cancel
Showing results for 
Search instead for 
Did you mean: 

Smartform: Preprinted Stickers

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

naimesh_patel
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Thansk for your answer,

I tried that before, but the problem was that the page jump isn't succed and I couldn't do it with a command because the smartform didn't allow this.

naimesh_patel
Active Contributor
0 Kudos

If you put the template inside your Main window that it would jump to next screen.

Like:


MAIN
... LOOP
..... TEMPLATE
....... STICKER1
....... STICKER2
...

If you have more than 8 records, it would jump to next page.

Regards,

Naimesh Patel

Former Member
0 Kudos

I think we are nearer of the solution. The itab have 9 record and now it's printing in the good position but each record it's printing in a page, so it's printing 9 pages instead of 2.

Former Member
0 Kudos

put a condition on the command node so that it executes after every 8th record, use a count to check when it becomes 8 now jump using command and dont forget to reset the counter after the jump.

кu03B1ятu03B9к

Former Member
0 Kudos

I just try it now, but the smartform haven't printed. I think that it's because the "standard" jump it doesn't avoiding. How could I avoid this?

Former Member
0 Kudos

how u have specified the condition

Former Member
0 Kudos

I put the condition:

if v_etiq_a_imprimir < 8.
  v_etiq_a_imprimir = v_etiq_a_imprimir + 1.
  clear v_salto.
else.
  v_etiq_a_imprimir = 1.
  v_salto = 'X'.
endif.

And the command is executed when:

v_salto = 'X'

Former Member
0 Kudos

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

naimesh_patel
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

Answers (0)