Skip to Content

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

please help to change this code

Hi All,

I am not abaper but i have to work on this code, currently i have this code in this code i need to exclude the the storage type belongs = 001.

Below i would like to exclude LGTYP = 001

the problem is here it is comparing the two materials and giving the error message, below for the storage type 001 it should exclude.

**************************************************************************************

IF sy-subrc EQ 0.

IF LV_MATNR NE I_LTAP-MATNR.

LV_ERR = c_x.

**************************************************************************************

*Get data.

SELECT * FROM ZWM_SINGLEMAT INTO TABLE LV_ZWM_SINGLEMAT

WHERE LGNUM = I_T331-LGNUM AND

LGTYP = I_T331-LGTYP AND

SINGLE = 'X'.

*Process data

READ TABLE LV_ZWM_SINGLEMAT.

IF sy-subrc EQ 0.

SELECT SINGLE MATNR INTO LV_MATNR FROM LQUA

WHERE LGNUM = I_T331-LGNUM AND

LGTYP = I_T331-LGTYP AND

LGPLA = I_LTAP-NLPLA.

IF sy-subrc EQ 0.

IF LV_MATNR NE I_LTAP-MATNR.

LV_ERR = c_x.

ELSE.

CLEAR LV_ERR.

ENDIF.

ENDIF.

ENDIF.

Tags:
replied

Hi,

if you want to exclude lgtyp = 001 in the loop.

just use below code.

READ TABLE LV_ZWM_SINGLEMAT.

IF sy-subrc EQ 0.

SELECT SINGLE MATNR INTO LV_MATNR FROM LQUA

WHERE LGNUM = I_T331-LGNUM AND

LGTYP <> '001' AND

LGPLA = I_LTAP-NLPLA.

IF sy-subrc EQ 0.

IF LV_MATNR NE I_LTAP-MATNR.

LV_ERR = c_x.

ELSE.

CLEAR LV_ERR.

ENDIF.

ENDIF.

ENDIF.

Regards,

venkat

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question