Error in BAPI_PO_CREATE1
Hi all,
Can anyone tell me how to use FM BAPI_PO_CREATE1.I am getting this error.
"Type conflict when calling a function module (field length)"
This is my code.
REPORT Z8CKG_BAPI_PO_CREATE1_T1.
PO HEADER DETAILS.
TYPES: BEGIN OF T_PO_HEADER.
INCLUDE STRUCTURE BAPIMEPOHEADER.
TYPES: END OF T_PO_HEADER.
TYPES: BEGIN OF T_PO_HEADERX.
INCLUDE STRUCTURE BAPIMEPOHEADERX.
TYPES: END OF T_PO_HEADERX.
PO ITEMS DETAILS.
TYPES: BEGIN OF T_PO_ITEMS.
INCLUDE STRUCTURE BAPIMEPOITEM.
TYPES: END OF T_PO_ITEMS.
TYPES: BEGIN OF T_PO_ITEMX.
INCLUDE STRUCTURE BAPIMEPOITEMX.
TYPES: END OF T_PO_ITEMX.
DATA: I_PO_HEADER TYPE STANDARD TABLE OF T_PO_HEADER,
I_PO_HEADERX TYPE STANDARD TABLE OF T_PO_HEADER,
I_PO_ITEMS TYPE STANDARD TABLE OF T_PO_ITEMS,
I_PO_ITEMX TYPE STANDARD TABLE OF T_PO_ITEMS.
DATA: WA_PO_HEADER TYPE T_PO_HEADER,
WA_PO_HEADERX TYPE T_PO_HEADER,
WA_PO_ITEMS TYPE T_PO_ITEMS,
WA_PO_ITEMX TYPE T_PO_ITEMS.
DATA: PUR_ORDER LIKE BAPIMEPOHEADER-PO_NUMBER,
C_X(1) TYPE C VALUE 'X'.
START OF SELECTION.
START-OF-SELECTION.
HEADER DETAILS.
WA_PO_HEADER-COMP_CODE = '0001'.
WA_PO_HEADER-DOC_TYPE = 'NB'.
WA_PO_HEADER-CREAT_DATE = SY-DATUM.
WA_PO_HEADER-CREATED_BY = 'DEVELOPER'.
WA_PO_HEADER-VENDOR = 'V1'.
WA_PO_HEADER-PURCH_ORG = '001'.
WA_PO_HEADER-CURRENCY = 'INR'.
WA_PO_HEADER-SALES_PERS = 'CHINMAY GHOSH'.
WA_PO_HEADER-TELEPHONE = '090019909'.
HEADERX DETAILS.
WA_PO_HEADERX-COMP_CODE = C_X.
WA_PO_HEADERX-DOC_TYPE = C_X.
WA_PO_HEADERX-CREAT_DATE = C_X.
WA_PO_HEADERX-CREATED_BY = C_X.
WA_PO_HEADERX-VENDOR = C_X.
WA_PO_HEADERX-PURCH_ORG = C_X.
WA_PO_HEADERX-CURRENCY = C_X.
WA_PO_HEADERX-SALES_PERS = C_X.
WA_PO_HEADERX-TELEPHONE = C_X.
ITEM DETAILS.
WA_PO_ITEMS-PO_ITEM = '10'.
WA_PO_ITEMS-MATERIAL = 'RM1'.
WA_PO_ITEMS-SHORT_TEXT = 'RAW MATERIAL1'.
WA_PO_ITEMS-PLANT = '0001'.
WA_PO_ITEMS-QUANTITY = '100'.
ITEMX DETAILS.
WA_PO_ITEMX-PO_ITEM = '10'.
WA_PO_ITEMX-MATERIAL = C_X.
WA_PO_ITEMX-SHORT_TEXT = C_X.
WA_PO_ITEMX-PLANT = C_X.
*WA_PO_ITEMX-QUANTITY = 'X'.
APPEND WA_PO_ITEMS TO I_PO_ITEMS.
APPEND WA_PO_ITEMX TO I_PO_ITEMX.
ITEM DETAILS.
WA_PO_ITEMS-PO_ITEM = '20'.
WA_PO_ITEMS-MATERIAL = 'RM2'.
WA_PO_ITEMS-SHORT_TEXT = 'RAW MATERIAL2'.
WA_PO_ITEMS-PLANT = '0001'.
WA_PO_ITEMS-QUANTITY = '150'.
ITEMX DETAILS.
WA_PO_ITEMX-PO_ITEM = '10'.
WA_PO_ITEMX-MATERIAL = C_X.
WA_PO_ITEMX-SHORT_TEXT = C_X.
WA_PO_ITEMX-PLANT = C_X.
*WA_PO_ITEMX-QUANTITY = C_X.
APPEND WA_PO_ITEMS TO I_PO_ITEMS.
APPEND WA_PO_ITEMX TO I_PO_ITEMX.
ITEM DETAILS.
WA_PO_ITEMS-PO_ITEM = '30'.
WA_PO_ITEMS-MATERIAL = 'RM3'.
WA_PO_ITEMS-SHORT_TEXT = 'RAW MATERIAL3'.
WA_PO_ITEMS-PLANT = '0001'.
WA_PO_ITEMS-QUANTITY = '200'.
ITEMX DETAILS.
WA_PO_ITEMX-PO_ITEM = '10'.
WA_PO_ITEMX-MATERIAL = C_X.
WA_PO_ITEMX-SHORT_TEXT = C_X.
WA_PO_ITEMX-PLANT = C_X.
*WA_PO_ITEMX-QUANTITY = C_X.
APPEND WA_PO_ITEMS TO I_PO_ITEMS.
APPEND WA_PO_ITEMX TO I_PO_ITEMX.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = WA_PO_HEADER
POHEADERX = WA_PO_HEADERX
POADDRVENDOR =
TESTRUN =
MEMORY_UNCOMPLETE =
MEMORY_COMPLETE =
POEXPIMPHEADER =
POEXPIMPHEADERX =
VERSIONS =
NO_MESSAGING =
NO_MESSAGE_REQ =
NO_AUTHORITY =
NO_PRICE_FROM_PO =
IMPORTING
EXPPURCHASEORDER = PUR_ORDER
EXPHEADER =
EXPPOEXPIMPHEADER =
TABLES
RETURN =
POITEM = I_PO_ITEMS
POITEMX = I_PO_ITEMX
POADDRDELIVERY =
POSCHEDULE =
POSCHEDULEX =
POACCOUNT =
POACCOUNTPROFITSEGMENT =
POACCOUNTX =
POCONDHEADER =
POCONDHEADERX =
POCOND =
POCONDX =
POLIMITS =
POCONTRACTLIMITS =
POSERVICES =
POSRVACCESSVALUES =
POSERVICESTEXT =
EXTENSIONIN =
EXTENSIONOUT =
POEXPIMPITEM =
POEXPIMPITEMX =
POTEXTHEADER =
POTEXTITEM =
ALLVERSIONS =
POPARTNER =
WRITE:/5 PUR_ORDER.
hi Chinmay,
you need to change the following declerations:
DATA: WA_PO_HEADER TYPE T_PO_HEADER,
WA_PO_HEADERX TYPE T_PO_HEADER,
<b>and re-write as mentioned below:</b>
DATA: WA_PO_HEADER TYPE BAPIMEPOHEADER,
WA_PO_HEADERX TYPE BAPIMEPOHEADERX.
Hope this helps.
Sajan Joseph.
Message was edited by:
Sajan Joseph
Similar Messages
-
Error using BAPI_PO_CREATE1 for creating PO with services
Hi,
I'm getting an error saying 'EnTER account assignment data for item' when I use BAPI_PO_CREATE1 and try to create POs with Service Items. I have filled all the required details, even then the system throws up this error message. Thanks for any help.
Regards,
Vijaywhat have you passed to the table POACCOUNT? and POACCOUNTX?
Regards,
Ravi -
Error using BAPI_PO_CREATE1 to create po with ref to PR
Hi all,
I am using FM BAPI_PO_CREATE1 to create a PO wrt PR. but while executing getting an error.
No instance of object type PurchaseOrder has been created. External reference:
Purchase order still contains faulty items
Purchase requisition 10002040, item 00010, does not exist
Purchase requisition 10002040, item 00010, does not exist.
Any suggestions to solve this problem.
Thanks in advance,
NeelaHi ,
i got the error message that 'Please maintain services sor limits' message se 029.I'm using bapi (BAPI_PO_CREATE1) and pass preq_no and preq_item in poitem structure.can u help me in this issue? -
Rounding error in BAPI_PO_CREATE1 Function module
Hi experts ,
In my project there are two steps behind PO creation 1-> Authorization of po creation And 2-> PO creation.
In authorization a logic in smart form calculates the amount for which the po is to be created and then goes go 2 nd step.
before creating po gross discount percentage is calculated the same way calculated in step1.
But at the end total amount in smartform and total amount of po created is differing by max of .01 to 0.1.
Unfortunetely the Z logic in the smartforms is caculation the creec value but standard BAPI BAPI_PO_CREATE1 is creating some rounding errors .
Please suggest some thing for this problem.
Thanks in advance
ShoaibmemonHi Md shoaib Memon,
there is another thread with the same issue.
http://scn.sap.com/thread/922418
Solution:
Set the following flag
poitem-no_rounding = 'X'.
poitemx-no_rounding = 'X'.
Best regards,
Ademir -
Error during BAPI_PO_CREATE1
Hi Friends,
During the execution on BAPI_PO_CREATE1 I am getting the following error.
Message Class: BAPI
Message No. 000000
Message Variable: PurchaseOrder
Parameter Name: POHEADER
Message Type: E
Please Guide me for the solution.
Regards,
Krishan Raheja.Compare the below data with data what you are passing, the fields mentioned below are mandatory.
Parameter: POHEADER
COMP_CODE = 1000
DOC_TYPE = NB
ITEM_INTVL = 00001
VENDOR = 0000001000
PMNTTRMS = 0001
PURCH_ORG = 1000
PUR_GROUP = 001
CURRENCY = EUR
Parameter: POHEADERX
COMP_CODE = X
DOC_TYPE = X
ITEM_INTVL = X
VENDOR = X
PMNTTRMS = X
PURCH_ORG = X
PUR_GROUP = X
Parameter: POITEM
PO_ITEM = 00001
MATERIAL = 100-100
PLANT = 1000
STGE_LOC = 0001
QUANTITY = 15.000
TAX_CODE = V0
ITEM_CAT = 0
ACCTASSCAT = K
Parameter: POITEMX
PO_ITEM = 00001
MATERIAL = X
PLANT = X
STGE_LOC = X
QUANTITY = X
TAX_CODE = X
ITEM_CAT = X
ACCTASSCAT = X
Parameter: POSCHEDULE
PO_ITEM = 00001
SCHED_LINE = 0001
DELIVERY_DATE = 02.12.2002
QUANTITY = 6.000
PO_ITEM = 00001
SCHED_LINE = 0002
DELIVERY_DATE = 03.12.2002
QUANTITY = 5.000
PO_ITEM = 00001
SCHED_LINE = 0003
DELIVERY_DATE = 04.12.2002
QUANTITY = 4.000
Parameter: POSCHEDULEX
PO_ITEM = 00001
SCHED_LINE = 0001
PO_ITEMX = X
SCHED_LINEX = X
DELIVERY_DATE = X
QUANTITY = X
PO_ITEM = 00001
SCHED_LINE = 0002
PO_ITEMX = X
SCHED_LINEX = X
DELIVERY_DATE = X
QUANTITY = X
PO_ITEM = 00001
SCHED_LINE = 0003
PO_ITEMX = X
SCHED_LINEX = X
DELIVERY_DATE = X
QUANTITY = X
Parameter: POACCOUNT
PO_ITEM = 00001
SERIAL_NO = 01
QUANTITY = 15.000
GL_ACCOUNT = 0000400000
COSTCENTER = 0000001000
CO_AREA = 1000
Parameter: POACCOUNTX
PO_ITEM = 00001
SERIAL_NO = 01
QUANTITY = X
GL_ACCOUNT = X
COSTCENTER = X
CO_AREA = X
Parameter: POCOND
ITM_NUMBER = 000001
COND_ST_NO = 001
COND_TYPE = PB00
COND_VALUE = 79.900000000
CURRENCY = EUR
CURRENCY_ISO = EUR
COND_UNIT = KG
COND_P_UNT = 1
CHANGE_ID = U
Parameter: POCONDX
ITM_NUMBER = 000001
COND_ST_NO = 000
ITM_NUMBERX = X
COND_TYPE = X
COND_VALUE = X
CURRENCY = X
CHANGE_ID = X
Parameter: POPARTNER
PARTNERDESC = OA
LANGU = EN
BUSPARTNO = 0000001100
PARTNERDESC = GS
LANGU = EN
BUSPARTNO = 0000001200
PARTNERDESC = PI
LANGU = EN
BUSPARTNO = 0000001000
Regards
Kannaiah -
Getting error in bapi_po_create1 'Please maintain services or limits '
Hi People,
I am trying to create a service purchase order using Bapi_po_create1...... i have used POSERVICES ( LINE_NO ,
SERVICE, QUANTITY , GR_PRICE , MATL_GROUP, FORM_VAL1, FORM_VAL2 ) ( i also added header, item,
schedule, account, details ) and when i execute this bapi iam getting the following error :
' Please maintain services or limits '
I couldnt solve this issue ..........can you people tel me what are fields that need to be filled and how to solve this error ?
( i checked the threads but not able to find the solution ) ?
Thanks in Advance,
SivaHi
I think you missed some more fields. Check this:
Field OUTL_IND is used to flag a line as an outline line. The service lines are assigned to the outline lines using the fields PCKG_NO (for the service line) and SUBPCKG_NO (for the outline line).
The outline hierarchy is mapped using the fields LINE_NO and HI_LINE_NO. Field HI_LINE_NO links to field LINE_NO of the hierarchically superior outline.
I found the above data in the Documentation of the BAPI which can be seen in se37 tcode.
Regards,
VIshwa. -
Error in BAPI_PO_CREATE1 FM
When I am executing BAPI_PO_CREATE1 fm, I am getting these eroor messages:
No instance of object type PurchaseOrder has been created. External reference:
Purchase order still contains faulty items
Can delivery date be met?
Enter Reason for Ord.
Net price for item 00010 adopted from last document
any resolution ?Hi,
What ever the data you are passing to the FM, same data pass through the Standard Transaction and try to create P.O with your functional consultants. If it is giving the same error, there is no problem with FM data. Ask them to give proper test data. otherwise what are all the solutions they are providing in front end , try to pass the same data to FM also.
Thanks,
Venkata -
Error in BAPI_PO_CREATE1 imputing WBS Element
hi,
I'm trying to create a service purchase order (ME21N) tied to a purchase requisition using BAPI_PO_CREATE1. The purchase requisition is imputed to Project (WBS Element). I have not been able to create, the BAPI generates an error KI235 "Account & requires an assignment to a CO object" The account 123456 is not set in OKB9 table. However, when I create a service purchase order using the same bapi with this account but charged to cost center, works perfectly. However, I need to create it imputing WBS element.
I filled the following relevant fields to the BAPI:
POITEM-PO_ITEM : 00010
POITEM-SHORT_TEXT : Texto
POITEM-PLANT : 'CENTRO'
POITEM-MATL_GROUP : 'GRUP'
POITEM-QUANTITY : 1
POITEM-PO_UNIT : 'ACT'
POITEM-NET_PRICE : 10
POITEM-ITEM_CAT : '9'
POITEM-ACCTASSCAT : 'P'
POITEM-PREQ_NO : 2000001500
POITEM-PREQ_ITEM : 00010
POITEM-PREQ_NAME : 0000012000
POITEM-PCKG_NO : 0000000100
POACCOUNT-PO_ITEM : 00010
POACCOUNT-SERIAL_NO : '01'
POACCOUNT-GL_ACCOUNT : '123456'
POACCOUNT-WBS_ELEMENT: 'PEP_ELEMET'
POACCOUNT-CO_AREA : 'SCOS'
POACCOUNT-PROFIT_CTR : 'CTRBENEF'
POACCOUNT-FUND : 'FUND'
POACCOUNT-CMMT_ITEM : '0000123456'
Best Regards,After a long investigating process, implementing the following note solved the problem: 1977169.
Best regards. -
Error After BAPI_PO_CREATE1 with multiple Lines "Enter Account Assignment"
Hi,
I am trying to Post Purchase Orders with Multiple lines using BAPI_PO_CREATE1 and got error
"Enter Account Assignment". This is happening when I post PO with multiple line items.
I am trying the same PO with one record, PO is creating successfully. Do I need to put any additional data.
I am creating PO with Item Category 'D' and Account Assignment 'N' and external number range and internal number range.
Pls let me know, Do i need any additional flags for this.
Thanks,
nainiHello all,
please help!!
I used function BAPI_PO_CREATE1 to create PO with limit item but function returned message error '518 No account assignment exist for service line 0000000000'. Can anyone give me an idea to slove this problem? for your information, I used parameters below to run this function.
POHEADER
POHEADER-COMP_CODE = '1205'
POHEADER-DOC_TYPE = 'GZPO'
POHEADER-VENDOR = '8000001313'
POHEADER-PMNTTRMS = '0001'
POHEADER-PURCH_ORG = '1222'.
POHEADER-PUR_GROUP = 'K05'
POHEADER-CURRENCY = 'THB'
POHEADER-EXCH_RATE = '1.00000'
POHEADER-EX_RATE_FX = ' X'
POHEADER-DOC_DATE = '10.06.2008'
POHEADERX
POHEADERX-COMP_CODE = 'X'
POHEADERX-DOC_TYPE = 'X'
POHEADERX-VENDOR = 'X'
POHEADERX-PMNTTRMS= 'X'
POHEADERX-DSCNT1_TO = 'X'
POHEADERX-PURCH_ORG= 'X'
POHEADERX-PUR_GROUP = 'X'
POHEADERX-CURRENCY= 'X'
POHEADERX-EXCH_RATE= 'X'
POHEADERX-EX_RATE_FX= 'X'
POHEADERX-DOC_DATE= 'X'
POHEADERX-INCOTERMS1= 'X'
POHEADERX-INCOTERMS2= 'X'
POITEM
POITEM-SHORT_TEXT = 'TEST'
POITEM-PLANT = '5005'
POITEM-MATL_GROUP = '606100001'
POITEM-QUANTITY = '1.000'
POITEM-PO_UNIT = 'AU'
POITEM-ITEM_CAT = 'B'
POITEM-ACCTASSCAT = 'K'
POITEM-DISTRIB = ' '
POITEM-PART_INV = ' '
POITEM-PCKG_NO = '0000100001'
POITEMX
POITEMX-SHORT_TEXT = 'X'
POITEMX-PLANT = 'X'
POITEMX-MATL_GROUP = 'X'
POITEMX-QUANTITY = 'X'
POITEMX-PO_UNIT = 'X'
POITEMX-ITEM_CAT = 'X'
POITEMX-ACCTASSCAT = 'X'
POITEMX-DISTRIB = 'X'
POITEMX-PART_INV = 'X'
POITEMX-PCKG_NO = 'X'
POSCHEDULE
POSCHEDULE-PO_ITEM = '00001'
POSCHEDULE-SCHED_LINE = '0001'
POSCHEDULE-DEL_DATCAT_EXT = 'D'
POSCHEDULE-DELIVERY_DATE = '01.09.2006'
POSCHEDULE-QUANTITY = ' 1.000'
POSCHEDULEX
POSCHEDULEX-PO_ITEM= '00001'
POSCHEDULEX-SCHED_LINE = '0001'
POSCHEDULEX-PO_ITEMX = 'X'
POSCHEDULEX-SCHED_LINEX = 'X'
POSCHEDULEX-DEL_DATCAT_EXT = 'X'
POSCHEDULEX-DELIVERY_DATE = 'X'
POSCHEDULEX-QUANTITY = 'X'
POACCOUNT
POACCOUNT-PO_ITEM = '00001'
POACCOUNT-SERIAL_NO = '01'
POACCOUNT-GL_ACCOUNT = '0065903020'
POACCOUNT-BUS_AREA = '70'
POACCOUNT-COSTCENTER = '0010700003'
POACCOUNT-ORDERID = ' '
POACCOUNTX
POACCOUNTX-PO_ITEM = '00001'
POACCOUNTX-SERIAL_NO = '01'
POACCOUNTX-PO_ITEMX = 'X'
POACCOUNTX-SERIAL_NOX = 'X'
POACCOUNTX-GL_ACCOUNT = 'X'
POACCOUNTX-BUS_AREA = 'X'
POACCOUNTX-COSTCENTER = 'X'
POACCOUNTX-ORDERID = 'X'
POSERVICES
POSERVICES-PCKG_NO = '0000100001'
POSERVICES-LINE_NO = '0000000001'
POSERVICES-OUTL_IND = 'X'
POSERVICES-SUBPCKG_NO = '0000100002'
POSERVICES-QUANTITY = ' '
POSERVICES-BASE_UOM = ' '
POSERVICES-GR_PRICE = ' '
POSERVICES-FROM_LINE = '000001'
POSERVICES-TO_LINE = '999999'
POSERVICES-SHORT_TEXT = ' '
POSERVICES-MATL_GROUP = ' '
APPEND POSERVICES
POSERVICES-PCKG_NO = '00100002'
POSERVICES-LINE_NO = '0000002'
POSERVICES-OUTL_IND = ' '
POSERVICES-SUBPCKG_NO = ' '
POSERVICES-QUANTITY = '1.000'
POSERVICES-BASE_UOM = 'AU'
POSERVICES-GR_PRICE = '43,486.21'
POSERVICES-FROM_LINE = ' '
POSERVICES-TO_LINE = ' '
POSERVICES-SHORT_TEXT = 'Demurrage'
POSERVICES-MATL_GROUP = '606100001'
POSRVACCESSVALUES
POSRVACCESSVALUES-PCKG_NO = '0000100001'
POSRVACCESSVALUES-LINE_NO = '0000000001'
POSRVACCESSVALUES-SERIAL_NO = ' '
POSRVACCESSVALUES-QUANTITY = ' '
APPEND POSRVACCESSVALUES
POSRVACCESSVALUES-PCKG_NO = '0000100002'
POSRVACCESSVALUES-LINE_NO = '0000000002'
POSRVACCESSVALUES-SERIAL_NO = '01'
POSRVACCESSVALUES-QUANTITY = '1.000'
POLIMITS
POLIMITS-PCKG_NO = '0000100001'
POLIMITS-LIMIT = '1.00'
POLIMITS-EXP_VALUE = '1.00'
APPEND POLIMITS
POLIMITS-PCKG_NO = '0000100002'
POLIMITS-LIMIT = ' '
POLIMITS-EXP_VALUE = ' '
please help
Thank you for advance -
Sc not transfered to backend rfc error after bapi_po_create1 ?
I have one user who's shoppingcarts are not transferred to the backend. when I try to transfer it manually with BBP_PD_SC_TRANSFER I get an rfc error after the bapi_po_create1
for the rest the whole system is functioning as it should but only for this user the shoppingcarts are not transfered. I also don't get any errors back from the bapi.
anybody got a clue what can be wrong with this particular user ?
I checked everything in ppoma but can't find any flaws or errors.
kind regards
arthur>
Virender Singh wrote:
> Hi
> Did you check the Error Log in RZ20. There has to be something wrong in this shopping cart data. Is the SC Approved? What is the error shown by BAPI_PO_CREATE1?
>
> Regards
> Virender Singh
I am a bit closer to the answer I guess. no there were no erros given with BAPI_PO_CREATE1
fuzzy part however with the sc was that there was only an acc_no of 002. since the last hrsps on the backend the BAPI_PO_CREATE1 gave errors back that it didn't accept 002 without a 001
so I checked in a badi if there were acc_no with 02 and 100% costassignment and transfered these back to 01
with the badi BBP_CREATE_BE_PO_NEW. that was working very nice until one user could not transfer any shoppingcart anymore. I saw that she had a workprocedure that caused the 02 acc_no (she used copy paste) when I let her do it without copy paste and just change it then the shoppingcart created a PO.
but I'm puzzled what I'm missing here and why it most of the times work but sometimes it just doesn't give any errors back and no purchasenr but just an exception others.
can I debug this further on in the backend somehow what causes the exception ?
kind regards
arthur -
BAPI Error for BAPI_PO_Create1
hi all,
i am supposed to create PO s for all the invoices in a Ztable.so i chose BAPI_po_create1.I am passing all the values but it throws some exception tht it was intercepted by some superior class.
it says FAILURE Exception.
Please help.
Thanks a lot,
Santosh Kotra.Hi,
have a look at the sample program:-
*& Report ZBAPI_CREATE_PO *
*& Program demonstrates the BAPI call to create Purchase Order *
*& Minimum required parameters are used are as per the current *
*& system configuration *
REPORT ZBAPI_CREATE_PO .
*DATA DECLARATION
CONSTANTS : C_X VALUE 'X'.
*Structures to hold PO header data
DATA : HEADER LIKE BAPIMEPOHEADER ,
HEADERX LIKE BAPIMEPOHEADERX .
*Internal Tables to hold PO ITEM DATA
DATA : ITEM LIKE BAPIMEPOITEM OCCURS 0 WITH HEADER LINE,
ITEMX LIKE BAPIMEPOITEMX OCCURS 0 WITH HEADER LINE,
*Internal table to hold messages from BAPI call
RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
data : w_header(40) value 'PO Header'.
data : ws_langu like sy-langu.
*text-001 = 'PO Header' - define as text element
selection-screen begin of block b1 with frame title text-001.
parameters : company like header-comp_code default '2700' ,
doctyp like HEADER-DOC_TYPE default 'NB' ,
cdate like HEADER-CREAT_DATE default sy-datum ,
vendor like HEADER-VENDOR default '0010000023',
pur_org like HEADER-PURCH_ORG default '2700' ,
pur_grp like HEADER-PUR_GROUP default '001' .
selection-screen end of block b1.
selection-screen begin of block b2 with frame title text-002.
parameters : item_num like ITEM-PO_ITEM default '00001',
material like ITEM-MATERIAL default 'CRANE' ,
plant like ITEM-PLANT default '2700' ,
quantity like ITEM-QUANTITY default 100.
selection-screen end of block b2.
START-OF-SELECTION.
*DATA POPULATION
ws_langu = sy-langu. "Language variable
*POPULATE HEADER DATA FOR PO
HEADER-COMP_CODE = company .
HEADER-DOC_TYPE = doctyp .
HEADER-CREAT_DATE = cdate .
HEADER-VENDOR = vendor .
HEADER-LANGU = ws_langu .
HEADER-PURCH_ORG = pur_org .
HEADER-PUR_GROUP = pur_grp .
*POPULATE HEADER FLAG.
HEADERX-comp_code = c_x.
HEADERX-doc_type = c_x.
HEADERX-creat_date = c_x.
HEADERX-vendor = c_x.
HEADERX-langu = c_x.
HEADERX-purch_org = c_x.
HEADERX-pur_group = c_x.
HEADERX-doc_date = c_x.
*POPULATE ITEM DATA.
ITEM-PO_ITEM = item_num.
ITEM-MATERIAL = material.
ITEM-PLANT = plant.
ITEM-QUANTITY = quantity.
APPEND ITEM.
*POPULATE ITEM FLAG TABLE
ITEMX-PO_ITEM = item_num.
ITEMX-MATERIAL = C_X.
ITEMX-PLANT = C_X .
ITEMX-STGE_LOC = C_X .
ITEMX-QUANTITY = C_X .
ITEMX-TAX_CODE = C_X .
ITEMX-ITEM_CAT = C_X .
ITEMX-ACCTASSCAT = C_X .
APPEND ITEMX.
*BAPI CALL
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
POHEADER = HEADER
POHEADERX = HEADERX
* POADDRVENDOR =
* TESTRUN =
* IMPORTING
* EXPPURCHASEORDER =
* EXPHEADER =
* EXPPOEXPIMPHEADER =
TABLES
RETURN = RETURN
POITEM = ITEM
POITEMX = ITEMX.
*Confirm the document creation by calling database COMMIT
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
* IMPORTING
* RETURN =
end-of-selection.
*Output the messages returned from BAPI call
LOOP AT RETURN.
WRITE / RETURN-MESSAGE.
ENDLOOP.
Regards
Sudheer -
Hi Experts,
From SE 37, am trying to create the PO by using BAPI_PO_CRAETE1, so, am hving issues like,
1 - ENTER TAX CODE of # 083 in ME
I tried to pass the value to the filed of TAX_CODE of POACCOUNT & POACCOUNTX structures/table,
but, still am getting the same error saying that, ENTER THE TAX CODE?????????? of ME class # is 083.
let me know, Wht I hv to still pass? Why am getting even though am passing the value?
help appreciated.got answer my self, by adding correct code
-
Problem while Error Handling thru BAPI_PO_CREATE1
Hi,
currently im facing problem while generating error thru BAPI_PO_CREATE1
im calling bapi two times thru loop iteration,
as my data is faulty , so for 1st iteration im getting 3 error in it_return structure.
now in 2nd iteration im getting (3+3)
repeted error which is geenarated earlier(old 3 err) +(new 3 err).
im refreshing all internal table,work areas and variables, still im getting same problem,
please provide ur kind suggestion on this.
refresh : <all it>
clear : <all wa>
Loop at it into wa.
refresh : it_return.
CALL FUNCTION 'BAPI_PO_CREATE1'
Tables = IT_RETURN
endloop.
Regards
Vivek Khobragadehi,
I found that Im getting duplicates error because of passing
BAPIMEPOITEM - PREQ_NO (Purchase Requisition Number)
BAPIMEPOITEM - PREQ_ITEM (Item Number of Purchase Requisition)
. if I dont pass these then I wont get duplicates error.
but as functional told its mandatory to update it?
please have eye on it?
regards
Vivek -
Error while creating PO from bid inviation?
Hello Experts,
1) We are using SRM 5.0 version. I accepted the bid after that i have clicked on "Generate Pucrchase order". we are getting error " 3700000340 E MEPO 028 No movement type can be usd for this item 4643513A094741B6000000000A402D38R12329Z ECPO " .
2) Create SC with sourcing cockpit indicator. Now SC will appear in work list. In carry out sourcing work list convert SC to PO by assgining vendor.
While creating PO in backend we got error " Shopping cart 3000363214 (PO 2100004803): MEPO 028 No movement type can be usd for this item".
If any one knows about these error please help me
please let me know..Venkatesh,
Are you using an item with Split Valuation ?
You are getting error because BAPI_PO_CREATE1 is looking for Valuation Type . And offcourse SRM doesn't supply that .
Try with a free text item.
Rgds, AJ -
Purchase Order from EBP was not created
Hi people,
I have a problem with an approved shopping cart that must generate a Purchase Order in R3.
But:
- The order was not generated in R3
- I have an entry in bbp_document_tab table in EBP system
- When I check the status of the Shopping Cart in transaction BBP_PD I can see the item in "Item in Transfer Process" status.
- When I check the Application Monitor in EBP system, there is no messages related to this Shopping Cart.
- The report CLEAN_REQREQ_UP is schedule to run every 25 minutes and after it runs, the entry in bbp_document_tab remains there.
- I checked the dumps in R3 system using transaction ST22 but I could not find entries (I have searched using the RFC user).
What else I can check? If I have an error when BAPI_PO_CREATE1 is called, where it is logged?
Thank you!Hi
You need to take help of ABAP resource here.
Using the same data what you are passing in the shopping cart, directly create a purchase order both
1) using ME21N transaction directly and
2) then using 'BAPI_PO_CREATE1' bapi using a custom program in this case.
3) Incase you are using ECS, then implement BBP_CREATE_PO_BACK BADI and put a break-point there and then you can easily figure out, what's the problem happening as soon as BAPI - 'BAPI_PO_CREATE1' is called from SRM system using RFC call there.
Do let me know your findings.
Regards
- Atul
Maybe you are looking for
-
Best Practices for SRM Installation !!
Hi can someone share the best Practices for SRM Installation ? What is the typical timeframe to install SRM on development server and as well as on the Production server ? Appericiate the responses Thanks, Arvind
-
Copying DVDs No Longer Working
Hello all! I did some video productions last year, edited them with iMovie and burned the master DVDs with iDVD. They work great in DVD players and when I insert them into one of my Macs, DVD player automatically opens, goes to full screen and begins
-
Illustrator not able to round corners properly (w/ image sample)
When designing a logo, I want to be able to round corners properly, i.e. mathematically. When I specify a radius of 20 mm, I expect a radius of 20 mm, not various random radiuses. Illustrator simply isn't capable of doing this properly. I find this v
-
Sun cluster 3.1 on Solaris 10 update1
Hi All, Good day !!! I am trying to build Sun Cluster 3.1 on Sun Solaris 10 update1 operating system. I am using sun V240 servers. If i plumb bge1 and bge2 the second and third interface and reboot the server system is not comming up. it promts error
-
...a newer version. is what I get after installing itunes 7.5. Is there an update or fix for this message?