Lookups on UDFs

We have added some UDFs to Business One (2005 SP01) which we have supporting UDTs for, and the UDFs are used on Document Lines for various document types including POs and AP Invoices.
We would like to provide lookups and validations on these UDFs.  One complication is that the list of valid values is conditional on other values on the line, and so may be different from line to line.
One option is combo boxes which would be tidy, but there seems to be no way to change the UDFs to be combo box type fields.
The other option is to create a ChooseFromList object.  Is there a good code sample available that illustrates the techniques involved:
- creating a Choose From List on a UDF
- populating it based on particular conditions
- return the selected vale to the originating control
We would be grateful for any help on this.

- validations on UDF: you can add valid values or you can
do this from UI by catching the VALIDATE event and attach
your validation logic to this event. ComboBox looks the
cleanest way of doing it, you could visualize your UDFs
as combos too
- CFL: there is documentation on the e-learning material
available here on SDN and samples too available

Similar Messages

  • RFC Lookup in UDF

    hi gurus,
    i'm  facing  a weird problem, i have implmented three scenarios IDOC  - > FILE, inside each mapping i created an UDF
    that call an RFC function that brings me an accounting value, the rfc call another FM : LAST_DAY_IN_PERIOD_GET.
    of course i give the UDF some parameters the BS, the name of CC.
    my probleme is in quality environment, randomly in some of those three scenarios,  the rfc brings me a null value.
    and i dont why and how to solve this issue.
    thanx in advance for your help.

    this the error
    Errorcom.sap.aii.mapping.lookup.LookupException: Problem when calling an adapter by using communication channel CC_RFC_FM_Out_3 (Party: , Service: BS_FP_QR0_210, Object ID: b790616ffd613ba9ad31f8ac8a610754) XI AF API call failed. Module exception: 'error while processing the request to rfc-client: com.sap.aii.af.rfc.afcommunication.RfcAFWException: RfcAdapter: receiver channel has static errors: can not instantiate RfcPool caused by: com.sap.aii.af.rfc.RfcAdapterException: error initializing RfcClientPool:com.sap.aii.af.rfc.core.repository.RfcRepositoryException: can not connect to destination system due to: com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: Connect to SAP gateway failed Connect_PM TYPE=A ASHOST=retail-qua SYSNR=70 GWHOST=retail-qua GWSERV=sapgw70 PCS=1 LOCATION CPIC (TCP/IP) on local host with Unicode ERROR partner '10.255.2.23:sapgw70' not reached TIME Tue Sep 21 05:46:16 201 RELEASE 700 COMPONENT NI (network interface) VERSION 38 RC -10 MODULE nixxi.cpp LINE 2513 DETAIL NiPConnect SYSTEM CALL connect ERRNO 79 ERRNO TEXT A remote host refused an attempted connect operation. COUNTER 6 '. Cause Exception: 'RfcAdapter: receiver channel has static errors: can not instantiate RfcPool caused by: com.sap.aii.af.rfc.RfcAdapterException: error initializing RfcClientPool:com.sap.aii.af.rfc.core.repository.RfcRepositoryException: can not connect to destination system due to: com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: Connect to SAP gateway failed Connect_PM TYPE=A ASHOST=retail-qua SYSNR=70 GWHOST=retail-qua GWSERV=sapgw70 PCS=1 LOCATION CPIC (TCP/IP) on local host with Unicode ERROR partner '10.255.2.23:sapgw70' not reached TIME Tue Sep 21 05:46:16 201 RELEASE 700 COMPONENT NI (network interface) VERSION 38 RC -10 MODULE nixxi.cpp LINE 2513 DETAIL NiPConnect SYSTEM CALL connect ERRNO 79 ERRNO TEXT A remote host refused an attempted connect operation. COUNTER 6 '.

  • How to give query in lookup type udf in OIM 11g

    Hi,
    In OIM 9.x, we were able to provide query in lookup type field in users UDF to fetch data from DB and display it in lookup table.
    Where as in OIM 11g, I cant find that option. We need to provide user id in lookuptype field based on some query. Please let me know where we can do the same in OIM 11g.
    Thanks,
    Kalpana.

    In OIM 9.x, we had below query in one of the lookup type attribute:
    select usr.usr_udf_empid,usr.usr_first_name,usr.usr_last_name from usr where usr.usr_emp_type='Full-Time' and usr.usr_status='Active' and usr.USR_UDF_EMPID is not null
    The lookup used to show firstname, lastname & employee id of active employees in the lookup.
    Where we can achieve the same in OIM 11g?
    Thanks,
    Kalpana.

  • Acess "set-cookie" and set later in lookup in UDF?

    Hello Experts,
    I' have a senario where I need to get a session ID in order to handle a series of web service request. Therefore I have written a UDF in the mapping where the first method (as login message) where I get a login key as payload and the session-id in the response header. This session Id then needs to be set before several other calls within the same udf are made to the webservice. We are not able to use the Axis-adapter and therefore have to use the normal SOAP-adapter.
    My question now is, is there any way to access the header of the first response message? I need to read the returned session-id and then write it to the other requests. Any idea?
    regards
    Christian

    Hi Mark,
    for sure I can post the UDF. This UDF that I have written is a generic UDF that I call from several other UDF's where ever I need to create a lookup:
    AbstractTrace trace = container.getTrace();
    String returnValue = "";
    try {
      Channel channel =  LookupService.getChannel(party,communicationComponent, communicationChannel);
      SystemAccessor accessor = LookupService.getSystemAccessor(channel);     
      InputStream inputStream = new ByteArrayInputStream(requestXMLString.getBytes());
      XmlPayload payload = LookupService.getXmlPayload(inputStream);
      Payload SOAPOutPayload = null;  
      /*The SOAP call is made here and the response obtained is in the SOAPOutPayload.*/     
      SOAPOutPayload = accessor.call(payload);   
      /* Parsing the Returnvalue     */
      InputStream inp = SOAPOutPayload.getContent();     
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();   
      /* Build DOM Structure for Input XML */     
      DocumentBuilder builder = factory.newDocumentBuilder();     
      Document document = builder.parse(inp);  
      /* Set the XML-Tag for the Response  */     
      NodeList list = document.getElementsByTagName(requestXMLValueTag);
      Node node = list.item(0);     
      if (node != null)
       node = node.getFirstChild();
       if (node != null)
        returnValue = node.getNodeValue();          
    } catch (Exception e)
      trace.addWarning("Error" + e);
    return returnValue;
    So within this function I need to access the set-cookie and then set it accordingly. If have you have any suggestions I'm very happy to hear about it.
    I don't think that I can use your link that you posted as I don't have a URLConnection-Object
    Can you show us your UDF? Maybe this blog can help:
    Simple Way to Get HTTP Response Header in Java • Crunchify
    regards
    Christian

  • Message Mapping UDF for lookuping of a value inside field's list of values

    Hey everyone,
    For a FI mapping I'm working on, I was wondering if somebody has some Java UDF which lookups for a value inside the whole list of values which the mapping gathered for a specific field?
    Thanks,
    Ben

    source code --
    //write your code here
    JCO.Repository myRepository;
    // Change the logon information to your own system/user
    JCO.Client myConnection = JCO.createClient(
    // all the client information namely client ,user id pwd etc
    myConnection.connect();
    // create repository
    myRepository = new JCO.Repository( "SAPLookup", myConnection );
    // Create function
    JCO.Function function = null;
    IFunctionTemplate ft = mRepository.getFunctionTemplate("xxxxx"); //Name of RFC
    function = ft.getFunction();
    // Obtain parameter list for function
    JCO.ParameterList input = function.getImportParameterList();
    // Pass function parameters
    input.setValue( a , "xxxxx" ); //import parameter of RFC, a is input argument.
    myConnection.execute( function );
    String ret = function.getExportParameterList().getString( "XXXX" ); //export param
    myConnection.disconnect();
    return ret;
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a03e7b02-eea4-2910-089f-8214c6d1b439
    File Lookup in UDF
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/xi/file%2blookup%2bin%2budf
    Lookupu2019s in XI made simpler
    /people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
    SAP XI Lookup API: the Killer
    /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    Webservice Calls From a User Defined Function.
    /people/bhavesh.kantilal/blog/2006/11/20/webservice-calls-from-a-user-defined-function

  • OIM 11g  UDF of UI type Lookup not reflected in Self Service Profile Page

    I created one UDF of type lookup in admin console. published the sandbox. Then I logged in self service console and created a new sandbox. I wanted to make udf visible in self service page so I started customizing the create user page. But the newly created udf is not visible under userVO.
    Steps to re-produce the issue:
    1. create a new sandbox in admin console. create a new udf of type lookup. publish the sandbox.
    2. login to self service console. create a new sandbox and start customizing. go to create user page. click on customize. select source and select the panel to add the udf. select data component catalog, select userVO. Under this userVO, my newly created UDF is not visible.I cant find my new lookup type udf. I can see the udf created in usr table in DB.
    Please let me know if anybody have faced similar issue and its resolution.
    Thanks,
    Kalpana.

    can you check whether remaining custom UDFs are appearing?
    Is it a problem just with Lookup UDF type?
    Also, this sandboxes are very error prone. So you need to make sure only 1 person is working during 1 specific work with sandbox

  • Lookup Code value switch automatically in case of same decode value

    Hi,
    We have create a simple Lookup type UDF on OIM user profile. The lookup value contains the different code value for same decode value like 1-->Project Manager, 2-->Project Manager, 3-->Project Manager. Now the issue is that if someone goes form the web console and edit the user (just click on edit and then save it back without making any change), this lookup field value switch to default code value for 'Project Manager'. Let's say if OIM internally assume 2 as default code value for 'Project Manager' (not sure how OIM maintains it internally), If we follow the edit process for a user who has '3' as code value then after save the value in the database change to '2'. The same happens for user with '1' as code value as well. Now mapping multiple code values to same decode is very common where you need to integrate OIM with legacy systems where multiple key values assigned to the Job title/positions with same description. Has anyone came across this scenerio in past and found any solution. Please help. We tried by using lookup querry as well but no luck. We are using 9102 BP02 OIM. Thanks

    First thing first
    Why do you need 3 entries in the lookup for the same vaule? It's only a confusion to the end-user to select which one.
    Now....
    In case you have some compelling situation, just try to have some differentiation for the decode value; like 1~Project Manager, 2~Project Manager, 3~Project Manager. This way confusion may be obviated and so as the issue.

  • Database Lookup ?

    Hi Guys,
    I have RFC-SOAP scenario working properly. I get a status code back from the 3rd party system in one of the response field and i need to map this to one of the field in RFC.
    The status codes maintained in the sql server database on the 3rd party system are in 100's, so i think i need to perform a DB Lookup and UDF in the response mapping.
    Do i need to create the table structure in XI ? or i can directly pull the message for the corresponding field.
    I have a single argument and single result message like
    100 -- success & 200-  Failure. I think i need not use the advanced function?
    I am following the web blog as below for the DB lookup.
    /people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
    any suggestions would be appreciated
    Thanks,
    Srini

    Hi,
    You don't need to create the structure in XI for this scenario.
    Accessing data from an external database is the objective of DB lookup. You will be doing this via UDF. Under the UDF code you will be using the communciation channel derived for triggering the query with SQL database.
    Under the UDF only you will get the field values from database. You can refer the code used in the blog you are currently referring.
    Here you can see UserID and Passwords are validated.
    Simialr way you can get the data of status code
    Thanks
    Swarup

  • Mapping lookups - RFC API

    Hi
    I have cr8ed rfc lookup in UDF,and I want to parse this xml and use only the value I need
    I read in the forum that there are 2 ways of doing it :
    DOM and SAX
    any1 knows good weblogs/threads which ellaborates on how or explain how it should b done ?
    thx,Shai

    Hi Shai,
    This blog and article deals with calling your RFC from your JAVA MAPPING / User Defined Function.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/801376c6-0501-0010-af8c-cb69aa29941c
    /people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
    And now going to the next half of your question regarding SAX and DOM parsers....
    The user defined functions that you write in your Graphical Mapping has nothing to do with Java Mapping.
    In your Graphical Mapping, the parsing of source structure is handled interannly by XI.
    But, when you go for an explicit mapping technique like Java Mapping, you have to parse the source XML structure, so that you can write the logic for your mapping.
    Java Mapping will execute a method called Execute, that will take the source XML structure as the Input Stream and then, you have to parse the Input STream and to do this parsing, you use SAX or DOM parser.
    DOM processor loads the entire XML into the memory and is processor intenseive, SAX does it element by element and so is not processor intensive.
    If you are using SAX parser, there are 5 methods . They are:
    1) Start of the document(startDocument)
    2) start of the element(startElement)
    3) end of the element(endElement)
    4) end of the document(endDocument)
    5) chars()
    Also check with any java site about SAX events how it works etc.
    Java Mapping
    http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/content.htm
    DOM parser API
    http://java.sun.com/j2se/1.4.2/docs/api/org/w3c/dom/package-frame.html
    On how to create XML docs with SAX and DOM go thruugh these links:
    http://www.cafeconleche.org/books/xmljava/chapters/ch09.html
    http://www.cafeconleche.org/books/xmljava/chapters/ch06.html
    Also go through these Blogs....
    /people/prasad.ulagappan2/blog/2005/06/08/sax-parser
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-iii
    I hope this helps...
    Regards,
    Abhy

  • What are all the advantages of JDBC, RFC, WebService Lookups

    Hi Friends,
    Please tell me advantages and Disadvantages of JDBC, RFC, Webservice Lookups.
    Thanks in Advancs.

    Example: PI 7.1 comes with JDBC and RFC Lookup.  During mapping we might have requirement to do validation or create logic based on the reference values in the table or SAP backend.  In this standpoint, we do JDBC and RFC Lookup. Earlier, we used to do coding in UDF or java mapping to achieve this. Now, we have it as a lookup graphical function. 
    Webservice Lookup is again the same idea. but we dont have lookup graphical function. We still need to do UDF coding to achieve this.
    http://help.sap.com/saphelp_nwpi71/helpdata/en/44/749dd812dd3676e10000000a114a6b/content.htm
    /people/jin.shin/blog/2008/02/15/sap-pi-71-mapping-enhancements-series-graphical-support-for-jdbc-and-rfc-lookups
    Disadvantage:
    If your soap message is larger size, dont do webservice lookup in UDF coding. It has maintanence issues.
    Parameterized mapping along with Integrated configuration is not currently possibe both in PI 7.1 and EHP1.

  • Lookups Vs  BPM

    Hi,
    Can any one tell me
    What is the difference between Lookups and BPM on performance bases?
    Where we should use BPM and where it is better to use lookups?
    Thanks

    Hi Vinay,
    We use BPM when we need to do:
    1. Controling or Monitoring of messages in XI
    2. Collect or Merge the messages in XI
    3. Split the messages in XI
    4. Multicast a Message
    5. Need to send an Alert
    XI BPM Performance: under-perform or out-perform?
    /people/swen.conrad/blog/2006/12/22/xi-ccbpm-performance-under-perform-or-out-perform
    LOOKUP Function: For example if you have a scenario in which you are getting the file from sender side and want to post the data of this file to R/3 system, but before posting the data into R/3 suppose you want to confirm that a particulat data let's say MATNR exists in R/3 or not then we create lookup function (UDF) in XI mapping.
    Lookups are not recomanded because of its performance  issue, reason behind this is, whenever you run the scenario it hits the R/3 tables to check an entry in the database, and as you know it is a big time issue to hit the database again & again.
    Below are few links:
    RFC Lookup.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a03e7b02-eea4-2910-089f-8214c6d1b439
    SAP XI Lookup API: the Killer - /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    DB lookup - /people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
    SOAP Lookup - /people/bhavesh.kantilal/blog/2006/11/20/webservice-calls-from-a-user-defined-function
    Check this weblogs with some screenshots on how to achieve this:
    /people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
    /people/sap.user72/blog/2005/12/06/optimizing-lookups-in-xi
    /people/morten.wittrock/blog/2006/03/30/wrapping-your-mapping-lookup-api-code-in-easy-to-use-java-classes
    /people/prasad.illapani/blog/2006/10/25/how-to-check-jdbc-sql-query-syntax-and-verify-the-query-results-inside-a-user-defined-function-of-the-lookup-api
    /people/sravya.talanki2/blog
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/406642ea59c753e10000000a1550b0/content.htm
    How to check JDBC SQL Query Syntax and verify the query results inside a User Defined Function of the Lookup API -http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    Lookups with XSLT - https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8e7daa90-0201-0010-9499-cd347ffbbf72
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/05a3d62e-0a01-0010-14bc-adc8efd4ee14
    Regards,
    Sarvesh

  • Read SAP XI table

    Hi everybody,
    in BLOG:
    Pipeline Approach in SAP XI Implementations.
    writes about reading a SAP XI table via RFC-Lookup in UDF.
    The speciality is, that the table is osted an XI.
    Does anybody know, how to set up a RFC connection/communication channel from SAP XI integration engine to XI-ABAP Stack to make a RFC-Lookup?
    Thanks, Regards
    Mario

    Hi,
    >>Does anybody know, how to set up a RFC connection/communication channel from SAP XI integration engine to XI-ABAP Stack to make a RFC-Lookup?
    Add the XI business system to the ID and create an RFC channel to it. Specify the XI server URL and the logon crediantial in it.
    In my blog Impede Duplicate Files a table is created in XI ABAP Stack and every time a look is made to this table using the RFC channel that has been configured in the way that I have specified above.
    Thanks
    SaNv...

  • Synch call to split in synch and asych

    Hi Guys,
    we got a new request to split a synchronous interface to asynchronous and synchronous realtime.
    SENDER (Service Interface Synchronous Outbound )              > SYSTEM A  (Service Interface Synchronous Inbound
                                                                                              >  SYSTEM B (Service Interface Asynchronous Inbound)
    How can we handle this without BPM? Thank you.
    PM

    What is your System B? is it file based or webservice?
    During the request mapping.. write the the required data into file using a UDF(for system B).
    sender (sync) -> graphical mapping (UDF - to create the file for system b using UDF) -> receiver(sync)
    File Lookup in UDF - Process Integration - SCN Wiki

  • Look-Ups

    Hi All,
    1.Can you tell me what exactly the look-ups are?
    2.Please tell me about the RFC and JDBC look-ups.
    3.Also please tell me how many data types do I need to create for For JDBC <---> RFC sync ?
    4.From my point of view I should create 2 data types ,2 message types for JDBC Request and JDBC Response while I can skip creating data types for Receiving RFC side.Is it?
    Thanks in advance.

    Hi Swetha,
    1.Can you tell me about when are RFC,JDBC,CSV look-ups are used?
       Look ups can be useful  in any where, especially when we like to map the value that is reseided in some other application system and that value  tend to change or get  updated very frequently in that system .So as to get the recently updated values we prefer this .if it doesnot happen we cn directly go for hardcoding either by using Fixed values or value mapping.If the value is queried from R/3 we use RFC look ups.If the value is to be retived from Database we go for JDBC.
    2.I think look ups are nothing but the User Defined Functions.Is it?Please tell me in detail.
      Look ups need not not only Java functions we can do that in BPMs remember Filr to RFC to FIle using BPM scenario there we get values from RFC response too in Bpm .But this is again a performance issue with out using UDF.But its very easy to perform the lookups using  UDF.Even SAP has provided good JavaAPI to perform lookups according to requirement.In most of the cases we use lookups for querying single values.But in PI7.1 there has been added advantage in the form of Graphical lookups to avoid java code and maintin reusability.The link was mentioned by experts already.
    3.Please give me any scenerio about the implementation of RFC,JDBC,CSV look-ups .
    I am giving example which i came across while working with EDI documents in SEEBURGER environment.There was a field value "TE" in some segment, while mapping to target i should get the Defintion forTE wich was maintained in some other data base and map to the target side, for that purpose we had to use JDBC look up and ping the data base to retrive the  required value as the result of Lookup. So when i applied look up i got the value "TELEPHONE" for the code TE.The same way for FX the lookup result was FASCIMILE.Not only this for PLANTCODES and some other business related data we might need to use Lookups...Hope you understood my point.
    Thanks,
    Ram.

  • UDF of type "Lookup" - doesn't accept "space/Empty" value in lookup defn

    Hello there,
    I have created a Combo Box UDF field - but I don't want to put any value in it. If I give only "space" in Encode and Decode - it gives error of providing some value to it. I want to give a default blank value over there along with other values so that the user is free to declare an empty value if he/she doesn't wants to provide one otherwise the user has to mandatorily provide some value to this like "NULL/zzz/NOTHING" as a string.
    Is there anyway we can achieve this - giving blank value in a lookup/combo field ?
    TIA,
    - oidm.

    I don't think you can enter nulll/space in decode.
    For Lookup Field Code as well as Decode can't be null.
    If you want to give blank so it is not possible APMK, in decode you can give ---. You can treat it as Blank.
    Code Key > NULL
    Decode > ---

Maybe you are looking for

  • How can I display the value of the Target Currency variable in my query

    We have a query which has a key figure set to prompt for a Target Currency at runtime.  Because the user did not want the currency displayed in each cell they used the NODIM function to remove it. They do however want to display the Target Currency i

  • Error when opening an RFC connection in IDT

    Hi Experts, I m trying to create a relational connection (JCO) from IDT to BW 7.4, and I m getting the following error: Error when opening an RFC connection (CPIC-CALL: ' ThSAPOCMINIT', communication I searched this error in Internet and I found many

  • Where are my photo stream pics

    I have a new account but where have my icloud pics gone?

  • Teranex Mini, the economical choice in front of FCP?

    My friend, the search function, did not have anything bad to say about Teranex. One poster said it was the best. In search of more information, I have gone to a review in Videography, suggested by Teranex. The reviewer has consulted for Teranex. Desp

  • Windows doesn't see my iPod

    I had my ipod connected and it worked just fine, I had to force my computer to turn off, hold down the power button, and now my computer doesn't see my iPod. I tried the data mode and the resetting and the restarting the computer. I can't restore the