Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

creating delivery from PO

Former Member
0 Kudos

I have tried two different function modules to create delivery from PO

BAPI_DELIVERYPROCESSING_EXEC

W_FRM_DELIVERY_CREATE_GENERAL

Both of them have the same problem. When I provide more than one line item they create more than one delivery. What could I be doing wrong.

  ls_request-document_type      = 'B'.
  ls_request-document_numb      = p_vbeln.
  ls_request-document_item      = 000010.
  ls_request-quantity_sales_uom = p_lfimg.
  ls_request-date_usage         = p_datvw.
  ls_request-date               = p_date.
  ls_request-time               = p_time.
 
  APPEND ls_request TO lt_request.
 
ls_request-document_type      = 'B'.
  ls_request-document_numb      = p_vbeln.
  ls_request-document_item      = 000020.
  ls_request-quantity_sales_uom = p_lfimg.
  ls_request-date_usage         = p_datvw.
  ls_request-date               = p_date.
  ls_request-time               = p_time.
 
  APPEND ls_request TO lt_request.
  CALL FUNCTION 'BAPI_DELIVERYPROCESSING_EXEC'
    TABLES
      request                 = lt_request.

Message was edited by:

Megan Flores

1 ACCEPTED SOLUTION

ferry_lianto
Active Contributor
0 Kudos

Hi,

I never had with two lines item ... can you add both quantities and create only one line? Just my two cents.

Regards,

Ferry Lianto

5 REPLIES 5

ferry_lianto
Active Contributor
0 Kudos

Hi,

Please try to add this lines.


  ls_request-document_type      = 'B'.
  ls_request-document_numb      = p_vbeln.
  ls_request-document_item      = 000010.
  ls_request-quantity_sales_uom = p_lfimg.
  ls_request-date_usage         = p_datvw.
  ls_request-date               = p_date.
  ls_request-time               = p_time.
  LS_REQUEST-ORDCOMBIND         = 'X'.          "Add here
 
  APPEND ls_request TO lt_request.
 
  ls_request-document_type      = 'B'.
  ls_request-document_numb      = p_vbeln.
  ls_request-document_item      = 000020.
  ls_request-quantity_sales_uom = p_lfimg.
  ls_request-date_usage         = p_datvw.
  ls_request-date               = p_date.
  ls_request-time               = p_time.
  LS_REQUEST-ORDCOMBIND         = 'X'.          "Add here

  APPEND ls_request TO lt_request.

  CALL FUNCTION 'BAPI_DELIVERYPROCESSING_EXEC'
    TABLES
      request                 = lt_request.

Regards,

Ferry Lianto

Former Member
0 Kudos

Well, from the documentation for this BAPI, both items had to be delivered in the same shipment. Were they?

Rob

Former Member
0 Kudos

Ferry

I executed the BAPI with the order comb indicator but it still returns me 2 deliveries instead of me. Were you able to get one delivery for more than one line item?

And yes all items in PO need to be delivered in same shipment

Message was edited by:

Megan Flores

ferry_lianto
Active Contributor
0 Kudos

Hi,

I never had with two lines item ... can you add both quantities and create only one line? Just my two cents.

Regards,

Ferry Lianto

Former Member
0 Kudos

They are different items / materials. How can I add the quantities. I also tried the other function module you recommended gn_delivery_create but that always gives out VBSK error, not sure why.

Message was edited by:

Megan Flores