Skip to Content
author's profile photo Former Member
Former Member

Global variable declaration

Hi all,

can u please tel me hoe to declare the variable globally in abap report so that i can use it in any of my include program in that report.

thanx....

Add comment
10|10000 characters needed characters exceeded

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 22, 2009 at 06:07 AM

    Make all Data Declarartions in TOP include.

    like

    REPORT  ZSDR_INV_INR.
    
    include ZSDR_Di_TOP.
    include ZSDR_DI_FORM.
    
    START-OF-SELECTION.
    
    PERFORM get_sales_data.
    perform get_delivery_data.
    perform process_data.
    perform refresh_tables.
    perform get_sales_data_ZIO2.
    perform get_delivery_data_ZIO2.
    perform process_data_ZIO2.
    *Perform Filter_Fieldcat.
    perform display_report_DI.
    

    Here make all ur data declarartions in ZSDR_Di_TOP .

    THEN U CAN USE ALL VARIABLES GLOBALLY.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 22, 2009 at 06:04 AM

    Hi

    Make declaration of the variable in TOP include , and it can be used across the entire report pgm in any include & FG too

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Its the SAP practice to SAPERATE out all the global declarations in a INCLUDE program, so that we get better clarity and understanding of the program.

      You can open any Function group of your choice and check in the TOP Include program of it.

      Example:

      Goto SE80->

      choose 'Function Group' in the list ->

      Type function group name as 'SLVC_FULLSCREEN' (This the function group name of 'Reuse_alv_grid_display' FM'). - >

      Check the main program of it.

      As a very first statement, it will have an include ' INCLUDE LSLVC_FULLSCREENTOP."

      Open it and see, it will contain only the declaration part for that Func group.

      regards,

      Padma