Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

quantity display

Former Member
0 Likes
608

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
553

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.

3 REPLIES 3
Read only

Former Member
0 Likes
553

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??

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
553

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.

Read only

Former Member
0 Likes
554

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.