Purpose: Using the 'view' command with relative positioning.
NOTE::
The usual 'offset' option does not work with view command, instead we use the 'getCoords' function. Make sure this function is loaded before the call.
Liquid UI Code:----------------------------------------------------------------------------------------------------------------------------------------------
Script File Name:
SAPLCOIH.E0101.sjs // IW32 Initial screen----------------------------------------------------------------------------------------------------------------------------------------------
// User Interface box("F[Order]+[5,0]","F[Order]+[28,120]","Testing View");
pushbutton("F[Order]+[2,0]","View WITH relative positioning","?",{"size":[2,24],"process":viewTest,"using":{"PTYPE":"WITHREL"}});
pushbutton("F[Order]+[2,30]","View W/O relative positioning","?",{"size":[2,24],"process":viewTest,"using":{"PTYPE":"WITHOUTREL"}});
if(z_iw32_scr == "WITHREL"){
//Below relative positioning does not work, instead use the one that is uncommented //view("F[Order]+[6,1]","F[Order]+[27,118]","http://www.guixt.com/"); view(getCoords("F[Order]", [6,1]), getCoords("F[Order]", [27,118]), "
http://www.guixt.com/");
} else if(z_iw32_scr == "WITHOUTREL"){
view([9,2],[30,118],"
http://www.guixt.com/");
}
// Related Functionsfunction viewTest(param){
onscreen "SAPLCOIH.0101"
set("V[z_iw32_scr]",param.PTYPE);
enter('?');
}
function getCoords(field, offset){
return [<field>.pos[0] + offset[0], <field>.pos[1] + offset[1]];
}
See attachments for code samples!