2013 May 20 5:24 PM
Hi,
I was trying to create delivery from a report using the BAPI BAPI_DELIVERYPROCESSING_EXEC.
I was wondering if it is possible to create a delivery from several preceding-documents (sales orders), having in mind that the shipment should be the same.
As stated here it looks like it can be done:
http://wiki.sdn.sap.com/wiki/display/ERPSCM/BAPI_DELIVERYPROCESSING_EXEC
At the time of running the BAPI it creates me two deliveries, one for each sales order. Have you ever tried to do so? Here is the relevant part of the code. wa_order contains the sales order structure obtained from an ALV.
LOOP AT it_order INTO wa_order WHERE mark = 'X'.
t_request-document_numb = wa_order-vbeln.
t_request-document_item = wa_order-posnr.
t_request-quantity_sales_uom = wa_order-kwmeng.
t_request-quantity_base__uom = wa_order-kwmeng.
t_request-id = 1.
t_request-document_type = 'A'.
t_request-delivery_date = sy-datum.
t_request-material = wa_order-matnr.
t_request-plant = wa_order-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 text-016.
ENDIF.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
Thanks,
Salva.
Hi,
I was trying to create delivery from a report using the BAPI BAPI_DELIVERYPROCESSING_EXEC.
I was wondering if it is possible to create a delivery from several preceding-documents (sales orders), having in mind that the shipment should be the same.
As stated here it looks like it can be done:
http://wiki.sdn.sap.com/wiki/display/ERPSCM/BAPI_DELIVERYPROCESSING_EXEC
At the time of running the BAPI it creates me two deliveries, one for each sales order. Have you ever tried to do so? Here is the relevant part of the code. wa_order contains the sales order structure obtained from an ALV.
LOOP AT it_order INTO wa_order WHERE mark = 'X'.
t_request-document_numb = wa_order-vbeln.
t_request-document_item = wa_order-posnr.
t_request-quantity_sales_uom = wa_order-kwmeng.
t_request-quantity_base__uom = wa_order-kwmeng.
t_request-id = 1.
t_request-document_type = 'A'.
t_request-delivery_date = sy-datum.
t_request-material = wa_order-matnr.
t_request-plant = wa_order-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 text-016.
ENDIF.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
Thanks,
Salva.
2013 May 20 7:39 PM
Hi Salvador,
did you have check the customizing ?
did you have check the difference between the two sales orders ? customer / plant / delivery date / ... everything that could split the delivery ?
Regards
Fred
2013 May 21 9:46 AM
NOTE: Already solved, I used BAPI BAPI_OUTB_DELIVERY_CREATE_SLS and worked fine the first time simply specifying sales order num and items_num.
Hi Fréderic,
I checked the little about I know about customizing on sales orders saw nothing. As far as I read the requirements for creating a delivery from two sales orders are that both have the same:
Ship-to-party
Delivery date
Shipping point
Incoterms
Route
I created two identical sales orders with different material and simulated the process correctly with transactions VL10A and VL10C, both worked fine.
There must be some missing/extra parameter (delivery date can't be current date, etc). I'll check the required fields since on the above transactions I simply select order positions and click on Background button.
Regards,
Salva.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |