Skip to Content

A bug in bapi BAPI_OUTB_DELIVERY_CREATE_SLS (and its solution)?

Hi community,

 

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.

 

Cheers,

Bruno

8 Comments
You must be Logged on to comment or reply to a post.
  • Hi Bruno,

    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.

    • Hi Mickaël,

      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.

      Cheers,

      Bruno

    • 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 🙂

      Cheers!

      Bruno

      • 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? 🙂

  • Hi Bruno,

    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

    select vstel

           max( ledat )

           into (lship_point, ldue_date)

           from vepvg

           where vbeln = pvbeln

           and lifsp = space

           group by vstel ledat.

    endselect.

    (…)

    * Synchronous RFC

    CALL FUNCTION ‘BAPI_OUTB_DELIVERY_CREATE_SLS’

    *   DESTINATION logsys

       EXPORTING

          ship_point              = lship_point

          due_date                = ldue_date

    (…)

    I’ve already used this trick 7-8 years ago 😉

    Best,
    Andrea