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: 

Code to write syntax for JOB submit ( Please answer ASAP)

Former Member
0 Kudos

Hi,

I need sytax to submit a job

Right now I am using this code to send 4 parameters.

I need to send these 4 in a structure.

submit Ztestjob USER sy-uname

via job p_jobnm

number p_jobcount

with afko-rsnum eq afko-rsnum

with aufnr_d eq aufnr_d

with sernr_d eq sernr_d

with p_lmnga eq p_lmnga

AND RETURN.

So I have to pass a structure of values into the BGprogram through a submit and do a couple of loops in the BGPROGRAM.

I need the syntax for submit .

I also need to know how to catch the structure with values in the BGPROGRAM.

Anyone please answer ASAP

Message was edited by:

ramana peddu

Message was edited by:

ramana peddu

1 ACCEPTED SOLUTION

ferry_lianto
Active Contributor
0 Kudos

Hi,

Please try this.


Call Program:
DATA: WA_MARA LIKE MARA. 

*Export structure values 
EXPORT WA_MARA TO MEMORY ID 'ZMARA'.

...

submit ZRAJJOBSUB USER sy-uname
via job p_jobnm
number p_jobcount
with afko-rsnum eq afko-rsnum
with aufnr_d eq aufnr_d
with sernr_d eq sernr_d
with p_lmnga eq p_lmnga
AND RETURN.

....


Submit Program:
DATA: WA_MARA LIKE MARA. 

*Import structure values
IMPORT WA_MARA FROM MEMORY ID 'ZMARA'.

...

FREE MEMORY ID 'ZMARA'.

Regards,

Ferry Lianto

4 REPLIES 4

ferry_lianto
Active Contributor
0 Kudos

Hi,

Please try to use EXPORT TO MEMORY and IMPORT FROM MEMORY statements to pass the data structure from call program to submit program.

For more information, please check this link.

http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3bc4358411d1829f0000e829fbfe/content.htm

Regards,

Ferry Lianto

Former Member
0 Kudos

Hi,

<u>SUBMIT</u>

Calls an executable program of type 1.

Syntax

SUBMIT <rep> [AND RETURN] [VIA SELECTION-SCREEN]

[USING SELECTION-SET <var>]

[WITH <sel> <criterion>]

[WITH FREE SELECTIONS <freesel>]

[WITH SELECTION-TABLE <rspar>]

[LINE-SIZE <width>]

[LINE-COUNT <length>].

Calls the program <rep>. If you omit the AND RETURN addition, the current program is terminated. Otherwise, the data from the current program is retained, and processing returns to the calling program when <rep> has finished running. The other additions control the selection screen and set attributes of the default list in the called program.

Regards,

Bhaskar

0 Kudos

Please tell me which is the one I need to select for structure.

ferry_lianto
Active Contributor
0 Kudos

Hi,

Please try this.


Call Program:
DATA: WA_MARA LIKE MARA. 

*Export structure values 
EXPORT WA_MARA TO MEMORY ID 'ZMARA'.

...

submit ZRAJJOBSUB USER sy-uname
via job p_jobnm
number p_jobcount
with afko-rsnum eq afko-rsnum
with aufnr_d eq aufnr_d
with sernr_d eq sernr_d
with p_lmnga eq p_lmnga
AND RETURN.

....


Submit Program:
DATA: WA_MARA LIKE MARA. 

*Import structure values
IMPORT WA_MARA FROM MEMORY ID 'ZMARA'.

...

FREE MEMORY ID 'ZMARA'.

Regards,

Ferry Lianto