2020 May 12 7:15 AM
I have created two checkbox. If user click on 1st checkbox, I want to display transaction for alv report. If i clicked on 2nd checkbox 2nd report should be display. What logic should i use ? and in which event, will i need to write ?
2020 May 12 7:23 AM
Hi nandini_borse
First of all create two checkboxes on the selection screen with USER-COMMAND option.
Then, for each command execute the desired report.
PARAMETERS: p_chka AS CHECKBOX DEFAULT '' USER-COMMAND rp1.
PARAMETERS: p_chkb AS CHECKBOX DEFAULT '' USER-COMMAND rp2.
AT SELECTION-SCREEN.
CASE sy-ucomm.
WHEN 'RP1'.
" execute report 1
WHEN 'RP2'.
" execute report 2
ENDCASE.
Hope this helps.
regards,
Mateusz
2020 May 12 7:23 AM
Hi nandini_borse
First of all create two checkboxes on the selection screen with USER-COMMAND option.
Then, for each command execute the desired report.
PARAMETERS: p_chka AS CHECKBOX DEFAULT '' USER-COMMAND rp1.
PARAMETERS: p_chkb AS CHECKBOX DEFAULT '' USER-COMMAND rp2.
AT SELECTION-SCREEN.
CASE sy-ucomm.
WHEN 'RP1'.
" execute report 1
WHEN 'RP2'.
" execute report 2
ENDCASE.
Hope this helps.
regards,
Mateusz
2020 May 12 8:15 AM
2020 May 12 7:29 AM
Hi,
Use code as given
PARAMETERS: cbox1 AS CHECKBOX.
PARAMETERS: cbox2 AS CHECKBOX.
If cbox1 = 'X'.
*Alv set of codes
elseif cbox2 = 'X'.
*Other requirement
Endif
2020 May 12 7:55 AM
nandini_borse,
Instead of check boxes, i would request you to consider radio Button. Because in case of check box user may have facility to select both the check boxes unless it is handled explicitly. In case of radio button you need not handle this explicitly as it will be already handled.
PARAMETERS: rb1 RADIOBUTTON GROUP qgrp USER-COMMAND flag DEFAULT 'X',
rb2 RADIOBUTTON GROUP qgrp.
AT SELECTION-SCREEN.
IF rb1 IS NOT INITIAL.
CALL TRANSACTION 'FIRST_REPORT T-CODE'.
ELSEIF rb2 IS NOT INITIAL.
CALL TRANSACTION 'SECOND_REPORT T-CODE'.
ENDIF.
Regards!
2020 May 12 8:20 AM
But i want both the radio buttons are inactive at first, and in radio button groups by default one radio button is active.
2020 May 12 8:41 AM