Skip to Content

Status record for failed IDOC not getting updated

Hi Experts,

There is a custom Inbound IDOC in which I have used FM L_TO_CREATE_SINGLE in process code.

Everything is fine when there are no exceptions raised by FM. FM returns to program(process code where I have used it) and the rest of the program gets executed as expected.

When there are some data issue in the process, FM is raising an exception but control is not returning back to the calling program. Due to this logic after FM call is not getting executed and IDOC is set with error.

Kindly help to get through this issue.

Regards,

Kumar S

Add comment
10|10000 characters needed characters exceeded

  • I'm confused by this part: "raising an exception but control is not returning back to the calling program". What do you mean exactly? What happens in the program?

    If it's a catchable exception then you need to use TRY... CATCH but that'd be an RTFM question.

    And if an exception is just not propagated by some standard program then it's the whole different story. You might want to provide more details.

  • Get RSS Feed

2 Answers

  • Jul 19, 2017 at 03:00 AM

    Kumar, the idoc processing function module has to have a signature(interface parameters) in a certain format, for example, see "IDOC_INPUT_ORDERS" ( table params idoc_status etc).

    What you can do is to wrap L_TO_CREATE_SINGLE in a Z-function module and use this for your process code.

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 18, 2017 at 12:05 PM

    Hello,

    You should use TRY CATCH block and, if you can, declare detailed EXCEPTIONS instructions. Something like this :

    DATA l_except_root TYPE REF TO cx_root.
    TRY.
    [..]
    CALL FUNCTION 'L_TO_CREATE_SINGLE'
    [..]
     EXCEPTIONS
       NO_TO_CREATED               = 1
       BWLVS_WRONG                 = 2
       BETYP_WRONG                 = 3
       BENUM_MISSING               = 4
       BETYP_MISSING               = 5
       FOREIGN_LOCK                = 6
       VLTYP_WRONG                 = 7
       VLPLA_WRONG                 = 8
       VLTYP_MISSING               = 9
       NLTYP_WRONG                 = 10
       NLPLA_WRONG                 = 11
       NLTYP_MISSING               = 12
       RLTYP_WRONG                 = 13
       RLPLA_WRONG                 = 14
       RLTYP_MISSING               = 15
       SQUIT_FORBIDDEN             = 16
       MANUAL_TO_FORBIDDEN         = 17
       LETYP_WRONG                 = 18
       VLPLA_MISSING               = 19
       NLPLA_MISSING               = 20
       SOBKZ_WRONG                 = 21
       SOBKZ_MISSING               = 22
       SONUM_MISSING               = 23
       BESTQ_WRONG                 = 24
       LGBER_WRONG                 = 25
       XFELD_WRONG                 = 26
       DATE_WRONG                  = 27
       DRUKZ_WRONG                 = 28
       LDEST_WRONG                 = 29
       UPDATE_WITHOUT_COMMIT       = 30
       NO_AUTHORITY                = 31
       MATERIAL_NOT_FOUND          = 32
       LENUM_WRONG                 = 33
       OTHERS                      = 34
              .
    if sy-subrc is not initial.
    * Deals with functionnal error here
    endif.
    [...]
    
    CATCH cx_root into l_except_root.
    * Deals with technical error here having a look at l_except_root->get_text( ).
    ENDTRY.

    Best regards

    Bertrand

    Add comment
    10|10000 characters needed characters exceeded