Regarding Searh option in table control

Hello,
I have one table control in which i have taken only one field of 132 length so that user enter the line wise comments in that table control.
Now i want a search button for that table control so that user can enter any string to search in the table control.
How to do that as i haven't seen any thing like this even in standard transaction also.
Please give me some ideas fro doing that.
with regards,
nitin

Hello,
Thanx for your reply,
I code like this.
I_TXTTAB is my table control internal table.
MODULE SEARCH. is my module for search
Codes as follow
  CASE OK_CODE.
    WHEN 'FIND'.
      PERFORM SEARCH.
TAB_SEARCH-TABNAME = 'TLINE'.
  TAB_SEARCH-VALUE = ROLE_TEXT.
  TAB_SEARCH-FIELDNAME = 'TDLINE'.
  APPEND TAB_SEARCH.
  CALL FUNCTION 'POPUP_GET_VALUES'
    EXPORTING
      POPUP_TITLE     = 'Find Text : Comment'(010)
    IMPORTING
      RETURNCODE      = RETURNCODE
    TABLES
      FIELDS          = TAB_SEARCH
    EXCEPTIONS
      ERROR_IN_FIELDS = 1
      OTHERS          = 2.
  IF RETURNCODE = 'A'. EXIT. ENDIF.
  READ TABLE TAB_SEARCH WITH KEY FIELDNAME = 'TDLINE'.
  ROLE_TEXT = TAB_SEARCH-VALUE.
  CLEAR L_TEXT_INPUT.
  L_TEXT_INPUT = TAB_SEARCH-VALUE.
  IF ROLE_TEXT IS INITIAL .
    EXIT.
  ENDIF.
  IF FILE IS NOT INITIAL AND
     I_TXTTAB IS NOT INITIAL.
    DESCRIBE TABLE I_TXTTAB LINES TXT_LINES.
    L_IND = COMMENT-CURRENT_LINE.
    READ TABLE I_TXTTAB INTO W_TXTTAB INDEX L_IND.
    FIND ALL OCCURRENCES OF L_TEXT_INPUT  IN W_TXTTAB IGNORING CASE RESULTS RESULTS.
    IF SY-SUBRC = 0.
      SET CURSOR FIELD 'W_TXTTAB' LINE L_IND.
      FLAG = 'X'.
    ENDIF.
This code finds the text string but it is not taking my cursor to that particular line item.
i write this code like this also, but still not getting to the line item
PROCESS AFTER INPUT.
  LOOP AT I_TXTTAB.
    CHAIN.
      FIELD W_TXTTAB-TDLINE.
      MODULE G_TEXT_MODIFY ON CHAIN-REQUEST.
    ENDCHAIN.
    MODULE SEARCH.
  ENDLOOP.
With Regards,
Nitin Malhotra

