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: 

ALV output needed form already generated ALV ouput

Former Member
0 Kudos

Hi Guys,

I have report output in ALV List with check boxes.

I have created a Push button on the ALV with my own status.

My requirement is when I select any check box and click on that push button i need to get details of that selected check box.

Is it possible of using any ALV here.

I dont want to call screens from the Push Buttons.

Thanks,

Prasad.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi.

Do this way as follow

1. copy GUI status of standard ALV to ZMENU* and add some bottons that you want to in it

2. call it in your ALV program instead of standard one

3. append routine of event AT USER-COMMAND to your ALV and coding to detect your function code

on ZMENU* which is additional once not standard

(how to call routing you can find it in document of ALV function)

Hope it helps.

Sayan.

7 REPLIES 7

Former Member
0 Kudos

Hi.

Do this way as follow

1. copy GUI status of standard ALV to ZMENU* and add some bottons that you want to in it

2. call it in your ALV program instead of standard one

3. append routine of event AT USER-COMMAND to your ALV and coding to detect your function code

on ZMENU* which is additional once not standard

(how to call routing you can find it in document of ALV function)

Hope it helps.

Sayan.

Former Member
0 Kudos

Hi Dheeru,

It is possible to call ALV again. there is no need to write call screen.

Just do as following.

form zusercommand using r_ucomm like sy-ucomm
                                 r_field type slis_selfield.

case r_ucomm 
 
when 'PUSHBUTTON'.

perform build_fieldcat.

perform build_layout.

call function REUSE_ALV_GRID_DISPLAY.

endcase.
endform.

I355602
Advisor
Advisor
0 Kudos

Hi,

Yes you can do that.

Refer this code in wiki, its working:-

This code displays the data in ALV grid with checkboxes append to each record in grid display.

And when user selects certain checkboxes for the records and click a button, then the selected records are displayed into another ALV grid display.

https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/alv%252bgrid%252bdisplay%252bwith%252bch...

For your requirement you can use the code in the sub-routine USER_COMMAND when the value of sy-ucomm is EXECUTE. It is explained very clearly.

Hope this helps you.

Thanks & Regards,

Tarun Gambhir

Edited by: Tarun Gambhir on Feb 24, 2009 10:13 AM

Former Member
0 Kudos

Hi,

Develop the logic in Form User_command


FORM USER_COMMAND USING L_UCOMM LIKE SY-UCOMM
                            LS_SELFIELD TYPE SLIS_SELFIELD.

  CASE L_UCOMM.
    WHEN 'Cond'         
          READ TABLE Itab index ls_selfield-tabindex. " write cond from this statment

<develop as per ur requirment>

          PERFORM fieldcat_alv.
          PERFORM build_sort_alv.
          PERFORM display_alv.

Regards.

Former Member
0 Kudos

Hi Prasad,

Yes you dont need to call screens, you can simply call the Reuse ALV Display FMs and generate your required result.

The following piece of should be what you require:

FORM USER_COMMAND USING F_UCOMM LIKE SY-UCOMM.

  CASE F_UCOMM.
    WHEN '<func code>'.                        "function code you declared for your push button
      LOOP AT IT_ALL INTO WA_ALL.
        IF WA_ALL-CHKBOX = 'X'.
          APPEND WA_ALL TO IT_ALL_2.  " new internal table you need to declare to hold 
        ENDIF.                                          " the records you have selected.
        CLEAR WA_ALL.
      ENDLOOP.
      REFRESH IT_ALL.
      MOVE IT_ALL_2 TO IT_ALL.
      REFRESH IT_ALL_2.
      PERFORM ALV_DISPLAY.
      CLEAR F_UCOMM.
  ENDCASE.
ENDFORM.

N.B. Here the PERFORM ALV_DISPLAY calls the 'REUSE_ALV_LIST_DISPLAY' FM.

You call also write 'CALL REUSE_ALV_LIST_DISPLAY' there.

Former Member
0 Kudos

Hi Prasad,

You can find out the selected rows and displays those details in ALV popup screen using function module 'REUSE_ALV_POPUP_TO_SELECT'.

Let me if it fulfill your requirement?

Regards,

Anil

Former Member
0 Kudos

Thanks to one and all...........