Crystal Reports - Global Variables
hi,
I want to know if we can define and use Global Variables in Crystal Reports ?
-Priyanka
'global' applies only within the report boundary. If you need to share values across main report / subreport boundaries, you need to declare the variable as 'shared'.
It you provide more context it would be easier to provide more specific help.
Similar Messages
-
Hi everyone
I want to calculate the balance quantity from the purchase order
According to receiving document and display it in the report , is there global variable in the report this my script
function CF_BALANCEFormula return Number is
LOC_RECE NUMBER(12,3);
LOC_BALANCE NUMBER(12,3);
LOC_PO_CODE VARCHAR2(30);
BEGIN
SELECT NVL(ITEM_QUANTITY,0)
INTO LOC_RECE FROM IM_GOODS_RECIEVE_DETAILS B
WHERE B.PO_CODE = :PO_CODE
AND ITEM_CODE = :ITEM_CODE
AND B.DOC_CODE = :DOC_CODE
AND LINE_NO = :LINE_NO;
BEGIN
SRW.MESSAGE(2001,'LOC_PO_CODE'||LOC_PO_CODE);
IF LOC_PO_CODE = :PO_CODE THEN
srw.message(2001,'LOC_RECE'||LOC_RECE);
:CP_HOLD:=(NVL(LOC_RECE,0)+ NVL(:CP_HOLD,0));
srw.message(2001,'CP_HOLD'||:CP_HOLD);
LOC_BALANCE := (NVL(:CF_ORDER,0) - (:CP_HOLD)) ;
:CP_BALANCE := LOC_BALANCE;
srw.message(2001,'CP_BALANCE'||:CP_BALANCE);
ELSE
:CP_HOLD := 0;
LOC_PO_CODE := :PO_CODE;
SRW.MESSAGE(2001,'LOC_PO_CODE'||LOC_PO_CODE);
srw.message(2001,'2 - LOC_RECE'||LOC_RECE);
:CP_HOLD:=(NVL(LOC_RECE,0)+ NVL(:CP_HOLD,0));
srw.message(2001,'2 -CP_HOLD'||:CP_HOLD);
LOC_BALANCE := (NVL(:CF_ORDER,0) - (:CP_HOLD)) ;
:CP_BALANCE := LOC_BALANCE;
srw.message(2001,'2 -CP_BALANCE'||:CP_BALANCE);
END IF;
END;
RETURN(LOC_RECE);
exception
when no_data_found then
return('');
when others then
srw.message(2001,'CF_BALANCE'||sqlerrm);
return('');
END;
Waiting for your valuable answer
Best regards
Jamil alshaibaniThank you everyone
I already got the answer
Thank very much
Jamil -
BW Query variable default value put in Crystal report variable question
Why BW Query variable default value put in Crystal report variable for BO InfoView to open crystal report.
I using Analyzer to open bw query,variables had default value ,but crystal report can't had variable default value ,and can't search variable value.
pho:
[http://file.itpub.net/f/e38876ad4f6efb7e73980488e7d71f8d/4ae940e9/day_091029/20091029_2b04da1232144feba180OrB23SNvXtoT.gif/p/1.gif]
[http://file.itpub.net/f/d93ddfe61e0eaf80429726c61f1a02ff/4ae940e9/day_091029/20091029_3211ffe04bf0302fbab5FRKnbwmH80p7.gif/p/BW_QUERY_Crystal.gif]
Edited by: flying on Oct 29, 2009 8:20 AMI Know what to do .
but Crystal report date variable value are Garbage characters "###".
PHO:
[http://file.itpub.net/f/39a8510104476707ae21c945db93ecba/4ae97949/day_091029/20091029_32dcbb7e7d99141483aesJ9KBJHXN0Kj.gif/p/2.gif] -
IF Statement Help in Crystal Report
Hi
I have written a SQL Query to use in my Crystal Report but it is wrong:
IF Currency = 'ZAR'
BEGIN
(SELECT LineTotal FROM PCH1)
END
ELSE
BEGIN
(SELECT TotalFrgn FROM PCH1)
END
Basically I am wanting to create a field in the Crystal Report that checks the Price Currency (PCH1) and if a specific currency then select the relevant PCH1 Table, so if it is ZAR then LineTotal will be shown in the report, IF USD is displayed then TotalFrgn.
Not to sure how to acheive this in Crystal as I used the Crystal Syntax fields but no luck (IF, THEN, ELSE), and if I select LineTotal it will display the converted LC for the report and not the USD value.
Any Ideas?
Regards
Kurt WaltersHi..
Check this thread you will get idea for If Condition on Crystal Report
[crystalreport variable problem.;
Regards,
Bhavank -
Crystal reports - Create Report from SAP Bex Query
I have installed the Crystal reports 2008 for a trial period and the sap integration kit. I have created a new report from a sap query and I am trying to format the report. I would like the columns headings be similar to Bex query - Current Month Jan 2009 which includes the selection parameter of month. I have tried with no sucess. Any help will be appreciated
Ingo
in crystal reports the variables are available in the field explorer. However when I drag the date selection to the report (in design mode) i get the foloowing ?[0I_CALMO], but when I execute the report I don't get any values. I also tried to create a formula but could not access the parameter for month year. Is there documentation on how to do this?
Thanks for your help. -
Selection screen values in global variable user exit
Hi all,
I made a project report global variable of type 3 (User Exit) and I develop the related code in enhancement KKDR0001 component EXIT_SAPLKYP1_003. In this code I need the value of project definition that user entered on selection screen.
Does anybody know how can I get this data?
Thanks!Hi,
You can do the following for getting project in Earlier screen
Data: l_string(20) type c
Field-symbols: <fs> type any.
l_string = '(Screen)variable name'.
assign l_string to <FS>.
Just try above... -
Issue with use of shared variables in Crystal Reports 2008 Offline Viewer
Hi,
I have a report that contains a number of sub-reports which include drill-down functionality. The report returns data relating to an individual team with the user being able to view top level summary information in each area from the parent report and then drill into the sub-reports to view see more detail. The data returned by the sub-reports is filtered, using sub-report links, based on the team code parameter value given by the user. This parameter field resides in the main report.
One of the values returned by the main report is the team name. This is passed to each sub-report using a shared variable and each sub-report displays this team name as part of a heading.
This all works fine in Crystal Reports 2008, but when a report, containing data, is opened using Crystal 2008 Offline Viewer there is a problem with the shared variable. The value is displayed correctly when the user initially drills into the sub-report. However, when the user begins to drill into grouped data within the sub-report the value passed to the sub-report using the shared variable disappears.
How can I ensure that, when a report is viewed using Crystal Offline Viewer 2008, the value within the shared variable is not lost when users drill into grouped data within sub-reports
Thanks
StuartPlease re-post if this is still an issue or purchase a case and have a dedicated support engineer work with you directly:
http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryID=11522300?resid=-Z5tUwoHAiwAAA8@NLgAAAAS&rests=1254701640551 -
Can I access Infoset variable from Crystal Reports
Hi,
In order to connect Crystal Reports 2008 to the SAP environment I have the Integration kit.
I have learnt that Crystal also offers InfoSet driver to connect to SAP.
If I need to access SAP BI- Infoset variables inside Crystal Reports is it possible to do that. If no, then do I need to have the filter using the variable value instead of the fixed filter value?
Please suggest.
Thanks,
Amogh.Hi Amogh,
the InfoSet connectivity that Crystal Reports offers as a direct Infoset connectivity is towards the classic InfoSets from ERP.
see here:
/people/ingo.hilgefort/blog/2008/02/07/businessobjects-and-sap-part-i
/people/ingo.hilgefort/blog/2008/03/23/businessobjects-and-sap-part-4
In case you want to connect to an InfoSet in a BW system you would put a BW query on top of the InfoSet and then use the BW Query in Crystal Reports.
see here:
/people/ingo.hilgefort/blog/2008/02/19/businessobjects-and-sap-part-2
Ingo -
BW hierarchy variable not working in Crystal Report 2008
Hi,
I have created BEx 7.0 report which has hierarchy on 0customer object, the report is working fine whith hierarchy variable. I have created Crystal Report by using this query as source. I have followed below link to create grouping to get data through hierarchy variable.
http://wiki.sdn.sap.com/wiki/display/BOBJ/BWHierarchiesinCrystalReports
But report does not work for hierarchy variable and report is blank. When I give filter of child node which has actual data then I get report output. For ex.
Below hierarchy for 0customer
11396
- 737007
- 123456
When I run report for 11396 then no data display but when I run 737007 child node I get report output but with blank group name.
Can anyone came accross this issue. Please guide me . Thanks in advance.Thanks Ingo for your reply..
The word filter means, I have hierarchy node variable in the BEx report that has become Parameter in CR. When I give hierarchy node variable value of parent node then there is not data display but for the child node I get the data.
For ex. In the info cube there is data for 730707 customer but in the customer hierarchy the parent node of 73707 is 11396. I am giving 11396 in the variable pop screen for hierarchy variable. I do not see any data but for 73707 I get data.
User does not know 73707, he always enter 11396 customer no. and he gets data in BEx query that is source of CR. but crystal report is not showing data for 11396.
One more point I want to tell here, I am saving CR at my local system not to SAP BW server.
Hope this clear my issue.
Harish Swami
Edited by: hswami27 on Jan 31, 2011 8:17 PM -
Open a crystal report from WAD with passing the variables values
Hi,
I need to know is there any way to link SAP WAD to crystal reports (open a crystal report from WAD)and pass the values of the variables which are entered in the Web App. (e.g. Customer id,year) should be passed to the Crystal Report.
Maybe we need to pass parameter by WAD URL but this is just my assumption and have no idea how to do this with passing variable values.
right now I know the method of how Bex queries which are used as data source for crystal reports but in my current scenario we have the structure like this that bex queries link with WAD and then WAD is linked with crystal reports.
No doubt that Crystal report is target option in RRI but there the source is Bex Query only but in current scenario we are looking WAD (web template) as a source to crystal report or crystal report called in WAD.
Please suggest something on same.
Thanks
Take care
Vishal sharmaHello Vishal.
Did you find a solution for this problem?
I'm facing right now the same problem, I need a way to link SAP WAD to crystal reports (open a crystal report from WAD) and pass the values of the variables which are entered in the Web App. (e.g. Customer id,year) should be passed to the Crystal Report.
Have found an answer to this issue? If yes, please kindly inform how have you solved this.
Best Regars
Armando Santos -
Re: Crystal Report and SAP BW Query with Variable
Crystal Report 2008 V1 SP3 and SAP Integration Kits 3.1 SP3 installed on my client machine.
I can open SAP BW Query in Crystal Report. However, in the Field Explorer >Database Fields, I dont see to be able to expan the Query and see it Key Figure/Characteristic.
I noticed this happen only if we have Variable defined in the Charactics.
If the characteristic has no variable, then I can expand the Query under Database Fields.
Do you have this problem?Yes, once I have imported the new SAP Integration Kits XI 3.1 SP3 transports into BW system, I can now expand the it.
I can now see the Variable in Crystal Report.
Thanks! -
Crystal Report not Adopting all possible Dropdown Values from BEx Variable
Hi all,
I am having an issue in a Crystal report where the drop down parameter that is sourced from a BEx query variable does not include all the possible values in the cube (or in master data). After learning my lesson the first time of not changing the name of the variable or changing it to dynamic (this causes it to break), I had the understanding that the value list may not be complete when running the report in the Crystal client or in the viewer, however, I thought it should be correct when published to the BOE and run in infoview. I am getting the same incomplete list in infoview. I published the report into infoview using the Crystal 2008 desktop client, not the /CRYSTAL/RPTADMIN transaction.
I know there are a couple ways of sourcing a Crystal report from a BW query - using MDX vs. not, etc. I created this report using the SAP menu > "Create new report from a query". I don't believe Crystal will easily let you use that menu option to create a report off two BW queries joined together (which is what I am doing), so I built it off one originally (using the SAP menu), then added the other later on. I have the checkbox for "Use MDX driver with support for Multiple structures" checked. In database expert, my "Selected Tables" both are of database type "SAP BW Query".
Do I have the right understanding of how the value list should work when sourced from a BEx variable? If so, can anyone offer any suggestions for getting the value list populated correctly?
Here's some info:
Crystal version: CR2008, version 12.2.4.507
BOE version 3.1
SAP BW 7.01 EhP 6
Thanks,
ChadHi,
- in the Crystal Reports designer the list of values is not online and there is a maximum number of values - configured by a registry setting:
(windows 7)
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Business Objects\Suite 12.0\SAP\BWQueryReportWrapper
Key: MaxPickListSize
and correct you can not change the name of the variable or set it to dynamic as the definition is based on the BEx query.
I know there are a couple ways of sourcing a Crystal report from a BW query - using MDX vs. not, etc. I created this report using the SAP menu > "Create new report from a query". I don't believe Crystal will easily let you use that menu option to create a report off two BW queries joined together (which is what I am doing), so I built it off one originally (using the SAP menu), then added the other later on. I have the checkbox for "Use MDX driver with support for Multiple structures" checked. In database expert, my "Selected Tables" both are of database type "SAP BW Query".
The checkbox on the Multi Structure is not for the option to combine 2 Bex queries - it is for Bex queries with 2 structures and the BW query driver has been deprecated already and you have to use the MDX Driver.
Do I have the right understanding of how the value list should work when sourced from a BEx variable? If so, can anyone offer any suggestions for getting the value list populated correctly?
in Crystal Reports Designer the list is static and when you publish the report using the BW Publishing to your SAP BusinessObjects Enterprise system the list becomes dynamic in InfoView.
regards
Ingo Hilgefort -
How to assign a variable value to crystal report viewer formula with CR2008
Hi ,
I am using crystal reports 2008 and i am not able to find how to assign variable value to crystal report viewer formula.
In CR 8.5 , i used to have crystalreport1.Formulas(0) = variable1
crystalreport1.Formulas(1) = variable2
but, i don't find similar kind in crystal reports 2008.
How can i achieve the same functionality using crystal reports 2008.
Thanks in Advance
Regards,
RamnathHi,
Can i anyone help me out with this.
I am generating crystal reports in vb6 using CR 8.5 and vb6 and below is the code snippet for the same
CrystalReport1.Formulas(0) = "PrintTitle= '" & strMyTitle & "'"
CrystalReport1.Formulas(1) = "FromDate= '" & MskFromDate.Text & "'"
CrystalReport1.Formulas(2) = "ToDate= '" & MskToDate.Text & "'"
Please let me know how the same functionality can be achieved in VB.Net using Crsytal reports 2008
Any code snippet would be of great Help.
Thanks in Adnvance.
Ramnath -
Setting VarChar Variable with String Parameter in Crystal Report Add Command
Setting a VarChar Variable with a String Parameter in a Crystal Report 2008 SP6.3 Add Command is causing an error with a SQL State of 42000. The Error Code depends on which value I select for the parameter. I created the @DateOpt string parameter in the Modify Command window, not in the report. If I comment out line 14 of the SQL the error does not occur.
I have attached the SQL Code and screen shots of the errors. Please tell me what I am doing wrong.Since your parameter is of type STRING, you need to enclose references to it within the Command inside single quotes.
For example, instead of
SET @BeginDate ={?BeginDate}
use
SET @BeginDate ='{?BeginDate}'
hth,
- ido -
Variable Text not working as dynamic header in Crystal report
Dear Experts,
I'm working Crystal report that connected to Query BEX SAP BW trough SAP integration kit,
currently i have case that need report dynamic header using variable text from BEX query, but seem the variable text not working in Crystal reports. the header in Crystal report shown as Desription\technical name, not result from the variable text in Query BEX in SAP.
In https://wiki.sdn.sap.com/wiki/display/BOBJ/Crystal%20Reports%20and%20BW%20query%20elements stated that the "Text variable" with "replacement path" is supported, but i don't know in my query is not working.
i already set in Database -> options-> table and fields -> Show Both, but the text variable still not working.
can you help me
Crystal Reports 2008 12.2.0.290
SAP Integration KIT 12.1.0.890
Thanks
LuqmanPost your question BEX and B1 and classic SAP data source issues to the Integration Kit forum
Maybe you are looking for
-
GUI_DOWNLOAD and background processing
Hello, I have created a process which creates a file. this process uses GUI_DOWNLOAD to put the file on the users C drive or other directory on our network. The user wants to run this process in background and the program is returning a 6 (error unk
-
My ipod nano will not sync with my new PC???
I have moved all my music to my itunes library on my new computer. All of my itunes purchased music appears in my library on new computer as well. The new computer is registered. Every time I plug my ipod into the computer, it will not sync. It says
-
Hi all, I want to add some content to a textframe which already has some text in it. If i use the following code tframe.content += "appended text" then the text is appended to the textframe but all the text that was previously present in the the text
-
Colours different in different selectors on fireworks
Can anyone tell me why this is happening: the CMYK value from the colors > cmyk sliders is outputnig the correct shade of green, however the color palette in the side bar is creating an extremely bright version. Almost looks like it's strying to matc
-
I installed a range expander (WRE54G v3) to expand my wireless range. My singal strength went from low to excellent but when doing that I went from about 3 Mbps to about 1.5 Mbps. Is there anyway to get the same speed out of my range expander a