Required UDF

Hi Frnds,
I required one UDF, my requirement is i am getting value from Source message.
if Region = "Australia/Sydney" then i have to create Australia Time, if it is IST then INDIA Standard TIME.
how to achieve this one.? my output format should be like this 20090520T120000Z
YYYYMMDD T HHMMSS  T is separator.
Regards,
Raj

check this link:
[http://www.exampledepot.com/egs/java.util/GetTimeOtherZone.html|http://www.exampledepot.com/egs/java.util/GetTimeOtherZone.html]
Try this UDF Code:
Calendar cal = new GregorianCalendar(TimeZone.getTimeZone(a));  // a = "Australia/Sydney" or "IST"
NumberFormat formatter = new DecimalFormat("00");
return(Integer.toString(cal.get(Calendar.YEAR)) + formatter.format(cal.get(Calendar.MONTH)+1)
     + formatter.format(cal.get(Calendar.DATE)) + "T" + formatter.format(cal.get(Calendar.HOUR)) +
     formatter.format(cal.get(Calendar.MINUTE)) + formatter.format(cal.get(Calendar.SECOND))+ "Z");
Edited by: Praveen Gujjeti on May 25, 2009 8:06 PM

Similar Messages

  • Mapping logic required-UDF

    Hi,
    My sender structure is as follows
    <zaction>(1:1)
    --Trans
    <Zcode>(0:999)
    --Code
    --Id
    My target field is
    <code>(0:999)
    --ID
    My requirement is
    if code= CE,CB,CH,CJ,CI,CO then don't create target field ID.
    else
    if code=AF and Trans=01 then ID=axv0001
    or
    if code=AF and Trans=02 then ID=axv0002
    if none of the above conditions matches pass ID received from sender.
    I am confused at using context type UDF. As suppress result is completely supressing the target field. it's not looking into the rest of logic. Can you provide me an appropraite UDF for this logic please.
    TIA,
    Mahesh

    Hello,
    You can use this context type UDF:
    Arguments: inTrans
    inCode
    inID
    for(int a=0;a<inCode.length;a++){
         if(inCode[a].equals("CE")|inCode[a].equals("CB")|inCode[a].equals("CH")|inCode[a].equals("CJ")|inCode[a].equals("CI")|inCode[a].equals("CO")){
              result.addSuppress();
         else if(inCode[a].equals("AF")&inTrans[0].equals("01")){
              result.addValue("axv0001");
         else if(inCode[a].equals("AF")&inTrans[0].equals("02")){
              result.addValue("axv0002");
         else{
              result.addValue(inID[a]);
    Logic is like this:
    For code
    Trans -> removeContext -> \
    Code --> removeContext -> UDF -> code
    ID ----> removeContext -> /
    For ID
    Trans -> removeContext -> \
    Code --> removeContext -> UDF -> splitByValue:eachValue -> ID
    ID -----> removeContext -> /
    Hope this helps,
    Mark
    Edited by: Mark Dihiansan on Nov 9, 2011 3:47 AM

  • Required UDF for comparing values within same context

    I have to compare values within the same context.I am getting boolean values for that field.If all the values in the same context are true,then the result should be true .Otherwise false  should be passed.
    If input is-
    <context>                                  
    true
    false
    true
    <context>
    true
    true
    <context>
    Output should be as-
    <context>
    false
    <context>
    true
    <context>
    Please suggest how to acheive this?..its urgent

    Hi,
    Check with this UDF
    Src>UDF>target
    public void context1(String[] a,ResultList result,Container container)
        int k = 0;
        int arrayLength = a.length;
        if (arrayLength > 0)
            String firstElement = a[0];
            for (int i = 1; i < arrayLength; ++i)
                   if(!(a<i>.equalsIgnoreCase(firstElement)))
                     k = 0;
                     break;
                   else
                     k = 1;
    if(k == 1)
        result.addValue("true");
    else
        result.addValue("false");

  • Required UDF to supress same lines

    Hi experts,
    I designed my mapping and when i display queue of my target i get:
    code1
    code1
    code1
    code1
    code2
    code2
    code2
    code3
    code3
    code3
    code4
    code4
    as you can see I have several times the same value
    I was wondering if its possible to delete the same lines and hence to have:
    code1
    code2
    code3
    do you know how to do that?
    thanks,
    Jamal

    Hey
    Use the following
    Sender Node(use parent node of node1,node2,node3)->RemoveContext->Sort->SplitByValue(Select Value Change)->CollapseContext->Target
    Thanx
    Aamir

  • Trying to add missing UDF, but keep breaking my existing layout!

    Hi Everyone,
    I am working with an existing layout in Crystal Reports.
    Unfortunately a UDF that I require, and expect to be present, cannot be accessed. The UDF that I need to use is called 'U_INE_FreightR'.
    I figured that it may be possible to remove the table, and then re-add it, and thereby obtain access to the 'missing' UDF. Towards this end I click Database > Database Expert. I then remove the table, OPOR.
    Doing so gives the following warning.
    I then click on OK, and proceed regardless of the warning.
    Afterwards I re-add the required, OPOR, table (after making a relevant database connection).
    Following this procedure produces the following error.
    I have no choice but to click on OK here, so that is what I did.
    Now when I look in the table for the required UDF it is present...
    Following on I then save the modified form back into Business One (Add-Ins > SAP Business One > Save).
    All appears to be well, however when I then use the layout in Business One there is a lot of information missing. I suspect that the errors with regard to missing content in the layout relate back to the error message "There are fields in the report from this file. Continue?".
    I am now at a complete loss regarding how to make the extra UDF available in the layout, without 'breaking' the layout, and losing content.
    If anybody can advice me on how to add the UDF without breaking my layout it will be greatly appreciated.
    Kind Regards,
    David

    Hi Saado,
    I have attempted your technique, however unfortunately I am getting stuck. Here are the steps that I follow -
    1). Click on Database menu
    2). Click on Verify Database
    3). Enter the password into the OLE DB (ADO) dialog box - as shown below -
    4). Click on Finish
    I am then presented with the screen below, for which I do not know the correct values to enter -
    If I simply click on OK I am met with the following error message -
    I then click on OK, and follow this by clicking on the close (red cross) button.
    The message below is shown -
    I click on OK, and am presented with a Map Fields dialog as shown below -
    I then click on OK, and receive the message 'The database is now up to date'. However I also receive the error message shown below -
    I click OK, and am then shown the Formula Workshop, as follows -
    Can you please provide further advice? I suspect that my mappings are out, but I don't have any idea about how to fix them!
    Any further assistance will be greatly appreciated.
    Kind Regards,
    David

  • Setting adapter specific message attributes

    hi xi guroos.
    i just got one doubt in a file to file scenario.
    if i set adapter specifec message attributes in sender file CC.
    and if  i enabled file name checkbox.
    some xi prof saying that the file at recievr directory will get created with the same filename which we r using at source directory .
    if this is the case then no need to create any UDF for getting same file name i n mapping and one more doubt is
    then what is the use of typing filename at reciever file adapter.
    u r anwer will be appreciated.
    waiting for u.
    bey.
    regards.
    seeta ram.

    <i>some xi prof saying that the file at recievr directory will get created with the same filename which we r using at source directory .</i>
    Its true.
    <i>if this is the case then no need to create any UDF for getting same file name i n mapping and one more doubt is</i>
    By marking the checkbox, at receiver u could have the same filename as that of sender. But this is the only requirement, UDF is not required.
    However if u want the filename as a value in Message mapping, u need the UDF. And moreover, there r many more header parameters that could be accessed in UDF
    <i>then what is the use of typing filename at reciever file adapter.</i>
    If u doesnt tick the checkbox (in most of the cases), then XI should know with which name file should be created
    Hope each doubt is cleared
    <i>[Reward if helpful]</i>
    Regards,
    Prateek

  • What the best way to create User defined table with ADDON purpose

    Hi folks, how are you ?
    I´m beginner in development to business one, and I m studying to develop ISV addons.
    But, during my exercises and analisys, I learned that have two ways to create tables and fields in business one. One way is throght by wizard in business one using Tools Menu > Configuration Tools > User Defined Tables >
    Obs: I ´m using Business One Patch Level 9.
    Other way, is create the tables and fields using DI API
    But, my question is. When I develop one addon, or one UDO form that uses one set of user defined tables or used defined fields that where created by the first way (by wizard in B1), how I deploy this in other business one installation ? The package process will ensure the creation of this tables in another enviroment or I must implement the creation of user defined tables using DI API so that this code is called during the installation?
    If in cases of addon develop I must use DI API to create user defined tables, How can I use my classes with this responsibility in package process ?
    Thanks my friends.

    Hi Renan,
    You just need to put your logic in to the startup of your application, after you've established your connection to the UI API and DI API. All this will be triggered in the constructor of your main class.
    namespace MyNamespace
    public class MyAddon
      bool runAddon = true;
      bool initialised = false;
      const string ADDON_NAME = "My Addon";
      public static void Main()
            MyAddon addOn = new MyAddon();
            if(runAddon)
                  System.Windows.Forms.Application.Run();
            else
             Application.Exit();
      public MyAddon()
            // Connect to SBO session for UI
            if(!SetApplication()) runAddon = false;
      private bool SetApplication()
            // Code goes in here to establish UI API and DI API connections
            // See SDK samples for examples
            // You should also define and filter the UI API events your addon will trap at this stage and create any menus
            // Call your routine to check if the required UDFs/UDTs exist on this company
            initialised = CheckInitialisation();
            if (!initialised)
               //  AddOn not yet intialised on this company so prompt the user to run the intialisation process
              int iResponse = app.MessageBox("The " + ADDON_NAME + " addon will now create all required fields and tables."
                                             + System.Environment.NewLine + System.Environment.NewLine
                                             + "WARNING: It is strongly recommended that all other users are logged out of this company "
                                             + "before running this process. Are you sure you wish to continue?", 2, "Yes", "No", "");
              if (iResponse == 1) initialised = InitialiseAddOn(); // Call your routine to create the objects
            return true;
    Kind Regards,
    Owen

  • Technical e-learning

    Hi experts,
    Can I get a link on technical e-learning materials on SAP B18.8, that includes standard setup and configuration taskS, mapping customer business requirements, UDFs, queries etc, I once got assistance from this forum on a link for product e-learning on SAP B1 8.8 and AIP materials which have been of great help, please assist.
    Patrick

    hi Patrick,
    go to SBO portal [www.service.sap.com|https://websmp103.sap-ag.de/~SAPIDP/002006825000000234912001E]
    you need the S Account to access this page. then got to Education there you can find what you looking for.
    regards,
    Fidel

  • Modify the ASMA without defining the Sender and Receiver Interface

    Hi All,
    I am developing a scenario where I am picking files from NFS and putting in FTP.
    For this I am using only the ID and no IR content.
    So far so good.
    But Now we have a requirement to dynamically extract the target folder names from the File name.
    e.g
    Sourc File: ABC_FN_PQR
    Folder name shouild be FN
    For this the solution would be UDF.
    But now my question is that where do i put this UDF as there is no IR at all.
    Please suggest.
    regards,
    Piyush

    Hi,
    Just ASMA setting will do the needful. Are you planning to rename your target file name. If yes then only you will require UDF.
    Update: Since your directory name will be taken from source file name then you have to use mapping for this, else it will not be possible.
    I don't know if creating a new module for this will help you solve the issue, but in that case rather creating adapter module, mapping will be easier.
    Regards,
    Sarvesh
    Edited by: Sarvesh Singh on Dec 7, 2009 3:04 PM

  • Code to retrive the sender and receiver interface names using custome adapter module

    Hello Team,
    I want to develop an custom adapter module which could retrieve the names of the sender and receiver interfaces of the scenario and for that i am trying to use com.sap.aii.af.service.administration.api.monitoring.ProcessContextFactory.ParamSet but i don't know whether this API will support or not and also i don't know how to develop the code using this API so please suggest me some code for it so that i could retrieve the names.
    Thanks you all in advance.
    Regards,
    Avinash.   

    Hi,
    Just ASMA setting will do the needful. Are you planning to rename your target file name. If yes then only you will require UDF.
    Update: Since your directory name will be taken from source file name then you have to use mapping for this, else it will not be possible.
    I don't know if creating a new module for this will help you solve the issue, but in that case rather creating adapter module, mapping will be easier.
    Regards,
    Sarvesh
    Edited by: Sarvesh Singh on Dec 7, 2009 3:04 PM

  • Xi mapping issue

    <Header>
      <Id dt:dt="i4">270</Id>
      <Time dt:dt="dateTime">2008-03-19T08:54:26</Time>
    <Node1>
      <Amt dt:dt="fixed.14.4">20</Amt>
      <IsPIO dt:dt="ui1">1</IsPIO>
    <Node3>
      <IsOut dt:dt="ui1">1</IsOut>
      </Node3>
      </Node1>
      </Header>
    <Header>
      <Id dt:dt="i4">272</Id>
      <Time dt:dt="dateTime">2008-03-19T09:14:15</Time>
    <Node1>
      <Amt dt:dt="fixed.14.4">80</Amt>
      <IsPIO dt:dt="ui1">1</IsPIO>
    <Node3>
      <IsOut dt:dt="ui1">1</IsOut>
      </Node3>
      </Node1>
      </Header>
    <Header>
      <Id dt:dt="i4">271</Id>
      <Time dt:dt="dateTime">2008-03-19T08:57:28</Time>
    <Node1>
      <Amt dt:dt="fixed.14.4">-20</Amt>
      <IsPIO dt:dt="ui1">1</IsPIO>
    <Node2>
       <VTran dt:dt="i4">270</VTran>
      </Node2>
    <Node3>
      <IsOut dt:dt="ui1">1</IsOut>
      </Node3>
      </Node1>
      </Header>
    From the above strucutre if Id = NOde2-VTran then SUPPRESS the Header where id = Node2-Vtran else populate Header.
    Above is the requirement, could any one help with the UDF code to acheive this. Thanks in advance.

    Hi Souvik,
    Well i dont think you really require UDF for that. It can be Implemented using Graphical mapping also .
      Id -> equals -> NOde2-VTran->not->ifWithoutElse(Keeps=True )
    in the second input of ifWithoutelse give the name of field to be send .
    in above case if value is if  NOde2-VTran it will give SUPPRESS
    as in Property of ifWithoutElse we have given Keeps=true, Which means if Condition is false it will pass SUPPRESS
    and if it is true then it will pass the field as it is
    UDF
    for(int i=0 ;i < input.length;i++)
    if(input.equals("NOde2-VTran"))
    resul.addValue(ResultList.SUPPRESS);
    else
    resul.addValue(input<i>);
    Reward Points if Helpful
    Thanks
    Sunil Singh

  • File to Jdbc: how to get record count from DB table

    Hello,
    i have a scenario file to JDBC....ihave to insert input file data to DB table.
    now my requirement is ..if i insert a file with 50 records to db table on first time, and then next time if i insert the file with 100 records to db table....the count should start from 51 in db table.
    if i insert another file 3rd time, with 25 records, the count shold start from 151...so how can i achieve this functionality....
    i think following options:
    1. in mapping write lookup to call JDBC sender channel and fetch count and map same to target filed of DB. if this is ok...please provide UDF code..2. db triggers (not suitable for my req.)
    So kindly let meknow possible solutions and required UDF codes..please
    Thanks in advance...SARAN

    >>>..if i insert a file with 50 records to db table on first time, and then next time if i insert the file with 100 records to db table....the count should start from 51 in db table.
    if i insert another file 3rd time, with 25 records, the count shold start from 151...so how can i achieve this functionality....
    i think following options:
    Suggestions:
    1)Create an id column in db table.  Talk to DB guy to create oracle sequencer for that column. So, every time you insert record that field will be updated with oracle sequencer. You dont need to handle this.
    Refer this link
    http://www.techonthenet.com/oracle/sequences.php
    2) If you want to handle via pi,  following suggestions..
    If you use PI 7.1 or above, use jdbc lookup in the mapping and do the query  something like this
    Refer this link
    /people/jin.shin/blog/2008/02/15/sap-pi-71-mapping-enhancements-series-graphical-support-for-jdbc-and-rfc-lookups
    Do select query as below
    select count(*) from tablename;
    the above query will return number of rows exist in the table. So use that value and map it in the target field.
    If you use pi 7.0 or below then use the previous reply and do the UDF implementation for jdbc lookup during mapping. Because jdbc lookup does not support in those versions.
    Hope that helps.
    Baskar

  • AddOn installer

    Hello,
    I am trying to create an installer for my add-on. I've seen the B1DE Professional Installer and I belive I can use it what it has generated and modify it according to my needs. But, I need to create some tables, user defined tables and user defined fields in the database that is requiesting the install. Do I do that in the Install method and how (I know how to create tables and userdefined tables, I just don't know how can you find out in which database)?
    Thank you,
    Irina

    Hi Irina,
    I think the usual method is to build this functionality in to the add-on itself rather than the installer. If you built it in to the installer, it would be difficult to install the add-on on a site with multiple companies and particularly on a site where a new company is created after the add-on was installed.
    There are probably a few ways to do this but here's the way I see implemented most often in third-party and SAP add-ons:
    1) You install the add-on as normal (ie using the standard ard and exe files in Add-on Administration)
    2) When you start the add-on, the add-on will perform a check to see if all the required UDFs and UDTs exist in the current company.
    3) If fields are missing, automatically create them. Personally I'd prefer the add-on to prompt me before this action takes place (but most add-ons just go ahead and create the fields without prompting )
    4) Once all UDFs and UDTs have been created, the add-on works as normal.
    The add-on perfoms the check every time it is started but, after the first time, all objects are found so this step is skipped.
    Kind Regards,
    Owen

  • DRQ : Draw Document Wizard only show limited details.

    Hi,
    I'm not sure is this the correct place to do development request.
    I found out that when do Copy from Function (eg. Do Delivery by Via Copy to function), Draw Document Wizard only show limited details. Width , height, length are not shown.
    Our customer sells same item (Product Code) with difference  size and dimension. It is hard to select the item from the draw document wizard.
    Even harder for documents that have a lot document lines with same product code.
    Is there any plan for this req in the next upcoming patch?
    Please advise.
    Andy

    Hi Andy
    What I understood from your explanation is you have one single item code, but the item has different sizes.  So, you are creating multiple lines for same item in base document (sales order/purchase order).
    My question is to you, how are you capturing the sizes in the document.  Have you created any UDF to capture the sizes.
    If your answer is 'Yes', then, you can include those UDFs in Draw Document Wizard -> Select Item to Copy (through Form Settings).  Also you can drag & drop those UDFs just beside your Item Code or Description, which will help user to understand the actual size/specification of the Item while drawing the base document into target.
    If your answer is 'No', then you can create those required UDFs for Marketing Document -> Rows and store the values in the base document.  And while using Draw Document Wizard include those UDFs through Form Settings as explained above.
    Thanks & Regards
    Anjan Bhowmick

  • Sales order Number in Outgoing Excise Invoice PLD

    Hi Expert
    How Can I display Sales Order No in Outgoing Excise Invoice PLD?
    Regards
    Shekhawat

    Shekhawat,
    As Gardon say you requires UDF and one FMS on that so for that make one UDF and assign FMS Query as below on that FMS.
    after that SO num will move automatically document by document.
    SELECT $[ORDR.DocNum] AS 'DocNum'
    if your problem solved then close the thread.
    Regards,
    Bhavank

Maybe you are looking for

  • How to create a Node variable without fetching in Char Restriction.

    Hi Expert - I got the refrence from this thread -  [Hierarchy variables in webi / Universe; to create a node variable for hierarchies. Requirement - the  characteristic on which you want to create a node variable must not be in Default section and in

  • SD BW reporting on EDIDC table and RRI to document level - urgent

    I need to do some BW sales reporting. To get to those fields, I need to access EDIDC table. But it only gives iDoc info. How do I get to document level details (RRI) from iDOC nos. Please help. Thanks Mary

  • How to implement hyperlink in java using swing components

    hi..... pls help me to find out solution how to implement hyperlink in java using swing components

  • MPEG-2 file to DVD

    I have searched the threads and not quite sure how to do this. I want to be able to share with others a video that I put together and burn it to a DVD. I am not quite sure how to do this. I have a MPEG-2 file and want to be able to burn it to a DVD s

  • Form Based Role Validation

    I am trying to use the form based security role validation. I am using JDeveloper's built in OC4J. I am getting to my login form but when I try to submit I get the following: java.lang.IllegalArgumentException: Resource /j_security_check?j_username=m