Skip to Content

This is the continuation of the blog SAP MI WebConsole simulation using PHP Script.



Function Modules Used



Table 1.2: Used Remote Function Modules

Function Module

Functionality


MEMGMT_DEVICE_ASSIGN_APPL
This is used to register particular application to particular device or to all devices.We will have to fill up the import parameters appropriately.
The import parameter ACTION should be filled with R if you want to assign application.This parameter with value U
is used to uninstall particular application.

MEMGMT_MCD_UPDATE
This is used to create MCD. MCD could be of type Application,SSL,Addon etc.If the same application is present, the current execution of this
function module will modify the existing application.

ME_JSP_SMOMO_MSD_DELETE
Used to delete the specified MCD.

MEMGMT_GET_DEVICE_LOGS
This is the standard function module for displaying the installation logs and traces. This one is not remote enabled. So we will have to copy this function module to our name space and made it remote enabled. Set the pass by value attribute for all import parameters.

SO_USER_LIST_READ
To get the list of Users in the MI Server.

MEMGMT_DEVICE_GETLIST
Used to get the list of device ids installed on the MI Server.This has one import parameter USERNAME.If you want to list the
device ids of particular user , you will have to fill up this parameter with the user name.

ME_JSP_SMOMO_MSD_GETLIST
Used to get the list of MCDs created on the MI Server.

MEMGMT_DEVTEMPLATE_GETLIST
Used to get the list of device configurations present in the MI Server.

MEMGMT_DEVICE_GETDETAIL
Used to get the attibutes of particular device.We will have to fill up the import parameter I_DEVICE_ID with the device id you want to display.

MEMGMT_MCD_GETLIST
Used to get the list of MCDs created on the MI Server.

WAF_DEVICECONFIG_UPD_BY_ROLES
This can be used to start the role synchronization



Style Sheet Used.


mi.css

You will have to copy this file into a directory named style within the htdocs directory or the directory you created for keeping the PHP files.


h6


td


input


tr.hP
{
     background-color: #fffbd5;
     color: black;
     font-family: “Arial, sans-serif”;
     font-size: 8pt;
     font-style: normal;
     font-weight: bold;
}


<!– Style for table header –>
tr.miHeader
{
   background-color: #9caece;
   color: black;
   font-family: “Arial, sans-serif”;
   font-size: 8pt;
   font-style: normal;
   font-weight: bold;
}                   
<!–  Style given for IBase Name –>
tr.miIBaseName
{
   background-color: #dedede;
   color: black;
   font-family: “Arial, sans-serif”;
   font-size: 8pt;
   font-style: normal;
   font-weight: normal;
}   
<!– Style for table body –>
tr.miBody


td.1stCellHeader
{
   border-bottom: black 1px solid;
   border-left: black 1px solid;
   border-right: black 1px solid;
   border-top: black 1px solid;
}


<!– Style for next cell in table header –>
td.nextCellHeader
{
   border-bottom: black 1px solid;
   border-left: black 0px solid;
   border-right: black 1px solid;
   border-top: black 1px solid;
}


<!– Style for first cell in table body –>
td.1stCellBody
{
   border-bottom: black 1px solid;
   border-left: black 1px solid;
   border-right: black 1px solid;
   border-top: black 0px solid;
}


<!– Style for next cell in table body –>
td.nextCellBody
{
   border-bottom: black 1px solid;
   border-left: black 0px solid;
   border-right: black 1px solid;
   border-top: black 0px solid;
}


</textarea>
</p>



JavaScript Used


docmanipulations.js

You will have to keep this docmanipulations.js file in a directory named script as i am referring this file as “script/docmanipulations.js in all of the PHP pages.

|\/|
|&|\$|%|!|\?|\;|\||\(|\)|~|\{|\}|\[|\]/g, “”);
  }
  else {
    newString = string;
  }
  return newString;
}


function checkInputFieldsFor(obj){
  applName = document.resultform.APPLNAME.value.toUpperCase();
  document.resultform.APPLNAME.value = replaceTags(applName);
  userName = document.resultform.USERNAME.value.toUpperCase();
  document.resultform.USERNAME.value = replaceTags(userName);
trimSpaces(obj);
}


