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: 

OOPS ALV report to show quantity ageing wise....

jayasankar_goud3
Explorer
0 Kudos
212

I have one requiremnet to show work center wise from how long the material is present.

Like output format as follow

Work cenetr    0-7 days(QTY) 8-15 days(QTY) 16-30 days(QTY) 31-180 days(QTY)    181-365 days    > 365 days     Total Weight

Actually Previous logic was Ageing 0-2,3-3,4-6,7-10,11-20,>20 that was done code as like as follows

   DO 6 TIMES.
    L_COL_STR = SY-INDEX.
   CONCATENATE IM_COL_CONST L_COL_STR '_L' INTO L_COL_STR.
   CONDENSE L_COL_STR NO-GAPS.
   ASSIGN ME->(L_COL_STR) TO <FS_COL>.
    W_COL_RANGES-COL1 = <FS_COL>.

    L_COL_STR = SY-INDEX.
   CONCATENATE IM_COL_CONST L_COL_STR '_U' INTO L_COL_STR.
   CONDENSE L_COL_STR NO-GAPS.
   ASSIGN ME->(L_COL_STR) TO <FS_COL>.
    W_COL_RANGES-COL2 = <FS_COL>.

    W_COL_RANGES-COL_NO  = SY-INDEX.
   APPEND W_COL_RANGES TO EX_IST_COL_RANGES.
ENDDO.

But now my requirement changed for to calculate qty for other ageing like as mentioned above.(

0-7 days(QTY) 8-15 days(QTY) 16-30 days(QTY) 31-180 days(QTY)    181-365 days    > 365 days     Total )

Now how can i get dynamically this days ageing format.

Please suggest me if you knows the solution.

Regards,

J. Jayasankar Goud

3 REPLIES 3

alex_campbell
Contributor
0 Kudos
173

I don't think the code you pasted is at all relevant to the change you need to make. As best as I can tell (and it's hard to tell without the data and object definitions) your existing logic is in a class, and that class has a lower and an upper attribute for each of the 6 columns (for example, ME->COL_1_L = 0, ME->COL_1_U = 2, etc.). If the original programmer did a good job, these are the bounds that will be used throughout the program, so you should only need to change those class attributes to match those of your new requirements (ME->COL_1_U = 7, etc.). If the original programmer did not do a good job, you'll have to check the rest of the program, including texts and literals, and make these updates in multiple places.

This requirement seems trivial considering the fact that you have existing code that does exactly what you need it to do. All you have to do is find where those values are defined (again, probably in class attributes) and change them to the new values. If in the future you want to make this more flexible, you can create a database table to store these ranges, and have the class read them from the DB table instead of having them hard-coded.

surajarafath
Contributor
0 Kudos
173

Your requirement was not very clear. As per my Understanding

Work Center 0-7 , 7-14,... are all columns i think..

Instead of going for the logic you used above, you can do like this. Define an internal table with columns as QTY1,QTY2,...QTY10,.. upto max extent of how much columns you may get. Then do your coding such that all intervals go into QTY1, QTY2,.. sequentially and Before displaying the ALV based on your condition just Hide the column (WA_FCAT-NO_OUT = 'X').

Private_Member_49934
Product and Topic Expert
Product and Topic Expert
0 Kudos
173

Can you please elaborate further? Can you post the class implementation? May be the requirement and current logic will be clearer then.