Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Fill Idoc error status

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

former_member194669
Active Contributor
0 Kudos

Which Customer exit do you using for this ?

7 REPLIES 7

former_member194669
Active Contributor
0 Kudos

Which Customer exit do you using for this ?

0 Kudos

EXIT_SAPLVEDA_011

0 Kudos

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.

0 Kudos

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

0 Kudos

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

0 Kudos

And also one more point to Max reply you need to change this line


move derrtab to w_errtab.

to


w_errtab[] = derrtab[].

Former Member
0 Kudos

change your last line in the code


derrtab = w_errtab. 

to



derrtab[] = w_errtab[].