How to assign a value to a parameter {?MyParam} dynamically?
How to assign a value to a parameter {?MyParam} dynamically?
Example:
{?One_Or_Two} <- my first parameter
{?MyParam} <- My second parameter
The Code:
If ( {?One_Or_Two} = 'One' then
{?MyParam} = 'One' ;
else
{?MyParam} = 'Two' ;
(THIS IS NOT WORKING FOR ME! ANYONE KNOW WHY?)
IT NEVER ASSIGN THE VALUE?
My Command query looks like:
SELECT * FROM MyTable
WHERE MyTable.MyColumn = {?MyParam}
THANKS
Hi Joseph,
I'm a bit unclear as to what you are doing and from what I see you're running in circles.
Your Command query is looking for a field that is equal to {?MyParam}.
Now you want to take {?MyParam} in the report and change the value after you've set it.
Parameters cannot be set from the Command, you can format it and manipulate it but they cannot be set except from the parameters window or from a front-end.
Thanks,
Brian
Similar Messages
-
Assigning a value to a parameter.
Hi all,
I am using CR XI, developping a report built upon a query in BW (using SAP Kit). The query in BW has a parameter PARAM1 of type string that comes automatically into my report but the type or the parameter is greyed. I can't change it.
In reality, I am expecting a date to be entered. It would be more user friendly to offer the user the calendar interface to select a value rather than the textbox for a string.
I can create a second parameter PARAM2 of type Date in CR, transform the input value to string but I do not know how to assign the result to PARAM1.
I have tried an assignment in a formula using beforereadingreports but no luck.
Does anybody know how to do this or if this is even possible ?
Thanks.Thanks Graham - sorry it took me so long.
That is an interesting suggestion that I did not think of. I tried but for some reason the parameter for the report against BW does not show up in the link part of the subreport definition. I created a "fake" main report with a date type parameter, a formula to translate it to a string but no way to "assign" its value to the parameter in the original report.
Queries against SAP seem to have "specificities"...
In other words, i am still stuck ! -
Conditionally assign a value to a parameter
I'm using this code to conditionally assign a value to a parameter p_data_type:
<?if:H_ACCOUNT_HIER_DESC='EST'?><xsl:param name="p_data_type" select="'number'" xdofo:ctx="begin"/> <?end if?>
<?if:H_ACCOUNT_HIER_DESC='PAR'?><xsl:param name="p_data_type" select="'text'" xdofo:ctx="begin"/> <?end if?>
However, I'm getting the following error.
Caused by: oracle.xdo.parser.v2.XMLParseException: Duplicate variable 'p_data_type' definition.
Once I get this working, I want to use it as follows:
<?sort:current-group()/ACCOUNT_SEQ;'ascending';data-type='{$p_data_type}'?>
Does anyone have any suggestions on how I might do this?
Thank you,
TamThanks, Vetsrini. Works great. I do have one further question if you don't mind. In the <xsl:when test...>condition below, why is the '//' reference required for H_ACCOUNT_HIER_DESC. The code didn't work unless I used the '//'
Here is my template code:
<?import:xdo://XXFIN.XXFIN_PSB_NUMBER_FORMAT.en.CA PROVINCE?>
<?start:body?>
<?for-each:XXFIN_PSB_GOS_EXP_ANNUAL_ACT_SUM?>
<?for-each:G_HEADER_PAGE?>
<xsl:variable name="p_data_type">
<xsl:choose>*<xsl:when test="//H_ACCOUNT_HIER_DESC='EST'">*<xsl:value-of select="'number'"/></xsl:when><xsl:otherwise><xsl:value-of select="'text'"/></xsl:otherwise></xsl:choose>
</xsl:variable>
Here is my XML:
<?xml version="1.0" encoding="UTF-8"?>
<XXFIN_PSB_GOS_EXP_ANNUAL_ACT_SUM>
<P_OUTPUT>E17-1</P_OUTPUT>
<P_ACCOUNT2_HIGH>
<G_HEADER_PAGE>
<H_RECIPIENT_NAME/>
<H_PROG_SUM_LEVEL>SV/SP</H_PROG_SUM_LEVEL>
<H_ACCOUNT_HIER>AC0000</H_ACCOUNT_HIER>
<H_ACCOUNT_HIER_DESC>EST</H_ACCOUNT_HIER_DESC>
Thanks again for your help.
Tam -
How to assigne multiple value in key of read table
Hi gurus,
I want read table xxxx with key field1 = ' xxx' or field1 = 'yyy'.
how to assign multiple value as key for the same field while reading internal table.
Regards
sagarHi ,
You can loop the internal table like
loop at <table xxxx> where field1 = ' xxx' or field1 = 'yyy'
or you can write two read statements to read the internal table in wrk area.
read table <table xxxx> with key field1 = ' xxx'.
if sy-subrc <>0
read table <table xxxx> with key field1 = 'yyy'.
if sy-subrc = 0
endif.
else.
do your data processing.
endif.
Thans. -
In flex, How to set a value to one parameter, the parameter
defined in a cffunction in a cfc file, In the cffunction there are
much cfargument, I want set a value to one of them, such as the
cfc:
<cffunction access="remote" name="myShow" output="false"
returntype="struct">
<cfargument name="ID" type="numeric" default=0>
<cfargument name="GoodsID" type="string" default="">
<cfargument name="DestTime" type="string" default="">
<cfargument name="DestCount" type="numeric" default=1>
How I set a value to only parameter one of them , such as set
GoodsID when use mx:remoteObject.
Thanks for your helpGot maybe a solution for you, I have just tested it.
So, the idea is to use intermediate variables. Imagine Var1 and Var2 variables that you refresh with your more or less complicated queries. Then what you can do is to refresh your final variable Var3 with a query using your intermediate variables. Here is an example for Oracle:
select #Var1+#Var2 from dual
This way you can make a chain of dependent variables: Var3 is using Var2 and Var2 is using Var1.
Hope it helps.
Shamil -
How to assign NULL value to an ITEM in Forms Personalization?
Hi,
how to assign NULL value to an ITEM in Forms Personalization?
please suggest me.
ThanksI don't know what your form personalization does and maybe I misunderstand you ...
Try
:item_name := null; -
Hi,
How to assign a value for Unit of measure (like PC, KG...) in ABAP program?
I want to assign PC in a field to execute the program, like wa-ENTRY_UOM = 'pc'.
But the system returen a message that "Unit of measure is not convertible to stockkeeping unit PC"
Could anyone tell me how to assign the value??
Thanks!hi,
first convert the quantity in the same unit ( like in you case ST to PC ) by using FM : MD_CONVERT_MATERIAL_UNIT
CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'
EXPORTING
i_matnr = matnr
i_in_me = entry_uom
i_out_me = out_uom
i_menge = quantity
IMPORTING
E_MENGE = fp_l_v_quant
EXCEPTIONS
ERROR_IN_APPLICATION = 1
ERROR = 2
OTHERS = 3.
IF sy-subrc <> 0.
give error message here
ENDIF.
bcoz in ur program somewhere the quantities etc are compared and there units may be different... so that is why it is showing such error. so just convert convert the quantity in the same unit .
regards
rahul
Edited by: RAHUL SHARMA on Jun 17, 2009 9:31 AM -
How to assign a value to the page variable to enable partial page rendering
This is part of my code:
<bc4j:rootAppModuleScope name="App1"
rendered="on@ctrl:page">
Now, I want to change the value of "on@ctrl:page" to "true" after user click a button so that part of the page will be displayed. But how do I assign the value to "on@ctrl:page". I tried to put the followings in my even handler:
<bc4j:setPageProperty name="on" value="true">
<bc4j:parameter name="on" />
</bc4j:setPageProperty>
But it doesn't work. Could someone pls tell me how I should do it.
Thanks a lot!
LingYou should do is:
in your event handle codes,you add the list:
public static EventResult eventname(
BajaContext context,
Page page,
PageEvent event) throws Throwable
EventResult result = new EventResult(page);
result.setProperty("on","true");//or "false"
return result;
then,
change
rendered="on@ctrl:page" -> data:rendered="on@ctrl:eventResult"
also ,you should see the 5th part of 'UIX Developer's Help' -
How to get each value from a parameter passed like this '(25,23,35,1)'
Hi
One of the parameter passed to the function is
FUNCTION f_main_facility(pi_flag_codes VARCHAR2) return gc_result_set AS
pi_flag_codes will be passed a value in this way '(25,23,35,1)'
How to get each value from the string
like 25 first time
23 second time
35 third time
1 fourth time
I need to build a select query with each value as shown below:-
(SELECT t2.org_id, t4.description
from org_name t2, ref_org_name t3, code_table t4
where t2.att_data = t4.code
and t3.ref_code = t2.att_type
and t2.att_type = 25 and t3.code_type = t4.code_type
and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date) q1,
(SELECT t2.org_id, t4.description
from org_name t2, ref_org_name t3,code_table t4
where t2.att_data = t4.code
and t3.ref_code = t2.att_type
and t2.att_type = 23 and t3.code_type = t4.code_type
and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date) q2,
(SELECT t2.org_id, RTRIM(xmlagg(xmlelement(e, t4.description || ';')
ORDER BY t4.description).EXTRACT('//text()'), ';') AS DESCRIPTION
from org_name t2, ref_org_name t3,code_table t4
where t2.att_data = t4.code
and t3.ref_code = t2.att_type
and t2.att_type = 35 and t3.code_type = t4.code_type
and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date
group by t2.org_id) q3,
(SELECT t2.org_id, t4.description
from org_name t2, ref_org_name t3, code_table t4
where t2.att_data = t4.code
and t3.ref_code = t2.att_type
and t2.att_type = 1 and t3.code_type = t4.code_type
and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date) q4
Please help me with extracting each alue from the parm '(25,23,35,1)' for the above purpose. Thank You.chris227 wrote:
I would propose the usage of regexp for readibiliy purposes and only in the case if this doesnt perform well, look at solutions using substr etc.
select
regexp_substr( '(25,23,35,1)', '\d+', 1, 1) s1
,regexp_substr( '(25,23,35,1)', '\d+', 1, 2) s2
,regexp_substr( '(25,23,35,1)', '\d+', 1, 3) s3
,regexp_substr( '(25,23,35,1)', '\d+', 1, 4) s4
from dual
S1 S2 S3 S4
"25" "23" "35" "1"In pl/sql you do something like l_val:= regexp_substr( '(25,23,35,1)', '\d+', 1, 1);
If t2.att_type is type of number you will do:
t2.att_type= to_number(regexp_substr( '(25,23,35,1)', '\d+', 1, 1))Edited by: chris227 on 01.03.2013 08:00Sir,
I am using oracle 10g.
In the process of getting each number from the parm '(25,23,35,1)' , I also need the position of the number
say 25 is at 1 position.
23 is at 2
35 is at 3
1 is at 4.
the reason I need that is when I build seperate select for each value, I need to add the query number at the end of the select query.
Please see the code I wrote for it, But the select query is having error:-
BEGIN
IF(pi_flag_codes IS NOT NULL) THEN
SELECT length(V_CNT) - length(replace(V_CNT,',','')) FROM+ ----> the compiler gives an error for this select query : PLS-00428:
*(SELECT '(25,23,35,1)' V_CNT FROM dual);*
DBMS_OUTPUT.PUT_LINE(V_CNT);
-- V_CNT := 3;
FOR L_CNT IN 0..V_CNT LOOP
if L_CNT=0 then
V_S_POS:=1;
V_E_POS:=instr(pi_flag_codes, ',', 1, 1)-1;
else
V_S_POS:=instr(pi_flag_codes,',',1,L_CNT)+1;
V_E_POS:=instr(pi_flag_codes, ',', 1, L_CNT+1)-V_S_POS;
end if;
if L_CNT=V_CNT then
V_ID:=TO_NUMBER(substr(pi_flag_codes,V_S_POS));
else
V_ID:=TO_NUMBER(substr(pi_flag_codes,V_S_POS,V_E_POS));
end if;
VN_ATYPE := ' t2.att_type = ' || V_ID;
rec_count := rec_count +1;
query_no := 'Q' || rec_count;
Pls help me with fetching each value to build the where cond of the select query along with the query number.
Thank You. -
How to get the value of a parameter/field in a ADF Read-Only Form
Hi,
My requirement is as follows. Could anyone shed some light on this issue.
I am showing the records from db table using ADF Read-Only Form ( which uses ViewObject created for the table). Now I want to capture(get) the value of a field in this form and then have to invoke an action based on the value in this field. I mean to say the next page depends the value of a field in this form.
Please suggest how can I achieve this functionality?
Thanks in advance.
~SivajiThat's indeed what Sivaji needs.
In the page definition you can add a value to the parameters of a certain method. Like RJundi mentioned, point to the attribute of the current row.
Example:
The value of the read only textfield will be something like this:
#{bindings.EmployeeName.inputValue}points to an attribute value in the pageDef of the page:
<attributeValues id="EmployeeName" IterBinding="AllEmployees">
<AttrNames>
<Item Value="EmployeeName"/>
</AttrNames>
</attributeValues>The attribute value has also an iterator binding defined in the page def:
<iterator id="AllEmployees" RangeSize="10"
Binds="AllEmployees" DataControl="MyService"/>If you want to 'pass' the attribute of the current row to the service, you can create a methodaction (eg: public void printEmpName(String name)) in the page def or you can drop the method from the datacontrol on to the page. After dropping the method, a screen will appear asking to fill in a value for the parameter ('name' in this example). Fill in '#{bindings.EmployeeName.inputValue}' if you want to pass the EmployeeName of the current row.
Hope it helps,
Koen Verhulst -
How to assign bean value to a local variable in JSP using struts.
Hi everybody!
I've a problem that puzzled me on how to assign a bean value to a local variable like String in JSP using struts.
we can have someting like this to display the value
<bean:write name="detailService" property="status" />or
<bean:define id="theStatus" name="detailService" property="status"/>
This is country: <%=theStatus%>but an error occured when I tried like this:
String currentStatus = "<bean:define id="theStatus" name="detailService" property="status"/>";
or
String currentStatus = "<bean:write name="detailService" property="status" />";Is there a way to do this?.....
Any help pretty much appreciatedJava != JSP.
The <bean:define> and <bean:write> tags are custom tags meant to appear in the HTML section of a JSP file, as opposed to the scriptlet section. They actually get turned into java code as part of the translation process.
The <bean:write> tag naturally just writes out what you tell it to.
The <bean:define> tag defines a local variable, and gives it a value.
this should do it.
<bean:define id="theStatus" name="detailService" property="status" type="java.lang.String"/>
<%
String currentStatus = theStatus;
%>With the advent of JSTL, you shouldn't really need to use scriptlet code anymore. Personally I am for 0% scriptlet code in any jsp I write. -
How can assign the value returned from javascript to Hidden item
Hi All,
I have created a report with button in one column adding following code to SQL select statement like
SELECT USER_RQST_ID, USER_RQST_DESC, RQST_DATE, STATUS, USER_ID, CNTRY_ID, KPI_LIST, YEAR_LIST, QTR_LIST, MONTH_LIST,
PROD_LIST, FULL_PERIOD_FLG, GEN_DATE, '<input type=button value="view_list" onclick="javascript:doSubmit('||USER_RQST_ID||');">' button FROM KPI_USER_RQST;
Then i have implemet doSubmit() function in Javascript like
function doSubmit(req_id)
html_GetElement('HIDDEN_ITEM')= req_id.value;
Here HIDDEN_ITEM is the name of the item, I want to use that HIDDEN_ITEM value in PL/SQL block like...
BEGIN
INSERT INTO SAMPLE(KEY) VALUES(:HIDDEN_ITEM);
END;
But it is not working, Please help me anybody know the solution How to assign an item in javascript block function.
Thanks,
NeelHello,
doSubmit() is one of the built in javascript functions in apex and it's a bad idea to override it unless you know exactly what you are doing, and even then is a generally bad idea.
change your function to this
function mySubmit(pValue){
$x('HIDDEN_ITEM').value = pValue;
doSubmit();
then your onclick will look like this notice the lack of the javascript: and the three ''' quotes to get the proper quotations for your value.
onclick="mySubmit('''||USER_RQST_ID||''')"
And there you go
Carl -
SSRS How to pass a value for Hidden parameter ?
Hello,
I have a SSRS report deployed on the Report server. This report is having an "Hidden" parameter.
Could someone please guide me, how to pass the value to this internal parameter in each of the following case -
1. Report is accessed through a Desktop application/Web application in Report Viewer.
2. Report is accessed through the Url.
3. Report is accessed through the Report Manager.
Any quick help on this is highly appreciated.
Thanks!
-Vinay Pugalia
If a post answers your question, please click "Mark As Answer" on that post or
"Vote as Helpful".
Web : Inkey Solutions
Blog : My Blog
Email : Vinay PugaliaHi Vinay Pugalia,
Internal Parameters in SSRS are parameters that are not configurable by the end-user at run-time and values cannot be passed to this type of parameter (when present in the child report) in case of a drill-through report implementation. This
type of parameter is read-only and not accessible in parent report.
This varies from a Hidden Parameter, which the user is not prompted to provide, but can still be configured through the URL to the report server.
So no matter you access the report through report manager, URL or Report Viewer. The passing value to the internal parameter will not work.
As you have mentioned that I will also suggest you use the hidden parameter instead.
More details information in this blog for your reference:
SSRS – Understanding Report Parameter Visibility
How to pass value to hide parameter is the same as that of the visible parameter, similar thread for your reference:
Passing the value in action property of a text box
If you still have any problem, please feel free to ask.
Regards,
Vicky Liu
If you have any feedback on our support, please click
here.
Vicky Liu
TechNet Community Support -
How to set Default value of a parameter to display Current Date
I need to display the Default value for my parameter 'As of Date' which is of datatype Date as Current Date[DD-MON-YYYY].
How can I do This??As Tamir-L pointed out, there is no direct way to do this, but there is a workaround:
First, create a new parameter, but do not base it on any item. Give the parameter a default value of "Today".
Then, create a condition like:
( :myParam = 'Today'
AND <date_item> = sysdate)
OR ( <date_item> = to_date(:myParam, 'DD-MON-YYYY'))Where :myParam is the parameter you created, and <date_item> is the item you are comparing against.
To make things a bit more bulletproof, you could create a calculation that returns sysdate when the parameter is 'Today', a date when the to_date is successful, and NULL when the to_date fails, and use the calculation in the condition. -
How to assign attribute values to a range of BPs ????
Hi All,
While assigning attribute values to business partners we can specify at the most one business partner at a time.
My requirement is to assign attribute values to a range of business partners at a time.
Is there any customization setting where I can do this OR
do I write a report for this ?
Regards,
AshishHi Ravi,
Thanks for replying !!!!
But, CRMD_MKT_TOOLS doesnt seem to solve my problem.
I have a range of BPs (e.g 8000101 to 8000199).
And I have a list of attribute sets with values as follows:-
Attribute Set Values
Age group 1 - 10, 11 - 20, ....
Reading habits Business, sports, news.....
Profession Doctor , Engineer .......
and so on..
Now in transaction CRMD_PROF_BP, I can choose a single BP (e.g. 8000101) and assign it an attribute set(e.g. Profession) and value (Doctor).
But, my requirement is to specify an entire range of BPs(8000101 to 8000150) and assign attribute set and values to that entire range.
Now how do I achieve this ???????
(target groups would be created only after attributes have been assigned)
Regards,
Ashish
Maybe you are looking for
-
SRM PO to PI and R/3 System at the time of Creation
Dear All, We are imlementing SRM 7.0 with extended classic scenario with the different backend systems including SAP non-SAP systems. Our scenario is this when the Shopping cart is created and Ordered the PO should be Transfer to the R/3 system using
-
Pages Documents created on my iPad won't open on my MBP
My daughter has a MBP running 10.8.3 with Pages '09 v4.3. and an iPad 2 running 6.1.3 with Pages 1.7.2 that she takes to Uni. Pages documents that she creates on her MBP and saves to iCloud will open on both her MBP and her iPad but Pages documents
-
Digital Signatures in PI sheets
Hi Guys; Can anyone explain how to assign Digital Signatures to PI sheets & what are the settings required. Thanks in Advance; Rajesh
-
I received a skype video call today, and the video looked like this. Both of us could see my image just fine. They told me that before the call connected, they could see themselves properly. Once the call connected, their image became corrupted at my
-
Receive "The Page cannot be displayed" in the page header within FBL5N
I have a user that started getting "The Page cannot be displayed" error message in the web content header after running FBL5N. The computer is running SAPGUI 710 and Windows XP SP3. I have already checked the FEATURE_DISABLE_MK_PROTOCOL settings in t