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

Similar Messages

  • 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

  • Help with the ABAP code

    Hi "Friends",
    I have small problem, but i don't know how to solve it.
    I changed an old program which had just executable report function. The display was written with "WRITE" sentence.
    here is the code:
               WRITE: / OUTPUT-MATKL(4), '|',
                       T023T-WGBEZ, '|',
                      AT 30 OUTPUT-MATNR+12(6), '|',
                      AT 39 OUTPUT-MAKTX, '|',
                      AT 90 OUTPUT-LABST, '|',
                      AT 110 OUTPUT-OMENG, '|',
                      AT 135 OUTPUT-BMENG, '|',
                      AT 165 VERFUEGBAR, '|'.
    How can I set in new code that the columns will start at the same point?
    New code:
    FORM BUILD_LINE USING  IW_DATA.                             "$001 start
      FIELD-SYMBOLS: <L_VALUE>,                                 "$001
                     <L_DATUM_EX>.                              "$001
      DATA: L_LEN TYPE I.                                       "$001
      DATA: L_STRLEN TYPE I.                                    "$001
      DATA: L_TYPE.                                             "$001
      DATA: H_DATE_EXTERNAL(10) TYPE C.                         "$001
      CLEAR: G_TRANSFER.                                        "$001
      REFRESH:  GTW_FIELDS.                                     "$001
      APP_NAME 'MATKL'.                                        
      APP_NAME 'WGBEZ'.                                        
      APP_NAME 'MATNR'.                                        
      APP_NAME 'MAKTX'.                                        
      APP_NAME 'LABST'.                                        
      APP_NAME 'OMENG'.                                        
      APP_NAME 'BMENG'.                                        
      APP_NAME 'VERFUEGBAR'.
    And my question is how to set in new code that the A column starts AT 30, second AT 90.... How to set this?
    I put the AT 30 infront of the APP_NAME, but doesn't work!! Please help.
    Thanks for the help,
    <b><REMOVED BY MODERATOR></b>... and it is urgent )
    BR
    saso
    Message was edited by: Saso
            Saso Poljansek
    Message was edited by:
            Alvaro Tejada Galindo

    Uf, but I would like to write on unix file now and this write is'n possible anymore...
    Here is the code I need to change... At this piece of code i need to change that the columns will be a the same place as was before when I used write sentance... There is another external program behind and I need to have the same structure as I have before....
    *&      Form  build_line
          text
         -->P_I_DATA  text
    FORM BUILD_LINE USING  IW_DATA.                             "$001 start
      FIELD-SYMBOLS: <L_VALUE>,                                 "$001
                     <L_DATUM_EX>.                              "$001
      DATA: L_LEN TYPE I.                                       "$001
      DATA: L_STRLEN TYPE I.                                    "$001
      DATA: L_TYPE.                                             "$001
      DATA: H_DATE_EXTERNAL(10) TYPE C.                         "$001
      CLEAR: G_TRANSFER.                                        "$001
      REFRESH:  GTW_FIELDS.                                     "$001
      APP_NAME 'MATKL'.                                         "$001
    *****************write also this from the customizing table
      APP_NAME 'WGBEZ'.                                         "$001
      APP_NAME 'MATNR'.                                         "$001
      APP_NAME 'MAKTX'.                                         "$001
      APP_NAME 'LABST'.                                         "$001
      APP_NAME 'OMENG'.                                         "$001
      APP_NAME 'BMENG'.                                         "$001
    *****************write also this from the customizing table
      APP_NAME 'VERFUEGBAR'.                                    "$001
      LOOP AT GTW_FIELDS.                                       "$001
        CLEAR SY-SUBRC.                                         "$001
        ASSIGN COMPONENT GTW_FIELDS-NAME OF STRUCTURE IW_DATA   "$001
                                                TO <L_VALUE>.   "$001
        CHECK SY-SUBRC = 0.                                     "$001
        DESCRIBE FIELD <L_VALUE> OUTPUT-LENGTH L_LEN.           "$001
        DESCRIBE FIELD <L_VALUE> TYPE L_TYPE.                   "$001
        CASE L_TYPE.                                            "$001
          WHEN 'D'.                                             "$001
            CLEAR: H_DATE_EXTERNAL.                             "$001
            ASSIGN H_DATE_EXTERNAL TO <L_DATUM_EX>.             "$001
            CALL 'DATE_CONV_INT_TO_EXT'                         "$001
              ID 'DATINT' FIELD <L_VALUE>                       "$001
              ID 'DATEXT' FIELD <L_DATUM_EX>.                   "$001
            UNASSIGN: <L_VALUE>.                                "$001
            ASSIGN <L_DATUM_EX> TO <L_VALUE>.                   "$001
        ENDCASE.                                                "$001
        L_STRLEN = STRLEN( G_TRANSFER ).                        "$001
        WRITE <L_VALUE> TO G_TRANSFER+L_STRLEN(L_LEN).          "$001
        L_STRLEN = L_STRLEN + L_LEN.                            "$001
        WRITE '|' TO G_TRANSFER+L_STRLEN.                       "$001
        AT LAST.                                                "$001
          SHIFT G_TRANSFER BY 1 PLACES RIGHT.                   "$001
          WRITE '|' TO G_TRANSFER+0(1).                         "$001
        ENDAT.                                                  "$001
        CLEAR: L_STRLEN.                                        "$001
      ENDLOOP.                                                  "$001
    ENDFORM.                    " build_line                    "$001 end

  • 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 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 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

  • HI ALL SINCE TWO DAYS I AM DOWNLOADING VIBER BUT I AM NOT HAVING MY ACCESS CODE AND EVERY TIME I DELETE THE APPLICATION AND DOWNLOADING IT AGAIN BUT ALWAYS THE SAME RESULT PLEASE I NEED YOUR HELP FOR THE ACCESS CODE.MY PHONE NUMBER IS 0022996969896.THANKS

    HI ALL SINCE TWO DAYS I AM DOWNLOADING VIBER BUT I AM NOT HAVING MY ACCESS CODE AND EVERY TIME I DELETE THE APPLICATION AND DOWNLOADING IT AGAIN BUT ALWAYS THE SAME RESULT PLEASE I NEED YOUR HELP FOR THE ACCESS CODE.MY PHONE NUMBER IS 0022996969896.THANKS IN ADVANCE

    try this website this should help you http://helpme.viber.com/index.php?/Knowledgebase/List/Index/1/iphone

  • 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

  • Need Help With Simple ABAP Code

    Hello,
    I'm loading data from a DSO (ZDTBMAJ) to an Infocube (ZCBRAD06). I need help with ABAP code to some of the logic in Start Routine. DSO has 2 fields: ZOCTDLINX & ZOCBRDMAJ.
    1. Need to populate ZOCPRODCD & ZOCREFNUM fields in Infocube:
        Logic:-
        Lookup /BI0/PMATERIAL, if /BIC/ZOCBRDMAJ = /BIC/OIZOCBRDMAJ
        then /BIC/ZOCPRODCD = ZOCPRODCD in Infocube
               /BIC/ZOCREFNUM = ZOCREFNUM in Infocube         
    2. Need to populate 0G_CWWTER field in Infocube:
        Logic:
        Lookup /BIC/PZOCTDLINX, if /BIC/ZOCTDLINX = BIC/OIZOCTDLINX
        then G_CWWTER = 0G_CWWTER in Infocube.
    I would need to read single row at a time.
    Thanks!

    I resolved it.

  • 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

  • Help with basic ABAP code (merge internal tables, sort of...)

    Hello,
    Can someone please help write some basic code for a Basis guy with limited ABAP knowledge?
    Should be some easy points for an experienced ABAPer!
    I have identicaly structured internal tables I_A and I_B and I_C which have already been filled by function models I called.
    How will I code the following?:
    I want to read all the data of I_A into a new internal table I_MASTER (structured the same as I_A,I_B and I_C).
    Then I want to read I_B and:
    1)Update I_MASTER with NEW records
    2)Update existing records if the value of field MYFIELD in I_B is smaller than the value of MYFIELD in I_MASTER.
    Then I want to read I_C and:
    1)Update I_MASTER with NEW records
    2)Update existing records if the value of field MYFIELD in I_C is smaller than the value of MYFIELD in I_MASTER.
    Let me know if I can provide anymore information.
    Thanks in advance for you help!
    Adriaan
    Message was edited by: Adriaan
    Message was edited by: Adriaan

    Hi Adriaan ,
    I want to read all the data of I_A into a new internal table I_MASTER (structured the same as I_A,I_B and I_C).
    <b>i_master[] = i_a[] .</b>
    loop at i_b .
    read table i_master with key myfiled < i_b-myfield .
    if sy-subrc = 0 .
    append i_master from i_b .
    endif.
    endloop.
    loop at i_c .
    read table i_master with key myfiled < i_c-myfield .
    if sy-subrc = 0 .
    append i_master from i_c .
    endif.
    endloop.
    Let me know if this helped .
    Regards,
    Varun .
    Message was edited by: varun sonu

  • 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

Maybe you are looking for

  • Installation Woes on Solaris 10

    I have looked thru all the issues posted so far and I have worked past those, my issue occurs during the installation of the Oracle JVM: The installation is at 36% when I hit this error: ORA-00604: error occured at recursive SQL level 1 ORA-04031: un

  • Can't use parameter in query if using another database

    Hi there, I logged on SAP Business one for company A,  and try to run the following query: select t0.field1 from \[company b\].\[dbo\].\[table1\] t0 where t0.filed2 = '\[%0\]' And I got errors. If '\[%0\]' is replaced by a real value it works. select

  • I want to know if I can assign no ringtone for private numbers?

    I don't want the iPhone ring when a blocked or private number calls me. Any idea.

  • Mac Mini Sound problem

    Hi all, i have a mac mini early 2009, the sound dont work and i run apple hardware test and show me following error  4mot/1/40000002 master-0 Any ideas to solve it or explaint what happen? Thanks for the help

  • Can I dual boot lion and OS-10.5.8?

    I want to use my mac pro with Lion for it's iCloud feature and iPad2, but also be able to use some old programs on the MP in 10.5.8.  Can I have both OS on the Mac ?