Table Control, change data of itab on enter-click

Hello all, I have an itab gt_task_704 which I use to display in a table control.
When the user changes a field and pushes on the ENTER-KEY, I'm trying to modify this itab with the new content.
The issue I have is that some fields are updated with faulty content.
In PAI I'm doing the following:
PROCESS AFTER INPUT.
*&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'TC_705'
  LOOP AT gt_task_705.
    CHAIN.
      FIELD gs_task_705-zzpcod.
      FIELD gs_task_705-zprest_descr.
      FIELD gs_task_705-zmdhrs.
      FIELD gs_task_705-zhrs.
      FIELD gs_task_705-discipline.
      FIELD gs_task_705-zmdpctouts.
      FIELD gs_task_705-zpctouts.
      FIELD gs_task_705-zmdpctovhd.
      FIELD gs_task_705-zpctovhd.
      FIELD gs_task_705-zcomment.
    ENDCHAIN.
    MODULE update_table_705. "INPUT.
  "MODULE sort_705.
  ENDLOOP.
====> update_table_705:
  DESCRIBE TABLE gt_task_705 LINES gv_lines_705.
  IF tc_705-current_line LE gv_lines_705.
    "READ TABLE gt_task_705 INTO gs_task_705 INDEX tc_705-current_line.
    SHIFT gs_task_705-zhrs LEFT DELETING LEADING '0'.
    MODIFY gt_task_705 FROM gs_task_705 INDEX tc_705-current_line
                       TRANSPORTING zhrs zpctouts zpctovhd.
  ENDIF.
  CLEAR gs_task_705.
It seems like a problem of sorting I think but I still didn't manage to change the correct lines.
Can someone please give a helping hand to this young abap'er
Thanks in advance

Mr.Dragovian you write the module between chain..endchain.
chain.
module Md1 on chain-input.
endchain.
MODULE Md1 INPUT.
   modify itab INDEX tc-current_line  transporting fld(s).
ENDMODULE.
By this way,you will be able to get the correct user-entered data into itab.

