Skip to Content
0
Former Member
Oct 07, 2004 at 01:45 AM

How to reference variable values in a BW Web Template

134 Views

Hi All,

I'm having a problem which I hope someone can help me with.

OVERVIEW

I've developed a BW Web template with (among other things) a TEXTELEMENTS Web Item and a TABLE Web Item. I've enhanced the context menu so that when a user selects a row within the TABLE, they can start a SEM-BPS Web interface (which displays a manual planning layout). I've used the 'How to call a BPS Web Interface with Predefined Selections' document to get the basic mechanism working. The JavaScript function I've written successfully passes the variable (DFCOST_PL) value to the planning layout.

THE PROBLEM

The problem is twofold....

1. I need to pass the value for a variable (FEPCVERS) to the layout. However I do not know how to make reference to the variable in JavaScript. The variable is available within the TEXTELEMENTS_1 object but how do I address it?

2. On a similar vein, I need to pass the value for a field within the table row to the planning layout. The TABLE_2 object contains the fields (DFCOST_PL and DFGROUPS). When the user selects a line the value for DFCOST_PL is available to the JavaScript function (ZAJT_JS_Maintain_Rules) in the 'parameter1' field. However, how do I make the DFGROUPS field available?

Below is the HTML code for my Web Template. Any help would be greatly appreciated.....

<!-- BW data source object tags -->

<object>

<param name="OWNER" value="SAP_BW">

<param name="CMD" value="SET_DATA_PROVIDER">

<param name="NAME" value="DATAPROVIDER_2">

<param name="QUERY" value="ZAJT3_COST_BASE_BY_COST_POOL">

<param name="INFOCUBE" value="Z_FEPC_CB">

DATA_PROVIDER: DATAPROVIDER_2

</object>

<!--BW HTML data source object tags: -->

<object>

<param name="OWNER" value="SAP_BW">

<param name="CMD" value="SET_PROPERTIES">

<param name="TEMPLATE_ID" value="ZAJT_RULES_ENTRY">

<param name="VARIABLE_SCREEN" value="X">

<param name="CMENU_LABEL_1" value="ZAJT Maintain Rules">

<param name="CMENU_FUNCTION_1" value="ZAJT_JS_Maintain_Rules">

<param name="CMENU_PARAMETER_1" value="1">

<param name="CMENU_CELL_TYPE_1" value="CHARACTERISTIC_VALUE">

<param name="CMENU_FILTER_1" value="DFCOST_PL">

<param name="CMENU_VISIBILITY_1" value="X">

<param name="CMENU_POSITION_1" value="TOP">

TEMPLATE PROPERTIES

</object>

<object>

<param name="OWNER" value="SAP_BW">

<param name="CMD" value="SET_DATA_PROVIDER">

<param name="NAME" value="DATAPROVIDER_1">

<param name="QUERY" value="ZAJT3_COST_BASE_BY_PC_NODE">

<param name="INFOCUBE" value="Z_FEPC_CB">

DATA_PROVIDER: DATAPROVIDER_1

</object>

<html>

<head>

<title>BW Web Application</title>

<link href= "/sap/bw/mime/BEx/StyleSheets/BWReports.css" type=text/css rel=stylesheet>

</head>

<!--ZAJT Test code start -->

<SCRIPT language="JavaScript">

function ZAJT_JS_Maintain_Rules(parameter,cell_type,filter,parameter1,parameter2,item,dataprovider,x,y)

{

var url;

var cpool=parameter1;

switch (parameter)

{

case "1":

url="http://dknborisdev.dcb.defence.gov.au:3280/sap/bc/bsp/sap/zbps_var_set/zbps_var_set.htm?area=ZFERULES&bps-appl=ZAJT_RULES3&var1=ZWEBCP&value1_1=" + cpool;

SAPBWOpenWindow(url ,"MaintainRules" ,600,400);

break;

}

}

</SCRIPT>

<!--ZAJT Test code end -->

<body>

<object>

<param name="OWNER" value="SAP_BW">

<param name="CMD" value="GET_ITEM">

<param name="NAME" value="TEXTELEMENTS_1">

<param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_TEXT_ELEMENTS">

<param name="DATA_PROVIDER" value="DATAPROVIDER_1">

<param name="CLOSED" value="X">

<param name="SHOW_COMMON_ELEMENTS" value="">

<param name="SHOW_FILTERS" value="">

<param name="ELEMENT_TYPE_1" value="VARIABLE_K">

<param name="ELEMENT_NAME_1" value="FEPCVERS">

<param name="ELEMENT_TYPE_2" value="VARIABLE_K">

<param name="ELEMENT_NAME_2" value="DF_GRP">

<param name="ELEMENT_TYPE_3" value="VARIABLE_K">

<param name="ELEMENT_NAME_3" value="ZCSTCNTR">

ITEM: TEXTELEMENTS_1

</object>

<object>

<param name="OWNER" value="SAP_BW">

<param name="CMD" value="GET_ITEM">

<param name="NAME" value="NAVIGATIONBLOCK_2">

<param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_NAV_BLOCK">

<param name="DATA_PROVIDER" value="DATAPROVIDER_2">

<param name="CLOSED" value="X">

<param name="TARGET_DATA_PROVIDER_1" value="DATAPROVIDER_1">

<param name="TARGET_DATA_PROVIDER_2" value="DATAPROVIDER_2">

ITEM: NAVIGATIONBLOCK_2

</object>

<object>

<param name="OWNER" value="SAP_BW">

<param name="CMD" value="GET_ITEM">

<param name="NAME" value="PC_HIERARCHY">

<param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_FILTER_HIERDD">

<param name="DATA_PROVIDER" value="DATAPROVIDER_1">

<param name="CLOSED" value="X">

<param name="CAPTION" value="Profit Centre Hierarchy">

<param name="BORDER_STYLE" value="BORDER">

<param name="IOBJNM" value="0PROFIT_CTR">

<param name="HIERARCHY_NAME" value="PROFIT_CTR_ZFEPCBP05">

<param name="TARGET_DATA_PROVIDER_1" value="DATAPROVIDER_2">

<param name="TARGET_DATA_PROVIDER_2" value="DATAPROVIDER_1">

ITEM: PC_HIERARCHY

</object>

<object>

<param name="OWNER" value="SAP_BW">

<param name="CMD" value="GET_ITEM">

<param name="NAME" value="TABLE_1">

<param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_GRID">

<param name="DATA_PROVIDER" value="DATAPROVIDER_1">

<param name="TARGET_DATA_PROVIDER_1" value="DATAPROVIDER_1">

<param name="TARGET_DATA_PROVIDER_2" value="DATAPROVIDER_2">

ITEM: TABLE_1

</object>

<object>

<param name="OWNER" value="SAP_BW">

<param name="CMD" value="GET_ITEM">

<param name="NAME" value="TABLE_2">

<param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_GRID">

<param name="DATA_PROVIDER" value="DATAPROVIDER_2">

ITEM: TABLE_2

</object>

</body>

</html>