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.

Similar Messages

  • Handling w/selcolumn in table control

    Hi experts,
    I have a table control made manually, I set w/selcolumn field to NUM. How can I handle that if i select a row and then push the 'PUSHBUTTON' then it made a selection and goes to the next screen.
    So I only want to know how can we know which row the user selected, how can we get data from that row?

    Hi,
    When the Push button is pressed, then follw this logic,
    For the table control you have the Internal table, then you have the Field callesd NUM, then if the Push button is pressed, then
    READ TABLE ITAB with key NUM = 'X'.  " Selected line will be read
    IF sy-subrc = 0
      " Move to other Structure with only the header data
    endif.
    Regards
    Sudheer

  • 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

  • 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

  • How to find out the selected column in Table Control

    Hi all,
          How to find out the selected column in Table Control?
    Thanks & Regards,
    YJR

    Hi,
    Let your table control name in Screen painter be TC1.
    READ TABLE TC1-COLS INTO WA_COLS (some wok area)
                 WITH KEY SELECTED = 'X'.
            IF SY-SUBRC = 0.
              CLEAR: W_DUMMY, W_COL_NAME.
              SPLIT WA_COLS-SCREEN-NAME AT '-' INTO W_DUMMY
                                                   W_COL_NAME.
            endif.
    W_COL_NAME gives you the column name.
    Hope it helps.
    cheers
    sharmistha

  • 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

  • BDC programming and table controls selColumns

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

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

  • Regarding page down in the table control veritcally

    Hi all,
              I have an issue regarding page down in the Table control in module pool , i.e when i m click the vertical scroll bar and going for page down then , the control is flowing to the next sceen which is not needed , and it shuld just scroll down and up vetically.
    Can anyone help me how to handle the page down event ?
    Thanks & regards,
    satya

    Table Controls: Examples with Scrolling
    The following example processes a table control with LOOP without parallel loop using an internal table. In addition to the scroll bar, the user can also carry out program-controlled scrolling with function codes.
    REPORT demo_dynpro_tabcont_loop.
    CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
    DATA: ok_code TYPE sy-ucomm,
          save_ok TYPE sy-ucomm.
    DATA: itab TYPE TABLE OF demo_conn,
          fill TYPE i.
          TABLES demo_conn.
    DATA: lines TYPE i,
          limit TYPE i.
    SELECT * FROM spfli INTO CORRESPONDING FIELDS OF TABLE itab.
    CALL SCREEN 100.
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'SCREEN_100'.
      DESCRIBE TABLE itab LINES fill.
      flights-lines = fill.
    ENDMODULE.
    MODULE fill_table_control OUTPUT.
      READ TABLE itab INTO demo_conn INDEX flights-current_line.
    ENDMODULE.
    MODULE cancel INPUT.
      LEAVE PROGRAM.
    ENDMODULE.
    MODULE read_table_control INPUT.
      lines = sy-loopc.
      MODIFY itab FROM demo_conn INDEX flights-current_line.
    ENDMODULE.
    MODULE user_command_0100 INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
      CASE save_ok.
        WHEN 'NEXT_LINE'.
          flights-top_line = flights-top_line + 1.
          limit = fill - lines + 1.
          IF flights-top_line > limit.
            flights-top_line = limit.
          ENDIF.
        WHEN 'PREV_LINE'.
          flights-top_line = flights-top_line - 1.
          IF flights-top_line < 0.
            flights-top_line = 0.
          ENDIF.
        WHEN 'NEXT_PAGE'.
          flights-top_line = flights-top_line + lines.
          limit = fill - lines + 1.
          IF flights-top_line > limit.
            flights-top_line = limit.
          ENDIF.
        WHEN 'PREV_PAGE'.
          flights-top_line = flights-top_line - lines.
          IF flights-top_line < 0.
            flights-top_line = 0.
          ENDIF.
        WHEN 'LAST_PAGE'.
          flights-top_line =  fill - lines + 1.
        WHEN 'FIRST_PAGE'.
          flights-top_line = 0.
      ENDCASE.
    ENDMODULE.
    The layout of screen 100 is:
    A resizable table control called FLIGHTS is defined. The fields of the table control are transferred from the structure DEMO_CONN in the ABAP Dictionary. The first two columns are lead columns. The corresponding fields are output fields. A title bar, column headers, and a selection column are created. The component MARK of type character with length 1 from structure DEMO_CONN is assigned to the selection column. You can select one column and several lines.
    It has the following flow logic:
    PROCESS BEFORE OUTPUT.
      MODULE status_0100.
      LOOP WITH CONTROL flights.
        MODULE fill_table_control.
    ENDLOOP.
    PROCESS AFTER INPUT.
      MODULE cancel AT EXIT-COMMAND.
      LOOP WITH CONTROL flights.
        MODULE read_table_control.
    ENDLOOP.
      MODULE user_command_0100.
    The system executes a loop at PBO and PAI using the table control FLIGHTS. During the PBO loop, a module is called to fill the table control from table ITAB of the ABAP program. During the PAI loop, a module is called to modify table ITAB.
    Before the PBO loop, in the module STATUS_0100 the current number of lines of the internal table ITAB is placed in component LINES of control structure FLIGHTS. This helps the system to correctly install the scroll bar of the table control.
    During the PBO loop, in the module FILL_TABLE_CONTROL the work area DEMO_CONN is filled with values from the internal table, where the row index corresponds to the current row of the table control.
    During the PAI loop, in the module READ_TABLE_CONTROL the current number of the loop SY-LOOPC in the table control is placed an auxiliary variable. The number is dependent on the size of the screen. The rows of the internal table, whose row index corresponds to the current row of the table control, are overwritten with the contents of the work area DEMO_CONN. User input is transferred from the input fields of the control to the internal table. In particular, the internal table also contains a flag in the column MARK to indicate whether the row of the table control is selected or not.
    After the PAI loop, user input is processed in the module USER_COMMAND. The GUI status SCREEN_100 provides the appropriate function codes. You can scroll line by line or page by page, or Goto the first or last page. You can implement scrolling by setting the component TOP_LINE of control structure FLIGHTS. For page-by-page scrolling the auxiliary variable that is filled in the PAI loop by SY-LOOPC is used as the step size.

  • Regarding the table control in bdc

    Hi Abap Gurus,
    my requirement is how to extend the table control in bdc? i have searched in the sdn but not found the proper code.
    i think we have to use the =P+ code .  if possible post the sample code.

    Use the search tool, or go to [How to scroll a table control?|http://wiki.sdn.sap.com/wiki/display/ABAP/BatchInputFAQ#BatchInputFAQ-Howtoscrollatablecontrol%3F] in [Batch Input FAQ |http://wiki.sdn.sap.com/wiki/display/ABAP/BatchInputFAQ] (not every transaction uses the same code)
    Regards,
    Raymond

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

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

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

  • Regarding Table controls dialog programming

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

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

  • Regarding table controls

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

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

Maybe you are looking for

  • Help!!! thunderbolt port on macbook pro 10.6.8 not working

    Help!!!I have a macbook pro 10.6.8 version. I have been using my HDMI cord via the thunderbolt port to connect my laptop to my TV. I have been using it for 4 months when this week it stopped working. I have changed the HDMI and adaptors but have disc

  • Aperture for a Powerbook G4?

    Hi! I have a powerbook G4 - 17" - Leopard and I´m planning to buy shortly a Macbook pro. However before I do I´m testing new applications in order to figure what applications I want for my new mac. I´m using photoshop and iphoto, but I read great thi

  • License For Mars 55 Question??

    Hi every one.i have some question about mars license: 1-do we have get a license and install on mars to get it operational? 2-if we dont have license can we download ips signature updates with cco account and then install it on mars? 3-if we dont ins

  • Error on Installation of CrystalReports 2008

    Hi, I attended to install CrystalReports 2008 on my Windows XP SP 2 machine. I already installed the BOBJ XI 3.1 client tools and the SAP integration pack. But there is no chance to install CrystalReports tool. First I tried to install the build-vers

  • WF initiator in another client does not work

    Hi, I have created my WF and the first step is a user decision (yes/no). In this I use the &_WF_INITIATOR& as the addresse of the WI. It works fine in the development client but not in another client and I wonder why. When I check the protocol, syste