cancel
Showing results for 
Search instead for 
Did you mean: 

smartforms

Former Member
0 Kudos

Hi ,

Based on one obknr from objk table we fetch lot of serial numbers in internal table it_ser_bat[] .i.e

obknr = 1234

serial numbers:

1235

1236

1237

1238

1239

1240

1242

1250

1257

1258

1259

Now we need to print these serial numbers according to scenario

if serial numbers are in sequece then numbers will be print in range otherwise individully i.e.

printing record:

1235 to 1240

1242

1250

1257 to 1259

Regards

Alok

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Here comes the solution,,

Please modify the code as per your need ..

I hope it will be ok for you ..

loop at i_tab.
  if sy-tabix = 1.   " here i have modified 
    w_number = i_tab-ser_num.
    w_first  = w_number.
  endif.
  if w_number = i_tab-ser_num.
     w_number = i_tab-ser_num + 1.
     CONTINUE.
  else.
     w_last = i_tab-ser_num.
   CONCATENATE w_first 'TO' w_last INTO w_final.
  endif.
ENDLOOP.

Use this W_final to print...

Edited by: Lokesh Tarey on Jul 28, 2010 9:00 AM

Answers (1)

Answers (1)

Former Member
0 Kudos

ok