Regarding Table controls dialog programming

Hello Experts-
I have a requirement in which I need to identity the record selected on the table control.This is similar to At line slection.Can anyone help me out.Thanks in advance.
With regards,
Swarna..

Hi Swarna,
Make   use of  CRIT_TABCNTRL-current_line to get the current line of the table control where  CRIT_TABCNTRL is table control name.
Have A Good Day
Chaitanya.

Similar Messages

  • Dynamic header text in table control - Dialog programming

    Hi All,
    I have a table control on one of my dialog screens.  I need to dynamically change the column header texts on this control in my PBO.  Does anyone know how to do this?  I have found all kinds of ways to modify the other characteristics of the fields at run time in the PBO (active, input/output, invisible, etc.) - but not to change the header text!  Any help is appreciated.
    thanks,
    Matt

    Hi Hymavathi,
    I appreciate your help!  This didn't solve the issue, however,...I have used the method you'd mentioned before (many times) for setting it inside the loop at screen:
    %_<screenname>_%_APP_%-TEXT = <text something>.
    - but only in ABAP reports.  It doesn't seem to recogize it (the table control column header text) within a dialog program.  I keep getting a compile error. (saying that the %_<screenname>_%_APP_%-TEXT doesn't exist.
    I tried the suggestion that you stated below (from lateesh) - yet it only let me place i/o field in title text area (not the column header text).  Am still searching...

  • Table control Dialog program

    I am Using table control wizard.once user click on button data will be populated in Table control from datatabase table
    once after getting data the lines which doesnot have data are disabled but
    user should be allowed to  enter and Update and delete data once after clicking
    ENTER Key  that data should be updated in the data base table.
    i am sending my program.
    SCREEN DESIGN .
    PROCESS BEFORE OUTPUT.
    *&SPWIZARD: PBO FLOW LOGIC FOR TABLECONTROL 'TAB1'
      MODULE TAB1_CHANGE_TC_ATTR.
    *&SPWIZARD: MODULE TAB1_CHANGE_COL_ATTR.
      LOOP AT   IT_TAB3
           INTO WA_TAB3
           WITH CONTROL TAB1
           CURSOR TAB1-CURRENT_LINE.
        MODULE TAB1_GET_LINES.
    *&SPWIZARD:   MODULE TAB1_CHANGE_FIELD_ATTR
      ENDLOOP.
    * MODULE STATUS_1002.
    PROCESS AFTER INPUT.
    *&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'TAB1'
      LOOP AT IT_TAB3.
        CHAIN.
          FIELD WA_TAB3-VBELN.
          FIELD WA_TAB3-POSNR.
          MODULE TAB1_MODIFY ON CHAIN-REQUEST.
        endchain.
        FIELD WA_TAB3-SP1
          MODULE TAB1_MARK ON REQUEST.
      ENDLOOP.
    *  MODULE TAB1_BUTTON.
      MODULE TAB1_BUTTONIP.
      MODULE TAB1_USER_COMMAND.
    *&SPWIZARD: MODULE TAB1_CHANGE_TC_ATTR.
    *&SPWIZARD: MODULE TAB1_CHANGE_COL_ATTR.
    * MODULE USER_COMMAND_1002.
    PROGRAM  Z_VI_TABL2.
    TYPES: BEGIN OF TY_TAB3,
           SP1(2) TYPE C,
           VBELN TYPE VBELN_VL,
           POSNR TYPE POSNR_VL,
           END OF TY_TAB3.
    TYPES: BEGIN OF TY_FILL,
           OBJKY TYPE OBJKY,
           END OF TY_FILL.
    DATA : IT_TAB3 TYPE STANDARD TABLE OF TY_TAB3,
           WA_TAB3 TYPE TY_TAB3,
           IT_FILL TYPE STANDARD TABLE OF TY_FILL,
           WA_FILL TYPE TY_FILL,
           G_VBELN TYPE VBELN_VL,
           G_POSNR TYPE POSNR_VL.
    *&SPWIZARD: DECLARATION OF TABLECONTROL 'TAB1' ITSELF
    CONTROLS: TAB1 TYPE TABLEVIEW USING SCREEN 1002.
    *&SPWIZARD: LINES OF TABLECONTROL 'TAB1'
    DATA:     G_TAB1_LINES  LIKE SY-LOOPC.
    DATA:     OK_CODE LIKE SY-UCOMM.
    *&SPWIZARD: OUTPUT MODULE FOR TC 'TAB1'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: UPDATE LINES FOR EQUIVALENT SCROLLBAR
    MODULE TAB1_CHANGE_TC_ATTR OUTPUT.
      DESCRIBE TABLE IT_TAB3 LINES TAB1-lines.
    ENDMODULE.                    "TAB1_CHANGE_TC_ATTR OUTPUT
    *&SPWIZARD: OUTPUT MODULE FOR TC 'TAB1'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: GET LINES OF TABLECONTROL
    MODULE TAB1_GET_LINES OUTPUT.
      G_TAB1_LINES = SY-LOOPC.
    ENDMODULE.                    "TAB1_GET_LINES OUTPUT
    *&SPWIZARD: INPUT MODULE FOR TC 'TAB1'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: MODIFY TABLE
    MODULE TAB1_MODIFY INPUT.
    *  MODIFY IT_TAB3
    *    FROM WA_TAB3
    *    INDEX TAB1-CURRENT_LINE.
      WA_TAB3-POSNR = 10.
      APPEND WA_TAB3 TO IT_TAB3.
    ENDMODULE.                    "TAB1_MODIFY INPUT
    *&SPWIZARD: INPUT MODUL FOR TC 'TAB1'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: MARK TABLE
    MODULE TAB1_MARK INPUT.
      DATA: g_TAB1_wa2 like line of IT_TAB3.
      if TAB1-line_sel_mode = 1
      and WA_TAB3-SP1 = 'X'.
        loop at IT_TAB3 into g_TAB1_wa2
          where SP1 = 'X'.
          g_TAB1_wa2-SP1 = ''.
          modify IT_TAB3
            from g_TAB1_wa2
            transporting SP1.
        endloop.
      endif.
      MODIFY IT_TAB3
        FROM WA_TAB3
        INDEX TAB1-CURRENT_LINE.
    *    TRANSPORTING SP1.
    ENDMODULE.                    "TAB1_MARK INPUT
    *&SPWIZARD: INPUT MODULE FOR TC 'TAB1'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: PROCESS USER COMMAND
    MODULE TAB1_USER_COMMAND INPUT.
      OK_CODE = SY-UCOMM.
      PERFORM USER_OK_TC USING    'TAB1'
                                  'IT_TAB3'
                                  'SP1'
                         CHANGING OK_CODE.
      SY-UCOMM = OK_CODE.
    ENDMODULE.                    "TAB1_USER_COMMAND INPUT
    *   INCLUDE TABLECONTROL_FORMS                                         *
    *&      Form  USER_OK_TC                                               *
    FORM USER_OK_TC USING    P_TC_NAME TYPE DYNFNAM
                             P_TABLE_NAME
                             P_MARK_NAME
                    CHANGING P_OK      LIKE SY-UCOMM.
    *&SPWIZARD: BEGIN OF LOCAL DATA----------------------------------------*
      DATA: L_OK              TYPE SY-UCOMM,
            L_OFFSET          TYPE I.
    *&SPWIZARD: END OF LOCAL DATA------------------------------------------*
    *&SPWIZARD: Table control specific operations                          *
    *&SPWIZARD: evaluate TC name and operations                            *
      SEARCH P_OK FOR P_TC_NAME.
      IF SY-SUBRC <> 0.
        EXIT.
      ENDIF.
      L_OFFSET = STRLEN( P_TC_NAME ) + 1.
      L_OK = P_OK+L_OFFSET.
    *&SPWIZARD: execute general and TC specific operations                 *
      CASE L_OK.
        WHEN 'INSR'.                      "insert row
          PERFORM FCODE_INSERT_ROW USING    P_TC_NAME
                                            P_TABLE_NAME.
          CLEAR P_OK.
        WHEN 'DELE'.                      "delete row
          PERFORM FCODE_DELETE_ROW USING    P_TC_NAME
                                            P_TABLE_NAME
                                            P_MARK_NAME.
          CLEAR P_OK.
        WHEN 'P--' OR                     "top of list
             'P-'  OR                     "previous page
             'P+'  OR                     "next page
             'P++'.                       "bottom of list
          PERFORM COMPUTE_SCROLLING_IN_TC USING P_TC_NAME
                                                L_OK.
          CLEAR P_OK.
    *     WHEN 'L--'.                       "total left
    *       PERFORM FCODE_TOTAL_LEFT USING P_TC_NAME.
    *     WHEN 'L-'.                        "column left
    *       PERFORM FCODE_COLUMN_LEFT USING P_TC_NAME.
    *     WHEN 'R+'.                        "column right
    *       PERFORM FCODE_COLUMN_RIGHT USING P_TC_NAME.
    *     WHEN 'R++'.                       "total right
    *       PERFORM FCODE_TOTAL_RIGHT USING P_TC_NAME.
        WHEN 'MARK'.                      "mark all filled lines
          PERFORM FCODE_TC_MARK_LINES USING P_TC_NAME
                                            P_TABLE_NAME
                                            P_MARK_NAME   .
          CLEAR P_OK.
        WHEN 'DMRK'.                      "demark all filled lines
          PERFORM FCODE_TC_DEMARK_LINES USING P_TC_NAME
                                              P_TABLE_NAME
                                              P_MARK_NAME .
          CLEAR P_OK.
    *     WHEN 'SASCEND'   OR
    *          'SDESCEND'.                  "sort column
    *       PERFORM FCODE_SORT_TC USING P_TC_NAME
    *                                   l_ok.
      ENDCASE.
    ENDFORM.                              " USER_OK_TC
    *&      Form  FCODE_INSERT_ROW                                         *
    FORM fcode_insert_row
                  USING    P_TC_NAME           TYPE DYNFNAM
                           P_TABLE_NAME             .
    *&SPWIZARD: BEGIN OF LOCAL DATA----------------------------------------*
      DATA L_LINES_NAME       LIKE FELD-NAME.
      DATA L_SELLINE          LIKE SY-STEPL.
      DATA L_LASTLINE         TYPE I.
      DATA L_LINE             TYPE I.
      DATA L_TABLE_NAME       LIKE FELD-NAME.
      FIELD-SYMBOLS <TC>                 TYPE CXTAB_CONTROL.
      FIELD-SYMBOLS <TABLE>              TYPE STANDARD TABLE.
      FIELD-SYMBOLS <LINES>              TYPE I.
    *&SPWIZARD: END OF LOCAL DATA------------------------------------------*
      ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get the table, which belongs to the tc                     *
      CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
      ASSIGN (L_TABLE_NAME) TO <TABLE>.                "not headerline
    *&SPWIZARD: get looplines of TableControl                              *
      CONCATENATE 'G_' P_TC_NAME '_LINES' INTO L_LINES_NAME.
      ASSIGN (L_LINES_NAME) TO <LINES>.
    *&SPWIZARD: get current line                                           *
      GET CURSOR LINE L_SELLINE.
      IF SY-SUBRC <> 0.                   " append line to table
        L_SELLINE = <TC>-LINES + 1.
    *&SPWIZARD: set top line                                               *
        IF L_SELLINE > <LINES>.
          <TC>-TOP_LINE = L_SELLINE - <LINES> + 1 .
        ELSE.
          <TC>-TOP_LINE = 1.
        ENDIF.
      ELSE.                               " insert line into table
        L_SELLINE = <TC>-TOP_LINE + L_SELLINE - 1.
        L_LASTLINE = <TC>-TOP_LINE + <LINES> - 1.
      ENDIF.
    *&SPWIZARD: set new cursor line                                        *
      L_LINE = L_SELLINE - <TC>-TOP_LINE + 1.
    *&SPWIZARD: insert initial line                                        *
      INSERT INITIAL LINE INTO <TABLE> INDEX L_SELLINE.
      <TC>-LINES = <TC>-LINES + 1.
    *&SPWIZARD: set cursor                                                 *
      SET CURSOR LINE L_LINE.
    ENDFORM.                              " FCODE_INSERT_ROW
    *&      Form  FCODE_DELETE_ROW                                         *
    FORM fcode_delete_row
                  USING    P_TC_NAME           TYPE DYNFNAM
                           P_TABLE_NAME
                           P_MARK_NAME   .
    *&SPWIZARD: BEGIN OF LOCAL DATA----------------------------------------*
      DATA L_TABLE_NAME       LIKE FELD-NAME.
      FIELD-SYMBOLS <TC>         TYPE cxtab_control.
      FIELD-SYMBOLS <TABLE>      TYPE STANDARD TABLE.
      FIELD-SYMBOLS <WA>.
      FIELD-SYMBOLS <MARK_FIELD>.
    *&SPWIZARD: END OF LOCAL DATA------------------------------------------*
      ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get the table, which belongs to the tc                     *
      CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
      ASSIGN (L_TABLE_NAME) TO <TABLE>.                "not headerline
    *&SPWIZARD: delete marked lines                                        *
      DESCRIBE TABLE <TABLE> LINES <TC>-LINES.
      LOOP AT <TABLE> ASSIGNING <WA>.
    *&SPWIZARD: access to the component 'FLAG' of the table header         *
        ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
        IF <MARK_FIELD> = 'X'.
          DELETE <TABLE> INDEX SYST-TABIX.
          IF SY-SUBRC = 0.
            <TC>-LINES = <TC>-LINES - 1.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDFORM.                              " FCODE_DELETE_ROW
    *&      Form  COMPUTE_SCROLLING_IN_TC
    *       text
    *      -->P_TC_NAME  name of tablecontrol
    *      -->P_OK       ok code
    FORM COMPUTE_SCROLLING_IN_TC USING    P_TC_NAME
                                          P_OK.
    *&SPWIZARD: BEGIN OF LOCAL DATA----------------------------------------*
      DATA L_TC_NEW_TOP_LINE     TYPE I.
      DATA L_TC_NAME             LIKE FELD-NAME.
      DATA L_TC_LINES_NAME       LIKE FELD-NAME.
      DATA L_TC_FIELD_NAME       LIKE FELD-NAME.
      FIELD-SYMBOLS <TC>         TYPE cxtab_control.
      FIELD-SYMBOLS <LINES>      TYPE I.
    *&SPWIZARD: END OF LOCAL DATA------------------------------------------*
      ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get looplines of TableControl                              *
      CONCATENATE 'G_' P_TC_NAME '_LINES' INTO L_TC_LINES_NAME.
      ASSIGN (L_TC_LINES_NAME) TO <LINES>.
    *&SPWIZARD: is no line filled?                                         *
      IF <TC>-LINES = 0.
    *&SPWIZARD: yes, ...                                                   *
        L_TC_NEW_TOP_LINE = 1.
      ELSE.
    *&SPWIZARD: no, ...                                                    *
        CALL FUNCTION 'SCROLLING_IN_TABLE'
             EXPORTING
                  ENTRY_ACT             = <TC>-TOP_LINE
                  ENTRY_FROM            = 1
                  ENTRY_TO              = <TC>-LINES
                  LAST_PAGE_FULL        = 'X'
                  LOOPS                 = <LINES>
                  OK_CODE               = P_OK
                  OVERLAPPING           = 'X'
             IMPORTING
                  ENTRY_NEW             = L_TC_NEW_TOP_LINE
             EXCEPTIONS
    *              NO_ENTRY_OR_PAGE_ACT  = 01
    *              NO_ENTRY_TO           = 02
    *              NO_OK_CODE_OR_PAGE_GO = 03
                  OTHERS                = 0.
      ENDIF.
    *&SPWIZARD: get actual tc and column                                   *
      GET CURSOR FIELD L_TC_FIELD_NAME
                 AREA  L_TC_NAME.
      IF SYST-SUBRC = 0.
        IF L_TC_NAME = P_TC_NAME.
    *&SPWIZARD: et actual column                                           *
          SET CURSOR FIELD L_TC_FIELD_NAME LINE 1.
        ENDIF.
      ENDIF.
    *&SPWIZARD: set the new top line                                       *
      <TC>-TOP_LINE = L_TC_NEW_TOP_LINE.
    ENDFORM.                              " COMPUTE_SCROLLING_IN_TC
    *&      Form  FCODE_TC_MARK_LINES
    *       marks all TableControl lines
    *      -->P_TC_NAME  name of tablecontrol
    FORM FCODE_TC_MARK_LINES USING P_TC_NAME
                                   P_TABLE_NAME
                                   P_MARK_NAME.
    *&SPWIZARD: EGIN OF LOCAL DATA-----------------------------------------*
      DATA L_TABLE_NAME       LIKE FELD-NAME.
      FIELD-SYMBOLS <TC>         TYPE cxtab_control.
      FIELD-SYMBOLS <TABLE>      TYPE STANDARD TABLE.
      FIELD-SYMBOLS <WA>.
      FIELD-SYMBOLS <MARK_FIELD>.
    *&SPWIZARD: END OF LOCAL DATA------------------------------------------*
      ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get the table, which belongs to the tc                     *
      CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
      ASSIGN (L_TABLE_NAME) TO <TABLE>.                "not headerline
    *&SPWIZARD: mark all filled lines                                      *
      LOOP AT <TABLE> ASSIGNING <WA>.
    *&SPWIZARD: access to the component 'FLAG' of the table header         *
        ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
        <MARK_FIELD> = 'X'.
      ENDLOOP.
    ENDFORM.                                          "fcode_tc_mark_lines
    *&      Form  FCODE_TC_DEMARK_LINES
    *       demarks all TableControl lines
    *      -->P_TC_NAME  name of tablecontrol
    FORM FCODE_TC_DEMARK_LINES USING P_TC_NAME
                                     P_TABLE_NAME
                                     P_MARK_NAME .
    *&SPWIZARD: BEGIN OF LOCAL DATA----------------------------------------*
      DATA L_TABLE_NAME       LIKE FELD-NAME.
      FIELD-SYMBOLS <TC>         TYPE cxtab_control.
      FIELD-SYMBOLS <TABLE>      TYPE STANDARD TABLE.
      FIELD-SYMBOLS <WA>.
      FIELD-SYMBOLS <MARK_FIELD>.
    *&SPWIZARD: END OF LOCAL DATA------------------------------------------*
      ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get the table, which belongs to the tc                     *
      CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
      ASSIGN (L_TABLE_NAME) TO <TABLE>.                "not headerline
    *&SPWIZARD: demark all filled lines                                    *
      LOOP AT <TABLE> ASSIGNING <WA>.
    *&SPWIZARD: access to the component 'FLAG' of the table header         *
        ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
        <MARK_FIELD> = SPACE.
      ENDLOOP.
    ENDFORM.                                          "fcode_tc_mark_lines
    *&      Module  TAB1_BUTTON  INPUT
    *       text
    MODULE TAB1_BUTTONIP.
      CASE SY-UCOMM.
        WHEN 'DELI'.
          REFRESH IT_TAB3.
          SELECT OBJKY
                 INTO TABLE IT_FILL
                 FROM DRAD
                 WHERE DOKNR = 'T-F122' AND
                       DOKOB = 'LIPS'.
          IF SY-SUBRC = 0.
            LOOP AT IT_FILL INTO WA_FILL.
              wa_tab3-vbeln = WA_FILL-OBJKY+0(10).
              wa_tab3-posnr = WA_FILL-OBJKY+10(4).
              APPEND wa_tab3 TO IT_TAB3.
            ENDLOOP.
            DELETE ADJACENT DUPLICATES FROM IT_TAB3.
         ENDIF.
      ENDCASE.

    hi Sonarali,
    this FM is of no use to you.
    in your PAI you have to loop at the table control table and put a method here you read the lines and save it.
    if you use wizard to create a table control it will automatically give the code to you...

  • Hide The Table in Table-Control Dialogue Programming

    Hi all,
    How to hide the TABLE itself (not the columns only but the whole table completely) in table-control in dialog-programming.can any one please help me.....
    Regards,
    Biswajit

    Hi,
    use the screen table.
    delclare as a "table" for the  group properties of that table element.
      LOOP AT SCREEN.
    if screen-goupt1 = "table"
       if the pushbutton = 'HIDE'  
            screen-required = 0.                            
            screen-invsible   = 0.                         
            screen-input    = 0.                          
            MODIFY SCREEN.
       ELSEIF  the pushbutton = 'SHOW'
            screen-required = 0.                           
            screen-invsible  = 1.                            
            screen-input    = 0.                           
            MODIFY SCREEN.
         ENDIF.
    endif.
        ENDLOOP.
    it solves your problme.
    Thanks

  • Help regarding 'table controls' and 'internal table' updation

    Hi all.
    Basically this is what i have done..... I have created a table control in module pool program. I declared an Internal table and also have populated it from a database table. I have also used insert statement to insert an blank record in the table control view and delete statements to delete any record,  also in the table control view... .
    But I am not able to update any new record into an Internal table or  the  original table ..
    Any Ideas how to do it ,Gurus
    Thanks

    HEllo,
    Check thsi simple report.
    REPORT ZTFH_TABLECONTROL .
    TABLES : ZEMPTABLE.
    DATA : SELLINE .
    DATA : FLD(20).
    DATA : LINNO TYPE I , OFF TYPE I.
    DATA : ITAB LIKE ZEMPTABLE OCCURS 10 WITH HEADER LINE.
    CONTROLS  : CON_TAB TYPE TABLEVIEW USING SCREEN 100.
    SELECT * FROM ZEMPTABLE INTO TABLE ITAB.
    DESCRIBE TABLE ITAB LINES CON_TAB-LINES.
    CALL SCREEN 100.
    *&      Module  EXT_COMM  INPUT
    *       text
    MODULE EXT_COMM INPUT.
    LEAVE PROGRAM.
    ENDMODULE.                 " EXT_COMM  INPUT
    *&      Module  TAB_UPDATE  INPUT
    *       text
    MODULE TAB_UPDATE INPUT.
    CASE SY-UCOMM.
    WHEN 'DEL'.
          IF SELLINE = 'X'.
            DELETE ITAB WHERE EMPNO = ITAB-EMPNO.
            MESSAGE I000(ZYF_DEL).
          ENDIF.
    WHEN 'UPD'.
        IF SELLINE = 'X'.
             MODIFY ITAB INDEX CON_TAB-CURRENT_LINE.
             MESSAGE I001(ZYF_DEL).
        ENDIF.
    WHEN 'INS'.
         IF SELLINE = 'X'.
          GET CURSOR FIELD FLD LINE LINNO OFFSET OFF.
          SET CURSOR FIELD FLD LINE LINNO OFFSET OFF.
          IF FLD CP 'ITAB*' AND SY-SUBRC = 0.
            IF LINNO >= 1.
              LINNO = LINNO + CON_TAB-TOP_LINE - 1.
              CLEAR ITAB.
              INSERT ITAB INDEX LINNO.
              CON_TAB-LINES = CON_TAB-LINES + 1.
            ELSE.
              CLEAR ITAB.
              APPEND ITAB.
              CON_TAB-LINES = CON_TAB-LINES + 1.
            ENDIF.
          ENDIF.
        ENDIF.
    WHEN 'SAV'.
      MODIFY ITAB INDEX CON_TAB-CURRENT_LINE.
      MESSAGE I002(ZYF_DEL).
    ENDCASE.
    ENDMODULE.                 " TAB_UPDATE  INPUT
    “ FLOW LOGIC
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0100.
    LOOP AT ITAB WITH CONTROL CON_TAB.
    ENDLOOP.
    PROCESS AFTER INPUT.
    MODULE USER_COMMAND_0100.
    MODULE EXT_COMM AT EXIT-COMMAND.
    LOOP AT ITAB.
    MODULE TAB_UPDATE.
    ENDLOOP.     
    REgards,
    Vasanth

  • Regarding table controls

    Hi experts,
    please claer my doubts the below
    1.what is a tableview?
    2.how to capture a new record in table control?
    3. what is a custom control?
    and please let me know how to reward.
    Thanks in advance
    Regards
    Ranga

    Hi srinivas,
    1.
       for table view plese refer to the thread:
       <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/collaboration">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/collaboration</a>
    2. to capture a new record in table control write this code in pai
    LOOP AT itab.
        MODULE modify_itab.
      ENDLOOP.
    in the module modify_itab write the foolowing line
    MODIFY itab INDEX tabcontrol-current_line.
    this will pick all the values of table control into internal table itab.
    3. for custom control refer to folloing link.
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/86/2d61d859c711d29bd90000e8a47b2e/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/86/2d61d859c711d29bd90000e8a47b2e/frameset.htm</a>
    Hope it helps
    And if you want to reward points  mark this thread as 'Problem Solved' or with appropriate points on the side of ur post.
    Regards
    Gaurav
    reward points accordingly.

  • Calrify this regarding table control?

    hi,
      while dealing with table control we must create global structure for that table control or we define structure using types or is there any other way of defining the table control structure.
    ex:
    *& Include ZSS_TABTOP                                        Module Pool      ZSS_TABSTRIP
    PROGRAM  ZSS_TABSTRIP.
    CONTROLS: ZSUB1 TYPE TABLEVIEW USING SCREEN '2441',
              SUB2  TYPE TABLEVIEW USING SCREEN '2442',
              TABLE_TABSTRIP TYPE TABLEVIEW USING SCREEN '2444',
              ZSS_TABSTRIP   TYPE TABSTRIP.
    TYPES: BEGIN OF S_VBAK,
           VBELN  TYPE VBAK-VBELN,
           ERDAT  TYPE VBAK-ERDAT,
           ERZET  TYPE VBAK-ERZET,
           ERNAM  TYPE VBAK-ERNAM,
           AUDAT  TYPE VBAK-AUDAT,
           VBTYP  TYPE VBAK-VBTYP,
           NETWR  TYPE VBAK-NETWR,
           WAERK  TYPE VBAK-WAERK,
           END OF S_VBAK.
    TYPES: BEGIN OF S_VBAP,
           VBELN  TYPE  VBAP-VBELN,
           POSNR  TYPE  VBAP-POSNR,
           MATNR  TYPE  VBAP-MATNR,
           NETWR  TYPE  VBAP-NETWR,
           WAERK  TYPE  VBAP-WAERK,
           NTGEW  TYPE  VBAP-NTGEW,
           GEWEI  TYPE  VBAP-GEWEI,
           ERDAT  TYPE  VBAP-ERDAT,
           ERNAM  TYPE  VBAP-ERNAM,
           NETPR  TYPE  VBAP-NETPR,
           KPEIN  TYPE  VBAP-KPEIN,
           END OF S_VBAP.
    DATA: I_VBAK TYPE TABLE OF  S_VBAK,
          I_VBAP TYPE TABLE OF  S_VBAP,
          W_VBAK TYPE S_VBAK,
          W_VBAP TYPE S_VBAP,
          OK_CODE TYPE SY-UCOMM,
          G_LINES TYPE I,
          H_LINES TYPE I.
    I WANT TO DISPLAY THESE INTERNAL TABLE DATA IN TABLE PLZ PROVIDE FURTER CODE

    Hi,
    TABLE CONTROL
    These are the screen elements used to display tabular data they can be called
    as screen tables( like STEP LOOP).To use table control we have to create it on the screen using SCREEN PAINTER(SE51) and declare a control variable of TYPE TABLEVIEW using CONTROLS statement in the ABAP program. We have to use LOOP .. ENDLOOP statement in both PBO and PAI with or without AT int_table parameter. IF AT int_table parameter is not used than we have to place a MODULE call between the LOOP...ENDLOOP statement to fill the screen table rows from the ABAP program in PBO and program our own scrolling functions
    using OK_CODE field.
    Having a parallel loop(at screen table rows & int table rows) by using parameter
    AT int_table makes the ABAP code simple.
    A special structure of type CXTAB_CONTROL is used to set/get various
    attributes of table control at runtime like CURRENT_LINE ,TOP_LINE.
    ABAP declaration
    CONTROLS: tab_con TYPE TABLEVIEW  USING SCREEN nnnn
      Here tab_con is the same name we used in screen for the table control.
    This ABAP statement will declare a control variable that will be used to access
    the table control ,  and set it's various attributes like number of fixed columns(tab_con-FIXED_COLS) ,total number of records it will display(tab_con-LINES).It is of type CXTAB_CONTROL and is a deep structure(structure containing structures).
    REFRESH CONTROL  tab_con FROM SCREEN nnnn
    This ABAP statement will initialize the table control on the screen nnnn to its initial values.
    PBO processing
    In PBO we have to use the screen LOOP ...ENDLOOP statement , with or without
    intenal table.
       LOOP WITH  CONTROL tab_con.
       MODULE fill_tab_con.
       ENDLOOP.
    Here a module should be called between the loop endloop statement to transfer
    data from th ABAP program to the screen table through a structure.This module
    should use the CURRENT_LINE attribute of the table control variable to get the
    current screen table record index to read the data from the internal table into a work area.
    e.g.
    READ TABLE int_table INDEX tab_con-CURRENT_LINE
    The record read will be placed in the header line of the internal table and will be available to the similarly named  screen fields or if these are different it can be written explicitly. e.g.
    screen_field_name = int_table-field_name
       LOOP AT int_table INTO workarea WITH CONTROL tab_con CURSOR i FROM 
       n1 TO n2.
       ENDLOOP.
    Here the module call is not required to fill the screen table.The CURSOR parameter is a integer of type I indicating which absolute internal table line
    should be the first to display on the table control .FROM n1 TO n2 can be used
    to restrict the starting line and ending line number of the internal table , they are of type SY-TABIX.
    In both cases before the LOOP statement a module should be called which
    is generally for setting of status ,in which we should fill the LINES attribute
    (tab_con-LINES ) of the control with the total number of internal table records,doing this ensures correct and automatic scrolling.
    The ABAP statement DESCRIBE TABLE int_table LINES lines can be used
    to get the total lines in an int table.
    PAI Processing
    We have to use LOOP ... ENDLOOP in PAI so that data can transfer fro table control to ABAP program. If we want to write changes to the data we should
    call a module between the LOOP ... ENDLOOP. The MODULE call to process user commands (SY-UCOM) should be called after the ENDLOOP statement.
    e.g.
    PROCESS AFTER INPUT
    MODULE mod AT EXIT-COMMAND.
    LOOP AT itab_table   or LOOP "depending on whether we are using AT int_table
    MODULE modify_int_table.
    ENDLOOP.
    MODULE user_command.
    In the MODULE call modify_int_table we can use
    MODIFY int_table FROM workarea INDEX tab_con-CURRENT_LINE
    or we can use
    int_table-field_name = screen_field_name.
    The steps to create a table control is given in this link.
    http://members.aol.com/skarkada/sap/table_control/table_control.htm

  • Regarding table control handling in BDC

    Hi,
    how to Handle table control in BDC ,how to handle resolution of table control in BDC?
    Pls send urgently

    Hi,
    chk this excellent link.
    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    Regards
    Anver
    if helped pls mark points

  • Regarding Table Control

    Hi all,
    i want to give a color to a particular column in table control how i can achieve this? currently am using textbox for  table control heading display is there any way to achieve this scenario, kindly help me regarding this scenario.

    You can just highlight it. No provision to set background color.
    To highlight the field, you can follow this steps:
    Open your table control in screen painter..
    Double click on the field on which you want to make highlight.
    This will bring you a popup screen for properties.
    Select Display tab in the Attributes frame.
    Check the BRIGHT checkbox on .
    Regards,
    Naimesh Patel

  • Regarding Table Control in screen Painter

    hi,
      In my table control, one column is aceepting the UV Rate of the Material. But that particular column did not accept the Decimal Value . when i enter the decimal,
    'Please enter the Numeric value' error is coming.
      I am declared as Curr Data type for my table zuvrate-dmbtr.
       how can i enter decimal value in that column?

    Neptune,
    Lets start from the beginning -
    Your custom table has a field called DMBTR (domain WERT7). The reference value for this field is T001-WAERS.
    Hope its correct so far.
    In the table control, your field DMBTR is called <customtablename>-DMBTR.
    In the screen attributes of this field, you have the 'From Dict' ticked, Format is CURR and the reference field is specified. Correct?
    If this is the case then the table control should not throw any errors, do let me know if there is any change.
    Update: I just figured, probably the reason for your errors is that you have not used the domain in your custom table and have specified the CURR type as a direct type. The problem with this is that 2 decimal places will always be required by the system. Whereas if you use the data element (eg: DMBTR), the output length is 16, which would work fine.
    Sudha
    Message was edited by: Sudha Mohan

  • Regarding table control in BDC

    Hi,
    How can we handle table control in BDC,If i have the transaction like
    1>having scroll bar
    2>having InsertButton for the tablle control
    3>Even though if we have scroll bar or Insert button(+) , is there any limit for the number of rows in table control
    or can we insert as many records as we want?
       If there is limit how can we identify ,what is the limit of table control.
    4>How can we know for table control ,how many records are inserted for each scroll down or Insert button.
       i think it varies accroding to the resolution.How can we handle this
    Thanks

    Hi Rama Krishna,
    While recording the scroll bar will not be recorded.
    There is no limit for the number of records,depends on configuration
    say suppose the visible lines are 16 then after pressing the new-page then again 16 lines will be available which includes one of the previous lines.
    the logic can be as
    loop at it_tab.(say 100 records are there)
    steps to be executed for table control.
    I hope u know hw to capture the line no into v_no.
    if v_no = 16.(visible lines)
    step for new-page.
    endif,
    endloop.
    Example :
       IF V_COUNT = '13'.                                   "Counter reached visible lines
                PERFORM BDC_FIELD       USING 'BDC_OKCODE'           " For New Document Number
                                               '=FDPE'.
                V_COUNT = 1.
    Hope this will be helpful.

  • Regarding TABLE CONTROL IN MODULE POOL

    Hi all,
         I have implemented a table control in a custom transaction . In the PBO of the code I have moved the internal table data to the  screen fields similarly in the PAI of the screen I have moved the screen data to the interanal table and iam modifying the internal table every thing is working fine till here but when I press the down arrow of the vertical scroll bar of the table control then the line item which the user has changed recently on the screen is overwriting the remaining records of the internal table and as a result the tablecontrol lines on the screen are also being overwritten by that record please help me in resolving this issue.....is there any solution to handle the scroll bar and as well the cursor position .

    Hi,
    For the vertical scrool bar F.code is space..
    so In pai of ur screen..
    If sy-ucomm = ' '  or sy-ucomm = 'ENTER'.
      modify it_data index tc-current_line.( so what evr u enter in the Table        control ,correponding changes will be captured to ur internal table)
    endif.
    I hope this works for ur situation..

  • BDC programming and table controls selColumns

    Hello,
    I have a small question regarding BDC programming. I am already quite familiar with the process in creating one but I have one question regarding table control and its selColumns.
    Transactions like pa40 would require its users to select one of the rows in the table controls via SelColumns. My questions is how would you simulate this using BDC.
    Thanks people and take care.

    Hai Chad Cheng
    report Z_TAB_CONTRL_01
           no standard page heading line-size 255.
    data : begin of it_kna1 occurs 0,
           kunnr like RF02D-KUNNR,
           D0130 like RF02D-D0130,
           end of it_kna1.
    data : begin of it_kna2 occurs 0,
           kunnr like RF02D-KUNNR,
           BANKS like KNBK-BANKS,
           BANKL like KNBK-BANKL,
           BANKN like KNBK-BANKN,
           koinh like KNBK-koinh,
           end of it_kna2.
    data : V_Count(2) type n.
    data : V_Val(15).
    include bdcrecx1.
    start-of-selection.
      perform Get_Data1.
      perform Get_Data2.
    perform open_group.
    loop at it_kna1.
    V_Count = '04'.
    perform bdc_dynpro      using 'SAPMF02D' '0106'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF02D-D0130'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RF02D-KUNNR'
                                  '10002103'.
    perform bdc_field       using 'RF02D-D0130'
                                  'X'.
    perform bdc_dynpro      using 'SAPMF02D' '0130'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=P+'.
    perform bdc_dynpro      using 'SAPMF02D' '0130'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=P+'.
    perform bdc_dynpro      using 'SAPMF02D' '0130'.
    loop at it_kna2 where kunnr = it_kna1-kunnr.
    if v_count = '10'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=P+'.
    perform bdc_dynpro      using 'SAPMF02D' '0130'.
    v_count = '00'.
    endif.
    V_Count = V_Count + 1.
    concatenate 'KNBK-KOINH(' V_Count ')' into V_Val.
    perform bdc_field       using 'BDC_CURSOR'
                                   'KNBK-KOINH(09)'.
    concatenate 'KNBK-BANKS(' V_Count ')' into V_Val.
    perform bdc_field       using V_Val
                                  it_kna2-BANKS.
    concatenate 'KNBK-BANKL(' V_Count ')' into V_Val.
    perform bdc_field       using V_Val
                                  it_kna2-BANKL.
    concatenate 'KNBK-BANKN(' V_Count ')' into V_Val.
    perform bdc_field       using V_Val
                                  it_kna2-BANKN.
    concatenate 'KNBK-KOINH(' V_Count ')' into V_Val.
    perform bdc_field       using V_Val
                                  it_kna2-KOINH.
    endloop.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=UPDA'.
    perform bdc_transaction using 'FD02'.
    clear : it_kna1,it_kna2.
    endloop.
    perform close_group.
    *&      Form  Get_Data1
          text
    -->  p1        text
    <--  p2        text
    FORM Get_Data1 .
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      CODEPAGE                      = ' '
       FILENAME                      = 'C:\tab_contl.txt'
       FILETYPE                      = 'ASC'
      ITEM                          = ' '
      FILEMASK_MASK                 = ' '
      FILEMASK_TEXT                 = ' '
      FILETYPE_NO_CHANGE            = ' '
      FILEMASK_ALL                  = ' '
      FILETYPE_NO_SHOW              = ' '
      LINE_EXIT                     = ' '
      USER_FORM                     = ' '
      USER_PROG                     = ' '
      SILENT                        = 'S'
    IMPORTING
      FILESIZE                      =
      CANCEL                        =
      ACT_FILENAME                  =
      ACT_FILETYPE                  =
      TABLES
        DATA_TAB                      = it_kna1
    EXCEPTIONS
      CONVERSION_ERROR              = 1
      INVALID_TABLE_WIDTH           = 2
      INVALID_TYPE                  = 3
      NO_BATCH                      = 4
      UNKNOWN_ERROR                 = 5
      GUI_REFUSE_FILETRANSFER       = 6
      OTHERS                        = 7
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.                    " Get_Data1
    *&      Form  Get_Data2
          text
    -->  p1        text
    <--  p2        text
    FORM Get_Data2 .
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      CODEPAGE                      = ' '
       FILENAME                      = 'C:\tab_cont1.txt'
       FILETYPE                      = 'ASC'
      ITEM                          = ' '
      FILEMASK_MASK                 = ' '
      FILEMASK_TEXT                 = ' '
      FILETYPE_NO_CHANGE            = ' '
      FILEMASK_ALL                  = ' '
      FILETYPE_NO_SHOW              = ' '
      LINE_EXIT                     = ' '
      USER_FORM                     = ' '
      USER_PROG                     = ' '
      SILENT                        = 'S'
    IMPORTING
      FILESIZE                      =
      CANCEL                        =
      ACT_FILENAME                  =
      ACT_FILETYPE                  =
      TABLES
        DATA_TAB                      = it_kna2
    EXCEPTIONS
      CONVERSION_ERROR              = 1
      INVALID_TABLE_WIDTH           = 2
      INVALID_TYPE                  = 3
      NO_BATCH                      = 4
      UNKNOWN_ERROR                 = 5
      GUI_REFUSE_FILETRANSFER       = 6
      OTHERS                        = 7
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.                    " Get_Data2
    Thanks & regards
    Sreenivasulu P

  • Sale Order Item : Custom Field : Table Control

    I have added two fields to sale order item table control in program SAPMV45A screen no . 4900. Now the field which i have added are working fine while creating sale order but while changing those fields are not changing.
    condition is like this: the custom field are automatically filled by some logic and if the user want to change those field he will able to do. Now 1st condition is fine and when i change those field they will show the previous saved value inspite of changed value. 
    I have also added those field in additional data b tab in screen 8459 , there they are working fine but here the problem remains the same.

    Hi,
    u can use BAPI_SALESORDER_CHANGE to update the values of those fields. for that u need to extend few tables and coding that u can get from the BAPI documentation. If not getting reply back. i can help u..
    regards,
    pavan.

  • Reg: Dialog Programming

    Dear All,
    I'm new to this group.
    Now i'm learning ABAp.
    I need a small Help.
    I want to insert/Update the data into master tables using Dialog Programming.
    How can i do that.
    I'm using RF(Radio frequency)devices,which can access the SAP Screens in Character Based Format and from those devices i want to update/recieve the Data in the database.
    Please send me the procedure/Code.
    Thanks  & Regards,
    Adi.

    Hai Sateesh,
    Thanks for your reply.
    I'm using RF Hand Held Devices & Barcode Technology for stores Automation.
    I want the dialog programming as when ever the user scan the barcode of the particular material,the system will automatically check the Databse and need to show the details of that Particular Material.
    For issuing & reciveing & for stock verification i want the dialog programming.
    In this How to use BDC's /BAPI's. what isa the advantage of using BDC's/BAPI's?
    i don't know much about BAPI Programming.
    I devloped one small Dialog Program...
    The code look like this.
      Delaration of Tables.
      Internal table Declaration.
      In the PAI Event.
      Case sy-ucomm.
      when 'save'.
      insert mara.
      when 'disp'.
      select * from mara where matnr = itab-matnr.
      endselect.
      when 'exit'.
       leave program.
      endcase.
      in the PBI Event
      Move-correspondin itab to mara.
      with this code i'm able to get the values what ever i entered,and i'm able to save.
    What is use of BAPI's & what is the Advantage?
    Please Reply me.
    Regards,
    Adinarayana.B

