2010 Nov 10 6:54 PM
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
2010 Nov 10 7:48 PM
But does it make any sense to run this in the background? It produces a worklist which must be processed (in the foreground).
Rob
2010 Nov 10 7:03 PM
Hi
But which is the program running in backgroud?
Your code submit a program, but ON LINE mode
Max
2010 Nov 10 7:05 PM
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
2010 Nov 10 7:06 PM
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
2010 Nov 10 7:21 PM
Hi
I think Rob is right: are your sure ls_vbap-vstel is always filled?
Max
2010 Nov 10 7:26 PM
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
2010 Nov 10 7:43 PM
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
2010 Nov 10 7:29 PM
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
2010 Nov 10 7:43 PM
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
2010 Nov 10 7:48 PM
But does it make any sense to run this in the background? It produces a worklist which must be processed (in the foreground).
Rob
2010 Nov 10 7:52 PM
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
2010 Nov 10 8:07 PM
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
2010 Nov 10 8:12 PM
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
2010 Nov 10 8:17 PM
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