Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How could i get the Exact error message While posting bdc.

former_member196331
Active Contributor
0 Likes
4,024

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.

1 ACCEPTED SOLUTION
Read only

former_member208149
Participant
0 Likes
2,805

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.

10 REPLIES 10
Read only

Former Member
0 Likes
2,805

The message type in your example is not an 'E'rror message.

rob

Read only

0 Likes
2,805

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.

Read only

0 Likes
2,805

You don't really need to catch this type of error. You have to fix the BDC session so this does not happen.

Rob

Read only

Former Member
0 Likes
2,805

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

Read only

Tomas_Buryanek
Product and Topic Expert
Product and Topic Expert
0 Likes
2,805

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...

-- Tomas --
Read only

0 Likes
2,805

hi, Thanks for your reply.

Through the Record only. I Develop the Se38  Coding.

Read only

siva_subramanian2
Participant
0 Likes
2,805

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

Read only

former_member241258
Active Participant
0 Likes
2,805

USE FM : FORMAT_MESSAGE

Read only

0 Likes
2,805

Ok I will Check it.

Read only

former_member208149
Participant
0 Likes
2,806

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