Maybe you are looking for

  • Opening url rebuffering stream when previewing songs

    How can I fix music previews that play for 3 seconds and then give me an error: opening url rebuffering stream? I never had this issue, and haven't changed anything. What's wrong?

  • How can I be reimbursed and cancel my old account?

    I wanted to cancel my old membership this afternoon, but I quickly realized that money was automatically taken out of my account in the morning. Shortly after I had paid for a membership, my school, Parsons The New School of Design, allowed students

  • Data field shifting to right cell in excel file

    Hi, I have proxy to file content conversion scenario in which I have one field in which e-mail getting populated. for some email id coimg correct in excel file cell <EMAIL>[email protected]</EMAIL> but for it is getting shifting to right cell <EMAIL>

  • ORA-20998 when entering exec qms_transaction_mgt.open_transaction('PATCH')

    When only entering the statement exec qms_transaction_mgt.open_transaction('PATCH') on the SQL*Plus prompt raises the following error: ORA-20998: Transaction Failed ORA-06512: at "HST65.QMS$ERRORS", line 128 ORA-06512: at "HST65.QMS$ERRORS", line 238

  • Online Help no longer functions

    Our online Help is no longer functioning.  A new window opens that reads: This program cannot display the webpage    Most likely causes: You are not connected to the Internet. The website is encountering problems. There might be a typing error in the