on 12-20-2004 2:13 PM
I have written some code(detailed at the bottom) that will change all of the key fields within a report to zero decimal places. This works fine for reports with only one structure but when I try the same thing on a report with two structures the command doesn't appear to do anything.
Is there a reason for this or does my code need modifying in some way to account for the two structures.
Any advise will really be appreciated.
Cheers
Shep.
Java:-
function decimal_zero() {
/* Get the optionnode */
optionnode =document.getElementById('keyfigures').firstChild;
i = 1;
myhtml = '<form name="MyDecimalZero" method="post" action="<SAP_BW_URL>">';
/* While node exist */
while (optionnode!= null) {
/* Check whether correct node type */
if ((optionnode.nodeType == '1') && (optionnode.nodeName == 'OPTION') ) {
kyf = optionnode.getAttribute('value');
if ((kyf!= '!ALL') && (i==1)){
myhtml = myhtml + '<input type="hidden" name="CMD" value="SET_VALUE_PROPERTIES">';
myhtml = myhtml + '<input type="hidden" name="DATA_PROVIDER" value="DP">';
myhtml = myhtml + '<input type="hidden" name="STRUCTURE_MEMBER_1" value="' + kyf + '">';
myhtml = myhtml + '<input type="hidden" name="DECIMAL_PLACES" value="0">';
i += 1;
}
else{
if (kyf!= '!ALL'){
/* For keyfigure fire URL with NO_OUTPUT */
myhtml = myhtml + '<input type="hidden" name="CMD_' + i + '" value="CMD=SET_VALUE_PROPERTIES&DATA_PROVIDER=DP&STRUCTURE_MEMBER_1=' + kyf + '&DECIMAL_PLACES=0">';
i += 1;
}
}
}
optionnode = optionnode.nextSibling;
}
/* Fire URL */
myhtml = myhtml + '</form>';
document.getElementById('Mydecimalzero').innerHTML = myhtml;
}
HTML:-
<P id="keyfigures" style="DISPLAY: none; VISIBILITY: hidden">
<object>
<param name="OWNER" value="SAP_BW"/>
<param name="CMD" value="GET_ITEM"/>
<param name="NAME" value="DROPDOWNBOX_1"/>
<param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_FILTER_DDOWN"/>
<param name="DATA_PROVIDER" value="DP"/>
<param name="GENERATE_CAPTION" value=""/>
<param name="IOBJNM" value="3SLDGCBTYCEGDCXMMWXMHAPGE"/>
<param name="SHOW_LABEL" value=""/>
<param name="ONLY_VALUES" value="X"/>
ITEM: DROPDOWNBOX_1
</object></P>
Realised I'd forgotten the second structure in the command.....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.