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 Code not working in Background processing

Former Member
0 Kudos
358

Hi All,

I have a requirement to create delieveries based on the Sales Order through transaction VL04 (RV50SBT1). Essentially, the program takes selected sales orders, determines the shipping point and creates deliveries immediately. I believe that the code below is correct as it works when my program is run in the foreground; however, when I run my program in background, SM37 gives an error "Fill in all required entry fields." The only mandatory field in VL04 is the Shipping Point (VSTEL) which is being successfully populated.

SUBMIT rv50sbt1 AND RETURN

WITH vstel = ls_vbap-vstel

WITH s_ledat BETWEEN '20091231' AND '99991231'

WITH samml = 'X'

WITH anzei = ' '.

Similar code to this is working in other custom developments that I have done; however, those programs only submit to programs without mandatory fields. Am I doing something wrong? Is it not possible to use the Submit command if a field is mandatory in the program you are submitting to? Any help you can give would be greatly appreciated. Thanks.

John

1 ACCEPTED SOLUTION

Former Member
0 Kudos
229

But does it make any sense to run this in the background? It produces a worklist which must be processed (in the foreground).

Rob

13 REPLIES 13

Former Member
0 Kudos
229

Hi

But which is the program running in backgroud?

Your code submit a program, but ON LINE mode

Max

Former Member
0 Kudos
229

There is no issue with SUBMIT with a program with obligatory parameters. I tried your code and it works OK. I would question though whether ls_vbap-vstel is in fact, completed.

In foreground processing it may be picking up a PID.

Rob

Former Member
0 Kudos
229

Hi Max,

Let me clarify. My custom program is the program running in Background. Within my custom program, it selects sales order data and then uses the Submit command for VL04. Does this clarify it?

John

0 Kudos
229

Hi

I think Rob is right: are your sure ls_vbap-vstel is always filled?

Max

0 Kudos
229

Hi Guys,

Yes, I am certain VSTEL is populated. I created a very simple program to ensure that the values would be there and it still didn't work in background. In this case, I pass one sales order that I know has a shipping point (in my case the VSTEL is populated with US01) via a parameter. In debugging, I found that the value is correctly passed.

Here is the test program I created.

data: ls_vbap type vbap.

PARAMETERS: pa_vbeln TYPE vbeln.

SELECT SINGLE * INTO ls_vbap FROM vbap

WHERE vbeln = pa_vbeln.

SUBMIT rv50sbt1 AND RETURN

WITH vstel = ls_vbap-vstel

WITH s_ledat BETWEEN '20091231' AND '99991231'

WITH samml = 'X'

WITH anzei = ' '.

John

0 Kudos
229

Since you aren't checking the return code after the SELECT, I wouldn't rely on the test program to heavily.

However, I do still see the problem.

Rob

Former Member
0 Kudos
229

Hmmm....

Actually, when I said that I tried it and it worked, I had tried it in the foreground.

But when I tried it in the background, I got your error.

Let me think on it.

Rob

0 Kudos
229

Hi

Something is strange, I've tried this code

SUBMIT rv50sbt1 AND RETURN

WITH vstel = 'XXXX'

WITH s_ledat BETWEEN '20091231' AND '99991231'

WITH samml = 'X'

WITH anzei = ' '.

And the job finish in error, just as John's saying

Max

Former Member
0 Kudos
230

But does it make any sense to run this in the background? It produces a worklist which must be processed (in the foreground).

Rob

0 Kudos
229

Hi Rob,

I believe that it does make sense. If you look at the flow control section of the selection screen on VL04, you can process immediately (SAMML = 'X') which will just create the deliveries automatically. Thanks.

John

0 Kudos
229

Aha

[Note 213980 - Job processing VL04 terminates: Check req. fields|https://websmp206.sap-ag.de/~form/handler?_APP=01100107900000000342&_EVENT=REDIR&_NNUM=213980&_NLANG=E]!

Rob

Edited by: Rob Burbank on Nov 10, 2010 3:10 PM

0 Kudos
229

Hi Rob

You're a bolt, it's just the note I'm reading now: it's an old note, but the issue is just that

It should use VL10 instead of VL04

Max

Edited by: max bianchi on Nov 10, 2010 9:12 PM

0 Kudos
229

Hi Rob and Max,

Thanks for your help. My basis team and I just narrowed it down to the VL04 program. I will use VL10 instead. thanks.

John