Application Development 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: 

I want to display ALV Report after click on checkbox.

nandini_borse
Participant
0 Kudos

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 ?

1 ACCEPTED SOLUTION

mateuszadamus
Active Contributor
0 Kudos

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

6 REPLIES 6

mateuszadamus
Active Contributor
0 Kudos

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

Thanks, Issue resolve.

Abinathsiva
Active Contributor
0 Kudos

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


former_member1716
Active Contributor

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!

But i want both the radio buttons are inactive at first, and in radio button groups by default one radio button is active.

Sandra_Rossi
Active Contributor
0 Kudos

Asked again and again and again. Please search the forum.