cancel
Showing results for 
Search instead for 
Did you mean: 

Data Prinitng in Smart forms

sudhir_uppalapati
Participant
0 Kudos

Hi All,

Is it possible to print the data of ex: some 2 fields in the below way. If suppose i have some 10 records.

S.no Name | S.no Name

1 a | 6 f

2 b | 7 g

3 c | 8 h

4 d | 9 i

5 e | 10 j

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Sidhir,

Yes it is possible to print the way you want.

1-Either you take 2 template window or 2 table widows.

2- Split the data and pass them to each window.

Regards,

Aditya

sudhir_uppalapati
Participant
0 Kudos

Hi,

I will use 2 templates but how can i split the data..I will do the loop and get the data for each record..but how to split the data after 5th record and the 6th record should be in another window.

former_member205763
Active Contributor
0 Kudos

suppose the data is in itab.

now use describe lines to get the total no. of line say n.

now divide n / 2, copy first n/2 lines in one and next n/2 in other, now u can use two windows with two templates and display each internal table seperately

sudhir_uppalapati
Participant
0 Kudos

Hi Karthik,

Can you explain in detail about the division of lines and displaying them.

former_member205763
Active Contributor
0 Kudos

First tell me how u want to split lines, is it that u want to split them in half, or in section of some number say 5.

sudhir_uppalapati
Participant
0 Kudos

I want to split based on the number of records. The records may exist upto 200.So, in my requirement i want to split each cell for 25 records and the next 25 records up to 50 should be in another cell and in the next it should start from 51 to 75....

former_member205763
Active Contributor
0 Kudos

if the max no. of records is 200 then max tables you would need is 8.

create 8 windows side by side with templates inside them.

now create 8 internal tables.

suppose ur main internal table is itab_main

describe table itab_main lines n.

n will have total lines. now divide n by 25. also get the remainder.

a = n / 25.

b = n mod 25.

if b > 0.

a = a + 1.

endif.

data: line type i.

do a times.

append lines of itab_main from line to 25 into itab.

if a = 1.

itab1[] = itab[].

endif.

if a = 2.

itab2[] = itab[].

endif.

if a = 3.

itab3[] = itab[].

endif.

if a = 4.

itab4[] = itab[].

endif.

if a = 5.

itab5[] = itab[].

endif.

if a = 6.

itab6[] = itab[].

endif.

if a = 7.

itab7[] = itab[].

endif.

if a = 8.

itab8[] = itab[].

endif.

if a = 3.

itab1[] = itab[].

endif.

if a = 4.

itab1[] = itab[].

endif.

if a = 5.

itab1[] = itab[].

endif.

if a = 6.

itab1[] = itab[].

endif.

if a = 7.

itab1[] = itab[].

endif.

if a = 8.

itab1[] = itab[].

endif.

line = line + 25.

enddo.