Skip to Content
author's profile photo Former Member
Former Member

Inconsistent Errors when processing IDocs using custom Function Module

I am encountering a most perplexing error. Here is the situation.

We have a custom function module to update data in the EH&S system. We are having a bizarre error occurring. This is the basic processing of the function module:

1. IDoc data is read and loaded into an internal table.

2. Data is run through a series of checks to determine if the data is valid for entry into the system.

3. After validation we use function module C1F2_SUBSTANCES_READ_WITH_REF to read characteristic data for the substance. This data is used to validate whether current data exists to allow for loading of the IDoc data. (This is the step where the IDoc is receiving an error even if the data is valid. This only occurs if we are processing a large amount of Idocs and one IDoc contains valid data and another invalid data for the same substance. It occurs even if the Idocs are not processed in sequence. If individually processed or reprocessed after initial failure they pass. This is what is so confusing!) If it exists, a flag is set and the data is loaded using function module BAPI_BUS1077_CHANGE to modify the data.

4. If the flag is set to allow further processing, the function module C1F2_SUBSTANCES_READ_WITH_REF is used again to select different characteristic data for the substance. A similar validation process occurs and if it passes, data is loaded using BAPI_BUS1077_CHANGE to update and BAPI_BUS1077_CREATE to create new data.

Here is the situation:

When processing one valid record for one substance, the record loads successfully. When processing multiple valid records (all are valid) for one substance, they all load successfully. The problem occurs when attempting to load valid and invalid records for the same substance. Some times the program successfully loads the valid data (as expected). Other times, it will not load any records. It is not consistent!

The order of IDoc processing does not have an impact on the success of the load. Whether the valid or invalid record processes first does not have an impact on the success of the valid substance load.

Does anyone have ANY Idea of what is going on? I am clearing all fields in the function module before processing occurs. I cannot find what is causing the error to occur.


Jim Hardy

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jul 22, 2008 at 03:35 PM

    What about your COMMIT Work ? It´s look like a commit work an wait problem.

    Can you check ... when the commit work is done ?

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      I have some further information. It seems that if data for a substance is sent in two separate Idocs, one with valid and one with invalid data, As long as the two IDocs are processed consecutively, they process correctly. If they are separated by IDocs containing other substance information, they fail.



Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.