UDF: Mapping query-------Urgent

hi...
I m doing a scenario from File to JDBC. I have the following requirement.
Source:
Field1
Field2
On the target side i should be able to insert into database such that in column FIELD i get:
Field1
Field2
This new line can be incorporated by concatenating Field1 with '|| chr(10) ||'
which is used in Oracle for inserting a new line.
But now i am facing a problem. The database is treating '|| chr(10) ||' as a string and instead of getting Field2 on a new line i am getting the inserted row as:
Field1 || chr(10) || Field2.
Please help me resolve this.

Hi,
A simple solution this is to write an UDF.
You can write a code in UDF as below
Pass a as an argument.
String c;
c = a + "\n"
return c;
use this c as variable in query.
Regards,
Akshay Jamgaonkar.
Reward points if find useful.

Similar Messages

  • Mapping query in SAP PI

    Hi Experts,
    I have a mapping query in SAP PI. Actually I am mapping the source and target fields, now the problem is.
    The sender filed is subnode of the main node, and I have mapped the two main nodes in the sender and receiver together.
    Now, whether the sender main node comes all the subnode values will come or do we need to do something else for it.
    Both the sender and target main nodes and subnodes can have multiple repetations.
    I think One to One mapping wont do in this case. What needs to be done please help??
    Thanks and regards,
    Aniruddha

    Hi Vijay,
    Thanks a lot.I will try this out. Can you help me in another mapping problem, the req. is that i need to map the source and the target.
    The condition basically is :
    If no value in LIFEX use VBELN to map to a single target field.
    But I wont use UDF in this case.
    Please help.
    Regards,
    Aniruddha

  • How to map query data to workbook

    Hi Freinds,
          Hoping you have goodday, please let me know how to create workbook
          and how to map query data to it.
    Thanks
    Chandan Kumar

    Hello,
    Execute a BEx Query and in the BEx toolbar you can see SAVE button, click that as select SAVE as Workbook.
    If you want to insert more queries then first place the cursor where you want to insert the query, then Goto BEX toolbar, Select the Tool Icon and you can see a menu called Insert Query.
    Thanks
    Chandran

  • Mapping query for context change without UDF

    Hi,
    My requirement is as below:
    Input queues are
    4319, 4319,4320,4321,4321
    M1,M1,M1,M2,M2,M2
    Required output is
    4319,4320,CC,4321
    COntext change is to be inserted when there is a change in value in second queue.
    regards, Anirudh.

    Hi,
    Have you tried using the formatByExample as specified?
    input1-->removeContext--> concat --> splitByValue:ValueChanged --> collapseContext --> substring (2..6) --> formatByExample (1) --> Target
    input2-->removeContext--> /
    input1-->removeContext--> concat --> splitByValue:ValueChanged --> collapseContext --> substring (0..2) --> splitByValue:ValueChanged -->formatByExample (2)
    input2-->removeContext--> /
    code explanation
    input1 and input 2 when concatted outputs M12319,M12319,M12320,M22321,M22321,M22321
    The upper part of the code does this: M12319,M12320,M22321, when you use the substring it outputs now 2319,2320,2321
    The lower part of the code does this: M12319,M12320,M22321, when you use the substring it outputs
    M1,M1,M2, then you use splitByValue. The output is now M1,M1,CC,M2.
    When you input the code from the upper part and lower part into a formatByExample node, the output becomes
    2319,2320,CC,2321
    Hope this helps,

  • Report in Answers using a SQL Query(Sub Query) URGENT

    HI
    Can anyone help me in creating a report in answers using this below query please. Its little Urgent. I have no idea how to implement this, please suggest.
    Select
    a.account_external_id, a.edc_external_id, c.ann_usg, indclassificationcode, g.usage_cv, trunc(g.bill_month, 'mm') bill_month
    from
    crm2ro.cdi_customer_gas_all a, pwrline.account@lodestar_source b, crm2ro.cdi_ann_usg c,
    select * FROM
    select * from
    select distinct d.account_external_id, d.end_date, d.bill_month, USAGE_CV, dense_rank () over (partition by d.account_external_id order by d.end_Date desc) dr
    from
    crm2ro.cdi_usage_gas_all d, crm2ro.cdi_customer_gas_all e
    where
    d.account_external_id = e.account_external_id and upper(e.plan_id) like '%CPS%' and e.product_external_id = 'V' and e.crm_product = 'MV'
    and (e.plan_id like '%VAR_CPS_MX_G%' or e.plan_id like '%VAR_CPS_IT_G%') and e.account_status = 'ACTIVE'
    )where dr<=12
    ) h
    ) g
    where
    a.account_external_id = g.account_external_id and
    a.account_external_id = c.account_external_id and
    a.account_external_id = b.accountid
    thanks
    van

    Yes Jai,
    I want to do it from rpd or from the advance tab as 974053 said. But I am not aware of doing through advance tab and if I want to do through rpd then how can I do it. Please help me how to build this query through rpd or any other solution.

  • Java Mapping Query

    Hi Experts,
    I have a query regarding creating Output XML in SAP PI 7.1. I am using the below command
    out.getOutputPayload().getOutputStream().write(outDoc.toString().getBytes("UTF-8"));
    Where out is the TransformationOutput parameter and outDoc is an output XML not the String.So, I have used toString() here.
    But, when we have imported it in PI7.1 the output is not creating but the entire program is running successfully.
    Th error to create output XML in PI7.1 is as below.
    Unable to display tree view; Error when parsing an XML document (Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 5b, 23, 64 (:main:, row:1, col:3))
    Kindly let me know.
    Regards,
    Aniruddha

    Hi Ninad,
    Thanks for your interest in the post, it is a file to mdm scenario, where the entire mapping is wriiten in Java map.
    We have tested the Java program in NWDS with main() and it has worked successfully.But, when I changed the main with transform and tested it in PI7.1 with the required changes I am getting  that error
    Unable to display tree view; Error when parsing an XML document (Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 5b, 23, 64 (:main:, row:1, col:3))
    But, I have addeed trace in different level and all are coming means the program is running, only in case of
    getTrace().addInfo("Before passing XML to String");
    out.getOutputPayload().getOutputStream().write(outDoc.toString().getBytes("UTF-8"));
    getTrace().addInfo("After passing  XML to String");
    Both the getTrace() is showing in PI7.1.
    Trace Output:
    Records Created - 1
    Before passing XML to String
    After passing XML to String
    END APPLICATION TRACE ***
    Java mapping hcl/com/XmlValidation completed. (executeStep() of hcl.com.XmlValidation).
    Execution of mapping on server took 564 milliseconds Executed successfully
    only the changed syntax is I am using toString() on outDoc as outDoc is an Document type not the String Type.Actaully, I have manipulate the input as an XML not as a String or Stream.
    Regards,
    Aniruddha

  • SAP PI mapping query

    Hi Experts,
    I have  two mapping queries:
    1. In which field A maps with field B.
    For a E-Mail address coming from field A I have to check whether @ and . are available or not.
    2. In which field A maps with field B.
    The value coming from filed A will be:  Only Numerics, Should Migrate Upto  2 decimal places (Ex: 34.21), Ignore the rest if any.
    Please let me know.
    Regards,
    Aniruddha

    chk the UDF given by Satish:
    mapping help-- Number format
    >>For a E-Mail address coming from field A I have to check whether @ and . are available or not.
    u can use standard functions for the same
    A-------------
    -----------indexOf-----greater(constant(0) ----2nd input)
    Constant(.)---
                                 ----------------------AND----IfWithoutElse(A----THEN)-----Target
    A-------------
    ------------indexOf-----greater(constant(0) ----2nd input)
    Constant(@)---

  • Enterprise bpm cluster query urgent please

    Hello
    I have 3 machines one 1st machine it is admin server and other 2 are managed servers
    I will install weblogic on all 3 machines and then create a domain but my query is to do with BPM enterprise.Should I install bpm enterprise on all 3 machines as well or just on 1 machine(admin machine/1st machine) ? this is my doubt can you please clarify..
    it is pretty urgent
    thanks

    With one machine is enough, then you will deploy to the WLS cluster at the end of the day you do not need to have BPM installed except for the Process Administrator.
    HTH

  • In line SQL Query - Urgent

    In the problem iam calculating a Stock report.In the SQL suppose the relation F does not return any rows , then (D.ACC_QTY + F.RET_QTY) gives null. How to avoid this problem..
    SELECT A.CLASSIFICATION_CODE, A.ITEM_ABBR, A.ITEM_DESC,
    A.ALT_ITEM_CODE, A.UOM_DESC, A.BASIC_PRICE,
    (A.OPENING_QTY + B.ACC_QTY - C.ISS_QTY)
    OPENING_STOCK, (D.ACC_QTY + F.RET_QTY) ACCEPT_QTY, E.ISS_QTY,
    ((A.OPENING_QTY + B.ACC_QTY - C.ISS_QTY)
    + (D.ACC_QTY + F.RET_QTY) - E.ISS_QTY)
    QTY_IN_HAND
    FROM (SELECT CLASSIFICATION_CODE, ITEM_ABBR, ITEM_DESC,
    ALT_ITEM_CODE, NVL(OPENING_QTY, 0)
    OPENING_QTY, UOM_MASTER.UOM_DESC,
    BASIC_PRICE
    FROM ITEM_MASTER, UOM_MASTER
    WHERE ITEM_MASTER.UOM_CODE = UOM_MASTER.UOM_CODE)
    A,
    (SELECT GRN_DETAIL.ITEM_CODE,
    SUM(NVL(GRN_DETAIL.ACCEPT_QTY, 0))
    ACC_QTY
    FROM GRN_HEADER, GRN_DETAIL
    WHERE GRN_HEADER.GRN_NO = GRN_DETAIL.GRN_NO AND
    GRN_HEADER.GRN_DATE < '01-JAN-2006'
    GROUP BY GRN_DETAIL.ITEM_CODE) B,
    (SELECT MRN_DETAIL.ITEM_CODE,
    SUM(NVL(MRN_DETAIL.ISSUED_QTY, 0))
    ISS_QTY
    FROM MRN_HEADER, MRN_DETAIL
    WHERE MRN_HEADER.MRN_NO = MRN_DETAIL.MRN_NO AND
    MRN_HEADER.MRN_DATE < '01-JAN-2006'
    GROUP BY MRN_DETAIL.ITEM_CODE) C,
    (SELECT GRN_DETAIL.ITEM_CODE,
    SUM(NVL(GRN_DETAIL.ACCEPT_QTY, 0))
    ACC_QTY
    FROM GRN_HEADER, GRN_DETAIL
    WHERE GRN_HEADER.GRN_NO = GRN_DETAIL.GRN_NO AND
    GRN_HEADER.GRN_DATE BETWEEN
    '01-JAN-2006' AND '31-DEC-2006'
    GROUP BY GRN_DETAIL.ITEM_CODE) D,
    (SELECT MRN_DETAIL.ITEM_CODE,
    SUM(NVL(MRN_DETAIL.ISSUED_QTY, 0))
    ISS_QTY
    FROM MRN_HEADER, MRN_DETAIL
    WHERE MRN_HEADER.MRN_NO = MRN_DETAIL.MRN_NO AND
    MRN_HEADER.MRN_DATE BETWEEN
    '01-JAN-2006' AND '31-DEC-2006'
    GROUP BY MRN_DETAIL.ITEM_CODE) E,
         (SELECT B.ITEM_CODE,
    SUM(NVL(B.QUANTITY_ISSUE,0))
    RET_QTY
    FROM MATERIAL_MOVEMENT_HEADER A,MATERIAL_MOVEMENT_DETAIL B
    WHERE A.SLIP_NO = B.SLIP_NO AND
    A.SLIP_DATE BETWEEN
    '01-JAN-2006' AND '31-DEC-2006' AND
              B.TO_JOB_CODE IS NULL
    GROUP BY B.ITEM_CODE) F
    WHERE A.ALT_ITEM_CODE = B.ITEM_CODE (+) AND
    A.ALT_ITEM_CODE = C.ITEM_CODE (+) AND
    A.ALT_ITEM_CODE = D.ITEM_CODE (+) AND
    A.ALT_ITEM_CODE = E.ITEM_CODE (+) AND
         A.ALT_ITEM_CODE = F.ITEM_CODE (+) AND
         A.ALT_ITEM_CODE LIKE 'BOBRNG%017' AND
    A.CLASSIFICATION_CODE = 'BO';

    Sorry members for writing the word 'Urgent'..and really cutting down on your work.
    I am thankful to the person who pointed out my error in the query..it was really simple..should hv solved myself, but even after changing the query with Nvl and changing the business logic to some extent it again fetches no rows..
    The sql given underneath is basically a job-wise stock allocation report..
    SELECT B.JOB_CODE, A.CLASSIFICATION_CODE, A.ITEM_ABBR,
    A.ITEM_DESC, A.ALT_ITEM_CODE, A.UOM_DESC,
    A.BASIC_PRICE, (A.OPENING_QTY + (NVL(B.ACC_QTY, 0)
    + NVL(F.RET_IN, 0)) - (NVL(C.ISS_QTY, 0) + NVL(G.RET_OUT,
    0))) AS OPENING_STOCK, (NVL(D.ACC_QTY, 0)
    + NVL(H.RET_IN, 0)) RECEIVED, (NVL(E.ISS_QTY, 0)
    + NVL(I.RET_OUT, 0)) ISSUED,
    ((A.OPENING_QTY + (NVL(B.ACC_QTY, 0) + NVL(F.RET_IN, 0))
    - (NVL(C.ISS_QTY, 0) + NVL(G.RET_OUT, 0)))
    + (NVL(D.ACC_QTY, 0) + NVL(H.RET_IN, 0)) - (NVL(E.ISS_QTY,
    0) + NVL(I.RET_OUT, 0))) QTY_IN_HAND
    FROM (SELECT CLASSIFICATION_CODE, ITEM_ABBR, ITEM_DESC,
    ALT_ITEM_CODE, UOM_MASTER.UOM_DESC,
    BASIC_PRICE, 0 OPENING_QTY
    FROM ITEM_MASTER, UOM_MASTER
    WHERE ITEM_MASTER.UOM_CODE = UOM_MASTER.UOM_CODE)
    A,
    (SELECT GRN_HEADER.JOB_CODE,
    GRN_DETAIL.ITEM_CODE,
    SUM(NVL(GRN_DETAIL.ACCEPT_QTY, 0))
    ACC_QTY
    FROM GRN_HEADER, GRN_DETAIL
    WHERE GRN_HEADER.GRN_NO = GRN_DETAIL.GRN_NO AND
    GRN_HEADER.GRN_DATE < '01-JAN-2006'
    GROUP BY GRN_HEADER.JOB_CODE,
    GRN_DETAIL.ITEM_CODE) B,
    (SELECT B.TO_JOB_CODE, B.ITEM_CODE,
    SUM(NVL(B.QUANTITY_ISSUE, 0)) RET_IN
    FROM MATERIAL_MOVEMENT_HEADER A,
    MATERIAL_MOVEMENT_DETAIL B
    WHERE A.SLIP_NO = B.SLIP_NO AND
    A.SLIP_DATE < '01-JAN-2006'
    GROUP BY B.TO_JOB_CODE, B.ITEM_CODE) F,
    (SELECT MRN_HEADER.JOB_CODE,
    MRN_DETAIL.ITEM_CODE,
    SUM(NVL(MRN_DETAIL.ISSUED_QTY, 0))
    ISS_QTY
    FROM MRN_HEADER, MRN_DETAIL
    WHERE MRN_HEADER.MRN_NO = MRN_DETAIL.MRN_NO AND
    MRN_HEADER.MRN_DATE < '01-JAN-2006'
    GROUP BY MRN_HEADER.JOB_CODE,
    MRN_DETAIL.ITEM_CODE) C,
    (SELECT B.JOB_CODE, B.ITEM_CODE,
    SUM(NVL(B.QUANTITY_ISSUE, 0)) RET_OUT
    FROM MATERIAL_MOVEMENT_HEADER A,
    MATERIAL_MOVEMENT_DETAIL B
    WHERE A.SLIP_NO = B.SLIP_NO AND
    A.SLIP_DATE < '01-JAN-2006'
    GROUP BY B.JOB_CODE, B.ITEM_CODE) G,
    (SELECT GRN_HEADER.JOB_CODE,
    GRN_DETAIL.ITEM_CODE,
    SUM(NVL(GRN_DETAIL.ACCEPT_QTY, 0))
    ACC_QTY
    FROM GRN_HEADER, GRN_DETAIL
    WHERE GRN_HEADER.GRN_NO = GRN_DETAIL.GRN_NO AND
    GRN_HEADER.GRN_DATE BETWEEN
    '01-JAN-2006' AND '31-DEC-2006'
    GROUP BY GRN_HEADER.JOB_CODE,
    GRN_DETAIL.ITEM_CODE) D,
    (SELECT B.TO_JOB_CODE, B.ITEM_CODE,
    SUM(NVL(B.QUANTITY_ISSUE, 0)) RET_IN
    FROM MATERIAL_MOVEMENT_HEADER A,
    MATERIAL_MOVEMENT_DETAIL B
    WHERE A.SLIP_NO = B.SLIP_NO AND
    A.SLIP_DATE BETWEEN '01-JAN-2006' AND
    '31-DEC-2006'
    GROUP BY B.TO_JOB_CODE, B.ITEM_CODE) H,
    (SELECT MRN_HEADER.JOB_CODE,
    MRN_DETAIL.ITEM_CODE,
    SUM(NVL(MRN_DETAIL.ISSUED_QTY, 0))
    ISS_QTY
    FROM MRN_HEADER, MRN_DETAIL
    WHERE MRN_HEADER.MRN_NO = MRN_DETAIL.MRN_NO AND
    MRN_HEADER.MRN_DATE BETWEEN
    '01-JAN-2006' AND '31-DEC-2006'
    GROUP BY MRN_HEADER.JOB_CODE,
    MRN_DETAIL.ITEM_CODE) E,
    (SELECT B.JOB_CODE, B.ITEM_CODE,
    SUM(NVL(B.QUANTITY_ISSUE, 0)) RET_OUT
    FROM MATERIAL_MOVEMENT_HEADER A,
    MATERIAL_MOVEMENT_DETAIL B
    WHERE A.SLIP_NO = B.SLIP_NO AND
    A.SLIP_DATE BETWEEN '01-JAN-2006' AND
    '31-DEC-2006'
    GROUP BY B.JOB_CODE, B.ITEM_CODE) I
    WHERE A.ALT_ITEM_CODE = B.ITEM_CODE (+) AND
    A.ALT_ITEM_CODE = C.ITEM_CODE (+) AND
    A.ALT_ITEM_CODE = D.ITEM_CODE (+) AND
    A.ALT_ITEM_CODE = E.ITEM_CODE (+) AND
    A.ALT_ITEM_CODE = F.ITEM_CODE (+) AND
    A.ALT_ITEM_CODE = G.ITEM_CODE (+) AND
    A.ALT_ITEM_CODE = H.ITEM_CODE (+) AND
    A.ALT_ITEM_CODE = I.ITEM_CODE (+) AND
    B.JOB_CODE = C.JOB_CODE AND
    B.JOB_CODE = D.JOB_CODE AND
    B.JOB_CODE = E.JOB_CODE AND
    B.JOB_CODE = F.TO_JOB_CODE AND
    B.JOB_CODE = G.JOB_CODE AND
    B.JOB_CODE = H.TO_JOB_CODE AND
    B.JOB_CODE = I.JOB_CODE AND
    A.ALT_ITEM_CODE = 'BOSNVL0004-006-002';
    regards,

  • Mapping query result to excel sheet

    Hi Experts,
    i have a requirement where in i need to map the result into particular cellls of the excel sheet, because the excel sheet acts as front end which has graphs and by just putting the result in particular cells of excel the graph is automatically generated, so is there any way where i can map the result cells into particulat cells in excel?
    Thank you.

    Hi Shetty,
    You might have stopped reading this thread since you have the answer you need for now.  From experience, let me tell you what might happen next.
    If the query definition is ever changed ... say, a new characteristic is added because a different user has a slightly different need ... the result table will move down by a few rows and your equation no longer works.
    If you think this might happen, let me tell you a very easy way to get around it.
    1.  Name the range(s) you will use.  If the first result is in cell B31 on Sheet1, then go to cell B31 on Sheet1 and Select Insert>>Name>>Define.  Call it something you will remember, like "LastMonthSales" (no spaces, but underline is OK)
    2. use the range name in your formula.  This happens automatically, in fact.  If you press = then click on cell B31, Excel will automatically use the range name instead of the range address.  Excel LIKES names.
    3. now, go to the Visual Basic Editor (Tools >> Macro >> Visual Basic Editor; or, Alt+F11).  In your workbook, there should be a subroutine as follows:
    Sub SAPBEXonRefresh(queryID As String, resultArea As Range)
    If you do not find it, add it.  This probably also means that you are using Excel 2002 or later and have not set your Macro security to "trust access to Visual Basic Project"; so, change that security setting (Tools >> Options >> Security >> Macro Settings).
    The visual basic code is very simple.  For each result that you need to map you will want one line of code like this one:
    resultArea.Cells(4, 2).Name = "LastMonthSales"
    The Cells(4, 2) are counted from the top left of the result table.  So, in this case if B31 = Cells(4,2), then the top left of my result table must have been in cell A28 in Excel.
    This subroutine will be run automatically every time that the query is refreshed.  So, if the result table moves, the names will move with it.  One less thing to worry about.
    If you do not think you need to do this today, don't!  No sense in doing work that is not necessary.  But, save this.  I suspect that some day you will need it.
    - Pete

  • Need help wrt query urgently

    Hi ,
    I have two tables "table1" and "table2".Structure of the both tables are below:
    Table1:
    CustomerId
    CustFname
    CustLname
    Convertion_Date
    Table2:
    CustomerId
    DFname
    DLname
    CustomerId is used for joins .
    Now i need a query based on conversion_date.
    If conversion_date <sysdate
    then
    select CustomerId ,CustFname,CustLname,Convertion_Date from Table1
    else
    select CustomerId,DFname,DLname from Table2
    End .
    I need this functionality in a single query using case statement.
    Please help ..
    Thanks,
    Preethi MR

    Preethi MR wrote:
    Hi ,
    I have two tables "table1" and "table2".Structure of the both tables are below:
    Table1:
    CustomerId
    CustFname
    CustLname
    Convertion_Date
    Table2:
    CustomerId
    DFname
    DLname
    CustomerId is used for joins .
    Now i need a query based on conversion_date.
    If conversion_date <sysdate
    then
    select CustomerId ,CustFname,CustLname,Convertion_Date from Table1
    else
    select CustomerId,DFname,DLname from Table2
    End .
    I need this functionality in a single query using case statement.
    Please help ..
    Thanks,
    Preethi MRIs this urgent homework? Or urgent something else work?
    What exactly makes it urgent?

  • Using a UDF in query select

    I am using CF8 and MS Sql Server. I am getting an error on "select Str, CapFirst(Str) ..." when trying the following:
    <cffunction name="CapFirst" returntype="string" output="false">... </cffunction>
    <cfquery name="query" dbtype="query">
    select Str, CapFirst(Str) as CapStr from SampleTable
    </cfquery>
    Thanks for your help

    You can't run a UDF like that in any <cfquery> SQL string, be it a QoQ or any other DB's driver.
    If one wants to use a UDF in the SQL string, then one needs to call it like one would anywhere else: #myFunctionHere()#.  However this won't help you because all the CF calls are resolved before the resultant string is sent to the DB driver.
    And the string that goes to the driver needs to be valid SQL.
    So you cannot do what you're wanting to do via this approach.
    I presume the original data is coming from a DB?  Why don't you run an equivalent function on the DB before passing it back to CF, so the results are already how you want them to be?
    Adam

  • UDF mapping error

    hai friends
    iam created one UDF function for splitting multiple storage locations in to create deffarent segments  based on ,(cama)
    test mapping working good .
    but at runtime the mapping is not working
    it is giving runtime error at mapping convertion .
    like this
    com.sap.aii.utilxi.misc.api.BaseRuntimeException was thrown: RuntimeException in Message-Mapping transformatio
    pls help me what is the problem.
    with regards
    srikanth vipparla
    Edited by: srikanth vipparla on Apr 24, 2008 3:44 PM

    no iam not using the same message in testing
    it is comming from mdm system.
    and my udf code is like this .
    String testString = a[0];
              StringTokenizer st = new StringTokenizer(testString,",");
              while(st.hasMoreTokens())
              result.addValue(st.nextToken());
    and way it is giving error pls help me .
    with regards
    srikanth vipparla
    Edited by: srikanth vipparla on Apr 24, 2008 3:51 PM
    Edited by: srikanth vipparla on Apr 24, 2008 3:52 PM

  • UDF Mapping Nodes

    Hello all,
    I'm trying to map two source structure names into one destination structure name.
    example :
    Source
    -BBSEG_DEBIT
    --NEWBS
    --WRBTR
    -BBSEG_CREDIT
    --NEWBS
    --WRBTR
    -BBSEG_CREDIT
    --NEWBS
    --WRBTR
    Destination
    -BBSEG
    --NEWBS
    --WRBTR
    -BBSEG
    --NEWBS
    --WRBTR
    -BBSEG
    --NEWBS
    --WRBTR
    How can you do this mapping? Thought of UDF but in my case all nodes have to be present otherwise attributes are not coming up in the right context anymore.
    Thnks in advance for your help.
    Regards,
    Laurent.

    Hello,
    It is more precisely this :
    Source
    -BBSEG_DEBIT
    --NEWBS
    --WRBTR
    -BBSEG_CREDIT
    --NEWBS
    --WRBTR
    Destination
    -BBSEG
    --NEWBS
    --WRBTR
    We can have two structures in source BBSEG_DEBIT and BBSEG_CREDIT with all it's subcomponents.
    They can be present x times or not at all for each one. (-> Rajesh this is why i cannot map one field to target node)
    The destination is one structure. BBSEG with the same subcomponents.
    Is it more clear?

  • UDF mapping to split string

    Hi,
    I'm starting with UDF functions.
    How can i split source string at '-' and take first part into target.
    ex : 123-456 -> 123
    Easy points for those who know...
    Thanks in advance,
    Laurent.

    Hi Laurent,
    Use an Advanced User Defined Function. Adavnced user Defined Functions can return Multiple values.
    UDF1:
    1.Takes renmark as input.
    2.Does the split on the basis of ;
    3. Splits each split of step 2 on the basis of /
    4. Add the output of step 3 to the resultlist with a context change.
    UDF2:
    1.Takes renmark as input.
    2.Does the split on the basis of ;
    3. Splits each split of step 2 on the basis of /
    4. Add the output of step 3 to the resultlist with a context change.
    For Advanced UDF's,
    http://help.sap.com/saphelp_nw04/helpdata/en/f8/2857cbc374da48993c8eb7d3c8c87a/content.htm.
    You can try this piece of code in your mapping...
    You need 3 UDFs each for <detail>, <field1>,<field2>
    UDF1: For <detail>
    String arr[] = a[0].split(";");
    for (int i=0;i<arr.length;i++)
    result.addValue(arr);
    UDF2: For ><field1>
    String str = a[0];
    String str1 = null;
    String sarr1[] = str.split(";");
    for (int i=0; i<sarr1.length;i++)
    str1 = sarr1;
    String sarr2[] = str1.split("/");
    for (int j=0; j><sarr2.length;j++){
    result.addValue(sarr2[j]);
    j++;
    result.addContextChange();
    UDF2: For ><field2>
    String str = a[0];
    String str1 = null;
    String sarr1[] = str.split(";");
    for (int i=0; i<sarr1.length;i++)
    str1 = sarr1;
    String sarr2[] = str1.split("/");
    for (int j=0; j><sarr2.length;j++){
    j++;
    result.addValue(sarr2[j]);
    result.addContextChange();
    ..All these functions requires one input <remark>
    Hope this helps you ..
    *Reward with points if helpful*
    Regards,
    Shibani

Maybe you are looking for

  • 2013 Icon Editor bug?

    I searched and did not see this listed as a bug, but I seem to have issue anytime i used the Icon Text feature versus just using the Text tool. 2013 SP1 2012 SP1 Solved! Go to Solution.

  • Server proxy code help!!!!

    Hi! I'm a rookie in XI and I create a server proxy in a abap. I need insert or modify the table zfintbcm017 in sap but I dont know if the code is correct because the system dont accept the insert and modify statement. In the EXECUTE_ASYNCHRONOUS meth

  • Text in MovieClip

    Hello, Sorry for this stupid question, it should already have been answered a lot, but I couldn't find the answer on the forum. So here it is: I have a movieClip "Cell" associated to a class. The cell is basically a square with a textField containing

  • Jar file not showing images

    Hi When I make a runable jar file, my images it not showing if I try it on another computer. I searched the net and most people seems to use URLs instead ImageIO. But that doesnt help me either. Then I get the error message: Uncaught error fetching i

  • Garbled Text with Tiger Install

    need some help with a G4 Dual 1 ghz M8493 Quicksilver that I bought that has some issues with the operating system. I erased the 80G drive and free space and Installed Tiger by starting up on the install disk all the text was jumbled up and missing.