Purchase Order BAPI's
Dear All,
Could you please let me know the BAPI that can be used to check whether the Purchase order has been created for a particular material or not.
Also to get the all the PO's that are created with the corresponding material details.
Please the list of input fields that needs to be provided for these BAPI's
Regards,
Nithiyanandam
Hi,
Could you please make it clear, Because I dont have much knowledge in ABAP. I executed this BAPI through the Tcode SE37, by providing the Material number details in Import parameter. When executed, the return parameter provided the total count of the PO numbers for the material( as 500 etc for ex) and I am not getting any details in the PO_ITEMS tables.
Let me know what else chould I provide.
Thanks & Regards,
Nithiyanandam
Similar Messages
-
How to find a purchase order bapi
Hi,
can any one help how to find purchase order bapi.Hi,
Please check with the transaction code - 'BAPI' & you can see the details in the below path:
Material Management -> Purchasing.
Please refer the bapi documentation.
Regards,
Selva K. -
How to find purchase order bapi
can any one help how to find purchase order bapi.
This isn't a Web Dynpro Specific question - moving to ABAP general.
However have you considered going to SE80 and searching for function modules that begin with the name BAPI and have purc in the name? Or maybe going to the BAPI Browser transaction (T-Code BAPI) and searching either in the Hiearchy or Alphabetical list. Probably not too difficult to find the purchase order object. -
Problem in creating a SyncBo for Purchase Order BAPIs
Hello Everybody,
I am trying to create a smart sync application for Purchase Orders.
I have used standard bapis like BAPI_PO_GETDETAIL AND BAPI_PO_CREATE1.
I have developed my own wrapper functions using these std bapis. For the PO creation i only plan to insert the necessary and mandatory data. The problem i face is that some of the tables in the create bapi which are mandatory for a PO creation are freezed in the SyncBo.
Tables like POITEMX, POADDRDELIVERY, POSCHEDULE and structure POHEADERX are all required for the creation of a PO. Without this minimum data a PO cannot be created.
After i have created the syncBo, on the mapping screen i can only see these tables under the create BAPI. But i am not able to perform the mapping of their fields. These are non-editable or i must say that they are freezed.
And if i cannot map them then i cannot pass data for them from the client. Although i can do the mapping for the table PO_ITEM and the structure PO_HEADER.
I hope i am able to expplain my problem. Kindly get back to me if i am not clear. Any sort of help is welcome.
Thanking in advance,
Saurabh.Hi Saurabh,
Hope you are aware of the prerequisites for creating the BAPI Wrappers.
If you want to insert some data into the Business Object, then you have to include
GETLIST, GETDETAIL and CREATE Bapi Wrappers.
I think in your case,
You might not have mapped those fields in your GETLIST Bapi Wrapper.Just check whether you have mapped those fields that are necessary for PO creation in your GETLIST and GETDETAIL BApi wrapper mapping screen.
Those fields you have mapped in the GETLIST and GETDETAIL BAPI wrappers will be visible (for selection - checkboxes will be editable) in the mapping screen for CREATE BAPI Wrapper.
So first of all, you have to map fields there in the mapping screens for GETLIST and GETDETAIL Bapi Wrappers...
check this thing...
refer these links..
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/com.sap.km.cm.docs/library/mobile/mobile%20infrastructure/mobile%20development%20kit%202.5/content/appdev/smartsync/introduction.html
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/com.sap.km.cm.docs/library/mobile/mobile%20infrastructure/mobile%20development%20kit%202.5/content/appdev/smartsync/bapi_wrapper_types.html
In the second link, you can see one figure, which is explaining the things that are to be satisfied by the BAPI Wrappers for SyncBO creation...
Let me know If you have doubts in the prerequisite section itself...
Regards,
Kishor Gopinathan -
Hi Experts,
My requirement is to get in to change mode of a PO's ,then
click on Messages Tab so that the Output type NEU gets triggered automatically for the list of PO's i have and then i save the PO.
I am trying to do a recording in ME22N .The recording seems to be working fine in Foreground and Background Mode.
When i try to Schedule it as a job in Background , it gives an
Error saying
'Unable to initialise ABAP Control Framework ...
Control Framework: Fatal error - GUI cannot be reached'.
Is there any BAPI which can solve my requirement.
I cannot use ME22 also as i dont have access to that TCODE.
Your help is very much appreciated.
Regards,
NickHi,
U cannot use ordinary transaction as it takes mre amount of time . for that use standard BAPI FM
BAPI_PO_CHANGE-- to change bapi PO and use method
purchaseorder.change to change PO.
BAPI_PO_CREATE
BAPI_PO_CREATE1
Depending upon u r req u use but it is better to use BAPI_PO_CREATE1 and dont forget to use
BAPI_Transaction_commit.
Reward if its usefull.
Regards
Durgaprasad.
Edited by: Durga Prasad on Apr 11, 2008 8:05 AM -
Open Purchase Order UPload Using the BAPI 's
i need to upload the open Purchase Order using the BAPI function BAPI_PO_CREATE1., below is the given fileds blod are for Header, header will Repeat for the line items,can any one help me out using the BAIP's for upload the PO, i need sample code for this ........
Thanks & Regards
Raghu
<u>Field Name Field Description Type Length</u>
<b>EBELN Purchasing Document Number CHAR 010 X
BUKRS Company Code CHAR 004 MN10 C
EKORG Purchasing Organization CHAR 004 MN00 C
EKGRP Purchasing group CHAR 003 X
BSART Order type (Purchasing) CHAR 004 X
LIFNR Account Number of Vendor or Creditor CHAR 010 X
BEDAT Purchase Order Date DATS 010 X
ZTERM Terms of payment key CHAR 004 X
WAERS Currency Key CUKY 005 X
INCO1 Incoterms (part 1) CHAR 003 X
INCO2 Incoterms (part 2) CHAR 028 X</b>
EBELP Item Number of Purchasing Document NUMC 005 X
EMATN Material number CHAR 018 X
WERKS Plant CHAR 004 X
LGORT Storage location CHAR 004 X
EPSTP Item category in purchasing document CHAR 001 X
KNTTP Account assignment category CHAR 001 X
EINDT Item delivery date DATS 010 X
MENGE "Purchase order quantity (direct input, transfer of POs)" CHAR 013 X
MEINS Order unit UNIT 003 X
NETPR "Net price: Document currency (direct input, transfer of" CHAR 011 X
PEINH "Price unit (direct input, transfer of POs)" CHAR 005 X
BPRME Order Price Unit (Purchasing) UNIT 003 X
BPUMZ Numerator: Conversion OPUn into OUn (direct input of POs CHAR 005 X
BPUMN Denominator: Conversion OPUn into OUn (direct input of P CHAR 005 X
SAKTO Cost element CHAR 010 X
KOSTL Cost Center CHAR 010 X
VBELN Sales and Distribution Document Number CHAR 010 X
VBELP Sales document item NUMC 006 X
WEMPF Goods recipient CHAR 012 X
WEBTH "Amount in local currency (direct input, transfer of POs)" CHAR 013 X
WEBTF "Amount in document currency (direct input, transfer of P" CHAR 013 X
WEREF Flag for treatment of GR/IR (direct input of POs) CHAR 001 X
SPINF Indicator: Update info record CHAR 001 X
WEPOS Goods Receipt Indicator CHAR 001 X
REPOS Invoice receipt indicator CHAR 001 Xi need to upload the open Purchase Order using the BAPI function BAPI_PO_CREATE1., below is the given fileds blod are for Header, header will Repeat for the line items,can any one help me out using the BAIP's for upload the PO, i need sample code for this ........
Thanks & Regards
Raghu
<u>Field Name Field Description Type Length</u>
<b>EBELN Purchasing Document Number CHAR 010 X
BUKRS Company Code CHAR 004 MN10 C
EKORG Purchasing Organization CHAR 004 MN00 C
EKGRP Purchasing group CHAR 003 X
BSART Order type (Purchasing) CHAR 004 X
LIFNR Account Number of Vendor or Creditor CHAR 010 X
BEDAT Purchase Order Date DATS 010 X
ZTERM Terms of payment key CHAR 004 X
WAERS Currency Key CUKY 005 X
INCO1 Incoterms (part 1) CHAR 003 X
INCO2 Incoterms (part 2) CHAR 028 X</b>
EBELP Item Number of Purchasing Document NUMC 005 X
EMATN Material number CHAR 018 X
WERKS Plant CHAR 004 X
LGORT Storage location CHAR 004 X
EPSTP Item category in purchasing document CHAR 001 X
KNTTP Account assignment category CHAR 001 X
EINDT Item delivery date DATS 010 X
MENGE "Purchase order quantity (direct input, transfer of POs)" CHAR 013 X
MEINS Order unit UNIT 003 X
NETPR "Net price: Document currency (direct input, transfer of" CHAR 011 X
PEINH "Price unit (direct input, transfer of POs)" CHAR 005 X
BPRME Order Price Unit (Purchasing) UNIT 003 X
BPUMZ Numerator: Conversion OPUn into OUn (direct input of POs CHAR 005 X
BPUMN Denominator: Conversion OPUn into OUn (direct input of P CHAR 005 X
SAKTO Cost element CHAR 010 X
KOSTL Cost Center CHAR 010 X
VBELN Sales and Distribution Document Number CHAR 010 X
VBELP Sales document item NUMC 006 X
WEMPF Goods recipient CHAR 012 X
WEBTH "Amount in local currency (direct input, transfer of POs)" CHAR 013 X
WEBTF "Amount in document currency (direct input, transfer of P" CHAR 013 X
WEREF Flag for treatment of GR/IR (direct input of POs) CHAR 001 X
SPINF Indicator: Update info record CHAR 001 X
WEPOS Goods Receipt Indicator CHAR 001 X
REPOS Invoice receipt indicator CHAR 001 X -
BAPI for PURCHASE ORDER with OPEN QUANTITY field
Hi All,
I wanted to use the BAPI_PO_GETDETAIL to get the Purchase Order details upon triggering from Warehouse management system,
But the details required contains a field called OPEN QUANTITY...which is not used in this BAPI.
I request to let me know if any BAPI exits for PO details having the structure for this field:Open Quantity.
Am using SAP version 4.0B.
If not exists please advise how to customize the existing BAPI to meet the requirement.
thanks
mahiHi,
Open quantity is a calculated field. I guess the BAPI gives the details of the delivery, so take the ordered qty and substract the delivered qty from that.
Delivery data is EKET table.
Regards,
Ravi -
Hi experts, Upload purchase order using BAPI
hi
Could you please help me how to do PURCHASE ORDER CREATION using BAPI.
Thank you.Satyendra,
The forum that you have posted your question in is for questions related to the SAP Business One Integration for SAP NetWeaver. Your question is or seems to be related to R/3 and should be posted in that forum.
Eddy -
Hy Gurus,
Are there a Bapi with input the purchase order number and output the purchase order open quantity and delivery date?
Thanks.
JosyHi
Use this bapi BAPI_PO_CREATE1 it has those fields you want..
thanks
Edited by: Sharada.Dhulipala on Oct 12, 2011 4:33 PM -
Error while creation of PUrchase order by using BAPI.
Hi All,
We are creating a purchase order thru BAPI ("BAPI_POEC_CREATE") and we are passing the following parameters ( I_PO_HEADER , I_PO_ITEMS , I_PO_ACCASS , I_PO_PARTNER and I_PO_ORGDATA) to the bapi and after processing we are getting the following error and Abend messages.
Messages:
1) Enter at least one item or one limit ( we have added line items in I_PO_ITEMS structure).
2) Incorrect interface data for set 78 in method C.
3) Interface data contains errors.
Can anyone help me in fixing these errors inorder to proceed further.
Regards
DharmarajuHi there,
Did you manage to sort this problem ?
If not let me know
I am using the same and know how to overcome
Thanks
Turlock
T -
Create a Purchase order using the BAPI using the data in the XML file.
Hello Gurus,
here is the scenario can anyone help me how to proceed explaining the procedure?
Create a Purchase order using the BAPI using the data in the XML file.
comprehensive explanations are appreciated.
thanks in advance.hi,
first use fm "bapi_po_create".
then use fm "BAPI_ACC_GL_POSTING_POST"
The demo environment was made with real business scenario in mind, but following subjects need to be addressed in a live implementation:
No exceptions and error handling is implemented, except the order rejection (e.g. partly delivery);
In Navision both XML Ports and the XML DOM has been used to integrate with SAP XI, because XML ports has some drawbacks regarding to Namespaces in XML Documents (mandatory in SAP XI);
A minimum of SAP and Navision customization is required to implement this solution. (e.g. user exit in SAP, Navision XML DOM). -
Bapi to post planned delivery cost of a purchase order
Hi every body,
Can anybody please give me the full details of the planned delivery cost data
to post with BAPI_INCOMINGINVOICE_CREATE
what are the manditory fields,
I am using the following code , but a few are posting , remaining r not posting
but when I post the same through MIRO it is posted what is difference
this error was came
ERROR: enter good reciept data only when working with GR-based IV
REPORT ZBAPI_MIRO .
tables: ekko,ekbe,ekpo,lfa1,EKBZ,t000.
data: itemdata like BAPI_INCINV_CREATE_ITEM occurs 0 with header line,
headerdata like BAPI_INCINV_CREATE_HEADER occurs 0 with header line,
return like BAPIRET2 occurs 0 with header line,
DOC_NO LIKE BAPI_INCINV_FLD-INV_DOC_NO,
FISC_YEAR LIKE BAPI_INCINV_FLD-FISC_YEAR.
DATA:error_flag.
data: item_data like EK08BN occurs 0 with header line.
data: begin of itab occurs 0,
p_order like ekpo-ebeln,
p_item like ekpo-ebelp,
p_ctype like konv-kschl,
p_lifnr like lfa1-lifnr,
end of itab.
data: order(10) type N,
vendor(10) type N.
data: begin of it_doc occurs 0,
DOC_NO LIKE BAPI_INCINV_FLD-INV_DOC_NO,
p_order like ekko-ebeln,
end of it_doc.
PARAMETERS: fn LIKE rlgrap-filename OBLIGATORY.
DATA: FN1 TYPE STRING,
l .
AT SELECTION-SCREEN ON VALUE-REQUEST FOR fn. "p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
field_name = 'FN'
IMPORTING
file_name = fn.
START-OF-SELECTION.
FN1 = FN.
PERFORM upload.
loop at itab.
CLEAR: EKBZ,EKPO,LFA1,ITEM_DATA,HEADERDATA,itemdata.
REFRESH:itemdata,HEADERDATA,ITEM_DATA.
order = itab-p_order.
itab-p_order = order.
vendor = itab-P_lifnr.
itab-p_lifnr = vendor.
select single * from ekbz where ebeln = order
and ebelp = itab-p_item
and kschl = itab-p_ctype
and bewtp = 'F'.
select single * from ekpo where ebeln = order
and ebelp = itab-p_item.
SELECT SINGLE * FROM LFA1 WHERE LIFNR = vendor.
clear: item_data.
refresh:item_data.
call function 'ME_READ_COND_INVOICE'
exporting
I_BUDAT =
I_EBELN = itab-p_order
I_EBELP = itab-p_item
I_FRBNR = ' '
i_lifnr = ' '
I_XBLNR = ' '
RE_KURSF =
RE_WAERS =
I_RESWK = ' '
I_EKKI = 'X'
I_BUBIS =
RE_WWERT =
XEK08B_FLAG =
I_BELNR =
I_BUZEI =
I_READ_KRUEK = ' '
I_DISPLAY = ' '
TABLES
XEK08BN = item_data
XEK08BN_CURR =
read table item_data with key kschl = itab-P_ctype.
headerdata-INVOICE_IND = 'X'.
headerdata-DOC_TYPE = 'KR'.
headerdata-DOC_DATE = ekbz-budat.
headerdata-PSTNG_DATE = SY-DATUM.
headerdata-REF_DOC_NO = itab-P_ORDER.
headerdata-COMP_CODE = 'HPL'.
headerdata-DIFF_INV = itab-p_lifnr.
headerdata-CURRENCY_ISO = ekbz-waers.
headerdata-GROSS_AMOUNT = item_data-WEWWR - item_data-AREWR .
headerdata-BLINE_DATE = SY-DATUM.
headerdata-DEL_COSTS_TAXC = 'V0'.
headerdata-PO_REF_NO = itab-P_ORDER.
headerdata-bus_area = 'OTHR'.
headerdata-ITEM_TEXT = LFA1-NAME1.
*headerdata-HEADER_TXT = .
headerdata-ALLOC_NMBR = itab-P_ORDER.
APPEND HEADERDATA.
CLEAR HEADERDATA.
itemdata-INVOICE_DOC_ITEM = '00001' .
itemdata-PO_NUMBER = itab-P_ORDER.
itemdata-PO_ITEM = itab-P_ITEM.
*itemdata-REF_DOC = ekbz-belnr.
itemdata-REF_DOC_YEAR = ekbz-gjahr.
itemdata-REF_DOC_IT = itab-P_ITEM.
itemdata-TAX_CODE = 'V0'.
itemdata-ITEM_AMOUNT = item_data-WEWWR - item_data-AREWR .
itemdata-QUANTITY = item_data-BPWEM - item_data-BPREM .
itemdata-PO_UNIT = ekpo-meins.
itemdata-PO_PR_UOM = ekpo-meins.
itemdata-COND_TYPE = itab-P_CTYPE.
*itemdata-ITEM_TEXT = .
append itemdata.
clear itemdata.
CALL FUNCTION 'BAPI_INCOMINGINVOICE_CREATE'
EXPORTING
HEADERDATA = HEADERDATA
IMPORTING
INVOICEDOCNUMBER = DOC_NO
FISCALYEAR = FISC_YEAR
TABLES
ITEMDATA = ITEMDATA
ACCOUNTINGDATA = I_ACCOUNTINGDATA
TAXDATA = I_TAX
RETURN = RETURN.
if sy-subrc <> 0.
message e999(re) with 'Problem occured'.
else.
loop at return.
if not return is initial.
clear bapi_retn_info.
move-corresponding return to bapi_retn_info.
if return-type = 'A' or return-type = 'E'.
error_flag = 'X'.
endif.
append bapi_retn_info.
endif.
endloop.
if error_flag = 'X'.
message e999(re) with 'Problem occured'.
rollback work.
else.
Return Table from BAPI call is empty
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = RETURN.
endif.
endif.
write:/ 'Document no :', doc_no.
it_doc-doc_no = doc_no.
it_doc-p_order = itab-p_order.
append it_doc.
CLEAR IT_DOC.
endloop.
loop at it_doc.
if it_doc-doc_no = ' '.
write:/ 'purchase order not posted ' , it_doc-p_order.
else.
write:/ 'document no:' , it_doc-doc_no, 'p.order:' , it_doc-p_order.
endif.
endloop.
*& Form upload
text
--> p1 text
<-- p2 text
form upload .
CALL function 'GUI_UPLOAD'
exporting
filename = FN1
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = ' '
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
tables
data_tab = ITAB
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
endform. " uploadI think you need to implement user-exit EXIT_SAPMM06E_012 of enhancement MM06E005.
Look in OSS with seach term MM06E005 to get some examples.
Note310154 "ME21N/ME51N: Customer-specific check, generating error log" has some examples.
You should use the macros to set errors/warnings
Example:
mmpur_business_obj_id pt_ekpo-id.
mmpur_metafield mmmfd_partners.
mmpur_message_forced 'W' '00' '208' text-001 '' '' ''.
regards,
JG -
BAPI for Reversal of Goods Receipt Purchase Order(Transaction : MIGO)
Hi all,
Is there any BAPI for the Reversal of posting the documents Goods receipt Purchase order
(Transaction: MIGO).
Any inputs on this..is highly appreciable...
thanks in advance...
regards..
prathima.Hi,
Try this passing material doc and year.
* Cancel the goods movement (creates a reversal document)
CALL FUNCTION 'BAPI_GOODSMVT_CANCEL'
EXPORTING
materialdocument = g_material_doc
matdocumentyear = g_matdoc_year
TABLES
return = i_return.
Edited by: Raj on May 14, 2008 7:46 PM -
BAPI needed for Goods Receipt Purchase Order(Transaction : MIGO)
Hi all,
We have a requirement where in we need to post the documents throuh BAPI for Goods receipt Purchase order(Transaction: MIGO).
Any inputs on this..is highly appreciable...
thanks in advance...
regards..
prathima.Hi,
use 'BAPI_GOODSMVT_CREATE'
Check this sample.
code
REPORT ZRICH_0001 .
Structures for BAPI
DATA: GM_HEADER TYPE BAPI2017_GM_HEAD_01.
DATA: GM_CODE TYPE BAPI2017_GM_CODE.
DATA: GM_HEADRET TYPE BAPI2017_GM_HEAD_RET.
DATA: GM_ITEM TYPE TABLE OF
BAPI2017_GM_ITEM_CREATE WITH HEADER LINE.
DATA: GM_RETURN TYPE BAPIRET2 OCCURS 0 WITH HEADER LINE.
DATA: GM_RETMTD TYPE BAPI2017_GM_HEAD_RET-MAT_DOC.
CLEAR: GM_RETURN, GM_RETMTD. REFRESH GM_RETURN.
Setup BAPI header data.
GM_HEADER-PSTNG_DATE = SY-DATUM.
GM_HEADER-DOC_DATE = SY-DATUM.
GM_CODE-GM_CODE = '04'. " MB1A
Write 971 movement to table
CLEAR GM_ITEM.
MOVE '412' TO GM_ITEM-MOVE_TYPE .
MOVE 'Q' TO GM_ITEM-SPEC_STOCK.
MOVE '3800533484' TO GM_ITEM-MATERIAL.
MOVE '1' TO GM_ITEM-ENTRY_QNT.
*MOVE 'PC' TO GM_ITEM-ENTRY_UOM.
MOVE '1060' TO GM_ITEM-PLANT.
MOVE '0007' TO GM_ITEM-STGE_LOC.
*MOVE '0901' TO GM_ITEM-MOVE_REAS.
MOVE 'P203601001' TO GM_ITEM-WBS_ELEM.
MOVE 'P203601001' TO GM_ITEM-VAL_WBS_ELEM.
APPEND GM_ITEM.
Call goods movement BAPI
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
GOODSMVT_HEADER = GM_HEADER
GOODSMVT_CODE = GM_CODE
IMPORTING
GOODSMVT_HEADRET = GM_HEADRET
MATERIALDOCUMENT = GM_RETMTD
TABLES
GOODSMVT_ITEM = GM_ITEM
RETURN = GM_RETURN.
IF NOT GM_RETMTD IS INITIAL.
COMMIT WORK AND WAIT.
CALL FUNCTION 'DEQUEUE_ALL'.
ELSE.
COMMIT WORK AND WAIT.
CALL FUNCTION 'DEQUEUE_ALL'.
ENDIF.
WRITE:/ GM_RETMTD.
LOOP AT GM_RETURN.
WRITE:/ GM_RETURN.
ENDLOOP.
[/code]
Also check the Bapis
BAPI_PO_CREATE --> To create Purchase Order
BAPI_PO_CHANGE --> To change Purchase Order
BAPI_PO_GETDETAIL --> Todisplay Purchase Order
Regards,
Raj. -
Reg bapi for creation of purchase order
hai to all,
i have to upload purchase orders from legacy file to R/3 system
certain order having more than 50 line items
so please any one send me <b>stardard bapi program or bdc program for me21n</b> transaction which will suitable for my senario.
please send asap
regards
vijayhai
i am trying to create po using bapi
the following code explains
constants : c_x value 'X'.
data: del_date type sy-datum.
data: pohead type bapimepoheader.
data: poheadx type bapimepoheaderx.
data: exp_head type bapimepoheader.
data: t_return_out type table of bapiret2 with header line,
wa_return_out TYPE bapiret2.
data: poitem type table of bapimepoitem with header line.
data: poitemx type table of bapimepoitemx with header line.
data: posched type table of bapimeposchedule with header line.
data: poschedx type table of bapimeposchedulx with header line.
data: ex_po_number type bapimepoheader-po_number.
Header Level Data
pohead-comp_code = '1011'.
pohead-doc_type = 'NB' .
pohead-creat_date = sy-datum .
pohead-vendor = 'A1138'.
pohead-purch_org = 'DOMS'.
pohead-pur_group = 'MFR'.
pohead-langu = sy-langu .
pohead-doc_date = sy-datum.
poheadx-comp_code = c_x.
poheadx-doc_type = c_x.
poheadx-creat_date = c_x.
poheadx-vendor = c_x.
poheadx-langu = c_x.
poheadx-purch_org = c_x.
poheadx-pur_group = c_x.
poheadx-doc_date = c_x.
Item Level Data
poitem-po_item = 1.
poitem-material = '000000000100001079'.
poitem-plant = 'HO01'.
poitem-stge_loc = ''.
poitem-quantity = 1.
append poitem.
poitemx-po_item = 1.
poitemx-po_itemx = c_x.
poitemx-material = c_x.
poitemx-plant = c_x .
poitemx-stge_loc = c_x .
poitemx-quantity = c_x .
poitemx-tax_code = c_x .
poitemx-item_cat = c_x .
poitemx-acctasscat = c_x .
append poitemx.
Schedule Line Level Data
posched-po_item = 1.
posched-sched_line = 1.
posched-del_datcat_ext = 'D'.
del_date = sy-datum + 1.
write del_date to posched-delivery_date.
posched-deliv_time = '000001'.
posched-quantity = 1.
append posched.
poschedx-po_item = 1.
poschedx-sched_line = 1.
poschedx-po_itemx = c_x.
poschedx-sched_linex = c_x.
poschedx-del_datcat_ext = c_x.
poschedx-delivery_date = c_x.
poschedx-quantity = c_x.
append poschedx.
call function 'BAPI_PO_CREATE1'
EXPORTING
poheader = pohead
poheaderx = poheadx
testrun = ' '
IMPORTING
exppurchaseorder = ex_po_number
expheader = exp_head
TABLES
return = t_return_out
poitem = poitem
poitemx = poitemx.
poschedule = posched
poschedulex = poschedx.
call function 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
if not ex_po_number is initial.
call function 'DEQUEUE_ALL'.
else.
call function 'DEQUEUE_ALL'.
message i036.
endif.
**endform. " create_po
IF ex_po_number IS NOT INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
PERFORM show_result.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
PERFORM show_result.
ENDIF.
*& Form show_result
text
--> p1 text
<-- p2 text
FORM show_result .
LOOP AT t_return_out INTO wa_return_out.
write : ex_po_number.
WRITE : / wa_return_out-type,
/ wa_return_out-id,
/ wa_return_out-number,
/ wa_return_out-message,
/ wa_return_out-log_no,
/ wa_return_out-log_msg_no,
/ wa_return_out-message_v1,
/ wa_return_out-message_v2,
/ wa_return_out-message_v3,
/ wa_return_out-message_v4,
/ wa_return_out-parameter,
/ wa_return_out-row,
/ wa_return_out-field,
/ wa_return_out-system.
ENDLOOP.
<b>iam geting the error such that</b>
E
BAPI
001
No instance of object type PurchaseOrder has been created. External reference:
000000
PurchaseOrder
POHEADER
1
E
ME
062
Account assignment mandatory for material 100001079 (enter acc. ***. cat.)
000000
100001079
POITEM
<b>how to correct this error</b>
regards
vijay
Maybe you are looking for
-
How to use AND in stead of OR at the Software Updates search criteria: Article ID.
When I try to filter out some KB's it is working for the first one (KB2124261), but when I want to filter out more than one it is not working as the 2. time you add the Article ID it is added as "OR" but should be "AND". I have tried to write more th
-
I bought a G4 MX460 in September 2002 and I have many problems: 1.it does not give any TV out with the LATEST MSI or Nvidia drivers. I had to go back to (old) version 2.7.2.0 of the VGA driver to make it work. This card will not give TV output if you
-
Mac & 802.1x Machine Authentication to Microsoft AD using PEAP
We are having trouble successfully connecting wirelessly our Active Directory-bound Macs to our internal 802.1x wireless network using EAP-PEAP with machine authentication. All of our Windows machines work fine. We have a network profile built out of
-
R12: License Manager - what should be marked?
Our contract has the following: Oracle Order Management - Application User Perpetual Oracle Order Management - Electronic Order Line Perpetual Oracle Supply Chain & Order Management Intelligence - Application User Perpetual Oracle Advanced Pricing fo
-
ORACLE ODBC DRIVER를 이용하여 ORACLE DATABASE에 접속하는 방법 (8.X이상)
제품 : ODBC 작성날짜 : 2003-03-27 ORACLE ODBC DRIVER를 이용하여 ORACLE DATABASE에 접속하는 방법 (8.X이상) ========================================================= PURPOSE Oracle Client가 8.X version인 경우, Oracle ODBC driver를 설치하고 Oracle database에 접속하는 방법을 살펴본다. Explanati