Need UDF for concatnating three fields

hi all,
            need java coding concatnating three fields , please help me as i dont know java
thanking you
Sridhar

Hi Sridhar,
use following code
public void calculate(String[] var1, ResultList result, String[] var2, String[] var3, String[] var4, String[] var5, String[] var6, String[] var7, String[] var8, String[] var9, String[] var10, String[] var11, Container container) throws StreamTransformationException{
for(int i = 0 ; i  < var1.length;i++)
   if (var1<i>.equals("true"))
   result.addValue(var11<i>+ var2<i>var3<i>var4<i>var5<i>var6<i>var7<i>var8<i>var9<i>var10<i>);
else
result.addValue(ResultList.SUPPRESS);
while creating this UDF:
Select Execution Type as "All values of Queue" (you will see this option when you go for creating UDF)
In signature Variable Declare 11 variable 1st will hold true or false and rest will be for concatination
First input is output of comaparison ("WE")
Now var1 will hold the output of comaparison. if it is true it will concate 10 value if false it will pass suppress (Same as if withoutelse)
Thanks
Sunil Singh

Similar Messages

  • UDF for Checking the field value

    Hi
    I want to check the whether the fiels conatins any value or not in mapping ... if not i want to raise the exception using the UDF
    DO any one have sample code for writing the UDF
    SV

    Hi SV
    what is your requirement first that should br clear.
    i am giving you two UDF
    1) i have written this uDF for string and comparing the field value XYZ
    2) i am entering a string and its returning aa string which starts from the index of your input fixed length
    int len = a.length();
    String res = "";
    String temp = "";
    if ( len >= 10)
    temp = a.substring(0,10);
    if ( temp.equals("XYZ"))
    res = temp;
    else
    res = "";
    return res;
    =======================================
    String fixed = "ABCD";
    String res = "";
    int index = -1;
    index = a.indexOf(fixed);
    if (index == -1)
    res = "NO INDEX FOUND";// or if u wanna set it as null res = "";
    else
    res = b.substring(index4,index12);
    return res;
    ===
    hope these may solve your problem
    Thanks
    Sandeep sharma
    If helpful reward points

  • UDF for Separating the Fields

    Hi,
    I am getting the 4 fields of data in single field from souce system, i need to send to target side with 4 Diffrent Fields. I want to separate the data based on (/).
    I think for this I need 4 UDF's, Pls let me know the UDF's for this requirement. I am new to UDF's.
    Example :
    Source Field:
    EmpNo / EmpName / EmpAddress / EmpPhone
    Target fields:
    EmpNo
    EmpName
    EmpAddress
    EmpPhnoe
    Mapping
    EmpNo / EmpName / EmpAddress / EmpPhone  -
    >  EmpNo
    EmpNo / EmpName / EmpAddress / EmpPhone -
    > EmpName
    EmpNo / EmpName / EmpAddress / EmpPhone -
    > EmpAddress
    EmpNo / EmpName / EmpAddress / EmpPhone -
    > EmpPhone
    Regards,
    Pasi.

    Hello,
    I think for this I need 4 UDF's, Pls let me know the UDF's for this requirement. I am new to UDF's.
    Not sure about PI 7.0 and below, but for PI 7.1 you can create a context type UDF with four result sets
    Argument: input
    Result: empNo
    Result: empName
    Result: empAddress
    Result: empPhone
    UDF code is:
    String temp[] = input[0].split("/");
    empNo.addValue(temp[0]);
    empName.addValue(temp[1]);
    empAddress.addValue(temp[2]);
    empPhone.addValue(temp[3]);
    Mapping is like this:
    Source -> UDF -> EmpNo
               |---> EmpName
               |---> EmpAddress
               |---> empPhone
    Hope this helps,
    Mark

  • Need information for all the Fields on Infotype 94.

    Hi all,
    I have a question on Infotype 94 which holds all the information  of I - 9 form.  I would like to know which field goes with what details when we are trying to take details from I - 9 Form. I need a example how would it look for a Alien authorized worker and a permanent Resident and US citizen.
    Please help me out in this issue.
    Thank you.

    Residence Status (Infotype 0094)   
    Definition
    Infotype 0094 allows you to store information regarding an employeeu2019s residence status, as well as information regarding the compliance with the Immigration Reform and Control Act (IRCA), which requires every employer verify that each person hired can prove via documents their identity, and their eligibility for employment.
    Structure
    This infotype is divided into two parts: the personal identification information section (the residence permit) and the employment verification section (the work permit).
    Personal identification
    This section stores the information for personal identification. The only field which is required on this infotype is Residence status. 
    The ID type field describes the type of documentation the employee presents to the company. You can also enter data for the issuing authority.
    The ID number is the number of the document provided by the employee to the company.  The Issuing date is the date on which the personal identification document was issued to the employee. This date must be the same as or later than the employeeu2019s date of birth.
    Lastly, the ID expiry date field is the date that the provided identification expires.
    If the expiration date is filled, and there is a value of A (Alien) in theResidence status field, then this transaction will automatically generate a transaction to store a deadline for the expiration of the work permit (infotype 0019, subtype 71).
    Employment verification
    This section stores the information for employment verification. The Work permit field stores the type of work permit. The Work permit number field stores the number of the document provided by the employee to establish work eligibility.
    The date issued and the issuing authority are also stored. The Expiry of work perm. field stores the date on which work eligibility expires. This field should only be filled for those employees who are not citizens
    http://help.sap.com/erp2005_ehp_05/helpdata/EN/2c/8323d0571111d182d40000e829fbfe/frameset.htm

  • Need help for use crm fields into EJB2

    hello i need help.
    i have one db table (table_1):
    id_1
    field_1
    nad the second table that depends from the tale 1:
    id_2
    fields
    id_1
    id_1 is the field that join the table 2 with the table 1.
    can anybody helps me to implemet this relationship into the xml files and into the java class?
    into the java class for the second table i have:
    public abstract long getId_1();
    public abstract void setId_1(long Id_1);
    public abstract long getId_2();
    public abstract void setId_2(long Id_2);
    public abstract String getField();
    public abstract void setField(String field);
    how must i reference the relation into the bean and into the confdiguration xml files (i use Weblogic 8 and EJB 2.1)
    Thanks

    SRM doesn't use kind of "cockpit" LO-like in ECC.
    Overall picture:
    http://help.sap.com/saphelp_srm40/helpdata/en/b3/cb7b401c976d1de10000000a1550b0/content.htm
    If you setup data flows accordign Business Content of SRM:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/3a/7aeb3cad744026e10000000a11405a/frameset.htm
    Then just perform an init load and schedule the deltas.

  • Need PPT for add new fields in CRM Portal

    Hi All,
    I am new to PCUI. I am not understanding what happend in PCUI.
    I have to add two fields in Advanced search area. How to do that.
    any body having PPT for how to add fields please send me <removed by SAP Community Network Moderator> or give me any use full links.
    Thanks,
    Subbu.

    <removed by SAP Community Network Moderator>
    Also check the Forum:Re: PCUI..Need to add field on Bussiness partner
    Regrds,
    Arjun

  • Need help for a adding field manually

    Hi,
    My requirement is to add fields in the component  BP_DATA/ accountcardsEF , for which i have to enhance the DB Table BUT0CC . Since this is not supported by EEW , i have to do all this manually.
    For which i have modified the DB table , added the fields at the BOL level and and are getting displayed on the WEB UI . Could you please tell me what modifications i have to do at the GENIL level as to save that data into the database .
    Please advice on this.
    Regards
    Manish

    HI
      did u added fields as Model Attributes(which contains reference to database)or else as Value attributes(no refeeence in database)
      In Case of value/model  attributes we have to write the code in get methods to retrieve the data from database.because they are not in the attribute structures.

  • Same filename from a sender to receiver :: DO we really need UDF ?

    Hi
    This is in refrence of Weblog " <i>same filename from a sender to a receiver file adapter "</i> by <i>Michal Krawczyk</i>.
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Actually I worked on another weblog by " <i>Shabarish Vijayakumar</i> "-->
    /people/shabarish.vijayakumar/blog/2006/04/03/xi-in-the-role-of-a-ftp
    And I am getting file created on the receiver side with the same file name as on the sender side without using the user-defined function mentioned in Michal's weblog.
    Now my question do we really need UDF for same file name when on the sender we are polling for one file only by its name.
    I am not exaclty getting the benefit of this feature. Can you tell me why do we need this feature as in whatever scenarios I worked I mentioned the file names in both Sender & Receiver File Adapters.
    So I am not getting what is the use of using this UDF, when we mention the name of file needs to be created on Receiver side.
    - Lalit Chaudhary -

    Hi
    I put this code for UDF -->
    <i>String valueNew;
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String valueOld = conf.get(key);
    if (valueOld != null)
        valueNew = valueOld.replaceAll("input123",name);
        conf.put(key, valueNew);
    return valueNew;</i>
    Signature of UDF is this :: <u>public String GetFileName(String name,Container container)</u>
    But when I am testing this UDF, I am getting following RunTime exception -->
    <i>Runtime exception during processing target field mapping /ns0:FileFTP_InOut_MT/File_nm. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._FileFTP_MsgMapping_UDF_ method GetFileName$[lalit, com.sap.aii.mappingtool.tf3.rt.Context@735df3b0] com.sap.aii.mappingtool.tf3.MessageMappingException: Runtime exception during processing target field mapping /ns0:FileFTP_InOut_MT/File_nm. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._FileFTP_MsgMapping_UDF_ method GetFileName$[lalit, com.sap.aii.mappingtool.tf3.rt.Context@735df3b0]</i>
    I am not much of Java Guy, can you pls. suggest what am I doing wrong, I copied this code from <a href="http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm">SAP Help</a>
    - Lalit -

  • UDF for leading zero's in message mapping

    Dear team,
    I need UDF for leading zero's in my message mapping.
    Source and Target both structures contains matnr field.But we have to maintain total 18 chars at target matnr , because RFC in R/3 needed.So I want to add leading zero's when mapping. Can anybody provide the UDF code.
    Matnr[source]--->split by value(eachvalue) ->UDF->Matnr[Target]
    Ex::if source matnr conatains value "9846538" ; I need matnr value at target side like "000000000009846538"[total 18 chars].
    -Drumi

    Hi Ambrish,
    Good day...
    I have enterd what you said and I got below error... and I gave "input" in place of var1, 18 in place of filedlenght in below program...
    =================================
    int len = Integer.parseInt(18);
    int inputLength = input.length();
    try {
    Integer.parseInt(input);
    // If it is an integer, add 0 (len - inputLength) times
    for (int i=0; i< len-inputLength;i++)
        input = "0" + input;
    return input;
    } catch (NumberFormatException numForEx) {
    // return as it is, if alphanumeric
    return input;
    ====================================
    ERROR:
    Source text of object Message Mapping: Lubrisur_SHPMNT_SHPMNT05_TO_WMMBXY_WMMBID02_TransferPosting | urn:bp:xi:dwn:lu:common:Logistics:100 has syntax errors:
    Function LeadingZeros, Line 1:
    cannot find symbol symbol  : method parseInt(int) location: class java.lang.Integer int len = Integer.parseInt(18);                  ^ 1 error
    =======================
    Please suggest

  • UDF for replacing special or junk characters

    Hi
    Is there any stanard function for replacing any junk characters with zero? If not, I needed UDF for fulfilling this requirement.
    My requirment is .... Am sending some files to r/3 using XI. In the source(txt file) some time some fields have some junk characters. I must make it to zero, the field which has junk. How can I acheive it? is there any UDF using which I can fulfill my requiremnt.
    Thanks.

    Hi,
    Use this UDF
    Here a is the input value.
    String b = "";
    b = a.replaceAll(",", "0");
    b = a.replaceAll("@", "0");
    Like all the special characters you can take and replace with zero.
    return b;
    Or
    Use the regular expression to check whether special characters occurs in the string then replace with zero
    http://www.j2ee.me/developer/technicalArticles/releases/1.4regex/
    Regards
    Ramesh.

  • How to use Radio Buttons in SAP BI 7 for a set of three fields?

    Dear SAP Gurus,
    We are using SAP BI 7. We need to use Radio button to select one field name (out of a set of three fields) which
    appeared on selection screen.
    The scenario is; we have three fields
    1) Field Name A
    2) Field Name B
    3) Field Name C
    Now, we need to select one field(using Radio button) from the above and later the report related to the above
    selected field should be displayed.
    The three reports will be as follows:
    1) Report A
    2) Report B
    3) Report C
    if Field Name A  is selected then Report A  will be displayed,
    if Field Name B  is selected then Report B  will be displayed and
    if Field Name C  is selected then Report C  will be displayed.
    To display the report we have two cases;
    1) There will be a common selection screen and all the three reports will come in single workbook but in seperate worksheet.
    2) There will be a common selection screen and all the three reports will come in same worksheet, one after the other.
    Is it possible to create the report in this manner, if yes, please suggest the steps.
    Regards,
    DV.

    I think you would just use commands to do the following:
    1. Hide report Analysis Item 2 and Analysis Item 3 if the 1st button was pushed.
    2. Hide report Analysis Item 1 and Analysis Item 3 if the 2nd button was pushed.
    3. Hide report Analysis Item 1 and Analysis Item 2 if the 3rd button was pushed.
    Hope that helps...

  • 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

  • I have just use my laptop for only three months and my hard disk cable have break and i need a replacement

    i have just use my laptop for only three months and my hard disk cable have break and i need a replacement

    Talk to AppleCare about getting a replacement.
    Allan

  • Need Code for FM for extracting the fields in view!

    Hi,
    can any one here pls give me the sample code for the function module, extracting all the fields in view ?
    Thanks,
    Ravi

    No No,
    I need to append two more fields other than the fields existing in View.and for that i need to create FM as per the requirement. they do not want view in the data source definition any more.
    now i want a sample code for Building the FM code
    Hope i am clear this time
    Thanks,
    Ravi

  • Need BAPI/RFC for Updating Category field of CRM_DNO_MONITOR  from SAP R/3.

    Hi SAP GURUS!!
    I need to have a new field category in "Create support message"  of the HELP menu in SAP server. This field values needs tobe updated with that of Category in Solution Manager ( CRM_DNO_MONITOR) .We have found a BADI (SBCOS001 ) where we designed the screen for having the new field. FOr updating the value of this field to sol man, is there any bapi or rfc ..
    Thanks in Advance,
    gopa.

    Hi
    Please check the following points.
    1. Please check the settings that you maintained in the table CRMSUBTAB in ECC. You need to have an entry as follows:
    User: CRM
    Object: VENDOR_MAIN
    U/D : DOWNLOAD
    Object Class: VEND ( & not BUPA for this entry)
    Function Module: PI_BP_VENDOR_MAIN_EXTRACT
    The other entry (for upload) has similar but different values. (Refer to the OSS note 883162.)
    2. Check if you have applied any filter settings in CRM for the adapter object VENDOR_MAIN.
    Regards,
    Srini.

Maybe you are looking for