Mapping Issue. Parsing problem to target Fields based on condition.

Hi All,
File to Idoc scenario.
My file looks like below.
HD 89650 28/01/11 "Presciber tan"
AF "disc-rsn"
RK "007287001" A
KE disc-code "007287"
KE addr-num "001"
DF fax-num ""
DF in-out "I"
DF phone-2 "23221"
AF "drs"
RK "007287" A
KE dr-num "00221"
KE addr-num "001"
DF affil "OPSM"
DF rec-stat "A"
DF phone-2 "12444"
AF "disc-rsn"
RK "dr-addraddress-1 17287|1EN" A
KE disc-code "008287"
KE field-name "address-1"
KE element " 1"
DF in-out "I"
DF phone-2 "1232"
DF post-code "3109"
DF provider-num "5349201J"
DF rec-stat "A"
T         24
I need to capture and create target segments only for the values "AF "disc-rsn"".And pass all the relavant rows (RK,KE,DF...) which are under "AF "disc-rsn"" to the target fields.
I'm struggling to parse the value to the output structure as RK,KE,DF will be present under anywhere like "AF drs", "AF disc-rsn" etc.
I'm able to create the target segments (2 Zdisc segments as 2 "AF disc-rsn" present in the file), but unable to parse the field values to the target fields.
Ex: DF phone-2 is present in 8th, 15th,22nd row. I need to pass only 8th and 22nd rows to the target fields.
After content conversion, My Source XML looks like below.
<?xml version="1.0" encoding="utf-8" ?>
- <MT_DiscountDetails>
- <HD>
  <KeyField>HD</KeyField>
  <HDRow>89650 28/01/11 "Presciber tan"</HDRow>
  </HD>
- <AF>
  <KeyField>AF</KeyField>
  <AFRow>"disc-rsn"</AFRow>
  </AF>
- <RK>
  <KeyField>RK</KeyField>
  <RKRow>"007287001" A</RKRow>
  </RK>
- <KE>
  <KeyField>KE</KeyField>
  <KERow>disc-code "007287"</KERow>
  </KE>
- <KE>
  <KeyField>KE</KeyField>
  <KERow>addr-num "001"</KERow>
  </KE>
- <DF>
  <KeyField>DF</KeyField>
  <DFRow>fax-num ""</DFRow>
  </DF>
- <DF>
  <KeyField>DF</KeyField>
  <DFRow>in-out "I"</DFRow>
  </DF>
- <DF>
Is there any way I can acheive my  mapping based on the above condition?? Kindly suggest me.
Thank you for your time.
Regards
Deepthi

Not required. Using Java function. Solved the issue.

