Application Development and Automation 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: 
Read only

Background processing.,

Former Member
0 Likes
785

Hi all.,

am using a SUBMIT query to run a second program  in background from first program.

  CALL FUNCTION 'JOB_OPEN'.

................

...............

SUBMIT PROG2

               WITH P_PAR1 = 'ABC' 

               WITH S_SE1 = 'XYZ'

               WITH P_RAD1 = 'X'

               USER SY-UNAME

                VIA JOB NAME NUMBER NUMBER AND RETURN.

CALL FUNCTION 'JOB_CLOSE'.

..................

..............

If i am not wrong, prog2 should run in background n return control to PROG1 without displaying the output of PROG2.

BUT in my program output of PROG2 is keep popping up.

where am i getting it wrong ??

regards,

madhu.

7 REPLIES 7
Read only

Former Member
0 Likes
760

Hi Madhu

Try this:

SUBMIT PROG2  WITH P_PAR1 = 'ABC'

               WITH S_SE1 = 'XYZ'

               WITH P_RAD1 = 'X'

           TO SAP-SPOOL

                 USER SY-UNAME

                VIA JOB NAME NUMBER NUMBER AND RETURN.

regards,

Archer

Read only

0 Likes
760

Hi Mr. Zhang,

TO SAP-SPOOL will not display the output but it triggers the  'Print Report Output' Dialogue box. How to avoid that ??

Thanks and Regards,

Madhu

Read only

0 Likes
760

Please 'F1' on 'submit', there are 'parameters' addition for this, you can control the dialogue display or not by this 'parameters'.

Or you can export output to abap memory, also in 'F1'.

regards,

Archer

Read only

Former Member
0 Likes
760

Should work as it is, can you also post code for Job_open call

Read only

0 Likes
760

CALL FUNCTION 'JOB_OPEN'

                 EXPORTING

                   JOBNAME          = NAME1

                 IMPORTING

                   JOBCOUNT         = NUMBER

                 EXCEPTIONS

                   CANT_CREATE_JOB  = 1

                   INVALID_JOB_DATA = 2

                   JOBNAME_MISSING  = 3

                   OTHERS           = 4.

               IF SY-SUBRC = 0.

                 SUBMIT ZPS_MATPLAN1

                 WITH P_VBUKR = 'ABC' 

                 WITH S_PSPID = 'XYZ'

                 WITH P_RAD1 = 'X'

                 USER SY-UNAME

     TO SAP-SPOOL

*    SPOOL PARAMETERS PRINT_PARAMETERS

*    WITHOUT SPOOL DYNPRO

                  VIA JOB NAME NUMBER NUMBER AND RETURN. "wa_CONS-CONS_WBS

*  EXPORTING LIST TO  MEMORY  AND RETURN.

                 IF SY-SUBRC = 0.

                   CALL FUNCTION 'JOB_CLOSE'

                     EXPORTING

                 JOBCOUNT             = NUMBER

                       JOBNAME              = NAME1

                       STRTIMMED            = '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.

                   IF SY-SUBRC <> 0.

                   ENDIF.

                 ENDIF.

               ENDIF.

Read only

0 Likes
760

SUBMIT ZPS_MATPLAN1

                 WITH P_VBUKR = 'ABC'

                 WITH S_PSPID = 'XYZ'

                 WITH P_RAD1 = 'X'

                 USER SY-UNAME

                  VIA JOB NAME1 NUMBER NUMBER AND RETURN. "wa_CONS-CONS_WBS


Job should be NAME1 as you are passing in JOB_OPEN, can u try n confirm back the results

Read only

0 Likes
760

My mistake, getting same result even after correction.