Skip to Content
author's profile photo Former Member
Former Member

Delivery from sales order

Hello.

Is there a BAPI or a FM that may create a delivery from a sales order?

Thank you

Nuno Silva

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2007 at 05:57 PM

    Hi,

    You can use the BAPI BAPI_DELIVERYPROCESSING_EXEC.

    Check this sample code..

    PARAMETERS: p_vbeln LIKE vbak-vbeln.

    DATA: BEGIN OF t_vbap OCCURS 0,

    vbeln LIKE vbap-vbeln,

    posnr LIKE vbap-posnr,

    kwmeng LIKE vbap-kwmeng,

    matnr LIKE vbap-matnr,

    werks LIKE vbap-werks,

    END OF t_vbap.

    DATA: t_request TYPE STANDARD TABLE OF bapideliciousrequest

    WITH HEADER LINE.

    DATA: t_created TYPE STANDARD TABLE OF bapideliciouscreateditems

    WITH HEADER LINE.

    DATA: t_return TYPE STANDARD TABLE OF bapiret2 WITH HEADER LINE.

    SELECT vbeln posnr kwmeng matnr werks

    INTO TABLE t_vbap

    FROM vbap

    WHERE vbeln = p_vbeln.

    LOOP AT t_vbap.

    t_request-document_numb = t_vbap-vbeln.

    t_request-document_item = t_vbap-posnr.

    t_request-quantity_sales_uom = t_vbap-kwmeng.

    t_request-id = 1.

    t_request-document_type = 'A'.

    t_request-delivery_date = sy-datum.

    t_request-material = t_vbap-matnr.

    t_request-plant = t_vbap-werks.

    t_request-date = sy-datum.

    t_request-goods_issue_date = sy-datum.

    t_request-goods_issue_time = sy-uzeit.

    APPEND t_request.

    ENDLOOP.

    CALL FUNCTION 'BAPI_DELIVERYPROCESSING_EXEC'

    TABLES

    request = t_request

    createditems = t_created

    return = t_return

    .

    READ TABLE t_return WITH KEY type = 'E'.

    IF sy-subrc = 0.

    MESSAGE e208(00) WITH 'Delivery creation error'.

    ENDIF.

    COMMIT WORK.

    READ TABLE t_created INDEX 1.

    Write: / 'Delivery ', t_created-document_numb.

    Thanks,

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2007 at 05:59 PM

    there is no BAPI or FM to create a delivery from sales order...U need to write SUBMIT VL04 in the exit MV45AFZZ and automatically the delivery gets created as soon as u save the order.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      If you are trying to create outbound deliveries, here is the fm I used in my project.

      W_FRM_DELIVERY_CREATE_GENERAL

      Fill the table T_DOCUMENTS. It just needs the sales order number, line item, required qty for delivery and unit of measure. Set DOC_CAT = 2 (for sales order).

      The output table T_VBLS will have the delivery number that was created.

      Please let me know if that works.

      Thanks,

      Jay Viswanathan.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.