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: 

PRELIMINARY_POSTING_FB01 converting warning message to error message

Private_Member_49934
Contributor
0 Kudos

Dear Gurus,

I struggled hard to find the fm or bapi to do parking of FI documents and after going through multiple threads at SDN i found that the function module PRELIMINARY_POSTING_FB01 can be used for the purpose. I tested and it seems to work except for the problem the it is aborting the process when it should through warning.

This FM call another FM FI_POSTING_KEY_CHECK which throws the warning message

IF NOT SY-SUBRC IS INITIAL.
     MESSAGE W832 WITH I_BSCHL I_UMSKZ I_LANGU RAISING POSTING_KEY_TEXT.
    ELSE.
      LM_TBSLT = TBSLT.
      APPEND LM_TBSLT.
    ENDIF.

but the processing stops ther and the FM returns the same as error (Message type E). The same function module is called in the transaction FB01 and there it shows warning which can be ignored by pressing enter. Any clue how to overcome it.

Any Help will be appreciated .

Thanks and Regards,

Kumar Gaurav

2 REPLIES 2

brad_bohn
Active Contributor
0 Kudos

F5 is one of those message classes that can be configured to behave differently by user - do you have this configured? (FI Global Settings - Documents)

anete
Participant
0 Kudos

Catch error message by adding exception to function module call and checking sy-subrc:

* Park document

  CALL FUNCTION 'PRELIMINARY_POSTING_FB01'

    EXPORTING

      i_tcode       = 'FV60'

    TABLES

      t_bkpf        = t_bkpf

      t_bseg        = t_bseg

      t_bsec        = t_bsec

      t_bset        = t_bset

      t_bsez        = t_bsez

      t_bkorm       = t_bkorm

      t_thead       = t_thead

    EXCEPTIONS

      error_message = 1.