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: 

Submit to sap-spool

former_member775718
Discoverer
0 Kudos

Dear All,

I am trying to call a program'B' from program 'A'.

I will displaying both spool and joblog,using submit TO SAP-SPOOL and VIA JOB job .

but import is failed .

INITIALIZATION.

EXPORT GW_SUCEED TO MEMORY ID 'RE'.

EXPORT GW_DELNUM TO MEMORY ID 'NUM'.

START-OF-SELECTION.

CALL FUNCTION 'JOB_OPEN'

EXPORTING

JOBNAME = 'Y_TEST_01'

IMPORTING

JOBCOUNT = W_JOBCOUNT

EXCEPTIONS

CANT_CREATE_JOB = 1

INVALID_JOB_DATA = 2

JOBNAME_MISSING = 3

OTHERS = 4.

SUBMIT Y_TEST_01 AND RETURN

TO SAP-SPOOL

SPOOL PARAMETERS

WITHOUT SPOOL DYNPRO

VIA JOB 'Y_TEST_01'

NUMBER W_JOBCOUNT

WITH P_BUKRS = P_BUKRS .

CALL FUNCTION 'JOB_CLOSE'

EXPORTING

JOBCOUNT = W_JOBCOUNT

JOBNAME = 'Y_TEST_01'

S TRTIMMED = 'X'

EXCEPTIONS

CANT_START_IMMEDIATE = 1

INVALID_STARTDATE = 2

JOBNAME_MISSING = 3

JOB_CLOSE_FAILED = 4

JOB_NOSTEPS = 5

JOB_NOTEX = 6

LOCK_FAILED = 7

INVALID_TARGET = 8

OTHERS = 9.

IMPORT GW_SUCEED FROM MEMORY ID 'SUC'.

IMPORT GW_DELNUM FROM MEMORY ID 'DEL'.

regards

2 REPLIES 2

Former Member
0 Kudos

Hi

you have to assign tags to data ur exporting and then use same tag in addition to index while importing..

use F1 help and you will get the ans

example :


EXPORT F1    FROM F1 
       F2    FROM F2 
       ITAB3 FROM ITAB3 
       TO SHARED BUFFER INDX(ST) FROM WA_INDX ID INDXKEY. 

IMPORT F1 = F1 F2 = F2 ITAB3 = ITAB3 
       FROM SHARED BUFFER INDX(ST) ID INDXKEY TO INDX_WA.

regards

vivek

0 Kudos

Sorry it's still failed.

But The "TO SAP-SPOOL "and "VIA JOB" is comment,

then import is successful.

SUBMIT Y_TEST_01 AND RETURN

*TO SAP-SPOOL

*SPOOL PARAMETERS

*WITHOUT SPOOL DYNPRO

*VIA JOB 'Y_TEST_01'

*NUMBER W_JOBCOUNT

WITH P_BUKRS = P_BUKRS .