Skip to Content
author's profile photo
Former Member

Return Order Number with Bapi_Alm_Order_Maintain

I have written an app with Visual Studio and the SAP .NET Connector that calls Bapi_Alm_Order_Maintain to create a PM work order in SAP. It is working properly, however, I have read that SAP is supposed to return the order ID number of the newly created order in the parameter ET_Numbers. All I get back in ET_numbers is "%00000000001". can you help me understand why I don't get the new Order number back in this table?

the operation is successful and the order is created. I see the following information in the BAPIRET2Table:

SAP Return Message: Order saved with number 91074455

SAP Return Type: S

SAP Return Message: S:IWO_BAPI2:112 %00000000001 91074455

SAP Return Type: S

SAP Return Message: S:IWO_BAPI2:110

SAP Return Type: S

But, I don't want to have to parse the new order number out of the BAPIRET2Table. This doesn't seem reliable, especially when my code will be running on different installations of SAP around the world.

any help would be appreciated!

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • author's profile photo
    Former Member
    Posted on Jun 01, 2007 at 06:25 PM

    You wouldn't need to parse the BAPIRET2 since the order number would be in the Message_V2 property. I've seen programmers just grab the order number from there.

    ET_NUMBERS should have two properties the incoming number (Aufnr_In) and the order number issued (Aufnr_New). Are both properties coming back "%00000000001"?

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member


      I have tried the SE37 and I see the same thing there that I see when I run my program. I don't really know how to run the program with the .NET Co trace file enabled. I have the .NET Connector calls built in a Visual Studio 2003 class library and then I reference that class lib from a Visual Studio 2005 forms project. Can you tell me how I'd turn that trace on?

      You mentioned that when you run this BAPI in your environment that the number is passed back properly. I was curious if there's some parameter I'm not passing in that is needed. Currently, I populate and pass in the following tables:






      I populate nothing in any other table (including the BAPI_ALM_NUMBERSTable).

      Many Thanks for your continued help!