on 03-18-2009 3:26 PM
Hello,
I'm exporting an itab to a smartform and I'm sending the first position to print in the paper.
The paper has 8 positions with preprinted stickers as below:
-
1 | 5 |
-
2 | 6 |
-
3 | 7 |
-
4 | 8 |
-
If the itab has 9 records and the position indicated is 2, it will be printed the positions from 2 to 8 in the first page and the positions from 1 to 2 in the second page.
I tried to create a template with a loop inside but it doesn't jump to another page and I can't insert a command with this jump because it doesn't allow.
You can fill some empty records to be able to start printing from specific position. Like: If you want to start from position 3, than fill two blank records as first two lines.
Create a template inside the main window, with 8 different sets of texts to print the information.
Put the condition on each set that it would print for specific record only.
You can put program lines to have the condition for that perticular set.
Regards,
Naimesh Patel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Now it's printing but in the same way as before, a sticker per page.
I have programmed the smartform this way:
LOOP
..COMMAND
..TEMPLATE
....VAR1
....VAR2
....
....VAR8
....CODE
Debugging the smartform I have managed print properly putting l_tabdef-vpos_used = 'X' in the standar code:
* absolute positioning?
if l_tabdef-vpos_used = c_false.
l_diff = ft-rem_height - l_tabdef-tabheight + lc_epsi.
if l_diff <= 0
and ( xsfop-xsf = c_false or
xsfop-xsf = c_true and xsfop-xsfformat = c_true ).
if docentry-tdwtype = c_wtype_main.
p_try_next_page = c_true.
endif.
p_table_not_fit = c_true.
exit.
endif.
I don't now what is "absolute positioning" but l_tabdef is referencing to the TEMPLATE
We got stuck, Let's try something else.
1. We would fill some empty records based on our starting point.
2. Fill 2 tables. Table 1 would contain the records which we want to print on left side. and Table2 would contain the records which will go on right side.
3. Create a TABLE node for the TABLE1
4. Create a table line with two cells
5. Create a text on the left cell
6. Create a program lines & text on the right cell. Read table2 with the same index of the TABLE1
and pass that information in the Text.
So, your MAIN would look like:
MAIN
.. TABLE .. for TABLE1
.... HEADER
.... MAIN area
....... CELL1
.......... TEXT1 " prints data from TABLE1
....... CELL2
.......... CODE1 "< reads TABLE2 with same index
.......... TEXT2 " Prints data from TABLE2
In this design, we are trying to print sticker 1 and 5, 2 and 6, 3 and 7, 4 and 8 at the same time.
Regards,
Naimesh Patel
Thanks a lot for your colaboration.
Finally, I solved the trouble. My solution isn't the cleanest but it runs.
I hade made a loop that it fills a itab that it has the fields that I need * 8.
This declaration had been made in the types
Types: begin of ty_etiq,
pernr1,
name1,
pernr2,
name2,
...
pernr8,
name8.
types: end of ty_etiq.
types: ty_t_etiq type ty_etiq occurs 0.
(The itab_new has more fields this is an abreviation.)
Then I hade made a new loop to this itab.
LOOP (itab_original)
--CODE(fill itab_new)
LOOP(itab_new)
--TEMPLATE
----TEXT1
----...
----TEXT8
User | Count |
---|---|
85 | |
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.