Re:Transfer Routine to split an incoming data record

Hi ,
We need to split an incoming data record coming from R/3 in to multiple records before updating into the cube.
The requirement is as follows.
We are having a record whose structure is as follows:
Order No  | Transaction Value for 1st Fiscal Period |Transaction Value for 2nd Fiscal Period |Transaction Value for 3rd Fiscal Period |............................................Transaction Value for 16th Fiscal Period |
Now we want to update the cube with the following 16 records whose structure is as follows along with the above record.
Order No  | Transaction Value for 1st Fiscal Period |
Order No  | Transaction Value for 1st Fiscal Period |
Order No  | Transaction Value for 2nd Fiscal Period |
Order No  | Transaction Value for 3rd Fiscal Period |
Order No  | Transaction Value for 16th Fiscal Period |
Is there any logic to write the same?
Thanks,
Surya Pydikondala

Hi
You can achieve this by Start routine while Transformation -- For example you have a filed of lenth 200.
here create 4 infoobjects each of lengh 60chars -- Rule Details write a routine/formula-- for 1st field
result = -<field>0(60). It will take from 1 to 60 chars.-- For 2nd field --result = <field>60(60). It will take from 61 to 120 chars. --For 3rd field --result = -<field>120(60). It will take from 121 to 160 chars. --For 4th field --result = tran_structure-<field>180(60). It will take from 181 to 240 chars.
May be you can work with SRTING commands with the help of  ABAP.
Hope it helps

