Is it possible to return a value via Java for hidden CMDs
I need to build a button within a web template that will change the scaling factor of all key figures. I some Java code that will do
this but as it places the multipple commancs (one for each key field) into one URL and as this exceeds 256 chars I can only get it to work for 15 key fields.
I am therefore looking at using hidden forms to do this instead. Using the code below it works nicely for 2 defined key fields
Is this possible (or am I being stupid?)
Any advise will be appreciated.
Cheers
Shep.
Hi,
place the following javascript just under your form.
But I would recommend to build the complete form via Javascript and place it into your span tag.
This could look somehow like this:
To get an Idea how you get to the structure members I propose to have a look on
http://help.sap.com/saphelp_nw04/helpdata/en/11/c80b40c6c01961e10000000a155106/frameset.htm
Heike
Similar Messages
-
I am not able to change exportfolders value in MBeans for FRConfig.cmd for Hyperion 11.1.2 Financial reporting .
When I enter the value , it just vanishes. Am I missing something here.?
I need to set export path for PDF generation in Hyperion financial report for batches.Edit FRConfig.cmd and update
set EPM_ORACLE_INSTANCE=%MIDDLEWARE_HOME%\user_projects\epmsystem1
update epmsystem1 to the correct epm instance name
Cheers
John
http://john-goodwin.blogspot.com/ -
Is it possible to return two values to Javascript from C in Dreamweaver?
In javascript, it can do it like this:
return {
errorCode: 100,
errorMsg: "unknown error"
My question is that whether it is possible to do the same thing when javascript calling a C function?
myFunction(JSContext *cx, JSObject *obj, unsigned int argc, jsval *argv, jsval *rval)
If can, how to set the bellowing return value?
If cannot, can we return values via jsval *argv, jsval *rval)?
Thanks a lot.Hello Robert,
Check the template FM for value mappings /AIF/FILE_TEMPL_VALMAPPING.
There is only one changing parameter VALUE_OUT of type STRING.
A solution might be to get the values in an internal table with a before-mapping FM at the structure mapping level.
Do you need to creata a line in a structure mapping for every line in the internal table ?
The solution really depends on your scenario.
Best regards,
George -
How to get the last inserted Autoincrement value in Java for Pervasive DB
Hi, I need to get the last inserted auto incremented value after the record is inserted IN JAVA For ex. consider we have 4 columns for the myTable in the PERVASIVE DATABASE V10 autoid - identity column (auto increment column) userID userName pageID insertSqlExpression = insert into myTable (userID , userName, pageID) values( ? ,? ,?); prepareInsert = connection.prepareStatement(insertSqlExpression); prepareInsert .excuteUpdate; After inserting the new record how can I get the autoid value (last inserted value) in the Java. Please help me.
Thanks in advance. ArthikJavaArthikBabu wrote:
I dont have privileges to write new stored procedures in database.I need to do in the Java side only. In many databases that irrelevant. The same way you would do it in a proc can be done with the correctly conceived statement (singular.)
For ex – if we insert and then the select record's identity value as a single transaction and would this guarantee that what is returned by the select would not include inserts that another might have made?Please do not take that path unless you are absolutely certain that your database does not support any other way to do it. -
Returning multiple values with SELECT FOR LOOP
Oracle EE 11gR1
PL/SQL
OEL 5.8
===========
Would like to know how to do the following?
for x, y in (select name, street
from employees
where hire_date < sysdate - 100)
loop
In other words, is there a way to handle 2 (or more) values in a SELECT FOR LOOP structure? If not, then how to accomplish the same task.
The above does not work of course. :-)
Appreciate any and all advice.Yes, just have one name in your for loop and that becomes the equivalent of a table name and reference the columns as that name.column name
for t in (select name, street
from employees
where hire_date < sysdate - 100)
loop
dbms_output.put_line('name = '||t.name);
dbms_output.put_line('street = '||t.street);
end loop; -
Possible to start the PC via java app?
Hi,
I want to write a program, that can start the pc from suspend mode or sleep mode.
Is this possible? And if true how?
regards
OlekI have created a program in C# that firstly puts the computer in sleep mode after some time and it continues running and if some more time passes it goes into hibernate mode and shuts down...so there must be a way to wake-up the computer from sleep mode from a C# application...that's why I tell you to check on forums.microsoft.com...they have a lot of topics on C# for suspend modes...
-
Radio Buttons - returning individual values from an exclusion group possible?
Using LC Designer 7.1
Does anyone know if it is possible to return individual values from an exclusion group of radio buttons? My xml data file gives one value for the entire group, e.g.,
2
...where the second radio button was selected. But I'd prefer an output something like this...
0
1
0
etc...
Is something in this format possible?You might be better off to use checkboxes and script them to act like radio buttons (as an exclusion group). That way they'd each have an on/off value.
Regards,
Dave -
Return 2 values (string, number) multiple rows, from java stored function
I would like to return 2 values (String, number prefered but String, String will work) from a java stored function.
I was able to successfully return a varray of varchar2 values but I was wondering if it is possible to return 2 values by using a varray?
Is it even possible? I tried using combinations of types which included a varray of objects (with 2 attributes) or a type as table of objects but I couldn't figure out how in my java code to set these values. Also what would my java function return type be and what Oracle type would map to it?
Any help and examples or pointers would be great.
Thanks,
DennisThanks to all. I finally figured it out through all the pieces on the web.
Here is what worked for me. First create 2 oracle types. One object type to represent the "columns" I will pass back:
CREATE OR REPLACE TYPE COST_OBJ AS OBJECT (COST_NAME NVARCHAR2(50), COST_VALUE number ) NOT FINAL
note: make sure the "strings" are defined as NVARCHAR2 or Java will puke if it is just VARCHAR2.
Then create a table type to hold your objects defined as following:
CREATE OR REPLACE TYPE COST_OBJ_TABLE is table OF COST_OBJ
Then create the oracle stored function that is a wrapper to the java function:
CREATE OR REPLACE FUNCTION get_Costs(Name VARCHAR2, evalDate VARCHAR2, fuelCodeID NUMBER) return COST_OBJ_TABLE
is language java name
'com.costs.storedProcedures.Cost.getCosts(java.lang.String, java.lang.String, int) return oracle.sql.ARRAY'
Once that is done, Oracle is ready. The Java function looks something like this:
public ARRAY getCosts(String name, String evalDate, int fuelCodeID) {
DBAccess da = getDBAccess();
// get a handle on the connection
Connection conn = da.getConnection();
// The stuff that will be returned should be as type object array
// make it to the size of the number of fuelcomponents passed in
Object[] returnStuff = new Object[3];
// create the type of struct that is defined on the database
StructDescriptor structDesc =
StructDescriptor.createDescriptor("CY_UMAP.COST_OBJ", conn);
for (int i = 0; i < returnStuff .size(); i++) {
Object[] costValues = new Object[]{
"This is object " + i,
new Integer ( i ) };
STRUCT cost_obj = new STRUCT(structDesc, conn, costValues);
returnStuff[i] = cost_obj;
ArrayDescriptor x_ad = ArrayDescriptor.createDescriptor (
"CY_UMAP.COST_OBJ_TABLE", conn);
ARRAY x_array = new ARRAY(x_ad, conn, returnStuff);
return x_array;
I hope this helps others.
Dennis -
Can the main return a value?
is there a way for the main to return a value?
possible something with the concept like public static void main -> public static int main?
(it has been tested and doesnt work)
i would like to have the main return an integer or boolean value.
help plz?
rwerSystem.exit(some_number);
doesnt work, it doesnt even compileIt does if you use it correctly. Apparently you didn't, or literally coded 'some_number' instead of taking it as an example.
and im pretty sure System.exit is a void functionSo? It ends up setting the process's exit code, so that the caller of the process may get that value.
I just want to know if its possible to return a value
from the main
changing "void main" to "int main" and having a
return 0; something that looks like
public static void main(String[] args) throws
Exception {
return 0;
will compile but will not run, im just looking for
ways to do this, any help would be nice...As stated before, no. But since the JVM is the one who calls main() and isn't going to do anything with such a return code, what good would it do? -
Whee the function return the value store in java
in c if i write this program
int add()
return 1;
main()
add();
if i run this program it give s error that lvalue required
but in java it works fine though the function return some valuein c if i write this program
int add()
return 1;
main()
add();
if i run this program it give s error that lvalue
requiredYou mean, if you try to run it as a C program it gave an error?
Then take your question to a "C" discussion forum. This is Java.
>
but in java it works fine though the function return some value
In Java this does NOT work fine.
It definitely does not compile! So you cannot run it. -
Failed to connect to MDM via Java API
Hi,
I wrote a very simple application in which there is a view which
calls the component contoller. The Component Controller
connects to MDM Repository.
I think I am wrong with the calling of Component from Web Dynpro view.
As, the code resulting in no error or success.
Please suggets something.
public void getRepositoryConnection( java.lang.String hostName, java.lang.String repositoryName, java.lang.String userId, java.lang.String passWord )
//@@begin getRepositoryConnection()
// create connection pool to a MDM server
String serverName = "kolapon.HCLT.CORP.HCL.IN";
ConnectionPool connections = null;
try{
connections=ConnectionPoolFactory.getInstance(serverName);
catch(ConnectionException e)
{ e.printStackTrace();
return;
// specify the repository to use
// alternatively, a repository identifier can be obtain from the GetMountedRepositoryListCommand
repositoryName = "KaushikRepo";
String dbmsName ="MDM";
RepositoryIdentifier reposId = new RepositoryIdentifier(repositoryName, dbmsName, DBMSType.ORACLE);
// get list of available regions for the repository
GetRepositoryRegionListCommand regionListCommand = new GetRepositoryRegionListCommand(connections);
regionListCommand.setRepositoryIdentifier(reposId);
try{
regionListCommand.execute();
catch(CommandException e)
e.printStackTrace();
return;
RegionProperties[] regions = regionListCommand.getRegions();
// create a user session
CreateUserSessionCommand sessionCommand = new CreateUserSessionCommand(connections);
sessionCommand.setRepositoryIdentifier(reposId);
sessionCommand.setDataRegion(regions[0]); // use the first region
try {
sessionCommand.execute();
} catch (CommandException e) {
e.printStackTrace();
return;
String sessionId = sessionCommand.getUserSession();
// authenticate the user session
String userName ="kaushikb";
String userPassword ="taton";
AuthenticateUserSessionCommand authCommand =
new AuthenticateUserSessionCommand(connections);
if(authCommand!=null)
wdComponentAPI.getMessageManager().reportSuccess("Success");
else{
wdComponentAPI.getMessageManager().reportWarning("Failure");
authCommand.setSession(sessionId);
authCommand.setUserName(userName);
authCommand.setUserPassword(userPassword);
try {
authCommand.execute();
} catch (CommandException e) {
e.printStackTrace();
return;
// the main table, hard-coded
try{
GetRepositorySchemaCommand getRepositorySchemaCommand = new GetRepositorySchemaCommand(connections);
getRepositorySchemaCommand.setSession(sessionId);
getRepositorySchemaCommand.execute();
RepositorySchema repositorySchema;
repositorySchema = getRepositorySchemaCommand.getRepositorySchema();
TableId tableId= repositorySchema.getTable("MDM_BUSINESS_PARTNERS").getId();
RecordFactory.createEmptyRecord(tableId);
//RecordFactory.createEmptyRecord(mainTableId);
if(tableId!=null)
wdComponentAPI.getMessageManager().reportSuccess("It is success");
else{
wdComponentAPI.getMessageManager().reportWarning("Failure");
catch(Exception ce)
ce.printStackTrace();
// catch(SessionException se)
//se.printStackTrace();
//@@end
Regards
Kaushik BanerjeeHi Jitesh,
getRepositoryConnection() is my method which does the connection.
Now, there are methods as :
getFields
public FieldId[] getFields()Get array of field IDs for all populated records.
Returns:
array of field IDs. Empty array is returned if any field was populated
getFieldValue
public MdmValue getFieldValue(FieldId fieldId)
throws java.lang.IllegalArgumentExceptionGet value of the specified field.
Parameters:
fieldId - field ID
Returns:
field value
Throws:
java.lang.IllegalArgumentException - if field with specified ID does not exist or was not populated
I want to use all these methods.
So, I need to declare these methods in the Controller Class and these methods will call themselves so, that I can achieve the real purpose of creating records, getting values from the field and getting field Ids etc.
Regards
Kaushik Banerjee
Edited by: Kaushik Banerjee on Apr 28, 2009 7:09 AM -
I Need to Return Two values or more from Function, Is this possible?
Below is the offending query, I am trying to pass v_bu and v_po to this function, and after validations then return v_count and v_action is this possible in a function? I am having problem returning two values.
see below code
function po_edi_func(v_bu purchase_order.business_unit_id%type,
v_po purchase_order.purchase_order_number%type)
return number as pragma autonomous_transaction;
v_count number;
v_ctdel number;
v_action varchar2(1);
begin
select count(*)
into v_count
from sewn.purchase_order
where business_unit_id=v_bu
and purchase_order_number =v_po;
if v_count > 0 then
select count(*)
into v_ctdel
from sewn.purchase_order
where business_unit_id=v_bu
and purchase_order_number =v_po
and purc_orde_status = 1;
if v_count <> v_ctdel then -- ALl PO's Cancelled--
v_action := 'U'; -- - NOT ALL PO DELETED --
else
v_action := 'D'; -- DELETED ALL PO--
end if;
else
v_action := 'I';-- New PO INSERT--
end if;
commit;
return v_count;
end;Paul,
This is becoming a nightmare to me, can you look at the below and tell me where I am having a problem
This is the Function below
CREATE OR REPLACE function po_edi_func(v_bu sewn.purchase_order.business_unit_id%type,
v_po sewn.purchase_order.purchase_order_number%type,v_action_out OUT VARCHAR2)
return number as pragma autonomous_transaction;
v_count number;
v_ctdel number;
v_action varchar2(1);
begin
select count(*)
into v_count
from sewn.purchase_order
where business_unit_id=v_bu
and purchase_order_number =v_po;
if v_count > 0 then
select count(*)
into v_ctdel
from sewn.purchase_order
where business_unit_id=v_bu
and purchase_order_number =v_po
and purc_orde_status = 1;
if v_count <> v_ctdel then -- ALl PO's Cancelled--
v_action := 'U'; -- - NOT ALL PO DELETED --
else
v_action := 'D'; -- DELETED ALL PO--
end if;
else
v_action := 'I';-- New PO INSERT--
end if;
commit;
v_action_out := (lpad(v_count,8,'0')||lpad(v_action,1,' '));
return v_action_out;
end;
and this is how I am calling it from my trigger which has to pass the v_bu and v_po values to be used in extracting data and returning the records
see below
if po_edi_func(v_bu,v_po) <> '' then;
v_count:= (substr(v_action,1,8));
v_action := substr(v_actione,9,1);
else
v_count:=0;
v_action := 'I';
end if;
I need the extracted values of v_count and v_action for my app to reset some values -
Returning several values from a C native method
Hi,
I need to return 3 values from a native methode : an int (the return code), a string of variable length and a double.
In pure C, my function would be defined as "int f ( char* s, double* d)", and I would "malloc" the string into the calling function, then copy my string to "s" and use "*d" to return the double...
Is there a way to do that with JNI? I found some examples where the native function returns only one parameterlike: "return(*env)->NewStringUTF(env, buffer);" But I didn't find examples where the native function returns several parameters, including a string.
Thanks in advance!
JMThis really has nothing to do with JNI.
You have a method, and you want to return more than one type of value.
The following solutions are possible.
1. Return an array that contains all the values (actual return value.)
2. Return an object that contains all the values (actual return value.)
3. Use an array via the parameter list and fill in a value.
4. Use an object via the parameter list and fill in the values. -
Pl/sql package for use with workflow will not return a value
hi all,
just trying to intercept a requisition being turned into an order if it uses a certain cost code. so i have amended the workflow and created a package to check what cost centre a requisition is using. how over the workflow stops on the function that calls the package witha a status of complete as if the package is not returning any values.
the package is as below:
CREATE OR REPLACE PACKAGE APPS.xxhccWFcapitalcheck AS
procedure XXHCC_CHECK_CAPITAL(itemtype in varchar2,
itemkey in varchar2,
actid in number,
funcmode in varchar2,
resultout out NOCOPY vARCHAR2);
END xxhccWFcapitalcheck;
CREATE OR REPLACE PACKAGE BODY APPS.xxhccWFcapitalcheck AS
procedure XXHCC_CHECK_CAPITAL(itemtype in varchar2,
itemkey in varchar2,
actid in number,
funcmode in varchar2,
resultout out NOCOPY varchar2 ) is
x_progress varchar2(100);
x_resultout varchar2(30);
l_doc_mgr_return_val VARCHAR2(1);
l_doc_string varchar2(200);
l_preparer_user_name varchar2(100);
doc_manager_exception exception;
p_test varchar2(100);
l_req_id varchar2(30);
CURSOR p_line_id IS
SELECT
codes.segment2 cost_center
FROM
po_requisition_headers_all headers,
po_requisition_lines_all lines,
po_req_distributions_all dist,
gl_code_combinations_v codes
WHERE
headers.requisition_header_id = lines.requisition_header_id
AND
lines.requisition_line_id = dist.requisition_line_id
AND
dist.code_combination_id = codes.code_combination_id
AND
headers.segment1 = l_req_id;
line_rec p_line_id%rowtype;
BEGIN
-- Do nothing in cancel or timeout mode
--if (funcmode <> wf_engine.eng_run) then
-- resultout := wf_engine.eng_null;
-- return;
-- end if;
l_req_id := wf_engine.GetItemAttrNumber (itemtype => itemtype,
itemkey => itemkey,
aname => 'DOCUMENT_NUMBER');
--FOR line_rec in p_line_id
---loop
open p_line_id;
fetch p_line_id into l_doc_string;
close p_line_id;
IF p_line_id= 'Q9DEF'
dbms_output.put_line p_line_id;
Then resultout := 'COMPLETE:F';
return;
p_test := 'USE DIFFERENT CODE';
ELSE
resultout := 'COMPLETE:T';
return;
END IF;
END LOOP;
end;
END xxhccWFcapitalcheck;
any help would be great!Hi Community, first of all, english is not my native language and im not sure to use the correct terms for PowerCenter - so if im wrong please help me correct and make clear what we need. We have a kind of 3-steps ToDo. First step: Load data from an external source into a "local" datastore (its an oracle db on a server in our "hands")Second step: Check data against several verifications, this is done with a PL/SQL Package. The PL/SQL Package shall be called with an Interfacename who is set in the First PowerCenter Mapping. Our current thoghts are to do this via a stored procedure, which runs as "Target Post Load" and gets a variable "Interface Name".Is that possible? Im not quite sure about it. About the last part its even more unclear how we can solve it:Third part should be switch back to PowerCenter now - and the package (or to be correct a function in the package) should return a value for "okay everything fine => workflow continue" or "something happened => workflow is stopped" Im not sure how i can handle this. I hope my explanations are good enough so you can provide some help?!If there are any questions please ask! Thank you alot, best regards, Christian
-
I get an error -626 and ndsconfig returns a value of 78.
Hello guys,
Here is a brief summary of the network design. We have a School server in the Network A. The Main eDir is in a Network B.
The school server to access the Main eDir goes through a DNAT configured on our firewall.
During the different steps I can browse my ldap on the main eDir without any issue.
This to complete the information about Existing Tree Information, Local Server Configuration and Linux User Management Configuration for example.
However, at the moment of the eDir configuration (I use the GUI) the software returns an error -626 and ndsconfig returns a value of 78.
Our issue seam to arise when using the NCP for replication I guess. The questions are: is it possible to DNAT NCP and if it is what is missing?
Of course, if I were installing another server on the Network B and try with the same settings it will work.
I have seen in different posts that replication is not possible through NAT. However I can't find anything regarding the ncp protocol that would explain why our DNAT shouldn't work.
I opened these ports.
389 LDAP
636 LDAPS
524 NCP
427 SLP
8443 iManager
8009 NRM
8030 iMonitor
8028 iMonitor
Is there a formal documentation that I can relate to?
Thank you in advance and I wish you already a great weekend.It could potentially work, but normally it does not work unless you do
some really interesting stuff with routing. Here is why:
When one server looks up how to reach another server, the way that
referral is given includes the target server's IP address, as seen by the
target server. As a result, if you are on 17u2.16.0.1 for serverA, and
you ask to talk to serverB which has address 192.168.0.1, the referral
(within the NCP packet) will tell the server to access 192.168.0.1. Since
neither 172.16.x.x nor 192.168.x.x are routable normally, and since you're
using DNAT, the addresses won't get to their destination and you have a
connection problem (-626).
The ability NCP has to provide addresses to clients and servers via
referrals, NDS Pings, and the like is really powerful because it means, in
a network that allows it, that any client/server can find any
replica-hosting server to be accessed directly. The downside of this is
that technologies which mess with the network layer by hiding IP addresses
break the way clients would access servers.
LDAP, for example, doesn't usually report anything about how to reach a
server. Normally a client knows which server to ask from the very start
and then goes there. Even with eDirectory, if an LDAP client accesses an
eDirectory server that does not have a replica of the desired object, then
by default the eDirectory server (not the LDAP client) goes and follows
referrals to find and return the object.
For these reasons, NAT is normally not supported between eDirectory
servers. Could you make it work? Probably assuming you can get your
routers to handle things properly, but it's going to be more than just
dropping things in place and hoping they work, and it will be more than
just allowing TCP/UDP ports through.
Good luck.
If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below...
Maybe you are looking for
-
Trying to reinstall CS5 onto new pc after laptop started acting up
Hi, I had purchased the CD for Photoshop CS and then eventually upgraded/downloaded to CS2 and did the same in April 2011 for CS5. I have the license number and the 'program" on an external hard drive where I saved everything, but when I click the s
-
Certificate Widget-Changing the Score
I searched through previous entries and it looks like this question may have already been touched on, but I need more clarification. I have a tutorial that was shot in manual recording mode, showing screen shots from within an application. I have "ex
-
I know this has been beaten to death, but if I want to view a PDF at maximum size there doesn't appear to be a way to do it (other than manually dragging the corner.) The justification for the non-maximizing behavior of the green button seems to be "
-
I have the Linksys BEFW11S4 ver.4 wireless router. I have reset the router (held reset for 30 secs. and power-cycled for 1 min.) and am trying to edit the wireless security settings. I have also updated the firmware to the most current version (1.52.
-
How do you keep attachments from rotating when they come in on the side
You keep attachments on your email from rotating when they come in sideways