Length of parameter field
Hello all,
I'm having trouble with a parameter on a selection-screen. I have a field in which the user must enter a filename/path to a workstation file. The length of the parameter field is 128 (RLGRAP-FILENAME), but on the screen, the parameters appears only in length 45 scrollable. Since our users are using loooooong directory pathes, they would like to see the complete filepath/name without scrolling. Is there any possibility to show all 128 digits of the parameter on the screen without manually editing the selection screen?
Thank you for your help, kind regards, Kathrin!
You can use the object/method version of the file F4 help and there is one for directory and one for file name i think. directory_browse for the directory and FILE_OPEN_DIALOG
***************************directory
*Selecting a Directory
data: gd_path(500) type c.
parameters: p_path like rlgrap-filename.
at selection-screen on value-request for p_path.
CALL METHOD cl_gui_frontend_services=>directory_browse
EXPORTING window_title = 'File Directory'
initial_folder = 'C:'
CHANGING selected_folder = gd_path.
CALL METHOD cl_gui_cfw=>flush.
concatenate gd_path '' into p_path.
file
*Selecting a File, plus inserting default file extension
tables rlgrap.
data: it_tab type filetable,
gd_subrc type i.
select-options so_fpath for rlgrap-filename.
at selection-screen on value-request for so_fpath-low.
REFRESH: it_tab.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
EXPORTING
WINDOW_TITLE = 'Select File'
DEFAULT_FILENAME = '*.txt'
MULTISELECTION = 'X'
CHANGING
FILE_TABLE = it_tab
RC = gd_subrc.
loop at it_tab into so_fpath-low.
so_fpath-sign = 'I'.
so_fpath-option = 'EQ'.
append so_fpath.
endloop.
Hope this helps
Regards mart
Similar Messages
-
It is possible to get giving parameter field name in function module
i have one question like below .
at main report .
call funciton Fm1
exporting
var1 = W_A
var2 = W_B
at function module i want to get giving parameter field name, in here value was "W_A" and "W_B" .
plz give me some hints or any advise .Only a hint:
If you have a fm with an unspecified parameter like
FUNCTION ZTESTBABLFM.
*"*"Lokale Schnittstelle:
*" IMPORTING
*" REFERENCE(INPUT)
type-pools: sydes.
data: fieldinfo type SYDES_DESC.
describe field input into fieldinfo.
ENDFUNCTION.
you can get some information from DESCRIBE FIELD either using INTO as above or with other options as LENGTH, TYPE ... -
Sales Order and obligatory material's parameter fields - help!!!
Hi,
My problem is:
I've got to create material in MM by using BAPI_MATERIAL_SAVEDATA, so that this material can be later used as an item in Sales Order (SD). Do you know what parameter fields from which structures are obligatory in my case? I've already passed quite a lot of data to this BAPI, but I still get following error:
"Material myMaterial is not defined for sales org. 4000, distr.chan. 01, language FI"
Any suggestion will be appreciated and properly rewarded if useful.
My Java source-code is available below. Check this out and let me know what is missed.
* HEADDATA FOR BASIC VIEW
Structure headData = input.getStructure("HEADDATA");
headData.setValue(_material, "MATERIAL");
headData.setValue("1", "IND_SECTOR");
headData.setValue(_matl_type, "MATL_TYPE");
headData.setValue("X", "BASIC_VIEW");
headData.setValue("X", "SALES_VIEW");
//headData.setValue("X", "MRP_VIEW");
headData.setValue("E", "INP_FLD_CHECK");
* CLIENTDATAX FOR BASIC VIEW
Structure clientDatax = input.getStructure("CLIENTDATAX");
clientDatax.setValue("X", "MATL_GROUP");
clientDatax.setValue("X", "OLD_MAT_NO");
// clientdatax.setValue("X", "PROD_HIER");
clientDatax.setValue("X", "BASE_UOM_ISO");
clientDatax.setValue("X", "NET_WEIGHT");
clientDatax.setValue("X", "UNIT_OF_WT_ISO");
clientDatax.setValue("X", "ITEM_CAT");
clientDatax.setValue("X", "PUR_VALKEY");
clientDatax.setValue("X", "LABEL_TYPE");
clientDatax.setValue("X", "LABEL_FORM");
clientDatax.setValue("X", "DIVISION");
* CLIENTDATA FOR BASIC VIEW
Structure clientData = input.getStructure("CLIENTDATA");
clientData.setValue("02", "MATL_GROUP");
clientData.setValue("testmaterial", "OLD_MAT_NO");
// clientdata.setValue("1000000790","PROD_HIER");
clientData.setValue("PCE", "BASE_UOM_ISO");
clientData.setValue(0.111, "NET_WEIGHT");
clientData.setValue("KGM", "UNIT_OF_WT_ISO");
clientData.setValue("NORM", "ITEM_CAT");
clientData.setValue("UV03", "PUR_VALKEY");
clientData.setValue("1", "LABEL_TYPE");
clientData.setValue("E1", "LABEL_FORM");
clientData.setValue("01", "DIVISION");
* SALESDATAX
Structure salesDatax = input.getStructure("SALESDATAX");
salesDatax.setValue("4000","SALES_ORG");
salesDatax.setValue("01","DISTR_CHAN");
salesDatax.setValue("X","ITEM_CAT");
salesDatax.setValue("X","DELYG_PLNT");
* SALESDATA
Structure salesData = input.getStructure("SALESDATA");
salesData.setValue("4000","SALES_ORG");
salesData.setValue("01","DISTR_CHAN");
salesData.setValue("NORM","ITEM_CAT");
salesData.setValue("4200","DELYG_PLNT");
* PLANTDATAX
Structure plantDatax = input.getStructure("PLANTDATAX");
plantDatax.setValue("4200", "PLANT");
plantDatax.setValue("X", "MRP_TYPE");
plantDatax.setValue("X", "MRP_CTRLER");
plantDatax.setValue("X", "REORDER_PT");
plantDatax.setValue("X", "MINLOTSIZE");
plantDatax.setValue("X", "LOADINGGRP");
* PLANTDATA
Structure plantData = input.getStructure("PLANTDATA");
plantData.setValue("4200", "PLANT");
plantData.setValue("ND", "MRP_TYPE");
plantData.setValue("001", "MRP_CTRLER");
plantData.setValue("0", "REORDER_PT");
plantData.setValue("100", "MINLOTSIZE");
plantData.setValue("0001", "LOADINGGRP");
* MATERIALDESCRIPTION EN
Table materialDesc = tables.getTable("MATERIALDESCRIPTION");
materialDesc.appendRow();
materialDesc.setValue("ENGLISH", "LANGU");
materialDesc.setValue("EN", "LANGU_ISO");
materialDesc.setValue(_material+" - test for sales order", "MATL_DESC");
* MATERIALDESCRIPTION FI
materialDesc.appendRow();
materialDesc.setValue("FINNISH", "LANGU");
materialDesc.setValue("FI", "LANGU_ISO");
materialDesc.setValue(_material+" - test FI", "MATL_DESC");
// materialdesc.insertRow(0);
// MeasureX
Table measurex = tables.getTable("UNITSOFMEASUREX");
measurex.appendRow();
measurex.setValue("X", "ALT_UNIT_ISO");
measurex.setValue("X", "UNIT_DIM_ISO");
measurex.setValue("X", "LENGTH");
measurex.setValue("X", "WIDTH");
measurex.setValue("X", "HEIGHT");
measurex.setValue("X", "VOLUME");
measurex.setValue("X", "VOLUMEUNIT_ISO");
measurex.setValue("X", "GROSS_WT");
measurex.setValue("X", "UNIT_OF_WT");
measurex.setValue("X", "UNIT_OF_WT_ISO");
// measurex.insertRow(0);
// Measure
Table measure = tables.getTable("UNITSOFMEASURE");
measure.appendRow();
measure.setValue("PCE", "ALT_UNIT_ISO");
// measure.setValue("X","DEL_FLAG");
measure.setValue("CMT", "UNIT_DIM_ISO");
measure.setValue(0.111, "LENGTH");
measure.setValue(0.111, "WIDTH");
measure.setValue(0.111, "HEIGHT");
measure.setValue(0.3, "VOLUME");
measure.setValue("CMQ", "VOLUMEUNIT_ISO");
measure.setValue(0.111, "GROSS_WT");
measure.setValue("KGM", "UNIT_OF_WT");
measure.setValue("KG", "UNIT_OF_WT_ISO");
//Tax classifications
Table tax = tables.getTable("TAXCLASSIFICATIONS");
tax.appendRow();
tax.setValue("FI", "DEPCOUNTRY");
tax.setValue("FI", "DEPCOUNTRY_ISO");
tax.setValue("MWST", "TAX_TYPE_1");
tax.setValue("1", "TAXCLASS_1");
//tax.setValue("01", "TAX_IND");
tax.appendRow();
tax.setValue("EN", "DEPCOUNTRY");
tax.setValue("EN", "DEPCOUNTRY_ISO");
tax.setValue("MWST", "TAX_TYPE_1");
tax.setValue("2", "TAXCLASS_1");Hi Alistair,
I have a full access to SAP, so I can create and extend material whenever I want through MM01/MM02, but my target is to develop a method in Java, which creates a fully functional material to be used later in Sales Order.
A code listed in my prevoius post shows most of my method. I've got to indicate that my method works correctly and creates material. I've checked it through MM03 - I mean my material created with my method exists.
Moreover both sales org. and distr. channel are passed to BAPI, as you may see in the following code:
* SALESDATA
Structure salesData = input.getStructure("SALESDATA");
salesData.setValue("4000","SALES_ORG");
salesData.setValue("01","DISTR_CHAN");
salesData.setValue("NORM","ITEM_CAT");
salesData.setValue("4200","DELYG_PLNT");
But the problem occurs when I wanna create Sales Order (VA01) and when I choose the item. Material created by my method causes error:
"Material myMaterial is not defined for sales org. 4000, distr.chan. 01, language FI"
I don't understand why? I'm not SAP specialist, but in my opinion I've passed necessary data.
Do you any idea?
Thanks in advance. Every helpful suggestion will be properly rewarded.
BR,
Rafal -
Parameter field should pick the values which are there in the value table
Hi Experts,
I have a requ. where in a parameter field should pick only the values which are there in the value table for that particular field and should not allow the User to put in any other value.
The value table is created in the program manually.
EX:If the value table contains two sales organization VE03 and VE65 then the field shouldn´t allow anyother value other then those two.
Thanks and Regards,
ArunTry using a listbox.
report zrich_0001.
type-pools: vrm.
data: ivrm_values type vrm_values.
data: xvrm_values like line of ivrm_values.
data: name type vrm_id.
parameters: p_vkorg(4) type c as listbox visible length 20.
at selection-screen output.
name = 'P_VKORG'.
xvrm_values-key = 'VE03'.
xvrm_values-text = 'VE03'..
append xvrm_values to ivrm_values.
xvrm_values-key = 'VE65'.
xvrm_values-text = 'VE65'..
append xvrm_values to ivrm_values.
call function 'VRM_SET_VALUES'
exporting
id = name
values = ivrm_values.
at selection-screen.
if p_vkorg is initial.
message e001(00) with 'Please enter a sales org'.
endif.
Regards,
RIch Heilman -
Sales Order and obligatory material's parameter fields
Hi,
My problem is:
I've got to create material in MM by using BAPI_MATERIAL_SAVEDATA, so that this material can be later used as an item in Sales Order. Do you know what parameter fields from which structures are obligatory in my case? I've already passed quite a lot of data to this BAPI, but I still get following error:
"Material myMaterial is not defined for sales org. 4000, distr.chan. 01, language FI"
Any suggestion will be appreciated and properly rewarded if useful.
My Java source-code is available below. Check this out and let me know what is missed.
* HEADDATA FOR BASIC VIEW
Structure headData = input.getStructure("HEADDATA");
headData.setValue(_material, "MATERIAL");
headData.setValue("1", "IND_SECTOR");
headData.setValue(_matl_type, "MATL_TYPE");
headData.setValue("X", "BASIC_VIEW");
headData.setValue("X", "SALES_VIEW");
//headData.setValue("X", "MRP_VIEW");
headData.setValue("E", "INP_FLD_CHECK");
* CLIENTDATAX FOR BASIC VIEW
Structure clientDatax = input.getStructure("CLIENTDATAX");
clientDatax.setValue("X", "MATL_GROUP");
clientDatax.setValue("X", "OLD_MAT_NO");
// clientdatax.setValue("X", "PROD_HIER");
clientDatax.setValue("X", "BASE_UOM_ISO");
clientDatax.setValue("X", "NET_WEIGHT");
clientDatax.setValue("X", "UNIT_OF_WT_ISO");
clientDatax.setValue("X", "ITEM_CAT");
clientDatax.setValue("X", "PUR_VALKEY");
clientDatax.setValue("X", "LABEL_TYPE");
clientDatax.setValue("X", "LABEL_FORM");
clientDatax.setValue("X", "DIVISION");
* CLIENTDATA FOR BASIC VIEW
Structure clientData = input.getStructure("CLIENTDATA");
clientData.setValue("02", "MATL_GROUP");
clientData.setValue("testmaterial", "OLD_MAT_NO");
// clientdata.setValue("1000000790","PROD_HIER");
clientData.setValue("PCE", "BASE_UOM_ISO");
clientData.setValue(0.111, "NET_WEIGHT");
clientData.setValue("KGM", "UNIT_OF_WT_ISO");
clientData.setValue("NORM", "ITEM_CAT");
clientData.setValue("UV03", "PUR_VALKEY");
clientData.setValue("1", "LABEL_TYPE");
clientData.setValue("E1", "LABEL_FORM");
clientData.setValue("01", "DIVISION");
* SALESDATAX
Structure salesDatax = input.getStructure("SALESDATAX");
salesDatax.setValue("4000","SALES_ORG");
salesDatax.setValue("01","DISTR_CHAN");
salesDatax.setValue("X","ITEM_CAT");
salesDatax.setValue("X","DELYG_PLNT");
* SALESDATA
Structure salesData = input.getStructure("SALESDATA");
salesData.setValue("4000","SALES_ORG");
salesData.setValue("01","DISTR_CHAN");
salesData.setValue("NORM","ITEM_CAT");
salesData.setValue("4200","DELYG_PLNT");
* PLANTDATAX
Structure plantDatax = input.getStructure("PLANTDATAX");
plantDatax.setValue("4200", "PLANT");
plantDatax.setValue("X", "MRP_TYPE");
plantDatax.setValue("X", "MRP_CTRLER");
plantDatax.setValue("X", "REORDER_PT");
plantDatax.setValue("X", "MINLOTSIZE");
plantDatax.setValue("X", "LOADINGGRP");
* PLANTDATA
Structure plantData = input.getStructure("PLANTDATA");
plantData.setValue("4200", "PLANT");
plantData.setValue("ND", "MRP_TYPE");
plantData.setValue("001", "MRP_CTRLER");
plantData.setValue("0", "REORDER_PT");
plantData.setValue("100", "MINLOTSIZE");
plantData.setValue("0001", "LOADINGGRP");
* MATERIALDESCRIPTION EN
Table materialDesc = tables.getTable("MATERIALDESCRIPTION");
materialDesc.appendRow();
materialDesc.setValue("ENGLISH", "LANGU");
materialDesc.setValue("EN", "LANGU_ISO");
materialDesc.setValue(_material+" - test for sales order", "MATL_DESC");
* MATERIALDESCRIPTION FI
materialDesc.appendRow();
materialDesc.setValue("FINNISH", "LANGU");
materialDesc.setValue("FI", "LANGU_ISO");
materialDesc.setValue(_material+" - test FI", "MATL_DESC");
// materialdesc.insertRow(0);
// MeasureX
Table measurex = tables.getTable("UNITSOFMEASUREX");
measurex.appendRow();
measurex.setValue("X", "ALT_UNIT_ISO");
measurex.setValue("X", "UNIT_DIM_ISO");
measurex.setValue("X", "LENGTH");
measurex.setValue("X", "WIDTH");
measurex.setValue("X", "HEIGHT");
measurex.setValue("X", "VOLUME");
measurex.setValue("X", "VOLUMEUNIT_ISO");
measurex.setValue("X", "GROSS_WT");
measurex.setValue("X", "UNIT_OF_WT");
measurex.setValue("X", "UNIT_OF_WT_ISO");
// measurex.insertRow(0);
// Measure
Table measure = tables.getTable("UNITSOFMEASURE");
measure.appendRow();
measure.setValue("PCE", "ALT_UNIT_ISO");
// measure.setValue("X","DEL_FLAG");
measure.setValue("CMT", "UNIT_DIM_ISO");
measure.setValue(0.111, "LENGTH");
measure.setValue(0.111, "WIDTH");
measure.setValue(0.111, "HEIGHT");
measure.setValue(0.3, "VOLUME");
measure.setValue("CMQ", "VOLUMEUNIT_ISO");
measure.setValue(0.111, "GROSS_WT");
measure.setValue("KGM", "UNIT_OF_WT");
measure.setValue("KG", "UNIT_OF_WT_ISO");
//Tax classifications
Table tax = tables.getTable("TAXCLASSIFICATIONS");
tax.appendRow();
tax.setValue("FI", "DEPCOUNTRY");
tax.setValue("FI", "DEPCOUNTRY_ISO");
tax.setValue("MWST", "TAX_TYPE_1");
tax.setValue("1", "TAXCLASS_1");
//tax.setValue("01", "TAX_IND");
tax.appendRow();
tax.setValue("EN", "DEPCOUNTRY");
tax.setValue("EN", "DEPCOUNTRY_ISO");
tax.setValue("MWST", "TAX_TYPE_1");
tax.setValue("2", "TAXCLASS_1");I forgot to indicate sth important what actually might be read from my source code. Both sales org. and distr. channel are passed to BAPI to structure SALESDATA. Why SAP doesn't recognize it? Do you know any explanation? or somebody else?
* SALESDATA
Structure salesData = input.getStructure("SALESDATA");
salesData.setValue("4000","SALES_ORG");
salesData.setValue("01","DISTR_CHAN");
salesData.setValue("NORM","ITEM_CAT");
salesData.setValue("4200","DELYG_PLNT"); -
Owb error while edit a mapping:the minimum length of this field is 1
after creating a mapping,an error always occur when i attemp to
edit it just as add a mapping table,the error description is:
the minimum length of this field is 1 and its maximum length is
15,You have 19 characters.
can some one help me?thanksHi Vidyanand,
Did you create the runtime access user using the runtime assistant? Did you select the correct runtime repository (if you have more) to associate your runtime access user with?
Note that there are 4 database roles being created when you create a runtime repository owner:
- OWB_A_<runtime repository owner>
- OWB_D_<runtime repository owner>
- OWB_R_<runtime repository owner>
- OWB_U_<runtime repository owner>
If you would grant those roles to a user, then that user becomes an access user for the user with username <runtime repository owner>.
Note that you can also use the runtime repository credentials to connect to the runtime repository for deployment purposes, but you may not want that because of security concerns.
Thanks,
Mark. -
Hi,
I have designed one report using Parameter Field which is Cost Code (string).
When I run my report, I ask to enter cost code. When I enter cost code 30, I get report for all transaction of cost code 30 and 300.
How could I avoid this problem.
Thanks
MithaniTry with this
{Project_cost.EXPENSES_Code} IN {?Cost Code}
and also
Check the query formed after giving the input parameter. Goto Database --> Show Sql Query. -
Pass the results from a selection formula to the default values for a parameter field
Post Author: kevans
CA Forum: General
Crystal 10 u2013 SQL 2000
I want to create a parameter field that will display all of our IT Departments so the end user can select the one they want to run the report against, such as IT-Security, IT-Network, etc. about 40 in all. BUT I donu2019t want this to be a static list where I type in all 40 depts in the default list, I was hoping I could do something more dynamic such a formula field that says u201C if {group.name startswith u2018ITu2019 then {group.name}u201D and then have the parameter field pull from this source.
Iu2019m sure this has been answered in a previous post but Iu2019m not finding it. I see stuff on creating a record selection formula such as u2018if {?group} like u2018IT-Secur*u2019 thenu2026u201D but this leaves too much room for error if people donu2019t type the name correctly. Maybe Iu2019m not using the record selection formula correctly? Sorry if I offend anyone but I just upgraded from 8 to 10 and thought for sure this option would be in 10, perhaps built right into the parameter default value page where you can place in select criteria but NOTHING has changed.Post Author: sharonmtowler
CA Forum: General
if you are creating the parameters in the rpt file, it will only pull values you enter, or directly from the database
in the record selection you can do something like this, so if they only enter the first 2 characters it should pick up only the IT etc.
(if eft(,2)={?parameter} then true else ={?parameter}) -
Parameter Field Value returns "no records"
I am using Crystal 11 and am new to Crystal but not to other Reportwriters. I have a Crystal report that has 2 parameter fields, one is "Enter Date" that prompts for the start and end date, the other "Select Items" prompts for the supply Item Numbers to be included in the report. In the "Edit Parameter: Select Items:" edit/create parameter dialog, the Select Item parameter has "Allow Multiple values" and "Allow discrete values" set to true. The report runs fine and returns any items entered in the "Select Items" prompt that has usage during the start & end date. My problem is ... if the entered Item Number for the Select Items parameter returns no records, I cannot report that Item Number as having zero usage. I cannot find a way at the time of report running to identify and report the "not found" items. I would also like to report the Start and End Dates parameters requested, but cannot, the Enter Date parameter returns an empty parameter field across the whole report. I'm sure other users have had this problem of reporting the requested parameter values. Need assistance.
Jeff's answer is one way to do it. There are others:
If you want the items with no data interspersed with the other items (say, in item number order), then you'd change the report to use your item master table and do a left join from that to the usage data. If a field from the usage table is null, then there was no usage, and you can condition a message based on that.
Or, if your parameter selects item numbers without some type of "ALL" option, then you can use arrays to keep track of which if the selected items printed. Then in the report footer, compare the list of items reported to the parameter items, and show which item numbers had no usage. (This might run a tad faster than the separate subreport that Jeff suggested - but maybe not...)
HTH,
Carl -
Passing a value to a Parameter Field From a VB Form
Post Author: as1971
CA Forum: General
Hello everyone
I'm using Visual Basic 6.0 and Crystal Report 9.0
I built a report using Crystal Report and named it Player_Statement.rpt. I then included it to my VB project and named it Player_Statement.Dsr
In this report I have a Parameter Field called P_Player_ID which I'm using in Record Selection Formula.
I'm using the following code to pass a value to the parameter:
Dim Report As CRAXDRT.ReportSet Report = New Player_StatementReport.ParameterFields.GetItemByName("P_Player_ID").AddCurrentValue CLng(cmbPlayerNB.BoundText)
When I execute the application I get the error message "The value or range you are adding has already existed" at the last line of code (Where I'm assigning the parameter a value)
Could anybody help me pleasePost Author: VinoTinto
CA Forum: General
Dim Report As CRAXDRT.ReportSet Report = New Player_StatementReport.GetItemByName("P_Player_ID").ClearCurrentValueAndRange Report.ParameterFields.GetItemByName("P_Player_ID").AddCurrentValue = CLng(cmbPlayerNB.Boundtext) -
Length of a field in a structure
Hi,
Is there any restriction on the length of the field in a structure which is CHAR type ??
Thanks.Sample
report zrich_0001
line-size 1023.
data: begin of s,
a(65510) type c,
b(25) type c,
end of s.
s-a = 'This is field 1 asdfkljas;dfkja;sldkjf;aslkdjf;alskdjfa' &
'asdfkajsd;kfjas;dlkfj;aslkdjf;alksjdf;lkasjdf;lasdfasdf' &
'asdfkljas;dlkfj;askdjf;askjdf;lkasdjf;lkasj thd end'.
s-b = 'This is field 2'.
Write:/ s-a.
write:/ s-b.
Regards,
Rich Heilman -
Filtering report data based on user login and Parameter fields
Post Author: mronquillo
CA Forum: General
Hi,I am running a report that filters data based on the user login. To do this, I created a formula called @user that compares the login name (using the CurrentCEUserName field) and returns the user's name. If the user login is not a login specified in the if statements, it returns the parameter field "user_name":For example: if CurrentCEUserName = "loginname1" then "User's Name 1"else if CurrentCEUserName = "loginname2" then "User's Name 2" else if CurrentCEUserName = "loginname3" then "User's Name 3" else if CurrentCEUserName = "loginname4" then "User's Name 4".. .else {?user_name} In select expert, I have a condition which filters data based on the string returned from that formula:{Table.Name} = {@user} This works fine and when the users run the report they only their own data. However, they are still prompted to choose a parameter field regardless if of the value returned by the @user formula. Oddly enough, regardless of what parameter field they choose, they will still only see their own data (i.e. if John chooses "Bob" from the parameter list, he will still only see John's data.)If I remove the "else {?user_name}" line from the @user formula, then the users are not prompted anymore. However, if they are not a "valid" user - that is, if any of the if statements in the formula are not true for their login name - then they will see no data. What I want to do is make the report ONLY prompt the user to choose a parameter field if their login name is not "valid". That is, if the @user formula is able to return a string value for their login name, then they will jump right into the report without being prompted to choose a parameter - otherwise, the user will be prompted to choose a name from the parameter list. I thought my formula would allow this (hence the "else" clause), but it seems that if a parameter field is present in any formula, then the report automatically prompts the user to choose a parameter. Is what I am trying to accomplish possible in CR (I'm using CR v10.0) or is there a better way to do what I am trying to do?Thanks in advance.Post Author: sharonmtowler
CA Forum: General
try, or something like that
(if CurrentCEUserName ={?user_name} then true else ({Table.Name} = {@user}) ) -
How to use a parameter field value as a substring in a "like" statement?
Hi all,
I'm trying to use a parameter field in a Record selection formula where the parameter field value would be a substring of the data stored in the field.
My parameter field (SlctResearcher) is constructed as follows:
Type: string
List of Values: static
Value Field: (Reports) RptAuthors
(in Value Options) Allow custom values?: True
{Reports.PubDate} in DateTime (2009, 04, 01, 00, 00, 00) to DateTime (2010, 03, 31, 23, 59, 59) and
{Reports.RptAuthors} like "*{?SlctResearcher}*"
When I hit F5 to generate the data, I get no results (and the parameter prompt field does not even come up...)
If I modify the formula to put a hard-coded string, like
"*Jones*"
after the 'like', I get results (all the reports where "Jones" is a substring in the RptAuthors string.) If I modify the formula to just use the parameter field without the quotes/stars like:
{Reports.PubDate} in DateTime (2009, 04, 01, 00, 00, 00) to DateTime (2010, 03, 31, 23, 59, 59) and
{Reports.RptAuthors} like {?SlctResearcher}
I do get the parameter prompt field, but still no results even if I put in a valid substring value (since it is not searching for a substring anymore...)
How can I do this?
Thanks,
Will1st thing... Make a copy of your report before doing anything!!!
To use a SQL Command, you'll want to open the Database Expert and look at the Current Connections. Expand the data source and the 1st option you see is the Add Command option.
To find the SQL That CR is currently using, choose Database from the menu bar and select Show SQL Query...
You can copy this and paste it directly into the command window. (If you you can write your own SQL you don't need copy CR's, it's just an option.)
You'll also want to take not of any parameters that you have, you'll need to add them the the Parameter List of the command as well... be sure to spell them EXACTLY as they are in the design pane.
Anyway, once the SQL statement is in the Command window you'll be able to alter the WHERE clause to use the wild cards.
For future reference... What type of database are you reporting against???
Jason -
How to get the length of a field value, not the length of DB's CHAR(20)
Hello.
I'm trying to handle a String from my DataBase and get its length:
String myName;
int i;
PreparedStatement sql = Conn.prepareStatement("SELECT NAME FROM MY_TABLE");
ResultSet results = sql.executeQuery();
results.next();
myName = results.getString("NAME");
i = myName.length();
out.println("The value is " + myName + " and the length is " + String.valueOf(i) );
I get:
" The value is Tom and the lengh is 20 "
20 is the length of the field (it's a CHAR (20) ), but I would like to get the length
of 'Tom'.
On other hand, I would like to detect if this value is 'Tom' or not, but trying with:
if (myName.equals("Tom")) {...}
or
if (myName == "Tom") {...}
There is no response.
Any experience?myName = results.getString("NAME");
if(myName!=null) myName = myName.trim(); //Take out trailing spaces
i = myName.length();Sudha -
Error while adding Parameter Field to CrossTab report in CR 2008
Hello Experts,
I'm getting an error - "Not supported" while I'm trying to add a paremeter to the Crosstab report. It is a simple report with no further complications.
Is there any special way to add a parameter field to Crosstab? Any help appreciated.
TIA
arjunHi,
What version of Crystal Report are you using?
Kindly refer SAP Note 1376117 & 1454192 and verify if you are on the approriate patch.
Regards,
Nakul
Maybe you are looking for
-
Am I stuck to going back to the CS6 version?
-
Zoom feature in iOS 7 for iPhone 4S
In Apples iOS user guide for ios 7 it states that the zoom feature in the video mode for the iSight camera is available for the iPhone 4S and above when in fact it is not. I spoke to two senior technicians in tech support and they both agreed that t
-
I purchased on-line a new Super Zoom for my iPad and iPhone. when I attached the iPhone lense to the iPhone, there seems to be a problem with the view. You can still see the outline of the lense and it is not a clear view looking through. Can you hep
-
Can't fully boot OS 9 when OS X 10.4 drive is connected to ATA bus
A friend has a g4 733 quicksilver running os 9.2.2. He bought a new 80gb drive and I installed it along with OS X 10.4. Updated and installed various applications (mainly audio apps). Then tried to boot back into OS 9 and at the very end of the start
-
Open a URL in default web browser
HI I have to open a URL Link (any one) using my application.... I have a menu option -> online help So i have to open a web page (already defined) in a default web browser of windows. Please suggest me way to solve this problem? Thanks in advance tig