function modifyDeviceValue(){
if(document.resultform.ALLDEVICES.checked)
  document.resultform.ALLDEVICES.checked = false;
}


function modifyDevices(){
  if(document.resultform.ALLDEVICES.checked == true){
    document.resultform.DEPLID.value = ” “;
  }
}


function checkConfigInput(){
  if(document.resultform.ALLDEVICES.checked == true){
    document.resultform.DEPLID.value = ” “;
  }
  if(document.resultform.USERNAME.value == “”){
    alert(‘Enter the user name’);
    document.resultform.USERNAME.focus();
    return false;
  } else if(document.resultform.APPLNAME.value == “”){
    alert(‘Enter the name of the mobile component’);
    document.resultform.APPLNAME.focus();
    return false;
  } else if(document.resultform.VERSION.value == “”){
    alert(‘Enter the version of the mobile component’);
    document.resultform.VERSION.focus();
    return false;
  } else if(document.resultform.DEPLID.value == “”){
      document.resultform.DEPLID.value = ” “;
  }


        return true;


}


function replaceTags(string){
  if(string != null){
    newString = string.replace(/<|>|\/|
|&|\$|%|!|\?|\;|\||\(|\)|~|\{|\}|\[|\]/g, “”);
  }
  else {
    newString = string;
  }
  return newString;
}


function showSearchHelp(popFor,flg)
{
var winname=”Search”;
var t = (screen.availHeight – 250)/2 ;
var l =(screen.availwidth – 900)/2 ;
var url = “/console/F4.php?f4=”+popFor;


if(popFor==”DEPLID”)
{modifyDeviceValue();}


if(flg==”0″)
{
url = “/console/F4.php?f4=”popFor“&DEP=”+document.resultform.USERNAME.value;
}
var prop =”scrollbars=yes, resizable=no, menubar=no, location=no, status=no, directories=no, toolbar=no,”;
prop = prop +”height=” + 500 + “,width=” + 600 + “,top=” + 0 + “,left=” + 0;
var win = window.open(url, winname, prop );
win.focus();
}     


function trim(string){
               var1=””;
               for(i=0;i<string.length;i++){
                    if(string.charAt(i)!=” “)
                         var1+=string.charAt(i);
               }
               return var1;
          }          
function trimSpaces(obj)          
{
   obj.value = trim(obj.value);
}


function deleteAppForDevice(ddd,dud,dap,dvr)
{
if(confirm(“Delete Entry:”ddd“/”dud“/”dap“/”dvr“?”))
{
     document.location.href=”?DEL=X&DDD=”+ ddd “&DUD=” dud “&DAP=” dap + “&DVR=”+dvr;
}
}


function showCustomerSearch(popFor)
{
var winname=”Search”;
var url = “/console/F4.php?f4=”+popFor;
var prop =”scrollbars=yes, resizable=no, menubar=no, location=no, status=no, directories=no, toolbar=no,”;
prop = prop +”height=” + 500 + “,width=” + 600 + “,top=” + 0 + “,left=” + 0;
var win = window.open(url, winname, prop );
win.focus();
}     


function makeUpperCase(obj){

  document.searchform.USERNAME.value = document.searchform.USERNAME.value.toUpperCase();
     trimSpaces(obj);
}


function popDeviceDetails(deviceID) {
           var url =”F4.php?deviceID=”deviceID“&f4=”+”DEVICE”;
           var prop = “scrollbars=yes, resizable=no, menubar=no, location=no, status=no, directories=no, toolbar=no, “;
                     prop = prop + “height=” + 500 + “,width=” + 600 + “,top=” + 0 + “,left=” + 0;
           var win = window.open(url, deviceID , prop );
           win.focus();
           }


function deleteMCD(mcdName,mcdVersion)
{
if(confirm(“Delete Mobile Component: “mcdName“/”mcdVersion” ?”))
{
     document.location.href=”?MDEL=X&MCDD=”+ mcdName + “&MVRD=”+mcdVersion;
}
}


</textarea>
</p>


Author’s Note


Also refer this blog also..

SAP MI WebConsole simulation using PHP Script – Part 3
</ul>


</p>


To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply