Application Development and Automation 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: 
Read only

ALV Grid Layout

Former Member
0 Likes
692

I am using ALV GRID DISPLAY function module to display my alv report.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

     EXPORTING

       I_CALLBACK_PROGRAM          = SY-REPID

       I_CALLBACK_TOP_OF_PAGE    = 'TOP_OF_PAGE'

       IS_LAYOUT                                = GS_LAYOUT1

       IT_FIELDCAT                             = IT_FCAT[]

*     IT_SORT                                    = S_SORT

       I_CALLBACK_USER_COMMAND  = 'SUB_USER_COMMAND'

       I_CALLBACK_PF_STATUS_SET 'PF_STATUS'

       I_DEFAULT                                   = 'X'

       I_SAVE                                          = 'A'

     TABLES

       T_OUTTAB                 = IT_FINAL[]

     EXCEPTIONS

       PROGRAM_ERROR            = 1

       OTHERS                   = 2


After displaying i have changed the layout and set as Default.


Then i am using usercommand and on click of that button i am displaying another alv report but due to the change of layout no colums are coming for second alv.


CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

         EXPORTING

           I_CALLBACK_PROGRAM       = SY-REPID

           I_CALLBACK_TOP_OF_PAGE   = 'TOP_OF_PAGE'

           IS_LAYOUT                = GS_LAYOUT

           IT_FIELDCAT              = IT_FCAT1[]

*         IT_SORT                  = S_SORT

*         I_CALLBACK_USER_COMMAND  = 'SUB_USER_COMMAND'

*         I_CALLBACK_PF_STATUS_SET = 'PF_STATUS'

           I_DEFAULT                = 'X'

           I_SAVE                   = 'A'

         TABLES

           T_OUTTAB                 = IT_ERROR[]

         EXCEPTIONS

           PROGRAM_ERROR            = 1

           OTHERS                   = 2.  


So what all i can do here so that the first layout wont affect the second alv report.


1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
629

Fill the parameter IS_VARIANT, fill REPORT field with SY-REPID and give two different values for HANDLE so the layout won't mess as they currently are.

NB: Also don't pass SY-REPID as a parameter but use a local variable to pass the value (else will be converted to function group main program.

Question: Why do you develop a new report with a nearly obsolete tool, better use a class as CL_SALV_TABLE (display of data) or CL_GUI_ALV_GRID (display or update of data) - or are you developing in an obsolete SAP version?

Regards,

Raymond

3 REPLIES 3
Read only

Former Member
0 Likes
629

hi yash,

did you check data in the internal table. is data available while you debug?

Read only

RaymondGiuseppi
Active Contributor
0 Likes
630

Fill the parameter IS_VARIANT, fill REPORT field with SY-REPID and give two different values for HANDLE so the layout won't mess as they currently are.

NB: Also don't pass SY-REPID as a parameter but use a local variable to pass the value (else will be converted to function group main program.

Question: Why do you develop a new report with a nearly obsolete tool, better use a class as CL_SALV_TABLE (display of data) or CL_GUI_ALV_GRID (display or update of data) - or are you developing in an obsolete SAP version?

Regards,

Raymond

Read only

Former Member
0 Likes
629

Thankyou Raymond Giuseppi .


Actually report was already developed i need to solve this issue, generally i prefer oops only to display.