Abap logic in Transformation end routine bringing 0 records

Hi,
I wrote this logic but is not populating the figure that I need. I am trying to get a Key figure /
field-symbols: <fs_rp> LIKE LINE OF RESULT_PACKAGE.
Types : Begin of s_itab,
S_ITEMID TYPE /N/ADSO_ASPC00-/N42/S_ITEMID,
STRDCOST TYPE /N/ADSO_ASPC00-/N42/S_STRDCOST,
End of s_itab.
Data : it_itab type table of s_itab,
wa_itab type s_itab.
LOOP AT RESULT_PACKAGE ASSIGNING <fs_rp>.
Read table it_itab INTO wa_itab with key S_ITEMID =
<fs_rp>-/N42/S_ITEMID.
Clear wa_itab.
if sy-subrc ne 0.
SELECT /N/S_STRDCOST /N/S_ITEMID FROM /N/ADSO_ASPC00 INTO
CORRESPONDING FIELDS OF wa_itab
FOR ALL ENTRIES IN RESULT_PACKAGE
       WHERE /N/S_ITEMID EQ RESULT_PACKAGE-/N/S_ITEMID.
ENDSELECT.
<fs_rp>-/N/S_STRDCOST = wa_itab-STRDCOST.
ENDIF.
ENDLOOP.

1. the name of the fields in the internal table it_itab and in table /n/adso_dsc00 are not the same, so you're move-corresponding is not working.
2. you need to select in table it_itab not in workarea wa_itab.
Data rp TYPE tys_TG_1.
field-symbols: <fs_rp> LIKE LINE OF RESULT_PACKAGE.
Types : Begin of s_itab,
/N/S_ITEMID TYPE /N/ADSO_DSOC00-/N/S_ITEMID,
/N/S_STRDCOST TYPE N/ADSO_DSOC00-/N/S_STRDCOST,
End of s_itab.
Data : it_itab type table of s_itab,
wa_itab type s_itab.
SELECT /N/S_STRDCOST /N/S_ITEMID FROM N/ADSO_DSOC00 INTO
INTO table it_itab
FOR ALL ENTRIES IN RESULT_PACKAGE
WHERE /N/S_ITEMID EQ RESULT_PACKAGE-/N/S_ITEMID.
ENDSELECT.
LOOP AT RESULT_PACKAGE ASSIGNING <fs_rp>.
Read table it_itab INTO wa_itab with key /N/S_ITEMID =
<fs_rp>-/N/S_ITEMID.
if sy-subrc ne 0.
<fs_rp>-/N/S_STRDCOST = wa_itab-STRDCOST.
ENDIF.
ENDLOOP.

Similar Messages

  • Abap logic in Transformation End Routine not working correctly

    Hi,
    I wrote a piece of code but during testing I found out that it doesn't meet my requirement.
    Requirement
    I want to extract Standard_Cost for all sales items that meets the conditon. but at the moment only the first sales item in the DSO is showing.
    I would like the following lines to display in the cube as well since the PLITEM is different.
    201021     PI31     REDBACK     999999A     78,850
    201021     PI31     FLXAAA     999999A     3154,000
    DSO Table
    CALWEEK     PLPLANT     PLITEM     SALESITEM     STRDCOST
    201020     IN06     FLXAAA     557868B     6308,000
    201021     FI24     FLXAAA     557868B     6308,000
    201021     FI24     FLXAAA     999999B     0,000
    201021     PI31     REDBACK     999999A     78,850
    201021     PI31     FLXAAA     999999A     3154,000
    InfoCube
    SALESITEM  PLPLANT       SALESDOC       STRDCOST
    999999A     PI31     1100000911         78,850
    Abap Logic
    Data ld_calweek(6) TYPE n.
    Getting the current week based on the system date.
    CALL FUNCTION 'DATE_GET_WEEK'
            EXPORTING
              date         = sy-datum
            IMPORTING
              week         = ld_calweek
            EXCEPTIONS
              date_invalid = 1
              OTHERS       = 2.
    Data rp TYPE tys_TG_1.
    LOOP AT RESULT_PACKAGE INTO rp.
    SELECT SINGLE STRDCOST FROM /N/ABC_EFG00 INTO
    rp-S_STRDCOST
    WHERE SALESITEM = rp-S_ITEMID  AND CALWEEK =
    ld_calweek AND PLPLANT EQ rp-S_SOURCE.
    MODIFY RESULT_PACKAGE FROM rp.
    Clear rp.
    ENDLOOP.
    How do I resolve this
    thanks

    Hi Vaidya
    Select single will always select the first entry from the source which matched your where condition.
    therefore you are not getting all the required data.
    WHERE SALESITEM = rp-S_ITEMID AND CALWEEK =
    ld_calweek AND PLPLANT EQ rp-S_SOURCE.
    according to your logic
    it will pick only one record e.g
    201021 PI31 REDBACK 999999A 78,850
    201021 PI31 FLXAAA 999999A 3154,000
    item id = 999999A
    plplant = PI31
    in this case it will pick only the first record due to select single will fetch only one record (whichever it gets first and which meets your where condition)
    You need to change your code logic and need to include more fileds which differentiates one record from another who have same valued as in your present where condition.
    Thanks
    Navneet

  • Poor performance of transformation end routine

    Hi Folks,
    I have written a transformation end routine to update a Cube for WBS Elements reading the Master Data and Hierarchy tables.  The code seems to be working but with a lot of time spent on reading the endroutine.  Could someone take a look and advice the efficient way to write this?
    Purpose: 
    Read WBS Element master data for the WBS Element delivered in the datapackage (comm. Structure).  Read the WBS Element hierarchy table for the WBS Element to determine what its level is. If the record is found, level is 4 and approval year is not empty, we use that. Otherwise if the record is found but it turns out to be a level 3, use the WBS element as well. If all fails (eg the level is 4 but there is no approval year), determine the parent WBS element, see code after else statement.
    Finally, if the WBS element above is the same as the one in the comm. Structure (for which we read already the master data in table t_h_wbs_elemt), fetch approval year from the table t_h_wbs_elemt (this increases performance because there is no need to read the master data for every new record), otherwise read the new WBS element master data in the header of t_h_wbs_elemt.
    Edited by: ramesh ramaraju on Jan 7, 2010 4:50 PM

    Hi,
    Try like this
    DATA: lv_nodename type RSSHNODENAME.
    DATA: lt_mwbs_elemt type table of /bi0/mwbs_elemt,
    lw_mwbs_elemt type /bi0/mwbs_elemt.
    DATA: lt_hwbs_elemt type table of /bi0/hwbs_elemt,
          lw_hwbs_elemt type /bi0/hwbs_elemt.
    ***instead of using select * try to specidfy the fields other wise it will fetch fiull records
    ***or if you are using select * specking a where condition avodi into corresponding fields instead use the field name
    select * from /bi0/mwbs_elemt
    into corresponding fields of table lt_mwbs_elemt.
    IF SY-SUBRC = 4.
    RAISE EXCEPTION TYPE CX_RSROUT_ABORT.
    ENDIF.
    ***instead of using select * try to specidfy the fields other wise it will fetch fiull records
    ***or if you are using select * specking a where condition avodi into corresponding fields instead use the field name
    select * from /bi0/hwbs_elemt
    into corresponding fields of table lt_hwbs_elemt.
    sort lt_hwbs_elemt by nodename.
    sort lt_mwbs_elemt by wbs_elemt.
    clear E_S_RESULT.
    loop at RESULT_PACKAGE into E_S_RESULT.
    clear lw_mwbs_elemt.
    loop at lt_mwbs_elemt into lw_mwbs_elemt
    where wbs_elemt = e_s_result-wbs_elemt.
    endloop.
    ***instead of looping again use a read statement
    read table lt_mwbs_elemt where where wbs_elemt = e_s_result-wbs_elemt binary search.
    clear lw_hwbs_elemt.
    loop at lt_hwbs_elemt into lw_hwbs_elemt
    where nodename = e_s_result-wbs_elemt.
    endloop.
    ***instead of looping again use a read statement
    read table lt_hwbs_elemt where where wbs_elemt = e_s_result-wbs_elemt binary search.
    clear lv_nodename.
    IF sy-subrc EQ 0 AND lw_hwbs_elemt-tlevel EQ 4
    and lw_mwbs_elemt-appr_year ne 0.
    lv_nodename = e_s_result-wbs_elemt.
    ELSEIF sy-subrc EQ 0 AND lw_hwbs_elemt-tlevel EQ 4
    and lw_mwbs_elemt-prog_def_s ne ' '.
    lv_nodename = e_s_result-wbs_elemt.
    ELSEIF sy-subrc EQ 0 AND lw_hwbs_elemt-tlevel EQ 3.
    lv_nodename = e_s_result-wbs_elemt.
    ENDIF.
    IF lw_mwbs_elemt-wbs_elemt ne lv_nodename.
    clear lw_mwbs_elemt.
    LOOP at lt_mwbs_elemt into lw_mwbs_elemt
    where wbs_elemt = lv_nodename.
    ENDLOOP.
    ENDIF.
    IF lw_mwbs_elemt-wbs_elemt EQ lv_nodename.
    E_S_RESULT-PROG_DEF_S = lw_mwbs_elemt-prog_def_s.
    E_S_RESULT-APPR_YEAR = lw_mwbs_elemt-APPR_YEAR.
    ENDIF.
    APPEND E_S_RESULT TO E_T_RESULT.
    ENDLOOP.
    REFRESH RESULT_PACKAGE[].
    MOVE E_T_RESULT] TO RESULT_PACKAGE.
    Regards,
    Ravi

  • Transformation End Routine - Aggregation - Dummy rule

    Hello,
    I am writing a transformation end routine.
    I would like to use a 'SUM' aggregation behaviour the key figures in my Result_Table instead of a MOVE.
    The help at sap http://help.sap.com/saphelp_nw04s/helpdata/en/e3/732c42be6fde2ce10000000a1550b0/content.htm
    says that
    "key figures are updated by default with the aggregation behavior Overwrite (MOVE)".
    In ordrer to do otherwise "You have to use a dummy rule to override this.".
    Could someone explain me how to do this?
    Claudio

    Claudio,
    Map your KF to a dummy KF and then set the aggregation to Summation.
    Then apply your transformation end routine and then the value calculated in the end routine will get summed up to the existing value.
    Arun

  • ABAP Logic in Transformations-Start or Field Routine

    Hi Experts,
    As i am new to BW Please update me with the ABAP logic  i need to implement in Transformation routine...and please advise me wether i can use that as a Start or field routine for a better performance.
    Target DSO:
    DSO A : Active Table:/BIC/AZDSOA
    Fields (ZLOC,ZPAY_ID,ZNPAY_ID,ZOPAY_ID & ZCHG_DTE)
    Source DSO
    DSO B : Active Table:/BIC/BZDSOA
    (ZLOC,ZPAY_ID)
    DSO C : Active Table:/BIC/CZDSOA
    Fields (ZLOC,ZPAY_ID,ZNPAY_ID & ZCHG_DTE(date))
    While Transfering Data from DSO B-->DSO A
    It should check DSO C for that ZLOC & ZPAY_ID
    If ZCHG_DTE IS Blank then it should pick ZNPAY_ID for that ZLOC & ZPAY_ID from DSO C and update ZNPAY_ID in DSO A
    if ZCHG_DTE IS not Blank then it should pick ZPAY_ID for that ZLOC & ZPAY_ID from DSO C and update ZOPAY_ID & ZCHG_DTE in DSO A
    ZPAY_ID - Pay ID
    ZNPAY_ID -New Pay ID
    ZOPAY_ID -Old Pay ID
    ZCHG_DTE -Change Date
    ZLOC     -Location.
    Logic in words:
    If Change date is Blank then it should pick new pay id for that Location & Pay Id and update NEw pay id field in DSO A
    If Change date is not Blank then it should pick  pay id for that Location & Pay Id and update old pay id field  & change date in DSO A
    Please update me with releavent code
    Thanks

    It must have something to do with your input variables - I ran this FM locally using my DOB and today's date and it worked fine.
    make sure your input date types are in the correct format for the FM.

  • Selecting, reading and sum of billing quantity for last 12 months in transformation end routine

    Hi experts,
    i have requirement to write end routine to read a DSO for last 12 months sales quantity for each month and sum value pass to keyfigure
    not interested using bex variable, while data loading from source to target dso in end routine i am trying to read another DSO which is same as my
    target dso where information is stored by fiscal period, year material etc. finally there is  a keyfigure in target whih needs to be filled with sum of 12
    months sales quantity, for each record form sourc to target maximum of 12 records will be in read dso (for 12 months) my routine is like below.
    i am not expert in abap please kindly gothrough and guide me in this
    TYPES: BEGIN OF s_/BIC/AZOSLS00,
    FISCPER  type /BI0/OIFISCPER,
    FISCVARNT  type /BI0/OIFISCVARNT,
    PLANT  type /BI0/OIPLANT,
    STOR_LOC  type /BI0/OISTOR_LOC,
    /BIC/MATERIAL  type /BIC/OIMATERIAL,
    VTYPE  type /BI0/OIVTYPE,
    BILL_QTY  type /BI0/OIBILL_QTY,
    END OF s_/BIC/AZOSLS00.
    DATA: it_/BIC/AZOSLS00 TYPE TABLE OF s_/BIC/AZOSLS00,
    wa_/BIC/AZOSLS00  TYPE s_/BIC/AZOSLS00.
    SELECT
    FISCPER
    FISCVARNT
    PLANT
    STOR_LOC
    /BIC/MATERIAL
    VTYPE
    BILL_QTY
         FROM /BIC/AZOSLS00 INTO TABLE it_/BIC/AZOSLS00
           FOR ALL
          ENTRIES IN RESULT_PACKAGE
           WHERE
    below field is from value of fiscal period (which is fiscal period -999 ex:  for 001.2014 this
    value will be 002.2013 so 12 months including current period)
    FISCPER >=  RESULT_PACKAGE-/BIC/ZFISCPERF
    below is result filed fiscal period (here i dont know which keyword or statement to be used to select
    interval values this between statement giving syntax error that can not be used in where for for all entries
    between RESULT_PACKAGE-FISCPER
            AND
             FISCVARNT = RESULT_PACKAGE-FISCVARNT AND
             PLANT = RESULT_PACKAGE-PLANT AND
             STOR_LOC = RESULT_PACKAGE-STOR_LOC and
          /BIC/MATERIAL = RESULT_PACKAGE-/BIC/MATERIAL .
        SORT it_/BIC/AZOSLS00 BY FISCPER FISCVARNT PLANT STOR_LOC
        /BIC/MATERIAL .
        LOOP AT RESULT_PACKAGE ASSIGNING <result_fields>.
          READ TABLE it_/BIC/AZOSLS00 INTO wa_/BIC/AZOSLS00 WITH KEY
    below dont know what statement i need to use in read statement for interval of fiscal periods
    giving error that >= can not be used
         FISCPER >=  <result_fields>-/BIC/ZFISCPERF
    FISCPER = <result_fields>-FISCPER
             FISCVARNT = <result_fields>-FISCVARNT
             PLANT = <result_fields>-PLANT
             STOR_LOC = <result_fields>-STOR_LOC
          /BIC/MATERIAL = <result_fields>-/BIC/MATERIAL
           BINARY SEARCH.
          BREAK-POINT.
          IF sy-subrc = 0.
    below for each record there will be 12 records in read so sume of 12 records quantity i need to pass to result again dont know what to say here
    sum statement giving error
                <result_fields>-/BIC/ZLSTSLS12 =
                 sum(wa_/BIC/AZOSLS00-BILL_QTY).
              ENDIF.
        ENDLOOP.
    friends please help me in this.
    Thanks
    Chandra.

    Hiii,
    If you only want to store last  12 months data in Target ODS .
    Then Create filter in DTP and write routine in filter for calmonth or fiscal period.
    Refer the below link to create filter routine :
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/80b2db87-639b-2e10-a8b9-c1ac0a44a7a6?QuickLink=index&…
    Regards,
    Akshay

  • Correct ABAP Logic in Transformations-Start or Field Routine Error

    Hi
    I have written this code in start routine to split the data record into 2 if  bic/zdte_trm is not initial.
    But i am getting below error please correct me where i was wrong
    LOOP AT SOURCE_PACKAGE ASSIGNING <source_fields>.
          IF NOT <source_fields>-/bic/zdte_trm = ' '.
    * append a new record to source_package with this field initialised
            CLEAR wa_source.
            MOVE <source_fields> TO wa_source.
            CLEAR wa_source-/bic/zdte_trm.
            APPEND wa_source TO SOURCE_PACKAGE.
          ENDIF.
        ENDLOOP.
    At a LOOP over an internal table, the table is not allowed to be changed 
      in the loop tail as a whole.                                            
    SORT, MOVE, REFRESH, CLEAR are, for example, not allowed.

    Hi Saurov,
    Thanks for all the help.....
    The code is working fine but
    I got a strange issue while using this code
    DSO Data (Exisiting Data )
    Emp ID---Start Date--End Date
    1-----01/01/2008----
    Data from source system
    Emp ID---Start Date--End Date
    1-----01/01/2008----01/05/2008
    The code is spliting that record into 2 records
    1-----01/01/2008----
    1-----01/01/2008----01/05/2008
    and in source system in can see total 3 records
    1-------01/01/2008   (Exisisting Record)
    1-------01/01/2008   (New)
    1-----01/01/2008----01/05/2008 (New)
    The key fields in DSO is Emp Id and End Date
    Please,please update me how to resolve this issue

  • ABAP Logic in Transformations-Start or Field Routine Error

    Hi,
    Below is the field routine in transformations that will calculacte No of Years between 2 dates (Source Field & System Date)
    It is showing me no systex Error but when i started data load ,Load is failing due to below mentioned error
    Routine:
    IF NOT SOURCE_FIELDS-/BIC/ZCYB_DOB IS INITIAL.
    CALL FUNCTION 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
    EXPORTING
    I_DATE_FROM = SOURCE_FIELDS-/BIC/ZCYB_DOB
    I_KEY_DAY_FROM = 00
    I_DATE_TO = SYST-DATUM
    I_KEY_DAY_TO = 00
    I_FLAG_SEPERATE = 'X'
    IMPORTING
    E_YEARS = RESULT.
    ENDIF.
    Error:
    The exception CX_STATIC_CHECK is neither caught nor is it declared in
    the RAISING clause of "EXECUTE".
    Please update me where i was doing wrong
    Thanks

    It must have something to do with your input variables - I ran this FM locally using my DOB and today's date and it worked fine.
    make sure your input date types are in the correct format for the FM.

  • ABAP Logic in Transformations-Start or Field Routine ENHANCEMENT

    Hi
    Currently i am calculacting age of an employee in years and months using FM.
    Source Object (DOB) is DATS and
    Target object (age) is Char (6)
    My requirment is to show age in YY.MM
    If an employee age is 65Y,8M..then it shoud be displayed as 65.08.
    If an employee age is 5Y,8M..then it shoud be displayed as 05.08
    The below code is working fine for the above sceaniro...
    BUT i need  to enhance the code for
    If an employee age is 100Y,8M..then it shoud be displayed as 100.08  and
    If an employee age is 65Y,8M..then it shoud be displayed as 65.08.
    Please update me how to proceed
    DATA: YEARS TYPE TFMATAGE,
              MONTHS TYPE TFMATAGE.
        DATA: Y_NUM(4) TYPE N,
              M_NUM(2) TYPE N.
    IF NOT SOURCE_FIELDS-/BIC/ZDOB IS INITIAL.
          CALL FUNCTION 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
            EXPORTING
              I_DATE_FROM    = SOURCE_FIELDS-/BIC/ZDOB
              I_DATE_TO      = SY-DATUM
              I_FLG_SEPARATE = 'X'
            IMPORTING
              E_MONTHS       = MONTHS
              E_YEARS        = YEARS.
          Y_NUM = YEARS.
          M_NUM = MONTHS.
          CONCATENATE Y_NUM+2(2) '.' M_NUM INTO RESULT.
        ENDIF.

    piece of cake...
    replace
    CONCATENATE Y_NUM+2(2) '.' M_NUM INTO RESULT.
    with
    IF y_num GE 100.
      CONCATENATE Y_NUM+1(3) '.' M_NUM INTO RESULT.
    ELSE.
      CONCATENATE Y_NUM+2(2) '.' M_NUM INTO RESULT.
    ENDIF.

  • How to write ABAP Logic in SAP Query to fetch records from many Tables

    Hi Expert,
    I have one requirement, want to display all BOM (Equipment BOM, Function Location BOM and Meterial BOM) from a particular plant.
    List of tables as below:
    EQST: Equipment to BOM Link
    TPST: Link Between Functional Location and BOM
    MAST: Material to BOM Link
    STPO:BOM item
    Requirement: When user enters Plant then SAP Query should execute and fetch all BOMs (as mentioned above) from STPO Table.
    I have done so far is as follows:
    I create User Group, Infoset and SAP Query.
    While creating INFOSET, i used 4 tables (EQST,TPST,MAST & STPO) and link between then is as follows:
    STPO-STLNR ---> EQST-STLNR : Left Outer Join
    STPO-STLNR ---> TPST-STLNR : Left Outer Join
    STPO-STLNR ---> MAST-STLNR : Left Outer Join
    Now its showing all BOM from all plants though I enter one Plant value.
    Please advise me to write SAP Query and Logic to fetch all BOM from selected Plant Value.
    Thanks,
    Jay.
    Edited by: jaykrishna007 on Jul 29, 2011 11:41 AM

    Hi FCannavo,
    Thanks for your quick reply.
    See, now I changed my Infoset design.
    I added one Plant Table (T001W) and then
    T001W-WERKS--->EQST-WERKS
    T001W-WERKS--->MAST-WERKS
    T001W-WERKS--->TPST-WERKS
    and then
    EQST-STLNR--->STPO-STLNR
    MAST-STLNR--->STPO-STLNR
    TPST-STLNR--->STPO-STLNR
    on selection screen, user will enter Plant Value.
    Now its showing some records, but i dont think so i would be correct output or not, please guide me whether it is correct or not?
    Thanks,
    Jay.

  • End routine logic

    I have two options to populate values for two info - objects (both are attributes of 0Mat_Sales):
    1. Read Master data
    2. End routine logic
    The reason why I am toying with the second approach is because some of the transaction records do not have a value for Distribution Channel and Sales Org. We are
    therefore writing some end routine logic to populate these records with a suitable value.
    If I read from master data will the transformation logic also take into consideration the logic written to populate Distribution Channel and Sales Org or is there
    a possibility that this could be missed.
    In effect what is called first the logic that is written in the end routine or the reading from Master data?
    Thanks

    Hi Deo,
    Master data rading step will be performed first as it is executed for individual record and it is part of transformation. But the logic you are going to write is part of End routine and it will be executed for each data package at the end just before updating data to target.
    If you use both the methods then the logic written in End routine will overwrite the result calculated by Read master data.
    Regards,
    Durgesh.

  • Can we have the RKF logic in transformation?

    Hello all,
    we have a lot of RKF created in our queries. I was wondering if we can write the same kind of logic in transformation itself like by writing some kind of code.
    The RKF we have is we are restricting the key figure by some characteristic. Example we are restricting the key figure with depending on the characteristics "Status" and its values. Like RKF Approved has the key figure and value of "Status" as approved. Pending RKF as Pending Value of "Status"
    Can we right some kind of like this logic in the transformation and include those many key figure in our cube so these RKF/key figures will be stored in cube rather than being calculated on the fly and the performance will be good?
    Thanks all in advance.

    Hi Kris,
    You can implement some ABAP logic in the update routines/transformations.
    You have to assign/map the original key figure from the info source to the key figure in the cube(RKF).
    In the mapping of the key figure use update type addition and update method as Routine.
    In the routine, you can check for the characterisitic value of the characteristic Status in the incoming record and assign the key figure value in the infosource to the key figure in the target (RKF).
    For each restrcted key figure you will have the corresponding key figure in the cube model and map it to the key figure(which was used in RKF definition) from the infosource.
    If you are using transformation, use routine as the rule type and implement the logic in the routine.
    PN - You are right the advantage of having key figures in the model would reduce the query response time, however it increases the loading time.
    Hope it helps,
    Regards,
    Sunmit.

  • Abap error in Transformation Endroutine - DSO Lookup

    Hi,
    I am trying to populate Key figure field in transformation end routine but I got this error.
    I have used similar code to perform DSO lookup without getting errors
    E:Unknown column name  "X_COST" until runtime, you cannot specify a field list.
    Data rp TYPE tys_TG_1.
    LOOP AT RESULT_PACKAGE INTO rp.
    SELECT SINGLE X_COST FROM DSO_CADO00 INTO rp- X_COST
    WHERE X_MATID  EQ rp X_MATID.
    MODIFY RESULT_PACKAGE FROM rp.
    ENDLOOP.
    thanks

    Hi,
    Just realised that  I was using the wrong DSO to fetch the data.
    It has now been corrected and the code is working properly.
    thanks alot

  • End Routine in virtual infoprovider based on DTP

    Hi gurus!!
    I'm facing the following problem. I need to have a Virtual Provider based on DTP based on a DataSource from a view of a table. But I want to do a end routine in the transformation rules. When I use the end routine, my filters don't work (always give al the information). If I don't use the end Routine (or start Routine) I can do filters work perfect.
    Any suggestions for this problems.
    Thanks a lot!
    Gorka Ibor.

    hi
    initially try to debug the rotines
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0038ad7-a0c7-2c10-cdbc-dd674682c8e7?QuickLink=index&overridelayout=true
    if you havent found any bug then
    check the links will help you
    Can I call values entered in DTP filter in transformation End Routine??
    Routines in DTP filters

  • How to add new records in Start routine or end routine.

    Hi All,
            My requirement is to transfer data from one DSO to anothe DSO. But while transfering a single record frorm DSO1 i want to add 7 records to DSO2 for each record in DSO1 with slight change in data( with a different key). I want to do it in start routine or end routine. How can i do it. If you have any ABAP code for this then please send.
    Regards
    Amlan

    you can use this code, replace the fields where i have marked with <>.
    DATA : WA_RESULT_PACKAGE TYPE DSO2,
           WA_RESULT_PACKAGE1 LIKE WA_RESULT_PACKAGE.
    DATA : IT_RESULT_PACKAGE LIKE TABLE OF WA_RESULT_PACKAGE.
    DATA : DATE1 TYPE SY-DATUM.
    DATA : DAYDIFF TYPE i.
    DATA : RECORD_NO type rsarecord.
    SORT RESULT_PACKAGE BY <KEY FIELDS> "specify the key fields here
    RECORD_NO = 1.
    LOOP AT RESULT_PACKAGE INTO WA_RESULT_PACKAGE.
         IF WA_RESULT_PACKAGE_1-<KEYFIELDS> NE WA_RESULT_PACKAGE-<KEYFIELDS>.
              WA_RESULT_PACKAGE_1 = WA_RESULT_PACKAGE.
              DAYDIFF = WA_RESULT_PACKAGE-ENDDATE - WA_RESULT_PACKAGE-STARTDATE.
                   WHILE DAYDIFF NE 0.
                        DATE1 = WA_RESULT_PACKAGE-STARTDATE + DAYDIFF.
                        MOVE DATE1 TO WA_RESULT_PACKAGE-<KEYFIELDDATE>.
                        MOVE RECORD_NO TO WA_RESULT_PACKAGE-RECORD.
                        APPEND WA_RESULT_PACKAGE INTO IT_RESULT_PACKAGE.
                        DAYDIFF = DAYDIFF - 1.
                        RECORD_NO = RECORD_NO + 1.
                        CLEAR DATE1.
                   ENDWHILE.
              CLEAR DAYDIFF.
         ENDIF.
    ENDLOOP.
    DELETE RESULT_PACKAGE[].
    RESULT_PACKAGE[] = IT_RESULT_PACKAGE[].
    Reg Point 3.
    The Key figures will then show up in the report aggregated.Hope that is fine with you.
    Note:
    Before loading data, in DTP set the semantic key with the key field of the DSO1.This brings all the similar data w.r.t the key fields from the PSA together in a single package.
    rgds, Ghuru

Maybe you are looking for

  • 1st generation ipod won't download music

    My firend just bought a 1st generation ipod and was only able to download a couple songs. He asked me if I could try and download some of my music on it cause I have a 20GB ipod of my own that works perfectly fine. But when I plug it in it just sits

  • Dell u2410 BANDING issues

    I use my DELL U2410 as my external monitor and I got some banding issues in some of the color. Especially in Blue and Black. It looks very pixelated. The driver provided by DELL is only for Windows and I tried to look for somehting online to see if t

  • 919 : Editing report

    Edit a report to modify the query, for example. Then, when I want to apply the changes, there is an error "name already used please enter new one". I have to drop and recreate the report. More critical : when exiting/restarting Raptor, all reports ar

  • Webcam continuous capture and save to avi later

    Hello, I am new to LabVIEW.  If anyone could help with the USB webcam and LabVIEW 2010.  I have all the IMAQ drivers installed. What I am try to do is capture video continuously into a buffer memory or an array and be able to extract that buffer vide

  • Mass Add Cross Dissolve

    Hi, I did a multi-clip edit and now have al of the cuts. Is there a way to have Final Cut go through and Add a cross dissolve transition after ever cut. So when it switches from angle to angle it cross dissolves. I am sure there is any easy way to do