03-22-2007 4:17 AM
hi,
when i execute this program....which out showing any error,result ...this is getting back to the program itself. I could not figure out what the error was.
my layout has one page, 3 windows.
in atributes i specified next page: first
if anyone sees the possible error plz suggest me the way to correct it.
tables: mara.
data: begin of itab occurs 0,
matnr like mara-matnr,
ersda like mara-ersda,
ernam like mara-ernam,
end of itab.
SELECT matnr ersda ernam INTO TABLE itab
FROM mara
CALL FUNCTION 'OPEN_FORM'
EXPORTING
DIALOG = 'X'
FORM = 'ZFORM'
LANGUAGE = SY-LANGU
EXCEPTIONS
OTHERS = 1.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'HEADER'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'HEADER'
EXCEPTIONS
UNOPENED = 1
OTHERS = 2.
LOOP AT ITAB.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'MAIN'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
EXCEPTIONS
UNOPENED = 1
OTHERS = 2.
ENDLOOP.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'FOOTER'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'FOOTER'
EXCEPTIONS
UNOPENED = 1
OTHERS = 2.
CALL FUNCTION 'CLOSE_FORM'
EXCEPTIONS
UNOPENED = 1
OTHERS = 2.
03-22-2007 4:31 AM
Hi Alchemi,
Yes, as per santosh solution i am agreeing with that, It is not possible to print with out knowing the type and function of the window. So please un comment those statements.
Hope this helps you, reply for queries,
Regards.
kumar.
03-22-2007 4:22 AM
check in this way.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
DIALOG = 'X' <b> comment this </b>
FORM = 'ZFORM'
LANGUAGE = SY-LANGU
EXCEPTIONS
OTHERS = 1.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'HEADER'
FUNCTION = 'SET' <b> uncomment this </b>
TYPE = 'BODY' <b> uncomment this </b>
WINDOW = 'HEADER'
EXCEPTIONS
UNOPENED = 1
OTHERS = 2.
LOOP AT ITAB.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'MAIN'
FUNCTION = 'SET' <b> uncomment this </b>
TYPE = 'BODY' <b> uncomment this </b>
WINDOW = 'MAIN'
EXCEPTIONS
UNOPENED = 1
OTHERS = 2.
ENDLOOP.
03-22-2007 4:25 AM
Hi Alchemi ,
Did you debugg the program and see whether the script is being called.
Also debugg the script , the method of doing it is before executing the program go to SE71 Utilities --> Activate Debugging.
Please check this and please revert back with observations.
Regards
Arun
03-22-2007 4:31 AM
Hi Alchemi,
Yes, as per santosh solution i am agreeing with that, It is not possible to print with out knowing the type and function of the window. So please un comment those statements.
Hope this helps you, reply for queries,
Regards.
kumar.
03-22-2007 4:41 AM
yea i tried it. its returning back to the program...with any error msg.
i have uncommented.
03-22-2007 4:45 AM
Hi Alchemi ,
Did you debugg the program and see how it is getting executed and is the script being called.
Regards
Arun
03-22-2007 4:50 AM
03-22-2007 4:55 AM
Hi ,
First check if the script is being called. To do this do the following
Before executing the program go SE71 transaction , In the menu you will find Utilities --> Activate Debugging.
Press Activate Debugging , this will activate SAP Script debugging.
Now try executing your program , if your program calls the script then the control will come to the script and the you can Press F5 to execute it step by step.
Please check it this way and in case of any further queries please feel free to revert back.
Regards
Arun
03-22-2007 4:58 AM
hei thanks.
the control is not coming to the script. i think the script is not being called.
03-22-2007 5:03 AM
thanks guys.
i will reward points for everyone who tried to help me.
its triggering
03-22-2007 5:04 AM
Hi ,
Please check the following , go to SE71 transaction , enter your form name and activae the form (* Just to confirm if the form is active or not )
Now when you execute the program , in the selections screen , top left you will ahve the command window , type /h and press enter , this activates debugging for the program , now execute the program and press F5 to see step by step execution.
Whne the fuinction OPEN_FORM is called , press F6 and after executuion see the value of SY-SUBRC.
please tell what is the value of sy-subrc.
Regards
Arun
03-22-2007 5:04 AM
03-22-2007 5:11 AM
Hi ,
Please check if you have defiend the element 'FOOTER; in the window FOOTER.
Regards
Arun
03-22-2007 5:12 AM
hei arun
sy-subrc value is 0.
i adjusted the line spacing and footer also triggers now.
thanks...one and all
03-22-2007 5:13 AM
yea i have the element for footer.
but the line spacing in main window was 1cm and i reduced it to 0.5 cm...and eventually footer triggered
03-22-2007 4:57 AM
is u r form name is correct and in active.
in that program no need <b> tables: mara </b>
try with giving select-options on matnr.