Skip to Content
1

Access global variable from stand alone html page in SAP Web ui

Oct 26, 2016 at 10:07 PM

151

avatar image
Former Member

Hi,

I have global variable with data. I need to display the data in an html page. This html page is not a part of a view. It is in component CRMCMP_IC_FRAME under Pages with Flow Logic. This page is used as a popup when a IC toolbar button is called.

If I directly try to access the global variable it shows empty.

Can anyone please help me regarding this issue.

10 |10000 characters needed characters left characters exceeded
Former Member

I am still trying but anable to find any solution. I have observed that when I am calling any call variable or method (static or instance) from the HTML page, Its not at all loading the run time call instances. So everything in the class in empty.

How can I get the runtime class data from the HTML?

0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Corrine Guan
Oct 27, 2016 at 05:54 AM
0

Suggest you add additional Tag 'UI Webclient UI Framework' also.

Regarding the question, where did you define your global variable?

What JS codes from which file do you use to call this html page from the button?

In your own html file, what's your codes to write the variable?

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

1. I have defined the global variable (static and public) in a view which is loading in the begining and populating the value too. (In debugging I can see the value is there )

2. I have created a new button on the IC toolbar and JS file header_jscripts.js is calling an html page as popup using code window.open()

3. In HTML file I have declared a same type of variable and tried the following ways to assign the value.

  • Directly assign the value: lv_data = class_name=>variable_name
  • By calling a static method which is returning the value: lv_data = class_name=>method_name( ).
  • Is there a way to use the page attribute in this. I have limited knoledge of it. I have created a page attribute for the class in which the variable is but the attribute name is not recognized in the html page.

Could you please help me out.

0
Corrine Guan
Nov 01, 2016 at 08:09 AM
0

Hello,

Not sure how exactly you implement your codes in the HTML file.

When you assign lv_data = class_name=>variable_name , and when you using the lv_data, are you writing them in <% ... %> ?

.

Or else, since you are opening the htm file using window.open, maybe you can also refer to the file

GenericPostExecutionNewWindow.htm under CRM_UI_FRAME. This

GenericPostExecutionNewWindow.htm is to be opened by a window.open JS statement when opening a transaction launcher in new window, and inside this htm file, you can see variable gv_layout .

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi. Thanks for replying.

I can not understand how to use GenericPostExecutionNewWindow.htm.

Whwnever any method and attribute is getting called from the HTML, its not at all loading the runtime instances. Whats why its all empty.

Is there a way I can call the HTML page from any method of the Component/View ans pass the value as parameter?

0

Can you upload your .htm file source code here?

0