<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: BAPI_DELIVERYPROCESSING_EXEC in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-deliveryprocessing-exec/m-p/1861830#M363765</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a little program that to test out this BAPI. This program asks for a Sales Order Number and Line Item, then creates a Delivery for 1 unit referencing that Sales Order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TBL_REQUEST is a denormalised table holding the delivery data for each line item. This means that each record in this table contains both header and line item data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*--------------------------------------------------------
REPORT ypat_create_delivery LINE-SIZE 256.

*--------------------------------------------------------
* Internal Tables
*--------------------------------------------------------
* Table to Hold Delivery Request
DATA: BEGIN OF tbl_request OCCURS 0.
INCLUDE STRUCTURE bapideliciousrequest.
DATA: END OF tbl_request.

* Table to hold Line Items Created
DATA: BEGIN OF tbl_items OCCURS 0.
INCLUDE STRUCTURE bapideliciouscreateditems.
DATA: END OF tbl_items.

* Table to hold BAPI Return Messages
DATA: BEGIN OF tbl_return OCCURS 0.
INCLUDE STRUCTURE bapiret2.
DATA: END OF tbl_return.

*--------------------------------------------------------
* Structures
*--------------------------------------------------------
DATA: st_vbak LIKE vbak,
st_vbap LIKE vbap.

*--------------------------------------------------------
* Selection Screen
*--------------------------------------------------------
PARAMETERS: p_vbeln LIKE vbak-vbeln,
p_posnr LIKE vbap-posnr DEFAULT '000010'.

*--------------------------------------------------------
* Start of Selection
*--------------------------------------------------------
START-OF-SELECTION.

SELECT SINGLE *
INTO st_vbak
FROM vbak
WHERE vbeln = p_vbeln.

CHECK sy-subrc EQ 0.

SELECT SINGLE *
INTO st_vbap
FROM vbap
WHERE vbeln = p_vbeln AND
posnr = p_posnr.


*--------------------------------------------------------* End of Selection
*--------------------------------------------------------
END-OF-SELECTION.

IF st_vbak IS INITIAL.
WRITE:/ 'Invalid Sales Order'.
EXIT.
ENDIF.

tbl_request-document_numb = st_vbap-vbeln.
tbl_request-document_item = st_vbap-posnr.
tbl_request-ship_to = st_vbak-kunnr.
tbl_request-sold_to = st_vbak-kunnr.
tbl_request-sales_organisation = st_vbak-vkorg.
tbl_request-distribution_channel = st_vbak-vtweg.
tbl_request-division = st_vbak-spart.
tbl_request-plant = st_vbap-werks.
tbl_request-quantity_sales_uom = '1'.

tbl_request-sales_unit = st_vbap-vrkme.
tbl_request-base_uom = st_vbap-meins.
tbl_request-material = st_vbap-matnr.
tbl_request-delivery_date = st_vbak-bstdk.
tbl_request-delivery_time = '160000'.
tbl_request-transp_plan_date = st_vbak-bstdk.
tbl_request-loading_date = st_vbak-bstdk.
tbl_request-goods_issue_date = st_vbak-bstdk.

tbl_request-extdelv_no = '98765'.
tbl_request-document_type = 'A'. "Delivery
tbl_request-document_type_predecessor = 'A'. "Sales Ord

tbl_request-document_type_delivery = 'LF'.


APPEND tbl_request.

CALL FUNCTION 'BAPI_DELIVERYPROCESSING_EXEC'
TABLES
request = tbl_request
createditems = tbl_items
return = tbl_return.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

LOOP AT tbl_return.
WRITE:/ tbl_return-type, 
tbl_return-id, 
tbl_return-number,
tbl_return-message.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt; Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Jan 2007 12:31:38 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-01-25T12:31:38Z</dc:date>
    <item>
      <title>BAPI_DELIVERYPROCESSING_EXEC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-deliveryprocessing-exec/m-p/1861829#M363764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using this FM BAPI_DELIVERYPROCESSING_EXEC to create a outbound delivery. I'm trying to update the ROUTE field in LIKP(Delivery header table) and passing a ROUTE value to the BAPI. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when the delivery is created , the ROUTE field is blank.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone pls help me out on this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jan 2007 12:24:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-deliveryprocessing-exec/m-p/1861829#M363764</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-25T12:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_DELIVERYPROCESSING_EXEC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-deliveryprocessing-exec/m-p/1861830#M363765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a little program that to test out this BAPI. This program asks for a Sales Order Number and Line Item, then creates a Delivery for 1 unit referencing that Sales Order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TBL_REQUEST is a denormalised table holding the delivery data for each line item. This means that each record in this table contains both header and line item data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*--------------------------------------------------------
