2009 Nov 19 6:31 PM
Hi,
How do I check the values contained in an ALV grid dynamically? In this case the number of lines is variable.
Best Regards.
Diovani.
Hi,
How do I check the values contained in an ALV grid dynamically? In this case the number of lines is variable.
Best Regards.
Diovani.
2009 Nov 19 6:36 PM
2009 Nov 19 6:40 PM
I want to create check point with the values contained in an alv grid in a report, did you get?
2009 Nov 19 6:45 PM
How have u created the GRID, by fm or OOA?
Max
2009 Nov 19 6:49 PM
2009 Nov 19 6:55 PM
Hi
So u can check the table in the user_command routine after the user has pressed a but of status:
how to check depends on what u need to do.
Anyway u can check the records by LOOP statament
Max
2009 Nov 19 7:04 PM
OK, but how is this done? What commands should I use?
Best Regards.
Diovani.
2009 Nov 19 7:21 PM
Hi
U should call your grid about in this way:
V_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID
* I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = ' USER_COMMAND'
....................................................................................................
TABLES
T_OUTTAB = ITAB.USER_COMMD is a form like this:
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
ENDFORM.R_UCOMM has the value of OK-CODE, in this FORM u can place all code u need to check your table.
If you use the standard status, u can indicate which OK-CODE has to call your user_command routine in the exporting parameter IT_EVENT_EXIT.
It has the following fields:
- ucomm: OK-CODE
- before: 'X' = The application gets control before the ALV executes the function.
- after: 'X' = The application gets control after the ALV has executed the function, but before the list is output.
So your code could be:
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE R_UCOMM.
WHEN <......>.
LOOP AT ITAB. " Here u can LOOP itab
ENDLOOP.
WHEN <......>.
READ ITAB INDEX RS_SELFIED-TABINDEX. "Here u can READ itab
WHEN <......>.
ENDACASE.
ENDFORM.If you use IT_EVENT_EXIT, rs_selfield returns the value of flag BEFORE and AFTER
Max
2009 Nov 20 9:33 AM
Sorry Friend,
I think I was not so clear.
But I want to make check points from an ALV GRID result with ecatt . I am not creating an ALV GRID.
Regards.
Diovani.
2009 Nov 24 9:06 AM
Hi,
I hope you are using SAPGUI to record and replay. In the interface you will have to check for the command line where you have selected the data record in the ALV.
Steps
Split the SAPGUI recoding on a dialogue level, ( CHEGUI to be implemented to check the field element content / check mechanism to be implemented by coding )
Make the record selection dynamic by replacing the row index with a loop counter, enclose the corresponding SAPGUI + CHEGUI or SAPGUI + check coding withing a loop.
Please ensure that only relevant part of the SAPGUI commands ( recording ) is put within the loop. The rest should be kept out.
Hope this gives you an idea to proceed.
Regards,
Sachin
2009 Nov 24 10:08 AM
Thank you Sachin,
Its work fine.
Regards.
Diovani.