Similar Messages

  • Split the incoming data into multiple grouped output records

    I have three fields in the source, Student ID, Student name and Student Marks. I need to map the details in the destination, by grouping the data on the basis of marks obtained. Each time there's a new mark , the corresponding details of names and student
    ID is saved under the a new mark group that is created. how do i come about it when there are n number of new marks?

    for your scenario i used below xml as input,
    <ns0:Students xmlns:ns0="http://BTSTempProj.StudentDetailsIn">
      <Student>
        <StudentID>StudentID_0</StudentID>
        <StudnetName>StudnetName_0</StudnetName>
        <StudentMarks>10</StudentMarks>
      </Student>
      <Student>
        <StudentID>StudentID_0</StudentID>
        <StudnetName>StudnetName_0</StudnetName>
        <StudentMarks>20</StudentMarks>
      </Student>
      <Student>
        <StudentID>StudentID_0</StudentID>
        <StudnetName>StudnetName_0</StudnetName>
        <StudentMarks>10</StudentMarks>
      </Student> 
      <Student>
        <StudentID>StudentID_0</StudentID>
        <StudnetName>StudnetName_0</StudnetName>
        <StudentMarks>10</StudentMarks>
      </Student>
      <Student>
        <StudentID>StudentID_0</StudentID>
        <StudnetName>StudnetName_0</StudnetName>
        <StudentMarks>20</StudentMarks>
      </Student>
      <Student>
        <StudentID>StudentID_0</StudentID>
        <StudnetName>StudnetName_0</StudnetName>
        <StudentMarks>30</StudentMarks>
      </Student>   
    </ns0:Students>
    and here is the output, hope this is what you are looking for. 
    <ns0:Students xmlns:ns0="http://BTSTempProj.StudentDetailsOut">
    <StudentMarks>10</StudentMarks>
    <Student>
    <StudentName>StudnetName_0</StudentName>
    <StudentID>StudentID_0</StudentID>
    <StudentName>StudnetName_0</StudentName>
    <StudentID>StudentID_0</StudentID>
    <StudentName>StudnetName_0</StudentName>
    <StudentID>StudentID_0</StudentID>
    </Student>
    <StudentMarks>20</StudentMarks>
    <Student>
    <StudentName>StudnetName_0</StudentName>
    <StudentID>StudentID_0</StudentID>
    <StudentName>StudnetName_0</StudentName>
    <StudentID>StudentID_0</StudentID>
    </Student>
    <StudentMarks>30</StudentMarks>
    <Student>
    <StudentName>StudnetName_0</StudentName>
    <StudentID>StudentID_0</StudentID>
    </Student>
    </ns0:Students>
    Please find the below xslt which you can use, it is basically based on the Muenchian grouping suggested by Ashwin
    <?xml version="1.0" encoding="UTF-16"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:var="http://schemas.microsoft.com/BizTalk/2003/var" exclude-result-prefixes="msxsl var s0" version="1.0"
    xmlns:ns0="http://BTSTempProj.StudentDetailsOut" xmlns:s0="http://BTSTempProj.StudentDetailsIn">
      <xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />
      <xsl:template match="/">
        <xsl:apply-templates select="/s0:Students" />
      </xsl:template>
      <xsl:key name="groups" match="Student" use="StudentMarks"/>
      <xsl:template match="/s0:Students">
        <ns0:Students>
          <xsl:for-each select="Student[generate-id(.)=generate-id(key('groups',StudentMarks))]">
            <xsl:sort select="StudentMarks" order="ascending"/>
            <StudentMarks>
              <xsl:value-of select="StudentMarks/text()"/>
            </StudentMarks>    
            <Student>    
              <xsl:for-each select="key('groups',StudentMarks)">
                <StudentName>
                  <xsl:value-of select="StudnetName/text()"/>
                </StudentName>
                <StudentID>
                  <xsl:value-of select="StudentID/text()"/>
                </StudentID> 
                </xsl:for-each>
            </Student>
          </xsl:for-each>        
        </ns0:Students>
      </xsl:template>
    </xsl:stylesheet>
    Regards, Amit More

  • Regd Data Transfer routine Transport

    Hello All,
    I have created a Copy Control Data Transfer routine 60X in the Development System. This created a Include RV45C60X in the Include RV45CNNN. When I check the where used list for RV45C60X it shows Include RV45CNNN. When I transported it to Quality System this Include was created but it was not in the Include RV45CNNN and the system was giving a short dump when SO created with reference to Quote.
    I executed the program RV80HGEN and than also generated the Program RV45CNNN in the Quality system. Than the Include RV45C60X was shown in Include RV45CNNN and the system works fine. The where used list for RV45C60X does not show RV45CNNN even though it is in the Include RV45CNNN. Is that ok or something more needs to be done.
    Can you please clarify.
    Thanks,
    SNK.

    Hello friends,
    Any suggestions for this. Or is this not an issue.
    Thanks,
    SNK.

  • Copy data transfer routine.

    13.01.2009
    Hello Gurus,
    How do we make a copy of data transfer routine ??? I dont find any copy option ??
    Regards,

    There is sort of a trick you can use. In VOFM transaction, find the routine you wish to copy. Switch to Change mode (Ctrl-F1), then place the cursor in the field with the routine number and simply type the new routine number (e.g. 901) over the existing one. When you hit Enter, you'll be prompted to enter an access key to create a new routine.
    Access key may be obtained on the SAP's website (if you have an authorization) or from your Basis admin, as mentioned above.
    Copy/paste would also work, of course, after you have created a new, blank routine.

  • Data transfer routine in copy control

    Hi Need to spli deliveries based on danger and non-danger goods.
    Could any one suggest me on this.
    I know that we have t-code VOFM.
    But i am unable to know how should i proceed in this.

    Hi,
    It seems that you have good knowledge of data transfer routines.
    I have a requirement to transfer LIKP-WADAT_IST into billing date in VF01 T-code to create invoice.I am passing this date into VBRK-FKDAT in data transfer routine.,but it is  not not getting copied.Plet let me know the correct way of doing it.
    My routine looks like this:
    DATA: BEGIN OF ZUK,
              MODUL(3) VALUE '001',
              VTWEG LIKE VBAK-VTWEG,
              SPART LIKE VBAK-SPART,
            END OF ZUK.
            break SHARMAM.
       IF VBRK IS NOT INITIAL.
      ZUK-SPART = VBAK-SPART.
      ZUK-VTWEG = VBAK-VTWEG.
      VBRK-ZUKRI = ZUK.
      VBRK-FKDAT = LIKP-WADAT.
      ENDIF.
    Thanks in advance,
    Meena

  • Transfer Routine for Master Data

    I want to write a transfer routine to load the text.
    I want to load Short text as some word 'EXACT' in the T-table, if the value of that attribute is blank. While loading the master data.
    Eg: In 0Equipment there is some attribute say ZEQUI .
         I want a routine where: If ZEQUI is blank then load the Short text as 'EXACT'
    Please its urgent, can anybody tell me how to do this & some sample code....
    Thanks
    Regards,
    Maddy

    Texts are language specific so you will need to decide on what languages you want 'EXACT' to appear.
    Once you have that done, you can create a flexible update and write a transfer or update rule to read the attributes before populating the text table.
    some pseudo code would be:
    1) Select equipment and attributes into internal table
    2) Read internal table for specific record
    3) determine if the attribute field is blank
    4) If blank, return 'EXACT'

  • How to get data in a cube in transfer routine

    i have to get some data from another cube to compute some numbers in a transfer routine
    is there some function modules to do this?
    thank you for your help

    Hi Zelphar,
    You can use this function : RSDRI_INFOPROV_READ
    In ur routine ..
    And there is sample of code regarding that, you can open :
    1. t-code se38
    2. Open this program: RSDRI_INFOPROV_READ_DEMO
    Hopefully it can help you a lot .
    Best regards,
    Niel.

  • Transformation rule routine to split a record into several

    Dear Experts
    I have a small requirement but I am not good in programs.
    I have a DSO with data at year level.
    I want to transfer this data to a second DSO but split the yearly data into Quarters evenly  by copying the source KF value (PRICE) into the Quarters where each quarter value equals the yearly value of the first DSO.
    This is because the KF value is valid for the whole year. Thus, I need to copy this value into each quarter.
    So, I have an Additional field in the 2nd DSO for the Quarter.
    I have mapped the fields in the transformation but not sure how to write the Rule routine to for this additional field in the 2nd DSO.
    Is this possible using a Routine Rule?  Or must use an Start routine?
    Source: FY2010  KF $100
    Target DSO :
    FY 2010   QTR1 KF $100
    FY 2010   QTR2 KF $100
    FY 2010   QTR3 KF $100
    FY 2010   QTR4 KF $100
    Please point me to a suitable routine or kindly give me some code structure to follow.
    Thank you very much.
    Best regards
    Pascal

    Dear Durgesh
    I am unable to find 'Time Distribution' radio button in the transformation mapping screen.
    I tried writting a start routine but not sure which stage in the code structure to insert the following :
    The error message is : tyt_sc_1 is unknown.  But i have checked this forum that this is how its declared. I inserted this data declaration in different places in the code but the error or other error persists.
    Data : wa_source_package type tyt_sc_1,
               i_fq  like /BIC/ZFQ.
    Loop at source_package into wa_source_package.
    i_fq = '1'.
    concatenate wa_source_package-/bi0/fiscyear i_fq into wa_source_package-/bic/ZFQ.
    append wa_source_package  to  Source_package.
    i_fq = '2'.
    concatenate wa_source_package-/bi0/fiscyear i_fq into wa_source_package-/bic/ZFQ.
    append wa_source_package  to  Source_package.
    i_fq = '3'.
    concatenate wa_source_package-/bi0/fiscyear i_fq into wa_source_package-/bic/ZFQ.
    append wa_source_package  to  Source_package.
    i_fq = '4'.
    concatenate wa_source_package-/bi0/fiscyear i_fq into wa_source_package-/bic/ZFQ.
    append wa_source_package  to  Source_package.
    ENDLOOP.
    Please help . Thanks.
    regards
    Pascal

  • Info object transfer routine

    Hi,
    i had infoobject ZEBAY01 and need to write global transfer routine for this infoobject. Now the infoobject value is comming 0000999999 but the business wants the output value as 009999. They want to see output value as 6digit like (009999).can someone help me how to write code here
    ROGRAM CONVERSION_ROUTINE.
    Type pools used by conversion program
    TYPE-POOLS: RSD, RSARC, RSARR.
    TYPES: DE_ZEBAY01(000015) TYPE C.
    Conversion rule for InfoObject ZEBAY01
    Data type = CHAR
    ABAP type = C
    ABAP length = 000015
    FORM CONVERT_ZEBAY01
    USING RECORD_NO LIKE SY-TABIX
    SOURCE_SYSTEM TYPE RSA_LOGSYS
    IOBJ_NAME TYPE RSIOBJNM
    CHANGING RESULT TYPE DE_ZEBAY01 " InfoObject value
    RETURNCODE LIKE SY-SUBRC.
    $$ begin of routine - insert your code only below this line

    Hi Laxmi
    Use the below code.
    RESULT = RESULT+2(8).
      RESULT = RESULT(6).
      RETURNCODE = 0.
    First Result will take from 8 characters starting from first position. So you get rid of first two leading zeroes.
    Then take first 6 character from the result of above operation from the first character. You get rid off last 2 digits.
    Regards
    Anindya

  • Which is better transfer routine or update routine???

    HI ALL,
    I have read some documents, but I didnt get the real concept.
    Can any one explain in detail as to how do we decide where to write the code i.e a start routine or transfer routine or update routine...and which one is better  for a given scenario..
    with example?

    My scenario is like this:
    master data InfoObject for e.g. Z_MATERIAL1 with 10 fields as attributes. It has two Source Systems feeding it; SAP and a flat file from a system called Product Catalog (PCAT).
    The PCAT data is generally more reliable, hence, if a material XYZ comes from PCAT then PCAT is the owner of the material. SAP should not be able to update five critical fields of that material if PCAT owns the material.
    For e.g. the below values comes from PCAT and Master data is updated.
    PCAT
    Material Group Type Price Curr Unit Prod Desc. Lang Class
    XYZ      ABC   BRU  10.00 USD  PC  Inh   To    EN   001
    When the data comes from SAP R/3, it should not update anything other than the last 4 fields.
    SAP
    Material Group Type Price Curr Unit Prod Desc. Lang Class
    XYZ      ABC    BRU 20.00 USD  BOX  In   The    DE   003
    Finally the data in the Master Data Object should be as below.
    Material Group Type Price Curr Unit Prod Desc. Lang Class
    XYZ      ABC   BRU 10.00  USD  PC  In    The    DE   003
    where do i write the code...i have written this in start routine of transfer rules...i want to know the performance issues...

  • Transfer Routine required

    Hi,
    I am getting the Alpha Numeric (for example:150DD say)data for the field 0SALESEMPLY into the infosource 2LIS_11_VAHDR, but the data type for 0salesemply is NUMC in the info source.
    Because of this data type(NUMC) the data for this filed is loading only the numeric value i.e.,150 only, but not as 150DD into the infocube.
    In order to load load as alpha numeric value, i think i need to write Transfer Routine for the 0SALESEMPLY info object in the Transfer rules (in 2LIS_11_VAHDR), there by it can load alpha numeric values for this info object.
    So please provide me the <b>Routine</b> which can transfer the alpha numeric data for the existing Data type(NUMC) for the info oblect in the infosource 2LIS_11_VAHDR.
    Thanks & Regards,
    Kishore

    Hi Anil,
    <b>I am loading the data from a Flat file where the data</b> , that contributes to the info object 0SALESEMPLY in the the info source 2lis_11_vahdr, <b>in the flat file for the respective field is Alpha Numeric values.</b>
    But we have the 0SALESEMPLY (BW) info object with data type Numc which accepts only numeric values.
    so it is loading only the numeric values(ex: 150 say) of that field but not the entire alpha numeric value(ex: 150AR, say).
    so in this situation how can i proceed.
    Please respond asap......
    Regards,
    Kishore

  • Syntax error during transport on valid transfer routines

    Dear All,
    We have some routines in a tranfer structure that are valid and working just fine in DEV.  But when we transport them to QA we get the following error message :-
    Start of the after-import method for object type R3TR ISTS (Activation Mode)                
    Transfer structure 6DB_V_BW_EPISODE_AD activated under the name 6DB_V_BW_EPISODE_AD         
    It is not necessary to copy dependent objects for transfer structure 6DB_V_BW_EPISODE_AD    
    Syntax error in transfer routine for InfoObject OPEN_DAT                                    
    Activating Transfer Rules 6DB_V_BW_EPISODE_AD ...                                           
    47 Transfer Rule(s) of the transfer structure 6DB_V_BW_EPISODE_AD removed from control table
    53 InfoObject(s) of the transfer structure 6DB_V_BW_EPISODE_AD removed from control table   
    Formulas have been saved                                                                    
    Syntax error in transfer routine for InfoObject OPEN_DAT
    If we remove all the routines the activation works just fine even though our routines are valid and working just fine in DEV.
    Can anyone explain this as this is becoming quite urgent now ?
    Thanks in advance.
    Craig

    Hi Oliver
    I work with Craig. In response to your question, what he means is that all objects independantly have been transported ok, apart from the transfer rules. If you look at the table RSTSRULES you will see a column called CONVROUT_L.
    In our Dev system this field contains the BW generated rule code. Eg.
    45GEGC5I66GA9Z5G4KFDDRIK4 against the Transfer structure. When the after import process runs, it uses the contents of this table together with the contents of the RSAABAP table which contains the code and creates the transfer rule program.
    In RSAABAP we have the following code for CODEID '45GEGC5I66GA9Z5G4KFDDRIK4'
    DATA: l_s_errorlog TYPE rssm_s_errorlog_int.
    CHECK NOT &TS&-opened_date IS INITIAL.
    IF &TS&-opened_date < '19000101'.
    &RS& = '19900101'.
    ELSEIF &TS&-opened_date > '29990101'.
    &RS& = '19900101'.
    ELSE.
    &RS& = &TS&-opened_date.
    ENDIF.
    returncode <> 0 means skip this record
    &RE& = 0.
    abort <> 0 means skip whole data package !!!
    &AB& = 0.
    In our QA system the column is blank because of the wierd Syntax problem when generating the program, therefore the transfer rules dont get activated.
    As you can see there is no problem with the ABAP.
    Regards
    Mark

  • What is the order of execution of global transfer routine where multiple routines are involved?

    Hi,
    Suppose we have start routine, transformation routines and end routine defined between datasource and data target, and also we have a global transfer routine created on an infoobject.
    What is the order of execution of routines in this scenerio?
    Also if conversion routine like ALPHA is defined for an Infoobject, when does this come into flow.?
    Please enlighten me.
    Thanks,
    Akshara

    Hello Akshara ,
    The sequence of routines are as
    1. Start Routine
    2. Master Data Look Up or
    3. Field Level Routine
    4. End Rountine
    Apart from this , there is Expert routine, which is used in special cases, when there are not the sufficient functions to perform a transformation. It can be used as a interim solution , and it performs all the  functions of Start routine, end routine , field routine.
    Note : if you have created  transformation, and then created Expert routine, then system will delete all the existing transformations.
    Further to this, you can explore more, by debug the transformation as suggested by Vijay Kumar.
    Hope this helps !
    Regards
    YN

  • Errors in Transfer Routine for 0MATERIAL_ATTR

    I created a transfer routine on the 0Material_attr upload that needs to populate an attribute called Z_CPFX.
    Problem is, I need to look at the material number, material group, and the Material Description, and then populate the result based on what I find.
    I am new to using ABAP in these routines, so any help would be appreciated.  I will award points.
    The error I keep getting is E:Field "TRAN_STRUCTURE-MATNR" unknown.
    Could somebody take a look at my ABAP and advise what I'm doing wrong?
    Thank you.
    Ken
    $$ begin of routine - insert your code only below this line        -
    DATA: l_s_errorlog TYPE rssm_s_errorlog_int.
      DATA:   X_DESCRIPTION TYPE TABLE OF /BI0/TMATERIAL.       " KC01
        select  *
              into CORRESPONDING FIELDS of Table X_DESCRIPTION
             from /BI0/TMATERIAL
            where tran_structure-matnr = /BI0/TMATERIAL-matnr.
      IF MATKL between 765 and 770.
        RESULT = 'MAPOO'.
      ELSEIF MATNR(1) = 'X'.
        RESULT = 'MAPOO'.
      ELSEIF MATNR(1) <> 'X'.
        AND (MATKL = '750'
              OR MATKL = '751'
              or MATKL = '755'
        RESULT = 'MAPWK'.
      ELSEIF
        (MATKL = '756'
        or MATKL = '760'
        or MATKL = '761'
        and X_DESCRIPTION-TXTMD co 'renew'.
        RESULT = 'MAPRK'.
      ELSEIF
      (MATKL = '756'
      or MATKL = '760'
      or MATKL = '761'
      and X_DESCRIPTION-TXTMD !co 'renew'.
        RESULT = 'MAPMM'.
      ELSE.
        RESULT = space.
      ENDIF.
    returncode <> 0 means skip this record
      RETURNCODE = 0.
    abort <> 0 means skip whole data package !!!
      ABORT = 0.
    $$ end of routine - insert your code only before this line         -
    ENDFORM.

    Hi Kenneth,
    /BI0/TMATERIAL is the text table for 0material. If you are trying to get all the data from text table, please correct your select statement as below (text table does not contain the attributes. you might need to chenge the selection table to its attribute tables):
    select *
    into CORRESPONDING FIELDS of Table X_DESCRIPTION
    from /BI0/TMATERIAL
    where tran_structure-matnr = /BI0/TMATERIAL-MATERIAL.
    I also see that some of your syntaxes are wrong:
    eg: IF MATKL between 765 and 770. ==>
    IF( ( MATKL > 765 ) and ( MATKL < 770 ) ).
    Please look into the syntaxes of other statements as well.

  • SPLIT An R3 data flow

    Here is an example of how my flow is
    There is a reason for the split in R3 data flow . I wanted to know if it was possible
    Example:
    -->Data flow
                  ---> R/3 data flow
    >Two tables from SAP r/3 system is joined by a query and connected to the data transport
                    R/3 data flow-->Query->Target Table
    This is just an example but the actual implementation is more complex  (The above is one job)
    Is it possible this way
    >DataFlow          
                   -->Data flow
                  ---> R/3 data flow
    >Two tables from SAP r/3 system is joined by a query and connected to the data transport
    2nd Job
    The rest of the work
    I guess its not possible because the R/3 data flow has to be connected to a target
    But just want to if there is a possibility.

    Are you able to call the customers middleware externally and on-demand?  If so, you could use the "Custom Transfer" data transfer method and specify the middleware application details as part of the extraction process.  This will cover the mandatory middleware transportation requirement but still maintaining the integrity of the Data Services extraction.

Maybe you are looking for

  • BootCamp Update 3.2.  .exe file, Windows 7 uninstallable with cordless mouse until drivers in.   What next then?

    Trying to get windows 7 to run under iMac. I am learning to fly and the best flight simulator (I'm told) is still FSX which does not run on the iMac which I made my main computer infrastructure last year.  And besides it's got the best screen in the

  • How to turn off descriptive cursor in illustrator CS5.5

    Does anyone know how I can turn off the descriptive cursor when I move objects around in illustrator? - (see bottom screencap) I know there must be a place but can't find it . . . . I am new to this version. I am on a Mac OS X - 10.6.8 - and running

  • How to run adt.jar in headless mode?

    Hi, I am facing issues packaging flex iOS applicaition in headless mode. Here is the error I am getting: After googling, I found this error might not occur when run in headless mode. I have already set the <headless-server>true</headless-server> in t

  • CF7 - sending a form using "Enter" key

    As I wrote in the subject, i've goit a question. How can I send a form using the "Enter" key. When I push the Enter nothing happneds. Can someone help me?

  • Exception: java.security.AccessControlException

    hi, im writing a swing applet that uses a gif in a toolbar. it works fine in the appletviewer but when i try and run it in IE i get the following message: Exception: java.security.AccessControlException: access denied(java.io.FilePermission new.gif r