Yeah Demish .. ri8 ![]()
Hello Sunil,
Please find below updated piece of code;
LOOP AT result_package ASSIGNING <result_fields>.
IF <result_fields>-mattype = '1234 '."scenario 1
READ TABLE imat WITH KEY
material = <result_fields>-material
mattype = '1324'
INTO wmat BINARY SEARCH. (work area)
IF SY-SUBRC = 0.
<result_fields>-RESULT = wmat-zstype.
ENDIF.
ELSEIF <result_fields>-mattype = '3567' .scenario 2 (A)
IF <result_fields>-division = 'USET'.
READ TABLE imat WITH KEY
material = <result_fields>-material
mattype = '3567'
division = 'USET'
INTO wmat BINARY SEARCH. (work area)
IF SY-SUBRC = 0.
<result_fields>-RESULT = wmat-zstype.
ENDIF.
ELSE. "scenario 2 (B)
READ TABLE imat1 WITH KEY
material = <result_fields>-material
mattype = '3567'
INTO wmat BINARY SEARCH. (work area)
IF SY-SUBRC = 0.
<result_fields>-RESULT = wmat-zstype.
ENDIF .
ENDIF.
ENDLOOP.
Regards,
Hitesh