Pulling the condition records - help in the ABAP code -urgent!!!!!

hi folks,
I need some urgent help here..
I have discussed this portion before in the forum  but there are some changes and I need some help here.
The code goes like this....
select knumv kschl kbetr kwert
  from konv into table cdata
     for all entries in bodyitab21
    where konv~knumv = bodyitab21-knumv
                 and konv~kwert > 0.
I am successfully pulling the data into cdata here..
I need to check for various condition types that are around 100. I need to split them into two types because some condition types containe just pricing values while some others have values in % (but the value not stored in that format) To do the extra coding I have use two differetn case statements and that's what i have done here.
<b>My probelm is I will have to check for each condition type, if the 'kwert' field has some value in it pull the data  and there is a condition text associcated to it in the table 'T685T' that needs to be pulled into the itab.
This process has to be done for every condition type.</b>Given this scenario how can i do it?
    loop at cdata  into wac.
    case wac-kschl.
         when 'ZRAT' OR 'ZAGR'  OR 'ZRCR' OR 'Y098' OR 'Y007' OR 'ZREW' OR 'Y106' OR 'ZTSR' OR 'Y127' OR 'Y125' OR 'Y126' OR 'Y124' OR 'Y157' OR 'Y092' OR 'Y085' OR 'Y090' OR 'ZMZD' OR 'Y215' OR 'Y214' OR 'Y111' OR 'ZC$D' OR 'ZAUD' OR 'ZTHX' OR 'ZCOL'
OR 'ZCFE' OR ZSPA' OR 'ZBOX' OR 'ZCOR' OR 'Y130' OR 'ZBOR'
OR 'Y108' OR 'ZFPP' OR 'Y204' OR 'Y200' OR 'Y202' OR 'Y201' OR 'Y203' OR 'Y002' OR 'ZSCR' OR 'Y128' OR 'Y100' OR 'ZABS' OR 'ZSMG' OR 'ZFRE' OR 'ZREC' OR 'ZCOM' OR 'ZPMG' OR 'BEMG' OR 'ZDTI' OR'ZBET'.
<b>***** the first set of these condition types have just values</b>     if wac-kbetr = ' ' AND wac-kwert = ' '.
               continue.
             else.
              p = wac-kbetr.
              i = p.
              c = i.
              MOVE c to w_accitab-zrate.
                 MOVE wac-kbetr to w_accitab-zrate.
              MOVE wac-kwert to w_accitab-zsubtotal.
            endif.
    when 'ZSED' OR 'ZRFQ' OR 'ZIMP' OR 'ZERR'
     OR 'ZECD' 'ZAC1' OR 'ZAC%' OR 'ZAC2' OR 'ZSED' OR 'ZRFQ' OR 'ZIMP' OR 'ZERR' OR 'ZECD' 'ZQUD' OR 'ZEMP' OR 'Y101' OR 'Y012' OR 'ZCHU' OR 'Y054' OR 'Y065' OR 'Y066' OR 'Y067' OR 'Y068' OR 'Y069' OR 'Y096'
OR 'Y103' OR 'Y010' OR 'Y070' OR 'Y071' OR
'Y072' OR 'Y073' OR 'Y074' OR 'Y075' OR 'Y076'
OR 'Y077' OR 'Y078' OR 'Y079' OR 'Y156' OR OR 'Y148'
OR 'Y102' OR 'Y205' OR 'Y206' OR 'Y207' OR 'Y208' OR
'Y209' OR 'Y213' OR 'Y210' OR 'Y211' OR 'Y212' OR 'Z%DS'
OR 'Z%DO' OR 'Y113' OR 'Y151' OR 'Y152' OR 'Y153' OR
'Y154' OR 'Y155' OR 'Y147' OR'Z%PB' OR 'Y142' OR 'Y131'
OR 'Y141' OR 'Y149' OR 'ZDEO' OR 'Z%DR' OR 'Y115' OR
'Y116' OR 'Y095' OR 'Y084' OR 'ZSA$' OR 'ZSA%' OR
'ZPA$' OR 'ZPA%'.
the second set of these condition types have just values that has to be converted into %.
           if wac-kbetr = ' ' AND wac-kwert = ' '.
            clear w_accitab-zrate.
            continue.
          else.
            p = wac-kbetr.
            p = p / 10.
            if p < 1.
              rate+0(1) = '-'.
            endif.
            if i = 0.
              clear w_accitab-zrate.
             else.
            i = p.
            c = i.
            shift c right deleting trailing '-'.
            concatenate rate c '%' into rate.
            condense rate no-gaps.
                 MOVE wac-kbetr to w_accitab-zrate.
            MOVE rate to w_accitab-zrate.
            clear rate.
            MOVE wac-kwert to w_accitab-zsubtotal.
          endif.
        endif.
