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

Regarding BDCMSGCOLL

Former Member
0 Likes
527

Hi,

I have used FORMAT_MESSAGE and traced the errors while trying to upload the file.

Now I want to Display the error message along with the record from the text file .

Say in the text file i have the vehicle number SHG5 and the error is "Vehicle does not exist',

I want to display it for the users as.

SHG5 Vehicle does not exist.

How do i do this.Kindly advise.

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
496

hi

below is the piece of code...

call transaction 'FB01' using BDCDATA mode 'N'

messages into MESSTAB.

read table MESSTAB with key MSGTYP = 'E' into WA_MESSTAB.

if SY-SUBRC = 0.

perform READ_MESSAGE using WA_MESSTAB-MSGID WA_MESSTAB-MSGNR

changing V_MSGSTR .

V_ERROR = V_ERROR + C_INCREMENT.

WA_RESULT-MESSAGE = V_MSGSTR.

append WA_RESULT to IT_RESULT.

else.

read table MESSTAB with key MSGTYP = 'S' into WA_MESSTAB.

if SY-SUBRC = 0.

perform READ_MESSAGE using WA_MESSTAB-MSGID WA_MESSTAB-MSGNR

changing V_MSGSTR .

V_SUCCESS = V_SUCCESS + C_INCREMENT.

WA_RESULT-MESSAGE = V_MSGSTR.

append WA_RESULT to IT_RESULT.

endif.

endif.

else.

V_ERROR = V_ERROR + C_INCREMENT.

WA_RESULT-MESSAGE = TEXT-012.

append WA_RESULT to IT_RESULT.

endif.

endloop.

Thanks

Ashu

3 REPLIES 3
Read only

former_member194669
Active Contributor
0 Likes
496

Create a message like the following in your custom message class YZZZ 999 as

& & & & &

then

message e999(yzzz) with v_textfile_veh_number v_message into v_message_text.

Now v_message_text contains your message SHG5 Vehicle does not exist.

a®

Read only

venkat_o
Active Contributor
0 Likes
496

Hi, Try this way.

VEHICLE_NO = 'SHG5'.
MESSAGE E027(Z7) WITH VEHICLE_NO 'Vehicle does not exist'.
"Z7 is custom message class. Thanks Venkat.O

Read only

Former Member
0 Likes
497

hi

below is the piece of code...

call transaction 'FB01' using BDCDATA mode 'N'

messages into MESSTAB.

read table MESSTAB with key MSGTYP = 'E' into WA_MESSTAB.

if SY-SUBRC = 0.

perform READ_MESSAGE using WA_MESSTAB-MSGID WA_MESSTAB-MSGNR

changing V_MSGSTR .

V_ERROR = V_ERROR + C_INCREMENT.

WA_RESULT-MESSAGE = V_MSGSTR.

append WA_RESULT to IT_RESULT.

else.

read table MESSTAB with key MSGTYP = 'S' into WA_MESSTAB.

if SY-SUBRC = 0.

perform READ_MESSAGE using WA_MESSTAB-MSGID WA_MESSTAB-MSGNR

changing V_MSGSTR .

V_SUCCESS = V_SUCCESS + C_INCREMENT.

WA_RESULT-MESSAGE = V_MSGSTR.

append WA_RESULT to IT_RESULT.

endif.

endif.

else.

V_ERROR = V_ERROR + C_INCREMENT.

WA_RESULT-MESSAGE = TEXT-012.

append WA_RESULT to IT_RESULT.

endif.

endloop.

Thanks

Ashu