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

Issue during passing values when using SUBMIT statement...

Gurus,

I am using a submit statement to transfer the control to PROGRAM as follows:

SUBMIT ZTEST

WITH V_EVENT_BELNR EQ '5105608125'

WITH V_EVENT_GJAHR EQ '2008'.

Now, when I go in debug mode, I see that the values V_EVENT_BELNR and V_EVENT_GJAHR are empty as soon as the control gets transfered to the ZTEST program.

I did define the data for values to be paased same in function module and same in Program as follows:

DATA: v_event_belnr like RBKP-BELNR, "Invoice Document Number.

v_event_GJAHR like RBKP-GJAHR. "Fiscal year.

Please help, if I am doing something wrong since I want the values V_EVENT_BELNR and V_EVENT_GJHAR to be passed to Program from function module during submission.

Regards,

Rajesh.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 11, 2008 at 03:09 PM

    Since neither of these fields are on the selection screen of ZTEST, you should export them to memory from the submitting program and then import them into ZTEST.

    Rob

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 11, 2008 at 02:55 PM

    Hi,

    Try this

    SUBMIT ZTEST Via selection-Screen

    WITH V_EVENT_BELNR EQ '5105608125'

    WITH V_EVENT_GJAHR EQ '2008'

    and return.

    Please refer:

    http://help.sap.com/saphelp_nw04/helpdata/EN/9f/dba51a35c111d1829f0000e829fbfe/content.htm

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 11, 2008 at 02:59 PM

    Hi,

    You can only pass data to the selection screen of a program, thus you need to define the selection-screen in order to submit the report with the selection criteria.

    Therefore in your program ZTEST.

    Change this

    DATA: v_event_belnr like RBKP-BELNR, "Invoice Document Number.

    v_event_GJAHR like RBKP-GJAHR. "Fiscal year.

    to

    parameters BELNR like RBKP-BELNR, "Invoice Document Number.
                     GJAHR like RBKP-GJAHR. "Fiscal year.
    

    Alternatively, you can do a set parameters and in your Z program do a get parameter if you dont want to define a selection screen.

    For belnr, the parameter Id is RBN, so before submitting the program, SET the parameter id 'RBN' with the value using SET PARAMETER. And similarly GJR for the year.

    And in your program, ZTEST, you can use GET PARAMETER statement.

    regards,

    Advait

    Edited by: Advait Gode on Nov 11, 2008 3:59 PM

    Edited by: Advait Gode on Nov 11, 2008 4:04 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 11, 2008 at 03:00 PM

    Hi

    I can't believe the program ZTEST can have 2 parameter with a name like V_EVENT_BELNR or V_EVENT_GJAHR, because those name are longer than 8 char.

    So in ZTEST how have you defined V_EVENT_BELNR and V_EVENT_GJAHR?

    U should have something like this:

    REPORT ZTEST.
    
    PARAMETERS: P_belnr like RBKP-BELNR, "Invoice Document Number.
                P_GJAHR like RBKP-GJAHR. "Fiscal year.

    And so

    DATA: v_event_belnr like RBKP-BELNR, "Invoice Document Number.
          v_event_GJAHR like RBKP-GJAHR. "Fiscal year.
    
    SUBMIT ZTEST WITH P_BELNR = v_event_belnr
                 WITH P_GJAHR = v_event_gjahr and return.

    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.