Thanks alot in advance.
Santhosh

Maybe this will help you,  otherwise I'm missing something.
[code]
data: begin of wac,
      kschl type t685t-kschl,
      vtext type t685t-vtext,
      end of wac.
case wac-kschl.
when 'ZRAT' or 'ZAGR' or 'ZRCR' or 'Y098' or 'Y007' or 'ZREW' or 'Y106'
or 'ZTSR' or 'Y127' or 'Y125' or 'Y126' or 'Y124' or 'Y157' or 'Y092' or
  'Y085' or 'Y090' or 'ZMZD' or 'Y215' or 'Y214' or 'Y111' or 'ZC$D' or
     'ZAUD' or 'ZTHX' or 'ZCOL' or 'ZCFE' or 'ZSPA' or 'ZBOX' or 'ZCOR'
or 'Y130' or 'ZBOR' or 'Y108' or 'ZFPP' or 'Y204' or 'Y200' or 'Y202' or
  'Y201' or 'Y203' or 'Y002' or 'ZSCR' or 'Y128' or 'Y100' or 'ZABS' or
     'ZSMG' or 'ZFRE' or 'ZREC' or 'ZCOM' or 'ZPMG' or 'BEMG' or 'ZDTI'
        or'ZBET'.
Some code
  when 'ZSED' or 'ZRFQ' or 'ZIMP' or 'ZERR'
or 'ZECD' or 'ZAC1' or 'ZAC%' or 'ZAC2' or 'ZSED' or 'ZRFQ' or 'ZIMP' or
  'ZERR' or 'ZECD' or 'ZQUD' or 'ZEMP' or 'Y101' or 'Y012' or 'ZCHU' or
  'Y054' or 'Y065' or 'Y066' or 'Y067' or 'Y068' or 'Y069' or 'Y096'
  or 'Y103' or 'Y010' or 'Y070' or 'Y071' or
  'Y072' or 'Y073' or 'Y074' or 'Y075' or 'Y076'
  or 'Y077' or 'Y078' or 'Y079' or 'Y156' or 'Y148'
  or 'Y102' or 'Y205' or 'Y206' or 'Y207' or 'Y208' or
  'Y209' or 'Y213' or 'Y210' or 'Y211' or 'Y212' or 'Z%DS'
  or 'Z%DO' or 'Y113' or 'Y151' or 'Y152' or 'Y153' or
  'Y154' or 'Y155' or 'Y147' or'Z%PB' or 'Y142' or 'Y131'
  or 'Y141' or 'Y149' or 'ZDEO' or 'Z%DR' or 'Y115' or
  'Y116' or 'Y095' or 'Y084' or 'ZSA$' or 'ZSA%' or
  'ZPA$' or 'ZPA%'.
Some code
endcase.
select single vtext into wac-vtext from t685t
              where spras = sy-langu
                and kschl = wac-kschl.
write:/ wac-kschl, wac-vtext.
[/code]
Regards,
Rich Heilman

