Selection-screen pushbutton & Table Control

Hi Everyone
In my program i have a pushbutton in my selection-screen; this button call a screen with a table control, the problem is when i run my report and return to the first screen, the data in the TC is cleared.
It's possible to save the information of my TC if i run my report and return to the first screen??
Thanks & Regards
    David

Hi,
Write the logic for putting data from an internal table into table control in the PBO of the called screen & not in the PAI of the calling screen. Also, when you exit that screen, retrieve data into the internal table.
For e.g. if Screen 9002 contains table control then
PBO of Screen 9002:
loop at it_itab into x_itab with control table_control_name.
module put_data.
endloop.
PAI of screen 9002:
loop at it_itab into x_itab.
module get_data.
endloop.
Reward points if the answer is helpful.
Regards,
Mukul

Similar Messages

  • 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

  • Record selected in the table control

    Hi All,
      How do i know the line no of the record selected in the table control.I have declared a table control CONTROLS : t_control1 type tableview using screen 200.But in t_control1-current_line the line no that is stored is always 1.
    Thanks,
    Rakesh.

    in table control property window you have to set that suppose you have set itab-mark as the sel field then it will always be X if you select the field ...
    regards
    shiba dutta

  • Selection screen pushbutton

    I have designed one push button on the selection screen below to input fields. If I press that button then I need to do some bdc programs after that I need to display log in the output screen. For this what I did is I have created perform statement in at selection screen event. And I am calling all the transactions inside of that form. But I am not able to display log in the output screen as it is under at selection screen event. So how to provide the log in the output screen after pressing push button.
    What I did is under start of selection I am looping messtab internal tables. The log displaying after I press execute button but it is not displaying after I press push button.
    Please help me what logic I have to build for this.
    Thanks a lot in advance.

    Try something like this.
    REPORT  RICH_0001.
    tables: sscrfields.
    selection-screen PUSHBUTTON  1(20) pb_test user-command PB1.
    at selection-screen.
      if sy-ucomm = 'PB1'.
         sscrfields-ucomm = 'ONLI'.
      endif.
    start-of-selection.
    write:/ 'StartOfSelection has been executed'.
    Regards,
    Rich Heilman

  • SELECTION-SCREEN PUSHBUTTON 0(20) name USER-COMMAND FILE.

    Hi,
    I'm trying to put a button on a selection-screen!
    I'd like this button to be Icon + text! Text is ook, how do I add an icon ?
    regards,

    If you want to create pushbuttons with tool tips on a selection screen or you want to assign a tooltip to the pushbuttons created with SLECTION-SCREEN FUCTIONKEY in the GUI status of a selection screen, the correction instructions contain a sample program which demonstrates how you can assign tool tips to pushbuttons or application toolbars in a selection screen.
    Code
    REPORT ZZTOOLTIPDEMO.
    TYPE-POOLS icon.
    DATA: funckey TYPE smp_dyntxt.
    TABLES: sscrfields.
    SELECTION-SCREEN PUSHBUTTON 1(40) pushbutt USER-COMMAND
    com VISIBLE LENGTH 12.
    SELECTION-SCREEN FUNCTION KEY 1.
    INITIALIZATION.
    CALL FUNCTION 'ICON_CREATE'
    EXPORTING
    name = icon_information
    text = 'My Text'
    info = 'My Quickinfo'
    ADD_STDINF = 'X'
    IMPORTING
    RESULT = pushbutt
    EXCEPTIONS
    OTHERS = 1.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    MOVE icon_information TO funckey-icon_id.
    MOVE 'My text' TO funckey-icon_text.
    MOVE 'My quickinfo' TO funckey-quickinfo.
    MOVE funckey TO sscrfields-functxt_01.

  • How to know no of selected fields in Table Control in at the first iteratio

    Hi ABAP Gurus,
    I have developed screen with Table control. At one particular scenario, I need to
    display an error message if all the displayed records are not selected. So I need to know the No of selected fields on the Table control in the very first iteration of the Loop in PAI event. Is there any Function Module/Method or any other way to Achieve this. 
    Thanks in Advance..
    Regards,
    Vishwanath

    You can simply count them, but looping the table and checking the "select" flag.
    data: records type i.
    data: counter type i.
    clear counter.
    Loop at itab where sel = 'X'.
    counter = counter + 1.
    endloop.
    describe table itab lines records.
    if records <> counter.
    message e001(00) with 'Not all records were selected'.
    endif.
    Regards,
    Rich Heilman

  • Logical Database selection screen pushbutton

    Hello All,
    I need to create a pushbutton on a selection screen of a logical database.  Basically this pushbutton when clicked will either display or suppress some fields on the screen.  I have tried to use the SSCRFIELDS option to create a pushbutton, however that never displays for me.  Logical Database DDF has an example of a pushbutton that I am looking to create, however the functionality will be different.  I am not sure what I am missing, can anyone help?  Thanks.
    John

    Hello All,
    Thanks for your replies. However, there is something that is causing these options not to work.  For some reason when using SSCRFIELDS nothing displays.  For the SELECTION-SCREEN PUSHBUTTON command, we see the push button however our code for some reason is not working.  I have another developer working this with me and we are both stumped.  We are mirroring that DDF Logical Database and are not having any luck so far.  Does anyone have any further suggestions?
    John

  • Dynamic variables: SELECTION-SCREEN PUSHBUTTON

    hi, how I can create 100 buttons on a cycle so dynamic?
    example:
    SELECTION-SCREEN BEGIN OF LINE.
       SELECTION-SCREEN PUSHBUTTON (4)  TEXT-001    USER-COMMAND but1.
       SELECTION-SCREEN PUSHBUTTON (4)  TEXT-002    USER-COMMAND but2.
       SELECTION-SCREEN PUSHBUTTON (4)  TEXT-003    USER-COMMAND but3.
       SELECTION-SCREEN PUSHBUTTON (4)  TEXT-004    USER-COMMAND but4.
    SELECTION-SCREEN END OF LINE.
    .....must be dynamic and they can be 100 and just 10
    thanks in advance.
    goudden.

    It gives you an error cause the macro is wrong. Try like this:
    define create_line.
    SELECTION-SCREEN BEGIN OF LINE.
       SELECTION-SCREEN PUSHBUTTON (4)  TEXT-&1    USER-COMMAND b&1.
       SELECTION-SCREEN PUSHBUTTON (4)  TEXT-&2    USER-COMMAND b&2.
       SELECTION-SCREEN PUSHBUTTON (4)  TEXT-&3    USER-COMMAND b&3.
       SELECTION-SCREEN PUSHBUTTON (4)  TEXT-&4    USER-COMMAND b&4.
    SELECTION-SCREEN END OF LINE.
    end-of-definition.
    selection-screen begin of block b01.
         create_line: 001 002 003 004, 005 006 007 008.
    selection-screen end of block b01.

  • In the component overview screen of CO01 I want  to disable all  the field in  screen of table control.I want to make it as output screen only.

    Hi all
      In the component overview screen of CO01 I want  to disable all  the field in  screen of table control.I want to make it as output screen only.
    Thanks & Regards,
    Rajib.

    Isn't that just exactly what transaction CO02 does? CO01 is for creating production orders so what sense does it make to have it display mode only?
    Maybe your goal is to stop then end user changing the component assignment that is automatically  detected by the system. If so, personally I think a better starting point would be PP configuration or user authorizations rather than looking to change the screen by whatever method. As we don't know what you are trying to achieve it's hard to offer much more advice maybe all you need is to change transaction to CO02

  • 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

  • How to delete selected row in table control

    Hi all,
    here is my coding for deleting selected row.
    But it is not working correctly.
    I am not able to delete seleced row.
    If i press delete button it automatically delete from beginning instead of selected rows.
    Can anyone can help me plz...
    CONTROLS rowdeleting TYPE TABLEVIEW USING SCREEN 100.
    TABLES zdetails.
    data : begin of itab occurs 0,
    NAME TYPE ZDETAILS-NAME,
    ADDRES TYPE ZDETAILS-ADDRES,
    CONTACTNO TYPE ZDETAILS-CONTACTNO,
    INIT TYPE C,
    end of itab .
    DATA OK_CODE LIKE SY-UCOMM.
    CALL SCREEN 100.
    MODULE STATUS_0100 OUTPUT.
    SET PF-STATUS 'BACK'.
    IF ITAB-INIT IS INITIAL.
    SELECT NAME ADDRES CONTACTNO FROM ZDETAILS
    INTO CORRESPONDING FIELDS OF TABLE ITAB.
    DESCRIBE TABLE ITAB LINES rowdeleting-LINES.
    ITAB-INIT = 'X'.
    ENDIF.
    ENDMODULE. " STATUS_0100 OUTPUT
    MODULE CHANGE_SDYN_CONN OUTPUT.
    READ TABLE itab INTO ZDETAILS INDEX rowdeleting-current_line.
    ENDMODULE. " CHANGE_SDYN_CONN OUTPUT
    MODULE READ_TABLE_CONTROL INPUT.
    IF ITAB-INIT = 'X' AND OK_CODE = 'DELETE'.
    DELETE ITAB index rowdeleting-current_line ."FROM ZDETAILS.
    DESCRIBE TABLE ITAB LINES rowdeleting-LINES.
    ENDIF.
    ENDMODULE. " READ_TABLE_CONTROL INPUT
    MODULE USER_COMMAND_0100 INPUT.
    CASE OK_CODE.
    WHEN 'BACK'.
    LEAVE PROGRAM.
    WHEN 'DELETE'.
    IF ITAB-INIT = 'X' AND OK_code = 'DELETE'.
    DELETE ITAB index rowdeleting-current_line .
    ENDIF.
    ENDCASE.
    ENDMODULE.
    regards ,
    ranjith.

    Hi,
    Check the following code:
    CONTROLS TABLE_CONTROL TYPE TABLEVIEW USING SCREEN 100.
    TABLES SDYN_SDW4.
    DATA SDYN_ITAB LIKE STANDARD TABLE OF SDYN_SDW4.
    DATA INIT.
    DATA OK_CODE LIKE SY-UCOMM.
    DATA SAVE_OK LIKE SY-UCOMM.
    DATA MARK.
    DATA  COL TYPE CXTAB_COLUMN.
    CALL SCREEN 100.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'GRUND'.
      SET TITLEBAR '100'.
      IF INIT IS INITIAL.
    Datenbeschaffung
       SELECT CARRID CONNID CITYFROM AIRPFROM CITYTO AIRPTO DEPTIME ARRTIME
                DISTANCE DISTID
                FROM SPFLI
                INTO CORRESPONDING FIELDS OF TABLE SDYN_ITAB.
        DESCRIBE TABLE SDYN_ITAB LINES TABLE_CONTROL-LINES.
        INIT = 'X'.
      ENDIF.
    ENDMODULE.                             " STATUS_0100  OUTPUT
    *&      Module  FILL_TABLE_CONTROL  OUTPUT
          text
    MODULE CHANGE_SDYN_CONN OUTPUT.
    you can change the content of current table control line via
    sdyn_conn
    READ TABLE sdyn_itab INTO sdyn_conn INDEX table_control-current_line.
    ENDMODULE.                             " FILL_TABLE_CONTROL  OUTPUT
    *&      Module  READ_TABLE_CONTROL  INPUT
          text
    MODULE READ_TABLE_CONTROL INPUT.
    Check input values
      IF MARK = 'X' AND SAVE_OK = 'DELETE'.
        DELETE TABLE SDYN_ITAB FROM sdyn_sdw4.
        DESCRIBE TABLE SDYN_ITAB LINES TABLE_CONTROL-LINES.
      ENDIF.
    ENDMODULE.                             " READ_TABLE_CONTROL  INPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
      SAVE_OK = OK_CODE.
      CLEAR OK_CODE.
      CASE SAVE_OK.
        WHEN 'SORT'.
          DATA: FLDNAME(100),HELP(100).
          READ TABLE TABLE_CONTROL-COLS INTO COL WITH KEY SELECTED = 'X'.
          SPLIT COL-SCREEN-NAME AT '-' INTO HELP FLDNAME.
          SORT SDYN_ITAB BY (FLDNAME).
      ENDCASE.
    ENDMODULE.                             " USER_COMMAND_0100  INPUT
    *&      Module  EXIT  INPUT
          text
    MODULE EXIT INPUT.
    LEAVE PROGRAM.
    ENDMODULE.                 " EXIT  INPUT
    Regards,
    Bhaskar

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

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

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

  • How to save the selected records from Table control in dialog programming

    Hiiiiiiii Every1
    Actually the problem is like this:-
    I have to select some records from table control and then want to save the selected records in DB table.
    Example
    I have some rows having inforamtion bout employees...
    Now what i want is that when i click on 'SAVE' button then these selected rows should be moved into DB table.
    Sachin Dhingra

    see below example, I have added INSERT option after DELETE option.
    REPORT demo_dynpro_tabcont_loop_at.
    CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
    DATA cols LIKE LINE OF flights-cols.
    DATA: ok_code TYPE sy-ucomm,
          save_ok TYPE sy-ucomm.
    DATA: itab TYPE TABLE OF demo_conn.
    TABLES demo_conn.
    SELECT * FROM spfli INTO TABLE itab.
    LOOP AT flights-cols INTO cols WHERE index GT 2.
      cols-screen-input = '0'.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDLOOP.
    CALL SCREEN 100.
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'SCREEN_100'.
    ENDMODULE.
    MODULE cancel INPUT.
      LEAVE PROGRAM.
    ENDMODULE.
    MODULE read_table_control INPUT.
      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 'TOGGLE'.
          LOOP AT flights-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 flights-cols FROM cols INDEX sy-tabix.
          ENDLOOP.
        WHEN 'SORT_UP'.
          READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
          IF sy-subrc = 0.
            SORT itab STABLE BY (cols-screen-name+10) ASCENDING.
            cols-selected = ' '.
            MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDIF.
        WHEN 'SORT_DOWN'.
          READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
          IF sy-subrc = 0.
            SORT itab STABLE BY (cols-screen-name+10) DESCENDING.
            cols-selected = ' '.
            MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDIF.
        WHEN 'DELETE'.
          READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.
          IF sy-subrc = 0.
            LOOP AT itab INTO demo_conn WHERE mark = 'X'.
              DELETE itab.
            ENDLOOP.
          ENDIF.
        WHEN 'INSERT'.
          READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.
          IF sy-subrc = 0.
            LOOP AT itab INTO demo_conn WHERE mark = 'X'.
              itab1 = itab.
              modify itab1.
            ENDLOOP.
          ENDIF.
          if not itab1 is initial.
            INSERT dbtab FROM TABLE itab1.
          endif.
      ENDCASE.
    ENDMODULE.

  • Selection column in Table control..

    Hi ,
    I have used a table control wizard in my custom screen. And it gives the desired output.
    But it doesnot contain the selection column ( used to slelect the table control rows) .
    Now i want to add that column to my existing Table control.
    1) what changes should i do with my Internal table?
    2) What should be included with the Table control in Screen  Painter?
    I searched the forum..but i didnt get the solution..
    If anybody knows pls suggest me..

    hi sathya,
    this may be helpful to u
    goto the screen painter double click on the table control wizard,u will get a pop up screenpainter attributes.
    In that pop up towards the end you will have a checkbox w/selcolumn,just check it.you will be able to get theselection column for your table control.
    u have to give a name to the selection column and add to the internal table which has the contents of the table control.you can select and unselect the columns using that variable.
    regards,
    sravanthi

  • Multiple selection column in table control problem

    Hi, all.
    My issue now is I have a table control on a screen that can let user select multiple records, and then click a button to process those selected record just now. But after I select some records and scroll down the screen, i found out that those record which are selected just now is disappear, and i have to select again.
    So, may i know how to fix those records in a table control which i selected earlier during i scroll up and down the table control on the screen?
    Thanks in advance.

    Hi,
    Once you scroll down the item selected above gets deselected this is natural thing in SAP Module Pool.
    You can do one thing to avoid such thing is by increasing your screen size where you are displaying the contents.
    hope this will solve your problem.
    Regards,
    Suvendu.

Maybe you are looking for

  • My macbook does not start, gray screen, apple and turning gear appears

    my macbook froze. then shut down the computer to clear the freeze condition. when trying to restart, the computer starts to boot,the apple appears on the screen, the gear rotates, however the computer does not continue to boot. can anyone help?

  • Apps take longer than 15 seconds to get deleted

    I got my iPhone 4s last September amd since then I've updated the firmware twice hoping that would solve the problem but it didn't so please tell me what else i can do: When i hold an app to delete it, it does start to wriggle immediatly but when i p

  • Chapter menu button not showing up

    I exported my project from FCP with Chapter Markers included and when I brought that project into iDVD there was no automatic button for my Chapter selections. According to the HELP tab, there was supposed to be a button formed on the screen. Yes I h

  • Actual Activity Cost

    Hi Friends For calculating the actual rate system take all the actual activity cost and divide it with actual quantity. I want to know how the system is calculating actual activity cost. In KSII system will calculate the actual activity rate. What is

  • Keep the zoom level the same when scrolling through photos

    To decide which is the best photo that i've got, i usually compares the details by zooming and switching through photos back and forth, but keep the zoom level the same.. The problem is, in iPhoto 11 i can't do this.. Because everytime i scroll to an