‎2007 Jun 22 12:12 AM
Hello All,
I am trying to stop the idoc by some conditions like given below code in one of the user exit. I am able to append the error record in standard errtab internal table.
I could see the appended error record also. But it is not throwing any error message. IDOC is created successfully. Please check the given code and correct me where i went wrong?
ExitName: EXIT_SAPLVEDA_001
*Check for existing Project Numbet and Version. If already exists in system throw the error in IDOC
IF ZE1EDK02-QUALF EQ '001'.
hxvbak = dxvbak.
v_bstnk = ZE1EDK02-BELNR.
select bstnk vsnmr_v into corresponding fields of table i_vbak from vbak
where bstnk = v_bstnk
and vsnmr_v = hxvbak-vsnmr_v.
describe table i_vbak lines l_lines.
if l_lines > 1.
sy-msgno = '209'.
sy-msgid = 'VG'.
raise user_error.
endif.
clear hxvbak.
ENDIF.
‎2007 Jun 22 12:17 AM
Hi Cris,
I don't think by using Raise you will be able to raise the error. Better write Meesage of type E or the best option is delete the entry from the IDOC for which you don't want IDOC to be generated.
Regards,
Atish
‎2007 Jun 22 3:03 AM
Hi Atish,
Thanks for your quick reply...Actually my logic is working. I haven't checked properly. we can throw the error message.
Thanks
Cris
‎2007 Nov 23 4:33 AM
hi cris,
i have the same requirement,
can u help me out in this problem,i am very much new to ale/idoc.
my requirement is
if idoc_data-segnam = 'e1edk02'.
if e1edk02-qualf = '011'.
xvbak-xblnr = e1edk02-belnr.
endif.
endif.
waiting for your reply