Table control urgent

I am calling  modal dialog screen(9002) from my normal screen(9001).
In the modal dialog i have container which iam using class TEXTEDIT_CUSTOM_CONTAINER for displaying long text.
My question's are,
1) In the normal screen i.e 9001 in user command i am using a button called text to call 9002.
I tried to change values  as below , i didnot noticed any difference in my out put.
call screen '9002' starting at 1  1
                    ending   at 111 5.
call screen '9002' starting at 7  30
                    ending   at 1 50.
2) my word wrap length is 80, iam able to see only 50 and to see the next 30 character i need to use horizontal scroll bar, which is ok.
But my requirement is i want to see all the 80 characters  without using horizontal scroll.
I thought of increasing the container width but the window size is limiting the container view.
so at max i can viewing 50 char per line without using horizontal bar.
if i reduce the container , i see less than 50 char per line then i have to use horizontal scroll to see remains char in the line.
i have to see 80 chars without using the horizontal scroll.
can anyone tell what the solution for this.
i THOUGHT OF THIS
1)Increasing the size of container in layout.
2) Incresing the values in call screen starting code.
3)Is there any thing that i can use just like we use
WORDWRAP_POSITION = '85' to limit the 85 char per line
Let me know.
SWATHI

For example, I have gotton this to work in my system, but changing the screen size to 82 columns, then making my control 82 wide.  Then here is my code.
report zrich_0001 .
data: text_container type ref to cl_gui_custom_container,
      text_editor    type ref to cl_gui_textedit.
<b>call screen 100 starting at 1 1
                ending at 80 20.</b>
*&      Module  STATUS_0100  OUTPUT
*       text
module STATUS_0100 output.
*  SET PF-STATUS 'xxxxxxxx'.
*  SET TITLEBAR 'xxx'.
create object text_container
       exporting
          container_name = 'TEXT_CONTAINER' .
CREATE OBJECT text_EDITOR
       EXPORTING
          PARENT = TEXT_CONTAINER
          <b>WORDWRAP_POSITION = '79'</b>
          WORDWRAP_MODE = CL_GUI_TEXTEDIT=>WORDWRAP_AT_FIXED_POSITION
          WORDWRAP_TO_LINEBREAK_MODE = CL_GUI_TEXTEDIT=>false.
endmodule.                 " STATUS_0100  OUTPUT
*&      Module  USER_COMMAND_0100  INPUT
*       text
module USER_COMMAND_0100 input.
leave program.
endmodule.                 " USER_COMMAND_0100  INPUT
Works good, 80 characters and no scroll bar.
Regards,
Rich Heilman

