Table Controll

Hi, Experts,
I am working on table control and have good idea on it. but there is one problem. I need help from you.
how can I check no. of visible lines in table control. It varries as per resolution of screen.
suppose I have given 12 lines on screen for resolution 800X600, it increases  when resolution change as 1024X768.
Please help me.
With warm regards
Rajiv singh.

Hi,
Check the below link.
http://www.sapfans.com/sapfans/repos/comelite.htm
Regards,
Maha

Similar Messages

  • Reg:How to delete the column in table control also from database table.

    Hi Experts,
    Once again thank u all for giving the responses.
    one more doubt is how to delete the columns of table control and also the record shold delete from ztable.
    With Regards,
    Saroja.P.

    Hi,
    If you want to delete the rows in the table control and simultaneously delete it from the database table, then you can implement a 'DELETE' functionality specific to your table control. Have a MARK field (you will find that in the screen attributes of the table control -> give a name for the MARK field, you will find an additional MARK column at the beginning of your table control). You can check whatever rows you want to delete from the table control, call the delete module.
    "This portion of code inside the LOOP...ENDLOOP.
    IF sy-ucomm eq 'F_DELETE'.
       gt_itab2-check = mark.  " Store the MARK field status into your internal table's correspoding field 'check'
      MODIFY gt_itab INDEX tabcontrol-current_line.
    ENDIF.
    iF sy-ucomm eq 'DELETE1'.
      DELETE gt_itab WHERE check eq 'X'. "Your internal table does not have rows that you want to delete
    ENDIF.
    Now you can modify your database table using the MODIFY statement.
    MODIFY ZDB FROM TABLE gt_itab.

  • How to delete the row in table control with respect to one field in module pool programming?

    Hi,
    Can I know the way to delete the row in table control with respect to one field in module pool programming
    Regards
    Darshan MS

    HI,
    I want to delete the row after the display of table control. I have created push button as delete row. If I click on this push button, the selected row should get deleted.
    I have written this code,
    module USER_COMMAND_9000 input.
    DATA OK_CODE TYPE SY-UCOMM.
    OK_CODE = SY-UCOMM.
    CASE OK_CODE.
         WHEN 'DELETE'.
            LOOP AT lt_source INTO ls_source WHERE mark = 'X'.
                APPEND LS_SOURCE TO LT_RESTORE.
                DELETE TABLE LT_SOURCE FROM LS_SOURCE.
                SOURCE-LINES = SOURCE-LINES - 1.
            ENDLOOP.
    But I'm unable to delete the selected rows, It is getting deleted the last rows eventhough I select the other row.
    So I thought of doing with respect to the field.

  • ISSUE IN THE TABLE CONTROL

    HAI FRIENDS,
    I HAVE DISPLAYED THE VALUES IN THE TABLE CONTROL
    I HAVE DEFINED 'CHECK'  FOR  SELECTING  THE FIELDS OF TABLE CONTROL
    THE ISSUE STARTS HERE
    WHEN I CHECK TOP FIELDS OF TABLE CONTROL
    THEN SCROLLED  VERTICALLY, THE TABLE CONTROL TO SELECT I.E CHECK THE
    BOTTOM FIELDS OF TABLE CONTROL.
    THE TOP FIELDS WATEVER  CHECK  WHERE CHECKS DISPAPEARS FOR TOP FIELDS  .
    BY THIS  I UNABLE TO SELECT THE FIELDS OF TABLE.
    PLZ HELP ME URGENTLY NEEDED.
    MY MONDAY I NEEDED

    You use an internal table for values in table control..
    One of the fields( very first field) in that itab is used for check - uncheck..
    u have make it 'X' when u click any row...
    I think this might be the problem in ur case.. when u scroll PAI starts... in that PAI check the value of check box for that particular field...
    Regards
    Prax

  • 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

  • Update internal table data from table control

    Hi GURUS,
    I need help regarding one of my requirement.
    I need to display data from the internal table on the screen and when the user selects a record/multiple records from screen and clicks on approve button i need to update one of the field from N to Y in the corresponding Ztable. Once the record is updated from Ztable , that should no longer be visible for the user on the screen.
    I am using table control wizard to display data. I am able to update the Ztable, but that record is not refreshing from the user screen. Any suggestions would be approved.
    Also please let me know if table control is the best way to do this/ alv grid control??

    hi
       REFRESH CONTROL Control-Name FROM SCREEN '0100'  -> use this command to refresh the table control
    to know more, read into
    https://forums.sdn.sap.com/click.jspa?searchID=2934287&messageID=673474
    Re: URGENT HELP REQ IN TABLE CONTROL WIZARD
    if helpful, reward
    Sathish. R

  • Validação de campos em um Table Control

    Boa tarde.
    Gostaria de pedir um auxilio .
    Tenho uma duvida, na seguinte situação. Estou construindo um programa de Module Pool
    Neste programa vai ter um tabstrip, para atualizar duas tabelas Z
    Na primeira u201CABAu201D, serão  inseridos os registros da tabela pai e na segunda u201CABAu201D, os registros da tabela
    Filho a relação será de 1 para N.
    Na tabela filho os campos  chaves serão um identificador próprio , mais o registro chave da tabela pai.
    Na segunda a aba para inserir os registros da tabela filho, terei que usar um table Control.
    O meu problema é que ao inserir os registros na tabela filho, terei que de forma automática preencher o campo que corresponde a chave da tabela pai. Ou seja o usuário na primeira u201Cabau201D digamos digite o código da tabela pai como 10 ao inserir na table Control um registro o campo correspondente a chave  da tabela pai devera ser preenchido com o valor 10 e não permitir ao usuário efetuar qualquer manutenção neste campo.
    Como eu faço isso???
    Alguém tem algum exemplo????
    Obrigado a todos

    Olá, bom dia!
    Este é um dessenvolvimento bem específico, talvez por isso ninguem lhe respondeu ainda. Voce já deu uma olhada na seção de Wiki, buscando algum código de exemplo?
    Vai alguns links que encontrei:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/1499ec90-0201-0010-769f-860989655f7e?QuickLink=index&overridelayout=true
    http://wiki.sdn.sap.com/wiki/display/sandbox/ModulePoolProgramming
    O primeiro link traz um exemplo de como torna um campo ineditavel via codigo. Espero que possa ajudar.
    Abraços,
    Rodrigo Paisante

  • Capture field name in table control on double click

    Hi,
    How can I capture the field name of internal table passed to table control on double click?
    I have set function code as 'PICK' and applied 'Respond to double click' and used GET CURSOR statement. Here I can get the values like row number (line number), field value also. But I would like to capture on which field the cursor is (or on which column the cursor is)?
    Thanks in advance.
    Regards
    Ramesh.

    Got it.
    We can capture it by using the statement GET CURSOR only.
    GET CURSOR field <field xx> .
    Here the <field xx> is the field name where we have said double click.

  • How to activate the Vertival Scroll Bar to Table control

    Hi All,
    I Have created a Module pool table control(Wizard) with Input control,where user can enter the values in the screen.
    In my screen 15 lines are visible,once i enter all 15 rows,vertical scroll bar is active,but rest of all lines are in deactivate mode.
    My requirement is:Once i enter all the visible lines,the remaining lines should be in activ mode(In put control).
    I appreciate your response.
    Best Regards,
    Seshadri

    DATA : BEGIN OF IT_MARA OCCURS 1,
           MATNR LIKE MARA-MATNR,
           ERSDA LIKE MARA-ERSDA,
           ERNAM LIKE MARA-ERNAM,
           MTART LIKE MARA-MTART,
           MBRSH LIKE MARA-MBRSH,
           V_FLAG TYPE C,
           END OF IT_MARA.
    DATA :  WA_MARA LIKE it_MARA .
    CONTROLS TABLE TYPE TABLEVIEW USING SCREEN 100.
    MODULE POPULATE_100 INPUT.
      CASE SY-UCOMM.
        WHEN 'DISP'.
          SELECT MATNR
                 ERSDA
                 ERNAM
                 MTART
                 MBRSH FROM MARA INTO WA_MARA .
            APPEND WA_MARA TO IT_MARA.
          ENDSELECT.
          DESCRIBE TABLE IT_MARA LINES V_TEXT.
          TABLE-LINES = V_TEXT.
          CLEAR IT_MARA.
    Regards..
    Balaji  ( assign if this helps u ..)

  • Problem while saveing in Table Control.

    Hi
    I am geting error while saving data in table control.
    This table contol is pop up window at end of screen .
    user enter qty & uom in TC..
    Error i am getting is...
    Field symbol has not been assigned.
    Error analysis                                                                               
    The system tried to access an anasigned field symbol (data segment        
    number 32772).                                                                               
    The field symbol is no longer assigned, because a Unicode program         
    previously tried to set the field symbol using an ASSIGN statement with   
    an offset/length declaration. The memory addressed in this offset/length  
    declaration, however, no longer lay within the valid range.                                                                               
    Information on where terminated                                                                               
    The termination occurred in the ABAP program "SAPLOMCV" in                
    "CONVERSION_EXIT_MATN1_INPUT".                                           
    i Have coded like this..
    MODULE USER_COMMAND_0112 INPUT.
      CASE OKCODE.
        WHEN 'BACK' or 'CANCEL'.
          SET SCREEN 0.
    This iti is contain data which diplay in TC
         when 'DISPLAY'.
              LOOP AT ITI.
              read table iti with key ingr_code = iti-ingr_code
                                      ingr_desc = iti-ingr_desc.
              wka1-ingr_code = iti-ingr_code.
              wka1-ingr_desc = iti-ingr_desc.
              wka1-conc = iti-conc.
              wka1-quantity = iti-quantity.
              wka1-uom = iti-uom.
            append wka1 to itf.
            ENDLOOP.
         WHEN 'SAV'.
          loop at itf where check = 'x' .
                  update zacg_ns
                    set ingr_code = itf-ingr_code
                    col_name = itf-ingr_desc
                    conc = itf-conc
                    quantity = itf-quantity
                      UOM =  itf-UOM
                      ru = itf-ru
                      where ingr_code = itf-ingr_code
                      and col_name = itf-ingr_desc.
        zacg_ns-ingr_code = itf-ingr_code.
       zacg_ns-col_name = itf-ingr_desc.
       zacg_ns-conc = itf-conc.
      zacg_ns-quantity = itf-quantity.
    zacg_ns-UOM = itf-UOM.
    update zacg_ns.
                     endloop.
                     leave program.
                  ENDCASE.
              ENDMODULE.                 " USER_COMMAND_0112  INPUT
    MODULE read_table_control INPUT
    MODULE read_table_control INPUT.
      MODIFY itf  INDEX tc-current_line.
    ENDMODULE.                    "read_table_control INPUT
    *&  Include           ZACG_NS_2                                        *
    *&      Module  STATUS_0111  OUTPUT
          text
    MODULE STATUS_0111 OUTPUT.
      SET PF-STATUS 'ZNEWSHADE'.
      SET TITLEBAR 'ZNS'.
    ENDMODULE.                 " STATUS_0111  OUTPUT
    *&      Module  STATUS_0112  OUTPUT
          text
    MODULE STATUS_0112 OUTPUT.
      SET PF-STATUS 'ZTC'.
    SET TITLEBAR 'xxx'.
      DESCRIBE TABLE itf LINES lines.
      tc-lines = lines.
    ENDMODULE.                 " STATUS_0112  OUTPUt
                                                                                    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0112.
    LOOP at itf WITH CONTROL TC CURSOR tc-current_line.
        MODULE TC_PBO  .
      ENDLOOP.
    PROCESS AFTER INPUT.
      MODULE CANCEL AT EXIT-COMMAND.
    LOOP at itf .
        module read_table_control.
      ENDLOOP.
    MODULE USER_COMMAND_0112.
    Can any one help me..

    Hi,
    Did you enter that filed later after creating the table control?
    You check in the element list whether for that element u have an entry or not..
    Regards,
    Nishant

  • Module pool - table control - update ztable

    hello , i doing a module pool that will have few screens , now i have one screen with a table control that fetch the data from a ztable when screen is call the table control is showing the data and is in grey and no editable i add a pf-status for change that mode i can delete the row from the table control but i don't figure out how update to the ztable when i press save , i wan't too another button for add a new row ( and remain the already in grey ) for add new entrie in the table and update the ztable
    pd: sorry for my bad english
    this is my code:
    TOP:
    PROGRAM  z_pp_lote_etiquetas MESSAGE-ID zz.
    TABLES:zc2p_lote_etique,
           zc2p_lider_modul.
    DATA: ok_code LIKE sy-ucomm.
    DATA save_ok LIKE sy-ucomm.
    * internal table
    DATA: it_zc2p_lote_etique LIKE STANDARD TABLE OF zc2p_lote_etique.
    DATA: it_zc2p_lider_modul TYPE STANDARD TABLE OF zc2p_lider_modul WITH HEADER LINE.
    DATA: it_zc2p_lider_modul_del TYPE STANDARD TABLE OF zc2p_lider_modul WITH HEADER LINE.
    **************Workarea
    DATA: wa_c2p_lote_etique TYPE zc2p_lote_etique.
    DATA: wa_c2p_lider_modul TYPE zc2p_lider_modul.
    DATA: wa_c2p_lider_modul_del TYPE zc2p_lider_modul.
    DATA: sel.
    DATA: MARK.
    DATA: init.
    DATA:  col TYPE scxtab_column.
    DATA: lines TYPE i.
    * Variable Declaration
    DATA : flg, "Flag to set the change mode
    ln TYPE i. "No. of records
    * Table Control Declartion.
    CONTROLS: zc2p_lider_crtl TYPE TABLEVIEW USING SCREEN '101'.
    **PROCESS BEFORE OUTPUT INCLUDE **
    *&  Include           Z_PP_LOTE_ETIQUETAS_O01
    *& Module set_status OUTPUT
    * Setting the GUI status
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'Z_PP_LOT_ETIQ_MENU'.
      SET TITLEBAR 'Z_PP_LOT_ETIQ'.
    ENDMODULE. " set_status OUTPUT screen 100
    *  MODULE status_0101 OUTPUT
    * Setting the GUI status
    MODULE status_0101 OUTPUT.
      SET PF-STATUS 'Z_PP_LOT_ETIQ_ME_101'.
      SET TITLEBAR 'Z_PP_LOT_ETIQ'.
    * Data retreving
      if init is INITIAL.
      select * from zc2p_lider_modul into CORRESPONDING FIELDS OF TABLE it_zc2p_lider_modul.
        DESCRIBE TABLE it_zc2p_lider_modul LINES ln.
        zc2p_lider_crtl-lines = ln + 10.
        init = 'X'.
    endif.
    ENDMODULE.                    "status_0101 OUTPUT
    module change_sdyn_conn output.
    * you can change the content of current table control line via
    * sdyn_conn
      READ TABLE it_zc2p_lider_modul INTO zc2p_lider_modul INDEX zc2p_lider_crtl-current_line.
    endmodule.                             " FILL_TABLE_CONTROL  OUTPUT
    MODULE set_screen_fields OUTPUT.
    LOOP AT SCREEN.
    IF flg IS INITIAL.
    screen-input = 0.
    ELSE.
    screen-input = 1.
    ENDIF.
    *ENDIF.
    * Modifying the screen after making changes
    MODIFY SCREEN.
    ENDLOOP.
    ENDMODULE. " set_screen_fields OUTPUT
    PROCESS AFTER INPUT INCLUDE.
    *  MODULE USER_COMMAND_0100 INPUT
    MODULE user_command_0100 INPUT.
      CASE ok_code.
        WHEN 'LIDM'.
          CALL SCREEN 101.
        WHEN 'CANC'.
          LEAVE PROGRAM.
        WHEN 'BACK'.
          LEAVE PROGRAM.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
      ENDCASE.
    ENDMODULE.                    "USER_COMMAND_0100 INPUT
    *  MODULE USER_COMMAND_0101 INPUT
    MODULE user_command_0101 INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
      CASE save_ok.
        WHEN 'SORT'.
          DATA: fldname(100),help(100).
          READ TABLE zc2p_lider_crtl-cols INTO col WITH KEY selected = 'X'.
          SPLIT col-screen-name AT '-' INTO help fldname.
          SORT it_zc2p_lider_modul BY (fldname).
        WHEN 'CHANGE'.
    * Setting the flag to make the table control in editable mode[excluding
    * primary key].
          flg = 'Y'.
        WHEN 'BACK'.
          CALL SCREEN 100.
          LEAVE SCREEN.
        WHEN 'CANCEL'.
          LEAVE PROGRAM.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
        WHEN 'SAVE'.
          MODIFY  zc2p_lider_modul FROM it_zc2p_lider_modul.
          COMMIT WORK.
      ENDCASE.
    ENDMODULE.                    "USER_COMMAND_0101 INPUT
    *  MODULE read_table_control INPUT
    MODULE read_table_control INPUT.
    * Check input values
      IF mark = 'X' AND save_ok = 'DELETE'.
        DELETE TABLE it_zc2p_lider_modul FROM zc2p_lider_modul.
        DESCRIBE TABLE it_zc2p_lider_modul LINES zc2p_lider_crtl-lines.
      ENDIF.
    ENDMODULE.                             " READ_TABLE_CONTROL  INPUT
    Screen Flow Logic 100
    PROCESS BEFORE OUTPUT.
    MODULE status_0100.
    PROCESS AFTER INPUT.
    MODULE user_command_0100.
    Screen Flow Logic 101.
    PROCESS BEFORE OUTPUT.
      MODULE status_0101.
      LOOP AT it_zc2p_lider_modul INTO zc2p_lider_modul WITH CONTROL
    zc2p_lider_crtl.
    * Dynamic screen modifications
        MODULE set_screen_fields.
        MODULE change_sdyn_conn.
      ENDLOOP.
    PROCESS AFTER INPUT.
      MODULE user_command_0101.
      LOOP AT it_zc2p_lider_modul.
        MODULE read_table_control.
      ENDLOOP.
    i hope somebody can help for what i missing here  thanks

    >
    Sanjeev Kumar wrote:
    > Hello Edgar,
    >
    > Problem seems to be there in the flow logic of 101
    >
    >
    > PROCESS BEFORE OUTPUT.
    >   MODULE status_0101.
    >   LOOP AT it_zc2p_lider_modul INTO zc2p_lider_modul WITH CONTROL
    > zc2p_lider_crtl. " no need to have 'INTO zc2p_lider_modul' above
    > * Dynamic screen modifications
    >     MODULE set_screen_fields.
    >     MODULE change_sdyn_conn.
    >   ENDLOOP.
    > *
    > PROCESS AFTER INPUT.
    >   MODULE user_command_0101. "this should be shifted after the following LOOP...ENDLOOP.

    >   LOOP AT it_zc2p_lider_modul. "need to have 'WITH CONTROL zc2p_lider_crtl' here
    >     MODULE read_table_control.
    >   ENDLOOP.
    >
    >
    >
    > With MODULE user_command_0101 call before the LOOP calls the MODIFY statement (under case save_ok 'SAVE') first and Z-table is updated with the old values as the changes are transferred from screen into the internal table it_zc2p_lider_modul in the LOOP...ENDLOOP later.
    >
    > Try these changes and I hope it will work.
    >
    > Thanks
    > Sanjeev
    i do the firts advice but the second one i get syntax error :
    my code :
    PROCESS AFTER INPUT.
      LOOP  at it_zc2p_lider_modul WITH CONTROL zc2p_lider_crtl.
        MODULE read_table_control.
      ENDLOOP.
       MODULE user_command_0101.
    error :
    In the event PROCESS AFTER INPUT, no additions are allowed with "LOOP     
    AT".

  • Baffling Table Control

    Hi,
    Currently using SAP 4.7 SAPKB62011
    The need was to develop a program, which based on a selection-criteria displays a table(editable) and some changes will be done in the table and data should get saved.
    The best approach I assumed was to
    a) Create a report, define the selection screen parameters
    b) Do validation in at selection-screen
    c) If all validations are proper, select values to be shown in table control
    d) call screen 9000
    Everything is working perfectly, except for adding new lines in table control.
    When I execute select query in AT SELECTION-SCREEN event before calling the screen 9000, then I am not able to add values to table control.
    But if I put the select query in the PBO of screen 9000, I am able to add new values. Only those values which are already present in table control can be changed. I am not able to add any new entries.
    In my opinion, there should not be a select query in PBO, because that query would hit the database in all possible events.
    Any particular reason, why.
    <b>AT SELECTION-SCREEN code</b>
    AT SELECTION-SCREEN.
      CASE sy-ucomm.
        WHEN 'ONLI'.
          lv_pernr = p_pernr.
          lv_lifnr = p_lifnr.
    *      SELECT *
    *        FROM zpersoninfo
    *        INTO TABLE lt_zpersoninfo
    *       WHERE personno = lv_pernr.
    *      IF sy-subrc <> 0.
    *      ENDIF.
    *      APPEND INITIAL LINE TO LT_ZPERSONINFO.
          CALL SCREEN 9000.
      ENDCASE.
    <b>Dynpro code</b>
    PROCESS BEFORE OUTPUT.
      MODULE pbo_9000.
    LOOP AT lt_zpersoninfo INTO zpersoninfo WITH CONTROL tablecontrol CURSOR
    tablecontrol-current_line.
        MODULE pbo_tc_9000.
      ENDLOOP.
    PROCESS AFTER INPUT.
      LOOP.
        MODULE pai_tc_9000.
      ENDLOOP.
      MODULE pai_9000.
    <b>PBO_9000</b>
    MODULE pbo_9000 OUTPUT.
      SET PF-STATUS lv_pfstatus.
      pa0315-pernr = lv_pernr.
      SELECT *
        FROM zpersoninfo
        INTO TABLE lt_zpersoninfo
       WHERE personno = lv_pernr.
      IF sy-subrc <> 0.
      ENDIF.
      APPEND INITIAL LINE TO LT_ZPERSONINFO.
    ENDMODULE.                 " PBO_9000  OUTPUT
    <b>PBO 9000 - Table Control Code</b>
    MODULE pbo_tc_9000 OUTPUT.
      LOOP AT SCREEN.
        IF lv_pfstatus = 'DISPLAY'.
          CASE screen-name.
            WHEN 'ZPERSONINFO-SERVICENO'.
              screen-input = '1'.
              screen-active = '1'.
            WHEN 'ZPERSONINFO-MANDATORY'.
              screen-input = '1'.
              screen-active = '1'.
          ENDCASE.
        ELSEIF lv_pfstatus = 'CHANGE'.
          CASE screen-name.
            WHEN 'ZPERSONINFO-SERVICENO'.
              screen-input = '0'.
            WHEN 'ZPERSONINFO-MANDATORY'.
              screen-input = '0'.
          ENDCASE.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    ENDMODULE.
    Let me know if I have skipped some information, which you may find it useful to find the solution.
    Regards,
    Subramanian V.

    That is because I didn't upate the 'LINES' field in tablecontrol. How silly !!
    Regards,
    Subramanian V.

  • Table Control[Accept Input Only] - "ENTER" Key

    Hi Folks,
    I'm reviving this unanswered thread in relation to table control: when the user press enter, all the values entered disappear.
    [url]Re: Table control (Enter key)[url]
    I have a table control that accepts "ONLY" input, meaning to say, there will be no pre-loading of data in the PBO, so it will loop through the table control itself instead of looping from an internal table.
    Issue: Whenever I press "ENTER" in any column/row of my table control, ALL the values I entered disappear.
    PBO:
    PROCESS BEFORE OUTPUT.
      MODULE CLEAR_OKCODE.
      MODULE LOAD_TABLECTRL.
      LOOP WITH CONTROL TC_DATA.
        MODULE READ_DATA.
      ENDLOOP.
    module READ_DATA output.
      READ TABLE T_DATA INTO WA_DATA INDEX TC_DATA-current_line.
      data : line_count type i.
      "to increase the number of lines in table control dynamically
      describe TABLE t_data lines line_count.
      TC_DATA-lines = line_count + 10.
    endmodule. 
    PAI:
    PROCESS AFTER INPUT.
      LOOP WITH CONTROL TC_DATA.
        MODULE MODIFY_DATA.
      ENDLOOP.
    module MODIFY_DATA input.
    WHEN 'CREATE'.
      "subroutines are here, etc.
    WHEN 'DELETE'.
    WHEN 'BACK'.
      LEAVE TO SCREEN 0.
    endmodule.
    In my ABAP Debug, the value of SY-UCOMM is BLANK whenever I press Enter.
    Thanks.

    Hi
    Your code seems to be rght only the MODIFY statament is useless:
    module READ_DATA output.
      READ TABLE T_ID_CHECK INTO WA_ID_CHECK INDEX TC_ID-current_line.
      IF SY-SUBRC EQ 0.
        ZQID_CHECK-WERKS = WA_ID_CHECK-WERKS.
        ZQID_CHECK-MATNR = WA_ID_CHECK-MATNR.
        ZQID_CHECK-LICHA = WA_ID_CHECK-LICHA.
        ZQID_CHECK-LIFNR = WA_ID_CHECK-LIFNR.
      ELSE.
        CLEAR ZQID_CHECK.
      ENDIF.
    endmodule.
    Now before LOOP of PBO try to set the lines of table control to be display, I've created this report on my system and it works fine:
    .CONTROLS T_CTRL TYPE TABLEVIEW USING SCREEN 100.
    DATA: BEGIN OF ITAB OCCURS 0,
              WERKS LIKE MARC-WERKS,
              MATNR LIKE MARC-MATNR,
              LIFNR LIKE LFA1-LIFNR,
          END   OF ITAB.
    DATA: WA LIKE ITAB.
    START-OF-SELECTION.
      DO 4 TIMES.
        ITAB-WERKS = '5010'.
        ITAB-MATNR = '1234567890'.
        ITAB-LIFNR = '0000000001'.
        APPEND ITAB.
      ENDDO.
      CALL SCREEN 100.
    PROCESS BEFORE OUTPUT.
      MODULE SET_T_CTRL.
      LOOP WITH CONTROL T_CTRL.
        MODULE READ_DATA.
      ENDLOOP.
    PROCESS AFTER INPUT.
      LOOP WITH CONTROL T_CTRL.
        MODULE MODIFY_DATA.
      ENDLOOP.
    MODULE SET_T_CTRL OUTPUT.
      DESCRIBE TABLE ITAB LINES T_CTRL-LINES.
    ENDMODULE.                 " SET_T_CTRL  OUTPUT 
    MODULE READ_DATA OUTPUT.
      READ TABLE ITAB INDEX T_CTRL-CURRENT_LINE.
      IF SY-SUBRC = 0.
        MOVE-CORRESPONDING ITAB TO WA.
      ELSE.
        CLEAR WA.
      ENDIF.
    ENDMODULE.                 " READ_DATA  OUTPUT
    MODULE MODIFY_DATA INPUT.
      MODIFY ITAB FROM WA INDEX T_CTRL-CURRENT_LINE.
      IF SY-SUBRC NE 0.
        CHECK NOT WA IS INITIAL.
        APPEND WA TO ITAB.
      ENDIF.
    ENDMODULE.                 " MODIFY_DATA  INPUT

  • How to modify changes of table control data in PAI

    I have a table control where the columns are brought by dict fields.I am able to bring data into table control through an itab.
    Now what i want is whenever user edits data in table control and clicks on save button the corresponding changes should be made in database.
    For this according to my understanding we need to (in PAI) modify the changes in itab from the table control and then in SY-UCOMM of SAVE button we need to update in database table using itab.
    For this , I am not able to write code for modifying the changes in itab from table control. Here is my code below.Please tell me how to do this.
    PROCESS BEFORE OUTPUT.
    MODULE FILL_DATA.
    LOOP AT ITAB INTO ZEMPLOYEE_MASTER WITH CONTROL EMPTABLE CURSOR
    EMPTABLE-CURRENT_LINE.
    ENDLOOP.
    MODULE STATUS_0001.
    PROCESS AFTER INPUT.
    LOOP AT ITAB.
       MODULE MODIFY_ITAB.
    ENDLOOP.
    MODULE USER_COMMAND_0001.
    REPORT  ZDATA_FORM1.
    TABLES: ZEMPLOYEE_MASTER.
    CONTROLS EMPTABLE TYPE TABLEVIEW USING SCREEN 0001.
    data: begin of itab occurs 0,
           emp_no like zemployee_master-emp_no,
           name like zemployee_master-name,
           city like zemployee_master-city,
          end of itab,
          rowno TYPE I VALUE 1.
    *&      Module  STATUS_0001  OUTPUT
    *       text
    MODULE STATUS_0001 OUTPUT.
    *  SET PF-STATUS 'xxxxxxxx'.
    *  SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0001  OUTPUT
    *&      Module  USER_COMMAND_0001  INPUT
    *       text
    MODULE USER_COMMAND_0001 INPUT.
      MESSAGE 'Inside INPUT' TYPE 'I'.
    CASE SY-UCOMM.
       WHEN 'SAVE'.
         UPDATE zemployee_master.
       WHEN 'EXIT'.
         LEAVE PROGRAM.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0001  INPUT
    *&      Module  fill_data  OUTPUT
    *       text
    MODULE fill_data OUTPUT.
      select emp_no name city from zemployee_master into TABLE itab ORDER BY emp_no.
      Describe table itab lines EMPTABLE-LINES.
    ENDMODULE.                 " fill_data  OUTPUT
    *&      Module  modify_itab  INPUT
    *       text
    MODULE modify_itab INPUT.
    * MODIFY itab from zemployee_master index
    * MESSAGE 'Inside modify_itab' TYPE 'I'.
    ENDMODULE.                 " modify_itab  INPUT

    Hi
    In the following module of your code
    MODULE modify_itab INPUT.
    MODIFY itab from zemployee_master index tc-current_line " Where TC is the name of the Table control on the Screen
    ENDMODULE.
    Table control data gets refreshed on *enter*
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/2165e990-0201-0010-5cbb-b5c2ad436140
    Cheerz
    Ramchander Rao.K

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

  • How to delete a row in table control?

    Hi All,
    I have a empty table control which is only use for data input(this data will then be use to store information to a custom table).  I have two buttons, Create Entry and Delete Entry.
    In my screenPainter for the table control, I have the checkbox w/SelColumn ticked and assign variable T_DATA-MARK on it.
    In my code:
    TOP Include
    CONTROLS: tc_data      TYPE TABLEVIEW USING SCREEN 9001.
    PBO
    PROCESS BEFORE OUTPUT.
      LOOP WITH CONTROL TC_ID.
        MODULE LOAD_TABLECTRL.
      ENDLOOP.
    module LOAD_TABLECTRL output.
      READ TABLE T_DATA INTO WA_DATA INDEX TC_DATA-current_line.
      IF SY-SUBRC EQ 0.
        MOVE-CORRESPONDING T_DATA TO WA_DATA.
      ENDIF.
    endmodule. 
    PAI
    PROCESS AFTER INPUT.
       LOOP WITH CONTROL TC_ID.
       ENDLOOP.
    MODULE GET_USER_ACTION.
    module GET_USER_ACTION input.
      WHEN 'DEL'.
        LOOP AT T_DATA INTO WA_DATA WHERE MARK EQ 'X'.
          DELETE T_DATA.
        ENDLOOP.
    In my debug, the internal table T_DATA-MARK does not have any value(s) even if I selected a particular row in my table control. 
    Am I missing something here?
    Thanks

    Hi All,
    Please see the actual screenshots and code below:
    The aim of the table control is just to accept inputs, so the internal table in the PBO is always empty.
    Table Control Screen Painter ScreenShot and Actual SAP Output: http://img710.imageshack.us/img710/4751/tablecontrolrowdelete.jpg
    PBO
    PROCESS BEFORE OUTPUT.
      LOOP WITH CONTROL TC_ID.
        MODULE LOAD_TABLECTRL.
      ENDLOOP.
    module LOAD_TABLECTRL output.
      READ TABLE T_ID_CHECK INTO WA_ID_CHECK INDEX TC_ID-current_line.
      IF SY-SUBRC EQ 0.
        MOVE-CORRESPONDING T_ID_CHECK TO TC_ID.
      ELSE.
          "EXIT FROM STEP-LOOP.
          CLEAR ZQID_CHECK.
      ENDIF.
    PAI
    PROCESS AFTER INPUT.
       LOOP WITH CONTROL TC_ID.
         CHAIN.
          MODULE CHECK_ENTRIES     ON CHAIN-INPUT.     
          MODULE MODIFY_T_ID_CHECK ON CHAIN-INPUT.
          MODULE DELETE_ROW        ON CHAIN-INPUT
         ENDCHAIN.
       ENDLOOP.
    module CHECK_ENTRIES input.
      CASE ok_code.
        WHEN 'DEL'.
            PERFORM F_FILL_ITABCREATE USING ZQID_CHECK-MATNR
                                            ZQID_CHECK-LICHA
                                            ZQID_CHECK-LIFNR.
      ENDCASE.
    endmodule.    
    module MODIFY_T_ID_CHECK input.
    DATA W_TEMPMARK(1) TYPE C.
      MOVE: T_ID_CHECK-MARK TO W_TEMPMARK,
            W_TEMPMARK TO T_ID_CHECK-MARK.
    MODIFY T_ID_CHECK INDEX SY-TABIX TRANSPORTING MARK.
    endmodule.
    module DELETE_ROW input.
      LOOP AT T_ID_CHECK WHERE MARK EQ 'X'.
        DELETE T_ID_CHECK.
      ENDLOOP.
    endmodule.   
    form F_FILL_ITABCREATE  using    us_zqid_check_matnr LIKE MARA-MATNR
                                     us_zqid_check_licha LIKE MCHA-LICHA
                                     us_zqid_check_lifnr LIKE LFA1-LIFNR.
      MOVE: us_zqid_check_matnr TO WA_ID_CHECK-MATNR,
            us_zqid_check_licha TO WA_ID_CHECK-LICHA,
            us_zqid_check_lifnr TO WA_ID_CHECK-LIFNR.
      APPEND WA_ID_CHECK TO T_ID_CHECK.
      CLEAR WA_ID_CHECK.
    endform.
    In my debug, I can now delete the internal table that has a 'X' mark on its respective row but on the SAP screen output, all of my entries are being deleted contrary to what the ABAP debugger is telling me.
    Thanks

