Search code examples
abapidocbadi

IDOC_CREATION_CHECK parameters filling?


I'm checking an implementation of the interface IF_EX_IDOC_CREATION_CHECK which has a method IDOC_DATA_CHECK with 3 parameters:

  1. IDOC_CONTROL type EDIDC
  2. IDOC_DATA type EDIDD_TT
  3. CREATE_IDOC type C

And my problem is that I can't find documentation in internet related to this interface nor examples. I want to know specifically what value does the parameter IDOC_DATA have when is called? Does it process IDocs from one material at a time or it carries all the IDocs of all the materials?

The code that is breaking my head is

loop at idoc_data assigning <it_data>.
  case <it_data>-segnam.
    when  'E1BPE1MATHEAD'. " Segment
      clear: it_mat,zliser.
      it_mathead = <it_data>-sdata.
      ...
      if sy-subrc eq 0. " -------> This 
        exit.           " -------> is my
      endif.            " -------> headache
...

When it comes to the exit. statement it goes out the loop without processing the next IDocs but I don't know exactly if it stops checking all the next IDocs of all the materials or the method IF_EX_IDOC_CREATION_CHECK~IDOC_DATA_CHECK is called again with the next set of IDocs of another material.

Unfortunately I can't run this interface with sample data because it directly changes data of other systems, so I just can read the code.

So if anyone has experience or reference in this issue I'd appreciate your help.

Thanks in advance.


Solution

  • The exit statement will cause the program to exit out of the loop, if the loop is the only processing block in the method, it will also exit the method.

    However, the BADI/method should be called again for each IDOC.

    Don't you have a development or QA environment where you could test this just to be sure?