cancel
Showing results for 
Search instead for 
Did you mean: 

First page global variable is getting overlapped with the last page's

Former Member
0 Kudos

Hi all,

I have one small problem.In my company there is PO form.At the end of the PO,I have to attach my code.I am getting one small problem,which I and my freinds are unable to resolve it for the past 3 days.I commented my entire code and checked with the below example.Even though I am getting the same wrong data.So,problem is not with my code.

At the end of the PO below is the code.I have one global variable 'X' declared in top include.

****End of existing PO code*********

****Begin of my code*******

X = '1'.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'POSPEC'

WINDOW = 'MAIN'

EXCEPTIONS

ELEMENT = 1

FUNCTION = 2

TYPE = 3

UNOPENED = 4

UNSTARTED = 5

WINDOW = 6

BAD_PAGEFORMAT_FOR_PRINT = 7

SPOOL_ERROR = 8

CODEPAGE = 9

OTHERS = 10.

X = '2'.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'POSPEC'

WINDOW = 'MAIN'

EXCEPTIONS

ELEMENT = 1

FUNCTION = 2

TYPE = 3

UNOPENED = 4

UNSTARTED = 5

WINDOW = 6

BAD_PAGEFORMAT_FOR_PRINT = 7

SPOOL_ERROR = 8

CODEPAGE = 9

OTHERS = 10.

POPEC is text element in main window.It creates a new page POSPEC

/E POSPEC

NEW-PAGE POSPEC

I have one variable window,which has the variable 'W'.Now I have to get 2 new pages(POSPEC) with W as '1' on the begining page and W as '2' on second page.But unfortunately I am getting W as '2' on the two pages.Remember W is on the variable window of the page 'POSPEC'.

Can anyone help me in this regard.It is very very urgent.I have been struggling for the past 3 days.

Thanks,

Balaji

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Krishna,

In Sapscripts, the variable window gets called only once at close_form and what ever the value is there at that time in your variable it will be displayed. That is why in your case you are getting only '2'.

If you want to use more than once then you should use MAIN window for that pupose.

Regards,

Anil

Pls award if helpful..

Former Member
0 Kudos

Hi Anil,

How can it be like that.If it is the case then how my footer window(which contains page of &page& sapscript-formpages) getting displayed.

no i am not sure that it is your correct.

please dont misunderstand me if i am mistaken.

Thanks,

Krishna

Former Member
0 Kudos

Anil,

Could you please let me know other alternate solution other than Main Window.My problem is I have to remove main window and create another window,which is bigger than main window.This we need because our Bitmap images will be too bigger.So I created new page with new variable window.Main window is part of PO .I modified both Print program and PO form to include my Modifications immediate after PO starting with new page.

So I can't create a new page with Main window.Since parameters for Main window are fixed.

Please let me know if you have any questions.

Thanks,

Balaji