2016 Mar 09 12:34 PM
Hi.
I need a small Information. I would like to Get the Exact error message in my bdc.
Suppose i am Adding routing Through the Ca01. I given Material XYZ. , Actually XYZ does not exists , then one error message will appear.
Material is Not Activated. I would like to Get this type of Error message. I used the below code For getting the Error.
But I am not Getting the Correct Message. In debugging I was checked, I am not Getting the Correct Error Message Id.
May i know how could i get the Correct Error message. Please Have a look on below Error message.
DATA:
T_MSG TYPE TABLE OF BDCMSGCOLL, " Collecting Error messages
LOOP AT T_MSG INTO W_MSG. "WHERE MSGTYP EQ 'E'.
* Format Message
CALL FUNCTION 'MESSAGE_TEXT_BUILD'
EXPORTING
MSGID = W_MSG-MSGID
MSGNR = W_MSG-MSGNR
MSGV1 = W_MSG-MSGV1
MSGV2 = W_MSG-MSGV2
MSGV3 = W_MSG-MSGV3
MSGV4 = W_MSG-MSGV4
IMPORTING
MESSAGE_TEXT_OUTPUT = W_MSG1.
ENDLOOP.
REFRESH: T_MSG.
CLEAR: W_MSG.
2016 Mar 10 4:48 PM
Hi,
The problem is not with the FM to format message but with the BDC table. To get the error message "Material is Not Activated." your BDC should run correctly but due to incorrect input of data in one of the BDC screens, you are getting the message "No batch input data for SAPLCPDI 1200".
Therefore, first check your BDC and correct it to run perfectly. May be you can run the CALL TRANSACTION with MODE 'A' and check what exactly is missing on which screen. Once that is corrected, you will get the expected message in Message table which you can convert into required format by using FM 'FORMAT_MESSAGE'.
Best Regards,
Sapeksh
Hi.
I need a small Information. I would like to Get the Exact error message in my bdc.
Suppose i am Adding routing Through the Ca01. I given Material XYZ. , Actually XYZ does not exists , then one error message will appear.
Material is Not Activated. I would like to Get this type of Error message. I used the below code For getting the Error.
But I am not Getting the Correct Message. In debugging I was checked, I am not Getting the Correct Error Message Id.
May i know how could i get the Correct Error message. Please Have a look on below Error message.
DATA:
T_MSG TYPE TABLE OF BDCMSGCOLL, " Collecting Error messages
LOOP AT T_MSG INTO W_MSG. "WHERE MSGTYP EQ 'E'.
* Format Message
CALL FUNCTION 'MESSAGE_TEXT_BUILD'
EXPORTING
MSGID = W_MSG-MSGID
MSGNR = W_MSG-MSGNR
MSGV1 = W_MSG-MSGV1
MSGV2 = W_MSG-MSGV2
MSGV3 = W_MSG-MSGV3
MSGV4 = W_MSG-MSGV4
IMPORTING
MESSAGE_TEXT_OUTPUT = W_MSG1.
ENDLOOP.
REFRESH: T_MSG.
CLEAR: W_MSG.
2016 Mar 09 4:19 PM
The message type in your example is not an 'E'rror message.
rob
2016 Mar 10 3:16 AM
Hi,Rob Burbank , Chandra Indukuri
Thanks for your reply.
In Excel i given Some Materials, All are not Exists in Material List. You may be think that.
Out of some materials ,Routing was created to one material. But No routing was created to Materials.
In this case how could i get the message.If i Check the Call transaction Mode 'A'. It is saying and stopping At Initial Screen that . Material is not Activated . I need to get this type of message.
I am calling.Like below.
CALL TRANSACTION 'CA01' USING IT_BDCDATA MODE 'A' MESSAGES INTO T_MSG.
2016 Mar 10 4:32 PM
You don't really need to catch this type of error. You have to fix the BDC session so this does not happen.
Rob
2016 Mar 09 9:53 PM
I think you are doing it right. Only thing is you are checking the Success message (at least in the screen shot) instead of the error message as Rob mentioned.
-Chandra
2016 Mar 10 7:05 AM
In provided screenshots you have problem in your BDC flow as is written in that message:
"No batch input data for SAPLCPDI 1200"
Create test transaction recording in SHDB (do not forget check "Simulate Background Mode").
And compare it with your BDC steps in program...
2016 Mar 10 7:32 AM
hi, Thanks for your reply.
Through the Record only. I Develop the Se38 Coding.
2016 Mar 10 8:34 AM
Hello,
Please use the FM Format_message and passthe MSGTYP and MSGNR. The other way is you can check in transaction code SE91.
Thanks
Siva.A
2016 Mar 10 9:03 AM
2016 Mar 10 9:07 AM
2016 Mar 10 4:48 PM
Hi,
The problem is not with the FM to format message but with the BDC table. To get the error message "Material is Not Activated." your BDC should run correctly but due to incorrect input of data in one of the BDC screens, you are getting the message "No batch input data for SAPLCPDI 1200".
Therefore, first check your BDC and correct it to run perfectly. May be you can run the CALL TRANSACTION with MODE 'A' and check what exactly is missing on which screen. Once that is corrected, you will get the expected message in Message table which you can convert into required format by using FM 'FORMAT_MESSAGE'.
Best Regards,
Sapeksh