Skip to Content
avatar image
Former Member

BAPI_MATERIAL_SAVEDATA error handling

Hello all, I'm using this BAPI to update some materials and I'm having problems handling the error messages.

This is my code:

    CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
      EXPORTING
        headdata       = header
        plantdata      = w_marc
        plantdatax     = w_marcx
        valuationdata  = w_mbew
        valuationdatax = w_mbewx
      IMPORTING
        return         = return
      TABLES
        returnmessages = return_msg.

as you can see I have seted the table returnmessages, but for some reason, there are some erros that are showed up in a window on the screen and the user must press ok for the procces to continue. Is there any way to avoid this kind of errors on a BAPI?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • May 19, 2006 at 01:15 PM

    That is very interesting because BAPIs are not supposed to fire messages that way. What kinds of messages are you seeing?

    Regards,

    Rich Heilman

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 19, 2006 at 01:16 PM

    Mauro,

    Ideally a BAPI is not supposed to throw any errors on the screen.I went through the source code of 'BAPI_MATERIAL_SAVEDATA' and found out at certain conditions some messages are being output instead of being stored in the return table.You cannot suppress them.However what you can do is to ensure that the data being passed is as correct as possible.

    Additionally i tried looking for some import parameter which will suppress these forced messages.Seems there is no such parameter available.

    Reward helpful answers

    Cheers

    Nishanth

    Message was edited by: Nishanth Bhandar

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 01, 2007 at 06:47 PM

    Hi,

    I had the same issue with another BAPI. It turned out to be a config problem and someone added a substitution rule that caused the pop up. Check config. If it is pop up messages that you are getting, you can debug the dialog and from there you can see what is wrong.

    Good luck,

    seema

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 29, 2007 at 06:03 AM

    dera mauro,

    could you plz send me you code...i am using this bapi for the first time

    Add comment
    10|10000 characters needed characters exceeded