Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

script not triggering

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

15 REPLIES 15

SantoshKallem
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

yea i tried it. its returning back to the program...with any error msg.

i have uncommented.

0 Kudos

Hi Alchemi ,

Did you debugg the program and see how it is getting executed and is the script being called.

Regards

Arun

0 Kudos

i donno to debug...plz suggest me the process

0 Kudos

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

0 Kudos

hei thanks.

the control is not coming to the script. i think the script is not being called.

0 Kudos

thanks guys.

i will reward points for everyone who tried to help me.

its triggering

0 Kudos

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

0 Kudos

i get the output but now the footer is not displayed.

0 Kudos

Hi ,

Please check if you have defiend the element 'FOOTER; in the window FOOTER.

Regards

Arun

0 Kudos

hei arun

sy-subrc value is 0.

i adjusted the line spacing and footer also triggers now.

thanks...one and all

0 Kudos

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

SantoshKallem
Active Contributor
0 Kudos

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.