Popup Bsp View Loads Twice

Hi All
I have a strange problem.
From the Web IC mvc application I use javascript to display a view with flow logic in a popup modal window.  this view has a textedit and and button.
The javascript loads the window, I hit the button and another instance of the window appears as a full page not a modal window.
Has anyone ever experienced this.  Any help would be great.
Here is the javascript code that is triggered from an onclientclick button event.
function ModalWindow(bpnum) {
    var popup = '/sap/bc/bsp/sap/zic_*****/NoteView.htm?BPNUM=' + bpnum;
    var result = window.showModalDialog(popup,'SalesNote',"dialogHeight:325px,dialogWidth:380px, status:no, help:no, resizable:no;");
    result.moveTo(400,100);
    result.focus();

Hi
I call a page using the javascript function that I posted earlier.  The pages loads correctly as a popup.
On this popup there is a textedit and a save button.  When I hit the button it creates a new instance of the page. The result is that I have the original page and a new page with the menu bar, title bar and address bar.
Here is the Layout:
<%@page language="abap"%>
<%@extension name="htmlb" prefix="htmlb"%>
<htmlb:content design="design2003">
  <htmlb:page title = "Enter Sales Note"> 
    <htmlb:documentBody>
    <htmlb:form>   
    <htmlb:group width="100%">
    <htmlb:groupHeader><b>Sales Note Details</b></htmlb:groupHeader>
    <htmlb:groupBody>
      <htmlb:gridLayout columnSize="13" rowSize="2">
        <htmlb:gridLayoutCell columnIndex="1" rowIndex="1" colSpan="2">
          <htmlb:label for="user" text="Created By:" />
        </htmlb:gridLayoutCell>
        <htmlb:gridLayoutCell columnIndex="3" rowIndex="1" colSpan="3">
          <htmlb:inputField  id="user" value="<%=wa_notes-Agent%>" disabled="TRUE"/>
        </htmlb:gridLayoutCell>
        <htmlb:gridLayoutCell columnIndex="1" rowIndex="2" colSpan="2">
          <htmlb:label for="aDate" text="Created On:" />
        </htmlb:gridLayoutCell>
        <htmlb:gridLayoutCell columnIndex="3" rowIndex="2" colSpan="3">
          <htmlb:inputField  id="aDate" value="<%=wa_notes-log_date%>" type="DATE" disabled="TRUE"/>
        </htmlb:gridLayoutCell>
        <htmlb:gridLayoutCell columnIndex="7" rowIndex="2" colSpan="2">
          <htmlb:label for="aTime" text="Time:" />
        </htmlb:gridLayoutCell>
        <htmlb:gridLayoutCell columnIndex="10" rowIndex="2" colSpan="3">
          <htmlb:inputField  id="aTime" value="<%=wa_notes-log_time%>" type="TIME" disabled="TRUE"/>
        </htmlb:gridLayoutCell>
      </htmlb:gridLayout>
    </htmlb:groupBody>
    </htmlb:group>
    <htmlb:group width="100%">
    <htmlb:groupHeader><b>Sales Note Text</b></htmlb:groupHeader>
    <htmlb:groupBody>
    <htmlb:textEdit id = "NoteText"
                        rows     = "10"
                        cols     = "65" text="<%=wa_notes-zzlines%>"
                        wrapping = "SOFT"/>
     <htmlb:button id="BtnSave" onClick="doSave" text="Save"/>
    </htmlb:groupBody>
    </htmlb:group>
   </htmlb:form>
   </htmlb:documentBody>
And here is the event processing "OnInputProcessing".
data: event type ref to cl_htmlb_event,
      http_fields type TIHTTPNVP,
      wa_fields like line of http_fields.
CLASS CL_HTMLB_MANAGER DEFINITION LOAD.
DATA: data TYPE REF TO CL_HTMLB_TEXTEDIT.
data ?= CL_HTMLB_MANAGER=>GET_DATA(
                                request = runtime->server->request
                                name    = 'textEdit'
                                id      = 'NoteText').
IF data IS NOT INITIAL.
  wa_notes-zzlines = data->text.
ENDIF.
event = CL_HTMLB_MANAGER=>get_event( runtime->server->request ).
if event->name = 'button' and event->event_type = 'click'.
  data: button_event type ref to cl_htmlb_event_button.
  button_event ?= event.
  case button_event->id.
    when 'BtnSave'.
      if editmode = abap_true.
        modify ZCRM_WEBIC_NOTES from wa_notes.
      else.
        CALL FUNCTION 'GUID_CREATE'
          IMPORTING
            EV_GUID_16 = wa_notes-NOTE_ID.
        insert into ZCRM_WEBIC_NOTES values wa_notes.
      endif.
      saved = abap_true.
      clear wa_notes.
  endcase.
Endif.
Message was edited by:
        Durairaj Athavan Raja
    to fix the formatting

Similar Messages

  • Non Modal Window Popup BSP View

    Hi,
    I have a requirement to launch a pop up window which will allow the user to access the original screen from which the pop up was launched (i.e. a non modal window). The pop up window contains a calculator with the intention being that the user would be able to view and copy data displayed on the original screen into the fields of the calculator.
    I have created the calculator as a form view within a BSP component. All of the fields on the form view have been configured using the configuration tab. I have successfully created a modal pop up using the following on the buttons click event:
    comp_controller->window_manager->create_popup( ).
    However, this does not meet my requirement because the form view is displayed in a modal window. I have also attempted to load the pop up using javascript however the view does not initialise correctly when it is loaded which causes a null reference error.
    Can anyone please provide any advice or assistance related to creating a non-modal window for a configured form view within a BSP component? Many of the examples I have found online are related to WebDynPro applications and html pages with flow logic rather than configured views with a controller class.
    Thank you.

    Hi,
    I have a requirement to launch a pop up window which will allow the user to access the original screen from which the pop up was launched (i.e. a non modal window). The pop up window contains a calculator with the intention being that the user would be able to view and copy data displayed on the original screen into the fields of the calculator.
    I have created the calculator as a form view within a BSP component. All of the fields on the form view have been configured using the configuration tab. I have successfully created a modal pop up using the following on the buttons click event:
    comp_controller->window_manager->create_popup( ).
    However, this does not meet my requirement because the form view is displayed in a modal window. I have also attempted to load the pop up using javascript however the view does not initialise correctly when it is loaded which causes a null reference error.
    Can anyone please provide any advice or assistance related to creating a non-modal window for a configured form view within a BSP component? Many of the examples I have found online are related to WebDynPro applications and html pages with flow logic rather than configured views with a controller class.
    Thank you.

  • Calling an ABAP WebDynpro Popup from a BSP view

    I need to know if the following is possible.
    I have a requirement to call an ABAP WebDynpro Popup from a BSP view.
    When the Popup is triggered (eg via pushbutton) the BSP will pass data to the Popup, before the Popup is closed the Popup will pass data back to the BSP to be displayed in the BSP view.
    I do not want to rely on Portal Events as Portals may not be used, would really appreciate a clean simple solution.

    Hi,
    any webdynpro application has a URL behind it. Haven´t you tried to call that URL with Javascript code ??
    script language="Javascript"
          url = "test_page.htm" + "?field=" + param;
          window.open(url, "F4window", "width=400, height=400");
    /script
    You can pass data to the WD application using parameters as I show you after the "?".

  • BSP View: URGENT

    I can see the Audit running when i test view default.do Main Controller. For other views like Start.htm which says different views for all modes i am not able to see the Page ..It just says Loading.... and stays there.
    Can u suggest sth,
    I am able to run the audit PIQAUDMP_CP for Mass but I want to show thatin BSP application PIQ audit. Where my requirtements should be either green or red.
    Its very important as we have some POC lined up.
    Can u help Michael,....??

    Deepak,
    I'm not sure what the exact problem is here, but here are some things to try:
    1) Check in the IMG that you have some BSP Views defined.  SLCM --> Processes in SLCM --> Audits --> Adjustment of User Interfaces --> Set Up views of BSP Applications.  Here, you should have some views, such as EV01, EV02, etc.
    2)  If that is OK, then try launching your BSP from a Favorite in the main menu.
    - BSP Application: PIQ_AUDIT
    - Start Page: default.do
    - Parameter AUDITTYPE: 1000
    - Parameter VIEW: EV01
    Good luck!
    Michael

  • Any ideas on a nice BSP view pretty printer?

    Hi there,
    I am wondering whether somebody already tried to extend the SAP standard pretty printer by an own functionality which fits better for pages with mixed content, containing not only BSP-elements but also HTML-tags.
    The standard pretty printer considers everything as plain text which is not a BSP-element and leaves it unaltered. Only BSP-elements are arranged according to their tree structure.
    This produces ugly results for pages with mixed content.
    1.) Requirement
    A Pretty Printer for HTML-based BSP views should cover the following:
    (a) HTML-Tags and BSP-elements together form the chain. As in following example:
    <z:table table_id="testTab" binding="//test/gt_test" rows="5">
      <z:tableBody position="top">
        <colgroup>
          <col width="4%">
          <col width="96%">
        </colgroup>
      </z:tableBody>
      <z:column name="type" header="<%=zcl_bsp_util=>dtel_text_s('EDI_TTYP')%>"
                listPos="10"/>
      <z:column name="text" listPos="20"></z:column>
    </z:table>
    (b) Certain HTML formatting tags like I, B, etc. should not be added to the stack but be treated inline.
    (c) HTML-attribute names should be converted to lower case, the attribute values should be quoted.
    (d) Like for BSP-elements, there should be a threshold after which the attributes should appear in separate lines. Instead of a certain maximum "number of attributes", this could also be a maximum number of characters per line.
    (e) Scripting Tags (<% ... %>) should start at a new line, if the content contains new-lines.
    (f) Evaluation Scripting (<%= ... %>) should be inline, if they are contained within text nodes (and not within HTML oder BSP element nodes).
    (g) The Pretty Printer should be parametrizable (with parameters like indent-depth,... ).
    2.) Exits?
    Of course, one could always use an external HTML editor and write an add-on for that editor which produces the desired result. Or one could take the view content into the clipboard, paste it into a plain text editor like UltraEdit or TextPad which allows external commands, apply an external, self-written pretty printer to it and then paste the result back into the View. But it would be easier to use the "Pretty Printer" button directly to get the result. Therefore the question arises at which point the standard Pretty Printer Functionality could be modified or extended.
    I didn't find an exit. But the pretty-print itself is doubly-decoupled in the standard which minimizes the number of points where an extension has to be made:
    2.a) First decoupling point: The Fcode handler method pretty_printer_ext( ) in cl_o2_page is calling
    dynamically a method in cl_o2_co2_processor:
    * call pretty printer
      create object pp type ('CL_O2_CO2_PROCESSOR').
      appl_str = me->pagekey-applname.
      page_str = me->pagekey-pagekey.
      try.
          CALL METHOD pp->('PRETTY_PRINT')
            EXPORTING
              indent              = 2
              ATTRIBUTE_NORMALIZE = 'X'
              ATTRIBUTE_THRESHOLD = 2
              BSP_UNFORMATTED     = source
              appl                = appl_str
              page                = page_str
            IMPORTING
              test_ok             = test_ok
              BSP_FORMATTED       = pp_source.
        catch cx_o2_co2_exception into o2ex.
    2.b) Second decoupling point:
    The method pretty_print() of class cl_o2_co2_processor (fancy names, by the way. It seems that many former chemistry students had joined the BSP team ),
    there is a second delegation, to a local class, as follows:
      data pretty type ref to LCL_BSP_PRETTY_PRINT.
      pretty = LCL_BSP_PRETTY_PRINT=>getInstance( processor = me ).
    The real logic for doing the Pretty Print, finally, is performed in this local class.
    3.) Implementation.
    Since, up to my knowledge, there is no HTML parser in the ABAP world,
    the implementation could be based on existing HTML Parsers, like the Perl module Parser::HTML, or the Java package http://htmlparser.sourceforge.net/ . The pretty printer could then be called as external OS command.
    Are there any ideas out there? Or is there somebody who already worked in this direction?
    Regards,
    Rüdiger

    For those who are interested. I found out that the Dave Ragget's classic "HTML Tidy" (see <a href="http://tidy.sourceforge.net/">http://tidy.sourceforge.net/</a> )  is available in ABAP! There is a class CL_HTMLTIDY (at least here in my SAP_BASIS 700 system) which wraps calls of HTML Tidy by kernel modules.
    The class is undocumented, but there are 2 OSS notes of this year for it, so it might well be that it is alive.
    HTML Tidy can surely not directly be used for Pretty Printing BSP views, but for designing test cases or for doing things like HTML parsing, it might be a helpful tool.

  • How to call Web Services (with javascript) in a view load event ?

    Hello to the expert community,
    I'm looking for a piece of javascript code allowing to call Web Services in a view load event ?
    Any ideas will be really appreciated.
    Regards.
    Have a nice week.

    Thank you for your answer, dongmei.
    It seems that the MethodResultTableDataProvider does not return the response of the web service as a value field if the WSDL contains only one result element.
    E.g. from WSDL of the USWeather Web Service which returns theGetWeatherReportResult string:
    <?xml version="1.0" encoding="utf-8"?>
    <wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://www.webserviceX.NET" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://www.webserviceX.NET" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
      <wsdl:types>
        <s:schema elementFormDefault="qualified" targetNamespace="http://www.webserviceX.NET">
          <s:element name="GetWeatherReport">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="ZipCode" type="s:string" />
              </s:sequence>
            </s:complexType>
          </s:element>
          <s:element name="GetWeatherReportResponse">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="GetWeatherReportResult" type="s:string" />
              </s:sequence>
            </s:complexType>
          </s:element>
          <s:element name="string" nillable="true" type="s:string" />
        </s:schema>If I drag the web service method on the page and I should be able to select the response value in the Bind to Data dialog box. But there is no value field. Value fields only occur if the web service returns more than one value.
    The question is how can I get the response GetWeatherReportResult from the service.

  • Can I get a refund if album was down loaded twice

    Can I get a refund if an album has down loaded twice?

    Did you pay for it twice?
    MJ

  • How to display the one BSP View page (not a start page)Through URL link..

    Hi Sir/Madam,
                 I want to open one BSP view page through URL link...
    Let me Explain clearly..
                I have an Z application ZHRRCF_APPROVAL..In this application approve.bsp file i have added som more Fields..and Finally I am going to click ApproVe Buton /Reject Button.When i click the reject button the the items are rejected.Its working fine.....
              My Requirement is :
                   1. I want to display the approval page directly when i click the URL link from mail box.--i am getting this .. No issues..(Got the URL link from function module)
                   2. After opening the approval page when i click URL link, when i click the reject button-- i am getting the error "The following Error Text was processed in the system GR2."Access via NULL object reference not possible"
                   3. How to proceed the this URL link without error .. the URL link is
    https://abd00093.de.abb.com:8200/sap(bD1lbiZjPTIwMA==)/bc/bsp/sap/zhrrcf_approval/application.bsp?objid=50003421&otype=NB&plvar=01&requestdate=20090121&requestedRsnCode=01&requestedstatus=1&requester=USRECRUITER1&SAPWFCBURL=https%3a%2f%2fabd00093%2ede%2eabb%2ecom%3a0000000000008200%2fsap%2fbc%2fwebflow%2fwshandler%3f_sapwiid%3d000000018491%26_saptask%3dTS51807979%26_saplogsys%3dGR2CLNT200%26_sapuname%3dLINEMANAGER%26_saplangu%3dE%26sap-client%3d200
    ( I got this URL directly using my own function module.. In this function Module i was not getting the SAPGUID -- the error is because of that i am not sure..)How to get this sapguid dynamically..
                    Please guide me to proceed this req asap..
    I am waiting for your reply ....Please
    Thanks and Regards
    Mohan,P

    Please have BPEL loggers both at domain and system level to DEBUG mode. Set all loggers to DEBUG as you are interested to see the entire sequence flow..however, some loggers give you unnecessary info ;/ apart from cube, activation, delivery, dispatch, persistence.
    Added to this, you might want to try SOAPUI, Fiddler, HTTP Analyzer.

  • How to create a popup window to load HTML page in AIR application without using any mx or spark?

    How to create a popup window to load HTML page in AIR application without using any mx or spark components?
    I need to load the HTML page in popup in AIR application without using any of the <mx> or <spark> components. I need to open in the application itself not in the browser.(If we use navigateToURL() it will open in th browser)

    Can we achieve this? can somebody help me on this scenario..

  • How to embed html page in bsp view

    Dear all,
    I would like to embed a html page (eg: www.google.com)  inside bsp view. I have used iframe to do this; but the iframe is getting refreshed everytime a button is getting clicked. Delta handling flag is also not working for iframe. Is there any other method to embed html in bsp view.
    Thanks and Regards,
    Manasi

    Hi Shreya,
    See if this <a href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/ep/_s-u/SDN%20Behind%20The%20Scenes%20-%20Embedding%20an%20EP%205.0%20iView%20in%20an%20HTML%20Web%20Page">link</a> helps.
                            OR
    You can create a JSP dynpage in portal application object.
    Along with this JSP and dynpage is created automatically. You can copy the html page and paste it in JSP page. To make it display, include a statement in JSP dynpage as
    this.setJspName("JSPname.jsp");
    For more info on this u can refer:
    http://help.sap.com/saphelp_nw04s/helpdata/en/95/cfa441cd47a209e10000000a155106/frameset.htm
    To get an idea of content development you can refer this <a href="https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2845">weblog</a>.
    Regards,
    Pooja.
    Message was edited by: Pooja S

  • Movie is loading twice

    Structure:
    * one main movie
    ** one swf loaded into that
    *** one mc in that
    I animate the mc using the timeline (movement up) and on the
    first frame of the same mc I generate up an interface inside it.
    This all works, but:
    When the mc has generated the interface and animated all the
    way up and stops....... It wipes clear and runs the script on the
    first frame again. In effect the interface blinks for half a second
    and everything that's been changed through functions up until that
    needs to be called again. o_O
    The wiping seems to coincide with the moment it hits the last
    frame on the animation (ie a new keyframe), but that shouldn't
    cause the movieclip to restart, right!? Someone must have had this
    issue before, do I have to make a scripted animation instead of
    using the timeline?

    Right I should have mentioned that, I do have stop() on the
    animation and the mc that I generate an interface in is just 1
    frame, which normally means it will run just once. (and if that was
    the problem it would load a whole lot more times then twice, now it
    loads twice and then it's done.)

  • EXS samples loading twice

    After upgrading from Logic 6 to 7 I get the following strange behaviour:
    When I start up Logic by double-clicking a song file that contains EXS24 instruments, the samples are loaded twice (according to the Progress window).
    Anybody else have experienced this? Or any ideas what may be wrong with my setup?
    PowerMac G4/1.2GHz   Mac OS X (10.4.4)  

    Thanks stash, but that wouldn't explain the behaviour, because
    1) I'm using only new samples from Logic 7, like eg. Yamaha Grand Piano
    2) The double loading does NOT occur if I open the song when Logic is already booted
    Perhaps somebody can do a little test to confirm/disprove this issue:
    - Create a song with just one EXS instrument, load the Yamaha Grand Piano
    - Save the song and quit Logic
    - Double-click the song file in the finder
    - Watch the loading in Progress window, does it appear only once or twice?
    Thanks in advance.
    PowerMac G4/1.2GHz   Mac OS X (10.4.4)  

  • How can I prevent pages loading twice?

    Practically every time I click on a link in an email (Outlook 2007) Firefox 3.6.6. loads the page, displays "stopped" and then reloads it, leaving two tabs with the same title.
    When I looked for a solution in this forum, searching for "firefox loads pages twice" I got 514 results filling 52 pages, but I soon discovered that though various versions of the question had been asked, there appeared to be no answer, and some replies got into technicalities that were beyond the average user of firefox.
    So I raise two points:
    1 Can we have a better filter in the forums that does not list every individual hit on a word in the query, but only on the complete phrase (putting it in quotes did not help)?
    2. Has a solution been found yet?
    == URL of affected sites ==
    http://

    What is the point of this forum if over 500 people have a problem with pages loading twice, but nobody, neither volunteers nor someone from Mozilla, can provide a solution?
    Perhaps it is time to switch to Opera.

  • Home page is loading twice. How do I stop this?

    Whenever I open Firefox, my home page is loaded twice. How do I stop this from happening?

    Firefox allows multiple homepages in separate tabs, maybe you inadvertently set the same page twice? ''Those separate pages have a pipe symbol'' | ''between them in the "Homepage" dialog box.''
    http://support.mozilla.com/en-US/kb/How+to+set+the+home+page

  • Hide Button when view loads

    I am making a simple iOS game in which there is a main menu which has a play button which takes you to a window that says "Start" to start the game. In the second view there is also a pause button, resume button and main menu button. I only want the pause and start button to apper when the second view loads. This does not mean clicking start and then the buttons disappering.
    How do I do this.
    Thanks in advance!

    You should be able to set it to hidden right away in the onViewDidLoad call for the view.
    Cheers,
    Rob

Maybe you are looking for

  • Subagent -- GET

    Hi! I will write a subagent using SDK. The agent shall give me the states of many software-components and it shall provide a interface to a GUI using C++ wedges. From this GUI I want to send GET and SET to the SEA Master Agent. Will he provide GET an

  • My trackpad is dug in on one side..

    on the left side my trackpad is dug in.. any way to fix this? It's been lopsided for about 3 days now..

  • Finding the right Collection

    Hello, I am preparing a small, local database (Collection + Serialization) I want to choose the right Collection. I have patients which are recognized by ID which is the key, but I would like to sort the Database's elements by one of the field which

  • Can I use the nano sim card from my HTC One (M8) for an iPhone 6?

    I am getting a Mac and with Yosemite, it's geared towards iPhones. So, I have decided I want to get an iPhone 6. However, I don't want to spend the extra money to upgrade through AT&T. If I order the iPhone 6 off the internet, can I put the nano sim

  • Make Pages Default For Opening Word Documents

    I currently use iWork but also use openOffice, whenever I open up a Word document by double clicking it openOffice opens... How can I make Pages the default application for handling these files?