XML Unbounded values into one field - Message Mapping

Dear All,
I am trying to convert an unbounded multifield XML structure to a 0.1 field so that the maltiple values are mapped into a single fields in semi-colon seperated fasion.
The source:
<MT_dates>
   <date>05-10-2011</date>
   <date>10-11-2011</date>
   <date>10-12-2011</date>
   <date>10-13-2011</date>
</MT_dates>
date field is 0.. unbounded
target
<MT_dates>
   <dates>05,10,2011;10,11,2011;10,12,2011;10,13,2011</date>
</MT_dates>
dates field is 0 .. 1
can anybody please help?
Regards,
Haik

chk this:
input will be : var1
execution type All values of a context
int a = var1.length;
String b="";
for(int i=0;i<a;i++)
b =b +var1<i> + ";";
int c=b.length();
String output =b.substring(0,c-1) 
result.addValue(output);
date-UDF--dates

Similar Messages

  • Multiple Checkbox Values Into One Field

    Hopefully someone can help me with this issue I'm having.
    I'm trying to save the values of multiple selected checkboxes into one field separated by commas through ADDT's Insert Transaction code. I can do this easily with DW's standard insert record wizard by using the PHP implode() function but I haven't been able to figure it out with ADDT's code.
    <form>
    <input type="checkbox" value="1" name="program[]" /> Program One
    <input type="checkbox" value="2" name="program[]" /> Program Two
    <input type="checkbox" value="3" name="program[]" /> Program Three
    <input type="checkbox" value="4" name="program[]" /> Program Four
    </form>
    THIS IS ADDT'S CODING
    $ins_quoteManager->addColumn("programs", "STRING_TYPE",  "POST", "programs");
    THIS WORKS VIA DREAMWEAVER'S INSERT RECORD WIZARD
    Original: GetSQLValueString($_POST['programs'], "text"),
    Modified: GetSQLValueString(implode(',',$_POST['programs']), "text"),
    Anyone know how to modify the ADDT code with the implode function to get this to work?

    Have you tried ADDT´s "comma-separated checkboxes" form control, which will also store the values into a field of your choice (and of course retrieve them from there on update record - pages) ? The only possible drawback might be, that the checkboxes can´t be defined statically, means that the array of value/label - pairs will be retrieved from another table by establishing an additional recordset.
    Cheers,
    Günter

  • Get multiple values into one field

    I want to get following two rows into one record.
    Thank you in advance!
    ID     Name     Category
    109     John     C1
    109     John     D8
    Result:
    ID     Name     Category
    109     John     C1, D8

    hi, i used centinul suggestion to create this is query.
    WITH tablet AS
         (SELECT '109' AS ID, 'John' AS NAME, 'C1' AS CATEGORY
            FROM DUAL
          UNION ALL
          SELECT '109' AS ID, 'John' AS NAME, 'D8' AS CATEGORY
            FROM DUAL)
    SELECT     ID, NAME,
               LTRIM
                  (MAX (SYS_CONNECT_BY_PATH (CATEGORY, ','))KEEP (DENSE_RANK LAST ORDER BY ID),
                  ) AS CATEGORY
          FROM (SELECT ID, NAME, CATEGORY,
                       ROW_NUMBER () OVER (PARTITION BY ID ORDER BY CATEGORY)
                                                                          AS curr,
                         ROW_NUMBER () OVER (PARTITION BY ID ORDER BY CATEGORY)
                       - 1 AS prev
                  FROM tablet)
      GROUP BY ID, NAME
    CONNECT BY prev = PRIOR curr AND ID = PRIOR ID
    START WITH curr = 1;or
    WITH tablet AS
         (SELECT '109' AS ID, 'John' AS NAME, 'C1' AS CATEGORY
            FROM DUAL
          UNION ALL
          SELECT '109' AS ID, 'John' AS NAME, 'D8' AS CATEGORY
            FROM DUAL)
    SELECT     ID, NAME, SUBSTR (SYS_CONNECT_BY_PATH (CATEGORY, ','),
                                 2)CATEGORY
          FROM (SELECT ID, NAME, CATEGORY, COUNT (*) OVER (PARTITION BY ID) cnt,
                       ROW_NUMBER () OVER (PARTITION BY ID ORDER BY CATEGORY) seq
                  FROM tablet)
         WHERE seq = cnt
    START WITH seq = 1
    CONNECT BY PRIOR seq + 1 = seq AND PRIOR ID = ID;Edited by: DeepakDevarapalli on Nov 12, 2009 2:45 PM
    Edited by: DeepakDevarapalli on Nov 12, 2009 2:46 PM

  • 10GR2 - How can I load multiple row values into one field?

    Hi
    Can anyone please help with a problem I'm having with merging data.
    The source table has multiple entries for the same Id e,g,
    ID Code
    1 123
    1 234
    2 123
    2 567
    The output should only have one row per ID e.g.
    ID Code_List
    1 123;234
    2 123;567
    Do you know what operator I could use that would allow me to do this? I've looked at unpivot but I think I would need multiple output fields (one for each Code). I have to concatinate the codes and separate with a semi-colon.
    Thanks
    GB

    Q) Input data
    =============
    COL_0,COL_4
    1235,"G0123,G124,G25,G6"
    1236,"G01,G23,G124,G25,G6"
    1237,"G0123,G1,G24,G25,G6"
    1238,"G,G0123,G124,G25,G6"
    1239,"G0123124,G256"
    Output
    ======
    TEST_ID,TEST_VAL
    1235,G0123
    1235,G124
    1235,G25
    1235,G6
    1236,G01
    1236,G23
    1236,G124
    1236,G25
    1236,G6
    1237,G0123
    1237,G1
    1237,G24
    1237,G25
    1237,G6
    1238,G
    1238,G0123
    1238,G124
    1238,G25
    1238,G6
    1239,G0123124
    1239,G256
    I wrote this procedure...
    declare
    rcd_cnt number;
    test_id123 number;
    junk_1 number;
    cd_occurences number;
    child_count number;
    str_abc varchar2(200);
    char_pos     number default 0;
    cd_temp_str varchar2(50);--:= 'G0123,G124,G25,G6';
    begin
    select nvl(count(col_4),0) into rcd_cnt from test_ee where col_4 is not null;
    for aa in 1 .. rcd_cnt loop
    select col_0,rownum rn,nvl(trim(col_4),0) into test_id123,junk_1,cd_temp_str from (select col_0,rownum rn,col_4 from test_ee where col_4 is not null) where rn = aa;
    --dbms_output.put_line('...I am in for loop...' || cd_temp_str);
         --dbms_output.put_line('===================' || rcd_cnt || '.................' ||aa);
    cd_occurences := length(cd_temp_str) - length(replace(cd_temp_str,','));
    dbms_output.put_line(cd_temp_str || '...Str Occurences are ...'||cd_occurences ||'**************'||test_id123);
    child_count :=0;
    for z in 1..length(cd_temp_str)+1 loop
    child_count := child_count+1;
         if(instr(cd_temp_str,',') > 0) then
         char_pos := instr(cd_temp_str,',',1,1);
              str_abc := substr(cd_temp_str,1,char_pos-1);
         dbms_output.put_line('..Partial String of..'|| z ||'..is.....' || str_abc);
              insert into test_xx(test_id,test_val) values(test_id123,str_abc);
         end if;
         cd_temp_str := substr(cd_temp_str,char_pos+1,length(cd_temp_str));
         if(cd_occurences=child_count) then
         dbms_output.put_line('..Partial String of..is.....' || cd_temp_str);
              insert into test_xx(test_id,test_val) values(test_id123,cd_temp_str);
         end if;     
    end loop; -- close for of z */
    --dbms_output.put_line('...I am in end for loop...');
         end loop; -- close for of aa
    end;
    instead of procedure,is there any way from sqlqery.

  • Mapping complete input XML structure into one field on target

    Hi,
    I have a scenario where I need to map the complete input XML structure as it is, into one field on target side. so can we achieve this in Graphical Mapping? If yes, please share your valuable info.
    Regards,
    Shiva.

    Hello,
    this is the java map code.just compile it and made a .zip file import it and use it Interface Mapping.
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.AbstractTrace;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    import java.util.Map;
    import java.io.*;
    public class PayloadToXMLField1 implements StreamTransformation {
        String strXML = new String();
       //Declare the XML tag for your XML message
       String StartXMLTag = "<DocumentBody>";
       String EndXMLTag = "</DocumentBody>";
       //String StartXMLTag1 = "<Code>";
       //String EndXMLTag1 = "</Code>";
        AbstractTrace trace;
        private Map param = null;
        public void setParameter(Map param) {
            this.param = param;
        public void execute(InputStream in, OutputStream out) {
            trace =
                (AbstractTrace) param.get(
                    StreamTransformationConstants.MAPPING_TRACE);
            trace.addInfo("Process Started");
            try {
                StringBuffer strbuffer = new StringBuffer();
                byte[] b = new byte[4096];
                for (int n;(n = in.read(b)) != -1;) {
                    strbuffer.append(new String(b, 0, n));
                strXML = strbuffer.toString();
            } catch (Exception e) {
                System.out.println("Exception Occurred");
            String outputPayload =
                StartXMLTag
             + "<![CDATA["
             + strXML
             + "]]>"
             + EndXMLTag;
            try {
                out.write(outputPayload.getBytes());
             trace.addInfo("Process Completed");;
            } catch (Exception e) {
                trace.addInfo("Process Terminated: Error in writing out payload");;

  • XML into one field

    Hi , we have a scenario where we have to move entire source structure into one of the fields of the target structure.
    Example:
    Source:
    item1
    description
    store
    storedescription
    price
    batch
    Target:
    item1
    store
    xmlstring
    we would like to do following mappings:
    1. item1 in source to item1 in target
    2. store in source to store in target
    3. entire source structure in XML format into xmlstring in target
    we reffered following blog , but couldnt map to our requirement.
    /people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping
    XML to single element: Attn: Henrique
    Thanks,
    Rajesh

    HI
    I think you need to write UDF for this. there is library from apache called XML Serializer. Below is the sample file how you achieve that using that. Use that code in your UDF.
    http://www.informit.com/articles/article.asp?p=31349&seqNum=3&rl=1
    Even just concatenate into one field in the target during mapping and the send the data . this could also achive your requirments. no need to go for Java mapping
    thanks
    Swarup
    Edited by: Swarup Sawant on Feb 15, 2008 11:42 AM
    Edited by: Swarup Sawant on Feb 15, 2008 11:42 AM

  • Get value of two fields into one field

    Hellou,
    i need little help with javascript again
    Currently i'm using code below to get value from one field to other:
    getField("Text35").value = getField("Text1").valueAsString;
    Now i'm wondering how to change this code, so i could get values from two fields into one. For example i have field "firstname" and field "lastname", now i want to show this in field "name".
    Example, if field firstname have value John and field lastname value is Doe, i want to show it in field name like "John Doe".
    I hope that u understood what i want
    Thanks for helping me!

    getField("Text35").value = getField("Text1").valueAsString + " " +
    getField("Text2").valueAsString;

  • SQL Query -How2bring multiple results into one field using Formatted Search

    Hi Everyone
    i am trying to bring in the results of the field dbo.Lot_ITEM.LOT using a formatted search into a row level using the following query:
    SELECT     dbo.LOT_ITEM.LOT
    FROM       dbo.DLN1 INNER JOIN dbo.LOT_ITEM ON dbo.DLN1.ItemCode = dbo.LOT_ITEM.ITEM
    WHERE     dbo.LOT_ITEM.ITEM=$[DLN1.ItemCode]
    however the result of the dbo.Lot_ITEM.LOT field could be more then one value depending on how many lots are assigned for that item
    (for example this query would be similar to assigning batch/serial numbers to an item being despatched - as you can choose multiple batches/serials depending on the quantities available and required and then move from the left to the right side of the selection window) if that makes sense!
    is it possible to bring in the multiple results into one field? and how can i amend the above query to include this?
    Thankyou in advance :o)
    Edited by: Asma Bi on Apr 23, 2008 7:22 PM
    Edited by: Asma Bi on Apr 23, 2008 7:24 PM

    Hi Suda
    Thanks for replying :o) but im not sure about the query?
    just to simplify it (as the query im working with is to do with 3rd party addons) i have used the serial/batchs field instead and used standard demo database fields from SBO 2005 sp01:
    SELECT     dbo.ixvSerialNoFact.SRI1_IntrSerial
    FROM       dbo.DLN1 INNER JOIN
                    dbo.ixvSerialNoFact ON dbo.DLN1.DocEntry = dbo.ixvSerialNoFact.SRI1_BaseEntry
    WHERE     dbo.ixvSerialNoFact.ItemCode='g1000' and dbo.ixvSerialNoFact.SRI1_BaseEntry = '193'
    The above brings me the relevant results but when i change it to be used in a formatted search:
    SELECT     dbo.ixvSerialNoFact.SRI1_IntrSerial
    FROM       dbo.DLN1 INNER JOIN
                    dbo.ixvSerialNoFact ON dbo.DLN1.DocEntry = dbo.ixvSerialNoFact.SRI1_BaseEntry
    WHERE     dbo.ixvSerialNoFact.ItemCode=$[dln1.itemcode] and dbo.ixvSerialNoFact.SRI1_BaseEntry = $[dln1.DocEntry]
    i cant seem to get it to work - now this may be because the serial number is not allocated until teh record is added to the system, however when this happens i am unable to go back in and manually trigger the query as the delivery note rows cannot be selected!
    i  think as what im originally wanting an answer for is same as this example, im wanting to know if this is even possible?
    Thanks
    Edited by: Asma Bi on Apr 24, 2008 3:53 PM
    Edited by: Asma Bi on Apr 24, 2008 3:55 PM

  • How to put the SQL-statement returned value into the field (as a default)

    Hi,
    I am using Developer/2000 (Forms Designer) under windows 98.
    Please tell me how to put the SQL-statement value (as a default value) into the field before enter-query mode. Noted that I have tried the following ways but still some problems:-
    1) Place the SQL-statement into PRE_QUERY trigger in the form/block level.
    There is a message box which ask 'Do you want to save the changes?'.
    2) Place the SQL-statement before execute enter_query. There is still a
    message box which ask 'Do you want to save the changes?'.
    Any hints? Thanks. Urgent.

    solved it!
    1) Suppress DEFAULT save message
    if form_failure then
    raise form_trigger_failure;
    end if;
    2) Place the default value before enter-query.
    Ref: Title='Default value in query field in ENTER_QUERY mode' in designer forum by CVZ
    form level trigger
    ============
    WHEN-NEW-ITEM-INSTANCE
    =======================
    if :system.mode = 'ENTER-QUERY' then
    :block.item := 'default waarde';
    end if;
    3) Suppress the changes whenever leaving the default field.
    if :block.item is null then
    -- assign statement
    end if;

  • Changing value of a field in mapping as per condition

    Hi Experts,
    I have one requirement in IDoc mapping to EDI structure.
    I want to change the value of a field depending on the condition. But the problem is the field is mapped at higher level than the condition.
    For example:
    Say i have a source structure in IDoc with name Source1 and target structure Target1. Source1 is mapped to Target1. Both of these structures have multiple occurances. So in general out structure will look something like below:
    Source1-> Target1
    Source2->Target2
    Source3->Target3
    Now i want to change value of one field from Target1 structure depending on Value of one field from Source3. At the runtime when Target1 structure is getting filled Source3 value is not visible so I am not able to set a proper condition.
    When at lower level we get value of Source3 can we change value of already filled structure Target1?
    Thanks,
    Atul

    Hi Aamir,
    Thanks for your reply.
    If possible can you give any sample code for this kind of UDF?
    Thanks,
    Atul Patil

  • How to find out the max/min value of one field corresponding to a second field in HANA through graphical way.

    Hi,
    I am trying to find out the latest delivery date(EINDT)  for each purchasing document (EBELN) through graphical way.
    The view contains other fields apart from the above mentioned two fields.
    When only the two fields (EBELN, EINDT) are there, then in semantics, I can select 'Max' as aggregation to get the maximum value for each document.
    If I do like this, then I need to join more than 3 views and also so many joins in calculation view. Taking so much time for data preview.
    Hence , please help me in getting the solution while the view contains other fields also.
    Thanks in advance.
    Thanks,
    Jyothirmayi

    Hi Sreehari/Vinoth,
    Thank you for your replies.
    if only two fields are then I can get the max/min values of one field corresponding to other field.
    But more than two fields are there with different values, then let me know how to find out the max/min value of a particular filed corresponding to the 2nd field with other fields also should be in the output.
    I hope you understood my issue.Please revert in case of questions.
    Thanks & Regards,
    Jyothirmayi

  • Problem in Showing multiple values into one text box.

    Hi all,
    How can show i multiple row values into one text box. here text box is multi line type.
    i have one table it has content column, it has number of rows. i need to show those data into one text box in form. how can i solve it?
    my sample code here,
    egin
    --:block3.txt_to := :parameter.p_current_user||''||':'||:block3.txt_From;
    -- go_item('txt_from');
    insert into chat(fromid,toid,content)values(:block3.fromid,:block3.toid,:block3.txt_From);
    :block3.txt_From:= null;
    commit;
    :block3.txt_to := :parameter.p_current_user||''||':'||:block3.txt_From;
    go_item('txt_from');
    declare
    cursor c4 is select content from chat where toid = :block3.fromid;
    rec1 c4%rowtype;
    begin
    open c4;
    loop
    fetch c4 into rec1;
    exit when c4%notfound;
    null;
    end loop;
    end;
    --select content into :block3.txt_to from chat where toid= :block3.fromid;
    end;
    please give me some tips to solve it.
    thanks
    gurus

    Hi,
    Try giving CHR(10) for line feed.
    DECLARE
         CURSOR C4 IS SELECT CONTENT FROM CHAT WHERE TOID = :BLOCK3.FROMID;
         Str_Temp VARCHAR2(20);
    BEGIN
         :BLOCK3.TXT_TO := '';
         OPEN C4;
         LOOP
              FETCH C4 INTO Str_Temp;
              EXIT WHEN C4%NOTFOUND;
              :BLOCK3.TXT_TO := :BLOCK3.TXT_TO || CHR(10) || Str_Temp;
         END LOOP;
         CLOSE C4;
    END;Regards,
    Manu.
    If this answer is helpful or correct, please mark it. Thanks.

  • To populate values into single field in an internal table

    Hi Friends,
    How we need to populate values into single field in an internal table.
    E.g itab consits of single field ( name)
           i need to assign values to this field name .like
          peter,
          john,
          abrahm,
          daneyal
    Pls tell me i how i need to code for this
    Thanks ,
    Parnith

    Hi,
    Please look at the below code :
    DATA : BEGIN OF itab OCCURS 0 ,
             name(20) TYPE c,
           END OF itab.
    START-OF-SELECTION.
      itab-name = 'Peter'.
      APPEND itab.
      CLEAR itab.
      itab-name = 'John'.
      APPEND itab.
      CLEAR itab.
      itab-name = 'Abrahm'.
      APPEND itab.
      CLEAR itab.
      itab-name = 'Daneyal'.
      APPEND itab.
      CLEAR itab.
      LOOP AT itab.
        WRITE : / itab.
      ENDLOOP.
    Thanks,
    Sriram Ponna.

  • BI for NW04S: Concatenating multiple chars into one field in BI query

    Hi,
      We have BI for NW04S. We have a requirement of concatenating multiple characteristics into one field in the BI report. This single field should have the usual drill down and other olap functionalities that a single characteristic usually enjoy in a BI report.
      In BI for NW04 (Not the S) this probably can be done using the table interface in WAD. However in BI7 WAD functionality are through Java.
      Also can this be done using Query designer alone.
      Can anybody help?
      Thanks

    Hi,
      Can you please elaborate on your Query designer option. You can always have a variable and in the user exit can write code, but what is not clear that
    1> How will you acheive the contatenation done for every row of the report in the BEX user exit variable( since it's called during the beginning of the query execution and not for all rows of the report
    2> How do you transfer the char variable into a char field in the report.
    Please elaborate .
    Thanks

  • Storing and retrieving multiple values into one cookie.

    Hi Everyone,
    I am wondering if anybody knows of any good tutorials involving storing multiple values into one cookie. Any URLs will be greatly apprecated. Thanks heaps.
    Regards
    Davo

    These are normally delimted in HTTP by a semicolon. You can concatenate the string yourself and on the reverse trip use StringTokenizer to get the values back out.
    - Saish

Maybe you are looking for