Skip to Content

Runtime values of internal table

Hi,

Is it possible to get the runtime value of all the internal tables used in a program ?


Let the parent program is ZPGM_PARENT . From this parent program, we are calling the child program ZPGM_CHILD using SUBMIT and RETURN statement. Is there any function module which will return the internal tables used in ZPGM_CHILD with its runtime values ?

Thanks,

Rohith

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Posted on Jan 11, 2016 at 12:47 PM

    I think you will need to adjust the program ZPGM_CHILD with statements to export the internal tables and the program ZPGM_Parent then can read these exported tables with import statement.s

    Without adjusting the programs I don't think it is possible

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2016 at 12:52 PM

    Hi Rohith,

    Am i correct in my interpretation of your question that you want to get a result set (in this case a ITAB) from the child program once the child program has finished running?

    If so i would recommend using the EXPORT and IMPORT methods as well as the SET and GET PARAMETER statements in both programs. This is how i have done it in pricing procedures before when passing tax information between different tax routines.

    Here is a page that goes more into what i'm referring to Passing Data Between Programs - ABAP Programming (BC-ABA) - SAP Library

    Hope this helps,

    Geoffery

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 11, 2016 at 01:06 PM

    As already written, the called program must save its data in memory or a persistent cluster of data if you want caller to get this information. Read documentation of EXPORT/IMPORT statement and online documentation on SAP Memory.

    Hint: Some tools, as ALV, also have this option integrated (perform some search on class cl_salv_bs_runtime_info)

    Regards,

    Raymond

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Rohith Mohan

      I don't think it matters. You just have to ensure that all of the programs have the COMMON PART. I don't think all of the COMMON PARTs have to be the same either.

      I don't know of any way to do directly what you are trying to do.

      Rob

  • Posted on Jan 11, 2016 at 05:01 PM

    I think you can solve this program by organizing your code to place all iTabs in program ZPGM_PARENT, writing program ZPGM_CHILD to modify these iTabs thru references, and then using PERFORM to call the child program.

    Debug the following programs. SUBMIT does not work, but PERFORM works fine.

    REPORT zpgm_parent.

    LOAD-OF-PROGRAM.

    DATA: t_list TYPE stringtab.

    FIELD-SYMBOLS: <s> TYPE string.

    START-OF-SELECTION.

    SUBMIT zpgm_child AND RETURN.

    PERFORM fill_itab IN PROGRAM zpgm_child IF FOUND.

    END-OF-SELECTION.

    LOOP AT t_list ASSIGNING <s>.

    WRITE: /01 <s>.

    ENDLOOP.

    *"

    REPORT zpgm_child.

    LOAD-OF-PROGRAM.

    DATA: ref TYPE string.

    FIELD-SYMBOLS: <t_list> TYPE stringtab.

    FIELD-SYMBOLS: <s> TYPE string.

    ref = |(ZPGM_PARENT)T_LIST[]|.

    ASSIGN (ref) TO <t_list>.

    *&---------------------------------------------------------------------*

    *& Form fill_itab

    *&---------------------------------------------------------------------*

    FORM fill_itab.

    CHECK: <t_list> IS ASSIGNED.

    APPEND INITIAL LINE TO <t_list> ASSIGNING <s>.

    <s> = |Hello World|.

    UNASSIGN: <s>.

    ENDFORM. "fill_itab

    START-OF-SELECTION.

    PERFORM fill_itab.

    *"

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 11, 2016 at 05:11 PM

    Is there any function module which will accept the program name and variant name and returns all the run time variables with run time data ?

    Add a comment
    10|10000 characters needed characters exceeded

    • And if a function module would exist, which runtime data you want to fetch ? The data just after the start of the programm, the data after your first select, or if there are more select statements the data after the second select? The data after the child programm has deleted some stuff or after it has manipulated the data in any other way ?

      Basically, in which moment in time of execution you want to know the runtime data, halfway the loop ?

      This is, to my opinion, a very silly request.

  • Posted on Jan 12, 2016 at 10:47 AM

    Hi Rohit,

    This way seems to work.

    Have a custom DDIC table which stores the data in the internal tables of child program. Once the program returned to parent program fetch the data from the custom DDIC table.

    Before the parent program ends clear all the data in the Custom table.

    Insert Delete statements would help in this.

    This could help you instead on export and import.

    Regards,

    Veera

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.