Table control in create mode

Hi,
I created a table control in a standard transaction code.
when iam clicking create button, The table control
is displaying in display mode.Now I should provide to the user
to add the entries in the table control in create mode.
Can any body resolve this issue with coding.
urgent requirement.

Hi,
In a PBO module of the screen, ypu have to write a code to find out the number of lines of the internal table used for the table control.
The code for this would be.
  DESCRIBE TABLE tb_line LINES lin.   * 'tb_line' is the internal table and 'lin' holds the number of lines*
  tcl_item-lines = lin.                             tcl_item is the name of the table control*
Now in the PBO, you have to make the table control editable or non editable by checking with the transaction.
Here i in the below code, there are 3 transactions for create,display and change.
If the transaction code is either 'ZCREATE09' or 'ZCHANGE09' , then the lines in the table control are checked.If the table control is not empty,then it is  editable.
During the display transaction,it is kept in non editable mode.
CASE sy-tcode.
    WHEN 'ZCREATE09' OR 'ZCHANGE09'.
***Checking if the table control is empty or not***
      IF lin NE 0.
        LOOP AT SCREEN.
***To make the screen editable****
          screen-input = 1.
        ENDLOOP.
      ELSE.
        LOOP AT SCREEN.
          IF screen-name CS 'TB_LINE'.
****To make the screen non-editable if no values are present in the
***table control****
            screen-input = 0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
****To make screen non editable during the display transaction****
    WHEN 'ZDISPLAY09'.
      LOOP AT SCREEN.
        screen-input = 0.
        MODIFY SCREEN.
      ENDLOOP.
  ENDCASE.
Reward if helpfull.
Thanks,
Kashyap

