Mapping Logic for matching the qualifier from different segments

Hi all,
I have the following input file and i would like to have the output in mentioned way.
I have to look for the STOP from delivery segment, if that matches to the STOP in the E1ADRM4 segment means i have to take that date.
For the first STOP in the delivery segment is getting the correct date from the E1ADRM4 segment but for the second onwards it is not giving in the uotput.
Please suggest me how to achieve this
Input file
  <E1EDT20>
      <E1ADRM4>
         <STOP>01</PARTNER_Q>
         <PARTNER_ID>1108</PARTNER_ID>
         <APNTD>20101115</APNTD>
      </E1ADRM4>
    <E1ADRM4>
         <STOP>10</PARTNER_Q>
         <PARTNER_ID>1115</PARTNER_ID>
         <APNTD>20101130</APNTD>
      </E1ADRM4>
    </E1EDT20>
   <E1EDL20>
      <VBELN>0085001387</VBELN>
      <ZATEDLVINFO>
         <STOP>10</STOP>
         <PRO>do not update</PRO>
         <CONTAINER>do not update</CONTAINER>
         <VESSEL>do not update</VESSEL>
       </ZATEDLVINFO>
   </E1EDL20>
  <E1EDL20>
      <VBELN>0085009999</VBELN>
      <ZATEDLVINFO>
         <STOP>01</STOP>
         <PRO>do not update</PRO>
         <CONTAINER>do not update</CONTAINER>
         <VESSEL>do not update</VESSEL>
       </ZATEDLVINFO>
   </E1EDL20>
Output
<E1EDL20 SEGMENT="1">
            <VBELN>0085001387</VBELN>
            <ZATEDLVINFO SEGMENT="1">
               <STOP>10</STOP>
               <PRO>do not update</PRO>
               <CONTAINER>do not update</CONTAINER>
               <VESSEL>do not update</VESSEL>
               <APNTD>20101130</APNTD>
            </ZATEDLVINFO>
         </E1EDL20>
<E1EDL20 SEGMENT="1">
            <VBELN>0085009999</VBELN>
            <ZATEDLVINFO SEGMENT="1">
               <STOP>01</STOP>
               <PRO>do not update</PRO>
               <CONTAINER>do not update</CONTAINER>
               <VESSEL>do not update</VESSEL>
              <APNTD>20101115</APNTD>
            </ZATEDLVINFO>
         </E1EDL20>
Regards

Hi,
Try this UDF:
Execution type: All values of a context.
Input : var1, avr2, var3.
int a=var1.length;
int b= var2.length;
for(int i=0;i<a;i++)
for(int j=0;j<b;j++)
if(var2[j].equals(var1<i>))
result.addValue(var3[j]);
Mapping:
STOP(ZATEDLVINFO)
STOP(E1ADRM4)--UDF-SplitByvalue---APNTD
APNTD(E1ADRM4)
NOTE: Change the context of all the 3 input fields(set the context to its message type name).
Thanks
Amit

