‎2009 Aug 25 2:51 AM
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.
‎2009 Aug 25 6:03 AM
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
‎2009 Aug 25 3:02 AM
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®
‎2009 Aug 25 3:18 AM
Hi,
Try this way.
"Z7 is custom message class.
Thanks
Venkat.OVEHICLE_NO = 'SHG5'.
MESSAGE E027(Z7) WITH VEHICLE_NO 'Vehicle does not exist'.
‎2009 Aug 25 6:03 AM
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