cancel
Showing results for 
Search instead for 
Did you mean: 

Text in Main Window printed twice when using Write_Form in Sapscripts

amber_garg
Active Participant
0 Kudos

I have a Sapscript with 1 page and 2 windows (MAIN and LOGO). The Main window contains just a simple text 'Hello World" (without using any element /E).

Now in my driver program , I wrote 3 FM's OPEN_FORM , WRITE_FORM( with no export parameters as by default it would take MAIN window) and CLOSE_FORM.

When i execute this driver program , the text "Hello World" is displayed twice one below the other.THe Logo is displayed fine.

THANKS

Accepted Solutions (0)

Answers (1)

Answers (1)

nabheetscn
Active Contributor
0 Kudos

Do one thimg assigm text elemnt to textand use it in write_form...its wriiting two lines as no text elemnt is tnere....a script always ahs a many window...plus no text elemnt text is always written plus you have made an extra call tO it in code.

Nabheet

amber_garg
Active Participant
0 Kudos

Suppose I have no text element in Main Window , then is it possible to execute driver program without having WRITE_FORM.

Or it is compulsory to have at least 1 WRITE_FORM even if i dont have a single text element in my whole form.

THANKS

nabheetscn
Active Contributor
0 Kudos

Try it and check sadly i dont have system access right now:):)

Nabheet

Edited by: nabheetmadan09 on Jan 9, 2012 1:01 AM

amber_garg
Active Participant
0 Kudos

I tried but if i dont write WRITE_FORM then it doesnt display the form itself. If u write it prints it twice.

So i guess without writing Element in MAIN window its not possible to display the data without duplicate output.

nabheetscn
Active Contributor
0 Kudos

Do one thing try it with elemnt and see what happens..i believ sap standard script usually always has am element:):)

Nice practical learning for everyone

Nabheet

amber_garg
Active Participant
0 Kudos

yes with Elements it has worked for me before also , but this time i tried without element. If its compulsory to have at least 1 element in main window to prevent this , then i wonder whats the logic behind that.

Thanks for your help anyways

nabheetscn
Active Contributor
0 Kudos

Its more like a generic thing which you want in header always whether ornot some things are printed or not..i take it as this way...lets say you want to write item detail start you dont need atext elemnt for this.....write...so its a generic text

Hope its clear:)

Nabheet

Former Member
0 Kudos

HI friend,

In Script we display the details in main window which needs to be repeated. Ie repeated in every page.

Also the datas which needs to be displayed in all the pages can also be displayed in main window.

See the link below it will be use ful for you,

Link: [Main Window in SAP Script|;

In this thing you are getting two main windows as you have not used WRITE_FORM in your driver program with out output parameters.

I have worked in my system and its working fine. So try using the normal method and after getting the ouput change the method for trial and error tests.

If you face any queries please revert back to em i will help you.

Thanks,

Sri Hari

Edited by: srihari.kumar on Jan 9, 2012 10:41 AM

amber_garg
Active Participant
0 Kudos

Thank you very much for your answer Srihari.

I had not used parameters in WRITE_FORM because i dont have any /E element for main window so there is nothing to be passed in ELEMENT paramter. Nerverthless i tried passing parameters WINDOW = 'MAIN' but still it shows it 2 times.

I fully understood the concept of MAIN window which you have told but in my case there is no repeated text to be displayed in other page.I just have a simple constant text in main window.

Former Member
0 Kudos

HI friend,

Did you tried debugging the driver program and saw is the write form calling twice or so.

Just debug the form and see for better understanding of its execution.

I think you will be able to figure out the problem by debugging. Just check and revert me back if you have any queries.

Thanks,

Sri Hari

nabheetscn
Active Contributor
0 Kudos

Then you can simply assign a text element to it and use write_form

thanks

Nabheet