‎2010 Aug 03 12:40 PM
Hi All,
One internal table have lot of records, in those records some are in sequence and some are not in sequence
e.g.
ITAB[]
1977
1980
1981
1982
1983
1988
1992
1993
1994
1995
2000
2001
2002
but i need to split the records based on condition like if records in sequence then record will display in range otherwise will display individually.
As mentioned above ,on the basis of scenario , i need to print these records in smart form.
Can anybody help on the same that would be very helpful asap.
Thanks in Advance
Alok.
‎2010 Aug 03 12:47 PM
Hi,
Print the first value.
Use a counter and check for the condition viz current record + 1 = next record.
Print the current record value when the condition fails. ( This means you are having the first and last value of a sequence.
‎2010 Aug 03 12:47 PM
Hi,
Print the first value.
Use a counter and check for the condition viz current record + 1 = next record.
Print the current record value when the condition fails. ( This means you are having the first and last value of a sequence.
‎2010 Aug 03 12:51 PM
Use Two Variables:
Last_Value and current_value..
when current_value - last_value >= 1 Write current value
Do this on a CODE statement in the smartform
‎2010 Aug 03 1:15 PM
Hi Pravin,
As you said, i have done but by this way you can only split records .
So again i made new internal table itab1 for storing records in range .
Based on condition if next = first +1 .
wa_tab1 = first.
append wa_tab1 to itab1
else
wa_tab = first.
Endif.
But here we are printing records from wa_tab because i have taken loop on itab for printing .
And also we can get range from table itab1 through concatenate .But when you get again new number series in records then how will you print?
Thanks for giving responce.
Alok
‎2010 Aug 04 6:24 AM
Hi Marcos,
thanks for giving response, Your suggestion is helpful for splitting the records .
OK .but after splitting the records i need to print records based on condition as mentioned in posted mail...
So please let me give more idea on the same.
Regards
Alok.
‎2010 Aug 06 5:39 AM