A bug in bapi BAPI_OUTB_DELIVERY_CREATE_SLS (and its solution)?
Another blazing fast and short blog post of mine. It seems I have come across a bug in standard bapi BAPI_OUTB_DELIVERY_CREATE_SLS.
I was trying to use it to deliver completely a sales order, but I ran into an interesting issue.
This BAPI calls function module RV_DELIVERY_CREATE, but, alas, it calls it without a “selektionsdatum”, which seems to be what the “due_date” in the BAPI is for.
I’m not sure about this, but the fact is, if I populate this field (selektionsdatum) with the value from due_date, it works (for me… in the system I work with…).
So what I did was implement an implicit enhancement at the beginning of the BAPI, and I store the value of due_date in the attribute of a global class.
Then I created another implicit enhancement implementation at the beginning of RV_DELIVERY_CREATE and get the due_date into selektionsdatum.
There ya go.
If this is helpful, great. If it’s not, I’m sorry.
If I’m terribly mistaken about this, let me know.
EDIT: Andrea Olivieri mentioned below, in the comments, that if you populate the due_date and the ship_point, it might work. Or, at least, it worked for him. Check below for his example.
If you have a SAP account did you try to look in SAP note if there is anything on that FM ?
And maybe pull your problem trough a ticket. Maybe SAP will give you a better feedback and also do a sapnote on this one...
If you do it, be patient with them this kind of query go somethime trough a lot of people or cycle with you before having a good and final answer.
I do have an account and I have searched for an OSS note. No luck.
I'm not patient. I fixed it myself. If SAP wants to learn, they are free to read this blog post.
I agree - this just needs to be reported to SAP in a low priority incident. You might save tons of time and frustration for other customers.
As we usually say in Portugal, by all means, go ahead. The way is the same for you and me.
Wait, aren't you the one with a thread exclusively for bugs that SAP never cared about? I believe some people even mention having reported bugs and still being waiting for a bug fix.
I think I have better chances of saving "tons of time and frustration" sharing this on SCN.
But please, go ahead 🙂
My thread is not about the bugs but rather inconveniences and annoyances. This very much looks like a bug, so I'm confused why this can't be reported to SAP. Are you saying you have no access to open an incident? Or are just afraid of the Big Bad SAP Support? 🙂
I have access, but not the time nor patience.
In order to completely deliver a sales order you have to specify as due_date the maximum delivery date taken from the delivery due list index table ( aka VEPVG).
More or less is the same behaviour you'll have in transaction VL01N ,
Insert this select statement before your BAPI call
max( ledat )
into (lship_point, ldue_date)
where vbeln = pvbeln
and lifsp = space
group by vstel ledat.
* Synchronous RFC
CALL FUNCTION 'BAPI_OUTB_DELIVERY_CREATE_SLS'
* DESTINATION logsys
ship_point = lship_point
due_date = ldue_date
I've already used this trick 7-8 years ago 😉
Thanks a lot for that Andrea 🙂
I'll try it next time!! And I will edit the post.
I tried this but does not work.
Since neither yours nor Andrea Olivieri's solution worked, I debugged the BAPI and found an implicit enhancement spot at the end of subroutine likp_datum_ermitteln of Include SAPFV50C_LIKP_DATUM_ERMITTELN.
Instead of passing required Due Date via storing it in class attribute, I simply used standard internal table XVBEP[ ] to find the latest due date (EDATU) and set that in LIKP-LFDAT.
Hope this helps.