Skip to Content
0
Former Member
Jan 21, 2010 at 04:50 PM

using the function WRITE_FORM in a SAPScript window

921 Views

hi everyone.

I need to print the texts of the SO10 transaction, in a SAPSCRIPT page, but i've not able to do so.

i have a SapScript with 2 pages: FIRST and SECOND, in the window "POINT2" of the page "FIRST", I put a "NEW-PAGE" , between an if condition, for to call the next page "SECOND".

i'm using WRITE_FORM function, in the control program, to send texts from the SO10 to the window "POINT2-1" in page "SECONDt".

now, if I make debbug to sapscript, i can see when: NEW-PAGE it's called and when the ITAB gets all the text, but in the end it doesn't print the text in the sapscript.

and if I search in the SP02 transaction, for the spool number, it only appears 1 page.

not 2 like it supose to be.

can anyone tell me what i'm doing wrong ?

this is the code that i'm using.

page: FIRST

window: POINT2

/:       POSITION WINDOW
/:       POSITION XORIGIN '+0' CH YORIGIN '+0' LN
/:       SIZE WIDTH '+0' CH HEIGHT '+0' LN
/:       BOX FRAME 10 TW
/:       IF V_CONT > 5
/:       NEW-PAGE
/:       ENDIF
PH     2º Descripción de error : <N>&IT_PRINT-QMTXT&<><><><></>  ,,&VIQMEL-QMTXT&
/:       INCLUDE &IT_PRINT-QMNUM& OBJECT QMEL ID LTQM LANGUAGE 'S'

page: SECOND

window: POINT2-1

/E       ELEMENT
/:       &IT_TEXTO-TDLINE&

control program

DATA: IT_TEXTO  LIKE STANDARD TABLE OF TLINE WITH HEADER LINE.



FORM print_form .


 LOOP AT IT_TEXTO.
    CALL FUNCTION 'WRITE_FORM'
     EXPORTING
       ELEMENT                        = 'ELEMENT'
       WINDOW                        = 'POINT2-1'
     EXCEPTIONS
       ELEMENT                        = 1
       FUNCTION                       = 2
       TYPE                           = 3
       UNOPENED                       = 4
       UNSTARTED                      = 5
       WINDOW                         = 6
       BAD_PAGEFORMAT_FOR_PRINT       = 7
       SPOOL_ERROR              = 8
       CODEPAGE                    = 9
       OTHERS                         = 10
              .
    IF sy-subrc <> 0.
         MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
 ENDLOOP.
ENDFORM.

<MOVED BY MODERATOR TO THE CORRECT FORUM>

Edited by: Alvaro Tejada Galindo on Apr 20, 2010 7:38 AM