Similar Messages

  • How to add rows in table control for data recording BDC?

    hello,
    pl tell me the way to upload data through BDC in table control of screen .
    how to add fields inrecording of table control?
    Please give some code in this regard.
    I am generous in giving points..pl help!

    Hi,
    While doing code under recording first you need to do the recording with sample data under a particular transaction like T-code XK01 (Vendor creation).
    Take an example of create vendor using T-code XK01:
    Go to t-code 'SHDB' under make recording for XK01 with sample data and once if you complete the recording means after vendor creation check the source code bye by pressing the button  'Program', it shows the total coding for recording of what you entered the test data.
    Then you will create one program and copy that source code of recording into your program, and now you have to remove the values at perform statement and give the internal table field name.
    Like that you can develop your own code along with your validations.
    my best suggestion is don’t see the example code of recording method because any one for standard t-code should get the code from recording with sample data, so first tryout with your own recording method and you can understand the code step by step.
    With these I hope you will get some idea of recoding method.
    Let me know for further doubts.
    Regards,
    Vijay.

  • Mixed Data Type Table Control for Data Entry

    Hi Guys --
    I'm attempting to do error-checked data entry,
    My data is mixed: path, boolean, and numeric.  The natural organization is an array of clusters.  For instance, the cluster element would look like "path, boolean, numeric, numeric"  and I would have many rows of this data cluster.  To further complicate things I have to dynamically define the number of numeric elements in the cluster (tricky already) and also dynamically define the length of the array.
    I find the table control to be ideal to handle the dynamic nature of the data for editing.  I can easily use scroll bars to navigate to the appropriate part of the data.  I can delete rows and columns etc.
    On the other hand, the table can only handle string data.  I find that doing data checking and type conversion on the table elements to be extremely cumbersome. 
    I think what I'm looking for is a Table Control with ability to handle controls as elements.  From what I've read in this list and personally experienced, that functionality doesn't exist.
    Does LV have in-built functionality that I'm overlooking to resolve this problem?  Is there a third-party library that would do the job?
    Thanks,
    John

    Hi Ben --
    I think perhaps that I wasn't clear in my description. 
    As I pointed out, my data is organized naturally as an Array of Clusters.  More descriptively, my data looks like spreadsheet data; some text, some numbers.  I need to add rows and columns dynamically.  I need to be able to resize column widths dynamically... and while the program is executing.
    The Table Control does all of this.  The intuitive way that the Table Control permits a user to enter data is also good for my user.  The Array of Cluster data looks like spreadsheet data and a Table looks close enough to a spreadsheet.  A Table permits one to insert and delete rows, resize columns widths, and scroll around.
    I don't see that I get these features with an Array of Clusters Control.
    The issue with the Table Control is the lack of in-built data types, so I spend an inordinate amount of time doing type-conversion and range-checking. 
    At this point I'm pretty much convinced that LV doesn't have the in-built capability that I'm looking for. 
    I am curious if there are any LV libraries or Active-X controls somewhere that would implement the functionality that I require?

  • Table control change column position or number

    Hi Guys,
    I need to move a column from position 10 to position 5 in the standard program. I did change the table control position in screen painter by doing cut and past of columns at required positions and it does change there but it does not show column positions in the actual screen. Is there config for table control in the standard program?
    In the attributes the position number is disable. Is there some other way that I can move the columns.
    Please advise.
    Thanks,
    FS

    Thanks Manesh,
    I am using travel overview transaction PR05. Can you recommend any config area where the table column positions are maintained. Thanks.
    Regards,
    FS

  • Table control-change the output of a column. My column shows numbers (char)

    Hello Friends,
    I have in the table control a table. This table show varoius columns , but one column shows numbers. My boss detected that there are showed the numbres but without decimals . for example 10 is showed instead of 10.35. The format of the column is char . How can i change the format to make it appear with decimals? I tried with split in the internal processes. but the problem are the external ones. Because this column is automatically converted to char . what can i do ?
    Thanks!!

    i did not asigned a type char.
    i just referenzed from a field of a matrix table., the machine recognizes this field as char and shows the filed with no decimals at all
    How can i make the decimals to appear?

  • How can we get a Scrolling in Table Control while data uploading?.

    Can anybody suggest me the way to put a scrolling in a table control while uploading the data?

    Hello,
    I dont think it is possible, anyways dont do it. It will make the program perfomance very bad. There is an indicator (little watch on the left hand side), that you can use, but it is better to dont do it. As I have told you the perfomance will be very bad.
    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
        EXPORTING
          percentage = 20
          text       = 'Uploading data'.
    THAT IS THE FM. Use it after and before the upload.
    Hope this helps
    Gabriel

  • Highlight table control rows when select all button is clicked

    Hi Experts,
    I have a table control and filling up rows through user input and i have also created button such as Select All* , De-Select All, and Delete.
    Now the issue is when i am pressing the select all button all the rows are marked for deletion(internal 'X' flag is set) but the rows are not highlighted(so that user will be able to know that all rows are selected).
    Anything that i am missing, please guide......
    Regards,
    Abhijit G. Borkar

    Ohh sorry there was some problem with the internet connect, that's why  this duplicate happened.
    Regards,
    Abhijit G. Borkar

  • How to populate data in table control  .

    hi all,
    i put matnr no. in screen no. 103
    validation is done at that screen only.
    now when i want to modify dat record
    when i put matnr no. at screen 103
    so how i will get all  data of dat number to table control screen.

    Hi Darshan,
       Here is a detailed description of how to update data in table controll.
      Updating data in table control
    The ABAP language provides two mechanisms for loading the table control with data from the internal table and then storing the altered rows of the table control back to the internal table.
    Method 1: Read the internal table into the Table Control in the screenu2019s flow logic.  Used when the names of the Table Control fields are based on fields of the internal table.
    Method 2: Read the internal table into the Table Control in the module pool code. Used when the names of the Table Control fields are based on fields of the database table.
    Method 1 (table control fields = itab fields)
    In the flow logic we can read an internal table using the LOOP statement. Define the reference to the relevant able control by specifying WITH CONTROL <ctrl>
    Determine which table entry is to be read by specifying CURSOR <ctrl>-CURRENT_LINE.
    After the read operation the field contents are placed in the header line of the internal table. If the fields in the table control have the same name as the internal they will be filled automatically. Otherwise we need to write a module to transfer the internal table fields to the screen fields.
    We must reflect any changes the user makes to the fields of the table control in the internal table otherwise they will not appear when the screen is redisplayed after PBO processing, (eg, after the user presses Enter or scrolls) However, this processing should be performed only if changes have actually been made to the screen fields of the table control (hence the use of the ON REQUEST)
    PROCESS BEFORE OUTPUT.
    LOOP AT ITAB_REG WITH CONTROL TCREG
    CURSOR TCREG-CURRENT_LINE.
    ENDLOOP.
    PROCESS AFTER INPUT.
    LOOP AT ITAB_REG.
    MODULE MODIFY_ITAB_REG.
    ENDLOOP.
    MODULE MODIFY_ITAB_REG INPUT.
    MODIFY ITAB_REG INDEX TCREG-CURRENT_LINE.
    ENDMODULE.
    Method 2 (table control fields = dict. fields)
    If using a LOOP statement without an internal table in the flow logic, we must read the data in a PBO module which is called each time the loop is processed.
    Since, in this case, the system cannot determine the number of internal table entries itself, we must use the EXIT FROM STEP-LOOP statement to ensure that no blank lines are displayed in the table control if there are no more corresponding entries in the internal table.
    PROCESS BEFORE OUTPUT.
    LOOP WITH CONTROL TCREG.
    MODULE READ_ITAB_REG.
    ENDLOOP.
    PROCESS AFTER INPUT.
    LOOP WITH CONTROL TCREG.
    CHAIN.
    FIELD: ITAB_REG-REG,
    ITAB_REG-DESC.
    MODULE MODIFY_ITAB_REG
    ON CHAIN-REQUEST.
    ENDCHAIN.
    ENDLOOP.
    MODULE READ_ITAB_REG OUTPUT.
    READ TABLE ITAB_REG INDEX TCREG-CURRENT_LINE.
    IF SY-SUBRC EQ 0.
    MOVE-CORRESPONDING ITAB_REREG TO TCREG.
    ELSE.
    EXIT FROM STEP-LOOP.
    ENDIF.
    ENDMODULE.
    MODULE MODIFY_ITAB_REG INPUT.
    MOVE-CORRESPONDING TCREG TO ITAB_REG.
    MODIFY ITAB_REG INDEX
    TCREG-CURRENT_LINE.
    ENDMODULE.
    Updating the internal table
    Method 1
    PROCESS AFTER INPUT.
    LOOP AT ITAB_REG.
    CHAIN.
    FIELD: ITAB_REG-REG,
    ITAB_REG-DESC.
    MODULE MODIFY_ITAB_REG ON CHAIN-REQUEST.
    ENDCHAIN.
    ENDLOOP.
    MODULE MODIFY_ITAB_REG INPUT.
    ITAB_REG-MARK = u2018Xu2019.
    MODIFY ITAB_REG INDEX TCREG-CURRENT_LINE.
    ENDMODULE.
    Method 2
    PROCESS AFTER INPUT.
    LOOP WITH CONTROL TCREG.
    CHAIN.
    FIELD: TCREG-REG,
    TCREG-DESC.
    MODULE MODIFY_ITAB_REG ON CHAIN-REQUEST.
    ENDCHAIN.
    ENDLOOP.
    MODULE MODIFY_ITAB_REG INPUT.
    MOVE-CORRESPONDING TCREG TO ITAB_REG.
    ITAB_REG-MARK = u2018Xu2019.
    MODIFY ITAB_REG INDEX TCREG-CURRENT_LINE.
    ENDMODULE.
    Updating the database
    MODULE USER_COMMAND_100.
    CASE OK_CODE.
    WHEN u2018SAVEu2019.
    LOOP AT ITAB-REG.
    CHECK ITAB_REG-MARK = u2018Xu2019.
    MOVE-CORRESPONDING ITAB_REG TO TCREG.
    UPDATE TCREG.
    ENDLOOP.
    WHEN u2026
    u2026
    ENDCASE.
    ENDMODULE.
    Hope this will solve your problem.
    Regards,
    Pavan.
    Edited by: PAVAN CHANDRASEKHAR GANTI on Aug 3, 2009 12:48 PM

  • Records are getting duplicated on presing enter key in table control

    Hi All,
    I am using table control in module pool program.  The issue is records are getting duplicated on press of enter key.
    I cannot use sy-ucomm enter and do some validation thing in my code. As the record should get update in int_tab(internal table). Otherwise ZSTR_TAB(table control)will be blank after pressing enter key.
    I have gone through all the previous threads on this. Have implemented sol provided in one of threads. Now records are not getting duplicated but the next line is getting disabled. The code to avoid duplication is :
    MODULE read_table_control INPUT.
      data tc-lines type i.
      DESCRIBE TABLE int_tab LINES tc-lines.
      IF tc-lines GE control-current_line.
        MODIFY int_tab FROM zstr_tab INDEX control-current_line.
      ELSE.
        IF gcreate_code = 'CREATE'.
          zstr_tab-zemp_num = gemp_num.
          INSERT zstr_tab INTO int_tab INDEX control-current_line.
        ENDIF.
        IF gchange_code = 'CHANGE'.
          MODIFY int_tab FROM zstr_tab INDEX control-current_line.
        ENDIF.
      ENDIF.
    ENDMODULE.   
    This module is in PAI. Now how to make the lines in control input enabled??
    Any other sol for avoiding duplicate records on pressing enter key?
    Thanks,
    Seema

    Hi,
    Have you written any code in when Others of case...Endcase  ?
    If Yes then checkout if there is anything wrong over there, debug and check.
    If not then write delete adgecent duplicates from Int_tab comparing key fields.
    Also check in PBO, if you have written any query that selects data from particular table and appending the internal table irrespective of entry is already exist. So you should write select query in the if...Endif block as below,
    If int_tab[] is not initial.
    select * from ZSTR_TAB
    into table int_tab
    where .........
    endif.
    If above is not the case then debug and check where exactly entries are getting duplicated so that I can have idea what exactly is happening.
    Regards,
    Umang Mehta

  • Error while trying to change the Column description in Table Control

    Hi,
    I have created a table control using the wizard in Module Pool.
    When i try to change the column description of the table control or adjust any other element which is already available on the screen and not in table control. It gives me an error
    Unable to transfer data. End Program?
    Any help would be appreciated.
    Thanks
    Sarves S V K

    Hi.,
    Check these  [Table Control Change Column Description|Add new columns in table control in custom screen program;
    and  [Add Columns in Table Control|Re: Table control columns]
    else  delete and create Table control Again..!!
    hope this helps u.,
    Thanks & Regards,
    Kiran

  • How to clear data in Table Control.

    hi! all
    How to clear the data in table control.
    i have a Table control which displays column A data from the previous screen and allows to enter column B and column C and i have a button CLEAR, when i click CLEAR button the Data displaying in table control has to be cleared. how to do it.
    Regards,
    Nagulan

    Hi,
    Loop over the internal table of table control & clear data from table control.
    loop at tctab.
    clear tctab.
    modify tctab.
    endloop.
    Best regards,
    Prashant

  • How to Insert Data in Ztable Using table Control

    Hi All,
      Please give some ideas of how to store the data from table control into the ztable database.
    There is a table control in which the end user enters the data manually and clicks the save button. Then, the data from the table control will go and store in the ztable.
    regards
    Vicky Kumar

    Hi Vicky,
    are you talking about ABAP transaction SE11 or about creating tables in the SAP HANA directly, i.e. in the HANA Modeler perspective?
    Cheers,
      Jasmin

  • Migrating data from one screen to another though Table Control

    Hi Sapgurus,
    I am woking n the scenerio where i have two screen 100 and 200 now in 100 screen i have a Table Control, now i want that when i click on the row of this table control the selected row data should  be migrated to another screen.
    I have already check the "Respond to Double click property". But i dont know how to move further.
    Please Help.

    Hi,
    In the user command Module,
    check at sy-ucomm
    if double click....call screen 200
    and then u must be having the data in the internal table, fetch the data from the table.
    Regards,
    Sonika

  • Reading data from table control

    Hi,
    Intially I have a table control and in that I am entering deliveries(manually), how to read them into internal table..plz advise
    regards.

    Hi,
    Use the FM DYNP_VALUES_READ
    Regards,
    Vikranth

  • Downloading table control data in excel sheet

    Hi experts,
    I have written a module pool pgm which fetches the data from a table and filled in a table control. Now my requirement is to download this (table control data) in an excel sheet like we download the ALV report data in an excel sheet.
    Can the same downloading option be provided in module pool pgm also?
    Pls tell me how it is possible to download the table control data in an excel sheet in module pool?
    Regards,
    Shanthi

    Hi Shanthi,
    As you can display data in Table Control means data is available in Internal Table
    Give Download Button
    case ok_code.
    when 'DOWN'.
          CALL FUNCTION 'F4_FILENAME'
            IMPORTING
              file_name = path1.
          CALL FUNCTION 'GUI_DOWNLOAD' " Go through FM Documentatin for more Info
            EXPORTING
              filename              = path1
              filetype              = 'ASC'
              write_field_separator = 'X'
            TABLES
              data_tab              = ist_final
              fieldnames            = ist_fc_download " You can provide the Column Heading
            EXCEPTIONS
              OTHERS                = 22.
    endcase.
    Cheerz
    Ram
    Edited by: Rob Burbank on Mar 20, 2010 5:04 PM

Maybe you are looking for

  • I have two itunes accounts and want to make them into one account.

    I have two itune accounts and would like to combined them to make one.  Is this possible and if so how can I do it?

  • Error while trying to feed a group with RSS.

    Hello, I'm working at the University of Southampton creating the iTunes U page. Although our page is not currently live, I'm trying to add a RSS feed (extracted from the iTuneU Adm. Guide) to a group of a course but I'm getting the following error: "

  • How can I get my ipod to work with itunes?

    When I connect my ipod classic into my new computer it seems that itunes does not recognize it. How can I get my ipod to work with itunes? I'm afraid to disconnect my ipod because the display is saying Do Not Disconnect.

  • Acrobat XI 11.0.0.6 Pro and Reader XI hang

    I recently installed the latest versions of Acrobat and Reader and have experienced several problems. Converting web pages to .PDF's seems to freeze the application. I get the error "Cannot connect to a DDE server" Rebooting fixes the issue temporari

  • Importing problems with LR4

    I import from memory card. After a few seconds of importing the pictures, it goes to a black screen that says "please select a source" Using LR4 on a PC running vista. I have tried copying the picture to a folder on my harddrive but when I ask LR to