on 06-04-2009 10:59 AM
Hi together,
I have got the follwoing problem.
We have to implement a proof on a partner function regarding the role.
I found the BADI IF_EX_COM_PARTNER_BADI~COM_PARTNER_CHECK
I implement the the follwoing coding:
IF is_partner_wrk-partner_fct = 'ZADI0012'.
SELECT SINGLE * INTO ls_but100
FROM but100
WHERE partner = is_partner_wrk-external_partner_number
AND rltyp = 'BUP004'.
IF sy-subrc = 4.
MESSAGE e003(crm_ic_partner) WITH is_partner_wrk-external_partner_number.
ENDIF.
ENDIF.
when I enter a partner with a wrong role, I got the message I have implemented. Afterwards I type in a partner with the correct role I got a short dump.
Recursive call of function module 'CRM_ORDER_MAINTAIN'
Has anybody an idea how to solve this issue?
Thanks and best regards,
Sylvia
Hi Sylvia,
2 suggestions:
It is not recommended to use MESSAGE statements in the BADI's.
Please use the following FM's
CRM_MESSAGE_COLLECT and CRM_MESSAGES_DELETE to add / remove messages.
Also check if this method can be used to remove messages based on your requirement.
IF_EX_COM_PARTNER_BADI~COM_PARTNER_MESSAGE_DELETE
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Naresh,
I changed the coding to FM CRM_MESSAGE_COLLECT
CALL FUNCTION 'CRM_MESSAGE_COLLECT'
EXPORTING
iv_caller_name = 'ORDER'
iv_ref_object = IS_PARTNER_CONTROL-DOCUMENT_ID
IV_REF_KIND = 'A'
iv_msgno = '003'
iv_msgid = 'CRM_IC_PARTNER'
iv_msgty = 'E'
iv_use_frame_log = 'X'
EXCEPTIONS
not_found = 1
appl_log_error = 2.
The short dump not ocuurs any longer. But the message is not shown in the log.
Do you have an idea?
Thanks!
Sylvia
Hi,
I found the solution
Thanks and best regards
DATA: ls_but100 TYPE but100,
ls_msgid TYPE bal_s_msid,
ls_msgno TYPE bal_s_idno,
lt_msgid TYPE TABLE OF bal_s_msid,
lt_msgno TYPE TABLE OF bal_s_idno,
lv_partner TYPE symsgv,
lv_guid TYPE crmt_object_guid.
IF is_partner_wrk-partner_fct = 'ZADI0012'.
SELECT SINGLE * INTO ls_but100
FROM but100
WHERE partner = is_partner_wrk-external_partner_number
AND rltyp = 'BUP004'.
IF sy-subrc = 4.
lv_partner = is_partner_wrk-external_partner_number.
CALL FUNCTION 'COM_PARTNER_MESSAGE_COLLECT_OW'
EXPORTING
is_partner_control = is_partner_control
iv_msgno = '003'
iv_msgid = 'CRM_IC_PARTNER'
iv_msgty = 'E'
iv_msgv1 = lv_partner.
ELSE.
ls_msgid-sign = 'I'.
ls_msgid-option = 'EQ'.
ls_msgid-low = 'CRM_IC_PARTNER'.
APPEND ls_msgid TO lt_msgid.
ls_msgno-sign = 'I'.
ls_msgno-option = 'EQ'.
ls_msgno-low = '003'.
APPEND ls_msgno TO lt_msgno.
CALL FUNCTION 'COM_PARTNER_MESSAGES_DELETE_OW'
EXPORTING
is_partner_control = is_partner_control
it_r_msgid = lt_msgid
it_r_msgidno = lt_msgno
iv_docnumber = is_partner_wrk-guid.
ENDIF.
ENDIF.
Hi scharfen,
We got the similar requirement what you implemented.I implemented the below code but the error message is coming 3 times.
I have got the follwoing problem.
We have to implement a check on a partner function regarding the role.
I found the BADI IF_EX_COM_PARTNER_BADI~COM_PARTNER_CHECK
I implemented the the follwoing coding:
method IF_EX_COM_PARTNER_BADI~COM_PARTNER_CHECK .
DATA: lw_but100 TYPE but100,
lw_but000 TYPE but000,
lw_msgno TYPE bal_s_idno,
lt_msgno TYPE bal_r_idno,
l_partner TYPE symsgv,
lw_low TYPE balmsgidno.
IF is_partner_wrk-PARTNER_FCT = '00000009'.
SELECT SINGLE * INTO lw_but000
FROM BUT000
WHERE partner = is_partner_wrk-external_partner_number
AND TYPE = '2'.
IF sy-subrc EQ 0.
SELECT SINGLE * INTO lw_but100
FROM but100
WHERE partner = is_partner_wrk-external_partner_number
AND rltyp = 'BUP004'.
IF sy-subrc = 0.
REFRESH lt_msgno.
lw_msgno-sign = 'I'.
lw_msgno-option = 'EQ'.
lw_low-msgid = '/DS1/A'.
lw_low-msgno = '139'.
lw_msgno-low = lw_low.
APPEND lw_msgno TO lt_msgno.
CALL FUNCTION 'CRM_MESSAGES_DELETE'
EXPORTING
IT_R_MSGIDNO = lt_msgno
iv_ref_object = is_partner_wrk-guid.
l_partner = is_partner_wrk-external_partner_number.
CALL FUNCTION 'COM_PARTNER_MESSAGE_COLLECT_OW'
EXPORTING
is_partner_control = is_partner_control
iv_msgno = '139'
iv_msgid = '/DS1/A'
iv_msgty = 'E'
iv_msgv1 = l_partner.
ELSE.
REFRESH lt_msgno.
lw_msgno-sign = 'I'.
lw_msgno-option = 'EQ'.
lw_low-msgid = '/DS1/A'.
lw_low-msgno = '139'.
lw_msgno-low = lw_low.
APPEND lw_msgno TO lt_msgno.
CALL FUNCTION 'CRM_MESSAGES_DELETE'
EXPORTING
IT_R_MSGIDNO = lt_msgno
iv_ref_object = is_partner_wrk-guid.
ENDIF.
ENDIF.
ENDIF.
endmethod.
when I enter a partner with a wrong role, I got the message I have implemented. But the message is appearing 3 times in the errorlog. Can anyone please let me know the reason for this and solution to resolve this.
Regards,
Swetha
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.