Skip to Content
0
Former Member
Aug 04, 2008 at 05:25 PM

Error during idoc creation

20 Views

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.