Maybe you are looking for

  • Problems with fade to black transition and photoalbum themed titles

    I keep having trouble with the titles in the photo album theme. When I use a fade to black transition and then try to use one of the top 4 titles available under the photos theme it seem like I have to move the title part of the way into the new clip

  • IMac 20" refresh rates question

    How do I find out what refresh rates are supported on my iMac 20" Core Duo? I don't see anything in system profiler and or the display preferences.

  • DST timezone patch for 10.1.0.5.0 on Linux

    I succesfully downloaded & run a new version of the script utltzuv2.sql which checks your TSTZ current data for any rows affected by the updates to the time zone files. (Patch 5126270 Description PLEASE PROVIDE UPDATED UTLTZUV?.SQL Release 10.1.0.5)

  • Ok so i thought i would tidy up oops

    Hope you can help Hi i am really enjoying Aperture and getting into the way it works so i thought i would restructure all my photos and tidy them up first of all I'm running Lion iTunes10 latest version and aperture 3.3 all on a mac intel and a brand

  • [solved]Trying to insert a blocking systemd unit into the boot process

    What i'm trying to do is to start (and *wait* for it to complete) a unit before starting another. In particular, i need to create and mount a partition on the fly before any filesystem gets mounted. My unit file is: # cat /etc/systemd/system/early-bo