Similar Messages

  • Last_page button is not working in table control-urgent

    hi  all,
    iam displaying the data in table control.in my pf-status i have first_page,next_page,prev_page and last_page.out of 4 buttons 3 buttons are working finr except last_page. any body can send me the code for this program.iam sending my program below.
    REPORT ZMAHI_TABLE_CONTROL .
    TABLES : VBAK,VBAP.
    DATA : BEGIN OF ITAB OCCURS 0,
             VBELN TYPE VBAK-VBELN,
             ERDAT TYPE VBAK-ERDAT,
             ERNAM TYPE VBAK-ERNAM,
             ERZET TYPE VBAK-ERZET,
             REASON(40) TYPE C,
           END OF ITAB.
    DATA :   FILL TYPE I VALUE 1.
    DATA : N TYPE I .
    DATA      : BEGIN OF XVALUES OCCURS 50,
                  BUTXT LIKE  T001-BUTXT,
                END OF XVALUES.
    DATA      : BEGIN OF XFIELDS OCCURS 50.
            INCLUDE STRUCTURE HELP_VALUE.
    DATA      : END OF XFIELDS.
    DATA      : BEGIN OF SEL_VAL OCCURS 50.
            INCLUDE STRUCTURE HELP_VTAB.
    DATA      : END OF SEL_VAL.
    TABLE CONTROL DECLARATIONS------
    CONTROLS : CONTROL_DATA TYPE TABLEVIEW USING  SCREEN '100'.
    DATA : OK_CODE TYPE SY-UCOMM,
    LIN TYPE I,
    LIN1 TYPE I,
    LIN2 TYPE I,
    LIN3 TYPE I.
    DATA: LINES TYPE I,
          LIMIT TYPE I VALUE 1.
    DATA :   LINE_COUNT       TYPE  I,
             LINEI            TYPE  I,
             LINEJ            TYPE  I,
             LINE1            TYPE  I,
             LINE2            TYPE  I,
             LN1              TYPE  I.
    SELECTION-SCREEN : BEGIN OF BLOCK B1.
    SELECT-OPTIONS   : P_VBELN FOR VBAK-VBELN.
    SELECTION-SCREEN : END OF BLOCK B1.
    START-OF-SELECTION.
      SELECT VBELN
             ERDAT
             ERNAM
             ERZET
        FROM VBAK
        INTO TABLE ITAB
      WHERE VBELN IN P_VBELN.
      CALL SCREEN 100.
    *&      Module  F4_HELP  INPUT
    MODULE F4_HELP INPUT.
      FREE  :  XFIELDS,SEL_VAL,XVALUES.
      MOVE : 'ZMAHI'     TO XFIELDS-TABNAME,
             'REASON'    TO XFIELDS-FIELDNAME,
             'X'        TO XFIELDS-SELECTFLAG.
      APPEND XFIELDS.
      XVALUES = 'Non Trade F&F'.
      APPEND XVALUES .
      XVALUES = 'Non Trade Retention'.
      APPEND XVALUES .
      XVALUES = 'Oldbills Accnt cntmnt'.
      APPEND XVALUES .
      XVALUES = 'Non Trade Not claimed'.
      APPEND XVALUES .
      XVALUES = 'Non Trade Dispute'.
      APPEND XVALUES .
      XVALUES = 'Non Trade Payment Block'.
      APPEND XVALUES .
      XVALUES = 'N/T Subsntly Cleared'.
      APPEND XVALUES .
      XVALUES = 'N/T Unstld Advances'.
      APPEND XVALUES .
      XVALUES = 'N/T OThers'.
      APPEND XVALUES .
      XVALUES = 'Trade Non Receipt OF BOE'.
      APPEND XVALUES .
      XVALUES = 'Trade OEM Adjustments'.
      APPEND XVALUES .
      XVALUES = 'Trade Reject Of Material'.
      APPEND XVALUES .
      XVALUES = 'Trade NOt Claimed'.
      APPEND XVALUES .
      XVALUES = 'Trade Dispute'.
      APPEND XVALUES .
      XVALUES = 'Trade Payment BLock'.
      APPEND XVALUES .
      XVALUES = 'Trade Subsntly Cleared'.
      APPEND XVALUES .
      XVALUES = 'Trade Non Submission of bills'.
      APPEND XVALUES .
      XVALUES = 'Trade others'.
      APPEND XVALUES .
      CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE_EXT'
           EXPORTING
                CUCOL         = 0
                CUROW         = 0
                DISPLAY       = ' '
                FIELDNAME     = 'REASON'
                TABNAME       = 'ZIFIOD011'
           IMPORTING
                SELECT_VALUE  = ITAB-REASON
           TABLES
                FIELDS        = XFIELDS
                SELECT_VALUES = SEL_VAL
                VALUETAB      = XVALUES.
    ENDMODULE.                 " F4_HELP  INPUT
    *&      Module  STATUS_0100  OUTPUT
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS '0100'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    MODULE USER_COMMAND_0100 INPUT.
      CASE SY-UCOMM.
        WHEN 'CANCEL' OR 'EXIT' OR 'BACK'.
          LEAVE TO SCREEN 0.
       WHEN 'NEXT_LINE'.
         CONTROL_DATA-top_line = CONTROL_DATA-top_line + 1.
         limit = fill - lines + 1.
         IF CONTROL_DATA-top_line > limit.
           CONTROL_DATA-top_line = limit.
         ENDIF.
       WHEN 'PREV_LINE'.
         CONTROL_DATA-top_line = CONTROL_DATA-top_line - 1.
         IF CONTROL_DATA-top_line < 0.
           CONTROL_DATA-top_line = 0.
         ENDIF.
        WHEN 'NEXT_PAGE'.
          CONTROL_DATA-TOP_LINE = CONTROL_DATA-TOP_LINE + LINES.
          LIMIT = LIMIT + 1.
          CONTROL_DATA-TOP_LINE = LIMIT.
        WHEN 'PREV_PAGE'.
          CONTROL_DATA-TOP_LINE = CONTROL_DATA-TOP_LINE - LINES.
          LIMIT = LIMIT - 1.
          CONTROL_DATA-TOP_LINE = LIMIT.
       WHEN 'LAST_PAGE'.
         CONTROL_DATA-TOP_LINE =  FILL - LINES + 1.
        WHEN 'FIRST_PAGE'.
          CONTROL_DATA-TOP_LINE = 0.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Module  SCROLL_BAR  INPUT
    MODULE SCROLL_BAR INPUT.
      DESCRIBE  TABLE  ITAB  LINES  CONTROL_DATA-LINES.
    ENDMODULE.                 " SCROLL_BAR  INPUT
    thanks,
    maheedhar.T

    Hi Ravi,
    The code which u sent to me is not working for next page and previous page.
    can u plz resend me the code.
    iam sending my code below.
    REPORT ZMAHI_TABLE_CONTROL .
    TABLES : VBAK,VBAP.
    DATA : BEGIN OF ITAB OCCURS 0,
             VBELN TYPE VBAK-VBELN,
             ERDAT TYPE VBAK-ERDAT,
             ERNAM TYPE VBAK-ERNAM,
             ERZET TYPE VBAK-ERZET,
             REASON(40) TYPE C,
           END OF ITAB.
    DATA :   FILL TYPE I VALUE 1.
    DATA : N TYPE I .
    DATA      : BEGIN OF XVALUES OCCURS 50,
                  BUTXT LIKE  T001-BUTXT,
                END OF XVALUES.
    DATA      : BEGIN OF XFIELDS OCCURS 50.
            INCLUDE STRUCTURE HELP_VALUE.
    DATA      : END OF XFIELDS.
    DATA      : BEGIN OF SEL_VAL OCCURS 50.
            INCLUDE STRUCTURE HELP_VTAB.
    DATA      : END OF SEL_VAL.
    TABLE CONTROL DECLARATIONS------
    CONTROLS : CONTROL_DATA TYPE TABLEVIEW USING  SCREEN '100'.
    DATA : OK_CODE TYPE SY-UCOMM,
    LIN TYPE I,
    LIN1 TYPE I,
    LIN2 TYPE I,
    LIN3 TYPE I.
    DATA: LINES TYPE I,
          LIMIT TYPE I VALUE 1.
    DATA :   LINE_COUNT       TYPE  I,
             LINEI            TYPE  I,
             LINEJ            TYPE  I,
             LINE1            TYPE  I,
             LINE2            TYPE  I,
             LN1              TYPE  I.
    SELECTION-SCREEN : BEGIN OF BLOCK B1.
    SELECT-OPTIONS   : P_VBELN FOR VBAK-VBELN.
    SELECTION-SCREEN : END OF BLOCK B1.
    START-OF-SELECTION.
      SELECT VBELN
             ERDAT
             ERNAM
             ERZET
        FROM VBAK
        INTO TABLE ITAB
      WHERE VBELN IN P_VBELN.
      CALL SCREEN 100.
    *&      Module  F4_HELP  INPUT
    MODULE F4_HELP INPUT.
      FREE  :  XFIELDS,SEL_VAL,XVALUES.
      MOVE : 'ZMAHI'     TO XFIELDS-TABNAME,
             'REASON'    TO XFIELDS-FIELDNAME,
             'X'        TO XFIELDS-SELECTFLAG.
      APPEND XFIELDS.
      XVALUES = 'Non Trade F&F'.
      APPEND XVALUES .
      XVALUES = 'Non Trade Retention'.
      APPEND XVALUES .
      XVALUES = 'Oldbills Accnt cntmnt'.
      APPEND XVALUES .
      XVALUES = 'Non Trade Not claimed'.
      APPEND XVALUES .
      XVALUES = 'Non Trade Dispute'.
      APPEND XVALUES .
      XVALUES = 'Non Trade Payment Block'.
      APPEND XVALUES .
      XVALUES = 'N/T Subsntly Cleared'.
      APPEND XVALUES .
      XVALUES = 'N/T Unstld Advances'.
      APPEND XVALUES .
      XVALUES = 'N/T OThers'.
      APPEND XVALUES .
      XVALUES = 'Trade Non Receipt OF BOE'.
      APPEND XVALUES .
      XVALUES = 'Trade OEM Adjustments'.
      APPEND XVALUES .
      XVALUES = 'Trade Reject Of Material'.
      APPEND XVALUES .
      XVALUES = 'Trade NOt Claimed'.
      APPEND XVALUES .
      XVALUES = 'Trade Dispute'.
      APPEND XVALUES .
      XVALUES = 'Trade Payment BLock'.
      APPEND XVALUES .
      XVALUES = 'Trade Subsntly Cleared'.
      APPEND XVALUES .
      XVALUES = 'Trade Non Submission of bills'.
      APPEND XVALUES .
      XVALUES = 'Trade others'.
      APPEND XVALUES .
      CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE_EXT'
           EXPORTING
                CUCOL         = 0
                CUROW         = 0
                DISPLAY       = ' '
                FIELDNAME     = 'REASON'
                TABNAME       = 'ZIFIOD011'
           IMPORTING
                SELECT_VALUE  = ITAB-REASON
           TABLES
                FIELDS        = XFIELDS
                SELECT_VALUES = SEL_VAL
                VALUETAB      = XVALUES.
    ENDMODULE.                 " F4_HELP  INPUT
    *&      Module  STATUS_0100  OUTPUT
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS '0100'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    MODULE USER_COMMAND_0100 INPUT.
      CASE SY-UCOMM.
        WHEN 'CANCEL' OR 'EXIT' OR 'BACK'.
          LEAVE TO SCREEN 0.
       WHEN 'NEXT_LINE'.
         CONTROL_DATA-top_line = CONTROL_DATA-top_line + 1.
         limit = fill - lines + 1.
         IF CONTROL_DATA-top_line > limit.
           CONTROL_DATA-top_line = limit.
         ENDIF.
       WHEN 'PREV_LINE'.
         CONTROL_DATA-top_line = CONTROL_DATA-top_line - 1.
         IF CONTROL_DATA-top_line < 0.
           CONTROL_DATA-top_line = 0.
         ENDIF.
       WHEN 'NEXT_PAGE'.
         CONTROL_DATA-TOP_LINE = CONTROL_DATA-TOP_LINE + LINES.
         LIMIT = LIMIT + 1.
         CONTROL_DATA-TOP_LINE = LIMIT.
       WHEN 'PREV_PAGE'.
         CONTROL_DATA-TOP_LINE = CONTROL_DATA-TOP_LINE - LINES.
         LIMIT = LIMIT - 1.
         CONTROL_DATA-TOP_LINE = LIMIT.
       WHEN 'LAST_PAGE'.
         DESCRIBE TABLE ITAB LINES LIMIT.
         CONTROL_DATA-TOP_LINE =  LIMIT.
       WHEN 'FIRST_PAGE'.
         CONTROL_DATA-TOP_LINE = 0.
    WHEN 'P--'.
    CLEAR ok_code.
    PERFORM paging USING 'P--'.
    WHEN 'P-'.
    CLEAR ok_code.
    PERFORM paging USING 'P-'.
    WHEN 'P+'.
    CLEAR ok_code.
    PERFORM paging USING 'P+'.
    WHEN 'P++'.
    CLEAR ok_code.
    PERFORM paging USING 'P++'.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Module  SCROLL_BAR  INPUT
    MODULE SCROLL_BAR INPUT.
      DESCRIBE  TABLE  ITAB  LINES  CONTROL_DATA-LINES.
    ENDMODULE.                 " SCROLL_BAR  INPUT
    *&      Form  paging
          text
         -->P_0356   text
    *FORM paging USING    VALUE(P_0356).
    FORM paging USING code.
    DATA: i TYPE i,
    j TYPE i.
    CASE code.
    WHEN 'P--'.
    CONTROL_DATA-top_line = 1.
    WHEN 'P-'.
    CONTROL_DATA-top_line = CONTROL_DATA-top_line - line_count.
    IF CONTROL_DATA-top_line LE 0.
    CONTROL_DATA-top_line = 1.
    ENDIF.
    WHEN 'P+'.
    i = CONTROL_DATA-top_line + line_count.
    j = CONTROL_DATA-lines - line_count + 1.
    IF j LE 0. j = 1. ENDIF.
    IF i LE j.
    CONTROL_DATA-top_line = i.
    ELSE.
    CONTROL_DATA-top_line = j.
    ENDIF.
    WHEN 'P++'.
    CONTROL_DATA-top_line = CONTROL_DATA-lines - line_count + 1.
    IF CONTROL_DATA-top_line LE 0.
    CONTROL_DATA-top_line = 1.
    ENDIF.
    ENDCASE.
    ENDFORM. " PAGING
    *ENDFORM.                    " paging
    thanks,
    maheedhar.t

  • Reg Table Control ---- URGENT

    HI to ALL,
    i have a table control with some fields.On that,
    if Form type = F, then program allows user to enter vendor code in vendor field.
    if form type = E, then program  didnt allow users to enter vendor in vendor field.
    How will i do it for that vendor field???? for form type = E, the vendor field doesnt allow input
    i tried in PBO.but it doesnt works fine.

    Why you say you tried PBO what did you try in that event.
    You need to use the logic of LOOP AT SCREEN.........

  • Hi All, How we can handle a table control in bdc - in detail its urgent pls

    Hi All, How we can handle a table control in bdc - in detail its urgent. Please send me the explanation in detail.
    Thanks&regards.
    Bharat

    hi,
    Create Table Control
    • Step 1 (Create new structure for table control)
    Type is name of structure (ZTC_EKKO) and press create
    • Step 2 (Create Program)
    Goto transaction SE80(Object Navigator) -> Repository Browser -> Program.
    Enter your program name, please ensure that is begins with SAPMZ…… as this is a module pool (dialog program).
    Press enter to create, and press yes!
    Ensure that you create a top include, and press Enter.
    Accept the name created for the top include.
    Press Enter.
    Press Save
    • Step 3 (Create TOP include)
    Double click on the top include and enter following ABAP code:
    Tables: ZTC_EKKO.
    controls: tc100 type tableview using screen 100.
    data: ok_code type sy-ucomm.
    data: it_ekko type standard
    table of ZTC_EKKO initial size 0,
    wa_ekko type ZTC_EKKO.
    data: ok_code type sy-ucomm.
    Press Save and Activate
    • Step 4 (Create screen)
    Right click the program to create a screen 100 for the dialog. Enter Short description, set screen type to Normal and enter 0 or blank into Next screen. Then move to Element List tab and enter the OK code as OK_CODE (i.e. the same as what you declared in the top include with data: ok_code type sy-ucomm).
    • Step 5 (Create table control)
    Press the Layout button to bring up the screen painter editor.
    Press table control button and drag it on to the screen, enter the name of table control created in TOP include (TC100). Now press the yellow button for attributes and set the table control as below options
    • Step 6 (Populate table control )
    Press the orange button (Fields). On the next screen enter ZTC_EKKO and press the ‘Get from Dict’ button. Select the fields you want (all) and press enter. Now drag them onto your Table Control.
    Below is the result, there will been syntax errors if we check now! So Save and go back into the flow logic tab.
    • Step 7 (Create flow control )
    Within the flow logic of screen 100 and create two modules, one to select the data from the database and the other to move the selected fields into the table control. Also insert the two loop statements to populate and retrieve the lines of the table control.
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0100.
    module data_retrieval.
    loop at it_ekko into wa_ekko with control TC100.
    module populate_screen.
    endloop.
    PROCESS AFTER INPUT.
    loop at it_ekko.
    endloop.
    MODULE USER_COMMAND_0100.
    Double click the module data_retrieval to create and click yes to get past the popup. Ensure that a new include is created to hold all the PBO modules (default). Press enter.
    Select 10 rows of data from the EKKO table and load into the internal table it_ekko. Go back to the flow logic to load this data into the Table Control.
    check this one
    REPORT ZCALL_TRANS_TAB1 .
    TABLES: LFA1,LFBK,lfb1.
    data: BEGIN OF it_vendor occurs 0,
    LIFNR LIKE LFA1-LIFNR,
    bukrs like lfb1-bukrs,
    END OF it_vendor.
    DATA: BEGIN OF IT_BANK occurs 0,
    LIFNR LIKE LFA1-LIFNR,
    BANKS LIKE LFBK-BANKS,
    BANKL LIKE LFBK-BANKL,
    BANKN LIKE LFBK-BANKN,
    koinh like lfbk-koinh,
    END OF IT_BANK.
    data: it_bdcdata like bdcdata occurs 0 with header line.
    data: it_messages like bdcmsgcoll occurs 0 with header line.
    *selection screen.
    selection-screen: begin of block b1 with frame.
    parameters: p_file like rlgrap-filename default 'c:/vendor.txt'
    obligatory.
    parameters: p_file1 like rlgrap-filename default 'c:/xyz.txt'
    obligatory.
    selection-screen: end of block b1.
    *at selection screen.
    at selection-screen on value-request for p_file.
    perform f4_help using p_file.
    at selection-screen on value-request for p_file1.
    perform f4_help1 using p_file1.
    *start of selection
    start-of-selection.
    *******uploading file
    perform upload_file using p_file P_FILE1.
    ******open session.
    perform populate_data.
    *& Form f4_help
    form f4_help using p_p_file.
    data: l_file type ibipparms-path.
    call function 'F4_FILENAME'
    importing
    file_name = l_file.
    p_file = l_file.
    endform. " f4_help
    *& Form POPULATE_DATA
    form populate_data .
    DATA: L_STRING TYPE STRing.
    DATA: L_COUNTER(2) TYPE n.
    loop at it_vendor.
    perform bdc_dynpro using 'SAPMF02K' '0106'.
    perform bdc_field using 'BDC_CURSOR'
    'RF02K-D0130'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'RF02K-LIFNR'
    it_vendor-lifnr.
    perform bdc_field using 'RF02K-BUKRS'
    it_vendor-bukrs.
    perform bdc_field using 'RF02K-D0130'
    'X'.
    perform bdc_dynpro using 'SAPMF02K' '0130'.
    perform bdc_field using 'BDC_CURSOR'
    'LFBK-bankn(03)'.
    perform bdc_field using 'BDC_OKCODE'
    '=UPDA'.
    *********bank details
    CLEAR l_COUNTER.
    LOOP AT IT_BANK WHERE LIFNR = IT_VENDOR-LIFNR.
    l_COUNTER = l_COUNTER + 1.
    clear l_string.
    CONCATENATE 'lfbk-banks(' l_counter ')' into l_string.
    perform bdc_field using l_string
    it_bank-banks.
    clear l_string.
    CONCATENATE 'lfbk-bankl(' l_counter ')' into l_string.
    perform bdc_field using l_string
    it_bank-bankl.
    clear l_string.
    CONCATENATE 'lfbk-bankn(' l_counter ')' into l_string.
    perform bdc_field using l_string
    it_bank-bankn.
    endloop.
    ******CALL TRANSACTION.
    call transaction 'FK02' using it_bdcdata mode 'A'
    messages into it_messages.
    write:/ sy-subrc.
    perform format_messages.
    clear it_bdcdata.
    refresh it_bdcdata.
    endloop.
    endform. " POPULATE_DATA
    *& Form FORMAT_MESSAGES
    form format_messages .
    data: l_msg(100).
    loop at it_messages.
    call function 'FORMAT_MESSAGE'
    exporting
    id = it_messages-msgid
    lang = sy-langu
    no = it_messages-msgnr
    v1 = it_messages-msgv1
    v2 = it_messages-msgv2
    v3 = it_messages-msgv3
    v4 = it_messages-msgv4
    importing
    msg = l_msg
    exceptions
    not_found = 1
    others = 2
    write:/ l_msg.
    endloop.
    endform. " FORMAT_MESSAGES
    *& Form bdc_dynpro
    form bdc_dynpro using value(p_program)
    value(p_screen).
    it_bdcdata-program = p_program.
    it_bdcdata-dynpro = p_screen.
    it_bdcdata-dynbegin = 'X'.
    append it_bdcdata.
    clear it_bdcdata.
    endform. " bdc_dynpro
    *& Form bdc_field
    form bdc_field using value(p_fnam)
    value(p_fval).
    it_bdcdata-fnam = p_fnam.
    it_bdcdata-fval = p_fval.
    append it_bdcdata.
    clear it_bdcdata.
    endform. " bdc_field
    *& Form upload_file
    form upload_file using p_p_file
    p_p_file1.
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
    CODEPAGE = ' '
    FILENAME = P_P_FILE
    FILETYPE = 'DAT'
    HEADLEN = ' '
    LINE_EXIT = ' '
    TRUNCLEN = ' '
    USER_FORM = ' '
    USER_PROG = ' '
    DAT_D_FORMAT = ' '
    IMPORTING
    FILELENGTH =
    TABLES
    data_tab = IT_VENDOR
    EXCEPTIONS
    CONVERSION_ERROR = 1
    FILE_OPEN_ERROR = 2
    FILE_READ_ERROR = 3
    INVALID_TYPE = 4
    NO_BATCH = 5
    UNKNOWN_ERROR = 6
    INVALID_TABLE_WIDTH = 7
    GUI_REFUSE_FILETRANSFER = 8
    CUSTOMER_ERROR = 9
    NO_AUTHORITY = 10
    OTHERS = 11
    IF sy-subrc <> 0.
    MESSAGE I000(ZZ) WITH 'UNABLE TO UPLOAD'.
    STOP.
    ENDIF.
    *******UPLOADING BANK DETAILS
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
    CODEPAGE = ' '
    FILENAME = P_P_FILE1
    FILETYPE = 'DAT'
    HEADLEN = ' '
    LINE_EXIT = ' '
    TRUNCLEN = ' '
    USER_FORM = ' '
    USER_PROG = ' '
    DAT_D_FORMAT = ' '
    IMPORTING
    FILELENGTH =
    TABLES
    data_tab = IT_BANK
    EXCEPTIONS
    CONVERSION_ERROR = 1
    FILE_OPEN_ERROR = 2
    FILE_READ_ERROR = 3
    INVALID_TYPE = 4
    NO_BATCH = 5
    UNKNOWN_ERROR = 6
    INVALID_TABLE_WIDTH = 7
    GUI_REFUSE_FILETRANSFER = 8
    CUSTOMER_ERROR = 9
    NO_AUTHORITY = 10
    OTHERS = 11
    IF sy-subrc <> 0.
    MESSAGE I000(ZZ) WITH 'UNABLE TO UPLOAD'.
    STOP.
    ENDIF.
    endform. " upload_file
    *& Form f4_help1
    -->P_P_FILE1 text
    form f4_help1 using p_p_file1.
    data:l_file1 type ibipparms-path.
    CALL FUNCTION 'F4_FILENAME'
    IMPORTING
    FILE_NAME = l_file1.
    p_file1 = l_file1.
    endform. " f4_help1
    http://sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    Regards,
    Sankar

  • Table control...? its urgent

    Hi friends,
    Can anyone gve me example table control program..
    My requirement is I have to display blank table control.....but when user enetrs value.. and submits it should be added to the inetrnal table in my program please help......
    Also if he wants to see the records in table control..which he enetered earlier the table should be displayed as populated..
    Please help its urgent....points will be rewarded....

    Seet he following ex:
    Created table control using wizard.
    *& Module pool       ZTEST_TBLCTRL
    PROGRAM  ZTEST_TBLCTRL.
    ***&SPWIZARD: DATA DECLARATION FOR TABLECONTROL 'TC1'
    *&SPWIZARD: DEFINITION OF DDIC-TABLE
    TABLES:   ZFG_SRNO, ZFIH0004.
    *&SPWIZARD: TYPE FOR THE DATA OF TABLECONTROL 'TC1'
    *TYPES: BEGIN OF T_TC1,
            ZSRNO LIKE ZFG_SRNO-ZSRNO,
            SCRNAME LIKE ZFIH0004-SCRNAME,
          END OF T_TC1.
    *TYPES: BEGIN OF T_TC1.
    STRUCTURE ZFG_SRNO.
          END OF T_TC1.
    *&SPWIZARD: INTERNAL TABLE FOR TABLECONTROL 'TC1'
    *DATA:     G_TC1_ITAB   TYPE T_TC1 OCCURS 0 WITH HEADER LINE,
             G_TC1_WA     TYPE T_TC1. "work area
    DATA:     G_TC1_ITAB   LIKE ZFG_SRNO OCCURS 0 WITH HEADER LINE,
              G_TC1_WA     LIKE G_TC1_ITAB. "work area
    DATA:     G_TC1_COPIED.           "copy flag
    *&SPWIZARD: DECLARATION OF TABLECONTROL 'TC1' ITSELF
    CONTROLS: TC1 TYPE TABLEVIEW USING SCREEN 0100.
    *&SPWIZARD: LINES OF TABLECONTROL 'TC1'
    DATA:     G_TC1_LINES  LIKE SY-LOOPC.
    DATA:     OK_CODE LIKE SY-UCOMM,
              S_CODE LIKE SY-UCOMM,
              MARK.
    DATA: T1(10).
    *&SPWIZARD: OUTPUT MODULE FOR TC 'TC1'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: COPY DDIC-TABLE TO ITAB
    MODULE TC1_INIT OUTPUT.
    IF G_TC1_COPIED IS INITIAL.
    *&SPWIZARD: COPY DDIC-TABLE 'ZFG_SRNO'
    *&SPWIZARD: INTO INTERNAL TABLE 'g_TC1_itab'
       SELECT * FROM ZFG_SRNO
          INTO CORRESPONDING FIELDS
          OF TABLE G_TC1_ITAB.
       G_TC1_COPIED = 'X'.
       REFRESH CONTROL 'TC1' FROM SCREEN '0100'.
    IF T1 <> SPACE.
    G_TC1_ITAB-ZSRNO = T1.
    CLEAR T1.
    APPEND G_TC1_ITAB.
        REFRESH CONTROL 'TC1' FROM SCREEN '0100'.
    ENDIF.
    *TC1-TOP_LINE = 1.
    ENDIF.
    ENDMODULE.
    *&SPWIZARD: OUTPUT MODULE FOR TC 'TC1'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: MOVE ITAB TO DYNPRO
    MODULE TC1_MOVE OUTPUT.
      MOVE-CORRESPONDING G_TC1_WA TO ZFG_SRNO.
           if sy-subrc ne 0.
    *append G_TC1_WA to G_TC1_ITAB.
    *endif.
    READ TABLE G_TC1_ITAB INDEX TC1-CURRENT_LINE.
    IF SY-SUBRC = 0.
        G_TC1_WA-ZSRNO = G_TC1_ITAB-ZSRNO.
    ENDIF.
    MOVE-CORRESPONDING G_TC1_ITAB TO ZFG_SRNO.
    REFRESH CONTROL 'TC1' FROM SCREEN '8001'.
      tc1-lines = G_TC1_LINES + 100.
    ENDMODULE.
    *&SPWIZARD: OUTPUT MODULE FOR TC 'TC1'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: GET LINES OF TABLECONTROL
    MODULE TC1_GET_LINES OUTPUT.
      G_TC1_LINES = SY-LOOPC.
    ENDMODULE.
    *&SPWIZARD: INPUT MODULE FOR TC 'TC1'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: MODIFY TABLE
    MODULE TC1_MODIFY INPUT.
    *break-point.
    MOVE-CORRESPONDING ZFG_SRNO TO  G_TC1_ITAB.
    MODIFY G_TC1_ITAB INDEX TC1-CURRENT_LINE.
    G_TC1_COPIED = 'X'.
    REFRESH CONTROL 'TC1' FROM SCREEN '8001'.
      MOVE-CORRESPONDING ZFG_SRNO TO G_TC1_WA.
      MODIFY G_TC1_ITAB
        FROM G_TC1_WA
        INDEX TC1-CURRENT_LINE.
          G_TC1_COPIED = 'X'.
          if sy-subrc ne 0.
    append G_TC1_WA to G_TC1_ITAB.
    endif.
    *modify G_TC1_ITAB INDEX TC1-CURRENT_LINE.
    ENDMODULE.
    *&SPWIZARD: INPUT MODULE FOR TC 'TC1'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: PROCESS USER COMMAND
    MODULE TC1_USER_COMMAND INPUT.
      OK_CODE = SY-UCOMM.
      PERFORM USER_OK_TC USING    'TC1'
                                  'G_TC1_ITAB'
                                  'FLAG'
                         CHANGING OK_CODE.
      SY-UCOMM = OK_CODE.
    ENDMODULE.
      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  D20XX_INIT  OUTPUT
          text
    MODULE D20XX_INIT OUTPUT.
    *if screen-name = 'ZSRNO'.
           SCREEN-INPUT = 0.
           SCREEN-COLOR = 0.
           MODIFY SCREEN.
         endif.
    ENDMODULE.                 " D20XX_INIT  OUTPUT
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    *CLEAR R1_REF.
    DO 30 TIMES.
       APPEND G_TC1_ITAB.
    ENDDO.
      DESCRIBE TABLE G_TC1_ITAB LINES TC1-LINES.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  TAB1_INIT  OUTPUT
          text
    MODULE TAB1_INIT OUTPUT.
    ENDMODULE.                 " TAB1_INIT  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Module  MESSAGE  INPUT
          text
    MODULE MESSAGE INPUT.
    OK_CODE = SY-UCOMM.
    S_CODE = OK_CODE.
    CLEAR OK_CODE.
    if S_CODE = 'DELE'.
    loop at G_TC1_ITAB.
    if G_TC1_ITAB-scrname = 'X'.
    delete g_tc1_itab.
    endif.
    endloop.
    ELSEIF S_CODE = 'SAVE'.
    G_TC1_WA-ZSRNO = T1.
    MOVE-CORRESPONDING  G_TC1_WA TO ZFG_SRNO.
      REFRESH CONTROL 'TC1' FROM SCREEN '0100'.
    ENDIF.
    ENDMODULE.                 " MESSAGE  INPUT
    *&      Module  DELETE_RECORD  INPUT
          text
    MODULE DELETE_RECORD INPUT.
      IF MARK = 'X' AND S_CODE = 'DELE'.
        DELETE TABLE G_TC1_ITAB FROM ZFG_SRNO.
        DESCRIBE TABLE G_TC1_ITAB LINES TC1-LINES.
      ENDIF.
    ENDMODULE.                 " DELETE_RECORD  INPUT
    *********************Screen modules*********************
    PROCESS BEFORE OUTPUT.
    *&SPWIZARD: PBO FLOW LOGIC FOR TABLECONTROL 'TC1'
      MODULE TC1_INIT.
    *&SPWIZARD: MODULE TC1_CHANGE_TC_ATTR.
    *&SPWIZARD: MODULE TC1_CHANGE_COL_ATTR.
      LOOP AT   G_TC1_ITAB
           INTO G_TC1_WA
           WITH CONTROL TC1
           CURSOR TC1-CURRENT_LINE.
    *&SPWIZARD:   MODULE TC1_CHANGE_FIELD_ATTR
        MODULE TC1_MOVE.
       MODULE TAB1_INIT.
       MODULE TC1_GET_LINES.
      ENDLOOP.
    MODULE D20XX_INIT.
    MODULE STATUS_0100.
    PROCESS AFTER INPUT.
    *&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'TC1'
    *BREAK POINT.
      LOOP AT G_TC1_ITAB.
        CHAIN.
          FIELD ZFG_SRNO-ZSRNO.
          MODULE TC1_MODIFY ON CHAIN-REQUEST.
         MODULE TC1_MODIFY.
        ENDCHAIN.
          MODULE MESSAGE .
        MODULE DELETE_RECORD.
      ENDLOOP.
      MODULE TC1_USER_COMMAND.
    *&SPWIZARD: MODULE TC1_CHANGE_TC_ATTR.
    *&SPWIZARD: MODULE TC1_CHANGE_COL_ATTR.
    MODULE USER_COMMAND_0100.

  • Urgent: Table control validation of defaulted values

    Hi All,
    I have 5 fields in my table control. I have provided a button on the screen, if the user clicks that button, one of the fields( checkbox) is set as 'X'.
    Now , I want to validate the value in this field.
    The issue I have is that it is not going into the CHAIN ENCHAIN module logic to do the validation, if the value is updated through the button, but it performs validation if I update the field manually.
    Please advice.
    Thanks.
    K K

    Try this in the PAI process of screen:
    LOOP AT itab.
        CHAIN.
            FIELD: ...
            MODULE CHECK_MODIFIED ON CHAIN-INPUT.
        ENDCHAIN.                                           
    ENDLOOP.
    Oherwise,you can add the check logic into the flow logic of the button,if the value is not valid,block it.
    Edited by: Liang Zhang on May 28, 2008 4:34 AM

  • Urgent!!!!Add a Horizontal Scroll Bar for Table Control

    Hi Experts,
    I want to have a Horizontal Scroll Bar on my Table control.
    I tried with few properties for the Table UI Element but not able to solve it.
    If any one who had already done this please help me out.
    Thanks in advance..
    Regards, Kishore K

    HI Koen,
    Thanks for early Reply.
    When I use this I get
    Page Down ( ->!!, Arrown with lines pointing Down)
    Page UP
    Page Top    ( ->, Arrown with lines pointing Top)
    Page Down ( ->, Arrown with lines pointing Down)
    But I need only Page top and Page down for this Table UI .
    I think my question is clear enough.
    Please let me know this also.
    Thanks & Regards,
    Kishore K

  • Urgent!!!!!  Inserting data in table control of infotype.

    Hi Experts,
    I want to insert data in custom infotype.I am using FM HR_INFOTYPE_OPERATION for this purpose.But custom infotype contains a table control.
    Table control of infotype has 20 rows containing  fields name01 , addr01 upto name20 , addr20.
    How do i insert data in table control fields of infotype if i want to use FM HR_INFOTYPE_OPERATION .
    Pls suggest if there is another way to do it.
    Thanks.

    Thanks for your reply.
    I am Calling FM HR_INFOTYPE_OPERATION in a loop of a table.
    Table contains multiple employee numbers-PERNR.There can be all different PERNR or some records of same PERNR.
    Suppose if there are four records in the table.First two records are of the same PERNR.Then how would name01 or name02 will be assigned.
    Now, third record is  of new PERNR .Again it should be name01.
    So the question is how everytime in a loop i will assign nameNN for different PERNR.
    nameNN and addrNN was an example. I am sending my code here.
    Loop at it_data.
    gs_9000-PERNR = it_data-pernr..
    gs_9000-currentamount03 = it_data-curramt.
    gs_9000-mtdamount03 = it_data-mtd.
    gs_9000-qtdamount03 = it_data-qtd.
    gs_9000-ytdamount03 = it_data-ytd.
    gs_9000-roll12amount03 = it_data-roll.
    CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
    EXPORTING
    NUMBER = gs_9000-pernr
    IMPORTING
    RETURN = RETURNE.
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
    EXPORTING
    INFTY = '9000'
    NUMBER = gs_9000-PERNR
    VALIDITYBEGIN = '20080801' 
    RECORD = gs_9000
    OPERATION = 'INS'
    TCLAS = 'A'
    DIALOG_MODE = '0'
    IMPORTING
    RETURN = RETURN
    KEY = KEY.
    IF RETURN IS NOT INITIAL.
    WRITE :/ 'Error Occurred'.
    ENDIF.
    CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
    EXPORTING
    NUMBER = gs_9000-PERNR
    endloop.
    So in above code...
    gs_9000-currentamount03 = it_data-curramt.
    gs_9000-mtdamount03 = it_data-mtd.
    gs_9000-qtdamount03 = it_data-qtd.
    gs_9000-ytdamount03 = it_data-ytd.
    gs_9000-roll12amount03 = it_data-roll.
    these are table control fields , so how i wud i assign for
    gs_9000-currentamount04 = it_data-curramt.
    gs_9000-mtdamount04 = it_data-mtd.
    gs_9000-qtdamount04 = it_data-qtd.
    gs_9000-ytdamount04 = it_data-ytd.
    gs_9000-roll12amount04 = it_data-roll.
    in loop of a table.
    Thanks

  • F4 help in table control. - Urgent  Please

    Hi all,
    Iam using F4 help in table control. when the user selects the data in F4 values 4 more fields that are displayed in the F4 has to be updated in the table control
    What function modules should I use to capture the f4 values and keep in the current table control record. Please help by sending some code.
    Helpful answers will be rewarded.
    Thankhs
    Aditya

    Hi ,
    Check out the follwing Eg.
    To read the remaining fields in the corresponding row use <b>dynpfld_mapping</b> parameters in Table option of F4 help Function Module.And then use <b>DYNP_VALUES_UPDATE </b> FM to populate into the screen fields.
    MODULE shlpcntno INPUT.
      DATA : BEGIN OF i_cntno OCCURS 0,
              contnum LIKE zmps_veh_entry-contnum,
              contsl LIKE zmps_veh_entry-contsl,
              END OF i_cntno.
      CLEAR: i_cntno,i_cntno[],i_return,i_return[],i_map,i_map[].
      SELECT contnum contsl FROM zmps_veh_entry INTO TABLE i_cntno.
      i_map-fldname = 'F0001'.
      i_map-dyfldname = 'I_CNTNO-CONTNUM'.
      APPEND i_map.
      CLEAR i_map.
      i_map-fldname = 'F0002'.
      i_map-dyfldname = 'I_CNTNO-CONSTL'.
      APPEND i_map.
      CLEAR i_map.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'CONTNUM'
          dynpprog        = sy-repid
          dynpnr          = sy-dynnr
          dynprofield     = 'W_CONTNUM'
          value_org       = 'S'
        TABLES
          value_tab       = i_cntno
          dynpfld_mapping = i_map
          return_tab      = i_return.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      LOOP AT i_return.
        IF i_return-fieldname = 'F0001'.
          w_contnum = i_return-fieldval.
        ELSEIF i_return-fieldname = 'F0002' AND flag = 3.
          w_slno = i_return-fieldval.
          CLEAR: i_dynread, i_dynread[].
          i_dynread-fieldname = 'W_SLNO'.
          i_dynread-fieldvalue = w_slno.
          APPEND i_dynread.
          CLEAR i_dynread.
          CALL FUNCTION 'DYNP_VALUES_UPDATE'
            EXPORTING
              dyname                     = sy-repid
              dynumb                     = sy-dynnr
            TABLES
              dynpfields                 = i_dynread
          IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDMODULE.

  • Urgent : Table control

    Hi to ABAP Gurus,
    I am having a serious problem.
    how a delete a record from table control. It should validate the record before deleting check in header table and item table.
    and delete the record from database.
    how to insert a record in to database from table control. before inserting it should validate the record from header table and item table.
    pls give me the needful solution.

    refer
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbac1d35c111d1829f0000e829fbfe/content.htm
    http://hometown.aol.com/skarkada/sap/table_control/table_control.htm
    http://help.sap.com/saphelp_sm32/helpdata/en/d1/801bdf454211d189710000e8322d00/content.htm
    http://www.sap-img.com/ab031.htm
    regards,
    srinivas
    <b>*reward for useful answers*</b>

  • ISSUE IN THE TABLE CONTROL

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

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

  • Update internal table data from table control

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

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

  • Using Table Control

    Hi Experts,
    I am working on module pool Program using " Table Control ".
    the below code is a part of program.
    "  Here i want insert new lines ( New values ). Please tell me that how to Do? "
    MODULE USER_COMMAND_0100 INPUT.
      SAVE_OK = OK_CODE.
      CLEAR OK_CODE.
      CASE SAVE_OK.
        WHEN 'INSERT'.
       "  Here i want insert new lines ( New values ). Please tell me that how to Do? "
        WHEN 'TOGGLE'.
          LOOP AT EMPLOYE-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 EMPLOYE-COLS FROM COLS INDEX SY-TABIX.
          ENDLOOP.
        WHEN 'DELETE'.
         READ TABLE EMPLOYE-COLS INTO COLS WITH KEY SCREEN-INPUT = '1'.
          IF SY-SUBRC = 0.
            LOOP AT ITAB INTO ZEMPLOYE WHERE EMPID = 'X'.
              DELETE ITAB.
            ENDLOOP.
          ENDIF.
      ENDCASE.
    ENDMODULE.   
    Its Urgent  
    Thank You.
    Basu

    Hi,
    WHEN 'INSERT'.
    " Here i want insert new lines ( New values ). Please tell me that how to Do? "
    <b>Append initial line to EMPLOYE.</b>
    Or
    Change the table control attribute for rows.
    Reward if helpful.

  • How to select perticular row in table control for BDC

    Hi all
    I want to select perticular row in table control for deletion through BDC. My transaction is CA02, My input is  material no and plant , then it display table control with work center. Now i want to select W999 cost center and delete through BDC.
    Please Suggest me. it urgent.
    Thanks& Regards,
    RP

    Hi all
    I want to select perticular row in table control for deletion through BDC. My transaction is CA02, My input is  material no and plant , then it display table control with work center. Now i want to select W999 cost center and delete through BDC.
    Please Suggest me. it urgent.
    Thanks& Regards,
    RP

  • Table control index

    Hi,
    I have a table control. How to get the index of the row selected in the table control?
    Please help. Very urgent
    Thanks

    Hi Kushaal Choudri,
    Procedure for Table control line selection and modifying master table using
    those values.
    1).
    U should take one variable in your internal table or in structure which
    is used for table control fields
    ex :
    data :begin of itab occurs 0 ,
    mark type c ,
    matnr like mara-matnr ,
    matkl like mara-matkl,
    maktx like makt-maktx,
    end of itab .
    Controls: TABC types TABLEVIEW using screen 100.
    2).
    This mark variable should be given in Table control properties.
    follow the path
    double click on the table control-->attributes .->select
    w/SelColumn and in that itab-mark. Check in the figure.
    [http://bp2.blogger.com/_O5f8iAlgdNQ/R99gOUH8CXI/AAAAAAAAA9I/d3gOum1fJ6s/s1600-h/pic28145-796618.jpg|http://bp2.blogger.com/_O5f8iAlgdNQ/R99gOUH8CXI/AAAAAAAAA9I/d3gOum1fJ6s/s1600-h/pic28145-796618.jpg]
    3).
    After that. Take this example.
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0100.
    LOOP AT ITAB WITH CONTROL tabc
    ENDLOOP.
    PROCESS AFTER INPUT.
    MODULE CANCEL AT EXIT-COMMAND.
    LOOP AT ITAB.
    Module read_table_control.
    ENDLOOP.
    module user_command_0100.
    ==============================
    In this Module read_table_control, You should write the following code
    MODULE read_table_control INPUT.
    MODIFY itab INDEX tabc-current_line."( This will update the ITAB table MARK field with 'X ' whatever we have selected on table control.)
    ENDMODULE.
    4)
    If you want to Delete some of the records from Table control
    follow this code u2026Create one pushbutton and give Fucnction code to that
    and write below code
    WHEN 'DELETE'.
    LOOP AT itab WHERE mark = 'X'.
    DELETE itab.
    ENDLOOP.
    ENDCASE.
    I hope that it helps u .
    Regards,
    Venkat.O

Maybe you are looking for

  • Trying to restore from a previous Filevault profile.

    Hi! I've recently gotten an new hard drive (500GB) and tried installing SL on it from a previous Time Machine save of my previous profile. This profile was protected using filevault and for some reason, after all the installs were done, I could not l

  • Layer disappear when using blur gallery

    The same thing happens on all three blur gallery effects (field blur, iris blur, tilt shift). Once I pick the filter the layer becomes empty. The strange thing is that when I manipulate any of the controls the object appears, but once I stop holding

  • How to add a device back to Apple ID

    How do you add a device back to Apple ID once it is removed by mistake? Signing in again doesn't work - "Apple ID Disabled".

  • Responsablity Is not showing On Frontpage

    Hi experts, We are using R12.0.6 EBS in Win server 2003. we add one responsablity for the particular user,it added. But when we login as a user, its not showing the added responsablity.when we restart the server its showing. but every time we cant do

  • InputFields disabled no matter what I do

    Hi, Im currently modifying an existing Web Dynpro application. I was adding a new View and a couple of InputFields into it. Turns out that no matter what I do, the controls are always disabled (user cannot write into it). I checked the properties, wi