Routine problem in transformation

Hi sdners
               following is the secenrio, i had a doubt in that. i have to create a transformation routine for the field cost performance index= budegt cost of work performed * percentage of work complete/ direct effort + direct expences. these for infoobject loaded by flat file. so how to do write the code, weather i have to map all calcultion field in traget field. please guide me how to write the code.
hari

Hi Hari,
I am assuming you have the fields budegt cost of work performed, percentage of work complete/ direct effort and direct expences in the data source.
Now when you enter into routine, scroll up. There you will find CLASS lcl_transform DEFINITION.
  PUBLIC SECTION. Under that  you will see TYPES: BEGIN OF tys_SC_1,
Under that you will find the the technical names of all fields that you have mapped i.e budegt cost of work performed, percentage of work complete/ direct effort and direct expences. You will have to use it in result.
Now what you have to do is scroll down again and then go to :
Start of code *************
CLASS lcl_transform IMPLEMENTATION.
  METHOD compute_ZPYENTDT.
  DATA:
      MONITOR_REC    TYPE rsmonitor.
Skip all these, keep them as it is:
$$ begin of routine - insert your code only below this line        -
    ... "insert your code here
*--  fill table "MONITOR" with values of structure "MONITOR_REC"
*-   to make monitor entries
    ... "to cancel the update process
   raise exception type CX_RSROUT_ABORT.
    ... "to skip a record
   raise exception type CX_RSROUT_SKIP_RECORD.
    ... "to clear target fields
   raise exception type CX_RSROUT_SKIP_VAL.
RESULT = Technical name of budegt cost of work performed * technical name of percentage of work complete/ direct effort + technical name of direct expences.
End of Code **************
Hope this helps.
Thanks,
Rahul

