Skip to Content

How to EDIT Incoming Idoc Data in Processing Function Module

Hello Team,

We have an issue while editing Idoc data in SAP system.

We are getting materials from another system via MATMAS idoc and in SAP we have configured internal number range for material master creation for the particular material type.

When Idoc comes into the system we are calling FM BAPI_MATERIAL_GETINTNUMBER to get next available material number from number range and adding this number to Idoc MATNR field.

This logic processing the idocs successfully but when I check the data into idoc the field MATNR doesn't have any value.

Please let me know how we can overcome this issue?

I have taken reference from below thread:

https://archive.sap.com/discussions/thread/1954090

Thanks & Regards,

Piyush

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Aug 21, 2017 at 06:52 AM

    Sorry for replying very late to this thread, but I found the way to tackle this situation.

    There is FM BAPI_MATERIAL_GETINTNUMBER which fetches the next available number from number range.

    I just cross checked this logic by calling above FM in LSMW.

    LSMW Step: Maintain Field Mapping and Conversion Rules

    For MATNR field I have written a small piece of code which gets the next available number and insert this into idoc MATNR field.

    DATA :LS_MATNR TYPE BAPIMATINR.
    DATA: LT_MATNR TYPE TABLE OF BAPIMATINR.
    if ERSA_SOURCE-MATNR is initial.
    CALL FUNCTION 'BAPI_MATERIAL_GETINTNUMBER'
      EXPORTING
        MATERIAL_TYPE          = ERSA_SOURCE-MTART
       INDUSTRY_SECTOR        = 'C'
       REQUIRED_NUMBERS       = 1
      TABLES
    MATERIAL_NUMBER        = LT_MATNR.
    READ TABLE LT_MATNR INTO LS_MATNR INDEX 1.
    E1MARAM-MATNR = LS_MATNR.
    endif.
    

    Thanks!!!

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 31, 2017 at 12:31 PM

    i guess you are missing commit statement somewhere in the program

    Add a comment
    10|10000 characters needed characters exceeded