I'm facing an issue while trying to display a page ( SAP BEx Report) on an IFrame.
There is a javascript function inside the the page make it keep refection.
I’m trying to overwrite this function before it run.
The src for the IFrame page :
Expand|Select|Wrap|Line Numbers
- <html><head><LINK REL=stylesheet HREF="/irj/portalapps/com.sap.portal.design.portaldesigndata/themes/portal/ARAMCO/prtl_std/prtl_std_ie6.css?7.1.5.0.1">
- <!-- EPCF: BOB Core -->
- <meta http-equiv="Content-Script-Type" content="text/javascript">
- <script src="/irj/portalapps/com.sap.portal.epcf.loader/script/optimize/js13_epcf.js?7.01000020"></script>
- <script>
- <!--
- EPCM.relaxDocumentDomain();
- EPCM.init( {
- Version:7.01000020,
- Level:1,
- PortalVersion:"7.0105.20090812092945.0000",
- DynamicTop:false, // [service=true nestedWinOnAlias=false]
- UAType:1, // [MSIE]
- UAVersion:8.0,
- UAPlatform:1, // [Win]
- UIPMode:"1", // [Default=1, User=0, Personalize=true]
- UIPWinFeatures:"",
- UIPPortalPath:"http://dvb.aramco.com.sa:52000/irj/portal",
- UIPPopupComp:"/irj/servlet/prt/portal/prtroot/com.sap.portal.epcf.admin.WorkProtectPopup",
- UIPPopupCompSize:"dialogWidth:450px; dialogHeight:200px; status:no",
- UIPPopupMsgNN:"",
- UIPPopupMsgND:"",
- DBGException:false
- } );
- EPCM.DSM.init( {
- TerminatorURL:"/irj/servlet/prt/portal/prtroot/com.sap.portal.dsm.Terminator",
- WinEmptyUrl:"/irj/portalapps/com.sap.portal.dsm/images/empty.gif",
- ForcedUserDebug:false,
- KeepAliveActive:false,
- KeepAliveDelta:840,
- KeepAliveStopAfter:36000
- } );
- function SAPWP_receiveSessInfo( sessInfo, frameRef ){
- EPCM.DSM.processSession( sessInfo, frameRef );
- }
- //-->
- </script>
- <!-- EPCF: EOB Core -->
- <script type="text/javascript">
- /*HTML Business for Java, 701_SP_TEST, 528954, Sat Jul 11 21:55:20 AST 2009*/
- ur_system = {doc : window.document , mimepath :"/irj/portalapps/com.sap.portal.design.urdesigndata/themes/portal/ARAMCO/common/", stylepath : "/irj/portalapps/com.sap.portal.design.urdesigndata/themes/portal/ARAMCO/ur/", emptyhoverurl : "/irj/portalapps/com.sap.portal.htmlb/jslib/emptyhover.html", is508 : false, dateformat : 1, domainrelaxing : "MINIMAL"};
- </script>
- <title >SAP NetWeaver Portal</title><meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"></head><body class="prtlBody urFontBaseFam urScrl">
- <!-- EPCF: Component com.sap.portal.appintegrator.sap.BWReport, codjkaekngoeniemidleobclomgncaib -->
- <script>
- <!--
- function hasNestedFrameStructure() {
- try {
- return (parent != window) && (parent.EPCM != null);
- } catch(e) {
- return false; // access denied!
- }
- }
- //-->
- </script>
- <!-- Session Mangement Check -->
- <!-- HTTPRenderLayer_Redirect::Begin -->
- <form id="form_Redirect_9223372036563636042"
- name="form_Redirect_9223372036563636042"
- method="POST"
- target="_self"
- action="/irj/servlet/prt/portal/prtroot/com.sap.ip.bi.web.portal.integration.launcher"
- style="DISPLAY:none">
- <input type="hidden" name="sap-bw-iViewID" value="pcd:portal_content/com.sap.pct/platform_add_ons/com.sap.ip.bi/iViews/com.sap.ip.bi.bex">
- <input type="hidden" name="sap-ext-sid" value="H6enlztSkkUZX7G*QhdSKA--Jt2cQdvkBs_*9RVvQeGETA--">
- <input type="hidden" name="Language" value="EN">
- <input type="hidden" name="QUERY" value="ZPS_PMIS_R_006_01">
- <input type="hidden" name="DUMMY" value="5">
- <input type="hidden" name="VARIABLE_SCREEN" value="X">
- </form>
- <div><iframe
- id="iframe_Redirect_9223372036563636042" name="iframe_Redirect_9223372036563636042"
- title="BEx Web"
- src="/irj/servlet/prt/portal/prtroot/com.sap.portal.appintegrator.Loading?1887930939"
- width="100%" height="100%"
- marginheight="0" border="0" frameborder="no">
- </iframe></div>
- <script>
- function requestTargetURL() {
- var theForm = document.getElementById("form_Redirect_9223372036563636042");
- var dsmObj;
- if (hasNestedFrameStructure()) {
- dsmObj = parent.EPCM.DSM;
- } else {
- document.body.scroll = "no"; // for IE only
- theForm.target = "iframe_Redirect_9223372036563636042";
- document.getElementById("iframe_Redirect_9223372036563636042").style.visibility = "visible";
- dsmObj = EPCM.DSM;
- document.title = 'BEx Web';
- }
- dsmObj.registerFullKey("GUSID:H6enlztSkkUZX7G*QhdSKA--Jt2cQdvkBs_*9RVvQeGETA--", "1288161886180");
- theForm.submit();
- }
- function onloadhandler(){
- setTimeout("requestTargetURL()",1);
- }
- </script>
- <form id="form_ClientWindowID_9223372036563636042" name="form_ClientWindowID_9223372036563636042"
- method="POST"
- target="_self"
- style="DISPLAY:none">
- <!-- Request Parameters -->
- <input type="hidden" name="VARIABLE_SCREEN" value="X">
- <input type="hidden" name="ClientWindowID" value="null">
- <input type="hidden" name="DUMMY" value="5">
- <input type="hidden" name="QUERY" value="ZPS_PMIS_R_006_01">
- <input type="hidden" name="$Roundtrip" value="true">
- <input type="hidden" name="$DebugAction" value="null">
- </form>
- <script>
- <!--
- function submitClientWindowIDForm(formTarget, formAction) {
- // set ClientWindowID Form-Field
- var theForm = setClientWindowIDForForm("form_ClientWindowID_9223372036563636042");
- // set Target
- if (formTarget != "_self") {
- theForm.target = formTarget;
- }
- if (formAction != null && formAction.length > 0) {
- theForm.action = formAction;
- }
- // submit
- theForm.submit();
- }
- function setClientWindowIDForForm(formID) {
- var windowID = EPCM.getUniqueWindowId();
- var theForm = document.getElementById(formID);
- // add unique window ID to the form
- if (theForm.ClientWindowID != null) {
- theForm.ClientWindowID.value = windowID;
- }
- return theForm;
- }
- //-->
- </script>
- <script>
- <!--
- var trueWindowID = EPCM.getUniqueWindowId();
- if (trueWindowID != "null") {
- submitClientWindowIDForm("_self");
- } else {
- EPCM.subscribeEvent("urn:com.sapportals.portal:browser","load",onloadhandler);
- }
- //-->
- </script>
- <!-- HTTPRenderLayer_Redirect::End --></body></html>]
The javascript function which causing the issue
Expand|Select|Wrap|Line Numbers
- function hasNestedFrameStructure() {
- try {
- return (parent != window) && (parent.EPCM != null);
- } catch(e) {
- return false; // access denied!
- }
- }
The script inside the IFrame will run before onload event.