Skip to Content
avatar image
Former Member

Getting sales order number against Delivery Number

Is there anyway i can get the sale document no against the delivery no. in a single select statement.

thanks

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Jun 25, 2008 at 06:54 AM

    Hi Syed,

    Can use LIPS-VGBEL (sales order), based on LIPS-VBELN (delivery number).

    BR,

    Victor.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Syed,

      As mentioned by Jaya you also can use VBFA table (document flow), but still it will have POSNR (item no) in the table.

      Why SAP provide POSNR, it's because there is a possibility to create delivery from more than 1 sales order.

      As far that i know there's no direct function just by enter the delivery number and return the sales order number, but you can make your own zfunction to cater this based on the logic that you prefer.

      Thanks,

      Victor.

  • avatar image
    Former Member
    Jun 25, 2008 at 07:00 AM

    Hi,

    Use table VBFA. for sales document flow.

    Regards,

    Jaya Vani

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 25, 2008 at 08:02 AM

    Hi seyed

    Hope below piece of code will help you.

    Reward points if helpful.

    Regards,

    Mohamed Aboobacker Siddique

    *************

    SELECT VBELV AS SONUM VBELN AS DONUM FROM VBFA

    WHERE VBTYP_N = 'J' " Document category of subsequent document ('J' is delivery)

    AND VBTYP_V IN ('I','C') . " Document category of preceding SD document ('C' is Order,'I' isOrder w/o ch)

    Add comment
    10|10000 characters needed characters exceeded