02-19-2008 6:10 AM
plz gimme name of BAPI FM for purchase order creation along with sample code...
02-19-2008 6:16 AM
Hi,
look at this code
when 'DISP' or 'CHAN'.
clear c_temp.
c_temp = ok_code_5000.
This method enables you to list the detailed data on a purchase order
call function 'BAPI_PO_GETDETAIL'
exporting
purchaseorder = ekko-ebeln
items = 'X'
importing
po_header = wa_po_header
tables
po_items = t_po_item.
leave to screen 5001.
clear ok_code_5000
call function 'BAPI_PO_CHANGE'
exporting
purchaseorder = wa_ebeln
poheader = wa_ekko
poheaderx = t_ekkox
tables
return = t_return
poitem = t_ekpo_bapi
poitemx = t_ekpox.
clear w_ebeln.
w_ebeln = wa_ebeln.
if sy-subrc = 0.
Function module BAPI_PO_CREATE1 enables you to create POs.
The BAPI uses the technology behind transaction (ME21N)
Controlling adoption of field values via X bar
call function 'BAPI_PO_CREATE1'
exporting
poheader = wa_ekko
poheaderx = t_ekkox
importing
exppurchaseorder = wa_ebeln
tables
return = t_return
poitem = t_ekpo_bapi
poitemx = t_ekpox.
clear w_ebeln.
w_ebeln = wa_ebeln.
if sy-subrc = 0.
message i001 with wa_ebeln. " PO Created Sucessfully
call function 'BAPI_TRANSACTION_COMMIT'.
clear ok_code_5000.
leave to screen 5001.
Dont Forget To use
call function 'BAPI_TRANSACTION_COMMIT'.
clear ok_code_5000.
leave to screen 5001.
endif.
elseif c_temp = 'CREA'.
at end..
<REMOVED BY MODERATOR>
Gaurav J.
Edited by: Alvaro Tejada Galindo on Aug 15, 2008 3:39 PM
02-19-2008 6:12 AM
02-19-2008 6:14 AM
Hi,
<REMOVED BY MODERATOR>
call function 'BAPI_PO_CREATE1'
exporting
poheader = zpoheader
poheaderx = zpoheaderx
POADDRVENDOR =
TESTRUN =
MEMORY_UNCOMPLETE =
MEMORY_COMPLETE =
POEXPIMPHEADER =
POEXPIMPHEADERX =
VERSIONS =
NO_MESSAGING =
NO_MESSAGE_REQ =
NO_AUTHORITY =
NO_PRICE_FROM_PO =
importing
exppurchaseorder = po_num
EXPHEADER = PO_NUM_HEAD
EXPPOEXPIMPHEADER =
tables
RETURN = zreturn
poitem = zitem
poitemx = zitemx
POADDRDELIVERY =
POSCHEDULE =
POSCHEDULEX =
POACCOUNT =
POACCOUNTPROFITSEGMENT =
POACCOUNTX =
POCONDHEADER =
POCONDHEADERX =
POCOND =
POCONDX =
POLIMITS =
POCONTRACTLIMITS =
POSERVICES =
POSRVACCESSVALUES =
POSERVICESTEXT =
EXTENSIONIN =
EXTENSIONOUT =
POEXPIMPITEM =
POEXPIMPITEMX =
POTEXTHEADER =
POTEXTITEM =
ALLVERSIONS =
POPARTNER =
POCOMPONENTS =
POCOMPONENTSX =
POSHIPPING =
POSHIPPINGX =
POSHIPPINGEXP =
.
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'
IMPORTING
RETURN =
.
Edited by: Alvaro Tejada Galindo on Aug 15, 2008 3:38 PM
02-19-2008 6:14 AM
02-19-2008 6:16 AM
Hi
Use BAPI_PO_CREATE
Thanks
Vijay
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Aug 15, 2008 3:38 PM
02-19-2008 6:16 AM
just use transaction code BAPI and watch out there is heirarchical display of allll object type in that extend the MM tree in that expand the purchase order traa in that expand the purchase order in that you can find CREATE FROM DATA OR DATA1 JUST EXECUTE THAT NODE YOU CAN FIND FUNCTION MODULE AND KEY FIELDS AND METHODS FOR FUNCTION MODULE EVERY THING ABOUT THAT BAPI OK. ANDY QUERIES REGARDING BAPI LET ME KNOW. OK
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Aug 15, 2008 3:39 PM
02-19-2008 6:16 AM
Hi,
look at this code
when 'DISP' or 'CHAN'.
clear c_temp.
c_temp = ok_code_5000.
This method enables you to list the detailed data on a purchase order
call function 'BAPI_PO_GETDETAIL'
exporting
purchaseorder = ekko-ebeln
items = 'X'
importing
po_header = wa_po_header
tables
po_items = t_po_item.
leave to screen 5001.
clear ok_code_5000
call function 'BAPI_PO_CHANGE'
exporting
purchaseorder = wa_ebeln
poheader = wa_ekko
poheaderx = t_ekkox
tables
return = t_return
poitem = t_ekpo_bapi
poitemx = t_ekpox.
clear w_ebeln.
w_ebeln = wa_ebeln.
if sy-subrc = 0.
Function module BAPI_PO_CREATE1 enables you to create POs.
The BAPI uses the technology behind transaction (ME21N)
Controlling adoption of field values via X bar
call function 'BAPI_PO_CREATE1'
exporting
poheader = wa_ekko
poheaderx = t_ekkox
importing
exppurchaseorder = wa_ebeln
tables
return = t_return
poitem = t_ekpo_bapi
poitemx = t_ekpox.
clear w_ebeln.
w_ebeln = wa_ebeln.
if sy-subrc = 0.
message i001 with wa_ebeln. " PO Created Sucessfully
call function 'BAPI_TRANSACTION_COMMIT'.
clear ok_code_5000.
leave to screen 5001.
Dont Forget To use
call function 'BAPI_TRANSACTION_COMMIT'.
clear ok_code_5000.
leave to screen 5001.
endif.
elseif c_temp = 'CREA'.
at end..
<REMOVED BY MODERATOR>
Gaurav J.
Edited by: Alvaro Tejada Galindo on Aug 15, 2008 3:39 PM
08-15-2008 5:48 PM