Skip to Content
avatar image
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.

HELP!

Jim Hardy

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    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 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.

      thanks

      Jim