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

Internal table in smartforms

Former Member
0 Likes
722

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
695

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.

5 REPLIES 5
Read only

Former Member
0 Likes
696

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.

Read only

0 Likes
695

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

Read only

0 Likes
695

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

Read only

0 Likes
695

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.

Read only

Former Member
0 Likes
695

ok