Skip to Content
avatar image
Former Member

Submit to sap-spool

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Sep 02, 2008 at 06:28 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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 .