02-23-2009 7:15 PM
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.
02-24-2009 2:57 AM
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.
02-24-2009 2:57 AM
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.
02-24-2009 4:38 AM
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.
02-24-2009 4:42 AM
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.
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
02-24-2009 5:01 AM
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.
02-24-2009 5:29 AM
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.
02-24-2009 5:37 AM
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
02-24-2009 10:40 AM