Modify contents in a table

Hi all,
I have a table 'tab' with some records and this table 'tab' has two keys. I want to read a particular record with the two keys(I have these two key values). This record has a field unit of measure which is always 'L' and I want to overwrite Unit of measure value to 'Kg' in that field and modify the table with that row entry.
How can I do this. Please help..... Waiting....

Hi Raju,
Let this be internal table it_test
key1 | key2 | name | unit |amount
1 | 2 | asd  | P | 100.00
3 | 4 | ash  | L | 200.00
5 | 6 | adsf | P |300.00
Lets assume that ( name = L ) can occur mulitple times
for different records in the internal table.
Then add this chunk of code to modify the contents of the field name form <b>L</b> to <b>Kg</b>.
LOOP AT it_test WHERE name = 'L'.
  it_test-name = 'Kg'.
  MODIFY it_test INDEX sy-tabix TRANSPORTING name.
ENDLOOP.
Regards,
AS

Similar Messages

  • Required code to modify contents of a table

    Hi All,
    I want to create a class which i can use in Web Application Designer to modify content of a WEB Query Table.
    For that i am using table interface property of WAD. Here is my scenario:
    In table where ever i got 999999 it has to be replaced by 'DNA' (Data Not Available).
    For that i created a class ZCL_RSR_WWW_MODIFY_TABLE which inherit superclass CL_RSR_WWW_MODIFY_TABLE
    Now in the Method DATA_CELL i need to write some code so that it must replaces the data cell content of the table as said above.
    Please go through this link so that you will be clear of what i am asking ?
    http://help.sap.com/saphelp_nw04/helpdata/en/b3/f4b1406fecef0fe10000000a1550b0/frameset.htm
    Regards,
    Rajkandula

    Solved Myself with little coding.

  • Problem in transporting contents of a table

    Hi All,
    I want to transport the contents of a table from development server to quality server.
    I used transaction SE16 and clicked on display entries. It gave a menu called transport entries where it gave a prompt for a workbench request. I created the workbench request for the table entries.
    When I was transporting the request, I checked the task under the request.  The request was in the modifiable task. It contained the entry for table contents namely R3TR TABU TABLENAME . After I released the task, I found that this entry for table contents namely R3TR TABU TABLENAME disappeared. Please could someone tell me why this is happening.
    Please could someone tell me if we should create a workbench request or a customizing request for  transporting the contents of a table.
    Apart fom SE16, which other method can we use to transport contents of a table ?
    Regards,
    Sushanth H.S.

    Hello Sushant
    >But even after doing so, when I clicked on SE16 and clicked on transport entries in the display menu of the >table, it was asking me for a workbench request and not a customizing request. Please could you tell me >the reason for the same.
    Based on this description your scenario looks like this:
    You have a z-table (now client-dependent) and maintain this table using a maintenance or table view.
    The only explanation I have for the behaviour of the system is that your client-dependent z-table has NOT delivery class = 'C' (Customizing) but probably 'A' (Application table instead).
    That's ok because I usually do define z-tables having delivery class = 'A' even if the table contents is used for some kind of customizing.
    Reason: I do no want to encounter all the restrictions for C-class tables in productive system.
    However, if your z-table contains very sensitive data you may explicitly choose delivery class = 'C'.
    Regards
       Uwe

  • How to modify a data base table ?

    Hi,
        i am working on a list output where if user is editing a field and that field need to be updated in the data base. table is a z table .
    the table has 5 fields .
    mandt       key field
    matnr       key field
    werks      key field
    charg       key field
    lgpla         key field
    usnam
    edate
    in the list output , the user will change the values in the lgpla field and that field need to be changed in the data base table.
    i have used the stmt :
    modify< table> from <internal table> ,
    but a new record is added in the data base instead of overwriting the existing one.
    but the record can be seen modified in the internal table.
    kinldy let me know the method of updating or modifying the existing value in the data base.
    thanks and regards,
    vikram.

    Hi,
    Its not possible to change Primary Key contents in the database.
    it  mention in documentation of MODIFY Statement,
    a line is searched for in the database table that has the same content
    in the primary key as the corresponding beginning part of the work area.
    If such a line is not found,
    a new line is inserted according to the same rules as for the INSERT statement.
    If such a line is found,
    this line is overwritten according to the same rules as for the UPDATE statement
    if you want insert the modified line first Delete from database,Then Use Modify Statement
    Regards,
    Raghava Channooru

  • How to Delete the Content of a Table?

    Hi,
    Please, i need to modify the content of a table, but before i want to delete this content. See follow the code that is used actually:
    DELETE (pr_name_table).
    MODIFY (pr_name_table) FROM TABLE prt_table.
    MESSAGE s000(zbrx) WITH text-i02 pr_name_table.
    The ABAP Editor don't accept the expression "DELETE (pr_name_table).".
    How to delete this content???
    Best Regards,
    Daniel Sanchez

    Hi,
    Thanks for helps! The problem been resolved with this solution:
    >> Call of Call:
    IF sy-subrc IS INITIAL.
          PERFORM z_upload_table TABLES t_zpf0012 t_bkp_zpf0012
                                    USING  c_zpf0012.
    ENDIF.
    >> In the Form: (after processing of Form)
    FORM z_upload_table TABLES prt_table prt_table2
                           USING  pr_nome_table.
      IF sy-subrc <> 0.
        MESSAGE i000(zbrx) WITH text-i03 l_file.
      ELSE.
        DELETE (pr_name_table) FROM TABLE prt_table2.
        MODIFY (pr_name_table) FROM TABLE prt_table.
      ENDIF.
    Best Regards,
    Daniel Sanchez

  • How to delete the complete contents of database table ? should be empty !!

    Hi Guys,
    I have requirement where i have delete the contents of database table..i have make it empty (no records at all) and then i have to fill it with the records from the excel sheet.
    I can upload data from the excel sheet.
    Please tell me how to delete the complete contents of the database table ??
    Regards
    Rahul

    hi ,
    just write like this,
    delete from <database table>.
    commit work.
    sample code, here edpar is database table.
    delete from edpar." FROM TABLE g_tab_delete.
      call function 'DB_COMMIT'.
      loop at g_tab_edpar into g_wa_edpar.
        insert into edpar values g_wa_edpar.
        if sy-subrc  eq 0.
          move-corresponding g_wa_edpar to g_wa_edpar1.
          append g_wa_edpar1 to g_tab_edpar1.
        else.
          move-corresponding g_wa_edpar to g_wa_edpar2.
          append g_wa_edpar2 to g_tab_edpar2.
        endif.
      endloop.
    that's all it works.
    reward points if helpful.
    regards,
    seshu.

  • How to use create, delete, modify butttons in a table

    hi all
    in my application i have emp table in my source view
    in that table i have inserted static data in columns i.e., empid, empname. i have 3 buttons create, delete, modify buttons in that table. when i press Create button it navigates to another view1 in which we have a emp form with create new emp button and labels empid, empname and 2 input fields.After filling the form when hit the create newemp button the form data should be displayed in the table.
    The same for Modify and delete.  i.e., when i select a particular empid row in my source view table and hit the modify button it should navigate to view2 in which the particular record form with data displays and after making necessary modifications the modified data should be display in the particular row .
    For delete button, when i select a particular record in the table and hit delete button it should be deleted from the table.
    any snippet of code is valuable
    Thanks in advance
    sravan

    Hi Sravan,
    I just need a clarification, are you getting the table data from the back-end system?
    On the second view, after the user input on click of the "Create New" or "Modify" button, update the back-end. Once the update is successful, fire a plug back to the first view and reload the table or execute the model again. The updated records will be fetched from back-end system.
    On click of "Delete" button, remove the record from the back-end and execute the model again.
    This holds good if you have the data fetched from the back-end.
    Regards,
    Santhosh.C

  • TCODE-to view the content of setuo table

    Hi Experts,
    Can anyone let me know is there any TCODE where we can view the content of setup table
    Regards,
    Meera

    Hi,
    Normally the tables r in the form of clustertables if u want to see there is no special tcode for this  go to the SE11 or SE16 give the table name as below
    if the datasource is 2lis_11_vahdr after filling setup tables for this datasource9for this application component)MC11va0hdrsetupin se11 in table u give that bold one and execute it u can see the setup tables.
    Thanks & regrds
    sathish
    Edited by: sathish kakumudi on Jan 30, 2009 2:22 PM
    Edited by: sathish kakumudi on Jan 30, 2009 2:24 PM

  • Problem in modifying the main internal table gt_data

    Hello i have written code for modifying the main internal table. i have read data from ausp table and put into the internal table gt_ausp. now i want to modify my main table GT-DATA with gt_ausp. i am not able to do this.
    LOOP AT gt_data  INTO ls_list.
        lt_temp-objek  =  ls_list-matnr.
        APPEND  lt_temp.                  " 특성값 발췌용도로 저장
        APPEND  ls_list  TO lt_work.      " 핵심작업용도로 저장
      ENDLOOP.
      DESCRIBE TABLE lt_temp.
      IF  sy-tfill  EQ  0.
        pv_flg  =  'X'.
        EXIT.
      ENDIF.
    Get 제품인증(플랜트별).....
      DESCRIBE TABLE lt_cetino_tp.
            플랜트          자재번호
            카타로그-인증   코드그룹-인증   인증코드
            Certi. No.
    Get 자재별 특성값..........
              오브젝트  특성이름  내부특성   내부카운터  특성값
      SELECT    aobjek    batnam   aatinn    aatzhl    a~atwrt
            INTO CORRESPONDING FIELDS OF TABLE  lt_ausp_tp
            FROM ausp AS a  INNER JOIN  cabn AS b
              ON aatinn  =  batinn
             FOR ALL ENTRIES IN  lt_temp
           WHERE a~objek  EQ  lt_temp-objek   " 오브젝트키(자재번호)
             AND a~klart  EQ  '001'           " 클래스유형
           AND a~atzhl  EQ  '001'           " 특성값카운터(최종건만 존재)
                                              자재특성 변경시 변경됨
             AND b~adzhl  EQ  '0000'.
      IF  sy-subrc  EQ  0.
        DELETE ADJACENT DUPLICATES FROM  lt_ausp_tp.
        lt_ausp[]     =  lt_ausp_tp[].
        lt_ausp_tp2[] =  lt_ausp_tp[].
        DELETE ADJACENT DUPLICATES FROM  lt_ausp_tp2.
      Get 특성내역
              내부특성   " 내부카운터
              특성값       특성값내역
        SELECT    aatinn  " aatzhl
                  aatwrt    batwtb
              INTO CORRESPONDING FIELDS OF TABLE  lt_cawn
              FROM cawn AS a  INNER JOIN  cawnt AS b
                ON aatinn  =  batinn  AND
                   aatzhl  =  batzhl  AND
                   aadzhl  =  badzhl
               FOR ALL ENTRIES IN  lt_ausp_tp2
             WHERE a~atinn  EQ  lt_ausp_tp2-atinn  " 내부특성
               AND b~spras  EQ  sy-langu.
      ENDIF.
      SORT  lt_work BY matnr .
      BREAK-POINT.
      LOOP AT lt_work  INTO ls_list.
      특성내역
        READ TABLE  lt_ausp  WITH TABLE KEY  objek = ls_list-matnr
                                             atnam = 'SECTION_WIDTH'.
      수출자재가 아닌 것은 제외
    LS_LIST-SECTION_WIDTH = LT_AUSP-ATWRT.
    MODIFY TABLE GT_DATA FROM LS_LIST  TRANSPORTING SECTION_WIDTH.

    Hi,
    Question before: why dont you just use the std.API for reading the classification data?
    e.g. "BAPI_OBJCL_GETDETAIL"
    Second: a DELETE DELETE ADJACENT DUPLICATES works only only sorted tables.
    Doing this after a select will only succeed randomly depending on the buffers of your data based below.
    ( 90% chance if it is an oracle system)
    To your question:
    Just replace your LOOP AT gt_data into ls_list
    by a LOOP AT gt_data ASSIGNING <current_list_record>.
    then you can access the fields directly:
    <current_list_record>-SECTION_WIDTH = LT_AUSP-ATWRT.
    Cause of your issue:
    "MODIFY" needs a key to to find the record to be updated.
    If your gt_data ist referencing a DDIC table type with a key or a local type with a key
    it has no chance to do it.
    Hope that helps.
    br,

  • Deleting DB table contents using internal table

    Hi Gurus,
    I have a requirement of deleting DB table contents. Requirement is as follows,
    User will select the DB table description in the seletion screen using drop down list.
    Whichever description he selects,the corresponding table contents should be deleted and we should not hardcode the table name in if or case conditions.
    Is this possible?
    Regards,
    G.Srinivasan

    Hi,
    You can get the Table name from the desciption from table DD02T.
    Use the Key word DELETE to delete the contents of a table from program.
    PARAMETERS : p_ddtext type ddtext.
    select single * from dd02t into table db_tab where DDLANGUAGE = 'EN' and ddtext = p_ddtext.
    DELETE DB_TAB-TABNAME
    FROM ITAB. " Take F1 help on this Key word
    IMPORTANT --> Do not manually delete the contents of a DB table in SAP.
    The individual records only deleted through BDC or any other Acceptable Methods.
    Rest is left to you. Be careful about this activity. Take enough Authourizations/ Permissions or consult your BASIS or other team members.
    Cheerz
    Ram

  • HOW TO MAKE THE CONTENT OF THE TABLE PRINT IN A TABLE CONTROL SCREEN?

    Can any one tell me how to make the content of the table control print in a table control screen!!?
    Please help!!
    I have to make the contents of a table in the table control screen print ? any idea
    Regards,
    Vj

    Please refer to Demo Program,
    DEMO_DYNPRO_TABCONT_LOOP
    Its very clear.
    Shreekant

  • Remove the contents of the table container in workflow

    hi,
    i want remove the contents of the table container in a method in workflow.
      how can i doit. anyone pls send me the syntax.
    after removing the old contents then i want to insert new values to that table.
    Thanks
    Sankar

    hi,
    i want to refresh the container in workflow.
    anyone pls tell me.
    Thanksin advance.
    sankar.

  • Copy contents of one table to another

    Hi,
    Can anyone will give me the code copying the contents of one table to another...
    Need an urgetn help..
    Thanks

    Thanks for everyones reply...
    But here the problem
    I to copy the content based on the length of the content
    Eg:
    If the content key code has 3 characteristics then where ever the last 2 characters are similar i need to copy the rrest content
    EG:-
    234
    236
    278
    299
    288
    that means i need to take the last two characteristic and copy the rest data ...
    another option
    23411
    23412
    23413
    23414
    in this i need to check the last 4 characters and copy...
    Can any one help..
    Another important point is it need to copy in different fields ...
    Eg: from where i am copying is FIELD A which has all the data and it need to copy in Field1,2,3,4,5,6,7,8
    Thanks

  • How to clear the contents of a table

    I was using a 'build table' to collect some datas and pass it to an 'Express  table'.
    what are the possible options to clear the contents of that table?
    How can i clear the contents using a 'button'?

    Build table function has an additional input called 'Reset'
    Attach a boolean to it.
    On front panel, set the boolean's mechanical action as 'latch when released'
    Look at attached vi
    Regards,
    Dev
    Message Edited by devchander on 08-06-2007 08:02 AM
    Attachments:
    reset table.vi ‏57 KB

  • Update Modified Content (Linked layers / Smart objects)

    Hey guys,
    Is there anything in the API for handling the new Linked layers? (CC 14.2)
    Specifically, I want to be able to Update Modified Content iteratively to handle lots of nested links.
    It doesn't have to be pretty, just functional, as this is a very complicated task to do manually.
    Cheers

    Crude, but maybe this helps:
    // 2014, use it at your own risk;
    #target photoshop
    if (app.documents.length > 0) {
    var ref = new ActionReference();
    ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
    var applicationDesc = executeActionGet(ref);
    var theXMP = applicationDesc.getString(stringIDToTypeID('XMPMetadataAsUTF8'));
    var theFiles = new Array;
    var theArray = theXMP.split("<stRef:filePath>");
    for (var m = 1; m < theArray.length; m++) {
    theFiles.push (theArray[m].slice(6,theArray[m].indexOf("</stRef:filePath>")));
    if (theFiles.length > 0) {alert(theFiles.join("\n"))};
    Edit: One problem, though: the list in the XMP metadata may not be up to date if the file has not been saved since the last linked SO has been placed or embedded.

Maybe you are looking for

  • Error in updating iTunes to 10.1.2

    Using the apple updater it's fine until it gets to install, which it will do for about a minute, then an error message will come up saying "Error occurred while installing the update" if problem persists install manually (which doesn't work) This has

  • Itunes update error

    Hey all: I have winxphome, avast antivirus, windows firewall. I do not have norton or Zonealarm. I have used itunes without problem for well over a year. I am trying to update to 6.0.2 but have this error each time. I have tried uninstall, reinstall,

  • 10g database control

    hi, Working on oracle 10g is just like a mirage for me. I have installed and uninstalled it many times on my new laptop, but not been able to work on it, because of many oracle problems. my OS is windows xp prof. sp2. i have cracked my brain on acces

  • Saving a journey details to my phone.

    I have logged in and managed to find the journey details for a particular run that I propose to make, but I cannot find out how to store the whole journey on to my phone ( a folder?) so that I can quickly access the details when I need to set off. Is

  • When i try to connect to my applications icon this error appears:  cannot connect to itunes store.  Why does it say this and how can I correct it?

    When I try to connect to my application icon it states "cannot connect to itunes store"  why and how can I fix it