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
Similar Messages
-
Webdynpro - how to add global variables and common proj to existing proj
How to add global variable in either ViewController or CustomController. We realise that codes must be added within the begin and end exction. Codes outside that will be deleted when saved.
How can we add a common WDP project to an existing project? We have actually added a common wdp project at the project references screen. But during runtime, we encouter error. The error is classNotFoundException. The class is the class created in the common project.Hi.
I think you need to assign ProB to ProA.
Step1.
Open propety of ProjectA.
Step2.
Select WebDynproRefrences
Step3.
Select Sharing references
Step4.
Choose add button.
Step5.
If your projectA named "testapp" and you are not using
DC "local/testapp" is the proper name.
I hope that it work!!!. -
How to debug global values in UDF in a graphical mapping
Hi Every one,
I got a situation in PI where i have to use global values in graphical mapping UDF.
I can't able to get the values in "Display Queue " option.
Can you please tell me what is the best way of debugging global variable in graphical mapping UDF.
1. I declare one array list in the global values
2. store some values using another UDF to the arraylist.
3. I am traversing the values in the arraylist, but the values are not showing in "Display Queue".
What is the solution to this.Did you try with trace.addInfo?
https://help.sap.com/javadocs/NW04/current/pi/com/sap/aii/mapping/api/AbstractTrace.html
Sample code for the setMail UDF (Carrier B2B) - Business Process Expert - SCN Wiki -
How to change Global variable in the query
Hi,
I have 6 reports which is using 0PDT as a global variable and has single option as a property. Now I want to change this property and have multiple selection but I am not able to change its property.
I am able to see all the filter variables from the query property and from there I am getting edit option to change but the "single selection" option is grey/disable which is preventing me to make change in this variable. Is there any way that I delete this variable and create a local variable which has date range option.
This is affecting all my reports and all the report needs date ranges instead of single select option.
Thanks,
ShivaniShivani,
You can change the restrictions with new variable(right click on required infoobject and choose restrict -->> choose variables -->> move existing variable from right to left and move new variable. Then you can see only one variable.
You can not delete any variable if is using in some queries.
how to restrict:
Srini<a href="http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a563fe09411d2acb90000e829fbfe/content.htm">Restricting Characteristics</a> -
How to decalre the variable.
HI all,
I have decalred a variable mard-LABST
Data: v_labst type mard-lasbst.
But when i check syntactical check it was showing syntactically wrong.
can any body please tell me how to decalre.Hi all,
This is my code. can you please check in u r editors.
tables: mard.
Types: begin of ty_NTGEW,
Matnr type matnr,
labst type labst,
lgort type LGORT_D,
end of ty_NTGEW.
data: v_ntgew type standard table of ty_ntgew,
wa_ntgew type ty_ntgew.
data: v_ntgew1 type standard table of ty_ntgew,
wa_ntgew1 type ty_ntgew,
v_open like wa_ntgew.
data: v_test type mard-labst.
Select MATNR
labst
lgort
From MARd up to 10 rows
Into corresponding fields of table V_NTGEW
where labst NE '0.000'.
loop at v_ntgew into wa_ntgew.
v_open = wa_ntgew.
move v_open-labst to v_test.
Replace all occurrences of '-' in v_test with ''.
Replace all occurrences of CL_ABAP_CHAR_UTILITIES=>CR_LF in V_test with ''.
write:/ v_test.
move v_test to v_open-labst.
write:/ v_open-labst.
endloop. -
How does a global variable affect the runtime of optimisation-function fminsearch?
Hi,
my function "fmintest" needs 254s ~ 4min to finish calculation in Mathscript, while Matlab needs
3s!!! I need the sorfware for data processing in a real time measuring system, where the calculation have to be done within 5 seconds.
In the Mathscript-help I found the following (global -> details):
If you call this function from a MathScript Node, LabVIEW operates with slower
run-time performance for the MathScript Node. To optimize the performance of the
MathScript Node, remove this function from scripts.
How can I remove needed global variables in the fminsearch function handle? Is the system faster if I would/can remove the global variables?
How can I avoid Mathscript-breakdown after saving changes to m-files and restarting them again?
regards
Attachments:
ni3.7z 2 KBHi,
can you provid a VI and not only your m-files? It will be easier to help you!
Can the customer provide a VI that demonstrates this behavior, rather than just providing the m files?
Also, the Help file says fminsearch is not supported by the
LabVIEW Run Time engine, so please take that in mind. If you want to build an application you cant use this function.
Regards, RMathews -
Each time I restart my application, I would like all global variables to be reset to their default values without having to reset each one individually. Can I do this? If so, how?
Sure you can do it. Enclosed is a VI which checks all VIs in memory and reinitializes any that are of type Global VI.
Attachments:
Reinit_Globals.vi 22 KB -
How to print global variable in smart form table cell
hi,
i have smartform and i insert table in it, i also have set global variable, i want to show variable in table cell.
regards
shahid raisHi Shahid Rais
You can use this global variable that has been declared in anywhere as you like.
For displaying global variable in table lines, You can first set the column and row of the table by using the table tab in table node . Then, u can decide either the variable u want to used will be placed on header, main, or footer. After that, right click on one of the table part, and choose create table line. After choosing the correct line type as already been declared in the table painter, just simply right click on the table cell, and then create text node.
You can now enter your variable by using "insert field".
And don't forget the & & signs before and after your variable name.
Regards,
William Prawira -
How to modify global variable in a function?
Hello,
I want to modify a globalvariable in a function, at first I did it this way:
class Global_output_class
GlobalDim("Correlation_Status,fail_part,End_Exp")
dim pouet
Correlation_Status = 12
Call Correlation()
pouet = Correlation_Status
Function Correlation()
Dim Global_output_class_sub
Set Global_output_class_sub = new Global_output_class
Correlation_Status = 1
fail_part = 2
End_Exp = 3
Global_output_class_sub.CorrelationStatus = Correlation_Status
Global_output_class_sub.failpart = fail_part
Global_output_class_sub.EndExp = End_Exp
set Correlation = Global_output_class_sub
End function
In this case: correlation_status receive the value 12, then I go to my function correlationn() where it became 1
Then it goes out of the subfunction and takes the previous value from the program(12) ( I dont want that)
To solve the problem I made it this way:
class Global_output_class
public CorrelationStatus
public failpart
public EndExp
end class
GlobalDim("Correlation_Status,fail_part,End_Exp")
Correlation_Status = 12
Set Global_Output = Correlation()
Correlation_Status = Global_Output.CorrelationStatus
fail_part = Global_Output.failpart
End_Exp = Global_Output.EndExp
pouet = Correlation_Status
Function Correlation()
Dim Global_output_class_sub
Set Global_output_class_sub = new Global_output_class
Correlation_Status = 1
fail_part = 2
End_Exp = 3
Global_output_class_sub.CorrelationStatus = Correlation_Status
Global_output_class_sub.failpart = fail_part
Global_output_class_sub.EndExp = End_Exp
set Correlation = Global_output_class_sub
End function
This way my global value are recopied in themselves after leaving the subprogram
I got a lot of variables, is there any easier way so the global variable modified in a function keep the value after leaving the function?
Thanks for help,
Fred
Solved!
Go to Solution.Hi Fred,
it is possible to use a global defined variable but the better way is to use to use a funtion call (or procedure call) with parameters. Please find first the good solution for a funcion call with parameter and the sub-optimal way with an global valiable:
dim oParameter
set oParameter = new cGlobal_output_class
oParameter.Correlation_Status = 12
msgbox "Correlation_Status before Call Correlation: " & oParameter.Correlation_Status
Call Correlation(oParameter)
msgbox "Correlation_Status after Call Correlation: " & oParameter.Correlation_Status
Function Correlation(oPara)
msgbox "Correlation_Status in the FUNCTION before change: " & oPara.Correlation_Status
oPara.Correlation_Status = 1
oPara.fail_part = 2
oPara.End_Exp = 3
msgbox "Correlation_Status in the FUNCTION after change: " & oPara.Correlation_Status
End function
class cGlobal_output_class
dim Correlation_Status,fail_part,End_Exp
end class
call GlobalDim("oPouet")
dim oPouet
set oPouet = new cGlobal_output_class
oPouet.Correlation_Status = 12
msgbox "Correlation_Status before Call Correlation: " & oPouet.Correlation_Status
Call Correlation()
msgbox "Correlation_Status before Call Correlation: " & oPouet.Correlation_Status
Function Correlation()
msgbox "Correlation_Status in the FUNCTION before change: " & oPouet.Correlation_Status
oPouet.Correlation_Status = 1
oPouet.fail_part = 2
oPouet.End_Exp = 3
msgbox "Correlation_Status in the FUNCTION after change: " & oPouet.Correlation_Status
End function
class cGlobal_output_class
dim Correlation_Status,fail_part,End_Exp
end class
Greetings
Walter -
How to pass global variables to call stored procedure in form personalizati
Hi,
We want to call a custom store procedure with 2 paramterts, I am storing values into 2 global variables.
We want call the custom store procedure with global variable values in form personalizations.
We tried like
='declare
begin
SUR_TEST_ORDER_LINE_UPD.update_order_line (:global.xx_line_id, :global.ship_set_id);
end'
Could you please suggest.
Advance Thanks
SubbuHi,
Doc number (MOS Doc 743490.) is avaiable in metalink or ?Yes.
Note: 743490.1 - Customization in Oracle Applications
https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=743490.1
Regards,
Hussein -
How to declare global variables using another global variable in ODI
I am declaring a gloabal variable using another global variable.
say for example:
I have a global variable empid.
I am decalaring another global variable empname in refreshing tab of global variables and the select statment is
select empname from emp where empno = #GLOBAL.empid -------if i write like this i am getting error as invalid character.
select empname from emp where empno = '#GLOBAL.empid'-------if i write like this i am getting error as invalid number.
I have kept the datatype as numeric and action as non persistent
Please help
Thank you in advance.Hi,
You cant test/refresh empname standalone.
You need to create a new package drag and drop both variables and make them as refresh variable and execute that package and test.
Flow,
empid----> empname
Thanks,
Guru -
How define a global variable in a class that all the methods will recognize
hi friends,
i need to define a global variable in a class that all the methods will recognize it.
any suggestions?
thanks,
dana.Dera Dana,
In se24, create your own "Z" class.
Open the Attributes tab.
Insert your variable in the declaration part.
EQ:
Attribute Level Visibility Typing Associated Type Description
ITAB Instance Attribute Public Type Structure name Description
In the Layout of View page,
<phtmlb:formLayoutDropDownListBox id = "Dropdown"
label = "Drop Down"
table = "<%= controller->Itab %>"
nameOfKeyColumn = "CODE"
nameOfValueColumn = "VALUE"
selection = "<%= controller->feild to be selected %>"
/>
Hope this will be helpful
Regards,
Gokul.N -
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,
JuergenHi 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 -
How to difine global variable in Formula node?
I want to access the same vailable in different formula nodes, so I need to define a global or external vailables? How can I do this?
Formula Nodes are distinct environments from each other. You will have to define the global constant in each node. Or make it a variable and wire your values to the variable input node on each of the formula nodes.
-
Simple Question -- How to use global variables in an another function??!
Function named globalLeftMargin that has:
Global NumberVar LeftMargin := 5;
HOW DO I USE THIS IN ANOTHER FUNCTION? B/C IT DOES NOT RECOGNIZE IT AND GIVES THIS ERROR:
The ) is missing.
The other function is:
Space(LeftMargin)Hi Ajay,
Add WhilePrintingRecords at the beginning of each formula like:
WhilePrintingRecords;
Global NumberVar LeftMargin := 5;
WhilePrintingRecords;
Global NumberVar LeftMargin;
Space(LeftMargin)
Good luck,
Brian
Maybe you are looking for
-
Full range of power levels on GPU? (Radeon Mobility X1400, I think)
As per wiki article, power levels can be set to a range of mid to high, or to low, but not a range of low to high. Auto is documented as never going low, and dynpm simply doesn't. I can't seem to find a way to seamlessly utilize the low clock/voltage
-
I just got the new Macbook Air and was wondering if this adapter will work with the Thunderbolt port? http://store.apple.com/dk/product/MB572Z/A?fnode=MTY1NDA3Ng&mco=MTA4NDU0NjA#over view - Mads-hk
-
I have successfully managed to move my itunes media file from my windows pc to my new mac and all is well. However, of course it hasnt copied my itunes, its just copied all the stuff in it. So information about the number of times a song has been pla
-
Tag structure lost while combining multiple PDF files
Hi All, As per client requirements, we have been using ABBYY Fine reader to create PDFs. After creating multiple PDFs of a huge book (separated logically according to Units consisting diff Chapters), we have tagged them correctly. We need to know put
-
I just bought an OFFICEJET PRO 860 by hp and have downloaded Smart Print . However, I am thinking that Smart Print does not work with iMac's or MacBook Pro's. Can someone please tell me if my feelings are correct. I cannot get either download to