2007 Mar 12 7:50 AM
hi experts,
I am reading feed code from a table (zfeed).if the feed code is not found in the table i've to do the following
If the feed is not found in this table then we need to error.
If sy-subrc <> 0.
Issue error message Feed code & is not setp-up in table (ZFEED), processing stopped.
This error message will be added to table (ERROR_COM)
Raise exit_processing.
Endif.
how to add this message in to the structure (ERROR_COM) this structure
ERROR_NUMBER
MSG_CLASS
MSG_TYPE
MSG_TEXT
MSG_VARIABLE1
MSG_VARIABLE2
MSG_VARIABLE3
MSG_VARIABLE4
these are the fields in the structure.
i expect a detailed explanation
thanx,
Prajith
2007 Mar 12 8:48 AM
Whst is the structure of ERROR_COM?
IF it is not yet created, then try this...
First create a msg in a msg class using this text:
"Feed code & is not set-up in table (ZFEED), processing stopped"
Now create the table as below:
ZFEED Number
Msg class
Msg Number
Date (These date n' time to track the things, if u want u can include the user name also)
Time
Now in ur function module populate these things in to table work area error_com and insert error_com.
2007 Mar 12 8:02 AM
Just add like this:
lwa_error-level = 1.
lwa_error-severity = 'E'.
lwa_error-langu = sy-langu.
lwa_error-ag = 'FTI_LDB_MESSAGE'.
lwa_error-msgnr = 202.
lwa_error-var1 = i_rfha.
APPEND lwa_error TO e_t_error.
Error number : Number of the mesage
class : msg class
text: Any tectxt to appear along with the msg
Var1..var4 can hold values
2007 Mar 12 8:16 AM
Hi Srivijaya,
can i use MESSAGE E007(AT) RAISING NOT_FOUND ?
is it possible to store all the data into the structure? i mean
all the message deatils?
thanx,
Prajith
2007 Mar 12 8:29 AM
Hello Prajith ,
You could also raise the error msg using :
MESSAGE ID 'FTI_LDB_MESSAGE' TYPE 'E' NUMBER 313
RAISING no_deal_num (0r)
the way u specified.
But this will not store the details into the structure. Rather it raises a message and exists. As i mentioned before, u have to create a workkarea ot type 'bapierr' or the way u wanted and append it to an internal table. Do u want to exist the pgm after the error occurs or maintain an error log and display in the last ?
2007 Mar 12 8:34 AM
Try the way below :
If sy-subrc <> 0.
**Feed code & is not setp-up in table (ZFEED), processing stopped.
lwa-ERROR_NUMBER = 007.
lwa-MSG_CLASS = xyz.
MSG_TYPE = 'E'.
MSG_TEXT = 'Feedcode not in bla bla bla . .'.
MSG_VARIABLE1 = Feedcode.
append lwa to itab_err.
MESSAGE E007(AT) RAISING NOT_FOUND .
Endif
2007 Mar 12 8:48 AM
Whst is the structure of ERROR_COM?
IF it is not yet created, then try this...
First create a msg in a msg class using this text:
"Feed code & is not set-up in table (ZFEED), processing stopped"
Now create the table as below:
ZFEED Number
Msg class
Msg Number
Date (These date n' time to track the things, if u want u can include the user name also)
Time
Now in ur function module populate these things in to table work area error_com and insert error_com.
2007 Mar 12 1:36 PM