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: 

passing data to submit program

0 Kudos
2,274

hi ,

i am submiting a report via job.

Here i am using export/import to have data in the called program and its not working.

let me know if there are any other options how i can achieve the same.

export data... to memory data

call function job_open

submit called_report via job v_job and return

call function job close.

********************************************************

called_report:

import data from memory id.

here i am getting sy-subrc as 4. Am i doing some thing wrrong or suggest me some other ways.

regards,

Vidhyarthi

1 ACCEPTED SOLUTION

Former Member
0 Kudos
411

Is this a custom program?(which looks like it is)

What kind of data you are trying to pass?

If its a custom program and data that needs to be passed is fairly simple, you can try this:

1> in your custom program declare a screen field for the data you want to pass. If you want you can hide this screen field.

2> Use submit WITH SELECTION-TABLE rspar options

If data is huge then you may research the shared objects-- tcode SHMA. Or something as simple as a database table.

7 REPLIES 7

Former Member
0 Kudos
411

Here are the documents which you can use for the syntax

Export

http://www.s001.org/ABAP-Hlp/abapexport_data_cluster.htm

Import:-

http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/import01.htm

or

If you are transferring data with in session you can use 'import and export'. If it is in different sessions you should use 'set and get parameters'.

export & import are ABAP memory.

set & get parameters are SAP memory.

Former Member
0 Kudos
411

forget export/import....look at your ABAP help for SUBMIT.

0 Kudos
411

>

> forget export/import....look at your ABAP help for SUBMIT.

Hello,

Not sure what you want to imply, this works fine for me:

REPORT  ztest01.
DATA: v_name TYPE char20 VALUE 'Suhas Saha'.

EXPORT v_name TO MEMORY ID 'TEST_SDN'.

SUBMIT ztest02 AND RETURN.

REPORT  ztest02.
DATA: v_name TYPE char20.

IMPORT v_name FROM MEMORY ID 'TEST_SDN'.
IF sy-subrc = 0.
  WRITE: / v_name.
ENDIF.

BR,

Suhas

andreas_mann3
Active Contributor
0 Kudos
411

use a file for saving / loading your data or try sth like this:

write: ...

SUBMIT ZFBPET00 WITH BR_BUKRS IN BR_BUKRS

WITH CPUDATUM IN DATUM

EXPORTING LIST TO MEMORY

AND RETURN.

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

LISTOBJECT = LISTE

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2.

hope that helps

MarcinPciak
Active Contributor
0 Kudos
411

I think that although the issue looks pretty easy, the reason why that doesn't work is not straightforward. We need to consider memory organization here.

We all know that when submiting program the new internal session is opened (either placed atop a current internal session or replacing it). If we use ABAP memory, the data is stored in the memory which allows exchaning data b/w different internal sessions (within one external session).

Apparently submiting a program via job works similarly to CALL FUNCTION ... STARTING NEW TASK . In this case new external session is opened and paraller processing takes place there. In such case only SAP Memory can be used to exchange data. I might suspect that submiting via job only runs the program and then restore the control to orignial program. in separate session (paraller processing will take place only when submited with immediate execution). So maybe using SAP memory will help. Otherwise consider exchaning data using DB table or shared memory .

Note!

I would lie saying I am sure about this - I am only suspecting. Anyhow I think it is worth trying;)

Regards

Marcin

Edited by: Marcin Pciak on Sep 22, 2010 4:44 PM

Former Member
0 Kudos
412

Is this a custom program?(which looks like it is)

What kind of data you are trying to pass?

If its a custom program and data that needs to be passed is fairly simple, you can try this:

1> in your custom program declare a screen field for the data you want to pass. If you want you can hide this screen field.

2> Use submit WITH SELECTION-TABLE rspar options

If data is huge then you may research the shared objects-- tcode SHMA. Or something as simple as a database table.

0 Kudos
411

also see this