Similar Messages

  • Issue in mapping the same source and target fields

    Hi All,
    I am working on PI 7.0 and currently I am connecting to PI 7.0 via citrix desktop . Problem here is : in the mapping , direct mapping option that is available to map the same source and target fields is disabled . I do know that this is due to some java version issue .
    What I want to know is there any possibilty of solving this issue without installing an updated java version ?
    Regards
    Vinay P.

    I've faced the same for many times and all of that were due to Java version.
    1st of all, you have to check the authorizations you have. If you have enough (DEVELOPER_J2EE, CONTENT_ORGANIZER_J2EE, and so), and - obvious but very often forgotten - you have to assure you're trying to change it in the message mapping change mode On.
    Then, last shot should be downgrade your Java version.
    The 1.4.2 JRE version allow you to use not only the Mapp the Identical field but also Dependencies, Clear Mapping and some other tools/buttons. As mentioned above, if there's a fix in the new Java releases, I do not know (hope so) and would appreciate if you could let us know.
    Tks.

  • Suppress Target structure based on condition

    Hi
    How to suppress target structure based on condition
    Example:
    Source is like:
    <Details>
    <Name>abdc</Name>
    <ID>234</ID>
    <Address>US</Address>
    </Details>
    I have two target structures
    1:
    <Details>
    <Name>abdc</Name>
    <ID>234</ID>
    <Address>US</Address>
    </Details>
    2:
    <Error>
        <ErrorID>
    </Error>
    if Any of the source filed is null then i dont want to map it to source structure. instead I want to assign an error id to ErrrorID node of the target.
    example
    abc,123,US
    abc
    in above case second record has two null values
    so my target structure should be
    <Details>
    <Name>abc</Name>
    <ID>123</ID>
    <Address>US</Address>
    </Details>
    <Error>
        <ErrorID>2nd record has erro</ErrorID>
    </Error>
    How to acheive this..
    Please help us
    Regards
    Sowmya

    hi ,
    plz try the following mapping
    Name-->exist-->if than else-> tuue----->Name
                                                        false---(constant)--
    error
    ID-->exist-->if than else-> tuue----->ID
                                                     false---(constant)--
    error
    adress-->exist-->if than else-> tuue----->address
                                                          false---(constant)--
    error
    regards,
    navneet

  • End Routine - populating Target Field based on Master Data

    Hi,
    I have an issue with my End Routine in BI 7.0. The scenario is as follows....
    The Target-Fields ZSALES_OFFICE , 0SALES_CHANNEL etc. are being mapped 1:1 from their respective source fields. In addition to these target fields I have a target field 0SALESORG which I need to populate based on the values from 0COMP_CODE which is an attribute of ZSALES_OFFICE. The values of 0COMP_CODE are 9000, 9001, 9002 and 9003 respectively. The end routine condition needs to be implemented as follows...
    For every 0COMP_CODE which has value 9000, 0SALESORG should be populated with the value "EAST". Similarly for every 0COMP_CODE which has value 9001, 0SALESORG should be populated with the value "WEST",  for every 0COMP_CODE which has value 9002, 0SALESORG should be populated with the value "NORTH" and  for every 0COMP_CODE which has value 9003, 0SALESORG should be populated with the value "SOUTH". I tried the following code but it doesnt seem to work. Could you pls help!!
    Thanks,
    SD
    DATA: it_tab4 TYPE TABLE OF /BIC/PZF31SALOFF,
              wa_tab4 TYPE /BIC/PZF31SALOFF.
        SELECT *
          FROM /BIC/PZF31SALOFF
        INTO CORRESPONDING FIELDS OF TABLE it_tab4.
        sort it_tab4 by /BIC/ZF31SALOFF.
        LOOP AT RESULT_PACKAGE
          INTO <result_fields>.
          read table it_tab4
          with key /BIC/ZF31SALOFF = <result_fields>-/BIC/ZF31SALOFF
          into wa_tab4
          binary search.
          if sy-subrc eq 0.
            CASE wa_tab4-comp_code.
              WHEN '9000'.
                <result_fields>-salesorg = 'EAST'.
              WHEN '9100'.
                <result_fields>-salesorg = 'WEST'.
              WHEN '9200'.
                <result_fields>-salesorg = 'NORTH'.
              WHEN '9300'.
                <result_fields>-salesorg = 'SOUTH'.
              MODIFY it_tab4 FROM wa_tab4.
            ENDCASE.
          endif.
        ENDLOOP.

    Replace your select statement ,
    SELECT *
    FROM /BIC/PZF31SALOFF
    INTO CORRESPONDING FIELDS OF TABLE it_tab4.
    instead of selecting all the fields , pick only the fields which are required.(one good performance improvement)
    SELECT    /BIC/PZF31SALOFF  comp_code
    FROM /BIC/PZF31SALOFF
    INTO CORRESPONDING FIELDS OF TABLE it_tab4.
    Remove the line below , this is not required
    MODIFY it_tab4 FROM wa_tab4.

  • Creating target field based on input node

    Hi all,
      I'm facing a problem in creating the target node based on input node. See if the input node value is repeated I don't want to create the target field for the second occurrence.
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_temp xmlns:ns0="urn:test">
       <row>
          <temp_id>1002</temp_id>
       </row>
       <row>
          <temp_id>1002</temp_id>
       </row>
    </ns0:MT_ItemEvent>
    In the above structure you can see the temp_id is repeated , I want to create only one target node. Plz help me to solve this.

    HI,
    Use the UDF and in that use Vector to create the result list with the values.
    use temp_id as imput and before that remove context
    after the UDF use the Splitbyvalue
    See the below code
    String () a;
    Vector prod = new Vector();
    for (i=0;i<a.length;i++){
    if(!prod.contains(a(i))) prod.add(a(i));
    Collections.sort(prod);
    for(i=0;i<prod.size();i++){
    result.addValue((String) prod.get(i));
    Regards
    Chilla

  • How to count number  of records for a field based on condition?

    Hi guys,
    I want to know how to find count of records coming from the database for a particular field based on some condition.
    I need to use this count to suppress some headers. Because of this i am not able to use running totals. Is there any other way?
    Ex scenario:
    I have account number and currency fields, those are coming from database. And i need to count the number of accounts whose currency is not Euro.
    Thanks in advance,
    Vijay.

    A simple formula can do that:
    //Formula begin
    if {your account field}<>"Euro" then 1
    //Formula end
    This formula can be summarized. (by group or report)
    Bryan Tsou@Taiwan

  • Message Mapping - NewLine generation  in the target field

    Hi ,
    This is a File to SOAP scenario, where text file is picked by XI and posted to target using webservice in the xml format.In the message mapping, I am supposed perform a logic where 3 fields in the source structured are to be concatenated and sent to the target structure. This fields at the target structure are to be displayed with a newline character.
    So if I am sending : abc, 123 and xyz as input and  the output should be in one field as follows :
    <ns3:OutputField xmlns:ns3=abc
                                                  123
                                                   xyz</ns3:StreetAddressLine>
    I have used this "&#x0D;&#x0A;" as the seperator in the concat function, hoping this would produce a new line but was hopeless.
    Any ideas are appreicated.
    Thanks,
    Rag

    Hi Raghav,
    XML will never show new line or space characters.
    Try to open the message in notepad or wordpad and then check if you can see the new line character.
    -Supriya.

  • How to Archive Files to Two target systems based on Condition

    Hi All,
    Iam doing Idoc--File Interface.
    we have to send the file to Two Different systems based on the plant condition
    If plant = 123 then send to ABC system ELSE if Plant = 999 then send it to XYZ system.
    And Archive the file to one Archive folder of the any one system. this is working fine correctly.
    Archive means not exactly Archiving, just we are droping one more extra file to Archive folder for refference
    Now i need to construct like this
    If plant = 123 then send to ABC system and Archive to Archive directory ELSE if Plant = 999 then send it to XYZ system and Archive to Archive directory.
    Please suggest me on this
    Regards
    Vamsi

    If Plant = 123 then select the BS1(ABC System)
    Ex: //sapdev/test/ABC/item.txt
    For Archive If Plant = 123 then select the BS1(ABC System) Archive folder
    Ex: //sapdev/test/ABC/Archive/item.txt
    If Plant = 999 then select the BS2(XYZ System)
    Ex: //sapdev/test/XYZ/item.txt
    For Archive If Plant = 123 then select the BS2(XYZ System) Archive folder
    Ex: //sapdev/test/XYZ/Archive/item.txt
    Then this becomes very simple:)
    I m assuming you are already using conditional Receiver determination,now for each receiver just configure an extra interface in Interface determination.
    so you will have 2 interface determination and each one of them will have 2 inbound messages,they can use same interface mapping.
    you already will have 1 conditional receiver determination.
    You can also do this via OS script if you have experience in that.
    Thanks
    Aamir

  • OIM Provisioning - Update target field just under condition

    Hello Experts,
    I need support to modify my SAP Target Provisioning.
    This is my scenario:
    - userA has a Resource SAP ECC.
    - I need that the 'Valid Through' field cannot be update if the SAP ECC resource is in status 'Disabled'.
    Is it possible?
    Thanks in Advance
    Best Regards,
    AT

    Hi Amit,
    thanks for your answer.
    At the moment the task that set our "Valid Through" atribute is linked to an adpter (type process task) that contanis just a "SET VARIABLE".
    We need to introduce an IF condition linked to the SAP Resource Status (Es. if the status is not 'Disabled'-> set variable).
    How can we do it using Design Console > Adapter Factory?
    If, into the Adapter, I add a new Util Task -> Oracle Identity Manager API, I can use an OIM Api method, but is not clear how to save the result value into an adapter variable..
    Could you give us some hints?
    Thanks in advance,
    Regards.
    AT

  • Problem in Spras field for join condition in creating new views

    Hi,
    I want to create a new view for three tables t1 t2 and t3 say.....i want to join this three tables like
    table    field         table   field
    t1      mandt     =   t2     mandt.
    t1      vkbur      =   t2      vkbur.
    And other condition is t2-spras = 'E' now.... how should i give this condition in the join condition as u have to give the other table name and the field name on the other side too..... table t1 has no filed in its table for the field spras.........so i just have to give t2-spras as 'E'. But this is throwing error...Please help

    Hi,
    1.u can specify the first thing i.e. t1 mandt = t2 mandt and t1 vkbur = t2 vkbur in the <b>join conditions</b> even if there is no relation ship b/w t1 and t2 on vkbur.simply u specify the join condition manually.
    2.for the second thing....wat u did is rite.......
    I think it will work.
    Thanks ,
    Jyothi.D
    want to create a new view for three tables t1 t2 and t3 say.....i want to join this three tables like
    table field table field
    t1 mandt = t2 mandt.
    t1 vkbur = t2 vkbur.
    And other condition is t2-spras = 'E' now.... how should i give this condition in the join condition as u have to give the other table name and the field name on the other side too..... table t1 has no filed in its table for the field spras.........so i just have to give t2-spras as 'E'. But this is throwing error...Please help

  • Highlight few fields based of condition

    Hi Experts,
    I have to highlight few fields which are changed.
    Scenario is, i am reading materials from SAP & displaying it in a view in edit mode for change. On send it has an aproval process befor updating SAP database. The approver should be able to see what are the fields changes by highlighting them.
    Along with that it should display the old value in tooltip.
    Regards,
    Nik.

    Hi,
    First try to implement the change log for these attirbutes...and create the context attirbute as STRING and also for
    highlighitng you need to use the cell design property.
    when you get the change log for these get the old value from that structure and set the value to this context attribute.
    Bind this attirbute to the TOOLTIP property of the field and cell deisign respectively.
    You might have got some button for APPROVAL right....
    In this button handler,
    get the change log,
    set the attributes.
    Regards,
    Lekha.

  • Dynamically Changing State of a field based on condition

    Hi,
    I have an existing view on the SRM portal which I have enhanced. There is a field Supplier. Requirement is when Invoice is created with reference to a PO, this field Supplier should be mandatory, But when Invoice is created without reference to PO, this field Supplier should be optional. Current by default this is a Required field on the view.
    Component Name is /SAPSRM/WDC_DODC_INV_O_BD
    I am new to Web Dynpro ABAP. Can someone please provide me the sample code to check this condition and change the state of this field Supplier dynamically. Also where should i write this code?
    Thanks and Regards,
      Vanessa

    hi
    In your method there would be a parameter ie ON_TOGGLE where you can write the name of your event .
    Whenever your checkbox will be clicked that event wil be called.
    You can write your code in that event itself.
    Regards
    Kuldeep

  • I need date mapping Below based on condition?

    Source sidefield:ZALDAT
    Taget Structure mapping condition:
    Format MMDDYY. If check is voided then it should be '000000'
    Taget field:Issue date
    I Need how to mapping source to target field based on conditioin explain me?give me saple mapping given condition?

    Hi,
    Try this udf
    youir input for this udf is "date" (which is a string)
    SimpleDateFormat sdf = new SimpleDateFormat("MMddyy");
    Date testDate = null;
    try
          testDate = sdf.parse(date);
    catch (ParseException e)
         return '000000';
    if (!sdf.format(testDate).equals(date))
        return '000000';
    return testDate.toString();
    code taken and modified from  http://www.dreamincode.net/forums/showtopic14886.htm
    Regards
    suraj
    Edited by: S.R.Suraj on Sep 29, 2009 7:53 AM

  • IDOC mapping issue (calculation using parent and child fields)

    We are mapping an IDOC to a file for output to a third party.  The IDOC has many segments, some of which are embedded.  This is where I'm having the issue.  I am trying to perform a calculation on a field from the parent node (E1EDP01-MENGE) with the field from the child node (E1EDP05-KRATE) to determine the total tax for that line (qty X rate). 
    <b>Issue:</b> The mapping that is in place is using the same MENGE value for all calculations, even where the E1EDP01 segment is not a parent of the E1EDP05 segment. 
    Please review the screen prints and explain how I can correctly group the E1EDP05 child segments rate field (KRATE) with the corresponding parent segment E1EDP01 quantity (MENGE).
    <b>Example:</b>
    Parent segment, E1EDP01 / Child segment E1EDP05 (There are many E1EDP05 segments for 1 E1EDP01 segment)
    E1EDP01 (parent node)
      E1EDP05 (child node)
    <b>Target structure</b>
    ITEM (parent) --->E1EDP01 is mapped at node level
      -->ITEM_DATA --->E1EDP01 is mapped at node level
      -->ITEM_TAX --->E1EDP01 is mapped at node level
           -->(fields for item_tax)
           -->Record type
           -->Invoice number
           -->Line total
           -->etc...
    I am mapping (E1EDP01-MENGE) for calculation with (E1EDP05-KRATE) to determine tax at the line item level. I have the context set at each Node, E1EDP01 for MENGE and E1EDP05 for KRATE.  I was using CopyValue, but this was using the frist occurence of MENGE for all line items.
    <b>mapping example</b>
    <u><b>*I am using MENGE (Copy_Value) then multiplying by KRATE to get the line item total.  This was causing the same MENGE (because of Copy_Value) for all line items.</b></u>
    E1EDP01-MENGE|Copy_Value|MULT--->TAX_ITEM-LINE_TOTAL
    E1EDP05-KRATE|
    I removed the CopyValue and now I'm getting the following error:
    Cannot produce target element /ns0:MT_DTN_INVOICE1/INVOICE/ITEM/ITEM_TAX[3]/LINE_TOTAL. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd
    How can I map this so the child records (E1EDP05) are grouped with the correct parent records (E1EDP01)?
    Thanks in advance!
    Michael

    Check this blog:
    /people/claus.wallacher/blog/2006/04/17/replication-of-nodes-using-the-graphical-mapping-tool
    Regards
    Stefan

  • Can we sort one field based on other field in messsage mapping !!

    Hi Folks,
    I have got source xml with couple of Vendors, Vendors has got promotions on different products with different dates. If I sort date field, product quantity is not sorting. How Can I sort both fields at the same time, if I sort Promotion date field in ascending order, the product quanitity has to sort respectively?
    Any one can help in this please , any links are examples etc..
    Kind Regards
    Thanks in advance.
    San

    Hi Folks,
    I have tried with this function SortbyKey, it always throuing exception. That's the reason I came to you guys. Please have a look following mapping
    ZY2K_DATE    ----> Remove Context -->
                                           Sortbykey  -----> Condition etc.,
    ZA02_QTY   -----> Remove Context -->
    if I try to see display queue on Sortbykey  I am getting ' Exception'
    Exception:[com.sap.aii.mappingtool.tf7.FunctionException: Queues have different lengths in function sortByKey] in class com.sap.aii.mappingtool.flib7.NodeFunctions method sortByKey[[Ljava.lang.String;@5be18f1d, [Ljava.lang.String;@357ae80b, SortComparator.CASE_SENSITIVE, SortOrder.ASCENDING, com.sap.aii.mappingtool.tf7.rt.ResultListImpl@1818459b,
    Source
    <ROOT>
    ...<OUTPUT>          - - - -       0..unbound
    .......<Group_LIN>    - - -        0..unbound
    ..........<Group_ZA>  - - -       0..unbound      
    ..............<D02_ZA>  - - -        0..unbound
    ..................<ZA01>QD</ZA01>
    ..................<ZA02>35.0</ZA02>
    ..................<ZA03>CT</ZA03>
    ..................<Z_Y2K_DATE>20100723</Z_Y2K_DATE>
    ..............</D02_ZA>
    ...........</Group_ZA>
    ........</Group_Lin>
    ....</OUTPUT>
    Target
    ProductDemandInfluencingEventNotification  0..unbound
    ...ProductDemandInfluencingEvent                 1..1
    .......Item                                                           1..unbound
    ..........OrderForecastTimeSeries                     0..1
    ..............Item                                                    1..unbound
    .................ValidityPeriod                                  1..1
    ......................StartDateTime                             0..1
    ......................EndDateTime                               0..1
    .................Quantity                                           1..1
    the above D02_ZA tag sometimes comes more than one QD with different dates. Same dates has to go under one tag with respective quantities!! This is the situation, can any solve this please?
    The target tag "ProductDemandInfluencingEventNotification" will generate based on number of promotions on particular date. Ex: if one vendor has 'n' number products promotions on 3 different dates, 3 "ProductDemandinfluenceevennotifications" has to generate, that three promotion dates and quantities has to respectively.
    That ZA02 (Qty) value has to go Quantity target field.
    Kind Regards
    San

Maybe you are looking for

  • Drive won't read any dvd ejects it automatically

    My drive Won't read any kind of DVDs, it keeps ejecting automatically after spinning for a while. it's been going on for a while now. please help!!!!!

  • Instrument I/O Assistant Missing

    Hi I am trying to communicate with an oscilloscope through Labwindows CVI by making use of the Instrument I/O Assistant, and on this site it shows how one is able to do that: http://zone.ni.com/devzone/cda/tut/p/id/4554 However in my tools menu there

  • TS3274 New IPAD Power plug gets hot

    I have a one week old new IPAD. The power plug that comes with the IPAD gets very hot upon charging (the bulk portion that gets into wall socket). I had IPAD2 and never faced this issue? Should I take it to an Apple Shop for replacement?

  • Problem with Rebate Agreement Sales Volume

    Hi, I executed the rebate recalculation via SDBONT06 for a total of 93 agreements on 04.08.2014 and therefore the sales volume was updated and there was no message in VBO3 as well. But today when i am checking the agreements all of them are showing m

  • Getting Wireless PCMCIA card to work

    Attempting to get a Linksys wpc54G wireless PCMCIA card to work on my 1.5Ghz G4 PB. I verified that the card works, by plugging it into to a PC.. ( works fine) Plugging the card into my pcmcia slot, on nothing. No lights.. nothing. I get the PCMCIA i