Table Control in ITS is getting wrongly displayed

Hi All,
I Have developed a program(say abc) and created a screen for that program(abc).
My issue is that,i have kept the table control in the box .
When i execute the screen in se80 under the program(abc) ,its displaying properly ( i mean table control is inside the box).
I have created an internet service program in se80 where i am passing the transaction code of  that program(abc) in the parameters tab.
**problem is***
but when i execute the internet service program(xyz) after publishing then the
table control is coming out of the box in ESS ,
i mean the width of the table control is not getting reduced.
It(table control) has to get fit inside the box.
even though its working properly through screen.
please help me out of this issue.
thanks,
bhavani.
Edited by: BHAVANI MADIREDDY on Jul 26, 2008 9:53 AM

Hi ,
I have set vertical scroll bar to 'X' but still when I scroll the scroll bar the counter is getting incremented and the last entered value is appended many times in the table control.
What can be done to overcome this issue?

Similar Messages

  • Table control on ITS need to design

    Hi,
    Can anybody let me know how to create Table Control on ITS Template ?
    I need to create one Table control in ITS template in internet service .
    With this i also need to transfer OK code in SAPGUI .
    I have created Table contol in SAP gui and want to display on ITS Template .
    I have internal table which i want to show on ITS .
    any help will be appreciated .
    Thanks,
    SS

    Hi,
    here a short example how to display a table control on a ITS template:
    `repeat with j from MY_TC.firstvisible to MY_TC.lastvisible`
    <tr>
      <td> <input type=text
            name="`myField[j].name`"
            value="`myField1[j].value`">
      </td>
    </tr>
    `end`
    MY_TC is the name of the table control.
    Best regards
    Dennis

  • How to enhance table control in DMS. Need to display doknr more than 25 cha

    Hi there.
    In transaction IL03 - document tab - I need to display a doknr which is longer than 25 characters.
    I search for exit/enhancement for DMS - saplcv140/control SUB_DOC, but cant find anything.
    If it is not possible to enhance this field, i would like to add a new field (more than 25 char) and fill in the long doknr.
    The documents that are attached contains both an internal docnumber(from the external system) and an external docnumber (functional location type of number). It is very important to show external documentno in the table control.
    Actually in the table DRAW the external dok number is in the field MRK_FILEP. Can this field somehow get in the tablecontrol?
    Anybody has experience with docno longer than 25 characters? Or how to enhance tablecontrol sub_doc (screen 0204) in fuction group CV140.
    Br,
    Liselotte.

    The BAdI CRM_BADI_RF_Q1O_SEARCH is for enhancing OneOrder based searches. Not for business partners.
    The BAdI CRM_BUPA_IL_SEARCH is the way to go. I just checked in our system.
    In the method SEARCH_CRITERIA_INITIAL check if your field is supplied in IS_PARAMETERS. If yes return CV_IS_NOT_INITIAL = 'X'.
    Then in SEARCH_PARTNERS you delete the entries from table CT_PARTNER_KEYS according to your parameter.
    However this is not very performant. If you have a search with criteria only of your own for the BAdI SAP coding will first select everything and then you filter out.
    Anyway, it is much faster to implement than a new search...
    cheers Carsten
    Edited by: Carsten Kasper on Nov 18, 2008 7:44 PM

  • How to increase the rows of a Table control on ITS

    Hi,
    I'm trying to increase the number of rows to 20 on ITS but it always shows 2 rows per navigation. Although in the backend module pool there are 8 rows and the GV_SOS_LIST_CONTROL-LINES contains the total no of rows of the internal table. yet there are always 2 rows getting printed. This screen is in different function group and being called from some other function group i.e BBP_SC_UI_ITS. Are there any parameters that we have missed out to pass from BBP_SC_UI_ITS to our function group. Reply needed urgently!!!!!!!!!!!

    Hi,
    i tried increasing the rows on the browser by hard coding the counter and then the rows do increase but the records that are shown are still 2 per navigation. i doubt if it is a screen size constraint. the transaction in which i'm trying all this is bbpsc01.

  • Error in table control while displaying data.

    Hi All,
    I m doing module pool programming using Table control.
    I m using one table only and declared internal table like the database table.
    When I m transferring data from internal table to Table control screen, I m getting error like.
    <b>A conversion error occurred while the program was trying to
    display data on the screen.</b>
    The filed is of DEC type and it is having some value with negative sign.
    Whether I have to change field type of sceen element and if so then to which data type?
    Or any other way to handle such situation.
    Thanx.
    Umesh.

    Hello,
    Please check whether the screen field name of the table control and the type
    is same as the internal table that you are using to populate.
    reward if helps
    Thanks
    Krishna
    Message was edited by:
            Krishnakumar Ramadoss

  • Problem with looping table control in PAI

    Hi,
    I have a table control which displays 10 records at a time. In PAI it is looping only these 10 records even though itab has more than 10. I need to do some validations on all the records. How to overcome this prob.
    Thanks in advance.

    c if u want to do validationsdo it on the internal table before passing it to the table control..
    Secondly in a table control if its size on the screen is for displaying 4 records only den it will display on 4 while running even though ur table has 10 records...
    So in SE41 drag and increase the size for table control...den it will display all records..
    And if u dont want dis..den write the code for vertical scroll in table control..
    Get back to me in case u want 2 do dat..
    Hope dis helps..
    Reward if it does

  • How to delete a row from table control

    I have created a push button on the screen for delete.
    its getting stored in ok_code.
    'FLAG' is the name of the mark on the table control.
    I am getting probs in this line.
    I am not getting anything in mark_field.
    ASSIGN COMPONENT p_mark_name OF STRUCTURE <wa> TO <mark_field>.
    The code is:
    MODULE tablctrl2_user_command INPUT.
      PERFORM user_ok_tc USING    'TABLCTRL2'
                                  'I_ZSKILLEMP'
                                  'FLAG'
                         CHANGING ok_code.
    ENDMODULE.
    FORM user_ok_tc USING    p_tc_name TYPE dynfnam
                             p_table_name
                             p_mark_name
                    CHANGING p_ok      LIKE sy-ucomm.
    -BEGIN OF LOCAL DATA----
      DATA: l_ok              TYPE sy-ucomm,
            l_offset          TYPE i.
    -END OF LOCAL DATA----
    Table control specific operations                                    *
      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.
    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.
    FORM fcode_delete_row
                  USING    p_tc_name           TYPE dynfnam
                           p_table_name
                           p_mark_name   .
    -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>.
    -END OF LOCAL DATA----
      ASSIGN (p_tc_name) TO <tc>.
    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
    delete marked lines                                                  *
      DESCRIBE TABLE <table> LINES <tc>-lines.
      LOOP AT <table> ASSIGNING <wa>.
      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.

    Hi...
    i got the same prob...but got the solution too...
    you have to take an internal table of same type of dbase table..and maintain a flag in it...which will be get filled automatically with 'X'.
    here is the code..go throug it..
    REPORT  YH642_DIALOG_TABLECONTROL.
    CALL SCREEN 999.
    DATA:
      W_INDEX TYPE I.
    DATA:
      W_UCOMM LIKE SY-UCOMM.
    ***&SPWIZARD: DATA DECLARATION FOR TABLECONTROL 'TAB'
    *&SPWIZARD: DEFINITION OF DDIC-TABLE
    TABLES:   YH642_RAM.
    DATA:
      BEGIN OF DDTAB,
        TAB_FLAG  TYPE C,
        MANDT  LIKE YH642_RAM-MANDT,
        EID    LIKE YH642_RAM-EID,
        ENAME  LIKE YH642_RAM-ENAME,
        MOBILE LIKE YH642_RAM-MOBILE,
      END OF DDTAB.
    *&SPWIZARD: TYPE FOR THE DATA OF TABLECONTROL 'TAB'
    TYPES: BEGIN OF T_TAB,
             TAB_FLAG TYPE C,
             MANDT LIKE YH642_RAM-MANDT,
             EID LIKE YH642_RAM-EID,
             ENAME LIKE YH642_RAM-ENAME,
             MOBILE LIKE YH642_RAM-MOBILE,
           END OF T_TAB.
    *&SPWIZARD: INTERNAL TABLE FOR TABLECONTROL 'TAB'
    DATA:     G_TAB_ITAB   TYPE T_TAB OCCURS 0,
              H_TAB_ITAB   TYPE T_TAB OCCURS 0,
              G_TAB_WA     TYPE T_TAB. "work area
    DATA:     G_TAB_COPIED.           "copy flag
    *&SPWIZARD: DECLARATION OF TABLECONTROL 'TAB' ITSELF
    CONTROLS: TAB TYPE TABLEVIEW USING SCREEN 0999.
    *&SPWIZARD: LINES OF TABLECONTROL 'TAB'
    DATA:     G_TAB_LINES  LIKE SY-LOOPC.
    DATA:     OK_CODE LIKE SY-UCOMM.
    *&SPWIZARD: OUTPUT MODULE FOR TC 'TAB'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: COPY DDIC-TABLE TO ITAB
    MODULE TAB_INIT OUTPUT.
      IF G_TAB_COPIED IS INITIAL.
    *&SPWIZARD: COPY DDIC-TABLE 'YH642_RAM'
    *&SPWIZARD: INTO INTERNAL TABLE 'g_TAB_itab'
        SELECT * FROM YH642_RAM
           INTO CORRESPONDING FIELDS
           OF TABLE G_TAB_ITAB.
        G_TAB_COPIED = 'X'.
        H_TAB_ITAB[] = G_TAB_ITAB[].
        REFRESH CONTROL 'TAB' FROM SCREEN '0999'.
      ENDIF.
    ENDMODULE.                    "TAB_INIT OUTPUT
    *&SPWIZARD: OUTPUT MODULE FOR TC 'TAB'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: MOVE ITAB TO DYNPRO
    MODULE TAB_MOVE OUTPUT.
      MOVE-CORRESPONDING G_TAB_WA TO DDTAB.
    ENDMODULE.                    "TAB_MOVE OUTPUT
    *&SPWIZARD: OUTPUT MODULE FOR TC 'TAB'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: GET LINES OF TABLECONTROL
    MODULE TAB_GET_LINES OUTPUT.
      G_TAB_LINES = SY-LOOPC.
    ENDMODULE.                    "TAB_GET_LINES OUTPUT
    *&SPWIZARD: INPUT MODULE FOR TC 'TAB'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: MODIFY TABLE
    MODULE TAB_MODIFY INPUT.
      MOVE-CORRESPONDING DDTAB TO G_TAB_WA.
      MODIFY G_TAB_ITAB
        FROM G_TAB_WA
        INDEX TAB-CURRENT_LINE.
    ENDMODULE.                    "TAB_MODIFY INPUT
    *&SPWIZARD: INPUT MODULE FOR TC 'TAB'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: PROCESS USER COMMAND
    MODULE TAB_USER_COMMAND INPUT.
      OK_CODE = SY-UCOMM.
      PERFORM USER_OK_TC USING    'TAB'
                                  'G_TAB_ITAB'
                                  'TAB_FLAG'
                         CHANGING OK_CODE.
      SY-UCOMM = OK_CODE.
    ENDMODULE.                    "TAB_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.
      L_OK = 'DELE'.
    *&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
         MESSAGE 'Are you really going to delete??' type 'I'.
          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'.
          W_INDEX = SYST-TABIX.
          DELETE <TABLE> INDEX SYST-TABIX.
          IF SY-SUBRC = 0.
            <TC>-LINES = <TC>-LINES - 1.
          ENDIF.
        ENDIF.
      ENDLOOP.
      READ TABLE H_TAB_ITAB INDEX W_INDEX INTO G_TAB_WA.
      IF SY-SUBRC EQ 0.
        MOVE-CORRESPONDING G_TAB_WA TO YH642_RAM.
        DELETE YH642_RAM.
      ENDIF.
    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  STATUS_0999  OUTPUT
          text
    MODULE STATUS_0999 OUTPUT.
      SET PF-STATUS 'SS_STD'.
      SET TITLEBAR 'TITLE'.
    ENDMODULE.                 " STATUS_0999  OUTPUT
    *&      Module  USER_COMMAND_0999  INPUT
          text
    MODULE USER_COMMAND_0999 INPUT.
      DATA:
        H_TAB_WA LIKE G_TAB_WA.
      CASE W_UCOMM.
        WHEN 'BACK'.
          LEAVE PROGRAM.
        WHEN 'TAB_MODI' OR 'SAVE'.
          LOOP AT G_TAB_ITAB INTO G_TAB_WA.
          FORMAT   INPUT OFF.
            MOVE-CORRESPONDING G_TAB_WA TO YH642_RAM.
            READ TABLE H_TAB_ITAB WITH KEY EID = G_TAB_WA-EID INTO H_TAB_WA.
            IF SY-SUBRC EQ 0.
              IF G_TAB_WA NE H_TAB_WA.
                MODIFY YH642_RAM.
              ENDIF.
            ELSE.
              INSERT  YH642_RAM.
            ENDIF.
          ENDLOOP.
    SORT  G_TAB_ITAB.
      ENDCASE.
    *CALL SCREEN 700.
    ENDMODULE.                 " USER_COMMAND_0999  INPUT

  • How to implement line selectability for a table control using table Wizard?

    Hello SDN Community,
    I have created a table control using the Table Wizard.  I found my exact question in this forum, but unfortunately it had not been andsered.  While I cannot paste a screen-print into this plane-text area, here are the steps I followed...
    1) SE51
    2) Create new screen 0100
    3) Click Layout button
    4) Clidk Table Control (with Wizard) and draw box on canvas.
    5) Step is "Start" - click Continue
    6) Step is "Name of Table Control" - provided name
    7) Step is "Table Name" - provided name of dictionary table (AUFK)
    8) Step is "Definition of Columns" - selected order numver and order text
    9) Step is "Table Control Attributes" - Line Selectability is in display mode - cannot set it.
    I would like to have a selectability column for my table.  Would appreciate any insight into how to do this.
    Thank you,
    Dean Atteberry.

    This is a puzzling...
    For the table control wizard, in the Table Control Attributes step, I was able to get line selectability to open up by declaring a char01 data element at the beginning of my type.
    The puzzling is in regards to the "Selection col. fld" entry field.
    If I leave it blank and try to go to the next step, I get message "Enter the name of the selection column if you are using a program table"
    So it looked like it wanted to know the name of my selection column.  So I type in "CHAR1".  and got the message "The field "CHAR1" for the selection column is already contained in the table."
    Hmmmmm.... don't understand............
    Dean Atteberry.

  • Module pool transfer of data from one table control to another

    Hi all,
    I have been assigned to module pool object wherein i have to display table control on screen and that table control contains only 10 rows on screen for display. Now my internal table it_out has 15 rows
    Describe table it_out
    line v_l.     " v_l  = 15.
    There is a pushbutton below table control and when i select multiple rows and click on that pushbutton it will navigate me to the next screen containing another table control on which i need to display those selected records.
    Now the problem is that when i select first record and move cursor down to select last record then i am seeing only last record on next screen table control. why is it happening? please provide me with solution. For rest of cases it is working fine for example if i select first record and second record then i am seeing both these selected records on next screen table control . Only the problem arises when i tried to select first and lets say last record when scrolling down on table control.
    I think the problem is with scrolling but when i loop on next screen with moved records i am seeing that 2 records are their but it is transferring only one record to next screen not the last one.
    Your response is highly appreciated.
    Thanks
    Parag

    Hi Parag,
    Screen 8002 (with table control) --> select records --> press a button --> move to screen 8003 --> display selected records in screen 8002.
    First problem that if you select first record in table control and scroll to end to select the last record, the first record in deselected.
    Next problem, that if you select say 3 records in table control you want the to be displayed in another table control, the use this code.
    Also take another internal table and work area same as the initial internal table and work area used in screen 8002.
    On screen 8002, take a button with function code 'PROCESS', on which user clicks the screen 8003 should display selected records.
    Now, use this code, its working:-
    Take the names of the input/output fields as work_area-field_name and select column in table control as work_area-flag.
    Also take a flag field of size 1 datatype character as the last field in the internal table and work area while declaration.
    You must have passed a code in PBO of the screen for reading internal table into the table control.
    So it reads the internal table into the table control whenever you perform any action on use command.
    All you need to do is to write a code to modify the internal table form the table control while performing any user action.
    Remember to change the LINE SEL option in attributes of table control as MULTIPLE.
    At Screen Logic:-
    PROCESS BEFORE OUTPUT.
      MODULE status_8002. "for pf-status
      LOOP WITH CONTROL po_tab. "po_tab is name of table control
        MODULE pass_data. "to pass data into table control from internal table
      ENDLOOP.
    PROCESS AFTER INPUT.
      MODULE user_command_8002. "to handle other user commands (back and exit)
      LOOP WITH CONTROL po_tab. "po_tab is name of table control
        MODULE modify_data. "to modify data from table control into internal table
        MODULE process_data. "to display selected records on another screen
      ENDLOOP.
    In PBO,
    *&      Module  STATUS_8002 OUTPUT
    MODULE status_8002 OUTPUT.
      SET pf-status 'ZAB_PFSTA'. " pf-status
      DATA : line_count TYPE i.
      DESCIRBE TABLE it_ekpo
      LINES line_count.
      po_tab-lines = line_count + 10.
      " to make table control scrollable
    ENDMODULE.                 " STATUS_8002  OUTPUT
    *&      Module  PASS_DATA  OUTPUT
    MODULE pass_data OUTPUT.
      READ TABLE it_ekpo into wa_ekpo INDEX po_tab-current_line.
    ENDMODULE.                 " PASS_DATA  OUTPUT
    "it_ekpo is internal table and wa_ekpo is the work area
    In PAI,
    *&      Module  MODIFY_DATA  INPUT
    MODULE MODIFY_DATA INPUT.
      MODIFY IT_EKPO INDEX PO_TAB-CURRENT_LINE FROM WA_EKPO.
      "modify records from table control into the internal table
    ENDMODULE.                 " MODIFY_DATA  INPUT
    *&      Module  PROCESS_DATA  INPUT
    MODULE PROCESS_DATA INPUT.
      CASE sy-ucomm.
        WHEN 'PROCESS'.
          IF wa_ekpo-flag = 'X'.
            wa_ekpo1 = wa_ekpo.
            APPEND wa_ekpo1 TO it_ekpo1. "if record selected move to another internal table
          ENDIF.
      ENDCASE.
      "modify records from table control into the internal table
    ENDMODULE.                 " PROCESS_DATA  INPUT
    Now if you select some records in this table control the values will retain in internal table.
    Screen 8003 with selected records to be displayed in another table control.
    At Screen Logic:-
    PROCESS BEFORE OUTPUT.
      MODULE status_8003. "for pf-status
      LOOP WITH CONTROL po_tb. "po_tb is name of table control
        MODULE pass_data1. "to pass data into table control from internal table
      ENDLOOP.
    PROCESS AFTER INPUT.
      MODULE user_command_8003. "to handle other user commands (back and exit)
      LOOP WITH CONTROL po_tb. "po_tb is name of table control
        MODULE modify_data1. "to modify data from table control into internal table
      ENDLOOP.
    In PBO,
    *&      Module  STATUS_8003 OUTPUT
    MODULE status_8003 OUTPUT.
      SET pf-status 'ZAB_PFSTA'. " pf-status
      DATA : line_count1 TYPE i.
      DESCIRBE TABLE it_ekpo1
      LINES line_count1.
      po_tb-lines = line_count1 + 10.
      " to make table control scrollable
    ENDMODULE.                 " STATUS_8003  OUTPUT
    *&      Module  PASS_DATA1  OUTPUT
    MODULE pass_data1 OUTPUT.
      READ TABLE it_ekpo1 into wa_ekpo1 INDEX po_tb-current_line.
    ENDMODULE.                 " PASS_DATA1  OUTPUT
    "it_ekpo is internal table and wa_ekpo is the work area
    In PAI,
    *&      Module  MODIFY_DATA1  INPUT
    MODULE MODIFY_DATA1 INPUT.
      MODIFY IT_EKPO1 INDEX PO_TB-CURRENT_LINE FROM WA_EKPO1.
      "modify records from table control into the internal table
    ENDMODULE.                 " MODIFY_DATA1  INPUT
    Hope this solves your problem.
    Thanks & Regards,
    Tarun Gambhir

  • Table control as non editable

    Hi experts,
                    I need make my table control as noneditable for a specific transaction after fetching values.
    i did till fetching part and displaying in table control. but its diplaying as editable field. i need to make that as non editable... plz help me in this....this screen is for only dispaly purpose...
    Note:- i did Table control through wizard...

    Based on your transaction identifier , and also give the Screen group1 for all the columns ex: AAA you can do some thing like this in the PBO
    PBO
    Loop at itab with control tc.
    module input_enable_disable.
    endloop.
    module input_enable_disable output.
    if Transaction = 'DISP'.
    loop at screen.
      if screen-group = 'AAA'.
       screen-input = 0.
       modify screen.
      endif.
    endloop.
    endif.
    endmodule.

  • Record not shown in table control

    Hi experts,
    I am working on the module pool program with a screen 0100. There is a table control called TABL_MATR in screen 0100.
    There is no error while compiling the program. But no record shown when a record added into the table control.
    I do not want to use the headerline in the program, because I intented to do it in OO way.
    Record shown if I do like this:
    DATA: ITAB_TRAY  TYPE STANDARD TABLE OF LS_TRAY WITH HEADER LINE.
    In PBO
    loop at itab_tray  " record show in the table control
    whereas record not shown if do like this:
    DATA: ITAB_TRAY  TYPE STANDARD TABLE OF LS_TRAY.
    In PBO
    loop at itab_tray into wa_tray  " no record show in the table control
    Can someone guide me how to do it in the right way?
    Please help.
    Thanks in advance.

    Hi all,
    I have added the below images.
    1) http://i566.photobucket.com/albums/ss106/wkw510/pic6.jpg
    2) http://i566.photobucket.com/albums/ss106/wkw510/pic7.jpg
    3) http://i566.photobucket.com/albums/ss106/wkw510/pic8.jpg
    I have also followed what Devendra's suggested, however the same error message I get:
    "ITAB_TRAY" is not a structure or internal table with header line.
    As such I have changed the statement
    module fill_table_control output.
      MOVE-CORRESPONDING wa_tray TO itab_tray.
    endmodule.
    to
    module fill_table_control output.
      APPEND wa_tray TO itab_tray.
    endmodule.
    After changed, compiled no error.
    But, when I started to use the program I got another error which closed the whole SAP screen.
    Therefore I tried to change the TABLE CONTROL setting to
    4) http://i566.photobucket.com/albums/ss106/wkw510/pic10.jpg
    Now, everything is okay but I only get the latest record shows in the TABLE CONTROL. The record I inserted display more than one time, and filled all the table control.
    5) http://i566.photobucket.com/albums/ss106/wkw510/pic11.jpg
    I am wondering should we include
    MOVE-CORRESPONDING wa_tray TO itab_tray.
    or
    APPEND wa_tray TO itab_tray.
    According from Devendra, the PBO should only has this code
      loop at itab_tray into wa_tray
        with control tabl_matr
        cursor tabl_matr-current_line.
    *    module fill_table_control.   "shoule we exclude this?
      endloop.
    If I exclude the above code, the table control only show one record, regardless how many records are inserted.
    Something is not right here, but just cant find it out.
    Please help.

  • Blank Row in table control

    Hi,
      Could anybody tell me how to add a n  number of blank lines to the table control UI element on some event. I have tried with the method CREATE_ELEMENT but its clearing the table control.
    I have two nodes called   "lines" and "table".  "Lines" node contains attribute "Count". and this attribute is binded to inputfiled "INP".
    When i click on button , based on inputfield value (INP)  that many blank rows should get appended to the table control.
    Can anybody advice me how can i get this ?
    Can anybody send me the sample code of CREATE_METHOD if its correct approach.
    Thanks and Regards
    Sireesha.

    Hi Saurav,
       Thanks a lot for your reply.  I am very Sorry to miss one point in my first thread. With the CREATE_ELEMENT its adding the blank rows to the table control but its adding in the second page. I thought its clearing the table control entries but in fact the blank rows are getting added in the second page.
    My doubt is how to add blank rows only in the first page.  I have unchecked the "footerVisible" property for the table control. so when i add rows to the table i cannt see the new rows.
    How to add blank rows only in the first page...?
    Thanks for your help.
    Regards
    Sireesha.

  • Table controls

    hi friends i created a table control .but its giving syntax error like this .
    The field "AGE" is not assigned to a loop. "LOOP ... ENDLOOP" must
    appear in "PBO" and "PAI".          
    please help me.
    please look at this code .
    tables : zpr_table.
    data : begin of itab occurs 0.
    include structure zpr_table.
    data :  end of itab.
    data : itab1 like itab.
    module USER_COMMAND_0100 input.
    TYPE-POOLS:cxtab.
    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.
      DATA p_tc_name1   TYPE dynfnam.
      FIELD-SYMBOLS: <tc>         TYPE cxtab_control.
      FIELD-SYMBOLS <table>              TYPE STANDARD TABLE.
      FIELD-SYMBOLS <lines>              TYPE i.
    loop at itab.
    case sy-ucomm.
    when 'int'.
    set cursor field itab1-age line l_selline.
      GET CURSOR LINE l_selline.
      IF sy-subrc <> 0.                   " append line to table
        l_selline = <tc>-lines + 1.
        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.
      l_line = l_selline - <tc>-top_line + 1.
      INSERT INITIAL LINE INTO <table> INDEX l_selline.
      <tc>-lines = <tc>-lines + 1.
    endcase.
    endloop.
    endmodule.                 " USER_COMMAND_0100  INPUT

    Hi,
    please check out the sample program below it might help you to resolve your queries
    *& Report  Z01_TABCONTROL                                              *
    REPORT  Z01_TABCONTROL                                              .
    TABLES: SFLIGHT.
    controls: tab_control type tableview USING screen 100.
    DATA: ITAB TYPE TABLE OF SFLIGHT,
          WA TYPE SFLIGHT,
          CHK(1) VALUE 'X',
          OK_CODE TYPE SY-UCOMM.
          CALL SCREEN 100.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
    SET PF-STATUS 'HI'.
    SET TITLEBAR 'xxx'.
    IF CHK = 'X'.
    SELECT CARRID CONNID FLDATE PRICE CURRENCY SEATSMAX SEATSOCC FROM
    SFLIGHT INTO CORRESPONDING FIELDS OF TABLE ITAB.
    CHK = 'N'.
    ENDIF.
    DESCRIBE TABLE ITAB lines tab_control-lines.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  TRANSFER  OUTPUT
          text
    MODULE TRANSFER OUTPUT.
    MOVE-CORRESPONDING WA TO SFLIGHT.
    ENDMODULE.                 " TRANSFER  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
    CASE OK_CODE.
    WHEN 'BACK'.
    LEAVE PROGRAM.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Module  CHANGE  INPUT
          text
    MODULE CHANGE INPUT.
    MODIFY ITAB FROM SFLIGHT INDEX TAB_CONTROL-CURRENT_LINE.
    ENDMODULE.                 " CHANGE  INPUT
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0100.
    LOOP AT ITAB INTO WA WITH CONTROL TAB_CONTROL.
    MODULE TRANSFER.
    ENDLOOP.
    PROCESS AFTER INPUT.
    LOOP AT ITAB.
    MODULE CHANGE.
    ENDLOOP.
    MODULE USER_COMMAND_0100.
    ********please reward points if the information is helpful to you*******

  • Table control modify

    Hi all,
    I have a question ie i have a treeview and if select a node the corresponding data for that node shd be placed in the table control.so iam fine with the creation, but in case of modification iam able to display the previous data but if i want to add another node from the tree view to the table control it's not getting the new value.
    PBO
    loop at   g_CNT_TAB_FLDS_itab
           into g_CNT_TAB_FLDS_wa
           with control CNT_TAB_FLDS
           cursor CNT_TAB_FLDS-current_line.
    module CNT_TAB_FLDS_move.
      endloop.
    PAI
    loop at g_CNT_TAB_FLDS_itab .
        chain.
          field ZGNX_FIELDS-TAB_NAME.
          field ZGNX_FIELDS-FLD_NAME.
        endchain.
      endloop.
    MODULE USER_COMMAND_1002.
    module CNT_TAB_FLDS_move output.
       move-corresponding g_CNT_TAB_FLDS_wa to ZGNX_FIELDS.
       ZGNX_FIELDS-DD04T-DDTEXT = g_CNT_TAB_FLDS_wa-ddtext.
    endmodule.
    MODULE USER_COMMAND_1002 INPUT.
      case ok_code.
        when 'TAB_FLD_ADD'.
           perform move_fields.
         when 'DEL_FLD'.
          perform remove_field_data.
      endcase.
    ENDMODULE.                 " USER_COMMAND_1002  INPUT
    FORM move_fields .
    data temp_node_key type TV_NODEKEY.
    DATA: node_key_table TYPE treev_nks.
    DATA: node_key_wa type treev_nks with header line .
      CALL METHOD G_TREE->GET_SELECTED_NODES
        changing
         NODE_KEY_TABLE               = node_key_table
        EXCEPTIONS
         CNTL_SYSTEM_ERROR            = 1
         DP_ERROR                     = 2
         FAILED                       = 3
         MULTIPLE_NODE_SELECTION_ONLY = 4
          others                       = 5
      IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    refresh gl_node_key_table.
    gl_node_key_table[] = node_key_table[].
    *read table itab_fld with key key = node_key_table.
    loop at node_key_table into node_key_wa.
      read table itab_fld with key key = node_key_wa.
      g_CNT_TAB_FLDS_wa-tab_name = itab_fld-tab_name.
      g_CNT_TAB_FLDS_wa-fld_name = itab_fld-fld_name.
      g_cnt_tab_flds_wa-fld_order = sy-tabix.
      g_cnt_tab_flds_wa-ddtext = itab_fld-ddtext.
      append g_CNT_TAB_FLDS_wa to g_CNT_TAB_FLDS_itab.
    endloop.
      SORT g_CNT_TAB_FLDS_itab.
    CALL METHOD G_TREE->SELECT_NODES
        exporting
         NODE_KEY_TABLE               = node_key_table
        exceptions
          others = 5.
    *if sy-subrc = 0.
    *endif.
    ENDFORM.                    " move_fields
    following is the code i was using.
    can anybody help me.

    Hi,
    Yes, this is because when the values are modified, those are not reflected in the internal table. The internal table has the old values.
    When User modifies the values, and clicks on a button to reflect those values in table control, REFRESH the data, before adding it to table control.
    Include this logic here.
    MODULE USER_COMMAND_1002 INPUT.
    case ok_code.
    when 'TAB_FLD_ADD'.
    <b>
    REFERSH</b> <u><b>The class which you are using will also have a REFRESH method. Please use that method here.</b></u>
    perform move_fields.
    when 'DEL_FLD'.
    perform remove_field_data.
    endcase.
    ENDMODULE. " USER_COMMAND_1002 INPUT
    Best regards,
    Prashant

  • Dropdown list in infotype table control

    Hello,
    I am creating a custom HR infotype with dropdown list field. This field holds a key but displays a text from text table. Dropdowns contents are dependant on Start Date of the infotype record and I am using PBO module to fetch this data. Everything works fine except one detail. Infotype has automatically generated overview table control, which holds various data including Start Date of infotype record and the dropdown field in question. And even that would work well if not for the date, in case when I drop the date check dropdowns in all rows get populated. Currently it seems to only use the date on the last row of the table control and subsequently fails to correctly populate dropdowns in all other rows. With no access to SAP code which populates table control, how do I get the date for each individual row?
    Best regards, Armins

    Hi Marty,
    For this you have to create 2 nodes
    1. A node which will be bound to the table. This will  be a singleton node.
    2. A node for dropdown. This node should be inside the table node and should be a non-singleton one.
    Check the singleton properties of both the nodes above.
    Whenever you will create an element for table node, an instance of the dropdown node will be automatically created.
    To set the value in this dropdown at leadselection, you can use the below logic
    1. Assume you know the value of the fruit to be set in the dropdown
    2. for(int i = 0; i < wdContext.nodeFruit().size(); i++)
              if( wdContext.currentTableNode().nodeFruit().getFruitElementAt(i).getFruit().equals(fruitName) )
                    wdContext.currentTableNode().nodeFruit().setLeadSelection(i);
                    break;
    Hope this helps you.

Maybe you are looking for