BAPI or FM to create outbound delivery from Sales order

Hello All,
My requirement is to create a outbound delivery from sales order. Also i need the batch number and texts to be updated in the delivery.
For this i need a single FM. The catch is that we don't have the batch number and texts in the sales order. That i have to take from some other delivery. I can get all the information .
The problem is that i can not find a FM through which i can create the delivery from the order and update the same.
I should not use two FM.
Could you please tell me some FM which does both in one go?
Thanks and Regards,
Rahul Sinha

Hi
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.
Regards,
Sreeram

Similar Messages

  • IDOC to create from outbound delivery from sales order as INBOUND process

    Hi Experts,
    We have third party interface for sales processing. Sales order, Outbound delivery and PGI will be done in Third party software and XML files will be send to SAP.
    We have to process this XML file into SAP with IDOC.
    Sales order processing is done but i am not able to find correct IDOC type for creating outbound delivery.
    Can you suggest Basic IDOC type / Message type and process code for the same.
    Regards,
    Sahadev Abhyankar

    Good morning !
    In the transaction WE20 to create the customer EDI  KU with EM function.
    Output parameter: message type DESADV and basic IDOC DESADV01.
    I associate the IDoc message type to LAVA, you should link it to the XML file, that is not how.
    Please : Could you please explain how you linked the XML file to IDOCS to create sales order ?
    Sorry for my poor English
    A greeting.

  • Is it possible to create outbound delivery for sales order with FM: GN_DEL*

    Hi all,
    Is it possible to create an outbound delivery for a sales order using the FM: GN_DELIVERY_CREATE. I am choosing this over a BAPI as I also needed to fill the bill of lading and inco terms.
    Thanks

    Hi Gurus, is there any function module / Bapi that updates the BOL in a outbound delivery  header created for a sales order

  • BAPI to create Delivery from Sales Order posting EIKP data

    Hi All,
    I'm searching for BAPIs to create a Delivery from Sales Order which I can update/insert data into EIKP table because I am receiving data that it must be saved into ZOLLA and ZOLLB fields (Customs Office: Office of Exit/Entry and Destination for Foreign Trade).
    I tried with BAPI_OUTB_DELIVERY_SAVEREPLICA, BAPI_OUTB_DELIVERY_CREATE_SLS and BAPI_DELIVERYPROCESSING_EXEC but I didn't find structures with these fields.
    Please, I need some help to resolve this issue.
    Thanks in advance.

    Hello Manoj what you have to do to create PO from PR is that
    1) Use   BAPISDORDER_GETDETAILEDLIST (pass sales order number in sales_document table) and then get PR (Purchase requisition number from this BAPI.
    2) Use  BAPI_REQUISITION_GETDETAIL to get PR items
    3) Use BAPI_PO_CREATE1 to craete PO from PR then.
    to create goods movement you can use
    BAPI_GOODSMVT_CREATE
    REWARDS IF USEFUL.

  • Create Billing Document from Sales Order (Without Delivery)

    Dear Experts,
    Pls note, presently we are creating Billing Document (VF01) from Outbound Delivery Number after Post Good Issue. All sales Document like Billing Document, Output Type, Invoice Type has been configured for this process and we are doing this without any error. Fyki, we have configured lots of Z Order, Billing & Delivery type to do this processes.
    But for one of this order type we need not do any delivery. We want to create Billing Documents from sales order directly (without doing any Outbound Delivery).
    So, would u pls advise the steps how can we configure and assign Order Type, Billing Type or any other type  to meet above requirement.
    Thanks in advance.
    Best Regards.
    Ripon

    Hi
    There are two most important configuration:-
    1) In VOV8 for your Order Type maintain the Order Related Billing Document
    2) Maintain the Copy control setting in VTFA betwwen your Order Type and billing Type.
    Also note that if your line item is not require to be delivered then for your Item category maintain (in VOV7) not relevant for delivery and not relevant for scedule line.
    Regards
    Amitesh Anand
    Edited by: Amitesh Anand on May 24, 2010 5:09 PM

  • Budget error while creating delivery from sales order

    hi Gurus,
    System is throwing error PB603 "Item 004 WBS element ABC-XXX budget exceeded" while creating delivery from sales order.
    I am picking material from unrestricted plant stock (not in project stock).
    I am also confused as sales order has 3 line items & error shows Item 004 !

    Hi Kuldeep,
    Check this note,
    Note 159387 - Message BP603: incorrect line item is displayed
    Its valid only till 4.6. Might give you some idea but.
    Regards,
    Gokul

  • Problems for creating a delivery from a order with less items

    hye, I have created a delivery from a sales order and all is ok. So, If I put less quantity in severals items, the delivery is generated ok and the sales order is OPEN status.
    Now , I want to generate a delivery from sales order, but I don´t want to include in my delivery all sales order's items. For example, if I have in my sales order four items (Itm1,Itm2,Itm3,Itm4) with theirs quantity, by SDK I want to generate the Delivery with Itm2 and Itm3 only. I can't do that. I hate It,jajajajajaja.
    With the next FOR, I get do it with all Items but I don´t know to say it that when status = 0 "jump" this item.
             delivery.CardCode = Order.CardCode
             delivery.DocDueDate = Order.DocDueDate
             delivery.DocDate = Order.DocDate
             For i = 0 To Order.Lines.Count - 1
                 delivery.Lines.BaseType = 17
                 delivery.Lines.BaseEntry = Order.DocEntry
                 Status = 1
                  If Status <> 0 Then
                       delivery.Lines.BaseLine = place
                       If i <> Order.Lines.Count - 1 Then
                          delivery.Lines.Add
                          place = place + 1
                       End If
                  End If
              Next
         retval = delivery.Add
    Thanks and I hope to get a solution.

    What is "it" that you cannot do (+ hate)???
    What is "status"? LineStatus???
    What is your problem when you try to skip an item?
    PS: You should always use enums instead of hard-coded values e.g.: Use the BoAPARDocumentTypes Enumeration for delivery.Lines.BaseType

  • FM:create a delivery for sales order in the background.

    Hi experts
    I want  Function Module to create a delivery for sales order in the background for both inbound and outbound.
    tcode : VL10A.
    Thanks in advance.
    kiran j

    Hi Kiran,
    Welcome to SDN Forums
    Please use the correct or most appropriate forum.
    The ABAP Objects Forum should be used for: ABAP Object definition and implementation including encapsulation, interfaces and inheritance in ABAP Objects.
    This thread will be moved from to .
    The forum is dedicated to: Data Transfer Techniques, Batch Data Communication, Legacy System Migration Workbench, Application Link Enabling, IDOCs, BAPIs.
    Please see the [Forum Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement] before posting.
    Also read this thread Welcome and Rules of Engagement.
    Greetings,
    Marcelo Ramos

  • Delivery from Sale Order for Inquiry stock

    Dear All,
    We have unique requirement from client mentioned below, any help would be greatly appreciated.
    This is a trading sale which is initiated from inquiry.
    1. Inquiry is created in SD, which in turn triggers Purchase Requisition.
    2. PR is converted to RFQ.
    3. Based on RFQ prices are negotiated with vendors, then Quotation is sent to Customer from VA21 which is created against inquiry.
    4. Now when the PO is created w.r.t RFQ, then GR is done , Stock will be lying against inquiry.
    5. But i want to do delivery from sales order for stock lying against inquiry.
    we are looking for a workaround solution.
    Note:
    1. Client has disagreed with Stock Movement from Inquiry to quotation using MB1B, as it becomes manual transaction.
    2. PR triggering has to be @ Inquiry, as sale order will not be created until quotation is approved.
    Looking forward for valuable inputs.
    Thanks in advance
    Best Regards,
    Chaithru

    Tien,
    Approval will not work when you have mutiple rows of data.  You would have to work with SP Transaction Notification
    There has been threads before on the forum on the same topics.
    Block the Quantity in Sales Delivery
    Approval Procedure for chaning quantity in Delivery Document
    Suda

  • Change in document type while creating billing document from sales order

    While creating billing document from Sales order it is creating with document type RV which is standerd one but i want to change Document type.
    How can i change it?
    Regards
    Raj

    Hi
    If you use another existing document type, check that it has a number range suitable to you.  Else create a new 'z' type and assign an entirely new number range, not used in the other doc types.
    It is useful to make the FI document number the same number.  If I understand from the forums, the FI number range must be external.  Search the forum for this.  It is very useful for the Finance people.
    Kind regards
    Dawn
    Edited by: Dawn Verrell on Sep 9, 2010 4:10 PM

  • Create outbound delivery from IDOC

    i want to create outboud delivery from incomming idoc..is DELVRY02 idoc type and shpcom message type will do this ..after crating the delivery i aslo need to do PGI..
    please tell me this idopc type and message type will do this or not?
    Thanks,

    Hi,
    I also have the same issue - I would like to be able to create an outbound delivery via IDOC/BAPI although cannot find the means to accomplish this.  Is there a standard process available to generate an outbound delivery without reference (VL01NO)?  I would like to avoid writing custom code if possible.
    Thanks!

  • Create Delivery from Sales Order Document

    Hello all,
    I have a business requirement to create deliveries from sales orders in the most effcient way possible.  Our current program uses BDC and calls transaction VL01N, however this has been found to dramatically increase the run-time of this program.  I have been searching for a BAPI to essentially do the same thing. 
      I came across one BAPI, BAPI_DELIVERYPROCESSING_EXEC, but have been getting inconsistent results.  It will create deliveries for some line items and not others with little rhyme or reason.  The return table is not being populated unless it is a high level error, such as the quantity passed being 0.
    To the BAPI, I am passing: Sales Doc Number, Line Item, Quantity, and Document Category.  This is done through an internal table.  I also pass internal tables to receive the return messages and the created documents. 
    Has anyone seen the same thing with this BAPI? Is there a better BAPI to use for such a purpose?
    many thanks for any help,
    brian

    Hi!
    For delivery creation you can use FM SHP_VL10_DELIVERY_CREATE:
        DATA:
          if_ledat TYPE lfdat_a,
          if_nur_vorgabe_pos TYPE xfeld,
          it_key_to_enque_t TYPE shp_vl10_package_t,
          it_key_to_enque LIKE LINE OF it_key_to_enque_t,
          it_komdlgn_t TYPE shp_komdlgn_t,
          cx_sd_order TYPE shp_vl10_sd_order,
          ct_vbsk_all_t TYPE shp_vbsk_t,
          ct_vbls_t TYPE shp_vbls_t,
          ct_key_late TYPE shp_vl10_package_t,
          ct_vorgabe_daten_t TYPE shp_vorgabe_daten_t,
          ct_vorgabe_daten LIKE LINE OF ct_vorgabe_daten_t,
          wa_dlvsrc LIKE LINE OF m_it_dlvsrc,
          msg TYPE string.
        LOOP AT m_it_dlvsrc
          INTO wa_dlvsrc.
          CLEAR it_key_to_enque.
          it_key_to_enque-panum = '1'.
          it_key_to_enque-vbobj = 'A'.
          it_key_to_enque-vbtyp = 'C'.
          it_key_to_enque-vbeln = wa_dlvsrc-vbeln.
          it_key_to_enque-posnr = wa_dlvsrc-posnr.
          it_key_to_enque-id = '1'.
          it_key_to_enque-tabix = '1'.
          it_key_to_enque-vstel = wa_dlvsrc-vstel.
          APPEND it_key_to_enque TO it_key_to_enque_t.
          CLEAR ct_vorgabe_daten.
          ct_vorgabe_daten-vgbel = it_key_to_enque-vbeln.
          ct_vorgabe_daten-vgpos = it_key_to_enque-posnr.
          ct_vorgabe_daten-lfimg = wa_dlvsrc-lfimg.
          ct_vorgabe_daten-akmng = 'B'.
          ct_vorgabe_daten-postab_tabix = it_key_to_enque-tabix.
          ct_vorgabe_daten-panum = it_key_to_enque-panum.
          ct_vorgabe_daten-id = it_key_to_enque-id.
          APPEND ct_vorgabe_daten TO ct_vorgabe_daten_t.
        ENDLOOP.
        if_ledat = sy-datum.
        if_nur_vorgabe_pos = 'X'.
        CALL FUNCTION 'SHP_VL10_DELIVERY_CREATE'
             EXPORTING
                  if_ledat           = if_ledat
                  if_nur_vorgabe_pos = if_nur_vorgabe_pos
                  it_key_to_enque    = it_key_to_enque_t
                  it_komdlgn         = it_komdlgn_t
             CHANGING
                  cx_sd_order        = cx_sd_order
                  ct_vbsk_all        = ct_vbsk_all_t
                  ct_vbls            = ct_vbls_t
                  ct_key_late        = ct_key_late
                  ct_vorgabe_daten   = ct_vorgabe_daten_t.
        COMMIT WORK AND WAIT.
    All created deliveries numbers:
    SELECT vbeln
          INTO TABLE m_it_vbeln
          FROM vbss
          FOR ALL ENTRIES IN ct_vbsk_all_t
          WHERE sammg = ct_vbsk_all_t-sammg.
    All errors during processing:
          SELECT msgid msgno msgv1 msgv2 msgv3 msgv4
            INTO TABLE it_msg
            FROM vbfs
          FOR ALL ENTRIES IN ct_vbsk_all_t
          WHERE sammg = ct_vbsk_all_t-sammg.
    Regards,
    Maxim.

  • Function Module to create AFS Outbound delivery for sales order

    Guys,
    I am looking for a function module to create deliveries for a sales order IN IS-AFS.
    I cannot make BAPI_DELIVERYPROCESSING_EXEC work. Also, if I use the IDOC type /AFS/DELVRY03 via message type WHSCON and function module IDOC_INPUT_DELVRY it doesn' work either.
    Does anyone know which function module I could use? I need to select specific AFS schedule lines though, but at this point I am not able to make any work.
    Thanks
    Leonardo

    This will not help .
    Edited by: Amit Khare on Aug 7, 2008 3:49 AM

  • Can we create service po from sales order

    HI
    can we create sales order from service po. if yes then how can we do so.

    Hi,
    we can create po from sales order in cross docking functionality.
    The steps are
    Sales order > Purcahse requistion > Purchase order > Inbound delivery with reference to purchase order and PGR > Outbound delivery with refernce to sales order and PGI > Invoice and billing.
    Br,
    Tushar Patankar

  • How to create a delivery for Sales Order

    Hi,
    I am in process of creating a delivery(T-Code: VL01N). for the Sales Order. in one of the Fields it is Asking for ORDER. i am not sure what details to pass here. as i already created a sales order any body tell me where can i get this ORDER details Thanks in Advance.
    Thanks
    Kiran.B

    Hi
    From the sales order screen itself you can create the delivery from the menu
    Sales order -> deliver/y
    or from VL01N , enter shipping point and Order number, create and save
    Reward points if useful
    Regards
    Anji

Maybe you are looking for