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

Selection screen check boxes

Former Member
0 Likes
809

Hi All,

I have selection screen which should display the fields on clicking on the checkboxes. There are 7 checkboxes and I want to display fields for selection on selecting each of the check box. How do I go about doing this. Can anyone help. This is urgent.

Thanks & Regards,

Sowmya

5 REPLIES 5
Read only

Former Member
0 Likes
711

Take a look at the example of RADIO BUTTON.

Use the same logic for CHECK BOXES as well.

http://help.sap.com/saphelp_nw04/helpdata/en/79/34a23dd9b511d1950e0000e8353423/content.htm

Regards

Ravi

Note - Please mark all the helpful answers

Read only

Former Member
0 Likes
711

Hi Sowmya,

Just assign same Modif ID to all the fields which should be displayed on Clicking the Checkbox. Also assign the same Modif ID to the checbox itself.

Also make the fields invisible/visible in the AT SELECTION-SCREEN OUTPUT event.

Have a look at the following code:

PARAMETERS p_1 AS CHECKBOX DEFAULT 'X' MODIF ID umc. "Checbox 1

PARAMETERS p_2 AS CHECKBOX MODIF ID umd."Checkbox 2

PARAMETERS p_3 TYPE mara-matnr MODIF ID umc."Fields with Check box1

PARAMETERS p_4 TYPE mara-matkl MODIF ID umc."Fields with Check box1

PARAMETERS p_5 TYPE mseg-lifnr MODIF ID umd."Fields with Check box2

AT SELECTION-SCREEN OUTPUT.

CASE 'X'.

WHEN p_1.

LOOP AT SCREEN.

IF screen-group1 EQ 'UMD'.

screen-active = 0.

ENDIF.

ENDLOOP.

WHEN p_2.

LOOP AT SCREEN.

IF screen-group1 EQ 'UMC'.

screen-active = 0.

ENDIF.

ENDLOOP.

ENDCASE.

Regards,

Chetan.

PS:Reward points if this helps.

Read only

Former Member
0 Likes
711

Hi,

selection-screen begin of block b3 with frame.

parameter: ch_exe as checkbox default space user-command ch_exe.

select-options: so_iwerk for iflo-iwerk no-extension no intervals

obligatory modif id exe.

selection-screen end of block b3.

*Initially disable so_iwerk as mandatory

loop at screen.

if screen-name eq 'SO_IWERK-LOW'.

screen-required = 0.

modify screen.

endif.

endloop.

If check box is checked make so_iwerk as mandatory

if ch_exe eq 'X'.

loop at screen.

if screen-name eq 'SO_IWERK-LOW'.

screen-required = 1.

modify screen.

endif.

endloop.

endif.

You can enable or disable fields similarly using screen-input = 0 or 1 respectively.

Regards,

Raghavendra

Read only

Former Member
0 Likes
711

Hi

Maybe below example can give you some idea:

selection-screen begin of line.
  parameters: p_chk1 as checkbox user-command ABC.
  selection-screen comment 3(10) chk1 for field p_chk1.
  selection-screen position 20.
  parameters: p_text1(10) type c.
selection-screen end of line.

at selection-screen output.
  loop at screen.
     check screen-name = 'P_TEXT1'.
     if not p_chk1 is initial.
        screen-active = 1.
     else.
        screen-active = 0.
     endif.
     modify screen.
  endloop.

initialization.
  move 'First Text' to chk1.

Kind Regards

Eswar

Read only

Former Member
0 Likes
711

hi

good

try this

Executing User Commands (AT USER-COMMAND AND AT LINE-SELECTION)

AT USER-COMMAND event is used in interactive reporting. The code between the AT USER-COMMAND and the ENDAT command is executed when the user enters data into the OK code field(the upper-left entry field on the screen where you enter transactions). The data entered into the OK code field is stored in the system field SY-UCOMM.

Eg :

AT USER-COMMAND.

CASE SY-UCOMM.

WHEN 'DETAIL'.

SELECT * FROM BSEG WHERE BELNR = BKPF-BELNR.

.....

ENDCASE.

The AT LINE-SELECTION comand defines the code thats executed after a user double-clicks a line or presses the F2 function key.

Eg :

AT LINE-SELECTION.

SELECT * FROM BSEG WHERE GJAHR = BKPF-GJAHR.

thanks

mrutyun^