REPORT ypat_create_delivery LINE-SIZE 256.

*--------------------------------------------------------
* Internal Tables
*--------------------------------------------------------
* Table to Hold Delivery Request
DATA: BEGIN OF tbl_request OCCURS 0.
INCLUDE STRUCTURE bapideliciousrequest.
DATA: END OF tbl_request.

* Table to hold Line Items Created
DATA: BEGIN OF tbl_items OCCURS 0.
INCLUDE STRUCTURE bapideliciouscreateditems.
DATA: END OF tbl_items.

* Table to hold BAPI Return Messages
DATA: BEGIN OF tbl_return OCCURS 0.
INCLUDE STRUCTURE bapiret2.
DATA: END OF tbl_return.

*--------------------------------------------------------
* Structures
*--------------------------------------------------------
DATA: st_vbak LIKE vbak,
st_vbap LIKE vbap.

*--------------------------------------------------------
* Selection Screen
*--------------------------------------------------------
PARAMETERS: p_vbeln LIKE vbak-vbeln,
p_posnr LIKE vbap-posnr DEFAULT '000010'.

*--------------------------------------------------------
* Start of Selection
*--------------------------------------------------------
START-OF-SELECTION.

SELECT SINGLE *
INTO st_vbak
FROM vbak
WHERE vbeln = p_vbeln.

CHECK sy-subrc EQ 0.

SELECT SINGLE *
INTO st_vbap
FROM vbap
WHERE vbeln = p_vbeln AND
posnr = p_posnr.


*--------------------------------------------------------* End of Selection
*--------------------------------------------------------
END-OF-SELECTION.

IF st_vbak IS INITIAL.
WRITE:/ 'Invalid Sales Order'.
EXIT.
ENDIF.

tbl_request-document_numb = st_vbap-vbeln.
tbl_request-document_item = st_vbap-posnr.
tbl_request-ship_to = st_vbak-kunnr.
tbl_request-sold_to = st_vbak-kunnr.
tbl_request-sales_organisation = st_vbak-vkorg.
tbl_request-distribution_channel = st_vbak-vtweg.
tbl_request-division = st_vbak-spart.
tbl_request-plant = st_vbap-werks.
tbl_request-quantity_sales_uom = '1'.

tbl_request-sales_unit = st_vbap-vrkme.
tbl_request-base_uom = st_vbap-meins.
tbl_request-material = st_vbap-matnr.
tbl_request-delivery_date = st_vbak-bstdk.
tbl_request-delivery_time = '160000'.
tbl_request-transp_plan_date = st_vbak-bstdk.
tbl_request-loading_date = st_vbak-bstdk.
tbl_request-goods_issue_date = st_vbak-bstdk.

tbl_request-extdelv_no = '98765'.
tbl_request-document_type = 'A'. "Delivery
tbl_request-document_type_predecessor = 'A'. "Sales Ord

tbl_request-document_type_delivery = 'LF'.


APPEND tbl_request.

CALL FUNCTION 'BAPI_DELIVERYPROCESSING_EXEC'
TABLES
request = tbl_request
createditems = tbl_items
return = tbl_return.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

LOOP AT tbl_return.
WRITE:/ tbl_return-type, 
tbl_return-id, 
tbl_return-number,
tbl_return-message.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt; Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jan 2007 12:31:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-deliveryprocessing-exec/m-p/1861830#M363765</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-25T12:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_DELIVERYPROCESSING_EXEC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-deliveryprocessing-exec/m-p/1861831#M363766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks fo rth ereply&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Every thing works fine for this BAPI. Only ROUTE information doesn't get updated in the delivery.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jan 2007 12:40:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-deliveryprocessing-exec/m-p/1861831#M363766</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-25T12:40:57Z</dc:date>
    </item>
  </channel>
</rss>