Similar Messages

  • Insert,  Delete and Update options in Table control

    Experts,
    I have writen code for Insert,  Delete and Update options in Table control. They are not working properly...
    can any one send the code for the above please...
    Thanks in advance..

    Hi,
    Following steps will help you.
    1.TOP-INCLUDE
    DATA: ITAB1 LIKE KNA1 OCCURS 0 WITH HEADER LINE.
    DATA: ITAB2 LIKE KNA1 OCCURS 0 WITH HEADER LINE.
    DATA: WA LIKE KNA1.
    DATA: ANT TYPE I,CUR TYPE I.
    DATA: OK_CODE TYPE SY-UCOMM.
    CONTROLS: TABCTRL TYPE TABLEVIEW USING SCREEN 100.
    IN FLOWLOGIC
    PROCESS BEFORE OUTPUT.
    LOOP AT ITAB1 CURSOR CUR WITH CONTROL TABCTRL.
    ENDLOOP.
    PROCESS AFTER INPUT.
    MODULE CLEAR_DATA.
    LOOP AT ITAB1.
    MODULE MOVE_DATA.
    ENDLOOP.
    ADD “OK_CODE” IN ELEMENT LIST. CLICK ON LAYOUT AND  ADD TABLE CONTROL(name it as TABCTRL) AND PUSHBUTTONS AS FOLLOWS.
    SELECT THE FIELDS FROM PROGRAM. SAVE CHECK AND ACTIVATE.
    CLICK ON FLOWLOGIC EDITOR FROM APPLICATION TOOL BAR.
    DOUBLE CLICK ON MODULE “CLEAR_DATA”.
    write the in this module as below.
    CLEAR ITAB2. REFRESH ITAB2.
    DOUBLE CLICK ON MODULE “MOVE_DATA”.
    write the code in this module as below.
    APPEND ITAB1 TO ITAB2.
    ACTIVATE PAI AND WRITE THE CODE AS BELOW.
    CASE OK_CODE.
    WHEN 'FETCH'.
    SELECT * FROM KNA1 INTO TABLE ITAB1 UP TO 20 ROWS.
    TABCTRL-LINES = SY-DBCNT.
    WHEN 'ADD'.
    GET CURSOR LINE CNT.
    CNT = TABCTRL-TOP_LINE + CNT - 1.
    CLEAR WA.
    INSERT WA INTO ITAB1 INDEX CNT.
    WHEN 'MODIFY'.
    GET CURSOR LINE CNT.
    READ TABLE ITAB2 INDEX CNT.
    LOOP AT ITAB2.
    MODIFY KNA1 FROM ITAB2.
    ENDLOOP.
    SELECT * FROM KNA1 INTO TABLE ITAB1.
    WHEN 'EXIT'.
    LEAVE PROGRAM.
    ENDCASE.
    SAVE,CHECK AND ACTIVATE ALL.
    CREATE TCODE AND EXECUTE.
    contact if u hv any issues regarding this code.
    reward points,if it is useful.
    Thanks,
    Chandu.

  • IB51, IB52 : Page up & Page Down option for table control disabled

    Hi experts,
    IB51, IB52 Page up & Page Down option for table control is disabled.
    We want to use these options in the table control while recording .
    Can any one tell us?
    Regards,
    Lakshmi

    Hi,
    You can refer to Note 379208 .
    The same is applicable in CRM too.
    Thanks ,
    Jomy

  • Filter Option in Table Control

    Hi Folks ,
    I am working on a table control , i need to add Filter functionality same as of ALV filter
    i tried with suggestion given on SCN
    Following is the code that i tried, but its not working, no popup with FM LVC_FILTER_DIALOG
    please help me with sum more suggestion or sample code
    DATA : cp_vbak LIKE it_vbak OCCURS 0.
      DATA : it_fieldcat1 TYPE lvc_t_fcat,
             wa_fieldcat LIKE line of it_fieldcat1,
             it_group1 like  lvc_s_sgrp occurs 0,
             ls_group LIKE lvc_s_sgrp,
             filter_ranges TYPE lvc_t_filt.
    DATA: counter TYPE i.
      counter = counter + 1.
      wa_fieldcat-col_pos    = counter.
      wa_fieldcat-fieldname  = 'VBELN'.
      wa_fieldcat-tabname    = 'IT_VBAK'.
       APPEND wa_fieldcat TO it_fieldcat1.
      CLEAR wa_fieldcat.
      counter = counter + 1.
      wa_fieldcat-col_pos    = counter.
      wa_fieldcat-fieldname  = 'VKORG'.
      wa_fieldcat-tabname    = 'IT_VBAK'.
      APPEND wa_fieldcat TO it_fieldcat1.
      CLEAR wa_fieldcat.
      counter = counter + 1.
      wa_fieldcat-col_pos    = counter.
      wa_fieldcat-fieldname  = 'VTWEG'.
      wa_fieldcat-tabname    = 'IT_VBAK'.
      APPEND wa_fieldcat TO it_fieldcat1.
      CLEAR wa_fieldcat.
      counter = counter + 1.
      wa_fieldcat-col_pos    = counter.
      wa_fieldcat-fieldname  = 'SPART'.
      wa_fieldcat-tabname    = 'IT_VBAK'.
      APPEND wa_fieldcat TO it_fieldcat1.
      CLEAR wa_fieldcat.
    ls_group-SP_GROUP = '0001'.
    ls_group-TEXT = 'VBELN'.
    append ls_group to it_group1.
    clear ls_group.
    ls_group-SP_GROUP = '0002'.
    ls_group-TEXT = 'VKORG'.
    append ls_group to it_group1.
      cp_vbak[] = it_vbak[].
      CALL FUNCTION 'LVC_FILTER_DIALOG'
        EXPORTING
          it_fieldcat           = it_fieldcat1
          it_groups             = it_group1
    *   IS_FILT_LAYOUT        =
    *   I_NO_DIALOG           =
    *   IT_EXCEPT_QINFO       =
        tables
          it_data               = it_vbak
        CHANGING
          ct_filter_lvc         = filter_ranges
    * EXCEPTIONS
    *   NO_CHANGE             = 1
    *   OTHERS                = 2
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *Need to code more for Filter the internal table

    Hi Pihu,
    I am also trying to implement the filter functionality in a Table Conntriol.
    I have used following two function modules to handle the filter option.
    1. CEP_DOUBLE_ALV: You will get the pop up to select you filtering fields.
    2. LVC_FILTER_DIALOG: Second pop up to select the filtering data for the fields selected.
    But the second FM is giving an error 'filter internal error : 15'
    If u have already implemented this functionality, can u give me the sample code.
    Thanks in advance,
    Sai

  • REGARDING  "w/selcolumn" IN table control

    hi experts,
                i m not able to use "w/selcolumn" in table control.
    cud u plz how will i use this to delete the data from database table as per the data showing in the table control.
    plz help me

    Hi,
    <u>Step 1</u>
    In your PAI capture all the seleted rows into an internal table. The following code snippet does that.
    recsel -> value you have given for w/selcolumn
    gt_student_select -> Internal table having the selected rows for deletion
    gt_student
    module select_record input.
    if recsel = 'X'.
    read table gt_student_select with key student_id = gt_student-student_id
    if sy-subrc eq 4.
    gt_student_select-mandt = gt_student-mandt.
    gt_student_select-student_id = gt_student-student_id.
    gt_student_select-student_name = gt_student-student_name.
    gt_student_select-student_address = gt_student-student_address.
    gt_student_select-student_average = gt_student-student_average.
    append gt_student_select.
    endif.
    else.
    delete table gt_student_select from gt_student.
    endif.
    endmodule.
    <u>Step 2</u>
    Perform deletion using the internal table gt_student_select.
    when 'DELETE'.
    clear ok_code.
    "deletes matching record from database table
         DELETE ztrch_stud_kri1 FROM table gt_student_select.
        "deletes the record from the itab
        loop at gt_student_select.
        delete table gt_student from gt_student_select.
        endloop.
        "sets the number of lines displayed in the table control to the
        "number of line in the internal table.
        DESCRIBE TABLE gt_student LINES tabctrl-lines.
        clear gt_student_select[].
    ***********************Reward points if found useful***************
    Regards,
    Kriththika.

  • Regarding duplicate entries in table control

    hi,
       i have created one table control in module pool. while entering values into the table control how can we validate the table control if we enter duplicate values.ie in the first line i entered 200 500 400
    again inthe second line i
    entered 200 500 400.
    validation should tabke place and error msg should be populated. pls help...
    i have used the below code.
    LOOP AT IT_TC2.
        CHAIN.
          FIELD:ZTC_ATMP-BUKRS,
                ZTC_ATMP-LEGACCNO,
                ZTC_ATMP-ZZDESKCODE,
                ZTC_ATMP-SAKNR.
          MODULE READ_TABLE_CONTROL.
         MODULE check_duplicates ON CHAIN-REQUEST.
        ENDCHAIN.
    ENDLOOP.
    but here module check_duplicates is not triggering why? any idea..

    Hi,
    you can try like this...
    LOOP AT IT_TC2.
    CHAIN.
    FIELD ZTC_ATMP-BUKRS module CHK1.
    FIELD ZTC_ATMP-LEGACCNO module CHK1.
    FIELD ZTC_ATMP-ZZDESKCODE module CHK1.
    FIELD ZTC_ATMP-SAKNR module CHK1.
    MODULE READ_TABLE_CONTROL.
    ENDCHAIN.
    ENDLOOP.
    Now write the validations for the corresopnding Fields in there Respective Modules.... for example Validation for  ZTC_ATMP-BUKRS  filed in module CHK1 and so on..
    Reward if helpful.
    Regards,
    Syed

  • Regarding Design of the Table Control

    Hi Experts,
                I am using Link to Action in one of the Column in the Table Control, Now i am using Designing type as Alternating,
    The Column which is using the Link to Action appearing the White Background, and the rest of the Coloumns are appearing as Blue background, I need a uniformity for the Look and Feel, How can i achieve this ?
    If i am using the Table control with Alternative Design without the Link to Action as the Column it is appearing the with Alternative Colors.But this Violates my functionality.
    How can i achieve this Alternating Colors when we are using Link to Action .????

    Hi Vikranth,
    To differentiate the type of cell Varients, SAP has marked them with different colors. Unfortunately, we cannot work around this.
    Regards,
    Sravan Varagani

  • Regarding  decimal entry in table control

    Hi,
       i am using one screen which is containing a table control. In that one field is called value(Local Currency value)
      Before that i  have created one table called zuvrate.
    In zuvrate , i have declared 'value'(one field of my table) as dmbtr data type(currency with 13 , 2 ) and
    reference field is t001-waers.
       My problem is, if i enter decimal value in that particular column in my table control, 'please enter numeric value ' error is coming.
      for example if i give 23.34 then error is coming
       elseif i give 23 then ok no error.
      How to enter decimal value in my table control?

    Hi,
    The reference field you have specified i.e. waers has no decimal places. Give the reference field which has the same number of decimal places as you want.
    Hope it helps..
    Lokesh
    pls. reward appropriate points

  • Not able to table control option in edit in layout

    HI,
    I am designing a screen with table control wizard ,but i am not able to see the option of table control wizard in edit.
    Message was edited by:
            nandulamatam Bharath
    Message was edited by:
            nandulamatam Bharath

    Hi
    Install the correct and latest patch of SAP GUI for this problem
    take the help of a BASIS person in this regard , he will install the same
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • Layout Management in Table Control

    Hi Dialog Programming Experts,
    I have a new requirement - adding Layout Management options in Table Control. This is dialog/module programming, not ALV Report. Is there a function module for this?
    Thanks so much in advance for your help.
    Regards,
    Joyreen

    Hi
    For filter use the following function modules,
    l_rightx-id = l_index.
      l_rightx-fieldname = 'DESCR'.
      l_rightx-text = text-054.
      APPEND l_rightx TO i_rightx.
      l_index = l_index + 1.
      CLEAR l_rightx.
      l_rightx-id = l_index.
      l_rightx-fieldname = 'DEL_CM'.
      l_rightx-text = text-055.
      APPEND l_rightx TO i_rightx.
    CALL FUNCTION 'CEP_DOUBLE_ALV'
           EXPORTING
                i_title_left  = text-034
                i_title_right = text-035
                i_popup_title = text-036
           IMPORTING
                e_cancelled   = l_cancelled
           TABLES
                t_leftx       = i_leftx[]
                t_rightx      = i_rightx[].
    Firstly populate the right table with all fields which you want in the filtering condition. The left table will be populated once the use selects some fields and transfer it to the left portion of the dialog.
    Then use the following FM like this.
    DATA: i_group TYPE lvc_t_sgrp.
          CALL FUNCTION 'LVC_FILTER_DIALOG'
               EXPORTING
                    it_fieldcat   = i_fldcat1
                    it_groups     = i_group
               TABLES
                    it_data       = i_ziteminvoice[]
               CHANGING
                    ct_filter_lvc = i_filter
               EXCEPTIONS
                    no_change     = 1
                    OTHERS        = 2.
    here filter table should have fields from left table above.
    Once you get the filter data, populate range table for each fields and then delete your internal table using these range.
    CASE l_filter-fieldname.
                  WHEN 'ITMNO'.
                    l_itmno-sign = l_filter-sign.
                    l_itmno-option = l_filter-option.
                    l_itmno-low = l_filter-low.
                    l_itmno-high = l_filter-high.
                    APPEND l_itmno TO li_itmno.
                    CLEAR l_itmno.
    DELETE i_ziteminvoice WHERE NOT  itmno IN li_itmno OR
                                          NOT  aedat IN li_aedat OR...
    First check this if it works, else let me know.
    Thanks
    Sourav.

  • Reg : Find the records  in Table control

    Dear all
    Im having one requirement in table control .  In my table control totally 100 records contains sales documents
    for Example
    100010
    100020
    100030
    In that Records how to find particluar sale document in table control. How to build find option in table control.
    If possible or not
    Thanks & regards
    Sri

    Hi Sridhar,
    You need to implement amodal screen for this and a Find button above the table control.
    or you can use POPUP_GET_VALUES FM
    after you enter a value in the POP up screen.
    " You need to put some effort to implement this, wish you to implement it successfully as this is possible
    READ TABLE ITAB WITH KEY VBELN = FIND_VBELN. " FIND_VBELN is the field on your find screen.
    if sy-subrc = 0.
    tc-top_line = sy-tabix. " this makes the record visible in the First position
    endif.
    PROCESS AFTER INPUT.
      LOOP AT itab.
        MODULE find.
      ENDLOOP.
    In Program
    MODULE find INPUT.
      DATA : tab TYPE STANDARD TABLE OF sval WITH HEADER LINE.
      REFRESH tab.
      CASE ok_code.
        WHEN 'FIND'.
          clear ok_code.
          tab-tabname = 'VBAK'.
          tab-fieldname = 'VBELN'.
          APPEND tab.
          CALL FUNCTION 'POPUP_GET_VALUES'
            EXPORTING
    *   NO_VALUE_CHECK        = ' '
              popup_title           = 'Find Sales Order'
       start_column          = '5'
       start_row             = '5'
    * IMPORTING
    *   RETURNCODE            =
            TABLES
              fields                = tab
    EXCEPTIONS
       error_in_fields       = 1
       OTHERS                = 2
          IF sy-subrc = 0.
            READ TABLE itab WITH KEY vbeln = tab-value.
            IF sy-subrc = 0.
              tc-top_line = sy-tabix.
            ENDIF.
          ENDIF.
      ENDCASE.
    ENDMODULE.                 " find  INPUT
    Cheerz
    Ram

  • 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

  • Selecting rows in table control

    Hi experts,
    I have question regarding selecting rows in table control. How can I select a row when a button is pressed. I cannot use the selection column in this case. Is there any option to achieve my requirement without using the selection column. Thanks.
    regards,
    sriram.

    By,
    Using the Get cursor syntax you can achive the Selected row in Table control.
      DATA : selrow TYPE i,
             selindex TYPE i  .
    * getting the cursor line in Table Control for selected row
      GET CURSOR FIELD selfield LINE selrow.
      selindex = <tablecontrol>-top_line + selrow - 1.
    Prabhu

  • Module pool prorgam in table control designing

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

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

  • Making 10 table control rows to be displayed always

    Dear All,
    How to make a table control display 10 lines always..?

    Hi,
    Thanks for the response
    I have 3 table controls in a single screen. Each will have minimum 7-10 rows ( filled data ). I need to display all the table with all the rows visible to the user without scrolling.
    At present though I define the lines as 10 for each table they are getting adjusted to 4 lines per table and getting fit to the screen.
    But what I need is irrespective of the size of the monitor it should display all the tables with all the data. The screenmay have the scroll but not the tablecontrol.
    for e.g
    Table 1 Actual data is
    1 flight
    2 Train
    3 Car
    4 Flight
    5 Hotel
    6 Other
    7 Car
    But it is displayed as with scroll option for table control
    1 flight
    2 Train
    3 Car
    4 Flight
    I need it to be displayed as irrespective of the size of monitor
    1 flight
    2 Train
    3 Car
    4 Flight
    5 Hotel
    6 Other
    7 Car
    Please help.
    Regards
    Sai

Maybe you are looking for