10-07-2008 10:29 AM
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.
10-07-2008 10:34 AM
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
10-07-2008 10:32 AM
Hi,
use for all entries in the select query.
check the modified select query below..
SELECT * FROM ZWM_SINGLEMAT INTO TABLE LV_ZWM_SINGLEMAT for all entries in i_t331
WHERE LGNUM = I_T331-LGNUM AND
LGTYP = I_T331-LGTYP AND
SINGLE = 'X'.
Regards,
venkat
10-07-2008 10:34 AM
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
10-07-2008 11:31 AM
Hi Venkat,
This is include program, so using the same variables available in this code we have to exclude the condition for the storage type 001.
please advice how we can do this.
Thanks
Murali
10-07-2008 10:36 AM
Hi
above the select statement add this delete statement to exclude lgty '001'.
delete I_T331 where lgtyp = '001'.
*Get data.
SELECT * FROM ZWM_SINGLEMAT INTO TABLE LV_ZWM_SINGLEMAT
WHERE LGNUM = I_T331-LGNUM AND
LGTYP = I_T331-LGTYP AND
SINGLE = 'X'.
Regards
Madhan
10-07-2008 12:17 PM
Hi Madha,
when am trying to use ur program its giving error message I_T331 is not internal table so i could not able to use your statement Delete I_T331 where lgtype ='031'.
Please clarify I changed like below
After select statment Data is moving to LV_ZWM_SINGLEMAT later he is reading this Table and checking subrc if it is success then he is going forward
My change before reading the internal table LV_ZWM_SINGLEMAT I deleted the entry using your previous statement Delete LV_ZWM_SINGLEMAT where LGTYP = '031'..
Is it ok. please confirm.
************************************************************************************************************************
Total New code is here below
*Get data.
SELECT * FROM ZWM_SINGLEMAT INTO TABLE LV_ZWM_SINGLEMAT
WHERE LGNUM = I_T331-LGNUM AND
LGTYP = I_T331-LGTYP AND
SINGLE = 'X'.
*Change Murali Start
*Deleting the etries which are belongs to storage type 031
Delete LV_ZWM_SINGLEMAT where LGTYP = '031'.
*Change Murali End
*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.
******************************************************************************************************************
Could you please confirm
Thanks & Regards,
Murali,