System APILocate this document in the navigation structure

System API provides a set of methods to discover the underlying client environment and current EPCM object. For background information, see System and Environment .

EPCM.getVersion()

Note

The EPCM.getVersion() API is deprecated. For more information and the list of affected releases, see SAPnote 2281002 Information published on SAP site.

Returns the current framework version as a number.

Sample Code
                  <script language="JavaScript">
    var version = EPCM.getVersion();
</script>

               

EPCM.getLevel()

Returns the current EPCF level as a number.

The EPCF level defines which EPCF services are available. Make sure that your portal application only uses services that are available at the current EPCF level.

Sample Code
                  
<script language ="JavaScript">
if (EPCM.getLevel() >= 2) 
                {
   EPCM.storeClientData( "urn:com.sap:myObjects","person", "John Doe" );
                }
 </script>

               

EPCM.getUAType()

Returns the client (user agent) type as a number.

The return value is equal to one of the predefined EPCM constants:

EPCM.MSIE, EPCM.NETSCAPE, EPCM.MOZILLA, EPCM.OPERA, EPCM.NOKIA, EPCM_UP, EPCM_ERICSSON, EPCM_MSPIE, EPCM_PALM, EPCM.OTHER.

Sample Code
                  <SCRIPT language ="JavaScript">
     if(EPCM.getUAType() == EPCM.MSIE){/*for IE*/ }
     if(EPCM.getUAType() == EPCM.MOZILLA){/*for Mozilla*/ }
 </SCRIPT>

               

EPCM. getUAVersion()

Returns the version of the client as a number.

Sample Code
                  <SCRIPT language ="JavaScript">
    if(EPCM.getUAType() == EPCM.MSIE){
      if(EPCM.getUAVersion() == 6.0){/*for MSIE 6.0 */ }
      if(EPCM.getUAVersion() > 6.0){/*for MSIE 7.0*/ }
    }
 </SCRIPT>

               

EPCM.getUAPlatform()

Returns the platform on which the client is running as a number.

The return value can be compared to the predefined EPCM constants:

EPCM.NT_PLATFORM, EPCM.WIN_PLATFORM, EPCM.MAC_PLATFORM, EPCM.LINUX_PLATFORM, EPCM.WAP_PLATFORM, EPCM.PDA_PLATFORM, EPCM.OTHER_PLATFORM.

Sample Code
                  <SCRIPT language ="JavaScript">
   if(EPCM.getUAPlatform() == EPCM.LINUX_PLATFORM){
   /* code that is processed if the client runs on LINUX */
   }
</SCRIPT>

               

EPCM.getInstanceId()

Returns a unique EPCM instance ID as a string.

When a page is refreshed, the previous instance of the EPCM object is discarded and a new instance is created. To check whether the EPCM instance has changed, compare the value returned by this method with a previously stored value.

Sample Code
                  <SCRIPT language ="JavaScript">
   document.write("EPCMInstanceId = " + EPCM.getInstanceId() );
</SCRIPT>

               

EPCM.getUniqueWindowId()

Returns an unique identifier of the IFrame as a string.

You can use this method to append the returned IFrame identifier string to the name you use to define a client data bag. This creates a client data bag that can only be accessed by a specific IFrame.

Caution

The method returns null when the window.top object (reference of the topmost frame of the current window) cannot be accessed because of the Same Origin Policy. For more information, see Relaxing of the Same Origin Policy .

Sample Code
                  <SCRIPT language ="JavaScript">
     document.write("WindowId = " + EPCM.getUniqueWindowId() ); 
     ...     
     ECPM.storeClientData(
     "com.sap.portal:test",EPCM.getUniqueWindowId()+"Item",myItem);
     ...
 </SCRIPT>

               

EPCM.getSAPTop ()

Returns the reference to the topmost frame that belongs to the SAP Portal.

Sample Code
                  <SCRIPT language ="JavaScript">
if( EPCM.getSAPTop() == window){
  /* the current frame/window is the topmost one */
}
</SCRIPT>