Skip to Content

How to pass Internal Table from method to Subroutine Pool

Hi Experts,

I have a requirement to pass internal table to Subroutine Pool.

I don't want to create a dictionary structure. That is why, I am using reference variable to communicate between method and Subroutine.

Inside Method

TYPES: BEGIN OF TY_DATA,

WORKFLOW_NAME TYPE STRING,

WORKFLOW_DESC TYPE STRING,

END OF TY_DATA.

DATA: LI_DATA TYPE TABLE OF TY_DATA,

LR_DATA TYPE REF TO DATA.

GET REFERENCE OF LI_DATA INTO LR_DATA.

PERFORM MAINTAINE_WORKFLOW_INFORMATION IN PROGRAM ZHR_R_WORKFLOW_ERROR_LOG CHANGING LR_DATA IF FOUND.

Inside Subroutine Pool

PROGRAM ZHR_R_WORKFLOW_ERROR_LOG.

TYPES: BEGIN OF TY_DATA,

WORKFLOW_NAME TYPE STRING,

WORKFLOW_DESC TYPE STRING,

END OF TY_DATA.

DATA: LI_DATA TYPE TABLE OF TY_DATA,

LI_DATA_TAB TYPE TABLE OF TY_DATA.

FORM MAINTAINE_WORKFLOW_INFORMATION TABLES LR_DATA LIKE LI_DATA_TAB.

APPEND INITIAL LINE TO LR_DATA.

READ TABLE LR_DATA ASSIGNING FIELD-SYMBOL(<LF_DATA>).

IF SY-SUBRC = 0.

<LF_DATA>-WORKFLOW_NAME = '90000060'.

<LF_DATA>-WORKFLOW_DESC = 'ABCD'.

ENDIF.

APPEND INITIAL LINE TO LR_DATA.

READ TABLE LR_DATA ASSIGNING <LF_DATA>.

IF SY-SUBRC = 0.

<LF_DATA>-WORKFLOW_NAME = '90000061'.

<LF_DATA>-WORKFLOW_DESC = 'EFGH'.

ENDIF.

ENDFORM.

When i am executing it, it is giving short dump.

Category: ABAP Programming Error

Runtime Errors: PERFORM_PARAMETER_MISSING

Except.: CX_SY_DYN_CALL_PARAM_MISSING

Please help on this.

Thanks in Advance,

Manoj

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 15, 2016 at 05:33 PM

    Hi

    You should have something like this:

    TYPES: BEGIN OF TY_DATA,

    WORKFLOW_NAME TYPE STRING,

    WORKFLOW_DESC TYPE STRING,

    END OF TY_DATA.

    DATA: LI_DATA TYPE TABLE OF TY_DATA,

    LR_DATA TYPE REF TO DATA.

    DATA: WI_DATA TYPE TY_DATA.

    START-OF-SELECTION.

    GET REFERENCE OF LI_DATA INTO LR_DATA.

    PERFORM MAINTAINE_WORKFLOW_INFORMATION USING LR_DATA.

    LOOP AT LI_DATA INTO WI_DATA.

    WRITE: / WI_DATA-WORKFLOW_NAME,

    WI_DATA-WORKFLOW_DESC.

    ENDLOOP.

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

    *& Form MAINTAINE_WORKFLOW_INFORMATION

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

    * text

    *----------------------------------------------------------------------*

    * -->LR_DATA text

    *----------------------------------------------------------------------*

    FORM MAINTAINE_WORKFLOW_INFORMATION USING LR_DATA TYPE REF TO DATA.

    FIELD-SYMBOLS: <FS_TAB> TYPE TABLE,

    <LF_DATA> TYPE TY_DATA.

    ASSIGN LR_DATA->* TO <FS_TAB>.

    APPEND INITIAL LINE TO <FS_TAB>.

    READ TABLE <FS_TAB> ASSIGNING <LF_DATA> INDEX 1.

    IF SY-SUBRC = 0.

    <LF_DATA>-WORKFLOW_NAME = '90000060'.

    <LF_DATA>-WORKFLOW_DESC = 'ABCD'.

    ENDIF.

    APPEND INITIAL LINE TO <FS_TAB>.

    READ TABLE <FS_TAB> ASSIGNING <LF_DATA> INDEX 2.

    IF SY-SUBRC = 0.

    <LF_DATA>-WORKFLOW_NAME = '90000061'.

    <LF_DATA>-WORKFLOW_DESC = 'EFGH'.

    ENDIF.

    ENDFORM. "MAINTAINE_WORKFLOW_INFORMATION

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 15, 2016 at 05:23 PM

    Hi

    You've defined a form with TABLE parameter, but you're calling the form transfering the data by CHANGE parameter

    Max

    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.