How to read container variable in UDF
Hello expert,
I have created a container variable(var_callerId) in an integrationprocess.
In a mapping I want to read the container variable with an UDF.
Can anyone send me the code for the UDF please ?
I can't find the solution in any post message / blog.
Thx for your help!
Best regards,
Juergen
Hi navneet,
thanks for your fast reply.
Let me explain why I wanted to use container variables:
(Perhaps there is a better way to fix the requirement)
I've following IP
Message Interface (input)
<getData>
<callerInfo>
<callerID>SYSA</callerID>
<SessionID>43545455545355</SessionID>
<number>3434344334</number>
</callerInfo>
</getData>
Then I have a mapping (<number>) to call a webservice.
I get the data from the webservice.
At last I will send the data back to the business System.
But I need the both tags from the input interface (SessionID, callerID) again, to send it back.
I tried a mapping to map sessionID and callerID from the input interface to the output interface, but it doesn't work.
So I thought I can store the sessionID and callerID in a container variable and in a mapping I will get it back with an UDF.
I think there should be a possiblility to get the stored value from the container variable inside the IP. But I don't find any solution.
I don't understand your solution with the global container. How can I access to the container variable(IP).
Thx for your help
Best regards
Juergen
Similar Messages
-
How to read url variable javascript problem
How to read the variable of latitude 1.22 and longitude 103.56.
This is my website: 127.0.0.1/1/map2.htm?latitude=1.22&longitude=103.56
function getUrl_Map()
//Get the variables in the URL
var vars = [], hash;
var latitude = getUrlVars()["latitude"];
//To get the second parameter
var longitude= getUrlVars()["longitude"];
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
alert('DEBUG: hashes= ' + hashes);
// read the file http://127.0.0.1/1/map2.htm
// read the file http://127.0.0.1/1/map2.htm? -->hashes
for(var i = 0; i < hashes.length; i++)
hash = hashes.split('=');
//alert('DEBUG: i= ' + i);
//i=0
alert('DEBUG: i= ' + i + 'hash = ' + hash );
vars.push(hash [0]);
vars[hash [0]] = hash [1];by the way you know that 127.0.0.1 is the address you use to get to your own computer right? It's the loopback address. so posting it doesn't really help anybody see the page, if that was what you were hoping.
-
How to read a variable within a VC code. I am using BADI based VC code.
How to read a variable within a VC code. I am using BADI based VC code.
Lets say I have a variable for a fiscal period that holds cumulative month.
If user enters 03/2014 in that variable, it will have month starting from Jan till March.
Within VC code I would like to read the last month which is
03/2014 and based on this month I would like to do some calculation on all the records using the last month.
Since VC code runs for one record at a time and there is no way I can store this value.
Is there a way to go about it....any suggestions would be of great help.
Thanks.Any suggestions would be highly appreciated.
Thanks! -
How to Decalre Global Variable in UDF
Hi All,
Can you please help me, how to declare a Global variable in UDF.
I am using SAP PI 7.0.
Regards,
Manian.Hi manian,
Have a look this thread:
Global Variable - How to Set and Access
Carlos -
How to read Environment Variable in Java.
Hi,
I am trying to read a environment variable $TMP which has a value of /apps/bea/pt847/psoft5/tmp in UNIX.
I have written the following code and getting Null pointer exception when calling the method logmessage. Any help with reading environment variable is appreciated.
public static void logMessage(String message) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss ");
Date now = new Date();
Properties p = null;
try
p = getEnvVars("$TMP");
System.out.println("the current value of TEMP is : " + p.getProperty("$TMP"));
catch (Throwable e) {
e.printStackTrace();
try
BufferedWriter os = new BufferedWriter(new FileWriter("/tmp/pscas_signon_log.txt", true));
os.write(formatter.format(now));
os.write(message);
os.write("\n");
os.write("tmp_env = " + p.getProperty("$TMP"));
os.write("\n");
os.close();
catch(IOException _ex) { }
public static Properties getEnvVars(String env_var) throws Throwable {
Properties envVars = new Properties();
Process p = Runtime.getRuntime().exec(env_var);
BufferedReader br = new BufferedReader( new InputStreamReader( p.getInputStream() ) );
String line = null;
while( (line = br.readLine()) != null ) {
int idx = line.indexOf( '=' );
String key = line.substring( 0, idx );
String value = line.substring( idx+1 );
envVars.setProperty( key, value );
// System.out.println( key + " = " + value );
return envVars;
}Updated code:
public static void logMessage(String message) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss ");
Date now = new Date();
Properties p = null;
try
p = getEnvVars("$TMP");
System.out.println("the current value of TEMP is : " + System.getProperty("$TMP"));
catch (Throwable e) {
e.printStackTrace();
try
BufferedWriter os = new BufferedWriter(new FileWriter("/tmp/pscas_signon_log.txt", true));
os.write(formatter.format(now));
os.write(message);
os.write("\n");
os.write("tmp_env = " + System.getProperty("$TMP"));
os.write("\n");
os.close();
catch(IOException _ex) { }
public static Properties getEnvVars(String env_var) throws Throwable {
Properties envVars = new Properties();
Process p = Runtime.getRuntime().exec(env_var);
BufferedReader br = new BufferedReader( new InputStreamReader( p.getInputStream() ) );
String line = null;
while( (line = br.readLine()) != null ) {
int idx = line.indexOf( '=' );
String key = line.substring( 0, idx );
String value = line.substring( idx+1 );
envVars.setProperty( key, value );
// System.out.println( key + " = " + value );
return envVars;
}and this is the error message..
java.io.IOException: $TMP: not found
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:72)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Runtime.java:602)
at java.lang.Runtime.exec(Runtime.java:461)
at java.lang.Runtime.exec(Runtime.java:397)
at java.lang.Runtime.exec(Runtime.java:359)
at SimpleCasValidator.getEnvVars(SimpleCasValidator.java:108)
at SimpleCasValidator.logMessage(SimpleCasValidator.java:81) -
How to read a variable from a java program?
Hey guys
I don't actually have a single clue about java itself. I usually use other languages. But i need to get the value of a variable/label from a java program.
After googling a bit i installed Java Access Bridge to get some more info how to find that value. Using JavaMonkey i got following accessibility info:
AccessibleContext information at mouse point [0, 0]:
Name: Spin:
Description:
Role: label
Role in en_US locale: label
States: enabled,focusable,visible,showing
States in en_US locale: enabled,focusable,visible,showing
Index in parent: 0
Children count: 0
Bounding rectangle: [421, 152, 598, 169]
Top-level window name: WEedit
Top-level window role: frame
Parent name:
Parent role: panel
Visible descendents count: 0
This label contains a value that i need. I'd like to write it to a textfile periodically or put it into the clipboard. Shouldn't be more than some lines of code.
Would appriciate any help.
Thank you and merry christmasNachtschicht wrote:
Well, i play google for you: http://java.sun.com/javase/technologies/accessibility/accessbridge/
So you tell me you can't extract any information out of this?
AccessibleContext information at mouse point [0, 0]:
Name: Spin:
Description:
Role: label
Role in en_US locale: label
States: enabled,focusable,visible,showing
States in en_US locale: enabled,focusable,visible,showing
Index in parent: 0
Children count: 0
Bounding rectangle: [421, 152, 598, 169]
Top-level window name: WEedit
Top-level window role: frame
Parent name:
Parent role: panel
Visible descendents count: 0
You don't have any hint, how i as a non-java programmer can access data out of a simple java program?No. That's a horrible way to interact with a program. A better way would be if it exposed some API. Or there was a web service you could call, for example. -
How to read shared variables inside event structure ?
Hi,
I have a problem that my shared variables do not update inside event structure. The program(s) I am trying to get working is seen in the attached screenshot. It works as follows:
0. I start the vi that is unsquared.
1. I write a string to a shared variable using vi in red square. I make sure that its updated using write-wait-read.
2. I run the other vi (blue square), this changes the boolean shared variable.
The unsquared vi has been running the whole time, it has event structure bind to boolean shared variable change (the one in blue vi). After I have runned the blue vi, the unsquared vi should change the indicator values to match the ones in red vi. However I have to start the blue vi multiple times to get it to change, sometimes even 6 times.
Also, when I change the value in red vi to a third value and start blue vi multiple times, the unsquared vi shows all the variables. I.e. I put "cat" to red then start red, put "mouse" to red then start red,... and then start clicking blue... Unsqured shows cat, mouse,..., dog (dog is the default).
How can I force the shared variable to update inside event sructure. I want the current value of the variable, not some historical values.
Attachments:
Screenshot-5.png 108 KBFound the buffering... disabling it solved the problem... thanks.
FYI, there is another solution that I just found out... attached. Adding timeout to the event structure and the variable read outside the event structure... This makes the shared variable strings (one that is read outside and the otherone that is read inside) different.
Could someone explain why the variables are in different state even if they are used in the same place and looped with 10ms intervals?
Juha
Attachments:
Screenshot-6.png 110 KB -
How to read environment variable
How do I read an environment variable within TS?
I was thinking of calling getenv("VARIABLE_NAME") except it returns a char * and TS only allows Boolean or Numeric return type.
I wonder if LV has any function for doing the same thing.With the new ability in TestStand 4.2 to get the standard output from a command line, you can do this with a call executable step.
Simply call cmd.exe as the executable, and pass it the following expression. Then all you have to do is set Locals.EnvironmentVariableName to the name of the environment variable you want the value of and define where you want the standard output to be stored.
"/C \"echo %"+Locals.EnvironmentVariableName+"%\""
I'm attaching a sequence file that shows this. The attachment is necessarily saved in TestStand 4.2, since it uses a feature introduced in that version.
Josh W.
Certified TestStand Architect
Formerly blue
Attachments:
get env var.seq 6 KB -
How to read static variable defined java class from flex?
This is a beginner question. If I use remoteClass to map a java class and a flex class, how can I access a static variable defined in java class from the flex code?
Thanks!Static propeties are by default ignored in the blazeds for serialization. You can try using another global property in the java bean which maps to the value stored in the static property( Hopefully it should work)
eg,
public String instanceValue = ClassName.staticValue;
Ref: http://livedocs.adobe.com/blazeds/1/blazeds_devguide/help.html?content=serialize_data_3.ht ml -
Accessing container variable of BPM in Message Mapping function
Hi,
I have a scenario in BPM where i have a container variable that is used as a loop counter.I want to access that counter defined , every time when i go around the loop and perform certain actions based on that counter. so how can i access that variable in my message Mapping function.Hi Sudharshan,
check these links, hope they give you the required information (i think there is some problem with SDN site, check these links after a while)
Re: How to use Container Variable across Maps
Container object in Message Mapping
Copy value of container (abstract interface) to an other container
Regards
Vishnu -
How to read response from WebService call
Hi,
I am consuming webservices in ABAP. I got proxy classes created. Port is also created.
I am calling classes generated by proxy in ABAP. Classes creates few structure by system. when i make a call to service, I am not getting importing values in veariables declared. Trace file (in SOAMANAGER ) shows call successful & XML file shows the correct response values, but are not appearing in program variables. I declared variables of same type generated by system.
My question is, am I missing any step.configuration? or how to read the variables?
Thanks in advance.
SunilYou coud create a procedure like this:
CREATE OR REPLACE PROCEDURE soap_env_pr (p_soap_env IN VARCHAR2)
IS
v_start NUMBER;
v_end NUMBER;
v_message VARCHAR2 (400);
v_length NUMBER;
BEGIN
v_start := INSTR (p_soap_env, '<ns0:Ok>');
v_length := LENGTH ('<ns0:Ok>');
v_end := INSTR (p_soap_env, '</ns0:Ok>');
v_message :=
SUBSTR (p_soap_env, v_start + v_length, v_end - v_start - v_length);
HTP.prn ('Ok: ' || v_message);
v_start := INSTR (p_soap_env, '<ns0:SessionNumber>');
v_length := LENGTH ('<ns0:SessionNumber>');
v_end := INSTR (p_soap_env, '</ns0:SessionNumber>');
v_message :=
SUBSTR (p_soap_env, v_start + v_length, v_end - v_start - v_length);
HTP.prn ('SessionNumber: ' || v_message);
v_start := INSTR (p_soap_env, '<ns0:ErrorMessage>');
v_length := LENGTH ('v_length');
v_end := INSTR (p_soap_env, '</ns0:ErrorMessage/>');
v_message :=
SUBSTR (p_soap_env, v_start + v_length, v_end - v_start - v_length);
HTP.prn ('ErrorMessage: ' || v_message);
END;and call it like this:
BEGIN
soap_env_pr
('<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/>
<env:Body>
* <invokeScenarioResponse xmlns:ns0="xmlns.oracle.com/odi/OdiInvoke/" xmlns="xmlns.oracle.com/odi/OdiInvoke/">*
* <ns0:Ok>true</ns0:Ok>*
* <ns0:SessionNumber>2223201</ns0:SessionNumber>*
* <ns0:ErrorMessage/>*
* </invokeScenarioResponse>*
</env:Body>
</env:Envelope>'
END;That would give you this output:
Ok: true
SessionNumber: 2223201
ErrorMessage:Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://apex.oracle.com/pls/otn/f?p=31517:1
http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
------------------------------------------------------------------- -
Read shared variable using D/3 DCS
This is a rather odd question.. I think it can be done, but I have not yet figured how.
A client has a DCS System (I believe from NovaTech), which communicates with a database.
They use a different PC to get data from a cFP using Shared Variables.
There is mention of data being sent over a Modbus Interface.
They want to know if it is possible to read the Shared Variables directly using their DCS System. If the DCS was from NI, it would probably be easier to accomplish. However, I am not at all acquainted with the NovaTech product, but I believe there must be a way to innterface to it. Probably using Data Sockets and/or PSP Protocol.
I realize the above is rather obscure... I have sent an email requesting more info and I am preparing the next email. I figured that I'd better do some background investigation and ask proper questions.
Has anyone attempted such a thing or similar? How about reading Shared Variables from Non-NI software? I did find some threads discussing reading/Writing (to/from) Shared Variables using LabWindows-CVI, but I suspect this will be quite different. Maybe I'm wrong..Thanks Christian.
I will continue in this thread after I find out more details from the client.
RayR -
How to read a whole text file into a pl/sql variable?
Hi, I need to read an entire text file--which actually contains an email message extracted from a content management system-- into a variable in a pl/sql package, so I can insert some information from the database and then send the email. I want to read the whole text file in one shot, not just one line at a time. Shoud I use Utl_File.Get_Raw or is there another more appropriate way to do this?
how to read a whole text file into a pl/sql variable?
your_clob_variable := dbms_xslprocessor.read2clob('YOUR_DIRECTORY','YOUR_FILE');
.... -
How to Access a BPM container variable in XI graphical message mapping
Hello XI BPM and Mapping experts,
is it possible to access a BPM container variable from an graphical mapping?
If yes, how ?
We need this for the following scenario:
IDOC to BPM.
BPM transforms and sends transformed IDOC to fileadapter
If both steps are successful a STATUS.SYSTAT01 IDOC should be send back to SAP-ISU with status 06.
If one of these steps fails the status in the SYSTAT01 should be set to 05. (Exception branch of block)
We want to avoid to write 2 mapping programs for mapping the SYSTAT01.
Instead we would like to use a BPM Container Variable which contains the status.
In the mapping for the SYSTAT01 we want to use this Container Variable.
Is this possible?
Thanks for soon answers.
Regards MarliesHi Marlies,
Is not possible to acces a BPM container variable from graphical mapping. For other hand, you can to use runtime variables for this purpose.
You could create an abstract interface with a message type having a single node with the required value and using this message in other mapping.
Best regards
Ivá -
How do I program Instrument I/O Assistant to read a variable in the input string?
How do I program the Instrument I/O Assistant to read a variable in the input string? I can manually type in the string using the Instrument I/O Assistant using the "Write" or "Query" tools but I do not know how to send a variable input to the Instrument I/O Assistant so that variable can be used inside the "Write" string. For example, I have a power supply whose current I want to set to X Amps. I can type the command "PC10" to program the current to 10 Amps, however I want to be able to program it at any arbitrary current. How do I feed the value X into the code for this purpose?
You can't. The assistant was designed to be a quick and dirty way to do some basic communication with an instrument. You can turn it into a VI (right click and select Open Front Panel) and modify it so that your write string is an input to the VI or use it as a template and create your own code with VISA Read and Write primatives.
Maybe you are looking for
-
Photoshop CS2 and windows issues! help!
Hi, I'm working with someone who is having issues with Adobe Photoshop CS2 among other Adobe problems. The problem is that after Photoshop is loaded, the interface is very messed up. You can't open a file because if you go to menu -> file nothing h
-
My address book will not show when I click on the TO or CC button, a mozilla page does open but there is no content. My E-mail accounts work fine on other computers. It also works fine on this computer if I use Explorer instead.
-
I want to use google when I type to search in the main bar and wikipedia on the small search bar on the right. However, they both seem to use the same search engine, depending on which one I've chosen on the small search bar. I want them to use diffe
-
Hello, I have a few hidden items on my page that contain some HTML code from a table. I wanted to display their value in a HTML region, at specific places, so I tried to use the &item_name. method inside my HTML code. The problem is that the referenc
-
Plant assignment to Sales Org..
Hi Gurus Can you pl let me know how can I see the Sales Org link to Plants without going into cusomization i mean SPRO.. Thanks in advance Points will be rewarded.. BR