2008 May 19 6:11 AM
Hi All,
I need to display some warning messages in IDOC status.
i can't use RAISING APPLICATION_ERROR as it will not post the IDOC , i just need to display the message but the IDOCS should be posted . I need to write this in the exit.
Could some one please provide me some solution.
Thanks,
Hem.
Hi All,
I need to display some warning messages in IDOC status.
i can't use RAISING APPLICATION_ERROR as it will not post the IDOC , i just need to display the message but the IDOCS should be posted . I need to write this in the exit.
Could some one please provide me some solution.
Thanks,
Hem.
2008 May 19 6:12 AM
Hi,
All idoc statuses are collected in internal table IDOC_STATUS.
Cheers.
...Reward if useful.
2008 May 20 11:51 AM
2008 May 21 3:08 PM
Hi Hem ,
Raise a warning message after the validation fails. Please find the sample code below.
********Start of validation for Invoice Receipt Flag*************
***Types Declaration
TYPES : BEGIN OF ty_temp_valid,
wepos TYPE wepos ,
weunb TYPE weunb,
webre TYPE webre,
xersy TYPE xersy,
repos TYPE repos,
END OF ty_temp_valid .
***Variable Declaration
DATA : l_sales_item TYPE posnr_va, "#EC NEEDED
it_tmp_idoc_data TYPE STANDARD TABLE OF edidd, "#EC NEEDED
it_temp_valid TYPE STANDARD TABLE OF ty_temp_valid,
wa_temp_valid LIKE LINE OF it_temp_valid, "#EC NEEDED
it_ekpo TYPE TABLE OF ekpo,
wa_ekpo LIKE LINE OF it_ekpo.
***Constant Declaration
CONSTANTS : c_msgid_zaf TYPE symsgid VALUE 'ZAF', "#EC NEEDED
c_msgtyp_e TYPE symsgty VALUE 'E', "#EC NEEDED
c_msgno_999 TYPE symsgno VALUE '999'. "#EC NEEDED
Loop at t_idoc_data INTO is_edidd
where segnam = c_segnam_e1edp02. "#EC *
MOVE: is_edidd-sdata TO is_e1edp02,
is_e1edp02-belnr TO l_ebeln,
is_e1edp02-zeile TO l_ebelp.
SELECT SINGLE * FROM ekpo INTO wa_ekpo WHERE ebeln = l_ebeln
AND ebelp = l_ebelp
AND wepos c_x
AND weunb c_x
AND webre c_x
AND xersy c_x
AND repos = c_x.
IF sy-subrc NE 0.
message W899(F4) with text-002.
ENDIF .
clear: wa_ekpo.
endloop.
**************End of validation for Invoice Receipt Flag**************
Use text elements for the your custom message.
I hope it resolve ur problem .Please let me know if u have any query
Rgds
Sree M
2008 May 21 3:13 PM
Here is an example:
IF wa_e1p0002 IS INITIAL OR
wa_e1p0006 IS INITIAL OR
wa_e1p0008 IS INITIAL .
wa_bapiret-type = c_e. " Check work area is getting cleared or not.
wa_bapiret-id = 'ZHR'.
wa_bapiret-number = '009'.
wa_bapiret-message_v1 = c_e1p0001.
v_status = c_idoc_stat_error.
PERFORM idoc_status
TABLES i_idocdata
idoc_status
return_variables
USING idoc_contrl
wa_bapiret
v_status
workflow_result.
ENDIF.
FORM idoc_status TABLES p_idocdata STRUCTURE edidd
p_idoc_status STRUCTURE bdidocstat
p_r_variables STRUCTURE bdwfretvar
USING p_idoc_contrl LIKE edidc
value(p_retn_info) LIKE bapiret2
p_v_status TYPE edi_status
p_wf_result LIKE bdwf_param-result.
CLEAR wa_idoc_status.
wa_idoc_status-docnum = p_idoc_contrl-docnum.
wa_idoc_status-msgty = p_retn_info-type.
wa_idoc_status-msgid = p_retn_info-id.
wa_idoc_status-msgno = p_retn_info-number.
wa_idoc_status-appl_log = p_retn_info-log_no.
wa_idoc_status-msgv1 = p_retn_info-message_v1.
wa_idoc_status-msgv2 = p_retn_info-message_v2.
wa_idoc_status-msgv3 = p_retn_info-message_v3.
wa_idoc_status-msgv4 = p_retn_info-message_v4.
wa_idoc_status-repid = sy-repid.
wa_idoc_status-status = p_v_status.
INSERT wa_idoc_status INTO p_idoc_status INDEX 1.
CLEAR : wa_variables, p_wf_result.
IF p_v_status = c_idoc_stat_error.
p_wf_result = c_wf_result_error.
wa_variables-wf_param = c_wf_par_error.
wa_variables-doc_number = p_idoc_contrl-docnum.
READ TABLE p_r_variables TRANSPORTING NO FIELDS FROM wa_variables.
IF sy-subrc <> 0.
APPEND wa_variables TO p_r_variables.
ENDIF.
ELSEIF p_v_status = c_idoc_stat_ok.
p_wf_result = c_wf_result_ok.
READ TABLE p_r_variables TRANSPORTING NO FIELDS FROM wa_variables.
IF sy-subrc <> 0.
wa_variables-wf_param = c_wf_par_ok.
wa_variables-doc_number = p_idoc_contrl-docnum.
APPEND wa_variables TO p_r_variables.
wa_variables-wf_param = c_wf_par_appl_objects.
APPEND wa_variables TO p_r_variables.
ENDIF.
ENDIF.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |