on 11-14-2007 1:44 AM
hello Expert!!!!
How to use function 'CRM_MESSAGE_COLLECT' for warning message ?
I can using function 'CRM_MESSAGE_COLLECT' for error message . But for warning message I can't . please help
data lv_save_message .
MESSAGE w002(ZEO001) into lv_save_message.
CALL FUNCTION 'CRM_MESSAGE_COLLECT'
EXPORTING
iv_caller_name = 'ORDERADM_H'
iv_ref_object = iv_guid
iv_cumulate = 'X'.
advance thanks.
Hi,
Where exactly you calling 'CRM_MESSAGE_COLLECT' to add the warning message in the 1 order flow? in the order save BADI?.
Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
CRM by default doesn't persist warning messages in database. Hence once you goto display mode they will not be shown.
What you need to do for that is that when you call CRM_MESSAGE_COLLECT it will return the message handle in the export parameter es_msg_handle.
Using that you make call to BAL_DB_SAVE and after that BAL_GLB_MEMORY_REFRESH ( for this pass the parameter i_refresh_all = space otherwise it will refresh all messages).
This should show the warning message in display mode also.
~Kiran
Hello Kiran
I already follow suggestion . It's work but It have one big problem .When I delete all item and then I save , It will show 'Log not found' and then I click save again ,It's shot dump .
this is my code
MESSAGE w001(zeo002) INTO lv_save_message.
CALL FUNCTION 'CRM_MESSAGE_COLLECT'
EXPORTING
iv_caller_name = gc_object_name-orderadm_h
iv_ref_object = iv_guid
iv_msgno = sy-msgno
iv_msgid = sy-msgid
iv_msgv1 = w_msg_w-msgv1
iv_ref_kind = gc_object_kind-orderadm_h
iv_msgty = sy-msgty
IMPORTING
es_msg_handle = t_es_msg_handle
EXCEPTIONS
not_found = 1
appl_log_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
APPEND t_es_msg_handle-log_handle TO lt_t_log_handle.
"save warning message into database
CALL FUNCTION 'BAL_DB_SAVE'
EXPORTING
i_t_log_handle = lt_t_log_handle
EXCEPTIONS
log_not_found = 1
save_not_allowed = 2
numbering_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
"refresh log message
CALL FUNCTION 'BAL_GLB_MEMORY_REFRESH'
EXPORTING
i_refresh_all = ' '
i_t_logs_to_be_refreshed = lt_t_log_handle
EXCEPTIONS
not_authorized = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
What I suppose to do? Please Help!!!!!
Advance thanks,
Kritamate Vimonsoponkitti
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.