‎2007 May 28 1:13 PM
hi gurus,
can any1 help me.
i have a drive progm for form,in that i hav a internal table to store that data which i want to display on the form output, and i have declared (fields)in the form(change editor part) also but i am unable to see the resective output.
canny1 can give me the sample way to do the same(mean the way of retrieving the data and displaying the same in the form output)
thanks in advance
regrds
anuj
Message was edited by:
anuj anuj
‎2007 May 28 1:16 PM
REPORT ZPSAPSCRIPT.
TABLES : EKKO,
EKPO,
KNA1,
USR01,
MARA,
MAKT.
DATA : BEGIN OF ZOPTION.
INCLUDE STRUCTURE ITCPO.
DATA : END OF ZOPTION.
PARAMETERS: P_EBELN LIKE EKKO-EBELN,
P_EBELP LIKE EKPO-EBELP.
CLEAR EKPO.
SELECT SINGLE * FROM EKPO
WHERE EBELN = P_EBELN AND
EBELP = P_EBELP.
CLEAR KNA1.
SELECT SINGLE NAME1 FROM KNA1
INTO KNA1-NAME1
WHERE KUNNR = EKPO-KUNNR.
CLEAR MAKT.
SELECT SINGLE MAKTX FROM MAKT
INTO MAKT-MAKTX
WHERE MATNR = EKPO-MATNR AND
SPRAS = SY-LANGU.
CLEAR USR01.
SELECT SINGLE * FROM USR01 WHERE BNAME = SY-UNAME.
ZOPTION-TDDEST = USR01-SPLD. "Output device (printer)
ZOPTION-TDIMMED = 'X'. "Print immediately
ZOPTION-TDDELETE = 'X'. "Delete after printing
ZOPTION-TDPROGRAM = 'ZPQRPRNT'. "Program Name
CALL FUNCTION 'OPEN_FORM'
EXPORTING
APPLICATION = 'TX'
ARCHIVE_INDEX = ' '
ARCHIVE_PARAMS = ' '
DEVICE = 'PRINTER'
DIALOG = ' '
FORM = 'Z_TESTSCRIPT'
LANGUAGE = SY-LANGU
OPTIONS = ZOPTION
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 'WRITE_FORM'
EXPORTING
ELEMENT = 'MAIN'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
EXCEPTIONS
ELEMENT = 1.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'FOOTER'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'FOOTER'
EXCEPTIONS
ELEMENT = 1.
CALL FUNCTION 'CLOSE_FORM'
EXCEPTIONS
UNOPENED = 1
OTHERS = 2.
‎2007 May 28 1:43 PM
hi alka,
thanks for the code i too hav the same with me.
but what i really want is to hav the simplest code.
mean if i want to display just two fields
ebeln and ebelp in my out put then what shul i do .
plz explain settin of both in driver program and in form.
thank in advwnce
anuj
‎2007 May 28 1:17 PM
You can not import the internal table that way. There is two solution.
1. Create a dictionary of that internal table type and pass it through form interface.
2. Declare the internal table in the global defenation of the smartform and select the data itself in the smartform.
‎2007 May 28 1:21 PM
Hi,
did u link the driver program and the script.
goto ur script and select in menu as below.
FORM->CHECK->TEXTS AND PRESS ENTER select APPEND PRINT PROGRAM,enter ur driver program and press enter.
also make sure that open_form,start_form,insert_form,end_form and close_form are all present in ur driver program.
it may work now.
rgds,
bharat.
‎2007 May 29 5:32 AM
hi all,
luckily i hav got the solution own my on .
thanks to all for there vaulable help.
regrads.
anuj