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: 

BAPI FM for stock trnsfer order

Former Member
0 Kudos

Hi Experts,

can anybody tell me BAPI fm for stock transfer order

Thanks in advance..

Narendra

6 REPLIES 6

Former Member
0 Kudos

Hi Narendra,

Check this thread:

Regards,

Chandra Sekhar

bpawanchand
Active Contributor
0 Kudos

hi

Check this function module it might help you

ME_CHECK_RESWK_STOCK_TRANSFER

further check this links

Regards

Pavan

former_member188685
Active Contributor
0 Kudos

STO is also a one of the Purchase Order type. But it is for Plant to plant.

So you can the same BAPI for Creating the STO.

BAPI_PO_CREATE1  "<---Preferred
BAPI_PO_CREATE

0 Kudos

Hi Vijay,

Thanks for giving answer.

Can u please give me the code for Stock transfer order

using bapi po create.

Thanks in advance

narendra

0 Kudos

Hi,

Check this link for sample code of bapi Bapi_po_create1-

http://abapreports.blogspot.com/2008/06/purchage-order-creation-using-bapi.html

0 Kudos

just check this sample code.., Replace the values which are mentioned and check .

REPORT  ZTEST_PO_STO.

data: poheader type BAPIEKKOC,
      poitem type table of BAPIEKPOC with header line,
      return type table of BAPIRETURN with header line.
 data: po type  BAPIMEPOHEADER-PO_NUMBER.
data: POSCHED type table of  BAPIEKET with header line.

poheader-doc_type = 'UB'. " it is for sto
poheader-SUPPL_PLNT = 'R300'.      "<----supplying plant
poheader-PURCH_ORG = 'R300'.     "<---Purchasing org
poheader-CO_CODE = 'R300'.        "<---company code
poheader-PUR_GROUP = 'R30'.     "<----Purchasing group
poheader-DOC_DATE = sy-datum.

poitem-MATERIAL = 'R100001'.   "<---material
poitem-PUR_MAT = poitem-MATERIAL.
poitem-plant = 'R310'.      "<----plant
poitem-PO_ITEM = '000010'.
poitem-STORE_LOC = '0001'.  "<---storage location
poitem-ITEM_CAT = '7'.   "<----item category for STO
append poitem.

POSCHED-PO_ITEM = '000010'.
POSCHED-DELIV_DATE = sy-datum.
POSCHED-QUANTITY = '1.00'.
append POSCHED.

CALL FUNCTION 'BAPI_PO_CREATE'
  EXPORTING
    po_header                        = poheader
 IMPORTING
   PURCHASEORDER                    = Po
  TABLES
    po_items                         = poitem
    po_item_schedules           = posched
   RETURN                           = RETURN
          .

read table return with key type = 'S' transporting no fields.
if sy-subrc eq 0.
write po.
call function 'BAPI_TRANSACTION_COMMIT'.
endif.