Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

0IC_C03 better suggestion

Gurus,

any better suggestions please below ??

0IC_C03 generate export datasource

thanks

Former Member
Former Member replied

Hi,

in your update start routine, write something like the herehunder, all records having material with division different than "division1" or "division2" won't be processed (deleted from the data package)

*DECLARATIONS

DATA: BEGIN OF ls_material,
            MATERIAL LIKE /BI0/PMATERIAL-MATERIAL
            DIVISION LIKE /BI0/PMATERIAL-DIVISION,
          END OF ls_material.

TYPES: ly_material LIKE ls_material.

DATA: lt_material TYPE SORTED TABLE OF ly_material WITH UNIQUE KEY MATERIAL.

*processing

SELECT MATERIAL DIVISION
INTO CORRESPONDING FIELDS OF TABLE lt_material
FROM /BI0/PMATERIAL 
WHERE OBJVERS = 'A'.

LOOP AT data_package.
  READ TABLE lt_material INTO ls_material 
  WITH KEY MATERIAL = DATA_PACKAGE-MATERIAL
  BINARY SEARCH.

  IF SY-SUBRC = 0.
    CASE ls_material-DIVISION.
       WHEN "your_division1.
           CONTINUE.
       WHEN "your_division2.
           CONTINUE.
       WHEN OTHERS.
           DELETE DATA_PACKAGE.      
    ENDCASE. 
  ELSE 
    "material is not is the master data ???
  ENDIF.
ENDLOOP.

I just wrote the code without any checks so you may have some syntax errors...

In adition depending how many materials you have in total we might have to fill the internal table with only the material prsent in your data_package (using FOR ALL ENTRIES)...

just let us know how this goes...

Olivier.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question