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 back ground (urgent)

Former Member
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.

7 REPLIES 7

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Please try this.



report zrich_0001.

<b>tables: mara.

ranges: r_matnr for mara-matnr.</b>


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.
<b>  r_matnr-sign = 'I'.
  r_matnr-option = 'EQ'.
  r_matnr-low = wa_bom-component.
  append r_matnr.</b>

ENDLOOP.




SUBMIT sdv03v02
  <b>WITH S_MATNR  in r_matnr</b>
     EXPORTING LIST TO MEMORY
          AND RETURN.


Regards,

RIch Heilman

0 Kudos

Hi Rich,

as it earlier , it is working FOREGROUND , but not BACKGROUND.

Please help me.

balaji.

0 Kudos

SUBMIT sdv03v02...specify name of the report in the capital letters.

0 Kudos

It actually works perfectly fine for me in background, in my test program I am passing 100 materials from report1 to report2 via the SELECT-OPTION field.

Regards,

Rich Heilman

0 Kudos

Hi Rich,

It may be working your sample program . i have used different concept i got RESULT.

Thank you.

i am giving code here.

CALL FUNCTION 'JOB_OPEN'

EXPORTING

  • DELANFREP = ' '

  • JOBGROUP = ' '

jobname = NAME

  • SDLSTRTDT = NO_DATE

  • SDLSTRTTM = NO_TIME

IMPORTING

JOBCOUNT = NUMBER

EXCEPTIONS

CANT_CREATE_JOB = 1

INVALID_JOB_DATA = 2

JOBNAME_MISSING = 3

OTHERS = 4

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

*loop at i_rspar into wa_rspar.

SUBMIT sdv03v02

TO SAP-SPOOL

SPOOL PARAMETERS print_parameters

WITHOUT SPOOL DYNPRO

    • with S_MATNR = WA_RSPAR-LOW

  • with S_MATNR IN R_MATNR

WITH SELECTION-TABLE i_rspar

  • EXPORTING LIST TO MEMORY

AND RETURN

VIA JOB name NUMBER number.

CALL FUNCTION 'JOB_CLOSE'

EXPORTING

  • AT_OPMODE = ' '

  • AT_OPMODE_PERIODIC = ' '

  • CALENDAR_ID = ' '

  • EVENT_ID = ' '

  • EVENT_PARAM = ' '

  • EVENT_PERIODIC = ' '

jobcount = NUMBER

jobname = NAME

  • LASTSTRTDT = NO_DATE

  • LASTSTRTTM = NO_TIME

  • PRDDAYS = 0

  • PRDHOURS = 0

  • PRDMINS = 0

  • PRDMONTHS = 0

  • PRDWEEKS = 0

  • PREDJOB_CHECKSTAT = ' '

  • PRED_JOBCOUNT = ' '

  • PRED_JOBNAME = ' '

  • SDLSTRTDT = NO_DATE

  • SDLSTRTTM = NO_TIME

  • STARTDATE_RESTRICTION = BTC_PROCESS_ALWAYS

  • STRTIMMED = ' '

  • TARGETSYSTEM = ' '

  • START_ON_WORKDAY_NOT_BEFORE = SY-DATUM

  • START_ON_WORKDAY_NR = 0

  • WORKDAY_COUNT_DIRECTION = 0

  • RECIPIENT_OBJ =

  • TARGETSERVER = ' '

  • DONT_RELEASE = ' '

  • IMPORTING

  • JOB_WAS_RELEASED =

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.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

0 Kudos

<i>I have used different concept i got RESULT.</i>

So its working now? Please make sure to award points for any helpful answers in this post and the other related post and make to mark them as "Solved" by a poster or "Solved on my own" Thanks.

Regards,

Rich Heilman

0 Kudos

I don't think it has got anything to do with the number of materials. When you are running it in the foreground, some of the parameters(particularly checkboxes) are automatically filled in. But when you run the same in background, you will have to explicitly pass all of them.

Add, in your WITH option, all the selection screen values that you see defaulted when you run it in the foreground.