‎2010 May 14 12:54 PM
Dear All,
Can some body help me in this
i have write some code to print the data into sap script
i have write select statement and now data is in internal table and i write
Loop
write_form
endloopit is saying invalid write_form and open_form is missing
Surendra
‎2010 May 14 4:28 PM
open form is must in any script. we have to open the script form with open_form statement.that might be the reason for getting open_form is missing.
Form OPEN_FORM .
CALL FUNCTION 'OPEN_FORM'
EXPORTING
Form = 'YKC_FIRST_SCRIPT'.
Endform. "OPEN-FORM
invalid write_form is because,we can not loop at write_form.istead looping can be done at either internal table or database values retrieval.
just check it out..or else.search in sdn.sap.com...we can know the exact method for the above mentioned query.
‎2010 May 14 4:34 PM
Example:
CALL FUNCTION 'OPEN_FORM'
EXPORTING
APPLICATION = 'TX'
* ARCHIVE_INDEX = ' '
* ARCHIVE_PARAMS = ' '
DEVICE = 'LOCL'
DIALOG = ' '
FORM = 'Z_XPTO'
LANGUAGE = SY-LANGU
OPTIONS = Z*OPTION*XPTO
IMPORTING
LANGUAGE = SY-LANGU
EXCEPTIONS
OTHERS = 1.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'HEADER'
* FUNCTION = 'SET'
* TYPE = 'BODY'
WINDOW = 'HEADER'
EXCEPTIONS
ELEMENT = 1.
CALL FUNCTION 'CLOSE_FORM'
EXCEPTIONS
UNOPENED = 1
OTHERS = 2.
‎2010 May 14 4:43 PM
The function module OPEN_FORM opens form printing. You must call this function module before you can use any other form function (WRITE_FORM, START_FORM, CONTROL_FORM...).
You need not specify a form name. If you omit the name, you must use the function module START_FORM to open a form before starting the output.
You must end form printing by using the function module CLOSE_FORM. Otherwise, the system does not print or display anything.
Within a program, you can use several OPEN_FORM..CLOSE_FORM pairs. This allows you to write output to several different spool requests from within one program.