Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Issue during passing values when using SUBMIT statement...

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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