How to access an internal table of one program in another program



How to access an internal table of one program in another program.



Step 1. Declare a Data Type


DATAls_data TYPE REF TO data.

TYPES DATE_RANGE TYPE RANGE OF SY-DATUM.

Step 2. Declare Field Symbols.

FIELD-SYMBOLS<lt_data> TYPE table.

Step 3. Create a Ranges and selection parameter as per your Requirement


DATA(DATE) = VALUE DATE_RANGE(
  
SIGN 'I' OPTION 'BT' LOW '20180820' HIGH '20180820') ).

Step 4. The below code will restrict ALV to display.

cl_salv_bs_runtime_info
=>setEXPORTING display  abap_false
                                          metadata 
abap_false
                                          
data     abap_true ).

SUBMIT ZTEST_REPORT WITH S_DATE IN DATE
                                  
WITH P_VCOMP 'X' and RETURN..
TRY.
    
CLEAR gv_flag.
    cl_salv_bs_runtime_info
=>get_data_ref(
    
IMPORTING r_data ls_data ).
    
ASSIGN ls_data->TO <lt_data>.”The Result will show in this Field Symbol
    
IF <lt_data> IS ASSIGNED.
    " Do your working here

    
ENDIF.
  
CATCH cx_salv_bs_sc_runtime_info.
    
MESSAGE `Unable to retrieve ALV data` TYPE 'E'.
ENDTRY.



Result

Display is list of retrieved internal table data from program


Comments

Popular posts from this blog

Handle and show SQL Exception show in popup message box in SAP ABAP

How to use GUID in asp.net C# for unique ID?