2005 Nov 09 6:39 AM
Hi,
I want to display the materials with
sy-date against LQUA-WDATU(Date of Goods Receipt).
if the date between 0 to 30 days the quantity(lqua-gesme) should display between the days like this...
0 to 30days,31 to 60days,61 to 90days,>91days
lqua-gesme, lqua-gesme,lqua-gesme,lqua-gesme
could any one tell me how to do this...
reward guaranteed
cheers
kaki
points guranteed
kaki
2005 Nov 09 7:42 AM
I think you would be extracting stock data from table LQUA for various materials in an internal table say itab1.
You have to define itab2 with fields: material, quantity less than 30 days(qunt1), quantity between 31 to 60 days(quant2) etc.
You also have to create and populate itab3 that contains a list of all materials.
For further processing, psuedocode would be
Loop at itab3
Loop at itab1 where material = material
Calculate age of stock
If age less than 30
Quant1 = stock + Quant1
Elseif age between 31 and 60
Quant2 = stock + quant2
-
-
endif
Endloop.
Append material, Quant1, Quant2 etc into itab2
Endloop
This way you will get all the materials with agewise stock in itab2 which you can output with write statenments.
Hi,
I want to display the materials with
sy-date against LQUA-WDATU(Date of Goods Receipt).
if the date between 0 to 30 days the quantity(lqua-gesme) should display between the days like this...
0 to 30days,31 to 60days,61 to 90days,>91days
lqua-gesme, lqua-gesme,lqua-gesme,lqua-gesme
could any one tell me how to do this...
reward guaranteed
cheers
kaki
points guranteed
kaki
2005 Nov 09 6:47 AM
Hi.
Answer is simple.
data : diff(3) TYPE N.
diff = sy-date - lqua-wdatu.
IF diff < 31.
~~~
ELSEIF diff < 61.
~~~~
ELSEIF diff < 91.
~~~~
ELSE.
~~~~
endcase.
Are you OK??
2005 Nov 09 7:05 AM
Hi,
Hope you have selected both lqua-wdatu and lqua-gesme before.
data d type i.
write 'Date'.
write : 10 '0 to 31 days',
20 '31 to 60 days',
30 '61 to 90 days',
40 '>91 days'.
loop at itab into wa.
...calculate the difference between wa-wdatu and sy-datum and store it in d
write / wa-wdatu.
if d < 31.
write 10 wa-gesme.
elseif d < 61.
write 20 wa-gesme.
elseif d < 91.
write 30 wa-gesme.
else.
write 40 wa-gesme.
endif.
endloop.
Hope it helps.If so,Kindly reward points.
2005 Nov 09 7:42 AM
I think you would be extracting stock data from table LQUA for various materials in an internal table say itab1.
You have to define itab2 with fields: material, quantity less than 30 days(qunt1), quantity between 31 to 60 days(quant2) etc.
You also have to create and populate itab3 that contains a list of all materials.
For further processing, psuedocode would be
Loop at itab3
Loop at itab1 where material = material
Calculate age of stock
If age less than 30
Quant1 = stock + Quant1
Elseif age between 31 and 60
Quant2 = stock + quant2
-
-
endif
Endloop.
Append material, Quant1, Quant2 etc into itab2
Endloop
This way you will get all the materials with agewise stock in itab2 which you can output with write statenments.
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |