‎2010 Dec 29 8:11 AM
Dear Gurus ,
I have made a program that uses the 'BAPI_REQUISITION_CREATE' to create Purchase Requisitions.
When i try to make a requisition with Asset i take the following error :No master record exists for vendor xxxx
I searched very much and i read many posts about this problem but i didn't find solution .
Look my code if you can see any problems :
CALL FUNCTION 'BAPI_REQUISITION_CREATE'
EXPORTING
SKIP_ITEMS_WITH_ERROR = ''
AUTOMATIC_SOURCE = 'X'
IMPORTING
NUMBER = PREQ_NO
TABLES
REQUISITION_ITEMS = BAPIEBANC
REQUISITION_ACCOUNT_ASSIGNMENT = BAPIEBKN
* REQUISITION_ITEM_TEXT =
* REQUISITION_LIMITS =
* REQUISITION_CONTRACT_LIMITS =
* REQUISITION_SERVICES =
* REQUISITION_SRV_ACCASS_VALUES =
RETURN = RETURN
* REQUISITION_SERVICES_TEXT =
* REQUISITION_ADDRDELIVERY =
* EXTENSIONIN =
.Also i pass all the relative data to the tables .
Can i skip this message ?
Also the lifnr exists in LFA1.
Thanks in advance ...
‎2010 Dec 29 10:43 AM
Hi Dimath72,
All the errors you are receiving are functional errors.
To successfully proces a requisition, take an already existing requisition from ME53N and use its details like vendor, item etc here.
Regards,
Jovito.
‎2010 Dec 29 8:28 AM
Hi,
Use BAPI_PR_CREATE for creating the purchase requisition.
Regards,
Shakeel
‎2010 Dec 29 9:00 AM
Hi Dimath,
When creating REQUISITION, the vendor should have Purchasing data.
Go to tcode XK03. Enter the vendor number, CC and Purc. Org and tick the Purchasing data.
Hit Enter.
If you receive an error like
"Vendor XXX has not been created for purchasing organization XXX",
the purchasing data for this vendor is not created.
Try another vendor for whom this data is present.
Purchasing data is stored in table LFM1. You can use this table to find relevant vendors.
Regards,
Jovito.
‎2010 Dec 29 9:28 AM
i see someone that exist is lfm1 but when i choose him to the BAPI i take the following error
"Account 6408999999 requires an assignment to a CO".
As i can understand the messages changes all the time ...
‎2010 Dec 29 9:39 AM
Hi Dimath,
I am assuming that the vendor does is not assigned to a company code.
Why dont you pick a vendor of an already existing requisition from ME53N and use it as a vendor (for the same item) in your code.
Regards,
Jovito.
‎2010 Dec 29 9:53 AM
Hi,
I have also developed the program using same BAPI. I had few validations like
perform conversion using wa_data1-sakto changing wa_acct-g_l_acct.
perform conversion using wa_data1-anln1 changing wa_acct-asset_no.
*******Form for converting *******************
form conversion using p_p_input
changing p_p_output.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = p_p_input
importing
output = p_p_output.
endform. " CONVERSION
Normally we dont append zero infront of asset number and G/L acct number. So, this conversion should be taken care.
Let me know if any concerns.
Thanks & Regards,
Manesh Ramachandran
‎2010 Dec 29 9:58 AM
Hi,
Convert the vendor before moving it to the BAPI structure using FM 'CONVERSION_EXIT_ALPHA_INPUT'
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = ld_lifnr
importing
output = ld_lifnr.
Regards
Praveen
‎2010 Dec 29 10:10 AM
Because the i did't know the problem i stoped the program with a break and i manually inserted the 0000 .
So the vendor now is 0000825930 .
BAPIEBANC
2 PREQ_ITEM N 5 00010
3 DOC_TYPE C 4 NBI
4 PUR_GROUP C 3 100
5 CREATED_BY C 12 DPADIORAS
6 PREQ_NAME C 12
7 PREQ_DATE D 8 20121222
8 SHORT_TEXT C 40 New laptop
9 MATERIAL C 18
10 PUR_MAT C 18
11 PLANT C 4 2830
12 STORE_LOC C 4 0010
13 TRACKINGNO C 10 TR002
14 MAT_GRP C 9 999999
15 SUPPL_PLNT C 4
16 QUANTITY P 7 1.000
17 UNIT C 3 ST
18 DEL_DATCAT C 1
19 DELIV_DATE D 8 20111227
20 REL_DATE D 8 00000000
21 GR_PR_TIME P 2 0
22 C_AMT_BAPI P 12 0.0000
23 PRICE_UNIT P 3 0
24 ITEM_CAT C 1
25 ACCTASSCAT C 1 K
31 DES_VENDOR C 10 0000850235
32 FIXED_VEND C 10
33 PURCH_ORG C 4 BAPIEBKN
2 PREQ_ITEM N 5 00010
3 SERIAL_NO N 2 00
4 DELETE_IND C 1
5 CREATED_ON D 8 00000000
6 CREATED_BY C 12
7 PREQ_QTY P 7 1.000
8 DISTR_PERC P 2 0.0
9 G_L_ACCT C 10 6408999999
10 BUS_AREA C 4
11 COST_CTR C 10 910007
12 PROJ_NO C 16
13 SD_DOC C 10
14 SDOC_ITEM N 6 000000
15 SCHED_LINE N 4 0000
16 ASSET_NO C 12
17 SUB_NUMBER C 4
18 ORDER_NO C 12
19 GR_RCPT C 12
20 UNLOAD_PT C 25
21 CO_AREA C 4 2800
22 TO_COSTCTR C 1 Xand the message is
Cost center 2800/910007 does not exist
‎2010 Dec 29 10:43 AM
Hi Dimath72,
All the errors you are receiving are functional errors.
To successfully proces a requisition, take an already existing requisition from ME53N and use its details like vendor, item etc here.
Regards,
Jovito.
‎2010 Dec 29 10:59 AM
The funny thing is that i go to se37 - BAPI .... and run it with some data .
It run OK.
The same data i run it in program and it doesn't run !!!!
‎2010 Dec 29 11:01 AM
‎2010 Dec 29 11:57 AM
Hi,
If that is the case then its a problem of leading zeros.
For example, your earlier error was :
Cost center 2800/910007 does not exist
and the value for Cost Center was 910007 was
11 COST_CTR C 10 910007Since cost center is of 10 digits, try 0000910007.
You can also use CONVERSION_EXIT_ALPHA_INPUT to automatically convert the input.
e.g.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = '910007'
IMPORTING
OUTPUT = cost_ctr
.
‎2010 Dec 29 12:55 PM
‎2010 Dec 29 1:51 PM
Cost center 2800/910007 does not exist
Check whether cost center 910007 exists in controlling area 2800???
‎2010 Dec 30 6:51 AM
Hi,
As per my suggestion, you can use the similar CONVERSION_EXIT_ALPHA_INPUT for appending zeros in front of cost center input and then feed into BAPI. Its better you try the same cost center manually and try to create a PR if it is not happening in foreground it will not happen in the BAPI also.
Note few things
1) Data in upload sheet might have cost center which are not present in Development environment. But it will be availabe either in quality or production system.
2) Kindly check whether you are testing in development test client.
3) Ask your functional consultants for active cost center and other data for dev environment.
Thanks & Regards,
Manesh.R
‎2011 Feb 23 5:14 AM
Hi Dimath,
I would suggest you to create a purchase requisition manually, by using the same data as you are passing to bapi. Once you are able to create PR manually, try the same data with your bapi.
I hope by doing this you can analyse the error & be able to rectify it.
Regards,
Vinit....
‎2011 Feb 22 8:51 PM