11-03-2009 6:22 AM
Hi Guriji,s
i have written one sql query. In tis query iwe written some condition. but we are getting the output only for 261 movement .
but i need the output both '201' or '261' movement type .
Plz check my query and tell me the solution.
IF DAYS IS NOT INITIAL.
WB2_V_MKPF_MSEG2-BUDAT = SY-DATUM - DAYS.
SELECT MATNR_I WERKS_I BWART_I BUDAT FROM WB2_V_MKPF_MSEG2 INTO CORRESPONDING FIELDS OF TABLE T_ITAB4
WHERE WERKS_I IN PLANT AND BWART_I IN ('201' , '261') AND BUDAT BETWEEN WB2_V_MKPF_MSEG2-BUDAT AND SY-DATUM.
ENDIF.
Thanks
11-03-2009 6:42 AM
Your Query:-
SELECT MATNR_I WERKS_I BWART_I BUDAT FROM WB2_V_MKPF_MSEG2 INTO CORRESPONDING FIELDS OF TABLE T_ITAB4
WHERE WERKS_I IN PLANT AND BWART_I IN ('201' , '261') AND BUDAT BETWEEN WB2_V_MKPF_MSEG2-BUDAT AND SY-DATUM.
Do following check:-
In se11, open table WB2_V_MKPF_MSEG2, in BWART_I provide 201 and 261. Check whether your imput for plant and budat is same or not.
11-03-2009 6:27 AM
Hi Sachin,
Just check whether all rest of the conditions are satisfying for Movement type '201'.
Because all the Where conditions are with 'AND' so all the conditions should be satisfied together.
Regards,
Nitin.
11-03-2009 6:32 AM
Check in SE16, if you have data for the given condition of the SELECT statement
11-03-2009 6:42 AM
Your Query:-
SELECT MATNR_I WERKS_I BWART_I BUDAT FROM WB2_V_MKPF_MSEG2 INTO CORRESPONDING FIELDS OF TABLE T_ITAB4
WHERE WERKS_I IN PLANT AND BWART_I IN ('201' , '261') AND BUDAT BETWEEN WB2_V_MKPF_MSEG2-BUDAT AND SY-DATUM.
Do following check:-
In se11, open table WB2_V_MKPF_MSEG2, in BWART_I provide 201 and 261. Check whether your imput for plant and budat is same or not.
11-03-2009 6:57 AM
Hi,
Your query for movement types is correct.
Other where conditions are not getting satisfied.Just remove other where conditions and check if its working fine only for movement types where conditions.It will work fine.
Regards,
Subhashini