‎2006 Mar 03 12:22 AM
hello everyone,
i am using BAPI_CUSTOMER_CREATEFROMDATA1 to create customer. My input file has 'Mr.', 'Mrs' etc. as form of address text. But when i am putting this value in the BAPI it is giving me an error 'Invalid form of address text'
what can i do about it?
thanks in advance.
eddie.
P.S: helpful answers will be rewarded.
‎2006 Mar 03 1:21 PM
Hello Eddie,
No u can pass information through PI_PERSONALDATA and still get the result. I checked the FM BAPI_CUSTOMER_CREATEFROMDATA1 and the problem I think is coming in LV02DU30 line 213
IF NOT I_BAPIKNA101_1-TITLE_P IS INITIAL.
SELECT SINGLE * FROM TSAD3T WHERE TITLE_MEDI
= I_BAPIKNA101_1-TITLE_P.
in FM SD_CUSTOMER_CHECK_1.
The field I_BAPIKNA101_1-TITLE_P is converting Mr. to capital MR. and checking with table where it is not going to find anything.
Try in debug mode and confirm. You can probably take it fwd from there.
Abhijit
‎2006 Mar 03 12:35 AM
Hi
Perhaps those titles aren't defined in your system.
See the table TSAD3T.
In the fm SD_CUSTOMER_CHECK_1 (called by your BAPI) there's this validation:
IF NOT I_BAPIKNA106-TITLE IS INITIAL.
SELECT SINGLE * FROM TSAD3T WHERE TITLE_MEDI
= I_BAPIKNA106-TITLE.
IF SY-SUBRC NE 0.
PE_RETURN1-TYPE = 'E'.
SY-MSGID = C_MSG_ID.
SY-MSGNO = '838'.
In my system there's Mr. but not Mrs
You should update that table.
Max
‎2006 Mar 03 2:09 AM
Thanks alot Max. I checked that table and it has keys assigned to Ms., Mr., Company, Mr. and Mrs. The keys are 0001, 0002, 0003, 0004 respectively.
Can you please explain about updating the table?
IF NOT I_BAPIKNA106-TITLE IS INITIAL.
SELECT SINGLE * FROM TSAD3T WHERE TITLE_MEDI
= I_BAPIKNA106-TITLE.
IF SY-SUBRC NE 0.
PE_RETURN1-TYPE = 'E'.
SY-MSGID = C_MSG_ID.
SY-MSGNO = '838'.
I checked I_BAPIKNA106-TITLE and it seems it is referring to the part where you are creating company personal data (PI_Companydata). On the other hand, I am creating PI_Personaldata for which the structure is BAPIKNA101_1.
Does it mean that I won't be able to put the address text that is coming in for me?
‎2006 Mar 03 2:14 AM
I have
010 EN 0001 Ms.
010 EN 0002 Mr.
010 EN 0003 Company
010 EN 0004 Mrs.
010 EN 0005 Miss
010 EN 0006 Dr.
in my system as the content for table TSAD3T.
Pls check contents in your system and your input should match to that of contents in table. Also keep a breakpoint and check why this select is failing. This will help to fix the problem.
‎2006 Mar 03 9:35 AM
Hi
Excuse me! The control is this:
select single * from tsad3t where
title_medi = i_bapikna101_1-title_p.
if sy-subrc ne 0.
pe_return1-type = 'E'.
sy-msgid = c_msg_id.
sy-msgno = '838'.
sy-msgv1 = space.
sy-msgv2 = space.
sy-msgv3 = space.
sy-msgv4 = space.
endif.
This the structure you're filling with master data, so I think the error's occuring here.
You can update that table by table view V_TSAD3 (trx SM30).
Max
‎2006 Mar 03 1:21 PM
Hello Eddie,
No u can pass information through PI_PERSONALDATA and still get the result. I checked the FM BAPI_CUSTOMER_CREATEFROMDATA1 and the problem I think is coming in LV02DU30 line 213
IF NOT I_BAPIKNA101_1-TITLE_P IS INITIAL.
SELECT SINGLE * FROM TSAD3T WHERE TITLE_MEDI
= I_BAPIKNA101_1-TITLE_P.
in FM SD_CUSTOMER_CHECK_1.
The field I_BAPIKNA101_1-TITLE_P is converting Mr. to capital MR. and checking with table where it is not going to find anything.
Try in debug mode and confirm. You can probably take it fwd from there.
Abhijit
‎2006 Mar 03 5:11 PM
Thank you all.
Abhijit, you were right, the problem was that it was converting mr. to capital MR. So I went and updated the table in SM30 just like Max said.
I really appreciate the help.
Thank you once again.
Regards,
Eddie.
‎2007 Mar 08 6:00 PM