‎2008 Jul 09 9:29 AM
i have one segment e1edp28 in idoc invoic02. i should block the idoc if herkl field in e1edp28 segment is initial.could u plz suggest me how to do it?
plz see if the following code works or not
IF ztype EQ c_zinvoic02
AND ztype1 EQ c_invoic02.
if edi_e1edp28-herkl is initial.
MESSAGE E018 WITH 'Country of origin of material needs to be entered'.
‎2008 Jul 09 9:38 AM
‎2008 Jul 09 9:32 AM
Hi,
You have to update the status table with your error message.
Check the std FM IDOC_INPUT_ORDERS is you scroll down in the FM you will see how the status message is updated..
* füllen IDOC_Status
* fill IDOC_Status
IF ok = space.
idoc_status-docnum = idoc_contrl-docnum.
idoc_status-status = beleg_nicht_gebucht.
IF check_orga = 'X'.
idoc_status-msgty = 'E'.
idoc_status-msgid = 'VG'.
idoc_status-msgno = '204'.
idoc_status-msgv1 = xvbak-kunnr.
idoc_status-msgv2 = lieferant.
APPEND idoc_status.
ELSE.
idoc_status-msgty = sy-msgty.
idoc_status-msgid = sy-msgid.
idoc_status-msgno = sy-msgno.
idoc_status-msgv1 = msgv1.
idoc_status-msgv2 = msgv2.
idoc_status-msgv3 = msgv3.
idoc_status-msgv4 = msgv4.
APPEND idoc_status.
ENDIF.
ELSE.Hope this helps
Cheers
VJ
‎2008 Jul 09 9:38 AM
‎2008 Jul 09 9:40 AM
Hi,
I believe that you are having a custom posting program to update the segments. If you have custom program then just update the status segments as i have posted in my previous post.
if you have std function module and not a custom program then you will have a USER EXIT to update the status segments. Kindly check and see where you can update the status segments.
let me know if you need more info.
Cheers
VJ