Register Login

Problem with IDOC update from User Exit

Updated May 18, 2018

I have an Inbound EDI 850 Purchase Order to create and SAP Sales Order. This comes into the iDoc ORDERS05 for processing by Function Module IDOC_INPUT_ORDERS.

Within the include program (ZXVEDU13) on the user exit (EXIT_SAPLVEDA_ 011). I am updating customer information (sold-to & ship-to customer numbers) on the internal tables DEDIDD and DXVBPA. In a debug session, I can see this is working correctly. I can also see that the tables have been updated upon returning from the User Exit back to the main program (the internal tables of the main program are IDOC_DATA and XVBPA, respectively) .

When I "continue" from the debug session within the main program, the iDoc processing continues, but my data changes have been lost, and the processing picks up on the original unmodifed data.

Any suggestions on how to correct this problem?


  • 22 Sep 2009 5:08 am saperpguru
    Check what parameter of the FM you are changing where the include program is located. Importing parameters cannot be changed.
  • 22 Sep 2009 5:10 am Shalesh Singh Visen
    I think function module exit EXIT_SAPLVEDA_ 011 will be triggered after IDoc number generated. This user exit will be used to manipulate the error message table ERRTAB. Try this function module EXIT_SAPLVEDA_ 012 for changing internal table entries.
  • 22 Sep 2009 6:00 am Shalesh Singh Visen
    I noticed that! Also, some user exist don't have visiblility of the iDoc! Example: 007 (FM EXIT_SAPLVEDA_ 007)
  • 22 Sep 2009 6:00 am Shalesh Singh Visen
    Thanks for the response. I have been doing a quite a bit of investigating.

    Curiously, I didn't get "012" to come up on a break point.

    Here seems to be the sequence of User Exits that are encountered.

    >> the VA01 is called

    SAP Note 753153 helps, but still falls short of significant documentation. (I've been working on SAP systems since 1995. It seems like they prefer to sell consulting services rather than provide system documentation. ) The SAP Note suggests that "012" is for configirable materials. We just have regular materials. "007" doesn't have access to the iDoc. Most of my "success" so far is within "009" (not discussed in the SAP Note.) I still have a problem:

    The Big Picture: We intend to use the iDoc to bring in the EDI transaction. This is for an existing customer (EDI trading partner) and existing materials with pre-determined pricing. When the item comes in, the first thing done is to setup the customer sold-to and ship-to. From here, we can determine which of our Sales Organizations will handle the transaction. Next look at the material. Although the material should already exist, there is one class of materials (by material group) that is considered "custom" and have to be handled by a human before a sales order can be created. So, these orders have to be passed to SAP WorkFlow. the rest of the items can be processed into a Sales Order. This is all pretty simple stuff. Not recket science!

    Here's my latest problem: When I process the iDoc using Transaction WE19 (the iDoc Test Tool), the data is processed properly with the changes that I apply in my User Exists. Looks like I'm on the right track. If the idoc is processed from the WorkFlow, big problem, the changes are not available. This is beyond my understanding! Most of the changes that I make (in "009") are with the tables such as XVBADR, XVBAP. ("011" changes DEDIDD, XVBPA, XVBADR) I understand that the changes that I make in the iDoc internal tables do not get saved into the db tables .. although, shouldn't that be the idea of a user exit?
  • 26 Sep 2009 8:43 am Shalesh Singh Visen
    Although this project is not yet complete, I have some update information. Looks like I have a solution.

    In summary here are the User Exits that I used on Function Module IDOC_INPUT_ORDERS and the tables that I changed..

    User Exit 009 (Function Module EXIT_SAPLVEDA_ 009, include ZXVEDU11)
    DXVBAK (change customer number, Sales Org., Customer PO)
    DXVBADR (change customer numbers)
    DXVBAP (change Material)

    User Exit 011 (Function Module EXIT_SAPLVEDA_ 011, include ZXVEDU13)
    DEDIDD (change customer numbers, Sales Org, Unit of Measure & Quantity)
    DXVBPA (change customer numbers)
    DXVBADR (change customer numbers)
    DXVBAK (ready only)

    One "got-cha" that caused me some problems is my incomplete coding resulted in some blank entries that were passed back to the main function module. Make sure that an un-used or undefined "ELSE" doesn't result in a blank field.