Skip to Content
author's profile photo Former Member
Former Member

Modal Page

Hi everybody.

I have a "Find" button near an input box in a page, and i want a modal page, with the options for that input box, to be shown after pushing the button. After choosing an option, the modal page will be closed, and the option will appear in the input box of the original page.

The modal page will show options readed from a SAP table.

Can someone help me to know how to do this?

Thanks in advance.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Feb 10, 2004 at 11:56 AM

    Hello Marièn,

    To realize this functionality you need some javascript code:

    after your "find" button was clicked you have to open a new window via javascript. I use a method to retrieve the server information, e.g.

    CALL METHOD cl_http_server=>get_extension_info


    extension_class = 'cl_http_ext_bsp'


    urls = l_urls.

    then you can concatenate the url of your popup window.

    After this you build up you JS - STring, e.g.


    '<script type="text/javascript">' ' ' 'NW' lv_contract_num " any ID ' ' '=' ' ' ' ' '"' lv_url "your url '"' ',' '"' lv_window_name "place a nice name here:-) '"' ',' '"' 'resizable=yes,status=yes,scrollbars=yes,menubar=no,Width=850,' 'Height=650,top=20,left=30' '"' ' );' ' ' '</SCRIPT>' INTO model->gv_javascript_opener. On the html-page I check if this javascript-string is filled and let it render --- <%= model.>gv_javascript_opener %> ... Now the window is open. To write back the selected value into your opener window you can use JS coding like this: CONCATENATE '<script type="text/javascript">' ' ' 'window.parent.opener.document.getElementById(' '"' model->GS_MATSEARCH_T_DETAIL-SOURCE_ID '"' ').value =' '"' lv_t_matnr '"' ';' ' ' 'top.window.close();' ' ' '</SCRIPT>' INTO model->gv_onclick_target_matnr. Render this string the same way on your new "find"- window when a value was selected. What you need is the "NAME" of input field to set the selected value via the JS method getElementByID(). In our case model->gs_matsearch_t_detail-source_id is the name of that input field.

    Now I pray that you don't work within a SAP Enterprise Portal Infrastructrue because then the JS will only work if Portal and WebAS are within the same domain.

    Hope that helps instead of confusing anyone.....

    Regards, Bernd

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.