Similar Messages

  • How to write the ABAP code for Datasource Enhancment

    Hi Team,
                  Can you please help me how to write the code for the enhancement i have made to the standard datasource
    i have added the fields ZZPayer and ZZPayer_access.
    I just wanted to know how to write the ABAP code to populate the data for these fields.
    Regards,
    Pradeep P.

    Hi
    From a performance point of view would like to suggest a few changes :
    WHEN '<DS name>'.
      select zzfields from <table> into itab
      for all entries in c_t_data where <condition>.
      If sy_subrc = 0.
    loop at c_t_data assiging f_c_t_data.
    read itab into wa_itab where key = f_c_t_data-key.
    f_c_t_data-zzfield = wa-itab-zzfield.
    endloop.
    refresh itab.
    regards,
    aparna
    endif.

  • How to see the ABAP Code behind SAP Exit Variables.

    Hi Everyone.
    I was wondering if anyone could help me with the steps to see the ABAP Code behind a SAP Exit Variable.
    Sometime back I remember of going to Transaction SE37 - Function Module and give the Variable name,
    Eg: 0F_ADAY, Hit F4 or something like that and was able to see the ABAP Code/Function Module/Exit written for that Variable.same
    But today I tried to do the same thing to see the code for Variable 0P_FVAEX but I was NOT able to see it.
    I think I am missing something.
    Can someone help me recollect what I am missing.
    Thank You for your time
    NOVICE

    Hi bi novice,
    big sorry for the late reply!
    The following variables are defined in function module RREX_VARIABLE_EXIT as case statement:
    '0CMONTH', '0CWEEK', '0CYEAR', '0CQUART', '0DAT', '0CWD', '0FYEAR', '0FPER', '0FYTCFP',
    '0FYTLFP', '0FYTCD', '0CYTCM', '0CYTLM', '0CYTCD', '0LYTCLD', '0CMONTHT', '0CWEEKT', '0CYEART', '0CQUARTT', '0DATT', '0FYEART', '0FPERT'
    Best regards,
    Andreas

  • Not able to remove the ABAP code from Transformation

    Hello Experts,
    We have transformation for DSO in that for one infoobject, field routine is written, Break Point is hard coded there and it's move to production. Now we are trying to remove that break point from development and then move it production.
    we are doing following activity to remove the break point.
    1. Open the transformation.
    2. Open the field routine.
    3. Going to ABAP code in field  routine.
    4. Remove the hard coded Break Point from ABAP code.
    5. Saving the code.
    6. It's taking to again filed routine window.
    7. We close the window and activate the transformation.
    8. When again check the ABAP code in field routine then it shows hard coded Break Point again.
    9. Not able to remove the hard coded break point.
    Can anyone know how to do this.
    Help will be appreciated.
    Thanks

    Hi,
    As pointed above, after point 6 don't simply close the window but click on Transfer Value and then activate your transformation. Refresh the system and check again.
    Regards,
    Arminder

  • How to establish code standards to make the abap code more readability

    Every programmer have their habit to code, but this lead a problem , it is difficult to read other people's code, especially the complex logic.
    So how to establish code standards to make the abap code more readability?
    I came up with this:
    1.Unify the naming rule.
    2.Reduce the nest of 'if' statement. (better in less than 4 if statement in one block )
    3.Use more Perform to replace the big code block.
    Is there any other standards to make our abap code more readability ?  (if we establish the standards, in sap is there any tool to help us to follow the rule we set ?)

    There are a number of things you could do. Some of which are:
    I would recommend creating your own in-house document on Coding standards, some of which you can control with the code inspector.
    It is also possible to set up the transport request in such a way that objects that do not pass the SCI test are not allowed to be released.
    I would also assign a senior developer to act as quality control for all developments. You can have a rotation scenario where this work can be divided by the number of senior developers you have.

  • How to see the abap code in sql language.

    hello gurus,
      very simply put,i dont know sql,but have to write some basic select queries to talk to oracle db...
    i would like to see the SQL transaltion of the ABAP code which i cant write.
    for eg: SELECT SINGLE * FROM MARA WHERE MATNR = 'XXXX'.
    How wud u write this on ORACLE.
    i would also like to see for all entries etc...
    NOW,i have tries st05..it doesnt give meaningful sql..
    pls help

    hai
    i wrote this in se38
    report zdsd.
    data wmatnr type mara.
    select single * from mara into wmatnr where matnr = '0001'.
    write wmatnr.
    _from st05_
           41 PROGDIR    REOPEN      0      0 SELECT WHERE "NAME" = 'ZTEST123' AND "STATE" = 'A'
        1,182 PROGDIR    FETCH       1      0
            4 DWINACTIV  REOPEN      0      0 SELECT WHERE "OBJECT" = 'REPS' AND "OBJ_NAME" = 'ZTEST123'
          592 DWINACTIV  FETCH       0   1403
            8 MARA       REOPEN      0      0 SELECT WHERE "MANDT" = '001' AND "MATNR" = '0001'
        9,388 MARA       FETCH       1      0
    i would like
    select matnr
    into :vi_matnr
    from PPS_SUB_BDZ.lm1_lagerpl
    where matnr = '0001'
    basicaly i need to work on new database (NON SAP) by making connections..
    i write the code in FM's in ABAP.
    I write Select queries between EXEC SQL. and
    ENDEXEC.
    I have to use SELECT SINGLE...FOR ALL ENTRIES ...counterparts now...

  • How find the ABAP code with Error message

    Hi
    How to  find the ABAP Code for Error Message?
    Example:
    Error Message: ZF026.
    Regards
    Odaiah Pelley
    Edited by: Odaiah Pelley on Aug 22, 2008 4:21 AM

    Hi
    Excellent Answer, I appreciate it.
    My question is with Error Message ZF026.
    How to find ABAP Code ?
    If I go for SE91 I will get same message as if I am getting error message.It is no use.
    Regards
    Odaiah Pelleyu

  • Pull the tax code automatically in the column field ??

    Could you please guide me how to pull the tax code automatically in the column field in the Sale Order form? I don't refer to the tax determination.

    Hi,
    In the Demo database, please create a new Business Partner and assign a tax code under the Business Partner Master Data > Accounting tab > tax tab. Make sure that the Business Partner is tax liable.
    Then try to create a SO for that BP Code and see whether the tax code is populated in the tax code field.
    Also, check that the Item taken into the SO is tax liable and under the Sales Tab what tax code is selected.
    Please update the results from the testing.
    Kind Regards,
    Jitin
    SAP Business One Forum Team
    Edited by: Jitin Chawla on Aug 11, 2011 5:55 PM

  • Need help in optimizing the ABAP code

    Hi,
    Can anyone help me in optimizing the code. Here the select statement has select within the loop. Need help in optimization.
    WHEN '0CO_PC_PCP_03'.
    LOOP AT C_T_DATA INTO TBL_KKBW_ITEM.
          W_TABIX = SY-TABIX.
          IF TBL_KKBW_ITEM-CURRENCY_TYPE EQ '20'.
    SELECT SINGLE KALNR KALKA KADKY TVERS KADAT KOKRS INTO (W_KALNR, W_KALKA, W_KADKY, W_TVERS,  
                    TBL_KKBW_ITEM-COSTING_DATE,
                    TBL_KKBW_ITEM-CONTROLLING_AREA)           
                    FROM KEKO                                  
                       WHERE KLVAR EQ TBL_KKBW_ITEM-COSTING_VARIANT                              
                        AND  KADKY EQ TBL_KKBW_ITEM-COSTING_DATE
                        AND  TVERS EQ TBL_KKBW_ITEM-COSTING_VERSION                           
                        AND  MATNR EQ TBL_KKBW_ITEM-HEADER_MATERIAL                             
                        AND  WERKS EQ TBL_KKBW_ITEM-HEADER_PLANT.
               IF SY-SUBRC EQ 0.                                
              SELECT SINGLE KOSTL INTO TBL_KKBW_ITEM-COST_CENTER
                              FROM CKIS WHERE KOSTL NE SPACE   
                                         AND  KALNR EQ W_KALNR 
                                         AND  KALKA EQ W_KALKA 
                                         AND  KADKY EQ W_KADKY 
                                         AND  TVERS EQ W_TVERS.
              IF SY-SUBRC NE 0.                                
                CLEAR TBL_KKBW_ITEM-COST_CENTER.               
              ENDIF.                                           
            ENDIF.                                             
            MODIFY C_T_DATA FROM TBL_KKBW_ITEM INDEX W_TABIX.
          ELSE.
            DELETE C_T_DATA INDEX W_TABIX.
          ENDIF.
        ENDLOOP.
    Thanks,
    Rani.

    hi
    plz use the below code :
    WHEN '0CO_PC_PCP_03'.
    SELECT  KALNR KALKA KADKY TVERS KADAT KOKRS INTO it_keko "declare internal table with the mentioned fields
    " also select the fields to be used in where condition
    FROM KEKO
    for all entries in c_t_data
    WHERE KLVAR EQ c_t_data-COSTING_VARIANT
    AND KADKY EQ c_t_data-COSTING_DATE
    AND TVERS EQ c_t_data-COSTING_VERSION
    AND MATNR EQ c_t_data-HEADER_MATERIAL
    AND WERKS EQ c_t_data-HEADER_PLANT.
    "sort the tables on the fields used in where.
    IF SY-SUBRC EQ 0.
    SELECT  KOSTL "and other fields to be used in where
    INTO it _ckis
    FROM CKIS
    for all entries in c_t_data
    WHERE KOSTL NE SPACE "use c_t_data
    AND KALNR EQ W_KALNR
    AND KALKA EQ W_KALKA
    AND KADKY EQ W_KADKY
    AND TVERS EQ W_TVERS.
    IF SY-SUBRC NE 0.
    CLEAR TBL_KKBW_ITEM-COST_CENTER.
    ENDIF.
    it_data[] = c_t_data. "declare it_data same as the extract structure
    delete it_data where CURRENCY_TYPE  NE '20'.
    LOOP AT it_data assigning <fs_data>. "use field symbols
    read from it_keko into wa_keko
    where
    KLVAR EQ <fs_data>-COSTING_VARIANT
    AND KADKY EQ <fs_data>-COSTING_DATE
    AND TVERS EQ <fs_data>-COSTING_VERSION
    AND MATNR EQ <fs_data>-HEADER_MATERIAL
    AND WERKS EQ<fs_data>-HEADER_PLANT
    binary search.
    if sy_subrc = 0.
    similarly read from the second itab
    ENDIF.
    ENDLOOP.
    c_t_data[] = it_data[].
    Pls let me know in case of any issues
    Regards,
    Aparna
    Edited by: Aparna KS on Jun 13, 2010 11:01 PM

  • Help in the abap code

    hi folks,
    I am checking for various condition types through this code for various orders. Each order has a different set of condition records.
    My requirement: when a order has a condition record for the condition type 'ZAGR' (AGREED PRICE) it should execute that block and ignore all the other condition types for that record and directly go to 'ZBET'to fetch the final amount
    How to incorporate that piece code here?
    The code goes like this...
    loop at cdata  into zcdata where
            knumv = bodyitabtotal-knumv.
    case zcdata-kschl.
             when 'ZRAT' OR 'ZFLE' OR 'ZRCR' OR 'ZFIX'.
           when 'ZAGR'.
            when 'ZONT'.
                concatenate zzkeyword  zpofield
                     into CTEXT3
                   separated by space
              MOVE zcdata-kbetr to w_accitab-zrate.
              MOVE zcdata-kwert to w_accitab-zsubtotal.
          when 'ZSMG'.
            when 'ZBET'.
             if zcdata-kbetr = ' ' AND zcdata-kwert = ' '.
                  MOVE '  ' TO w_accitab-zamount.
              ELSE.
                 MOVE zcdata-kwert to w_accitab-zamount.
              ENDIF.
            when  others.
              continue.
          endcase.
    Thanks
    Santhosh

    Rich,
    I need the 'knumv' to be checked too because it is unique to each order, and I am running this within a loop.
    The format of the code goes like this...
    select distinct ...... into table bodyitab1(internal table)
    *fetching all the information of the sales orders into the table
      insert lines of bodyitab1 into table bodyitabtotal.
    loop at bodyitabtotal
    reading all the data into various variables and reading into 'w_accitab'
      select knumv kschl kbetr kwert kinak
        from konv into table cdata for all entries in 
    bodyitabtotal where konv~knumv = bodyitabtotal-knumv
      *fetching the rates, amounts, for each sales order based on  'knumv' and checking for the condition types
      loop at cdata  into zcdata where knumv = bodyitabtotal-knumv.
         case zcdata-kschl.
            when 'ZAGR'.
       append w_accitab to accitab.
             clear accitab-zamount.
       clear accitab.
          clear w_accitab.
         endloop.
      endif.
    endloop.
    here the loop ends and this completes the cycle for one order
    so when I use the read statement it has to check for 'ZAGR' for that order only but if you see the query
    cdata' has the condition records for all entries in 'bodyitabtotal' because all orders do not have 'ZAGR' condition type
    I hope you understand the flow of the program.
    thanks
    Santhosh

  • Exploiting RIA & RCA functionalities would entail changing in the ABAP code

    Dear All,
    Could someone please explain  to what extent exploiting the latest RCA & RIA functionalities available in SAP NetWeaver would lead to changing in the underlying ABAP code (SAP native & customized) of an ERP system, ABAP stack.
    Thank you in advance for your cooperation.
    Best regards.
    Reda Khalifa

    Hi,
    1st: you create a class using se24. Within your class you can define methods. Each method can have import, export and changing parameter.
    2nd: in the global part of your start routine you need to instanciate your class using:
    data: class_variable type ref to <your class>.
    create object class_variable.
    In the start routine and the infoobject routines itself you call your methods using:
    call method class_variable->method_name exporting..... importing..... changing.....
    For some more help use the F1-help on the keywords in the abap editor.
    Hope this helps!
    regards
    Siggi

  • Error in the ABAP Code for Customer Exit Variable

    Could you please update me what is the wrong with the below ABAP Code developed for Customer Exit Variable in BW
    i created a Variable (ZVWKNO) of Customer Exit,Single Value ,Mandatory and Variable is ready for input
    In CMOD i had written the below Code:
    When 'ZVWKNO'.
    DATA: WEEK(2) TYPE N,
    WEEKNO(2) TYPE N.
    IF i_step = 1.
    l_st_date = SY-DATUM.
    CALL FUNCTION 'DATE_GET_WEEK'
    EXPORTING
    DATE = l_st_date
    IMPORTING
    WEEK = l_fn_week.
    CHECK sy-subrc = 0.
    WEEK = l_fn_week+4(2).
    If WEEK 0.
    WEEKNO = WEEK - 1.
    l_s_range-low = WEEKNO.
    l_s_range-sign = k_sign_inclusive.
    l_s_range-opt = k_option_equals.
    APPEND l_s_range to e_t_range.
    ENDIF.
    ENDIF.
    But when i execute the query the default value is not populated with Week-1 No in the variable screen
    Please update me what went wrong
    Thanks

    Case ZVWKNO.                "write this with out comments
    When '1'.              "write the value that needs to equal with value in varaible ZVWKNO after when in sungle quotes
    DATA: WEEK(2) TYPE N,
    WEEKNO(2) TYPE N.
    IF i_step = 1.
    l_st_date = SY-DATUM.
    CALL FUNCTION 'DATE_GET_WEEK'
    EXPORTING
    DATE = l_st_date
    IMPORTING
    WEEK = l_fn_week.
    CHECK sy-subrc = 0.
    WEEK = l_fn_week+4(2).
    If WEEK 0.                                    "check this Week Minimum is '01' and Maximum '52'
    WEEKNO = WEEK - 1.
    l_s_range-low = WEEKNO.
    l_s_range-sign = k_sign_inclusive.
    l_s_range-opt = k_option_equals.
    APPEND l_s_range to e_t_range.
    ENDIF.
    ENDIF.
    Prabhudas

  • Error in the ABAP code

    Hello all,
    I am getting error in ABAP code .
    The error is:Field "0" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement.
    I have statement as calmonth = sy-datum + 0(6).
    Any ideas are always welcome
    Thanks,
    JB

    Thanks every body.
    eliminating blanks worked.
    AS I am new to ABAP,I have one more error saying
    Unable to interpret "IT_YEAR". Possible causes of error: Incorrect spelling or comma error.The error occured at the staement:
    <b>read it_year with key /BIC/LESS = calmonth+0(4) binary search.</b>
    IT_YEAR is an internal table
    data: it_year like /BIC/PZ_JB occurs 0 with header line.
    Any ideas!!
    JB

  • Adding the ABAP code to SAP Query to support Query's ALV Double click.

    Hi, Expert.
    I need to add some ABAP Code into SAP Query (or Infoset) to support the double click event on ALV cell of result of query.
    Is it possible & How to do ?
    Thank you very much.
    Best Regard
    Nattapash C.

    Hi, Gautham.
    I've put BREAK-POINT in all code section e.g. INITIALIZATION, END-OF-SELECTION..
    I found there are some section for add code that will be executed when query is processing before output data to ALV.
    What I need to know is Where I can input the code after ALV output. For support the Double Click Event on Query's ALV cell.
    Best Regard,
    Nattapash C.

  • Please help me with ABAP code

    Hi Gurus,
    Please help me with the code.
    Algorithm: This is for master data extraction. I need to append some records to I_T_DATA before the loop on I_T_DATA begins.
    ZTAB is a custom defined table with key KEY. STAB is standard table with key KEY.
    1. Create an internal table I_T_STAB similar to STAB.
    2. Loop at I_T_DATA
        Read record from ZTAB where KEY = I_T_DATA-KEY and { field1 <> I_T_DATA-field1 or field2 <> I_T_DATA-field2 <> field3 <> I_T_DATA-field3}
    If success
         Delete record from I_T_DATA.
    Else
         Continue loop.
    Copy all records of STAB to I_T_STAB.
    3. Delete records in I_T_STAB where I_T_STAB-KEY = ZTAB-KEY.
    Now
    4. Delete all records in I_T_DATA where I_T_DATA-KEY = I_T_STAB-KEY.
    Now,
    5. Append all the remaining records from step 3 in I_T_STAB to I_T_DATA.
    Please help me with the code upto this part.
    Now the actual code in exit starts.
    Loop at I_T_DATA
    Thanks,
    Regards,
    aarthi
    [email protected]

    You might get a quick answer if you were to post in the ABAP forum. 
    Moderator, please move to ABAP forum.  Thanks.
    Regards,
    Rich Heilman

Maybe you are looking for