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: 

Problem with SUBMIT in Background

Former Member
0 Kudos

Hi,

I want to pass a internal table data to 2nd program from 1st program. I am using SUBMIT 2nd program and i am getting results in foreground , i am not getting in back ground .

will you face this sort of problem ever.

Please help me .

Thanks in advance .

Balaji.

12 REPLIES 12

Former Member
0 Kudos

Balaji,

Look at the EXPORT and IMPORT commands. You can EXPORT a internal from Program 1 and IMPORT the same Program 2.

Regards,

Ravi

Note : Please mark the helpful answers

Former Member
0 Kudos

Here is a sample code for submit command.

If you want to run as a new background job.

call function job_open

submit <program name> to sap-spool keep in spool 'X'

without spool dynpro

user g_user

via job l_jobnm number l_count

with s_batid in r_batch

and return.

call function job_close.

in this case the internal table you want to pass to another program - create a select option in the program. Populate the same in this program using ur internal table and use submit command.

ferry_lianto
Active Contributor
0 Kudos

Hi Balaji,

Please check this sample code.

DATA: number TYPE tbtcjob-jobcount, 
      name TYPE tbtcjob-jobname VALUE 'JOB_TEST', 
      print_parameters TYPE pri_params. 

... 

CALL FUNCTION 'JOB_OPEN' 
  EXPORTING 
    jobname          = name 
  IMPORTING 
    jobcount         = number 
  EXCEPTIONS 
    cant_create_job  = 1 
    invalid_job_data = 2 
    jobname_missing  = 3 
    OTHERS           = 4. 
IF sy-subrc = 0. 
  SUBMIT submitable TO SAP-SPOOL 
                    SPOOL PARAMETERS print_parameters 
                    WITHOUT SPOOL DYNPRO 
                    VIA JOB name NUMBER number 
                    AND RETURN. 
  IF sy-subrc = 0. 
    CALL FUNCTION 'JOB_CLOSE' 
      EXPORTING 
        jobcount             = number 
        jobname              = name 
        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 
        OTHERS               = 8. 
    IF sy-subrc <> 0. 
      ... 
    ENDIF. 
  ENDIF. 
ENDIF.

Hope this will help.

Regards,

Ferry Lianto

former_member181962
Active Contributor
0 Kudos

Hi Balaji,

I think youa re using ranges or parameters to pass the internal table data to the second report.

In that case the parameters or select options in the second program must be declared as no -display.

REgards,

Ravi

LucianoBentiveg
Active Contributor
0 Kudos

try using adittion:

SUBMIT ... EXPORTING LIST TO MEMORY

0 Kudos

Can we see your code please?

Regards,

RIch Heilman

0 Kudos

Hi friends,

in this i want to pass S_MATNR field from i_rspar internal table.

LOOP AT i_bom INTO wa_bom.

wa_rspar-selname = C_MATNR. "'S_MATNR'.

wa_rspar-kind = c_s. "'S'.

wa_rspar-sign = c_i. "'I'.

wa_rspar-option = c_eq . "'EQ'.

wa_rspar-low = wa_bom-component.

APPEND wa_rspar TO i_rspar.

CLEAR : wa_bom,wa_rspar.

ENDLOOP.

SUBMIT sdv03v02

WITH SELECTION-TABLE i_rspar.

EXPORTING LIST TO MEMORY

AND RETURN.

in this one it is working fine in forground , it is not working in back ground. because of 52 records for MATNR FIELD.

have you face this sort of problem.

thanks in advance .

balaji.

0 Kudos

Hi Balaji,

This is because u must have declared s_matnr without using no-diplay addition.

YOu should declare s_matnr in the secong prog as,

select-options: s_matnr for mara-matnr no-display.

REgards,

Ravi

0 Kudos

Ravi,

S_MATNR is field in SAP Defined program (sdv03v02

) , how can we change it.

Balaji.

0 Kudos

Why don't you populate ranges with MAterial nos.

And then pass the same to submit statement.

submit sdv03v02 to sap-spool keep in spool 'X'

with s_matnr in r_matnr

and return.

Former Member
0 Kudos

Hi Balaji,

Use can use EXPORT statement in program1 and IMPORT statement in program2.

Make sure that the <b>internal table name</b> and <b>memoryid name</b> are identical in both statements.

oops... okai, here it goes

Basic form

<b>SUBMIT rep</b>.

Addition 6

...

<b>EXPORTING LIST TO MEMORY</b>

<b>Effect</b>

Does not display the output list of the called report, but saves it in SAP memory and leaves the called report immediately. Since the calling program can read the list from memory and process it further, you need to use the addition ... AND RETURN . Also, since the called report cannot be requested for printing, the addition ... TO SAP-SPOOL is not allowed here. You can read the saved list from SAP memory with the function module 'LIST_FROM_MEMORY' and then (for example) store it in the database with EXPORT . You can process this list further with the function modules 'WRITE_LIST' , 'DISPLAY_LIST' ... of the function group "SLST" .

Regards,

Raj

Message was edited by: Rajasekhar Dinavahi

Former Member
0 Kudos

Hello

I am trying to investigate on the rescheduling v_v2, SDV03V02, do any one know if this works with rescheduling every night for a great number of materials and saleordres, the DC have about 12 000 different materials.

I don’t know much about the transaction, but I would be happy to learn more about it, if you are using it I would like you to tell you about your experiences..

Best regards Elin