Modify internal table

vbeln posnr qty errorlog  date
0001 10 2000             21.04.2008
0001 10 200              22.04.2008
0001 10 100 e           23.04.2008
0002 10 1000            22.04.2008
0002 20 2000            15.04.2008
depending on the error at e in third item remain above in same vbeln need to make errorlog as e
vbeln posnr qty errorlog  date
0001 10 2000 e     21.04.2008
0001 10 200 e      22.04.2008
0001 10 100 e       23.04.2008
0002 10 1000      22.04.2008
0002 20 2000       15.04.2008
query not working properly need to sort vbeln in ascending order and date by descending so that date
vbeln posnr qty errorlog  date
0001 10 100 e       23.04.2008
0001 10 200       22.04.2008
0001 10 2000      21.04.2008
0002 10 1000      22.04.2008
0002 20 2000       15.04.2008
based up on the e message i have to populate the other 2, and 3 record with e as below
vbeln posnr qty errorlog  date
0001 10 100 e       23.04.2008
0001 10 200   e    22.04.2008
0001 10 2000   e   21.04.2008
0002 10 1000      22.04.2008
0002 20 2000       15.04.2008
read table modify table based on error log
sort it_data descending by zedatu_apd ascending vbeln.
break-point.
loop at it_data where errlog = 'E'.
MODIFY it_data where vbeln = it_data-vbeln TRANSPORTING errlog = 'E'.
endloop.

Hi Anil,
First of all understand the below logic.
data v_tabix type sy-tabix.
read table itab with key errorlog = 'e'.
if sy-subrc = 0.
v_tabix = sy-tabix - 1.
endif.
if not v_tabix is initial.
loop at itab from 1 to v_tabix.
itab-errorlog = 'e'.
modify itab.
endloop.
endif.
And try to close the threads immediately once you got the  solution.
Edited by: Velangini Showry Maria Kumar Bandanadham on Apr 3, 2008 11:57 AM

