on 07-28-2009 6:41 AM
hi all,
i am facing this problem . i have developed a script for which i have to create five pages like one for duplicate, triplicate etc.. means the same page i have to print 5 times with different headings.any help in solving this please??????
regards,
Naren
Hi,
If you are creating 5 pages for the script and printing the same data 5 times then there won't be any issue for you as all the pages are triggered you can maintain different variable windows on all the 5 pages and give the heading as you like there.
or
If you are looping the write form from your driver program 5 times then check for the sy-tabix and change the text element according to the sy-tabix value so you can print different headings for all the 5 times.
like
IF SY-TABIX = 1.
W_ELEMENT = 'FIRST'.
ELSEIF SY-TABIX = 2.
W_ELEMENT = 'SECOND'.
ENDIF.
CALL FUNCTION 'WRITE_FORM'
ELEMENT = W_ELEMENT
........
........
ENDFUNCTION.
Maintain all the text elements in your script main window or variable window with different headings.
Regards
Sarves
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Create the text elements FIRST, SECOND, THIRD, FOURTH AND FIFTH in the script and when you are looping in the driver program pass the elements value using a variable W_ELEMENT according to the sy-index value. In this you have 5 text elements in the script calling each text element according to the sy-index
In the first text element of the script give the text as Original.
second Duplicate
third Triplicate......
or
You can declare a variable in the driver program name
and pass it accordingly with the text element also. In this you will have only one text element in the script and change the value of the name according to the sy-index.
DO 5 TIMES.
IF SY-INDEX = 1.
NAME = 'ORIGINAL'.
ELSEIF.....
ENDIF.
CALL FUNCTION 'WRITE_FORM'.
ELEMENT = 'TEST'.
....
ENDFUNCTION.
Regards
Sarves
Edited by: Sarves Sombhatla on Jul 28, 2009 3:17 PM
Hi,
No it is not necessary to include all the function modules in the loop. only write_form will do it. I have replicated the scenario with 2 different page headings,Just check the code below
" Driver Program
CALL FUNCTION 'OPEN_FORM'
.......
DO 2 TIMES.
IF sy-index = 1.
name = 'Original'.
ELSE.
name = 'Duplicate'.
ENDIF.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'TEST'
window = 'MAIN'.
* function = 'APPEND'.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
if sy-tabix > 1.
clear name.
endif.
ENDDO.
CALL FUNCTION 'CLOSE_FORM'
.......
" In SCRIPT MAIN WINDOW I have declared a text element 'TEST'
/E TEST
* &name&
/: NEW-PAGE 'SECOND'
Note: I took the new-page just to trigger another page and check whether it is triggering in the second page Hope this will completely resolve the issue.
Regards
Sarves
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.