Unable to display a variable which as decimal values in a report
Hi Experts,
I declared a variable with
var1 type p decimals 3.
While I am trying to display it in the report, it is retreiving a jargon value like ########. Can any one help me how to solve this issue in displaying the correct value with decimals.
I tried with var1 type f. but I found the same jargon value.
Thanks
Ravi
Hi Ramesh,
Code is below
output table structure
data : begin of out_table occurs 100 ,
firstname like pa0002-vnamc,
lastname like pa0002-nchmc,
midname like pa0002-midnm,
hire like pa0041-dat01,
prorate type p decimals 3,
prorate type f,
hrrate like pa0008-bet01,
end of out_table.
data : begin of z_proration_table occurs 100 ,
begda like pa0000-begda,
endda like pa0000-endda,
prorate type p DECIMALS 3,
prorate type f,
end of z_proration_table.
data var1(10) type c.
loop declared
loop at z_proration_table.
if ( z_proration_table-begda+0(4) = '2007'
and z_proration_table-begda4(2) = '12' and dat14(2) = '12' )
concatenate '2007' dat1+4(4) into dat2.
else.
concatenate '2008' dat1+4(4) into dat2.
endif.
if ( z_proration_table-begda <= dat2
and
z_proration_table-endda >= dat2 ).
out_table-prorate = z_proration_table-prorate.
var1 = z_proration_table-prorate.
endif.
endloop.
out_table-prorate = var1. -
this is the desired line
select single bet01 into out_table-hrrate
from pa0008
where pernr = z_all_employees-pernr
and endda = '99991231'.
out_table-hire = dat1.
out_table-firstname = z_all_employees-firstname.
out_table-lastname = z_all_employees-lastname.
out_table-midname = z_all_employees-midname.
write out_table. -
displaying in the report
append out_table.
clear out_table.
clear dat2.
endloop.
Thanks
Ravi
Similar Messages
-
Getting wrong values for decimal value in Bex report
Hi,
I am getting some problem in Bexreport decimal values.
In ODS i am able to look the values for this key figure
(Total PO Release Val)= 140.692,00,the same value in Bex report looks like this $ 140,692.00.
Here one calculation is going with these above values
% Used = 'Total PO Release Val' / 'Target Value' * 100
as per ODS value calculation it is correct = 140.692/1000 * 100 =14.692
as per Bex it is coming like this = 140,692.00/1000 *100 = 142.692.
in Bex report Percentage valus is not considering value is taking as 140,692.00 rather than 140.692.I mean to say decemal values are ignoring while calculation in Bexreport.can you any please advice me how to comeout of this problem.Appreciate your help.
Regards
Ramesh<i> "(Total PO Release Val)= 140.692,00,the same value in Bex report looks like this $ 140,692.00."
</i>
How do you check the ODS value? The amount will only have two decimal places after it, so you can't have a value like 140.692,00. It seems to be an issue of user's decimal notation (where decimal is represented by comma, and thousand seperator by '.'). Go to user profile, change this setting (in default tab) to correct one (ie decimal being represented by '.') and login again and check it. The value that you see in ODS is 'one hundred forty thousand six hundred ninety two, the same that you get in Bex, only the representation is different). -
Unable to display a variable value in xml through xsl using coldfusion
Hi ColdFusion Heroes ,
Is their any one to help me in this issue . I am new to cold
fusion , XML and XSL .
Detail Explaination :
develoment_files.cfm is a .cfm page , which includes an xml
page .
development_files_dropdown.xsl is a xsl page .
develoment_files.cfm : Code is as follows .
<CFDIRECTORY ACTION="LIST" DIRECTORY="#somepath#"
NAME="DirContents" FILTER="p*">
<CFQUERY DBTYPE="query" NAME="Files">
SELECT *
FROM DirContents
WHERE Type = 'File'
</CFQUERY>
<CFOUTPUT><?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet type="text/xsl"
href="../XSL/development_files_dropdown.xsl"?>
<Test xmlns:xsi='
http://www.w3.org/2001/XMLSchema-instance'>
<CFLOOP QUERY="Files">
<Directory>
<DisplayName>#Name#</DisplayName>
<FullPath>#Name#</FullPath>
</Directory>
</cfloop>
</Test></CFOUTPUT>
This file generates a query resulting files starting with p*
and then it should be a file and manipulates in xml.
development_files_dropdown.xsl pages is as follows.
<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes"/>
<xsl:preserve-space elements="*"/>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="Test">
<B>Script Name: </B>
<select name="T1_Dev_Script" CLASS="DevInput">
<xsl:for-each select="Directory">
<option>
<xsl:attribute name="value">
<xsl:value-of select="FullPath/text()"/>
</xsl:attribute>
<xsl:value-of select="DisplayName/text()"/>
</option>
</xsl:for-each>
</select>
</xsl:template>
</xsl:stylesheet>
This is only for the purpose of display .
Now i want to get one particular file named "pfile" { Code is
written in development_files.cfm page and kept it in a variable } I
want to display it in #Name# filed. how can i do that ? I am
getting XML Parsing error from javascript .
Could any one look into this .
Thanks & Regards,
Nataraj GThe first part is right -
1) drag a text element onto the page, at a location in which you want the variable value to be displayed
2) On the left hand bottom page - go to the web item properties for the text element
3) scroll down to the specific properties for the item - in that uncheck the first two check boxes - display general text elements & display static filter values
4) in the next item in the properties (List of text elements) click once on the box where List is written and then clcik on the small browse button that appears.
5) in the window that opens, in the element type field, select variable/variable value as key (as per your requirement) and then under the element ID field type in the technical name of your variable that you want to display.
click ok and save your template and try executing it.
See if this solves your problem.
regards,
Nikhil -
Passing variable which has multiple values to cursor as parameter
declare
i varchar2(4000):='0';
j varchar2(100):='0';
cursor c1
is
(select * from gl_je_lines
where period_name='Mar-10'
and reference_10='WRITEOFF');
cursor c2 (l_ref varchar2)
is
(select * from gl_je_lines
where period_name='Mar-10'
and reference_10='WRITEOFF'
and reference_2 not in (l_ref));
begin
for cur_record in c1
loop
j:=cur_record.reference_2;
end loop;
i:= i||','''||j||'''';
dbms_output.put_line(i);--here i has 254 values separated by ','
for cash_rec in c2(i)
loop
dbms_output.put_line('this is loop 2');
dbms_output.put_line(cash_rec.reference_2||','||cash_rec.reference_1);--Here this output is not displayed
--i think the code in this cursor c2 is not executing
--please tell me the solution
end loop;
end;
I already use pl-sql table with array..it is not sufficietn to my requirement.because when i use it we must increment the index of that table ..so every time not in operator works in cursor2.so it shows wrong result
From last three days i am working on this only please let me know as early as possible friends
Edited by: 805567 on Oct 28, 2010 11:30 PM
Edited by: 805567 on Oct 29, 2010 1:05 AMyou said two cases
in first case
place my second cursor in first cursor
if i place like that here i use not in operator
so it prints for every value it will print not in of that value
so it was wrong result
i want not in all values
in second case
i took values from cursor not from table
like as shown below
declare
credit_amount number:=0;
debit_amount number:=0;
v1 number:=0;
v2 number:=0;
v3 varchar2(500);
v4 varchar2(500);
v5 varchar2(240);
v6 varchar2(240);
v7 number;
v8 varchar2(240);
v9 varchar2(240);
v10 number;
v11 number;
v12 varchar2(240);
v13 varchar2(240);
v14 varchar2(240);
v15 number;
v16 number;
--This cursor is for liability records which are in GL not in AP
cursor c1(p_header_id number,p_reference_2 varchar2,p_reference_4 varchar2)
is
(select
jl.je_header_id "JE_HEADER_ID"
,jl.period_name "PERIOD"
,glcc.concatenated_segments "ACCOUNT_CODE"
,DECODE(jl.accounted_dr,null,0,jl.accounted_dr)"ACCOUNTED_DEBIT"
,DECODE(jl.accounted_cr,null,0,jl.accounted_cr) "ACCOUNTED_CREDIT"
,DECODE(jl.accounted_dr,null,0,jl.accounted_dr) - DECODE(jl.accounted_cr,null,0,jl.accounted_cr) "NET"
,glcc.CODE_COMBINATION_ID "CODE_COMBINATION_ID"
,jl.SET_OF_BOOKS_ID "SET_OF_BOOKS_ID"
,jl.PERIOD_NAME "PERIOD_NAME"
,DECODE(Jl.entered_dr,null,0,Jl.entered_dr)"ENTERED_DEBIT"
,DECODE(Jl.entered_cr,null,0,Jl.entered_cr) "ENTERED_CREDIT"
,jl.reference_1 "SUPPLIER"
,jl.reference_2 "INVOICE_ID"
,jl.reference_3 "CHECK_ID"
,jl.reference_4 "CHECK_NUMBER"
,jl.reference_5 "INVOICE_NUM"
,jl.reference_6 "'AP_PAYMT_JUST_INSERTED'"
,jl.reference_7 "set_of_books_id"
,jl.GL_SL_LINK_ID "GL_SL_LINK_ID"
,jl.REFERENCE_8 "INVOICE_DIST_LINE_NUMBER"
,jl.reference_9 "INVOICE_PAYMENT_ID"
,jl.REFERENCE_10 "LIABILITY"
,jl.TAX_CODE_ID "TAX_CODE_ID"
,jl.TAX_GROUP_ID "TAX_GROUP_ID"
FROM
gl_je_lines jl
, apps.gl_code_combinations_KFV glcc
, gl_je_headers jh
WHERE
jl.period_name='Mar-10'
and glcc. code_combination_id in (1016,1296,1298)
and jh.je_header_id = jl.je_header_id
AND glcc.code_combination_id = jl.code_combination_id
and jh.je_source = 'Payables'
AND jl.je_header_id = p_header_id
and jl.reference_2 = p_reference_2
and jl.reference_4 = p_reference_4
MINUS
select
ir.je_header_id
, h.period_name "APPERIOD"
,g.CONCATENATED_SEGMENTS "AP ACCOUNT CODE"
,DECODE(l.accounted_dr,null,0,l.accounted_dr) "AP ACCOUNTED_DR"
,DECODE(l.accounted_cr,null,0,l.accounted_cr) "AP ACCOUNTED_CR"
,DECODE(l.accounted_dr,null,0,l.accounted_dr) - DECODE(l.accounted_cr,null,0,l.accounted_cr) "NET"
,l.CODE_COMBINATION_ID "AP_CCID"
,h.set_of_books_id
,h.PERIOD_NAME "PERIOD_NAME"
,DECODE(l.entered_dr,null,0,l.entered_dr)"ENTERED_DEBIT"
,DECODE(l.entered_cr,null,0,l.entered_cr) "ENTERED_CREDIT"
,l.reference1 "SUPPLIER"
,l.reference2 "INVOICE_Id"
,l.reference3 "reference_3"
,l.reference4 "reference_4"
,l.reference5 "INVOICE_NUM"
,l.reference6 "reference_6"
,l.reference7 "reference_7"
,l.GL_SL_LINK_ID "GL_SL_LINK_ID"
,l.REFERENCE8 "REFERENCE_8"
,l.reference9 "reference_9"
,l.REFERENCE10 "REFERENCE_10"
,l.TAX_CODE_ID "TAX_CODE_ID"
,l.TAX_LINK_ID "TAX_LINK_ID"
from
ap_ae_lines_all l,
ap_ae_headers_all h,
gl_code_combinations_kfv g
,gl_import_references ir
where
ir.gl_sl_link_id=l.gl_sl_link_id
AND g.CODE_COMBINATION_ID = l.CODE_COMBINATION_ID
and h.ae_header_id = l.ae_header_id
AND h.period_name ='Mar-10'
AND g.CODE_COMBINATION_ID in (1016,1296,1298)
AND ir.JE_HEADER_ID = p_header_id
and l.reference2 = p_reference_2
and l.reference4 = p_reference_4);
--This cursor is for writeoff records
cursor c2
is
(select * from gl_je_lines
where period_name='Mar-10'
and reference_10='WRITEOFF'
and reference_2 in ('525706','525600'));
credit number:=0;
debit number:=0;
j varchar2(240);
i varchar2(4000):='0';
cursor c3 (p_invoice_id varchar2)
is
(select
jl.je_header_id "JE_HEADER_ID"
,jl.period_name "PERIOD"
,glcc.concatenated_segments "ACCOUNT_CODE"
,DECODE(jl.accounted_dr,null,0,jl.accounted_dr)"ACCOUNTED_DEBIT"
,DECODE(jl.accounted_cr,null,0,jl.accounted_cr) "ACCOUNTED_CREDIT"
,DECODE(jl.accounted_dr,null,0,jl.accounted_dr) - DECODE(jl.accounted_cr,null,0,jl.accounted_cr) "NET"
,glcc.CODE_COMBINATION_ID "CODE_COMBINATION_ID"
,jl.SET_OF_BOOKS_ID "SET_OF_BOOKS_ID"
,jl.PERIOD_NAME "PERIOD_NAME"
,DECODE(Jl.entered_dr,null,0,Jl.entered_dr)"ENTERED_DEBIT"
,DECODE(Jl.entered_cr,null,0,Jl.entered_cr) "ENTERED_CREDIT"
,jl.reference_1 "SUPPLIER"
,jl.reference_2 "INVOICE_ID"
,jl.reference_3 "CHECK_ID"
,jl.reference_4 "CHECK_NUMBER"
,jl.reference_5 "INVOICE_NUM"
,jl.reference_6 "'AP_PAYMT_JUST_INSERTED'"
,jl.reference_7 "set_of_books_id"
,jl.GL_SL_LINK_ID "GL_SL_LINK_ID"
,jl.REFERENCE_8 "INVOICE_DIST_LINE_NUMBER"
,jl.reference_9 "INVOICE_PAYMENT_ID"
,jl.REFERENCE_10 "LIABILITY"
,jl.TAX_CODE_ID "TAX_CODE_ID"
,jl.TAX_GROUP_ID "TAX_GROUP_ID"
FROM
gl_je_lines jl
, apps.gl_code_combinations_KFV glcc
, gl_je_headers jh
WHERE
jl.period_name='Mar-10'
and glcc. code_combination_id in (1016,1296,1298)
and jh.je_header_id = jl.je_header_id
AND glcc.code_combination_id = jl.code_combination_id
and jh.je_source = 'Payables'
and jl.reference_2 in (p_invoice_id)
MINUS
select
ir.je_header_id
, h.period_name "AP PERIOD"
,g.CONCATENATED_SEGMENTS "AP ACCOUNT CODE"
,DECODE(l.accounted_dr,null,0,l.accounted_dr) "AP ACCOUNTED_DR"
,DECODE(l.accounted_cr,null,0,l.accounted_cr) "AP ACCOUNTED_CR"
,DECODE(l.accounted_dr,null,0,l.accounted_dr) - DECODE(l.accounted_cr,null,0,l.accounted_cr) "NET"
,l.CODE_COMBINATION_ID "AP_CCID"
,h.set_of_books_id
,h.PERIOD_NAME "PERIOD_NAME"
,DECODE(l.entered_dr,null,0,l.entered_dr)"ENTERED_DEBIT"
,DECODE(l.entered_cr,null,0,l.entered_cr) "ENTERED_CREDIT"
,l.reference1 "SUPPLIER"
,l.reference2 "INVOICE_Id"
,l.reference3 "reference_3"
,l.reference4 "reference_4"
,l.reference5 "INVOICE_NUM"
,l.reference6 "reference_6"
,l.reference7 "reference_7"
,l.GL_SL_LINK_ID "GL_SL_LINK_ID"
,l.REFERENCE8 "REFERENCE_8"
,l.reference9 "reference_9"
,l.REFERENCE10 "REFERENCE_10"
,l.TAX_CODE_ID "TAX_CODE_ID"
,l.TAX_LINK_ID "TAX_LINK_ID"
from
ap_ae_lines_all l,
ap_ae_headers_all h,
gl_code_combinations_kfv g
,gl_import_references ir
where
ir.gl_sl_link_id=l.gl_sl_link_id
AND g.CODE_COMBINATION_ID = l.CODE_COMBINATION_ID
and h.ae_header_id = l.ae_header_id
AND h.period_name ='Mar-10'
AND g.CODE_COMBINATION_ID in (1016,1296,1298)
and l.reference2 in (p_invoice_id)); --here if i put l.reference2 in (p_invoice_id)) it must show the details of
-- of all.but it doesnot display sir
--here if i put l.reference2 not in (p_invoice_id)) it shows that id also sir
BEGIN
for writeoff_rec in c2
LOOP
FOR Main_cur in c1(writeoff_rec.je_header_id,writeoff_rec.reference_2,writeoff_rec.reference_4)
LOOP
j:='0';
IF writeoff_rec.accounted_dr is not null AND Main_cur.ACCOUNTED_CREDIT<>0
THEN
v10:=Main_cur.ACCOUNTED_CREDIT;
credit_amount:= credit_amount+Main_cur.ACCOUNTED_CREDIT;
ELSIF writeoff_rec.accounted_cr is not null AND Main_cur.ACCOUNTED_DEBIT<>0
THEN
v11:=Main_cur.ACCOUNTED_DEBIT;
debit_amount:= debit_amount+Main_cur.ACCOUNTED_DEBIT;
END IF;
if c1%found then
j:=Main_cur.INVOICE_ID;
end if;
END LOOP;
-- i:=i||','||j;
i:= i||','''||j||'''';
END LOOP;
dbms_output.put_line(i); --Here i got all invoiceids of varchar2 records without single qutations
--its look like '0','23232','2324234' etc.
for cash_clearing_cur in c3(i)--here is the problem i am sending i with 250 values separated by ',' is it correct
loop
v3:=0;
v4:=0;
v5:=0;
v6:=0;
v7:=0;
v8:=0;
v9:=0;
v10:=0;
v11:=0;
v12:=0;
v13:=0;
v14:=0;
v15:=0;
v16:=0;
credit:=credit+cash_clearing_cur.ACCOUNTED_CREDIT;
debit:=debit+cash_clearing_cur.ACCOUNTED_DEBIT;
v3:=cash_clearing_cur.JE_HEADER_ID;
v4:=cash_clearing_cur.INVOICE_ID;
v5:=cash_clearing_cur.CHECK_NUMBER;
v6:=cash_clearing_cur.LIABILITY;
v7:=cash_clearing_cur.CODE_COMBINATION_ID;
v8:=cash_clearing_cur.PERIOD;
v9:=cash_clearing_cur.ACCOUNT_CODE;
v10:=cash_clearing_cur.ACCOUNTED_CREDIT;
v11:=cash_clearing_cur.ACCOUNTED_DEBIT;
v12:=cash_clearing_cur.SUPPLIER;
v13:=cash_clearing_cur.CHECK_ID;
v14:=cash_clearing_cur.INVOICE_NUM;
v15:=cash_clearing_cur.GL_SL_LINK_ID;
v16:=cash_clearing_cur.SET_OF_BOOKS_ID;
DBMS_OUTPUT.PUT_LINE('HEAd '||v3||','||'inv_id '||v4||','||
'chk_num '||v5||','||'ref10 '||v6||','||'CCID '||V7||','||'PED '||V8
||','||'acctcode '||v9||','||'acct_Ct '||V10
||','||'acct_Dt '||v11||','||'chk_id '||v13||','||'inv_num '||V14
||','||'link '||v15||','||'sob '||v16||','||'suplir '||V12);
end loop;
DBMS_OUTPUT.PUT_LINE( 'Dr Amt ' ||debit || 'Cr amt ' || credit );
EXCEPTION
when too_many_rows then
dbms_output.put_line('Invalid no of rows');
when no_data_found then
dbms_output.put_line('no data found exception');
when others then
dbms_output.put_line('Other than Invalid no of rows');
dbms_output.put_line(SQLERRM);
END;
/ -
Displaying the quantity field in decimal values
hi
I have created a web dynpro application,and I am calling BAPI functional module from that webdynpro application.
Now the output is being displayed in the second view by giving the input from the first view.
Now my problem is that the quantity value is being displayed as "5" and whereas It should be "5.00".
Is there any setting to be done from the properties end of that particular table.
Please suggest me in this issue.
thanks and regards
krisHi Gopi,
The property in question is "calculated". This is a property of a context value attribute. So select the value attribute in the context to which your field is bound and view the properties. Set "calculated=true". It will generate the accessors.
In the setter method, add the following piece of code:
public void set<your attribute name>(IPrivate<your component>View.IContextElement element, java.lang.String value)
DecimalFormat df = new DecimalFormat("#.00");
value = df.format(value).toString();
Regards,
Satyajit
Message was edited by: Satyajit Chakraborty
Message was edited by: Satyajit Chakraborty -
Multiple value variable - not showing Multiple values in the report
Hi,
I have careated a Multiple value variable for one of the characteristics in my Query. however, When i run the Query and select multiple values for the same, the report displays values for only the first selection.
Could you help me resolve this ?
Rgds
ShwetaHello Shweta,
Are you running the report in the Analyzer excel or Web?
May be you can check the following:
1. Use the latest FEP. It is working for me.
2. May be the other values that you selected do not have corresponding keyfigures values. Hence it is showing only the first one.
Try selecting other values ( except first one selected this time )
Regards,
Sheik Bilal -
Issue with Decimal Values in Bex Reporting
hello gurus,
I have extracted data from 2LIS_13_VDITM. In the ODS when I look at the Active data, column Billing Qty Sls Units - it shows "13,190 " and the Sales Unit is "KM".
ITEM SALES UNIT Billing Qty :Sales Unit
10 KM 13,190
20 KM 0,500
In R3 table VBRK also it stores in the above format.
But while reporting it rounds of the data as 13,000 and 1,000.
How can i get the actuals, in reporting also.
Pls advise. thanks in advance.Hi Eugene -Scaling it to 1 did not help.
Hi Roberto -> I had a look at the entries in T006 for KM (kilometers)and M(meters). this is what i got.
[Int. meas. unit] [Decimal.pl.rnd.] [Decimal places]
KM | 0 | 0
M | 2 | 0
And in SPRO in Src System and BW Sytem there is no mention of KM and meters.
Message was edited by: bw
Message was edited by: bw
Message was edited by: bw -
How to creat test variable for required year value.
Hi All,
I have one report in that report description i want to display year value(zvar_year).
Ex : report description like "&zvar_year& report" in runtime it can show "2011 report".
when i run this report from feb to dec i have to show current year value, when i run this report on jan it have to show previous year value
For this i used diff type of test variable as fallowed bellow
1) test variable using replacement path with info object :
variable type:test
char:zyear
process type:replacement path
replacement variable with:infoobject
replace with :key
(or)
iam trying bellow variable method but iam unable to see in variable list its charectaristic value variable
variable type:test
char:zyear
process type:replacement path
replacement variable with:variable "this is customer exit variable built on zyear unable to see in variable list
replace with :key
2)test variable using customer exit:
variable type:test
process type:customer exit
*Problem:* when i used &zvar_year& in the description its showing "&zvar_year&" only not "2011" value.
please let me know how to get the values into test variable
Thanks in advance
Edited by: RJANAR on May 18, 2011 7:17 AM
Edited by: RJANAR on May 18, 2011 7:23 AMHi,
For that you need to modify your customer exit as shown below
Data : zyear(4), zmonth(2).
zmonth = sy-datum+4(2).
if zmonth = '01'
zyear = sy-datum(4).
Zyear = Zyear -1.
elseif
zyear = sy-datum(4).
endif.
CLEAR L_S_RANGE.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
L_S_RANGE-LOW = zyear.
APPEND L_S_RANGE TO E_T_RANGE
Hope this helps you. Thanks.
Regards,
Raj -
Sql server max function for decimal value
dear team
i have column which contains decimal value eg,
QuestionMasterId Studentid Score
19 1 9.01,
19 2 9.02,
19 3 9.35,
19 4 8.04,
i have to display the max score - that student score but when i am using the following query it is returning the int value
DECLARE @MAX decimal
SELECT @MAX=max(Score) from [QuestionPaperwiseScore] where QuestionMasterId=19
print @MAX
select Studentid,Score,@MAX-Score as diff from [QuestionPaperwiseScore] where QuestionMasterId=19
kindly helpTake a look at
BOL again. The default scale is 0. Thus it behaves like an INT.
DECLARE @Sample TABLE
QuestionMasterId INT ,
Studentid INT ,
Score DECIMAL(3, 2)
INSERT INTO @Sample
VALUES ( 19, 1, 9.01 ),
( 19, 2, 9.02 ),
( 19, 3, 9.35 ),
( 19, 4, 8.04 );
DECLARE @MAX DECIMAL(3,2);
SELECT @MAX = MAX(Score)
FROM @Sample
WHERE QuestionMasterId = 19
SELECT @MAX;
SELECT Studentid ,
Score ,
@MAX - Score AS diff
FROM @Sample
WHERE QuestionMasterId = 19 -
Situation:
SSIS Package designed in SQL Server 2012 - SQL Server Data Tools
Windows 7 - 64 bit.
The package (32 bit) extracts data from a SQL Server db to an Excel Output file, via an OLE DB connection.
It uses 3 package variables:
*) SQLCommand (String) to specify the SQL Statement to be executed by the package
Property path: \Package.Variables[User::ExcelOutputFile].Properties[Value]
Value: f:\Output Data.xls
*) EXCELOutputFIle (String) to specify path and filename of the Excel output file
Property path: \Package.Variables[User::SQLCommand].Properties[Value]
Value: select * from CartOrder
*) VarObjectDataSet (Object) to hold the data returned by SQL Server)
Property path: \Package.Variables[User::VarObjectDataSet].Properties[Value]
Value: System.Object
It consists out of 2 components:
*) Execute SQL Task: executes the SQL Statement passed on via a package variable. The resultng rows are stored in the package variable VarObjectDataSet
*) Script Task: creates the physical output file and iterates VarObjectDataSet to populate the Excel file.
Outcome and issue:The package runs perfectly fine both in SQL Server Data Tools itself and in DTEXECUI.
However, whenever I run it via SQL Server Agent (with 32 bit runtime option set), it returns the errror message below.
This package contains 3 package variables but the error stating that a package variable can not be set, pops up for the VarObjectDataSet only. This makes me wonder if it is uberhaupt possible to set the value of a package variable
of type Object.
Can anybody help me on this please ?
Message
Executed as user: NT Service\SQLSERVERAGENT. Microsoft (R) SQL Server Execute Package Utility Version 11.0.2100.60 for 32-bit Copyright (C) Microsoft Corporation. All rights reserved. Started: 6:40:20 PM DTExec: Could
not set \Package.Variables[User::VarObjectDataSet].Properties[Value] value to System.Object. Started: 6:40:20 PM Finished: 6:40:21 PM Elapsed: 0.281 seconds. The package execution failed. The step failed.
Thank you very much in advance
JurgenHi Visakh,
thank you for your reply.
So, judging by your reply, not all package variables used inside a package need to be set a value for when run in DTEXEC ?
I already tried that but my package ended up in error (something to do with "... invocation ...." and that error is anything but clearly documented. Judging by the error message itself, it looks like it could be just about anything. that is why I asked my
first question about the object type package variable.
Now, I will remove it from the 'set values' list and try another go cracking the unclear error-message " ... invocation ...". Does an error message about " ... invocation ..." ring any bells, now that we are talking about it here ?
Thx in advance
Jurgen
Yes exactly
You need to set values only forthem which needs to be controlled from outside the package
Any variable which gets its value through expression set inside package or through a query inside execute sql task/script task can be ignored from DTExec
Ok I've seen the invocation error mostly inside script task. This may be because some error inside script written in script task. If it appeared after you removed the variable then it may because some reference of variable existing within script task.
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
Decimal Values getting truncated
Hi,
In my query results, the decimal values are getting truncated. e.g.
0.30 + 0.44 = 0.70 (expected result = 0.74)
0.30 + 0.45 = 0.80 (expected result = 0.75)
0.40 + 0.48 = 0.80 (expected result = 0.78)
What am I supposed to do to make sure that the second decimal point is not truncted.
Thanks,Hi,
I do not have any conditions. Except that I am just using the function NODIM to get the decimal values in my report.
I did tried using the decimal places in the Key Figure properties.
Are there any other possibilities to solve this?
Thanks, -
Unable to create the Variable icon which shows Less than or equal to
Hi Experts,
when we create a variable normally will get a icon of the variable which say equal to symbol on the varaible icon. Hope everybody know that.
Now how can we change that variable icon to less than or equal.
Please can you provide me that information.
Thanks alot !hi,
when you are trying to restrict the char select range values instead of variable.
then select the operator type (less than, greate than etc) and in place of value select variable and then give the variable name.
regards,
Arvind.
Edited by: Arvind Tekra on Jun 15, 2011 4:57 PM -
Unable to see the variable in Query Designer
Hello Experts,
I am running one report and it is showing me 0calday variable selection screen at run time. I am unable to see this Variable on my Query designer but when I am opening query properties its showing me in this.
Kindly let me know where is this Variable using in my query designer ?
Thanks,
AnoopHi Anoop,
The variable is probably being used to restrict a key figure.
Go to the key figures,
Display the technical names
Check the key figures for which the technical name is not appearing even though the key figure is not a formula.
Here you will see one of the key figure being restricted by a variable for 0calday
Hope this helps.
Regards,
Joe
Didnt notice the question is answered :P
Edited by: lazarus_joey on Feb 17, 2012 6:48 PM -
JavaMapping in PI 7.1 Error:Unable to display tree view; Error when parsing
hi,
i get by testing in PI 7.1 (operation mapping) this ERROR:
"Unable to display tree view; Error when parsing an XML document (Content is not allowed in prolog.)"
this is my java-programm-code:
import java.io.FileInputStream;
import java.io.FileOutputStream;
import com.sap.aii.mapping.api.StreamTransformation;
import java.io.*;
import java.util.Map;
import javax.xml.parsers.*;
import org.xml.sax.*;
import org.xml.sax.helpers.*;
/*IMPORT statement imports the specified classes and its methods into the program */
/Every Java mapping program must implement the interface StreamTransformation and its methods execute() and setParameter() and extend the class DefaultHandler./
public class Mapping extends DefaultHandler implements StreamTransformation {
Below is the declaration for all the variables we are going to use in the
subsequent methods.
private Map map;
private OutputStream out;
private boolean input1 = false;
private boolean input2 = false;
private int number1;
private int number2;
private int addvalue;
private int mulvalue;
private int subvalue;
String lineEnd = System.getProperty("line.separator");
setParamater() method is used to store the mapping object in the variable
"map"
public void setParameter(Map param) {
map = param;
public void execute(InputStream in, OutputStream out)
throws com.sap.aii.mapping.api.StreamTransformationException {
DefaultHandler handler = this;
SAXParserFactory factory = SAXParserFactory.newInstance();
try {
SAXParser saxParser = factory.newSAXParser();
this.out = out;
saxParser.parse(in, handler);
} catch (Throwable t) {
t.printStackTrace();
As seen above execute() method has two parameters "in" of type
InputStream and "out" of type OutputStream. First we get a new instance
of SAXParserFactory and from this one we create a new Instance of
SAXParser. To the Parse Method of SaxParser, we pass two parameters,
inputstream "in" and the class variable "handler".
Method "write" is a user defined method, which is used to write the
string "s" to the outpurstream "out".
private void write(String s) throws SAXException {
try {
out.write(s.getBytes());
out.flush();
} catch (IOException e) {
throw new SAXException("I/O error", e);
public void startDocument() throws SAXException {
write("");
write(lineEnd);
write("");
write(lineEnd);
public void endDocument() throws SAXException {
write("");
try {
out.flush();
} catch (IOException e) {
throw new SAXException("I/O error", e);
public void startElement(String namespaceURI, String sName, String qName,
Attributes attrs) throws SAXException {
String eName = sName;
if ("".equals(eName))
eName = qName;
if (eName.equals("NUMBER1"))
input1 = true;
if (eName.equals("NUMBER2"))
input2 = true;
public void endElement(String namespaceURI, String sName, String qName)
throws SAXException {
String eName = sName;
if ("".equals(eName))
eName = qName;
if (eName.equals("NUMBER1"))
input1 = false;
if (eName.equals("NUMBER2"))
input2 = false;
public void characters(char[] chars, int startIndex, int endIndex)
throws SAXException {
String dataString = new String(chars, startIndex, endIndex).trim();
if (input1) {
try {
number1 = Integer.parseInt(dataString);
} catch (NumberFormatException nfe) {
if (input2) {
number2 = Integer.parseInt(dataString);
if (input2 == true) {
addvalue = number1 + number2;
mulvalue = number1 * number2;
subvalue = number1 - number2;
write("" + addvalue + "");
write(lineEnd);
write("" + mulvalue + "");
write(lineEnd);
write("" + subvalue + "");
write(lineEnd);
in developer studio 7.1 i dont get error.
this happens by testing the mapping-programm in ESR.
can somebody help me please?Make sure that the xml created out after the java mapping is a valid xml with only one root node.
Regards,
Prateek -
Watching videos at nbcnews.com, some days get message: Unable to display this video. The ads always display, but not the stories. And only some days. Why?
You're right that when the apps are available they work better than Safari. I can't find one for The Last Word, which is my favorite show. And like I said, the problem seems to be intermittent, so I don't believe that its a Flash issue. Actually, it's been a couple of days now since I could view The Last Word, so perhaps they are doing something different with their coding than before.
Thanks for your suggestions... They are helpful. :-)
Maybe you are looking for
-
HI i have read http://www.adobe.com/devnet/flex/articles/coldfusionflex_part1_02.html problem is that this sample is using flex data service 2.0 and i am using lcds2.5.1 as well as cold fusion 8 . I am not aware with both the thing i am a very new in
-
IPhone 2.0 Bluetooth with RSAP for VW car kit ?
Does anyone knows if this new iphone comes with RSAP in bluetooth that allows you to connect with VW PASSAT and others that only support RSAP protocol ? Also is there any way to get iPhone to download photos from a Canon 20D ? I can get my ipod video
-
Data format in pivot table calculated item
Hi All, I've got a pivot table with a dimension on rows and a dimension on columns and a measure. I have a "new calculated item" based on the dimension on the columns which does the following: ( ($2-$1) / ($1) ) *100 I want this calculated item shown
-
Hi experts, Can a dropdown be displayed in a select option. eg: att type: awart- low awart-high Can this awart-low and awart-high have a dropdown to select data instead of a search help. Because when I tried to create a select option and added w
-
I just got the Z10 phone, and I really really love it. One thing I hate about it though, is the lack of map data for Denmark. The maps app is useless here in Denmark. So when do you guys roll out an update to get full map in the app? There isn't even