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: 

Delivery to Subcontracting Vendor in ME2O

Former Member
0 Kudos
736

Hi All,

I am working on a requirement where the Delivery needs to be created for the Purchase order in ME2O. Can someone help me out in this. I need the BAPI for doing this. It would be difficult to do with BDC. Please help

Thanks

Rashmi

4 REPLIES 4

Former Member
0 Kudos
89

Hi,

See th Business object BUS2012

u can see all bapis for Purchase order.

BAPI_PO_CREATE

BAPI_PO_CREATE1 to create purchase order.

Reward points if found helpful.....

Cheers,

Chandra Sekhar.

Former Member
0 Kudos
89

Hi ,

Do u mean , u need a BAPI fpr Creating delivery ?

revrt back,

regards,

Naveen

0 Kudos
89

Yes I need BAPI to create Delivery for PO.

The scenario is something like this.. PR is created & then with PR reference Purchase Order is being created. We have to deliver the stock to Subcontracting Vendor so we have to make a delivery in ME2O with PO reference

0 Kudos
89

Hi ,

Following is the sample code for creation of inbound delivery Using BAPI 'BAPI_DELIVERYPROCESSING_EXEC'

Which may be helpful.

PARAMETERS: p_vbeln LIKE ekko-ebeln.

DATA: BEGIN OF t_ekpo OCCURS 0,

ebeln LIKE ekpo-ebeln,

posnr LIKE ekpo-posnr,

kwmeng LIKE ekpo-kwmeng,

matnr LIKE ekpo-matnr,

werks LIKE ekpo-werks,

END OF t_ekpo.

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 ebeln posnr kwmeng matnr werks

INTO TABLE t_ekpo

FROM ekpo

WHERE ebeln = p_vbeln.

LOOP AT t_ekpo.

t_request-document_numb = t_ekpo-vbeln.

t_request-document_item = t_ekpo-posnr.

t_request-quantity_sales_uom = t_ekpo-kwmeng.

t_request-id = 1.

t_request-document_type = 'A'.

t_request-delivery_date = sy-datum.

t_request-material = t_ekpo-matnr.

t_request-plant = t_ekpo-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, ' created'.

Revrt back if any issues,

regards,

Naveen