on 11-28-2012 5:06 AM
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.