Similar Messages

  • How to Modify Internal table

    select  pernr dlart darbt subty
               into (loan-pernr , loan-ln_type,loan-ln_amt, loan-subty)
               from  pa0045
               where pernr  =  pernr-pernr
               and   subty in ('Y001' , 'Y011' , 'Y010' , 'Z001' , 'Z005' , 'Z006')
             and  begda  <     fisc_day.
    APPEND loan.
    ENDSELECT.
    SELECT   ZZTEL0144B ZZTEL0144B ZZTEL0147B ZZTEL0150B ZZTEL0153B ZZTEL0156B
           into (wa-ZZTEL0144B,wa-ZZTEL0144B,wa-ZZTEL0147B,wa-ZZTEL0150B, wa-ZZTEL0153B, wa-ZZTEL0156B)
    from pa9999
      WHERE pernr = loan-pernr
      and   subty in ('Y001' , 'Y011' , 'Y010' , 'Z001' , 'Z005' , 'Z006')
        and  begda  <     fisc_day.
    APPEND wa.
    ENDSELECT.
    in 1st Query i gett data related tothe PF loans . in 2nd query i got the data related to the balances and repayments. i have to apprend the 2nd query in internal table Loan. according to the respect records  kindly help me out

    >> is it possible to define internal table with header line.
    NO.. you have to create a work area & loop at the itab into this work area.. and you can modify the itab contents from this work area..
    ~Suresh

  • Modifying Internal Table row - The column name is dynamic

    Hi,
    I need to update the internal table as described below,
    Assume that i have 10 columns in my internal table and i need to modifying the column value in row, which is dynamic.
    for example, i'm writing it in Subroutine and it has 3 formal parameter
    1) Key field value
    2) Column name
    3) Value of the column
    in my subroutine i need to write code to modify the row, which should handle the columns dynamically.
    Samples,
    7th record i need to modify the 4th column value.
    4th record i need to modify the 9th column value.
    Please guide me to handle this requirement.write me if i'm not clear.
    ...Nandha

    For the column check the ASSIGN statement:
    No system here, but I think it is:
    ASSIGN COMPONENT <index> OF STRUCTURE <structure> TO <field-symbol>.
    For the row:
    READ TABLE <itab> INDEX <index> INTO <work area>.
    --> For your 1. example you could write:
    READ TABLE <itab> INDEX 7 INTO <work area>.
    ASSIGN COMPONENT 4 OF STRUCTURE <work area> TO <field-symbol>.
    <field symbol> now points to the 4th column of the 7th row.
    Guenther

  • Modify internal table embedded in internal table as field

    Hi Experts,
    I am using function module CRM_DNO_READ_ORDER_TEXT.
    One of the output table of this fm is  ET_ALLTEXTS whixh is of structure COMT_TEXT_TEXTDATA_T.
    This structure has two fields one is GUI and other is LINES which itself contains the table in it.
    I want to delete one row from the data of this LINES table in main table ET_ALLTEXTS .
    Actually, this LINES table contains the texts entered by user from some application. So i want to edit the text.
    Pls help me..this is very complicated.
    thnx
    DIvya

    I guess Nilesh is right, there is something wrong with your declaration. Me for one, I've tried to reproduce your problem and I don't see any problem here. How did you declare your internal table for example?
    When you want to delete a line from table LINES you can't just say:
    delete et_alltexts-lines index 1.
    Because this will give you the error message with 'table without header line....". Instead you first have to loop at this ET_ALLTEXTS internal table and only then you have access to the individual lines, which is an internal table as well. The following is only an example, but it should be helpful:
    DATA: gv_header_guid TYPE crmt_object_guid.
    DATA: gt_textdata    TYPE comt_text_textdata_t ,
          gt_alltexts    TYPE comt_text_textdata_t.
    FIELD-SYMBOLS: <alltext>     LIKE LINE OF gt_alltexts.
    CALL FUNCTION 'CRM_DNO_READ_ORDER_TEXT'
      EXPORTING
        iv_header_guid = gv_header_guid
      IMPORTING
        et_textdata    = gt_textdata
        et_alltexts    = gt_alltexts.
    LOOP AT gt_alltexts ASSIGNING <alltext>.
      DELETE <alltext>-lines INDEX 1.
    ENDLOOP.

  • How to modify internal table with new value after data processing

    Hi,
    My code is as below:
    LOOP AT i_raw INTO wa_raw.
       IF  ( wa_raw-/BIC/ZOUASCLS = 'BA') OR ( wa_raw-/BIC/ZOUASCLS = 'CO' ) .
          LOOP AT i_crrs INTO wa_crrs.
            IF wa_raw-/BIC/ZOUIDCIF = wa_crrs-ZCBGCIFNO.
              wa_raw-/BIC/ZOUINDAP = '03'.
            ELSE.
              wa_raw-/BIC/ZOUINDAP = '02'.
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDLOOP.
    Initially column /BIC/ZOUINDAP is empty and I want to populate either value '02' or '03' as shown above.
    How do I insert those values into each i_raw records ?
    Pls help!

    Hello,
    try this code:
    IF ( i_raw-/BIC/ZOUASCLS = 'BA') OR ( i_raw-/BIC/ZOUASCLS = 'CO' ) .
    LOOP AT i_raw INTO wa_raw.
    WHERE wa_raw-/BIC/ZOUIDCIF = i_crrs-ZCBGCIFNO.
    IF SY-SUBRC = 0.
    wa_raw-/BIC/ZOUINDAP = '03'.
    ELSE.
    wa_raw-/BIC/ZOUINDAP = '02'.
    APPEND wa_raw INTO i_raw.
    ENDLOOP.
    ELSE.
    i_raw-/BIC/ZOUINDAP = ' '.
    ENDIF.
    Hope it helps.
    Best regards.
    Simone.

  • How to know no of records(in Internal Table) modified after using Modify statement

    Hi Experts ,
    I am using statement Modify internal table transporting XYZ FIELD.
    I just wanted to know how many Records/Count (assuming more then 1 ) get updated just after successful execution of this command.
    Is there any system field exist?
    if yes please let me know?
    Warm Regards,
    Santosh

    Hello Santosh,
    Try like below and it works for me.
    Count will have the number rows changed.
    DATA: itab_mara TYPE STANDARD TABLE OF mara,
          itab_mara1 TYPE STANDARD TABLE OF mara,
          str_mara TYPE mara,
          str_mara1 TYPE mara,
          diff LIKE IREF-IIND,
          count TYPE int2.
    SELECT * FROM mara INTO TABLE itab_mara UP TO 10 ROWS.
      itab_mara1[] = itab_mara[].
      str_mara-lvorm = 'X'.
    MODIFY itab_mara FROM str_mara TRANSPORTING lvorm WHERE VPSTA = 'KVB'.
    LOOP AT itab_mara INTO str_mara.
      READ TABLE itab_mara1 INTO str_mara1 WITH KEY matnr = str_mara-matnr.
    CALL FUNCTION 'COMPARE_STRUCTURE_DATA'
      EXPORTING
        i_ddic_name       = 'MARA'
        i_rec_old         = str_mara
        i_rec_new         = str_mara1
       I_CHECK_MODE      = 'Y'
    IMPORTING
       E_IS_DIFF         = diff.
    IF diff = 'X'.
      count = count + 1.
    ENDIF.
    ENDLOOP.
    WRITE:/ count.
    Regards,
    Thanga

  • How to modify DataBase Table with an internal Table

    Hi, Friends.
    I am coping Data from a Database table to an internal table after modifying data in the internal table I want to modify the db table according to the modification in the internal table. can some one help me out in this way, i am doing this modification in Table Control in Screen programing.
    My Code is as follow.
    MODULE zfsl_stinf_tc_init OUTPUT.
      IF tc_copy IS INITIAL.
        SELECT * INTO CORRESPONDING FIELDS OF TABLE it_zfsl_stinf FROM zfsl_stinf.
        tc_copy = 'X'.
        REFRESH CONTROL 'TC_FOR_ZFSL_STINF' FROM SCREEN '0001'.
      ENDIF.
    ENDMODULE.                 " zfsl_stinf_init  OUTPUT
    *&      Module  zfsl_stinf_tc_move  OUTPUT
          text
    MODULE zfsl_stinf_tc_move OUTPUT.
      MOVE-CORRESPONDING wa_it_zfsl_stinf TO zfsl_stinf.
    ENDMODULE.                 " zfsl_stinf_tc_move  OUTPUT
    *&      Module  STATUS_0001  OUTPUT
          text
    MODULE status_0001 OUTPUT.
      SET PF-STATUS 'ZFSL_SCREEN_1ONLY'.
    SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0001  OUTPUT
    *&      Module  zfsl_stinf_tc_modify  INPUT
          text
    MODULE zfsl_stinf_tc_modify INPUT.
      MOVE-CORRESPONDING zfsl_stinf TO wa_it_zfsl_stinf.
      MODIFY it_zfsl_stinf FROM wa_it_zfsl_stinf INDEX tc_for_zfsl_stinf-current_line.
    _*"" here i have the modified internal table  " it_zfsl_stinf "*_
    ENDMODULE.                 " zfsl_stinf_tc_modify  INPUT
    Kind regards,
    Faisal

    Hi
    Here you are modifying your dbtable in module pool programming
    so  better to use work area to modify the database table
    example:
    data: itab type table of zfsl_stinf .
    data: wa_itab type itab.
    select single * from zfsl_stinf INTO itab WHERE <condition>
    (pass your values to wa_itab.)
    modify zfsl_stinf from values of wa_itab.
    Regards
    Srinivasu

  • Insert a string at particular location in the internal table

    1. I have an internal table t_text of type bcsy_text , this internal table contains a few lines of HTML code
    2. I have a variable w_text of type string , this variable contains some text
    3. now the internal table t_text contains text:
    <!"<font size = "3.5" ><b>Comments:</b></font><br><br>***********<br><br><font size = "3.5" ><b>Thank You</b></font>">
    4. The text in the w_text comes from a text area on my module pool screen
    5. There is a push button SAVE on the same module pool screen
    6. now when I enter text in the text area and press the SAVE button then i want the text in the variable w_text to be inserted into the internal table at the location where i have marked *********** in my HTML code.
    How do i achieve this?
    <!-- **--> is not part of my HTML code.. i have written it because the HTML formatting appears on the screen if i dont comment it
    Edited by: DoshiAnkit on Sep 8, 2010 3:43 PM

    Ankit,
    You have to first determine which row of the internal table needs to be updated. Once you know which row, read that row into a variable using the READ statement and INDEX option.
    Once you have the row in a variable (WA_ROW) , you have to determine the position where you want to insert the w_text contents.
    Suppose that position is 123. Then, you can concatenate the first part of the row, w_text contents, and second part of the row into another variable (WA_NEW_ROW).
    CONCATENATE wa_row(123)
    w_text
    wa_row+123
    INTO wa_new_row
    SEPARATED BY SPACE.
    Finally, modify internal table contents with WA_NEW_ROW using the INDEX option.

  • Problem in changing the internal table contents of a standard program

    Dear All,
    I am making changes to internal table LT_PPDIT of standard program SAPLHRPT in the user exit EXIT_SAPLACC4_001 while payroll posting to accounting with tcode PC00_M99_CIPE. But though the changed value of LT_PPDIT is visible within the exit still the value of LT_PPDIT when we come outside exit is the same as what was before entering exit.
    Please suggest is there any way of modifying internal table of a standard program in the user exit.
    Regards,
    Kanupriya

    Hi,
    I think the internal table is getting refreshed or something like that after the user exit.
    Try debugging after the user exit and put breakpoints at clear and modify statements.
    Then you ll find out where its regaining the oringinal value after getting changes.
    After locating that point try finding some enhancmenent point there and including your code so that your value of internal able gets modified.
    Regards,
    Subhashini

  • Update the database table with the content of the internal table

    Hello!
      I have the next form:
      FORM erase_data.
    SELECT * FROM zadrress INTO CORRESPONDING FIELDS OF TABLE itab_adrress.
      DELETE TABLE itab_adrress: FROM zadrress,
                                 WITH TABLE KEY adrid = '456'.
      WRITE 'The information after the DELETE operation'
      COLOR 2.
      LOOP AT itab_adrress INTO wa_adrress .
        WRITE:/
               wa_adrress-adrid COLOR 5,
               wa_adrress-name COLOR 7,
               wa_adrress-email COLOR 5,
               wa_adrress-depart COLOR 7,
               wa_adrress-display COLOR 5.
      ENDLOOP.
      SKIP.
    LOOP AT itab_adrress INTO wa_adrress.
       MODIFY zadrress FROM wa_adrress.
       COMMIT WORK.
       IF sy-subrc = 0.
         WRITE 'OK !'.
         SKIP.
       ELSE.
         WRITE 'FAIL !'.
         SKIP.
       ENDIF.
    ENDLOOP.
      MODIFY zadrress FROM TABLE itab_adrress.
      UPDATE zadrress FROM TABLE itab_adrress.
    TRANSPORTING adrid, name, email, depart, display.
    INSERT zadrress FROM TABLE itab_adrress ACCEPTING DUPLICATE KEYS.
    PERFORM display_data .
    ENDFORM.                    "erase_data
    I see that my record is deleted  when I display the records from my internal table, but
    now I want to delete the record from database table.
       For that I want to move the content of the modified internal table in the database table. You can see the methods I tried (some of them commented), but nothing seems to work.
    Any advice ?
    Thank you.

    FORM erase_data.
    SELECT * FROM zadrress INTO CORRESPONDING FIELDS OF TABLE itab_adrress.
    DELETE TABLE itab_adrress: FROM zadrress,
    WITH TABLE KEY adrid = '456'.
    WRITE 'The information after the DELETE operation'
    COLOR 2.
    LOOP AT itab_adrress INTO wa_adrress .
    WRITE:/
    wa_adrress-adrid COLOR 5,
    wa_adrress-name COLOR 7,
    wa_adrress-email COLOR 5,
    wa_adrress-depart COLOR 7,
    wa_adrress-display COLOR 5.
    ENDLOOP.
    SKIP.
    LOOP AT itab_adrress INTO wa_adrress.
    MODIFY zadrress FROM wa_adrress.
    COMMIT WORK.
    IF sy-subrc = 0.
    WRITE 'OK !'.
    SKIP.
    ELSE.
    WRITE 'FAIL !'.
    SKIP.
    ENDIF.
    ENDLOOP.
    <b>DELETE FROM zadrress.</b>  "Make this change and try
    MODIFY zadrress FROM TABLE itab_adrress.
    UPDATE zadrress FROM TABLE itab_adrress.
    TRANSPORTING adrid, name, email, depart, display.
    INSERT zadrress FROM TABLE itab_adrress ACCEPTING DUPLICATE KEYS.
    PERFORM display_data .
    ENDFORM. "erase_data'.

  • Update & Insert into Internal table

    Dear Abapers,
    Is it possible to update a entry in the internal table if exists, otherwise inserts a new one.
    I think MODIFY <Internal Table> will not insert new one if the matching entry is not there.
    MODIFY <database_table> have this facility.
    Thanks in advance,
    Satish

    Hi,
    i dont know what type of fields u r having but about collect statement i am correct
    The following special statement allows you to summate entries in an internal table:
    COLLECT wa INTO itab.
    itab must have a flat line type, and all of the fields that are not part of the table key must have a numeric type (f, i, p). You specify the line wathat you want to add as a work area that is compatible with the line type of itab.
    When the line is inserted, the system checks whether there is already a table entry that matches the key. If there is no corresponding entry already in the table, the COLLECT statement has the same effect as inserting the new line. If an entry with the same key already exists, the COLLECT statement does not append a new line, but adds the contents of the numeric fields in the work area to the contents of the numeric fields in the existing entry.
    REPORT demo_int_tables_COLLECT .
    DATA: BEGIN OF line,
    col1(3) TYPE c,
    col2(2) TYPE n,
    col3 TYPE i,
    END OF line.
    DATA itab LIKE SORTED TABLE OF line
    WITH NON-UNIQUE KEY col1 col2.
    line-col1 = 'abc'. line-col2 = '12'. line-col3 = 3.
    COLLECT line INTO itab.
    WRITE / sy-tabix.
    line-col1 = 'def'. line-col2 = '34'. line-col3 = 5.
    COLLECT line INTO itab.
    WRITE / sy-tabix.
    line-col1 = 'abc'. line-col2 = '12'. line-col3 = 7.
    COLLECT line INTO itab.
    WRITE / sy-tabix.
    LOOP AT itab INTO line.
    WRITE: / line-col1, line-col2, line-col3.
    ENDLOOP.
    The list output is:
    1
    2
    1
    abc 12 10
    def 34 5
    The example fills a sorted table. The first two COLLECT statements work like normal insertion statements. In the third COLLECTstatement, the first line of itab is modified.
    Regards

  • Problem in modifying a table through modify statement

    Hi,
    I am trying to update a 'Z' table in which there are 5 fields comprising of primary key. Out of them 2 key fields are defined as a part of seconadry index with 'Unique' option selected.
    As per the requirement, I am trying to update the table using modify statement so whenever this statement occurs it will check the primary keys and accordingly try to modify a record or insert a new record.
    But as there is Unique Index defined on 2 of the key fields the Modify query is

    Hi,
    Your syntax for MODIFY is not correct.
    As other friends suggested you can have index and you can modify the internal table.
    Whenever we are modifying internal table inside LOOP, we can omit index as system will take current row by default. So MODIFY statement should be written as follows:
    MODIFY T_ITPO5 from W_ITPO5 transporting AUFNR
    You can LOOP FROM INDEX also for the same to improve performance.
    data: wv_index like sy-tabix.
    sort T_ITPO5 by aufnr.
    sort T_ITPO4 by aufnr.
    wv_index = 1.
    LOOP AT T_ITPO5 INTO W_ITPO5.
         LOOP AT T_ITPO4 INTO W_ITPO4 from wv_index.
         if W_ITPO4-aufnr eq W_ITPO5-aufnr.
              IF ITPO4-NTGEW 0 .
                  CALL FUNCTION 'ZGET_ITEM_WEIGHT'
                    EXPORTING
                       P_BUID = W_ITPO4-WERKS
                       P_ITEMID = W_ITPO4-MATNR
                       P_QTY = 1
                       P_UOM = W_ITPO4-MEINS
                       P_UOM1 = 'KG'
                   IMPORTING
                      P_RETVAL = W_ITPO4-WTKG.
    TOTWT1 = W_ITPO4-WTKG * W_ITPO4-MENGE.
    IF W_ITPO4-BWART = '261'.
    W_ITPO5-I_QTY = W_ITPO5-I_QTY + TOTWT1.
    ELSEIF W_ITPO4-BWART = '101' OR W_ITPO4-BWART = '531'.
    W_ITPO5-I_QTY = W_ITPO5-I_QTY - TOTWT1.
    ENDIF.                    " IF W_ITPO4-BWART = '261'.
    endif.
    elseif W_ITPO4-aufnr gt W_ITPO5-aufnr.
       move sy-tabix to wv_index.
       exit.
    endif.                      " if W_ITPO4-aufnr eq W_ITPO5-aufnr.
    ENDLOOP.
    MODIFY T_ITPO5 FROM W_ITPO5 transporting aufnr.
    ENDLOOP.

  • Why "Modify itab index sy-tabix." makes internal table content blank?

    We have an internal table itab which looks like to have the following content:
    A---B---C
    1----3----
    2----2----
    We would like to get the column C value in this internal table itab by summing Column A and Column B, and then fill C column values into this internal table. We know that the program would looks like:
    Loop at itab into wa_itab.
        wa_itab-C = wa_itab-A + wa_itab-B.
        Modify itab index sy-tabix.
    EndLoop.
    But after executing the above code, all itab becomes blank. Through debugging, find it's caused by the statement "Modify itab index sy-tabix.".  Could any ABAP expert here let us know the reason and we will give you reward points!

    hi,
    what you tried is correct.but instead of using
    modify itab index sy-tabix
    use
    modify itab index sy-tabix from wa_itab.
    the reason for blank data is you are not mentioning from where that record is to be updated.your specifying the record using index.one thing is no need to use index also because in a loop you are modifying so automatically it will take you to the record.
    try the following code.
    types:begin of it,
         a type i,
         b type i,
         c type i,
         end of it.
    data:itab type standard table of it.
    data:wa_itab type it.
    wa_itab-a = 3. wa_itab-b = 4.
    append wa_itab to itab.
    Loop at itab into wa_itab.
        wa_itab-C = wa_itab-A + wa_itab-B.
    Modify itab index sy-tabix from wa_itab.
    *you can use Modify itab from wa_itab.
    EndLoop.
    loop at itab into wa_itab.
    write:wa_itab-a,wa_itab-b,wa_itab-c.
    endloop.
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Apr 8, 2008 5:49 PM

  • Modify dynamic internal table from dynamic work area using index...

    ASSIGN w_text TO <fs>.
        ASSIGN w_temp TO <fs1>.
        lint_tab_iw49[] = <tab>.
        lint_tab_iw49_t[] = <tab>.
        DELETE ADJACENT DUPLICATES FROM lint_tab_iw49 COMPARING aufnr.
        LOOP AT lint_tab_iw49 INTO lws_tab_iw49.
          READ TABLE lint_object_tab1 INTO lws_object_tab1
                        WITH KEY aufnr = lws_tab_iw49-aufnr.
          IF sy-subrc EQ 0.
    Collect operations in rows of an internal table.
            w_idx = 1.
            WHILE w_idx < 51.
              w_nn = w_idx.
              CONCATENATE 'lws_object_tab1-ZZOPERN' w_nn INTO w_xx.
              ASSIGN (w_xx) TO <fs>.
              CONCATENATE w_text <fs> INTO w_text SEPARATED BY ','.
              w_idx = w_idx + 1.
            ENDWHILE.
    Split operations into an internal table to get operations in rows.
            SPLIT w_text AT ',' INTO TABLE lint_vornr.
            DELETE lint_vornr WHERE vornr = ' '.
            DESCRIBE TABLE lint_vornr LINES w_lines.
    Collect costs in rows of an internal table
            CLEAR: w_idx, w_nn, w_xx, w_text.
            w_idx = 1.
            WHILE w_idx < 51.
              w_nn = w_idx.
              CONCATENATE 'lws_object_tab1-ZZCOST' w_nn INTO w_xx.
              ASSIGN (w_xx) TO <fs>.
              <fs1> = <fs>.
              CONCATENATE w_text <fs1> INTO w_text SEPARATED BY ','.
              w_idx = w_idx + 1.
            ENDWHILE.
    Split costs into an internal table to get costs in rows.
            SPLIT w_text AT ',' INTO TABLE lint_escost.
            DELETE lint_escost WHERE cost = ' '.
            DESCRIBE TABLE lint_escost LINES w_lines_cost.
           Append lines of lint_escost from 1 to w_lines to lint_escost1.
    Collect currencies in rows of an internal table
            CLEAR: w_idx, w_nn, w_xx, w_text.
            w_idx = 1.
            WHILE w_idx < 51.
              w_nn = w_idx.
              CONCATENATE 'lws_object_tab1-ZZCURR' w_nn INTO w_xx.
              ASSIGN (w_xx) TO <fs>.
              <fs1> = <fs>.
              CONCATENATE w_text <fs1> INTO w_text SEPARATED BY ','.
              w_idx = w_idx + 1.
            ENDWHILE.
    Split costs into an internal table to get costs in rows.
            SPLIT w_text AT ',' INTO TABLE lint_curr.
            DELETE lint_curr WHERE curr = ' '.
            DESCRIBE TABLE lint_curr LINES w_lines_curr.
           Append lines of lint_curr from 1 to w_lines to lint_curr1.
          ENDIF.
          PERFORM update_object_tab_for_iw49n.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " modify_object_tab
    *&      Form  update_object_tab_for_IW49N
          text
    -->  p1        text
    <--  p2        text
    FORM update_object_tab_for_iw49n .
      DATA: lws_temp TYPE string VALUE 'where aufnr = lws_tab_iw49-aufnr',
            lw_index TYPE sy-index.
      READ TABLE <tab> TRANSPORTING NO FIELDS WITH KEY ('AUFNR') =
      lws_tab_iw49-aufnr.
      IF sy-subrc EQ 0.
        lw_index = sy-tabix.
        LOOP AT <tab> INTO <wa1> FROM lw_index.
          IF <wa1>-aufnr NE lws_tab_iw49-aufnr.
            EXIT.
          ELSE.
            CLEAR lw_index.
           lw_index = sy-tabix.
            lw_index = 1.
            WHILE lw_index LE w_lines.
              READ TABLE lint_escost INTO lws_escost INDEX lw_index.
              IF sy-subrc EQ 0.
             lw_index = lw_index + 1.
                <wa1>-zzcost1 = lws_escost-cost.
              ENDIF.
              READ TABLE lint_curr1 INTO lws_curr INDEX lw_index.
              IF sy-subrc EQ 0.
                <wa1>-zzcurr1 = lws_curr-curr.
              ENDIF.
              MODIFY <tab> FROM <wa1> "TRANSPORTING ('ZZCOST1') ('ZZCURR1')
                        INDEX sy-tabix.
              IF sy-subrc EQ 0.
              ENDIF.
              lw_index = lw_index + 1.
            ENDWHILE.
          ENDIF.
        ENDLOOP.
      ENDIF. 
    ENDFORM.                    " update_object
    Hi,
    With referene to the code snippet above I want to modify <tab> from <wa1> on specific indices or with specific where condition.
    Is it achievable... How?
    Many thanks in advance.
    Thanks & Regards,
    Shreya

    You might have to split the code in to two parts to keep the formatting intact.

  • Internal table not getting modified from Table Control

    Hi Guys,
    I am developing a <b>Module Pool </b>Program where I am inserting data directly in table control of the main screen.
    In the flow logic of the Table control I have written :
    PROCESS BEFORE OUTPUT.
      LOOP AT itab WITH CONTROL tc1 CURSOR tc1-current_line.
        MODULE read_data.
      ENDLOOP.
    MODULE status_0100.
    PROCESS AFTER INPUT.
      LOOP AT itab.
        MODULE mod_data.
      ENDLOOP.
    MODULE user_command_0100.
    Module mod_data input.
    MODIFY itab INDEX tc1-current_line.
    Endmodule.   
    At modify, when I am debugging it's showing sy-subrc = 4 (Entry not appending in Int Table though it is there in the header line). But, if I use append itab, it's working (Problem is that while inserting 2nd record a copy of first record is also appending which I don't want).
    Please let me know what's wrong in Modify statement or what is solution for inserting records of tablecontrol in internal table.
    TIA,
    Nitin

    Hi Nitin,
    use the following code wor module.
    Module mod_data input.
    READ ITAB INDEX TC1-CURRENT_LINE.
    IF SY-SUBRC = 0.
           MODIFY itab INDEX tc1-current_line.
    ELSE.
           APPEND ITAB.
    ENDIF.
    Endmodule.

Maybe you are looking for

  • RTF template does not format properly when run from Concurent Manager

    Hi I have complex RTF template; many stuff in are in header in word table format,body section again fields are in table format and Footer again in word table format. When I run BI Publisher report as concurrent request half the content like header an

  • Bea weblogic server

    My weblogic server is not getting started... software is installed succesfully....

  • Setting Camera Profile question

    Canon 40D in Lightroom 2.3 While reading the FAQ I noted the statement for the Canon settings: In general, there are 5 CM profiles per Canon DSLR, one for each of the default Canon Picture Styles. These five Picture Styles are called Standard, Portra

  • Isight driver install problems

    Hello all, well after installing SL then Win 7 then running bootcamp inside windows almost everything is working correctly. The only error i'm faced with is the iSight drivers do not want to correctly install. At boot up i get a driver install error

  • Upgrade From the Microsoft VM to Java Sun JRE

    Hello, I am trying to upgrade my applet to java sun 1.5. I am using this tutorials: http://java.sun.com/j2se/1.4.2/docs/guide/deployment/deployment-guide/upgrade-guide/ the problem is, when I run the applet local, I am not calling to the JAR file. in