Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

about selection screen

Former Member
0 Likes
971

how to set mandatory field in selection screen while runtime?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
952

Hi Bindu,

Just copy and paste this program, Click p_set radio button on the selection screen.

You can see the parameter p_number is converted to the mandatory one.

parameters:

p_number TYPE i,

p_set RADIOBUTTON GROUP g1 USER-COMMAND us1,

p_unset RADIOBUTTOn GROUP g1 default 'X'.

data:

w_flag TYPE i.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SCREEN-NAME = 'P_NUMBER' AND w_flag = 1.

SCREEN-REQUIRED = 1.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

AT SELECTION-SCREEN.

IF p_set EQ 'X'.

w_flag = 1.

ENDIF.

Regards,

V.raghavender.

9 REPLIES 9
Read only

Former Member
0 Likes
952

Hi Bindu,

u will use Obligatory Key word along with ur parameter ,or select-option.

Thnaks & Regards'

Bhaskar Rao.M

Read only

Former Member
0 Likes
952

one option statically

parameters : p_matnr like mara-matnr [obligatory].

other way.

at selection-screen output.

loop at screen.

if screen-name = 'P_MATNR'.

screen-required = '1'.

modify screen.

endif.

endloop.

regards

shiba dutta

Read only

Former Member
0 Likes
952

Hi Bindu,

please find the code below for setting a selectio-screen field mandatory.

PARAMETERS:

pa_check TYPE c.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

CASE screen-name.

WHEN 'PA_CHECK'.

screen-required = '1'.

MODIFY SCREEN.

ENDCASE.

ENDLOOP.

Regards,

kishor.

Read only

ashok_kumar24
Contributor
0 Likes
952

Hi Bindu,

<b>Good Check the following example

TYPES: tt_selection TYPE STANDARD TABLE OF rsparams.

DATA: l_iblnr TYPE st_iblnr,

  • Define internal table and work area for select-options

l_selection TYPE rsparams,

li_selection TYPE tt_selection.

  • Create selectIon table

LOOP AT gi_iblnr INTO l_iblnr.

CLEAR l_selection.

l_selection-selname = 'IM_IBLNR'. "Option name

l_selection-kind = 'S'. "S= select options P=Parameters

l_selection-sign = 'I'. "Sign

l_selection-option = 'EQ'. "Option

l_selection-low = l_iblnr-iblnr. "Value

APPEND l_selection TO li_selection.

ENDLOOP.</b>

Good Luck and thanks

AK

Read only

former_member673464
Active Contributor
0 Likes
952

hi..

welcme to SDN

You change the progperties of screen in loop at screen.

Give a modif id to the field .

in loop at screen change the field property required to '1'.

LOOP AT SCREEN.

IF screen-group1 = 'MOD'.

IF flag = ' '.

screen-required = '0'.

ELSEIF flag = 'X'.

screen-required = '1'.

ENDIF.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

regards,

veeresh

Read only

Former Member
0 Likes
952

Hi,

use obligatory keyword

e.g.

select-options: s_matnr like for mara-matnr OBLIGATORY.

Read only

Former Member
0 Likes
953

Hi Bindu,

Just copy and paste this program, Click p_set radio button on the selection screen.

You can see the parameter p_number is converted to the mandatory one.

parameters:

p_number TYPE i,

p_set RADIOBUTTON GROUP g1 USER-COMMAND us1,

p_unset RADIOBUTTOn GROUP g1 default 'X'.

data:

w_flag TYPE i.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SCREEN-NAME = 'P_NUMBER' AND w_flag = 1.

SCREEN-REQUIRED = 1.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

AT SELECTION-SCREEN.

IF p_set EQ 'X'.

w_flag = 1.

ENDIF.

Regards,

V.raghavender.

Read only

0 Likes
952

ThankU.....

Read only

Former Member
0 Likes
952

hi,

selection-screen : begin of block blk1 with frame title text-001.

parameters : p_matnr like mara-matnr obligatory.

select-options : s_werks like marc-werks obligatory.

selection-screen: end of block blk1.

reward with points if helpful.