08-11-2009 3:50 PM
Hi Folks,
I am trying to fill the IDoc error status when processing inbound ORDERS IDoc.
Code looks OK.
But i am not getting the IDoc in error status.
Pl look @ the code and let me know.
data: w_errtab like errtab occurs 0 with header line.
if condition fails.
move derrtab to w_errtab.
w_ERRTAB-ARBGB = 'IDOC_ADAPTER'.
w_ERRTAB-CLASS = 'E'.
w_ERRTAB-MSGNR = '902'.
w_ERRTAB-MSGV1 = xvbak-bstdk.
w_ERRTAB-MSGV2 = s_kunnr.
w_ERRTAB-MSGV3 = s_vbeln.
append w_ERRTAB.
DESCRIBE TABLE w_errtab LINES sy-tfill.
derrtab = w_errtab.
endif.
The IDoc status is still 53.
Thanks,
Matt
08-11-2009 4:09 PM
08-11-2009 4:09 PM
08-11-2009 4:31 PM
08-11-2009 4:57 PM
call customer-function '011'
exporting
dxvbak = xvbak
docnum = idoc_contrl-docnum
tables
derrtab = errtab
dxvbap = xvbap
dxvbep = xvbep
dxvbadr = xvbadr
dxvbpa = xvbpa
dxvbuv = xvbuv
dedidc = idoc_contrl
dedidd = idoc_data
dxkomv = xkomv
dxvekp = xvekp
dyvekp = yvekp.
describe table errtab lines anzahl.
if anzahl gt 0 and input_method = 'X'.
export errtab to memory id 'idoc_test_errtab'.
endif.
if anzahl gt 0 and
xaprau eq 'D'.
loop at errtab where arbgb eq 'VG' and
msgnr eq '219'.
anzahl = anzahl - 1.
endloop.
if anzahl eq 0.
refresh errtab.
endif.
endif.
if anzahl ne 0
and input_method is initial.
perform determine_user.
perform statusrecord tables errtab. " This is place in which IDOC_STATUS table get filled from
" ERRTAB. Please check whether your IDOC_STATUS have
" the Error record 51 that you inserted
call customer-function '010'
exporting
docnum = idoc_contrl-docnum
tables
derrtab = errtab
xbdidocstat = idoc_status.
else.
a®
08-11-2009 5:07 PM
Hi,
when the below line of code is executed,
describe table errtab lines anzahl.
even though the errtab contain a record, anzahl = 0, i don't understand why?
When i debug the code, anzahl is 0, why?? at this point of time my errtab is not initial. It contains a record
Can you pl help me what i am doing wrong??
Thanks,
Matt
Edited by: Creasy Matthew on Aug 11, 2009 6:08 PM
08-11-2009 5:16 PM
Hi
This is your code:
data: w_errtab like errtab occurs 0 with header line.
if condition fails.
move derrtab to w_errtab.
w_ERRTAB-ARBGB = 'IDOC_ADAPTER'.
w_ERRTAB-CLASS = 'E'.
w_ERRTAB-MSGNR = '902'.
w_ERRTAB-MSGV1 = xvbak-bstdk.
w_ERRTAB-MSGV2 = s_kunnr.
w_ERRTAB-MSGV3 = s_vbeln.
append w_ERRTAB.
DESCRIBE TABLE w_errtab LINES sy-tfill.
derrtab = w_errtab.
endif.
I can see you append the record in a your own internal table W_ERRTAB, but I can't see where u append the record in the table parameter DERRTAB of the user-exit interface.
There's this line
derrtab = w_errtab.
But here u're fill the headerline of DERRTAB, so any record is appended here, u should write:
APPEND DERRTAB.
Max
08-11-2009 5:20 PM
And also one more point to Max reply you need to change this line
move derrtab to w_errtab.
to
w_errtab[] = derrtab[].
a®
08-11-2009 5:19 PM
change your last line in the code
derrtab = w_errtab.
to
derrtab[] = w_errtab[].