cancel
Showing results for 
Search instead for 
Did you mean: 

Call BSP htm page in Pop up from component view and send back values

Former Member
0 Kudos

Hi,

Please help me with the below requirement.

I have an htm page (page with flow logic) in my component that is calling some web service to fetch some data .

I need to call this htm page from a view on click of a button call it 'Fuzzy Search'. Button is added to the view in .htm page.

I am able to call that htm page (page with flow logic) using 'onclientclick' attribute of button using javascript.

<crmic:button design  = "STANDARD"
                      id      = "FUZZY"
               onClientClick = "var lhurl = '../Z_WW_CRM_IC/fuzzysearch.htm'; window.open(lhurl, 'Search');"
                          text    = " Fuzzy Search " />

But from the pop up, there would be some values returned from web service call in form of internal table (array), which I need to send back to my calling page for setting of collection wrapper of result view.

For this, possible solutions could be

1. calling HTM page in pop up from EH_ONFUZZY using onclick, but how do I return values from HTM pop up to my calling page

2. using 'onclientclick' javascript and return values using opener.window(return values), but then how do i set the collection wrapper as these values I would receive in .htm page of the component view

P.S. Button is coded in component view htm page, please reply considering that.

Also, I had put this in CRM WebUI forum as well, please refer to that in case required, as I am not sure in which forum would the proper skillset be utilized.

Waiting for guidance.

Regards,

Rohit Khetarpal

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

no replies...no use watching

Former Member
0 Kudos

Hi Rohit

I just want to explain two things. You might already know these things.

1. How to pass values between Javascript and ABAP variables - You can declare an empty inputfield in HTML inside your pop up window. You can send values into this empty field upon clicking on some button in your popup window. Once you have value in this input field, you can retrieve the value in the 'OnInputProcessing' event using the method 'Get_Form_Field'.

2. Once you have the above value in an ABAP variable, you can use export and import to memory funcitonality to use it anywhere you want.

Hope my points helps you in some direction.

Regards

Hari

Former Member
0 Kudos

No replies?

I have seen a couple of threads telling how to call a view in pop up using do_request, calling .do using javascript, and using call view.

but my requirement is to call page with flow logic on click of a button from Search Page, and return values(in form of array/table) back so that i can set the result.

complete scenario is:

Search page -> button search -> open page with flow logic htm page in pop up (which calls web service in do request) -> self.close -> read back the result array into calling search page -> it should go to some server event handler so that i can set the result collection

I am able to call using java script, i am not able to pass value using opener.document syntax (it says not accesible)... i can set global variable and read it, but it wont go to event handler of calling page on close event, then how do i set collection? directly in .htm page?

Any help will be highly appreciated!!

Note: Am working in BSP component for ic webclient 5.0, so its pure bsp involved here.

Regards,

Rohit Khetarpal

Edited by: Rohit Khetarpal on Mar 19, 2010 12:45 PM

Rodrigo-Giner
Active Contributor
0 Kudos

I did it but passing only one variable. Dont know if u could pass an internal table in the same way

I did it to make a Custom Search Help (F4) pop up.

In teh Search. htm this is the Js code

function transf(fval)

{

document.getElementById("search_i_VKORG_low").value = fval;

}

function getF4(pagina)

{

var url = 'F4.htm?pagina='+pagina;

NewWindow=window.open(url,'newWin','width=500,height=300,left=20,top=20');

NewWindow.focus(); void(0);

}

and in the F4.htm

function getData()

{

opener.transf("<%=w_valor%>");

window.close();

return true;

}

So, the popup pass to the function transf the variable w_valor (this w_valor is declared in the F4.htm so u can declare this variable like a table.

and in this function I recive the value and put it in a inputText

function transf(fval)

{

document.getElementById("search_i_VKORG_low").value = fval;

}

From what I now there is no way to pass variables from JS to ABAP. A lot of ppl use Hidden InputText to store values sorta like I did, but never read about tables.

Former Member
0 Kudos

Thanks for the useful reply.

Sorry for coming back late on this, was occupied with other issues.

I was trying the same thing, but have a peculiar problem, if you are aware of the same please let me know.

When I am trying to call opener.<funcname> or window.opener.<funcname> or window.document.form[0].<func> ..... any of this, I get 'Access is denied' error in javascript.

(note: it works when call is between two page with flow logic .htm pages, but I am calling page with flow logic .htm page from a view.htm page, Also I am opening window using OnClientClick of Button, can't we access Javascript function written within this from pop up window???)

Some research says that it comes when domain of calling and called window are not same, I have no idea why would it happen and how to avoid it!

Any help/suggestions plz?

Thanks,

Rohit