cancel
Showing results for 
Search instead for 
Did you mean: 

Smartforms: split main window into two parts

Former Member
0 Kudos

Hello there,

Considering that Window nodes cannot be created under Main Window. I wanna split a table line under main  window into left part and right part. I use loop to get data records.

At the first loop, its its will be shown at the left part of the table line. At the second loop, its data will be shown at the right part of the same table line. Then, the third loop data record will be shown at the left part of a new line. The forth loop data record will append to the left part and be shown at the right part.

How can I show data records in such a way?

I really appreciate your favor.

Accepted Solutions (1)

Accepted Solutions (1)

kaushalya
Active Participant
0 Kudos

First you have to create a two column structure to store your data in a single row.

Then, use this simple even/odd logic inside your print program to append two rows into one row.

LOOP AT i_table.

      t = sy-tabix MOD 2.

      IF t <> 0.     "Odd

        j_table-col1 = i_table-col .

      ELSE.         "Even

        j_table-col2 = i_table-col.

         APPEND j_table.

      ENDIF.

ENDLOOP.

Now u have a new table with even/odd rows in two separate columns.

Then in your smartform loop through j_table to show col1 and col2.

Former Member
0 Kudos

It works for my similar problem, thank you. This should be marked as correct answer.

Answers (2)

Answers (2)

Former Member
0 Kudos

loop at itab into wa.

v_index = sy-tabix MOD 2.

if v_index <> 0.

move : wa-column to wa1-column1.

else.

move : wa-column to wa1-column2.

append wa1 to jtab.

endif.

So now u can loop jtab internal table and fill column1 & column2 directly with out any conditions.

former_member192109
Participant
0 Kudos

Hi,

Can u try with seperating the required rows into 2 different
tables and then use 2 main windows side by side with one table each, couldnt check, but give it a try...

Regards,

Umar
Syed.

Former Member
0 Kudos

Let's say first time left part(cloumn1) and second time(coloumn2) should get fill. In program lines write the below logic.

v_index = sy-tabix MOD 2.

if v_index <> 0.

flag = 'X'.

else.

flag = 'Y'.

endif.

in conditions tab, put flag = 'X' for coloumn1 and flag = 'Y' for column2.

Hope this help u.

Former Member
0 Kudos

Hello Sreenivasulu Reddy,

I've tried this method before but column2 will be shown at a new line other than being appended to the first part. Thanx.