Function library in PI 7.1 - retrieval of filename
Hi,
I am trying to use the function library functionality in PI 7.1 but struggling a bit.
Basically, I want a function for the retrieval of the filename - pretty easy in goold old UDF days but not so easy now everything has moved to the function library world in PI 7.1
I have defined the following code in the "init" Function and Java Areas:
DynamicConfiguration conf = (DynamicConfiguration) container.getParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
//For getting filename
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
//For getting directory
DynamicConfigurationKey key2 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
// Retrieve the filename
String FileName = conf.get(key1);
// Retrieve the directory
String Directory = conf.get(key2);
This is working ok - but I want to return these values so they can be used in mapping.
when I try to add the statement return FileName; , the compiler then complains with the following error:
cannot return a value from method whose result type is void return FileName;
But where do you define the result type for a method ????? I guess it has something to do with the signature variables but I am a bit lost.
Any help greatly appreciated.
Thanks
Colin.
Hi
Function type Void is not going to return value. It has be String type to return value. Check the function again
Also this documents provides good info on mapping in PI 7.1
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f06d11f2-e7c2-2a10-04a9-f2f6f374cd29
Thanks
Gaurav
Similar Messages
-
PI 7.1 function library
Dear All,
We are working on PI 7.1 EHP1, we have implemeted the functionality of Function Library having common place for UDFs. We have seperate SWCV for this.
We are using these UDFs in other SWCV's mapping and working well in DEvelopement Server.
When we have transported this to Production Server, it is giving following error.
"Linkage error while loading class com/sap/xi/tf/_Invoic02_InvoiceDataService_MM_; java.lang.NoClassDefFoundError: Extend/GeneralUDFs"
Here, Extend is the name of the SWCV and GeneralUDFs is the name of Function Library.
Please help
with regards,
Ravi SiddamWe have seperate SWCV for this.
We are using these UDFs in other SWCV's mapping and working well in DEvelopement Server.
Working in DEV because you would have created Dependencies between the SWCVs....is the same thing (dependency) available in PROD.
Regards,
Abhishek. -
Unable to edit Function Library
Hi all,
I am unable to edit a function library I created. I always get a NullPointerException:
There is no syntax error in the included functions. The Library is activated, but it is also not found by the runtime. When I send a test message I get an error that the used functions were not found.
I have already tried to create another function library. I am able to create and activate it, but get the same error when I try to edit it.
I am working on a Java single-stack.
Any suggestions?I already tried this.
But the main problem ist: When I am in ESR in the function library and klick the Edit-Button, I get the error message shown above. So I am not able to edit any function library.
What could be the problem? I already tried:
- To remove all special characters from the name and description of the function library
- To create a new namespace with a new function library -
i have made an xquery function library which incorporates the add_month function of sql.
add_months($date as xs:dateTime,$value as xs:int) as xs:dateTime?
But while using this function in a let clause in xquery:
let $nextMonth:= ns1:add_months(fn:current-dateTime(),xs:int("1")) i am geting this error;
add_months": unbound external function. Improper use of the user-defined SQL function .It's "improper" as none of the arguments come from that database, therefore ALDSP will not push it to the database.
This computation can be done in XQuery - what you want to do is to add a YearMonth style 'duration' to the date.
If you go to w3.org, click on Xml Query, click on the 'Functions and Operators' link, then look for in section 10.8.4. Notice this is an 'op' - an operator. It is not a function and you cannot call it directly. Notice the last line in the description - it says it 'backs up the + operator' - so that's how you use it - by using the + operator.
So -
A YearMonth duration of 0 years 1 month is
xs:yearMonthDuration("P0Y1M")
so what you want is :
fn:current-dateTime() + xs:yearMonthDuration("P0Y1M")
If you had a genuine need to call a database function with arguments that did not come from that database, you could do so by creating a New -> Physical Data Service -> Relational -> SQL Statement. -
Creating function Library in PI 7.1
Hi All,
I have a requirement in which I need to write a function library which taking field value as input and returning the concatenation of the entire field.
For Example
Node 0-----unbounded
Field 1 1--1
Field 2 1--1
Field 3 1--1
Field 4 1--1
Field n 1--1
My Question is how can I give input to the function as number of field is not fixed. i.e I want to take N no of input and concat.
Thanks
NavneetHi Sumeet,
I am not sure how Function Library concept will address your issue.
Function Library is to make the UDFs available to other message mappings.
Coming to your requirement, the data can be dynamic, but the structure should be static.
In other words, you should always know the number of fields in a node. How can it be dynamic?
If it is dynamic, how do you define your source message type / data type etc?
Regards,
Ravi Kanth Talagana -
Function to function referencing in Function Library
If you have many functions within your function library, is there a way to reference another as to not have redundant code? Or is each function within the library completely separate?
Yes, I know i can simply copy the code out of a specific function and add it into another functions code, but I am hoping for an option that allows for easier, one location, maintenance.
Thanks in advanceHi Daniel,
To achieve You want, you need to define each function as static. Then You can cal the function of this way:
import mypackage.myFunctionclass;
public class mycomplexFunctionClass{
private void complexfunction(){
int a = myFunctionclass.function1();
/*It is not necessary to instance the class, only add the correct reference taking account the correct
and complete class name(it includes the package)*/
Regards
Ivan -
User Function Library for Crystal Reports 10 doesn't work on Win2K3 SP2
Hi,
Recently, we have been facing problem with Crystal Reports 10 developer edition on Windows Server 2003 R2 Service Pack2.
The user function library concept doesnu2019t seem to be working on Windows Server 2003. We had installed CR10 Service Pack 6.
We have a UFL written in VB 6.0 and this UFL is used in a formula in one of our reports.
Whenever this report is invoked, the application crashes with a page fault. Dr Watson log files points to a crash occurring in Crystal Reports component.
To reproduce this problem:
1) Create a UFL in VB 6.0
2) Use the UFL in a formula in a report
3) Create a VB 6.0 application and use CR 10 Report Viewer control
4) Invoke the report from the application
5) The application crashes on Windows Server 2003 (SP2).
This is a high priority issue.
Is there any other alternative to User Function Library?
Any help on this will be very much appreciated.
Thanks in advance.Hi,
Recently, we have been facing problem with Crystal Reports 10 developer edition on Windows Server 2003 R2 Service Pack2.
The user function library concept doesnu2019t seem to be working on Windows Server 2003. We had installed CR10 Service Pack 6.
We have a UFL written in VB 6.0 and this UFL is used in a formula in one of our reports.
Whenever this report is invoked, the application crashes with a page fault. Dr Watson log files points to a crash occurring in Crystal Reports component.
To reproduce this problem:
1) Create a UFL in VB 6.0
2) Use the UFL in a formula in a report
3) Create a VB 6.0 application and use CR 10 Report Viewer control
4) Invoke the report from the application
5) The application crashes on Windows Server 2003 (SP2).
This is a high priority issue.
Is there any other alternative to User Function Library?
Any help on this will be very much appreciated.
Thanks in advance. -
Reg include generated in function library
Hi Experts,
I have three include generated while creating maintanance view
THIS FILE IS GENERATED BY THE FUNCTION LIBRARY. *
NEVER CHANGE IT MANUALLY, PLEASE! *
INCLUDE LZZMEDRUCK_SPU01.
"ZUS_ME_PRINT_PO_SP1
INCLUDE LZZMEDRUCK_SPU02.
"TABLEFRAME_ZZMEDRUCK_SP
INCLUDE LZZMEDRUCK_SPU03.
"TABLEPROC_ZZMEDRUCK_SP
All these includes are created in function group zzmedruck_sp.
I need to delete these includes.
Thanks in Advance,
SashtiThose include programs for Function modules but these function modules can be used by Table maintenance
JUST open function group check if there any function module exists.
ZZMEDRUCK_SPU01/2/3 or any other that is using the same includes
try to delete those function module from SE37 but check the dependencies
of function module.
INCLUDE LZZMEDRUCK_SPU01-----Just comment it in the main include
I think there are dependencies for that reason you cannot delete it
Create a new one and use it
Regards,
Gurpreet -
Unknown type in include generated by the function library?
Hi,
I have an include LZSHIP$01, that is generated by the function library.
* THIS FILE IS GENERATED BY THE FUNCTION LIBRARY. *
* NEVER CHANGE IT MANUALLY, PLEASE! *
INCLUDE LZSHIPV01 .
FUNCTION $$UNIT$$ Z_SHIP_STATUS_PLANNED
IMPORTING
VALUE(I_TKNUM) TYPE !VTTK-TKNUM
VALUE(I_COMMIT) TYPE !COMMIT_FLG DEFAULT 'X'
VALUE(I_REVERSE) TYPE !CKML_MODE_REVERSE DEFAULT ' '
VALUE(I_LOCK) TYPE !DO_LOCK DEFAULT 'X'
VALUE(I_VTTK) TYPE !VTTK_ALV
VALUE(I_ZVTTK) TYPE !ZVTTK
EXCEPTIONS
!RV_SHIPMENT_READ
!ENQUEUE_EVVTTKE
!SD_SHIPMENT_HEADER_CHANGE
!SD_SHIPMENTS_SAVE .
but I get the error that type do_lock doesn't exist. Now I can't create do_lock, because the name doesn't start with Y or Z, and I can't replace the type do_lock by another type in the include, because the include is generated by the function library, and I can't change it manually.
How do I fix this? thx!go To SE37 : Z_SHIP_STATUS_PLANNED.
go to Export Parameters Tab and Chnage Types reference there with desired one instead of DO_LOCK. -
Have a 4th gen, Nano. Original iTunes library was on old computer that no longer works. Was able to access iTunes on new laptop but songs were greyed out tried to get them released w/o success. Got a pop up message requesting permission to allow access for new computer. Entire library vanished and cannot seem to retrieve. Is there any way to retrieve the library? HELP!
If it's slow on startup it would be extensions loading or LaunchDaemons starting up.
You should have a look in:
/Library/LaunchDaemons
/Library/Extensions
You can count out anything in your home folder and it shouldn't put anything in /System as that's reserved for Apple. -
I inadvertently trashed my Iphoto library. Can I retrieve it, like one can restore to an earlier time period on Windows? I trashed it but I did not use secure trash.
if you are running Time Machine - launch it and go back to the time you want, select the iPhoot library and click restore
Step 1 - launch Time Machine (either click on it in the DOCK or double click on it in the applications folder)
Step 2 - in the resulting window (which looks like a finder window) go back in time to when your iPhoto library had not been trashed
Step 3 - select the iPhoto library at that time (by default it is in your pictures folder)
Step 4 - Click on "RESTORE" and restore the iPhoto library from before it was trashed
Step 5 launch iPhoto (click on iPhoto in the DOCK or double click on it in the applications folder)
You do not copy or directly access the TM backup - as noted you use TM to restore the iPhoto library
Additionally, I would assume that I should start from scratch. Access and delete/trash all the pictures that I've since imported from a disk that I had save them too a year ago, in effect leave Iphoto empty before attempting any restore/import of the file, if possible. Yes?
No do not delete anything until this is all sorted out - and if you restore properly you certainly will not have to start over
LN -
Sorry if this is a dumb question, but from what I gather from various examples I've seen online the User Exit piece of MDT lets you specify a script that can contain a library of *multiple* functions right? So what if I have two User Exit Scripts I want
to use in MDT? Do I just copy the functions I want into a single user exit script and only reference that or is there a way to reference two user exit scripts in customsettings.ini?Those two routers don't have USB ports nor similar. Unless you have a network printer you cannot connect the printer to the network. You have to connect the printer to a computer and use printer sharing to make it accessible from the LAN.
If the printer only has a wired network interface you must run a wire to the LAN. You cannot use the wireless routers to create a wireless bridge. You must run a wire between them to make any use of those two routers. But of course, if you run a wire anyway you could simply connect the network printer directly to the WRT. -
Ringtones lost--not showing up at all in library. Can they be retrieved?
After switching pc's and having numerous email problems on my iphone resulting in deleting the account a few times, all of my ringtones are now gone. The songs are still in my library, but nothing under the ringtones tab. Is there any way to get them back? Does Itunes have a record of my purchases so that I could recreate them and not be charged again as long as I use the same songs/sounds? Any help would be appreciated! Dana
Since you switched pc's you need to get that ringtone file onto your new pc and then add to iTunes. You did back up your music...right? Apple does keep a file of what you downloaded and in extreme cases(their fault) they will give you a credit to download that particular file again. But for the most part, you cannot download lost music simply because you switched pcs. That's why it is imperative that music and all files are backed up on external drives, CD-Rs, DVD+Rs, etc.
HTH -
DSP - how to use Function Library
hi all,
ALDSP is returning the following error code:
*weblogic.xml.query.exceptions.XQueryDynamicException: ld:br/com/DSL.ds, line 59, column 274: {err}XP0002 [{bea-err}XP0002a]: Current node needed, but not defined (or $ missing preceding a variable name)*
I created a physical data source(DSP) based on a oracle function.
In my Logical data source (DSL), I have the following code:
for $bla in proc:BLABLA_MYFUNCTION($endereco/COD_COMPL1,$endereco/TXT_COMPL1,$endereco/COD_COMPL2,$endereco/TXT_COMPL2,$endereco/COD_COMPL3,$endereco/TXT_COMPL3,$endereco/COD_COMPL4,$endereco/TXT_COMPL4,null,null,null,null,null)
return
<ns1:Address>
<ns1:tipoEndereco?>a constant string</ns1:tipoEndereco>
<ns1:endereco?>
<end:numeroEndereco?>{fn:data($endereco/NUM_ENDERECO)}</end:numeroEndereco>
*<end:complemento?>{fn:data($bla)}</end:complemento>*
<end:referencia?>{fn:data($imovel/TXT_REFERENCIA)}</end:referencia>
</ns1:endereco>
</ns1:Address>
i tried to use
+<complemento>+
+ {+
+ for $x in fun:FNTH_OBTEM_ENDER_PRINCIPAL($EQUIPAMENTO/ID_EQUIPAMENTO)+
+ return $x+
+ }+
+ </complemento>+
instead, but i got the same error.
does anyone can help me?
Edited by: virgulino on Jul 6, 2009 5:44 PM
Edited by: virgulino on Jul 6, 2009 6:01 PMA variant is a very specific LabVIEW datatype (really a C++ type object internally) and trying to pass that to a function, which excepts a flat memory pointer there, for sure will crash very quickly.
As to endianess, yes Unflatten will be able to adjust for endianess, which in this case however is most likely exectly NOT what you want. So make sure that the you select native type for the endianess input on Unflatten from String. LabVIEW internally works with whatever is the native endianess, as will most likely your C++ DLL. The platform independent big endian format does only come into play when you receive data streams over some streaming interface like a network connection. Here it is desirable to use an endian format that is independent from the actual platform that generates and consumes the data stream. LabVIEWs default endianes is big endian here.
But as long as you pass data directly to native components like DLLs there is no difference in endianess between what LabVIEW uses and what those components use.
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions -
I fear I may have deleted ALL my photos!!! When opening iPhoto it stated that the photos were damaged. By creating a new photo library, I now cannot find the old photos in the Pictures file. I think I really screwed up!!!
Download and run Find Any File to search for "Library6.iPhoto" on your hard drive. That's a file that is in every iPhoto library. And Find Any File can search inside packages as areas that Spotlight can not.
See if you find more than one of those files. If you do then you can find out where that other library is. If there's only one found click on the Desktop to get to the Finder and use the Go ➙ Go to folder... menu option. Enter in the window /Volumes.
When you created the new library did you get this window where you were to either accept the default name that iPhoto presented or rename the new library?
Click to view full size
OT
Maybe you are looking for
-
Print data in two line in the same column
Hi, In a tabular Report I want to print a column (eg:Description,) in two lines in the same cell. Since the description is too long. Is it possible in report 6i. Or any other solution for this? Please reply.
-
I got a new computer and somehow have lost some of my more recently purchased and or imported music. I have some of that music on an iphone and some on an ipad. How do I get the music from those devices into my itunes library without losing everyth
-
My home computer is no longer working. How do you addf your Iphone 4 to a different computer for updates and sync?
-
Is there a plug-in I am missing or that I can get?
This may seem silly....please don't flame me. I tried to get on the disneyland web site to order tickets, check prices. I cannot get the page to work. I have tried this at home and on my laptop running safari 3.0.4 It runs ok on my friends pc. I do n
-
HTM attachment in a mail has a wrong format/characters in IE
Hello guys. When receiving mails from the ECC6 system, the HTM attachment opened with Internet Explorer has a bad formatting and strange characters. I'm not an ABAP developer, so I would like to understand if this has something to do with the ABAP co