on 01-09-2008 9:04 AM
Hi,
I am writing the code for generic extractor. In function module, I am writing
Check DataSource validity
CASE i_dsource.
WHEN 'Z_PRE_POST'.
WHEN OTHERS.
IF 1 = 2. MESSAGE e009(r3). ENDIF.
this is a typical log call. Please write every error message like this
log_write 'E' "message type
'R3' "message class
'009' "message number
i_dsource "message variable 1
' '. "message variable 2
raise error_passed_to_mess_handler
endcase.
While activating this function module, I am getting an error which is:-
The statement "LOG_WRITE" is not expected. A correct similar statement is "WRITE"...
I have used it in many codes but on different servers. This is a new system. Can anyone tell me why this is happening?
Thanks!
Hi,
LOG_WRITE is a macro defined in the include LRSALK01 (SE38);
Check that you have this include well activated in your system; otherwise implement it your own function module call or simply CALL FUNCTION 'RSAL_LOG_WRITE' with your messages...
here the standard code from SAP for this macro:
DEFINE LOG_WRITE.
RSAL_SAVE_SUBRC = SY-SUBRC.
RSAL_S_LOGPARMS-MSGTY = &1.
RSAL_S_LOGPARMS-MSGID = &2.
RSAL_S_LOGPARMS-MSGNO = &3.
RSAL_S_LOGPARMS-MSGV1 = &4.
RSAL_S_LOGPARMS-MSGV2 = &5.
CALL FUNCTION 'RSAL_LOG_WRITE'
EXPORTING
I_MSGTY = RSAL_S_LOGPARMS-MSGTY
I_MSGID = RSAL_S_LOGPARMS-MSGID
I_MSGNO = RSAL_S_LOGPARMS-MSGNO
I_MSGV1 = RSAL_S_LOGPARMS-MSGV1
I_MSGV2 = RSAL_S_LOGPARMS-MSGV2.
SY-SUBRC = RSAL_SAVE_SUBRC.
END-OF-DEFINITION.
this is weird anyway....
let us know
Olivier.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
what did you do finally?
in which release are you?
thanks for your feedback!
Olivier.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am in ECC 6.0.
Used following code...
DATA: v_subrc TYPE sy-subrc,
v_msgty TYPE sy-msgty,
v_msgid TYPE sy-msgid,
v_msgno TYPE sy-msgno,
v_msgv1 TYPE sy-msgv1,
v_msgv2 TYPE sy-msgv2.
DEFINE log_write.
v_subrc = sy-subrc.
v_msgty = &1.
v_msgid = &2.
v_msgno = &3.
v_msgv1 = &4.
v_msgv2 = &5.
call function 'RSAL_LOG_WRITE'
exporting
i_msgty = v_msgty
i_msgid = v_msgid
i_msgno = v_msgno
i_msgv1 = v_msgv1
i_msgv2 = v_msgv2.
sy-subrc = v_subrc.
END-OF-DEFINITION.
.
.
..
.
.
.
.
log_write 'E' "message type
'R3' "message class
'009' "message number
i_dsource "message variable 1
' '. "message variable 2
RAISE error_passed_to_mess_handler.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.