cancel
Showing results for 
Search instead for 
Did you mean: 

Smartform Prints not coming in sequence

Former Member
0 Kudos

Hi Friends,

I wanted 5 prints of a particular smartform.A particular text in the header changes for all the five prints.

eg: Original ,duplicate,triplicate,copy and copy.To achieve this my logic is

do 5 times.

if sy-index = 1.

var = 'original'.

endif.

if sy-index = 2.

var = 'duplicate'.

endif.

if sy-index = 3.

var = 'triplicate'.

endif.

if sy-index = 4.

var = 'copy'.

endif.

call smartform(functionmodule name)

exporting

var = var.

end.

I am getting all the 5 prints but the problem is all the 5 prints are not cumming in sequence.Sumtimes duplicate cums first or sumtimes triplicate cums first.

Pls do the needful.

Thks n Regards,

Nicklas.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

In u r form

First Create one Separate Window for Text of type 'Copies Window'.

In program lines write the below code

IF SFSY-COPYCOUNT = '001'.

v_TEXT = 'Original'.

ENDIF.

IF SFSY-COPYCOUNT = '002'.

v_TEXT = 'Duplicate'.

ENDIF.

IF SFSY-COPYCOUNT = '003'.

v_TEXT = 'Triplicate'.

ENDIF.

IF SFSY-COPYCOUNT = '004'.

v_TEXT = 'Quadruplicate'.

ENDIF.

IF SFSY-COPYCOUNT = '005'.

v_TEXT = 'Extra Copy'.

ENDIF.

Then Print 'V_TEXT' in Text Element.

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

If that is the case then you may use a local vairable in the print program and increase the count after each call of the smartforms.

Pass the variable to each smartforms and then apply the logic as per your client requirement is concerned.

Hope this works for you.

Regards,

Ram

Former Member
0 Kudos

Hi,

U can try like this,take a local variable and loop smartform 5 times and basing on the count assign ur values to teh text and pass that text to the smart form parameters.after the end loop dont forget to clear the variable.

Regards.

Former Member
0 Kudos

Hi,

Create a copies window in your smartform by selecting the window type as Copies window in that create Program lines node and write this logic

IF SFSY-COPYCOUNT = '001'

TEST = 'Original'.

ELSEIF SFSY-COPYCOUNT = '001'.

TEST = 'Duplicate'.

ELSE.

TEST = 'Tripilicate'.

ENDIF.

After this Programlines node Create one text node In that write the variable TEXT.

Regards,

Jagadeesh.

Former Member
0 Kudos

Hi,

Try this to find the no of times a dcoumetn is printed.

SELECT anzal FROM nast

INTO var_total_copies

WHERE kappl = 'V3'

AND objky = var_invoice_number

AND nacha = 1

AND vstat = 1.

wherein declare var_total_copies to store the number times a document is issued and var_invoice_number is the document number.

Pass the variable var_total_copies to the smartform interface and print accordingly as per the value of the variable.

If var_total_copies is '0'.

display 'Original'.

If var_total_copies is '1'.

display 'Duplicate'.

like that...

Regards,

Ram

Edited by: Ramakrishna Peri on May 11, 2009 11:18 AM

Former Member
0 Kudos

Hi Ramakrishna,

The same logic i hve applied but the prints are not coming in sequence.The sfsy-copycount is a gud logic and it solves my printing problem,but i have to call three smartforms to meet the client specification.So if sfsy-cpycount logic gets approved i will close this thread.

Thanks n regards,

Nicklas.

Former Member
0 Kudos

Hi,

You can do in another way.Please fill an internal table 'itab' like as below.

No Text

1 original

2 duplicate

3 triplicate

4 copy

5 copy

loop at itab.
  call smartform(functionmodule name)
    exporting
      var = itab-text.
endloop.

2. You can do by using program lines also,if you want

Thanks,

Suma.

Former Member
0 Kudos

Hi ,

My problem is the 5 prints are not coming in sequence.i.e original,duplicate, triplicate n so forth .If i use your logic will it solve my query.Coz i am duin the same thing calling the smartform 5 times.And in print preview all are been shown in sequence.

Regards,

Nicklas.

former_member262988
Active Contributor
0 Kudos

HI,

Do you have any other loop above do...endo .?

Thanks,

Shailaja Ainala.

Former Member
0 Kudos

Hi,

I do use loop,but it has got ntng to do wid this.It performs a different function altogether.

Regards,

Nicklas.