Similar Messages

  • Infoobject routine problem in transformation using BI 7.0 datasource

    Hi expert,
    We have the business senario:need to look up data from Active data of DSO: /BIC/AZIN_O0100 into infoobject ZN1 in DSO:AAA through the link ZNR. We have the code, but after DTP, there are blank value in infoobject ZN1 in the content of DSO:AAA. Anyone can guide us why we get the blank in the value.
    DSO:AAA
    ZNR;ZN1
    Source field
    ZNR;
    Active data  /BIC/AZIN_O0100
    /BIC/ZNR;/BIC/ZN1
    Code in routine of infoobject ZN1 in transformation (BI 7.0 datasource)
        DATA: IT_ZN1 TYPE  /BIC/AZIN_O0100-/BIC/ZN1.
        SELECT /BIC/ZN1 INTO IT_ZN1 FROM  /BIC/AZIN_O0100
         WHERE /BIC/ZNR = SOURCE_FIELDS-ZNR.
        ENDSELECT.
        RESULT = IT_ZN1.

    Hi ,
    Please split this code in start routine and transformation routine.
    DSO:AAA
    ZNR;ZN1
    Source field
    ZNR;
    Start Routine
    Active data /BIC/AZIN_O0100
    /BIC/ZNR;/BIC/ZN1
    DATA: IT_ZN1 TYPE /BIC/AZIN_O0100-/BIC/ZN1.
    SELECT /BIC/ZN1 FROM /BIC/AZIN_O0100 INTO IT_ZN1
    FOR ALL ENTRIES IN SOURCE_PACKAGE
    WHERE /BIC/ZNR = <SOURCE_FIELDS>-ZNR.
    Transformation Routine
    READ TABLE IT_ZN1 with key
    /BIC/ZNR = <SOURCE_FIELDS>-ZNR BINARY SEARCH.
    IF sy-subrc = 0.
    RESULT = IT_ZN1 - FIELDNAME.
    Hope this answres you.
    -Vikram
    RESULT = IT_ZN1.

  • Problem with READ Statement in the field routine of the Transformation

    Hi,
    I have problem with read statement with binary search in the field routine of the transformation.
    read statement is working well when i was checked in the debugging mode, it's not working properly for the bulk load in the background. below are the steps i have implemented in my requirement.
    1. I selected the record from the lookuo DSO into one internal table for all entried in source_packeage.
    2.i have read same internal table in the field routine for each source_package entry and i am setting the flag for that field .
    Code in the start routine
    select source accno end_dt acctp from zcam_o11
    into table it_zcam
    for all entries in source_package
    where source = source_package-source
         and accno = source_package-accno.
    if sy-subrc = 0.
    delete it_zcam where acctp <> 3.
    delete it_zcam where end_dt initial.
    sort it_zcam by surce accno.
    endif.
    field routine code:
    read table it_zcam with key source = source_package-source
                                                 accno  = source_package-accno
                                                 binary search
                                                 transportin no fields.
    if sy-subrc = 0.
    RESULT  = 'Y'.
    else.
    RESULT = 'N'.
    endif.
    this piece of code exist in the other model there its working fine.when comes to my code it's not working properly, but when i debug the transformation it's working fine for those accno.
    the problem is when i do full load the code is not working properly and populating the wrong value in the RESULT field.
    this field i am using in the report filter.
    please let me know if anybody has the soluton or reason for this strage behaviour.
    thanks,
    Rahim.

    i suppose the below is not the actual code. active table of dso would be /bic/azcam_o1100...
    1. is the key of zcam_o11 source and accno ?
    2. you need to get the sortout of if endif (see code below)
    select source accno end_dt acctp from zcam_o11
    into table it_zcam
    for all entries in source_package
    where source = source_package-source
    and accno = source_package-accno.
    if sy-subrc = 0.
    delete it_zcam where acctp 3.
    delete it_zcam where end_dt initial.
    endif.
    sort it_zcam by surce accno.
    field routine code:
    read table it_zcam with key source = source_package-source
    accno = source_package-accno
    binary search
    transportin no fields.
    if sy-subrc = 0.
    RESULT = 'Y'.
    else.
    RESULT = 'N'.
    endif.

  • How do you identify the Logical system in start routine of a transformation

    My scenario is this.  I have five r3 systems that I am extracting from.   In the start routine of the transformation from the r3 data source to my data store I  am going to delete data and I need to know the source system id.    How do I identify the logical system or source system id in the transformation.  Is there a system field that contains this information.    I do not want to hard code the source system id in the routine.

    hi
    have a lool at tables rsreqdone and rsbkrequest with a join you should be able to determine the source.
    regards
    Boujema
    How to give points: Mark your thread as a question while creating it. In the answers you get, you can assign the points by clicking on the stars to the left. You also get a point yourself for rewarding (one per thread).
    Edited by: Boujema Bouhazama on May 9, 2008 12:04 AM

  • Problems with transformation; infoobject not updated in DSO.

    Hi all,
    We are having some problems with one of our transformations between PSA and DSO.
    Suddenly some of the fields are not filled in the DSO. The mapping for field Sales order number worked fine, and then I added an infoObject in the DSO to hold the info for Sales order item. I also replaced the infoobject that was supposed to hold the sales order number. After this, none of the two fields has any data in DSO. I checked the PSA, and the data is available here. I tested the rule in ‘Rule details’ and for sales order number it gives the correct result, but for sales order item it gives a runtime error; assertion failed. I checked on SAP Notes, and found 929934. But the corrections are already added in our system.
    Has anyone got any ideas on what to do?
    BR,
    Linda

    Hi,
    There are a number of problems in Transformation when either a source field or target field is changed.
    This can lead to inconsistent transformation.
    You can raise a message to SAP or best thing is if possible delete the Transformation and create a new one.
    Regards,
    Nitin

  • Syntax Error in Routine while Activating Transformation

    Dear All,
    I am activating whole scenario for 0SD_C03. we have made transformation for 2lis_11_vaitm, during installation we get below errors:
    - Rule (target: 0SUBTOT_1S, group: 01 Standard Group): Syntax error in routine
    -Rule (target: 0NET_VAL_S, group: 01 Standard Group): Syntax error in routine
    -Rule (target: 0PROD_CATEG, group: 01 Standard Group): Syntax error in routine
    I really appreciate your any input for this.
    Thanks & Regards,
    Darshan

    Hi,
    I hope there is inbalance in between SOURCE Datapackage and Target Datapackage. So in the start routines pls check it and it not found then add in DATA_PACKAGE...
    Check with ABAPer
    under ,
    TYPES:
          BEGIN OF tys_TG_1_full,
            SUBTOT_1S           TYPE /BI0/OISUBTOT_1S,
    and also you can fin dsimilar kind of threads in SDN.
    Re: Syntax Error in Routine while Activating Transformation
    Re: Issue while creating Transformation from Update rule.
    Re: 0IC_C03 activation of Transformation rule ends with ERROR
    Re: Error in activation of transformation
    Thanks
    Reddy

  • Question for inverse routine in the transformation for a virtual infocube

    Hello,
    I have a virtual infocube with it transformation and i want to know if there is a way to know in the inverse routine or in the start routine if in the query the user is selecting a filter value.
    When the user want to select one value for a characteristic the transformation is executed in order to obtain the infoprovider values. In this moment the inverse routine is executed and i want to know if there is a way to identify when the user is making a drilldown or a filter.
    In the start routine of the transformation i have an abap code with a very expensive time of execution to obtain some key figures values but i dont want that this abap code will be executed when the system executed the transformation to obtain the values for one characteristic in order to make a filter.
    Thanks in advance for your help. 
    Best regards.
    Ignacio

    Hi Ashish,
    Your document is very useful, in fact I used it to write my abap code, now Iu2019m getting the values of the query selection conditions, but what I need is after the report is showed in the first time.
    When data in report is showed, user has the possibility to filter values for one characteristic. If the characteristic has the option for filter value selection during query execution equal to u201COnly Values in infoprovideru201D , the inverse routine is executed to obtain the values that are contained in the infoprovider and then the system show all the possible values. What I need is to identify this event, because in this case I donu2019t want to make some calculations in the transformation that are very expensive in time.
    Thanks a lot for your information.
    Best regards
    Ignacio

  • Problem with transforming coordinate systems

    Hiho,
    i've got a problem with transforming coordinate systems.
    When I'm trying to transform a sdo_geometry object to another coordinate sytem and then back to the old system, the coordinates are not the same.
    Here's an example:
    StartSystem SRID is 8220 (Longitude / Latitude (DHDN))
    TargetSystem SRID is 8307 (Longitude / Latitude (WGS84))
    Original object:
    Polygon: {ExteriorRing: LineString: { (0.0, -90.0) (1.5, 0.0) (0.0, 90.0) (4.5, 0.0) (0.0, -90.0)} }
    Transformed object:
    Polygon: {ExteriorRing: LineString: { (0.0, -5156.620156177403) (85.94366926962347, 0.0) (0.0, 5156.620156177403) (257.8310078088704, 0.0) (0.0, -5156.620156177403)} }
    Transformed back to old system:
    Polygon: {ExteriorRing: LineString: { (0.0, -5156.620156177403) (4924.209525017614, 0.0) (0.0, 5156.620156177403) (14772.628575052844, 0.0) (0.0, -5156.620156177403)} }
    Any ideas what to do?
    Thanks for the help in advance.
    Dirk

    Hi Dirk
    Since the transform you are trying to do is just a datum conversion of lat./long. coordinates, even the first transform yields obvious rubbish. What you have provided here does not illustrate how you submitted your polygon to CS_TRANSFORM.
    Provide the syntax of your construction of the corresponding SDO_GEOMETRY object and your SQL select statement that gave these results.
    Bruce

  • Problem with Transformation Routine

    Hi all
    I am using a DSO 0FIGL_O02 taking data from the DataSource 0FI_GL_4 . I have a field 0Customer to the DSO & for that i´m taking data from the another DSO ZPCA_EC3 .
    The folllowing is the Tranformation Routine i have tried
    Routine 1,
    Data : zcustomer type /BIC/AZPCA_EC300-CUSTOMER.
    select single customer
           from  /BIC/AZPCA_EC300
           into  ZCUSTOMER
           where AC_DOC_NO = SOURCE_FIELDS-BELNR.
         RESULT = zcustomer.
    Routine 2.
    Data : zcustomer type /BIC/AZPCA_EC300-CUSTOMER.
    select single customer
           from  /BIC/AZPCA_EC300
           into  ZCUSTOMER
           where AC_DOC_NO = SOURCE_FIELDS-BELNR
            and  COMP_CODE = SOURCE_FIELDS-bukrs
            and FISCYEAR  = SOURCE_FIELDS-gjahr.
        RESULT = zcustomer.
    I dont get any errors for this Routine , But when i run the DTP it is going on Running & Running for hours, with no results , But again no errors also.
    What could be the problem  ?
    Could anyone help me write a better routine .here is my requirement
    I want to pick up 0Customer field data from ZPCA_EC3 based on 0AC_DOC_NO in both ZPCA_EC3 & 0FI_GL_4 DataSource.
    Regards
    Ramesh

    Hi,
    well I don't know the key of your ods. But the first check would be to use fields in the where clause which are in the key or a additional index. Another option might be to select the data for the complete data package at once into a internal table and access the internal table in the routine. May be you can also do the whole thing in the start routine.
    regards
    Siggi

  • Transformation routine problem - changing 2 infoobjects in 1 routine

    Dear all,
    i have coded a transformation routine which gets data from 4 infoobjects and writes into 1 infoobject.
    routine is like that:
    startdate-starttime-enddate-endtime
    routine  converts data into :  time difference / 0calmonth
    however i need to update also 0calmonth with that routine? how can i do that?
    when i define a rule, i guess it always update only one infoobject?
    thanks in advance.

    Hi John,
    sure you can. It is the same procedure as in update rules, but a start routine will only work if all your required fields are contained in the communication structure and so in the infosource. Otherwise you need to stay with the second routine.
    regards
    Siggi

  • Problem in transformation routine.

    Hi,
    I add new logic but it is not working. my understanding is if the condition (   IF <FS>-CALDAY > W_ZODPMSOB-CALDAY.) is ture then out from the loop, but when i debuge the code it is come on the loop and jump out from the loop it is not going to check the condition eventhough  <FS>-CALDAY  is less than the  W_ZODPMSOB-CALDAY.
    please help me to fix this problem.
    Thanks
       FORM apply_resettlement TABLES w_zodpmsob LIKE it_result.
      DATA : lv_tabix TYPE sy-tabix, rec_found(1).
      READ TABLE w_zodpmsob
          WITH KEY ba_objnrt = <fs>-ba_objnrt
           BINARY SEARCH.
      lv_tabix = SY-TABIX + 1.
      lOOP.
        IF <FS>-CALDAY > W_ZODPMSOB-CALDAY.
          EXIT.
          CLEAR: lv_tabix.
          READ TABLE w_zodpmsob
            WITH KEY ba_objnrt = <fs>-ba_objnrt
              BINARY SEARCH.
          lv_tabix = SY-TABIX + 1.
          IF SY-SUBRC NE 0.
            EXIT.
          ENDIF.
        ENDIF.
      ENDLOOP.
      <fs>-/bic/zamount_c = <fs>-amount * w_zodpmsob-/bic/zper_cap.
      <fs>-/bic/zamount_o = <fs>-amount * w_zodpmsob-/bic/zper_oper.
      <fs>-/bic/zamount_r = <fs>-amount * w_zodpmsob-/bic/zper_rec.
      <fs>-/bic/zamount_u = <fs>-amount * w_zodpmsob-/bic/zper_und.
      <fs>-/bic/zper_cap  = w_zodpmsob-/bic/zper_cap.
      w_recno = w_recno + 1.
      <fs>-recno          = w_recno.
    ENDFORM. "APPLY_RESETTLEMENT

    Hi Pria,
    First of all, do not worry. This is a easy fix.
    Can you please let me know what is the purpose you want the code? It is quite not clear with this piece of code as in this code we are just increasing the sy-tabix by 1 if the condition meet and do not meet.
    In your code, I can see that some statements are not required.
    ***lOOP.
        IF <FS>-CALDAY > W_ZODPMSOB-CALDAY.
    ***      EXIT.
          CLEAR: lv_tabix.
          READ TABLE w_zodpmsob
            WITH KEY ba_objnrt = <fs>-ba_objnrt
              BINARY SEARCH.
          lv_tabix = SY-TABIX + 1.
          IF SY-SUBRC NE 0.
            EXIT.
          ENDIF.
        ENDIF.
    *** ENDLOOP.
    I have added *** on the statements that are not required this applies for WHILE statement too. You ideally only need IF statement. But still it is not clear the purpose of your code. I do not see any modifications to the data etc.
    Can you please paste your complete code of endroutine and tell the purpose of your code?
    Regards
    Amit

  • Facing problem in transformation field level routine

    Dear experts,
    I have 2 ODS Example : ODS1 and ODS2 and for my target cube(Ex:CUBE1) ODS1 is source while loading data i want to refer ODS2.
    I place the data of ODs2 in one internal table.
    I want to check each and every records from my source and ODS2.
    I used read statement and loop seperately,Both works in different manner.
    Can anyone explain me what exactly loop and read will do?
    Kindly help as quick.
    Regards,
    Kiruthika...

    Hi,
    This is beacuse there is exactly one record which matches.
    In such cases you should always go with read.
    When you know x=y, then use read.
    when you know x=a, x=b, x=c so on use loop.
    also if you need all records where x>y or x<y or x>=y, basically conditions use loop.
    If you need patterns say x like %y, use loop.
    Final verdict, if there is only one and exactly one record which will be returned when you compare two key values then use read.
    hope this helps.
    thanks,
    rahul

  • Mapping(type routine) missing in transformation  2lis_03_bf - BCT 703, 704

    Hi Friends,
    i am on 703 BI content, than when i activated the 0ic_c03 infocube I observed that in transformation 2lis_03_bf mapping is missing, target field should is not mapped with source field, in earlier version of bi content target fields is gettinc caluclated by some routine and secondly start routine of 2lis_03_bf have syntax error, same with 2lis_03_bx and um transformation.
    so we upgraded to BI conetent 704 with patch 0001 than i reactivated the 0ic_c03 cube but though problem is same.
    so, we are now planning to upgrade support patch 0003 for BI content 704, will support patch 0003 for BI content 704 solve the problem or anyother thing required to do with current status of BI conetent 704 with patch 0001 to solve this issue?
    Regards,
    dushyant,

    Hi Colin Moloney  ,
    we applied the 0003 support pack/patch for the BI content 704 from patch 0001 of BI content 704,
    now start routine error of 2lis_03_bf is gone, transformation is comin as active verson once we do reactivation of object from BI content,
    But still missing the mapping rules in transformation.
    note 1179880 is saying that Import Support Package 3 into your system. is that mean patch 0003 for BI content 704?
    note content -  "Solution
    Implement Note 1171293 in your system. The following procedure depends on the release you are using.
    BI_CONT 7.04:
    A Support Package that contains all transformations is available for Release BI_CONT 7.04. Import Support Package 3 into your system.
    If you install Release 7.04 by upgrading from Release 7.03, only the changed objects (delta) are imported into the system. As a result, transformations may be deleted in the system, and you may only notice this when you activate the new BI Content from Release 7.04. The missing transformations are delivered completely in this Support Package"
    now what to do?
    regards,
    dushyant.

  • An issue regarding the routines in a transformation rule

    Hi experts,
    I have two fields in my transformation rule which i fill through characteristic routines. The second routine needs information provided by the first routine. For example:
    First char. A
    Sec. char. B
    In the routine for B i am using the field A which has to be filled in this moment through the first routine for a certain assignment.
    The problem is that i recognized that i get here the wrong assignment because in this moment in which the routine B is running the information provided by routine A is still not there. So i have analyzed and saw that the char. B has the position 25 in the transformation rule and the char. A has the position 27. Does it really mean that in the loading the char. B is filled at first and the char. A after that because of the order? Is that the problem why I don't still have information of char. A while i am filling char. B?
    If yes has anyone a good idea how to handle it? The further problem is that we can not change the order because the cube is filled and we have to delete the data at first in order to do it and it is not possible at the moment.
    I would really appreciate it.
    Thank you in advance.
    Kind regards,
    Ali

    Hi,
    AS we do not know what logic you are trying to write in field level routine so its pretty difficult to understand the scenario.
    I can suggest you to write the same logic in END Routine based on your requirement.
    Share your logic and code for more inputs.
    Hope it helps.
    Regards,
    AL

  • Lookup routine problem

    Hi
        I have problem in Lookup routine in transformation.
    But need for some object which were not in Standard infocube 0sd_c03, i have created one customize Infocube ZSD_C03_1 where data have been coming from Standard 0SD_C03 infocube by Lookup Transformation routine & running full load DTP in Daily basis. It is working fn till today.
    But problem is that now size of data is very huge while full DTP run from 0sd_c03 to ZSD_C03_1. can any one give suggestion what should i do for only delta data come. lookup routine should update data in daily.plz help

    Hi
    In that case i would suggest you to have a DSO between the data loding process as your expectation cannot be met with data
    loading between cube to cube.
    Just create a standard DSo between the cubes and do the data loading so that the delta handling will be as per your
    expectation
    Prathish

Maybe you are looking for

  • Find and replace a line in a text  file

    Hi All, I wanted to read a text file , find a line and replace that line with out affecting any other lines and with out creating a new file. If any one of you know any API to do this work ,please throw some light

  • Firefox is not showing certain informations on Facebook wall

    On my wall on facebook I don't see posts about pages I liked, pictures I commented and new friendships, just like only links and statuses are viewable. This is not happening in other browsers, I checked Opera and Chrome. == URL of affected sites == h

  • Unable to connect destinationPlease help me!

    I installed oracle Developer6.0 and Oracle 8i personal edition. I am able to login into oracle 8i. But when I was trying to connect it from front end(Developer 6.0) I am getting an error as: Unable to connect destination. Please help me out. OS: Wind

  • Modify Reporting Services Configuration File (RSreportserver.config)

    Trying to modify the config file (rsreportserver.config) which I found here: C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER2012\Reporting Services\ReportServer Would like to add an option "TXT" to this dropdown list: But the code under Rend

  • Failed to execute custom transfer program

    I have already looked at the custom transfer transport thread I checked all the parameter but still failing If anybody has done this before Please let me know what kind of transfer program uses and the configurations specially the custom transfer arg