Similar Messages

  • Table control in display mode

    Hello All,
    Please tell me how to show table control in display mode,
    My requirement is , whenever ill put T-code for table maintainace it should be appear in display mode.
    Thanks,
    Gaurav

    table control or table maintenance?
    Ok, let me assume that you have table mainteance view done for ZTEST table with Z_V_TABLE (maintenance view generated)
    create a tcode now
    1) transaction with parameters - se93 - tcode Z_TABLE
    2) Transaction SM30
    3) skip initial screen checked
    4) maintain below values in default values in se93
    VIEWNAME     Z_V_TABLE
    SHOW     X
    now when we run with Z_TABLE table it will always show in display mode.
    Hope - I understood your question correctly

  • Table Control in Editable mode

    Hello All,
    I have created an infotype which has a table control. But all the table control lines are in non-editable mode. I would like to have all the lines in editable mode.
    Kindly help out.
    Regards,
    shails

    If your internal table contains no record and when you are refering to the table control then all the lines will get disabled.
    Now you will be knowing the number of lines your table control displays in singe page...say 10 lines.
    So initially in the PBO append 10 initial lines to your itab. then set the property lines of the table control to the total lines of internal table.
    Now in pbo capture the user command page down and append 10 initial lines to your itab.
    Hope you got the idea.
    Now if your itab already has some records , then just set the lines as total record count of your internal table.
    Also change the property in the screen attributes for each field of the control

  • Columns in table control in display mode in display transaction

    Hi all,
    I have a table control in a custom screen .Now i have few columns in the table control which need to be input enbaled but should be dislay only when thetransaction mode is "display" e.g VL33N.
    I have written the follwoing lines of code:
    IF sy-tcode = 'VL33N'.
        IF g_trtyp = 'A'.
          LOOP AT tc01-cols INTO wa_tc01.
            IF wa_tc01-screen-group1 = 'G2'.
              wa_tc01-screen-input = 0.
              MODIFY tc01-cols FROM wa_tc01.
            ENDIF.
          ENDLOOP.
    ENDIF.
    ENDIF.
    However the specific olumns in table control are not displayed in display mode when in display transaction!
    Can anyone suggest what am i doing wrong?
    thanks.

    I would have answered if you followed forum rules (as I can see in your previous posts, missing feedback, closed without any info)

  • Reg : Table control row settings to change mode

    Hi geeks.
            I am working on a requirement where the table control has to be in display mode at the time of prepopulating(initial display).This works fine and could get all columns in display mode for which i used column properties of table control. I could select a row from the table control and created a button above the table control for copy of the row which is added to the last row of the TC. I could get this with out any issues. They want the added row to be in changed mode whereas the other rows selected previously should remain in the display mode. Can anybody help me out to solve.Timely help will be appreciated <removed by moderator>
    Regards  ,
    Kumar.
    Edited by: Vinod Kumar on Aug 2, 2011 9:21 AM

    This thread will assist you.
    [Table control with non editable rows;
    Make use of some flag for identifying the new records that will be appended in itab on the press of the button.
    Then in PBO,
    loop at itab with control tc cursor tc-current_line.
    module editnewrow.
    endloop.
    module editnewrow output.
    if itab-flag  =  'X'.
    loop at screen.
        screen-input  =  1.
        modify screen.
      endloop.
       itab-flag  =  ' '. (resetting back to non-editable state for consequent press of the button)
       modify itab index tc_4000-current_line.
      endif.
    endmodule.

  • Table control- add a new row

    I have a table control on a custom screen with some data from data base table in non-editable mode. Now, when I click insert button, it should create a new row in table control in editable mode. I tried loop at screen and modify screen but no luck. Can somebody please help me?

    hi chandu,
    try this code.
    if sy-ucomm = 'INS'.
    data : wf_lines type i.
    *number of lines of table control
      DESCRIBE TABLE int_factor LINES wf_lines.
      tab_control-lines = wf_lines + 1.
    ENDIF.
    for any clarifiaction pls mail me.
    pls reward points, if this helped u.
    regards,
    anversha.
    [email protected]

  • Module pool prorgam in table control designing

    Hi ,
    I have created the table control in module pool program.(Screen added in VA01 header level under addition data2)
    I have given the option for table control for Single line selection and W/Sel colum .
    My requirement is if i enter the data in table cotrol( SO creation)  or if data alreday Coming in table cotrol  (for So Change mode).Should allow to select the row.if table control doesn't have data for line wise.shouldn't t allow to select the Row selection.
    I tried to set the table control line selection mode option with  TABLE1-LINE_SEL_MODE = 0 through program.Its not allowing to select any row like with data also not allowing  to select and without data also its not allowing to select the data.
    How to set the functinality for same.
    Its very urgent Requirement.
    Regards
    DIvakar Reddy K.

    Hi Divakar,
    In the PBO of the screen, you need to write below code:
      PROCESS BEFORE OUTPUT.
      MODULE STATUS_0100.
        LOOP AT ITAB INTO DEMO_CONN WITH CONTROL FLIGHTS.
      ENDLOOP.
    Please refer to program DEMO_DYNPRO_TABCONT_LOOP_AT.

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

  • How To delete the Chosen line from the Table Control

    Hi Friends,
      i am new to Module Pool Programming , i developed a Table Control in input mode and i am getting data also into that table control. my requirement is that i want to delete the current chosen line from that table control. please help me out.

    HI
    GOOD
    GO THROUGH THIS REPORT
    REPORT demo_dynpro_tabcont_loop_at.
    CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
    DATA: cols LIKE LINE OF flights-cols,
    lines TYPE i.
    DATA: ok_code TYPE sy-ucomm,
          save_ok TYPE sy-ucomm.
    DATA: itab TYPE TABLE OF demo_conn.
          TABLES demo_conn.
    SELECT * FROM spfli INTO CORRESPONDING FIELDS OF TABLE itab.
    LOOP AT flights-cols INTO cols WHERE index GT 2.
      cols-screen-input = '0'.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDLOOP.
    CALL SCREEN 100.
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'SCREEN_100'.
    DESCRIBE TABLE itab LINES lines.
    flights-lines = lines.
    ENDMODULE.
    MODULE cancel INPUT.
      LEAVE PROGRAM.
    ENDMODULE.
    MODULE read_table_control INPUT.
      MODIFY itab FROM demo_conn INDEX flights-current_line.
    ENDMODULE.
    MODULE user_command_0100 INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
      CASE save_ok.
        WHEN 'TOGGLE'.
          LOOP AT flights-cols INTO cols WHERE index GT 2.
            IF  cols-screen-input = '0'.
              cols-screen-input = '1'.
            ELSEIF  cols-screen-input = '1'.
              cols-screen-input = '0'.
          ENDIF.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDLOOP.
        WHEN 'SORT_UP'.
          READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
          IF sy-subrc = 0.
            SORT itab STABLE BY (cols-screen-name+10) ASCENDING.
            cols-selected = ' '.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDIF.
        WHEN 'SORT_DOWN'.
          READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
          IF sy-subrc = 0.
            SORT itab STABLE BY (cols-screen-name+10) DESCENDING.
            cols-selected = ' '.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDIF.
        WHEN 'DELETE'.
          READ TABLE flights-cols INTO cols
                                  WITH KEY screen-input = '1'.
          IF sy-subrc = 0.
            LOOP AT itab INTO demo_conn WHERE mark = 'X'.
              DELETE itab.
    ENDLOOP.
          ENDIF.
    ENDCASE.
    ENDMODULE.
    CHANGE THE CODE AS PER THIS LIGIC.
    THANKS
    MRUTYUN

  • How to determine cursorline in table control

    Hi,
    Every time an entry is inserted in the table control i need to put the cursorline in the next line.
    It is ok while you are using the initial lines of the table control but when you use the scroll it is gone.
    The complet scenario is:
    - my table control is created with 5 lines.
    - Every time the user inserts a line, a new line is created (so you will have always 5 lines behind to complete)
    - when the 5th line is inserted, if you want to fill the 6tn you have to use the scroll
    - In this moment is when i dont know how to determine the cursorline. It will be different depending how much de the scroll is moved. Maybe the correct cursorline is 5, or 3 or 2... Do you know how i can determine it? Is it possible?
    Maybe the way would be to move the table control (scroll) one position and always cursorline would be 5, but i dont know if it possible neither.
    Thank you,
    Manel

    Sorry misunderstood the question.
    You will have to use the variable topline from the tablecontrol.
    Edited by: Pedro Guarita on Feb 10, 2010 5:25 PM

  • Table control enable and disable rows

    Hi,
    I want to keep the table control in disabled mode initially.
    When user press the add button,the row next to where data is already present should alone be enabled for data entry.
    In PBO event i was able to disable the entire table control.but when i could not find a way to identify the first blank line to enable it for data entry.
    Please help.
    Thanks
    Ambily

    Hi Ambily,
    follow the below steps
    declare a data : w_flag  type c. in the global
    and next write the code the PBO
    PROCESS BEFORE OUTPUT.
    * Module screen GUI-Screen&Status and Screen Logic
      MODULE status_<Screennum>.
    * Table control for OUTPUT
      LOOP AT <table-control> .
        MODULE Modify_screen.
      ENDLOOP.
    Module modify_screen output.
    * Table control reading values from input screen & displaying on screen
      READ TABLE <table>   INDEX <tablecontrol>-current_line.
    If w_flag is initial.
        LOOP AT SCREEN.
          IF screen-name = <Tablecontrol Line>.
            screen-input = 0.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
    wndif.
    Endmodule.
    "next in PAI mark the w_flag to 'X'
    Prabhudas

  • Input Check in Table Control

    A table control is created in screen painter and an internal table was used to store particular data in ABAP program.
    Information were entered into the table through ABAP program(insert value into internal table). The input check generated by data dictionary do not work due to data not inserted from screen field. How can I solved the problem?
    Do I need to manually program the input check using module as following:
    FIELD f Module m.
    But how can I make the whole row ready for input and with cursor on particular column just like what was done with normal data dictionary input check?
    Message class 00 number 058 with text
    Entry & & & does not exist in &4 - check your entry
    can be used for compute the message.

    What are those conditions that will trigger the input check for my situation?
    I can only do that for those fields with check table.
    Here are what I had done:
    <b>Flow Logic</b>
          field EBAN-EKGRP MODULE CHECK_EKGRP.  " Purchasing Group
    <b>Module code</b>
    MODULE CHECK_EKGRP INPUT.
    TABLES:  T024.
      CHECK:  EBAN-EKGRP IS NOT INITIAL.
      SELECT SINGLE * FROM T024 WHERE EKGRP = EBAN-EKGRP.
      IF SY-SUBRC NE 0.
        MESSAGE E058(00) WITH EBAN-EKGRP '' '' 'T024'.
      ENDIF.
    ENDMODULE.                 " CHECK_EKGRP  INPUT
    However, this is not applicable for those without check table.
    Please help. Points will be awarded for helpful answers.

  • What is wrong with PBO (table control)

    Hi,
    Another beginner's question. Unable to fill table control.
    Following in my Program
    report  test_tab_con.
    controls flights type tableview using screen 100.
    data:  ok_code type sy-ucomm,
           save_ok type sy-ucomm.
    data: fill type i,
          begin of itab_con occurs 0,
          id type i,
          name(10) type c,
          address(20) type c,
          end of itab_con.
    data: wa_itab like line of itab_con.
    perform populate.
    form populate.
      itab_con-id = 1.
      itab_con-name = 'ABCD'.
      itab_con-address = 'Test Area'.
      append itab_con.
      itab_con-id = 2.
      itab_con-name = 'XYZ'.
      itab_con-address = 'Come again'.
      append itab_con.
      call screen 100.
    endform.
    module fill_table_control output.
      move-corresponding wa_itab to flights.
    endmodule.                   
    module status_0100 output.
      set pf-status 'SCREEN_100'.
      describe table itab_con lines fill.
      flights-lines = fill.
    endmodule.
    and my screen PBO is:
    process before output.
      loop at itab_con into wa_itab with control flights.
        module fill_table_control.
      endloop.
      module status_0100.
    But finally I see empty table control. There is some option of w/ selColumn (i m not using this - is it mandatory for display?).
    Regards,
    Arpit

    Still no luck. I am sure it is not being refresh onto the final screen. Just don't know how to get it done
    Steps taken to create the UI using screen painter:
    - Create screen
    - Drag & drop the Table control element
    - Press F6 to open dictionary/program fields view, selected itab_con and its fields. Dragged them on to the table control to create it.
    - For all the three fields ID, Name, Address - double clicked on the table control and in screen painter attribute marked them as Input Field (possible). Tried it also by marking as Output field.
    Do I need to do anything part of the screen painting?
    I get three rows in the UI but the text is not visible. What else can be a miss here?
    Regards,
    Arpit

  • Enable/Disable Rows In table Control

    I m getting material number for particular material doc.  if i get N rows in output i want to disable all other rows of table control.
    Moderator message: please search for previous solutions to similar problems before asking.
    Edited by: Thomas Zloch on Nov 20, 2010 7:24 PM

    Hi,
    In PBO, Loop at your table control lines, create a module inside it and use
    LOOP AT SCREEN.
    SCREEN-INPUT = '0'.
    MODIFY SCREEN.
    ENDLOOP.
    Regards,
    Senthil

  • New field does not reflect in Table control

    Dear Experts,
    There is a requirement to add a new field in a table and gets it displayed in already created table control (with wizard). I have added a new field, I can see that in the final internal table (debugger). But the field is not getting reflected in the table control. Why? Should I delete the whole table control and create again (which I do not want to do) or is there any other way?
    As you can see in the below screenshot that there is already enough space but the last zzfield is not yet added.
    Regards
    Mani

    Hi,
    Either you use table control wizard and delete and create new table or try to understand how table control works and add the field on your own.
    Open the screen layout. Press F6 or click on Dictionary/Program fields window. Type field name here. It should be work area field in which table data is loaded by looping on the table. Click on Get from program button. Your field will be listed there. Select the line and click on OK button. Place the field at appropriate location in the table. You can change the attributes of the field by clicking on the attribute window F2.
    Thanks.
    Devendra

Maybe you are looking for