cancel
Showing results for 
Search instead for 
Did you mean: 

Print text in var window only on last page?

deepak_kumar11
Participant
0 Kudos

hi ,

how to print a text in var window only on last page?

regards

deepak

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Just print the text when &Next-page& = 0. this is enough.

Regards,

Vijay

deepak_kumar11
Participant
0 Kudos

hi.

&next-page& = 0 is not working.......

any other soln?????

deepak

correct syntax is &nextpage& = 0

Message was edited by:

Deepak Kumar

former_member533584
Contributor
0 Kudos

hi,

try this.

in program u declare

loop.

........

AT LAST.

W_FLAG = 1.

ENDAT.

endloop.

in script

IF &W_FLAG& eq 1.

last page.

endif

Message was edited by:

ananth

Former Member
0 Kudos

hi Deepak

you can keep a condition using if endif in the window

if &PAGE& EQ &SAPSCRICT-FORMPAGES&

put your text here or the variable which you want to print.

endif.

Plz reward points for the helpful answers.

Regards

Zarina

Former Member
0 Kudos

Hi..

Try this code....

1,Create main window with text element.

2,Create one variable window..

With <b>text element</b> u may write some code in that variable window...

<b>Coding in Variable window</b>

/E VAR

P1 This is the variable window

<b>Coding in main window</b>

/E HEADER

P1 Example for Main Window

/E FIRST

P1 &itab-sno&

<b>coding in driver program</b>

REPORT zba_sdn_script .

DATA : BEGIN OF itab OCCURS 0,

sno(2) TYPE n,

END OF itab,

w_sno(2) TYPE n .

DO 200 TIMES.

w_sno = w_sno + 3.

itab-sno = w_sno.

APPEND itab.

ENDDO.

CALL FUNCTION 'OPEN_FORM'

EXPORTING

device = 'PRINTER'

dialog = 'X'

form = 'ZBA_SDN'

language = sy-langu.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'HEADER'

function = 'SET'

type = 'BODY'

window = 'MAIN'.

LOOP AT itab .

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'FIRST'

function = 'SET'

type = 'BODY'

window = 'MAIN'.

ENDLOOP.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'VAR' <-------Text element name..

function = 'SET'

type = 'BODY'

window = 'WINDOW1'. <----Variable window name

CALL FUNCTION 'CLOSE_FORM'.

This will print the variable window in tha last page only.

Hope it will helps

Reward point if it useful means

Regards

Bala..

Message was edited by:

S Balasubramanian

Former Member
0 Kudos

hi

put the conditon for the TEXT <b>in condition tab</b> of purtcular node

SFSY-PAGE = SFSY-FORMPAGE

So this will be true only on last page so.. this text will be printed on last page

Please Close this thread.. when u r problem is solved. Reward all Helpful answers

Regards

Naresh Reddy K

deepak_kumar11
Participant
0 Kudos

IT IS FOR SMARTFORM ...I AM TRYING IN SAP-SCRIPT...HOW TO DO IT IN SAP-SCRIPT?

DEEPAK

Former Member
0 Kudos

sorry boss, ican't help u.. i am poor