2008 Aug 04 6:25 PM
Hi Experts,
In the below i am trying to check for the value of one field in the segment. If its value is initial then an alert has to be sent to the support team. how do i accomplish the same.
thanks in advance.
REPORT ZTESTIDOC.
communication IDOC generated
data: lt_edidc type standard table of edidc,
wa_edidc like line of lt_edidc.
data: lt_edidd type standard table of edidd,
wa_edidd like line of lt_edidd.
data: lv_seg_name type edidd-segnam value 'Z1PSXYZ',
lv_msg_type type edidc-mestyp value 'ZPSZYZ,
lv_idoc_type type edidc-idoctp value 'ZPSXYZ01',
ls_pstput type z1pstput.
IDOC control record
data : ls_control_record_out like line of lt_edidc.
Build Control Record from EDP13
select doctyp rcvpor rcvprt rcvprn rcvpfc std stdvrs stdmes
mescod mesfct outmod test cimtyp mestyp from edp13 up to 1 rows
into corresponding fields of ls_control_record_out
where mestyp = lv_msg_type .
endselect.
ls_control_record_out-idoctp = lv_idoc_type.
' need to check if ls_psput-field2 is initial if yes then an alert has to be sent.
wa_edidd-segnam = lv_seg_name .
wa_edidd-sdata = ls_pstput.
append wa_edidd to lt_edidd.
call function 'Z_MASTER_IDOC_DISTRIBUTE' in background task
exporting
p_master_idoc_control = ls_control_record_out
pt_communication_idoc_control = lt_edidc
pt_master_idoc_data = lt_edidd.
2008 Aug 05 1:46 PM
I understand you do want to send the alert after the Idoc is triggered. The idoc data is stored in the table EDID4. You may select the corresponding segment record for the idoc created from EDID4 . You should be knowing the offset of the field ( You may physically check the offset of the field in the segment). check the value for the offset and you can trigger the alert.
But remember accessing EDID4 may consume lot of resources.
Hope this helps.