Similar Messages

  • Logic for retreiving the values from a dynamic internal table

    Hi all,
    I have an issue with the logic to fetch data from a dynamic internal table into fields. let me give you guys an example the sy-tfill = 9 (subject to vary). I need to populate the fields.
    Regards,
    Sukumar

    Hi,
    this is for printing out the info in a dynamic table,
    it will work likewise to insert data.
    PARAMETERS:
      p_tabnam TYPE tabname DEFAULT 'DB_TABLE_NAME'.
    DATA:
      lv_dref TYPE REF TO data,
      ls_dd03l LIKE dd03l,
      lt_fieldname TYPE TABLE OF fieldname,
      ls_fieldname TYPE fieldname.
    FIELD-SYMBOLS:
      <fs> TYPE STANDARD TABLE,
      <wa_comp> TYPE fieldname,
      <wa_data> TYPE ANY,
      <wa_field> TYPE ANY.
    REFRESH lt_fieldname.
    SELECT * FROM dd03l INTO ls_dd03l
                       WHERE as4local = 'A'
                         AND as4vers  = '0000'
                         AND tabname  = p_tabnam
                       ORDER BY position.
      ls_fieldname = ls_dd03l-fieldname.
      APPEND ls_fieldname TO lt_fieldname.
    ENDSELECT.
    IF NOT ( lt_fieldname[] IS INITIAL ).
      CREATE DATA lv_dref TYPE TABLE OF (p_tabnam).
      ASSIGN lv_dref->* TO <fs>.
      SELECT * FROM (p_tabnam) INTO TABLE <fs>.
      WRITE:
        / 'CONTENTS OF TABLE', p_tabnam.
      LOOP AT <fs> ASSIGNING <wa_data>.
        SKIP.
        WRITE:
          / 'LINE', sy-tabix.
        ULINE.
        LOOP AT lt_fieldname ASSIGNING <wa_comp>.
          ASSIGN COMPONENT sy-tabix OF STRUCTURE <wa_data> TO <wa_field>.
          WRITE:
            / <wa_comp>, <wa_field>.
        ENDLOOP.
      ENDLOOP.
    ENDIF.
    grtz
    Koen

  • How to get data from  different SEGMENTs

    Hi;
    My requirement is to first of all retrieve the data from different segments in run time.
    I mean, i have to execute t/code WE19 and the idoc will be given after that an user exit would called where i have to retrieve the data from different segments and then it would store in an internal table for further calculation.
    Can you all please guide me how to retrieve the data via ABAP code in runtime so that it can store in an internal table.
    Regards
    Shashi

    write code lke this ..
    form post_idoc tables idoc_data structure edidd
                                    idoc_status structure bdidocstat .
    loop at idoc_data .
      case idoc_data-segnam .
        when 'zsegment1'.
           move idoc_data-sdata to wa_zsegment1 .
        when 'zsegment2'.
          move idoc_data-sdata to wa_zsegment2 .
       when 'zsegmentn'.
          move idoc_data-sdata to wa_zsegmentn.
      endcase .
    endloop.
    After this write code to move data to int table from work area .
    endform .
    Hope this helps u....

  • Need Mapping logic for the following scenario

    Hi everyone,
    I need a mapping logic for the following scenario.
    For the same order no with same material no, the quantity should be summed and only one idoc should be created.
    For the same order no with different material no, no need to sum the quantity and only one idoc should be created.
    For example:
    Source Structure:
    Ord No      Mat No      QTY
    12               1               2
    13               1               3
    13               2               1
    12               2               4
    15               1               5
    14                3              7
    12               1              6
    Target Structure:
    Ord No      Mat No      QTY
    12               1               8
    12               2               4
    13               1               3
    13               2               1
    14               3              7
    15               1              5
    Thanks in Advance

    Try the graphical mapping as shown below using concat with a space as delimite and UDF to split the value again by space.
    1. Idoc node
    (RootContext)
    OrdNo
         |concat[ ] -> sort[asending] -> SplitByValue -> collapseContexts -> Idoc
    MatNo                case sensitive    [ValueChange]                              
    (RootContext)
    2. OrdNo
    OrdNo(RC)
         |concat[ ] -> sort[asending] ->SplitByValue->collapseContexts->SplitByVale-> UDF to fetch ordno  -> OrdNo
    MatNo(RC)           case sensitive    [ValueChange]                [eachValue]   (return var1.split(" ")[0];)
    3. MatNo
    OrdNo(RC)
         |concat[ ] -> sort[asending] -> SplitByValue ->collapseContexts->SplitByVale-> UDF to fetch ordno  -> MatNo
    MatNo(RC)              case sensitive    [ValueChange]                  [eachValue]   (return var1.split(" ")[1];)
    4. Qty
                   [asending,case sensitive]               
                   --  sortByKey -----> formatByExample -> sum ->Qty
    OrdNo(RC)           |          |          ^          
         |concat[ ] -> |            Qty(RC)          |
    MatNo(RC)           |                |     
                   --sort[asending]-> SplitByValue
                       case sensitive    [ValueChange]
    Regards,
    Sunil Chandra

  • Error occurred in deployment step 'Install app for SharePoint': The provided App differs from another App with the same version and product ID.

    I am facing this problem while start debugging the Provider-Hosted app through VS2013. I want to deploy the app with same version. So please let me know any solution
    to remove the app instance from office365 online, so that I can deploy the same app with same version on the specified "Developer Site".
    Note: If I change the version in AppManifesst.xml file then this problem/error gets resolved. But I want to deploy with the same version as
    per my business requirement.
    The actual error renders while I click to "Start" button of the Visual Studio 2013 to deploy the provider-hosted app, for the sake
    to deploying it on say "ABC" site collection (i.e. developer site). I work on office365 online. Therefore, request you to please provide the solution for SharePoint online office 365. The occurrences is:
    "Error occurred in deployment step 'Install app for SharePoint': The provided App differs from another App with the
    same version and product ID."
    Please assist me anyone. It will be so kind of you.....
    Naveen Kumar
    Steria India Ltd.

    Did you updated the  AppManifest.xml file
    and change the version.
    If this helped you resolve your issue, please mark it Answered

  • The Informatica maps are not taking the parameters from dac

    Hi All,
    The Informatica maps are not taking the parameters from dac. We have tried setting the parameters at DAC level, task level. The parameter file is getting generated by DAC and has correct values as we expect. But when we run a full load from DAC, the initial date in Informatica is being taken as 1/1/1753. Do we need to specify the parameter file name at workflow level?
    Is there any setting that we are missing. Please guide us and let us know the steps we should take to make sure that the parameters that we set at DAC level get passed to the Informatica maps. Also mention this is happening only with dates and other parameters like data source num , soruce and target database information is getting passed to Informatica maps.
    The version of Informatica as 7.4.1 and dac version AN 328, Build date Aug 8 2007.
    Please Help me in this issue.
    Thanks in advance for all members.

    Hi Ananth.v
    Try to make sure that your parameter file's path in Infa is in-sync with the path of DAC files being generated.
    The date you are getting seems strange - which are your Source/Target DB platforms?
    In general take a look at [this thread|   http://forums.oracle.com/forums/message.jspa?messageID=3405906#3405906] , it may make some thing clearer for you.
    Hope it helps,
    Please post if you found a solution,

  • Logic for determining the delivery address in PO

    Hi,
    We have a requirement (for a enhancment ) to get the country updated in the delivery address of a purchase order.  Would be highly helpful if someone provide me the logic for getting the country key from the delivery address tab.
    Our landscape involves SRM PO & ECC PO's and hence getting the details from Plant & s.loc will be o.k for ECC PO's , but for SRM PO's the details are updated from ship tp address.
    Regards
    Sudhakar

    Hi,
    U can get the country key ( LAND1)  in T001W table, by giving plant code, which u can get in EKPO ( WERKS) by giving PO no.
    Also u can get in ADRC table, thr u need to input ADRNR no. which u will get from T001W table by giving plant code.

  • Loadbalance for servers thats belongs from different Vlan

    Hi,
    We are using FWSM and ACE module in our switch. We have to configure our new application in cisco ACE. Our exiciting servers and vip are in vlan5 and new servers and vips are in vlan 6. vlan 6 is defined in FWSM. We have craeated one interface vlan 6 for the application. While checking the interface status  through "show interface vlan 6" we are getting the following error.
      Not assigned from the Supervisor, down on Supervisor
    We have already assigned vlan group to supervisor. We have allocated same interfce vlan to context also.
    kindly suggest what chould be the issue.
    Kindly suggest can we do the loadbalance for servers thats belongs from different Vlan???
    Thanks in advance.
    Regards,
    Ranjith

    Hi Daniel,
    We are using cisco 6509 switch with FWSM and ACE module.
    We have created interface VLAN 6 in FWSM and ACE and assigned the IP as follows.
    FWSM Interface VLAN 6 is 10.6.10.55 and ACE Interfce VLAN 6 is 10.6.10.60.
    We have 2 servers in the same vlan (.49 and .50). and they are physicaly connected to switch vlan 6 and logicaly connected to FWSM interface vlan 6.
    We have defined the VIP as 10.6.10.51 and that is not pinging from our network.
    Server default gateway and ACE default gateway is FWSM interface vlan 6 IP(ie, 10.6.10.55).
    We dont want to change the server gateway as ACE interface vlan 6 ip.
    KIndly suggest how can i achive the loadbalancing with out changing my server gateway to ACE IP.
    Thanks in advance.
    Regards,
    Ranjith

  • SAP logic for calculating the replenishment requirement - IS Retail

    Hi All,
              Could you explain from where does the RPLRQ field is getting picked up from the WRPT table.And what is the SAP logic for calculating the replenishment requirement for a particular article.
    Regards,
    PSS

    Dear PSS,
    Field RPLRQ represents for the replenishment requirement determined in the previous replenishment run. This can be changed when follow-on documents are created if order optimizing is active (for example, if quantities are to be rounded off).
    Bye,
    Muralidhara

  • Gui_download for transferring the data from internal table to excel sheet.

    hi all,
    i am using gui_download for transferring the data from internal table to excel sheet.
    I have a internal table with 3 columns col1,col2,col3 and I am getting the file at the specified path,but my problem is that,in the excel sheet(path specified) all the 3 columns values are printed in one column.Please help me.
    Thanks in advance.

    Hi Venkata,
    plz use FM 'SAP_CONVERT_TO_XLS_FORMAT' :
      call function 'SAP_CONVERT_TO_XLS_FORMAT'
        exporting
    *   I_FIELD_SEPERATOR          =
    *   I_LINE_HEADER              =
          i_filename                 = p_file
    *   I_APPL_KEEP                = ' '
        tables
          i_tab_sap_data             = t_mbew
    * CHANGING
    *   I_TAB_CONVERTED_DATA       =
    * EXCEPTIONS
    *   CONVERSION_FAILED          = 1
    *   OTHERS                     = 2
      if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    Hope this helps,
    Erwan

  • Lock NOT set for: Archiving the data from a data target

    Dear Expert,
    I try to archive one of my info cube, when i start to write the Archive file the Free Space in the Archive folder not enough and it make the process error.
    Then i try to changes the Archive folder to another path with enough free space. But when i start to write the archive file with new variant this error message came up :
    ==============================================================
    An archiving run locks InfoProvider ZICCPS810 (archivation object BWCZICCP~0)
    Lock NOT set for: Archiving the data from a data target             
    InfoProvider ZICCPS810 could not be locked for an archiving session 
    Job cancelled after system exception ERROR_MESSAGE                  
    ==============================================================
    Please Help Me.
    Wawan S

    Hi Wawan,
    If the earlier archive session resulted in error, please try to invalidate the earlier session in archive management and try running archive job again.
    Hope this helps,
    Naveen

  • Is there a way for preventing the placeholder from appearing if there is not content for it?

    I am creating a structure with tags and place holders.  However, not all my entries have all the same information. For example, my first entry has a 3 line address (123 West Street, Suit 23, Lincoln NE 68521) but my second entry only has 2 line address (456 North Street, Lincoln NE 68521).  When imported into my structure, the second address reads 456 North Street, <address2>, Lincoln NE 68521. My question for you is, is there a way for preventing the placeholder from appearing if there is not content for it?

    IJWAA,
    A work-around if you don't already use XSLT (to avoid having to) is to not have placeholder text, just use empty tags in your text layout that correspond to your incoming XML structure (any unused by the incoming structure IN ORDER, will be skipped). So long as you don't mind the blank line (rather than left over placeholder copy).
    If you had placeholder copy in your text box (<address2> for example) look at it using the story editor window (edit > edit in story editor, or command-y/control-y) so you can see the surrounding tags... style the surrounding tags by selecting them with the cursor and applying character or paragraph styles (with text in between the tags at the time) and then delete only the placeholder text from the middle of the sandwich, leaving the tags in tact. Trying to do this without being in the story editor will not work.
    Also, when importing the XML, I believe you'll still need to use "merge content" and "don't import empty white space" as you have been in order to replace placeholder text in any areas you had it.
    For situations when you have a mixture of dynamic and static text in the same text block and you are merging data (more so when the placeholder text has been deleted as I've suggested above but the dynamic tags for the possible incoming text are still there), you can use a tag you've created (I call mine "staticText") in your layout to wrap ANY bits of text you don't want to accidentally delete when the surrounding tags get populated or not, using the merge option upon importing your XML. Just be sure never to use "staticText" as an actual tag in your structure or surrounding incoming data. The text contained within staticText tags in your layout will be ignored by incoming data, and won't accidentally get deleted when it's sandwiched between two sets of tags that are dynamically populated when merge content is the import option.
    In my example below I'm using brackets/carats with the tag name instead of the color coded tag icon you see in the story editor, also I've used LB here to indicate a regular line break in Indesign and SP a regular space character in indesign:
    [staticText>Name:<staticText][firstName>Abc<firstName][staticText>SP<staticText][lastName>Xyz<firstName][staticText>LB<staticText]
    [staticText>Address:<staticText][address1><address1][staticText>LB<staticText]
    [address2><address2][staticText>LB<staticText]
    all other tags on following lines...
    This should just leave a blank line for address2 when no data comes in for it. I'm assuming you have line breaks, if not, all the better.

  • NEED THE LOGIC TO RETRIVE THE DATA FROM IT2001 SUBTY 0910 AND 0100

    HI ALL,
    ITS URGENT
    NEED THE LOGIC TO RETRIEVE THE DATA FROM IT2001(P2001) SUBTY 0910 AND 0100.
    BEST REGARDS
    SUNIL

    Hi,
    Please find the logic to retrieve the data from IT2001.
    <b>Infotypes : 2001 mode n."Declare the infotype in the infotypes declaration.
    Get pernr.
    RP-READ-ALL-TIME-ITY PN-BEGDA PN-ENDDA."Retrieves all the records of absence
    LOOP AT P2001 WHERE SUBTY = XYZ.
    Write the logic.
    ENDLOOP.</b>
    Regards,
    Pavan Kattamuri.

  • My contract is finishing, and now the operator what's to charge me 30US for unlocking the phone from the carrier. The say that it is Apple who charges them. Can this be true that that Apple want money for that?

    My contract is finishing, and now the operator what's to charge me 30US for unlocking the phone from the carrier. The say that they need to send a message to Apple and they charge them for the device to be unlocked?. Can this be true that that Apple want money for that? Or it is their lie and they don't really want to boather....

    No. Apple does not charge. It is entirely up to he carrier to set conditions and fees for unlocking.

  • How to grant access to sharepoint for the user from different Domain

    Hi All
        I need to grant access to user from different domain. 
        Where I can able to view the users in people picker (different domain).
    Thanks in Advance.
    Raj

     Hi
    Trevor Seward
    Sorry to disturb
    you again.
      I am trying to restrict user from search from other domain, say we have domain A and Domain B, where I am trying to restrict all the user from domain B (Search users)for a site collection. I have found couple of stsadmin command to do so. but none
    of them works. Below are the commands I have tried
    STSADM.exe -o setproperty -pn peoplepicker-searchadforests -pv "domain:<Name>.domain" -url "http://Site URL"
    stsadm -o setproperty -pn peoplepicker-searchadcustomquery -pv “(canonicalName=<Name>.domain*)” -url "Site URL"
    we have two way trust.
    Can you suggest any solution.
    Thanks 
    Raj

Maybe you are looking for

  • 10.4.6 Won't install now everything has gone pear shaped!

    Tried installing via software update only to be told installation could not be completed, so I tried downloading the PowerPC update, ran the installer only to be told again that due to an error, can't be installed. Now, when I try and run Software Up

  • Defining XSLT from Abap to XML and XML to Abap (Internal Table)

    Hi Experts, I need help with this XSLT for call transformation. I have defined an internal table and intend to use it as a source for Call Tranformation. But I have a Problem defining its XSLT and help would be greatly appreciated! I also wonder if t

  • G41 LCD flickers then goes dark

    My G41 LCD began acting up yesterday. For what it's worth, the LCD would turn back on for a few minutes after closing and opening the lid, then flicker and go dark. As I had trouble shot a bad NVIDEA card a couple of months ago, I decided to check fo

  • Re-install b/c of database corruption

    I have a small SCCM 2012 deployment where the SQL database has become corrupt (suspect) and I am unable to repair it. All of my backups have been over written so I don't have a backup to restore from either. I am looking at having to re-install every

  • I need help with my drivers on my windows 8 partition

    So i installed windows 8 with bootcamp and im pretty sure my drivers are messed up. On the windows side, my network connection is terrible, my second monnitor wont work, and when i try to run the games i got windows 8 for they are extremely slow. I h