2009 Jan 29 9:28 AM
Hi All,
I need to get all the movement types occured in date range for a material.
I got movement types for material form MSEG but i need to specify within date range.
Plz suggest.
Thanx
Rohit
2009 Feb 03 3:51 PM
Hi,
Try the following code,
TABLES: mseg.
RANGES: r_bwart FOR mseg-bwart.
r_bwart-sign = 'I'.
r_bwart-option = 'EQ'.
SELECT DISTINCT bwart FROM mseg
INTO r_bwart-low.
APPEND r_bwart TO r_bwart.
ENDSELECT.Hope will help you.
Kind Regards,
Faisal
Hi All,
I need to get all the movement types occured in date range for a material.
I got movement types for material form MSEG but i need to specify within date range.
Plz suggest.
Thanx
Rohit
2009 Jan 29 9:31 AM
Make a join between MKPF and MSEG. MKPF has the dates.
You can create a simple query in SQVI to create a table join.
2009 Jan 29 9:31 AM
Could you please elabarate the requirement..date range??
Regards,
Sai
2009 Jan 29 9:32 AM
2009 Feb 03 3:15 PM
Thanks for repling..
Now i have mov type from date range for material doc.for mkpf..table
and i have three fields on the selection screen..
Posting date(parameters)20/01/2009
System date(parameters)03/02/2009
System time(select-option)00:00:00 to 16:24:34
if a mat.doc has been created on 25/01/2009 18:24:20 and i am taking posting date which is in between the two dates given in the selection screen...
as 25/01/2009 falls in between that range but the time is 18:24:34 which does not fall in between that time range provided on the screen...
so the select query fails...
wt i want is that to get a range as 20/01/2009 00:00:00 to 03/02/2009 16:24:34 from table mkpf..
how to get that...
plz suggest..
Rohit
2009 Feb 03 3:38 PM
try it like this: you will get the movement type between this date & time range from mseg
Select a~BWART
into table t_itab
from mseg as a inner join mkpf as b
on a~MBLNR eq b~MBLNR
and a~MJAHR eq b~MJAHR
where b~BLDAT between l_BLDAT and h_BLDAT
and b~CPUTM between s_time-low and s_time-high.or you want to check for a single movement type than
Select single a~BWART
into w_bwart
from mseg as a inner join mkpf as b
on a~MBLNR eq b~MBLNR
and a~MJAHR eq b~MJAHR
where b~BLDAT between l_BLDAT and h_BLDAT
and b~CPUTM between s_time-low and s_time-high
and a~BWART eq p_BWART.
if sy-subrc <> 0.
Endif.With luck,
Pritam.
Edited by: Pritam Ghosh on Feb 3, 2009 4:42 PM
2009 Feb 03 3:51 PM
Hi,
Try the following code,
TABLES: mseg.
RANGES: r_bwart FOR mseg-bwart.
r_bwart-sign = 'I'.
r_bwart-option = 'EQ'.
SELECT DISTINCT bwart FROM mseg
INTO r_bwart-low.
APPEND r_bwart TO r_bwart.
ENDSELECT.Hope will help you.
Kind Regards,
Faisal
2009 Feb 05 5:26 AM
Thanks all for ur replies...
my problem has solved....
i cant take time as select-option as mentioned by pretam....because
if i want to take a range as
20-jan 12:00:10
30-jan 09:12:00
in that case the s_time-low (12:00:10) has value greater than s_time-high (09:12:00).....thats not possible..
so i took time as two perameters.....
Thanks every bdy....
Rohit