Reg: Table control list box

Hi All,
Can anyone please explain with sample code how to get values from the table control list box and save it the internal table.
regards,
karthik

*& Report  ZTABLEC
REPORT  ZTABLEC.
tables : mara.
data : it like mara occurs 0 with header line.
data : begin of it1 occurs 0 ,
       matnr like mara-matnr ,
        end of it1 .
data: OK_CODE  type SY-UCOMM .
data :STATUS like zaiod3-status .
controls : t1 type tableview using screen 1000.
call screen 1000.
*&      Module  STATUS_1000  OUTPUT
      text
MODULE STATUS_1000 OUTPUT.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
select * from mara into table it up to 10 rows.
ENDMODULE.                 " STATUS_1000  OUTPUT
*&      Module  USER_COMMAND_1000  INPUT
      text
MODULE USER_COMMAND_1000 INPUT.
IF SY-UCOMM = 'SAVE'.
IT-MATNR.
append it .
modify MARA from it.
ENDIF.
ENDMODULE.                 " USER_COMMAND_1000  INPUT
*&      Module  create_dropdown_box  INPUT
      text
MODULE create_dropdown_box INPUT.
SELECT matnr FROM mara
                  INTO CORRESPONDING FIELDS OF TABLE it1.
         CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
           DDIC_STRUCTURE         = ' '
             RETFIELD               = 'MATNR'
           PVALKEY                = ' '
           DYNPPROG               = ' '
           DYNPNR                 = ' '
           DYNPROFIELD            = ' '
           STEPL                  = 0
           WINDOW_TITLE           =
           VALUE                  = ' '
            VALUE_ORG              = 'S'
           MULTIPLE_CHOICE        = ' '
           DISPLAY                = ' '
           CALLBACK_PROGRAM       = ' '
           CALLBACK_FORM          = ' '
           MARK_TAB               =
         IMPORTING
           USER_RESET             =
           TABLES
             VALUE_TAB              = IT1
           FIELD_TAB              =
           RETURN_TAB             =
           DYNPFLD_MAPPING        =
          EXCEPTIONS
            PARAMETER_ERROR        = 1
            NO_VALUES_FOUND        = 2
            OTHERS                 = 3
         IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
         ENDIF.
ENDMODULE.                 " create_dropdown_box  INPUT
IN PAI & PBO SECTION...
PROCESS BEFORE OUTPUT.
MODULE STATUS_1000.
loop at it  with control t1.
endloop.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_1000.
loop at it.
endloop.
MODULE USER_COMMAND_1000.
  PROCESS ON VALUE-REQUEST.
  FIELD mara-matnr MODULE create_dropdown_box.
FOR LAYOUT SECTION .......................
CREATE A TABLE CONTROL SELECT A FIELD OF TABLE CONTROL ON WHICH YOU WANT TO CREATE A LIST BOX
DOUBLE click on that open a tool box click the drop down list box select the list box .
save check activate
regards
Aniruddh Singh

Similar Messages

  • Table control list box. different values in each row of the list box

    Hi all,
    i have a requirement to display text box in table control. Each row of list box should contain different values.
    i tried with the below code  but the values are not getting populated in list  box. please give your ideas.
    I tried with list box which is having same values in all rows, it is working fine.
    loop at itab.
    select vbeln from ZSD_PS_BLAWB into ZSD_PS_BLAWB-vbeln
    where BLAWBNO = itab-BLAWBNO and
    BLAWBDT = itab-BLAWBDT and
    CTRNO = itab-CTRNO.
    if sy-subrc = 0.
    index = 1.
    list3-key = index.
    list3-text = ZSD_PS_BLAWB-vbeln.
    append list3 to list2.
    index = index + 1.
    endif.
    endselect.
    clear index.
    CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
    ID = 'ITAB-VBELN'
    VALUES = list2
    EXCEPTIONS
    ID_ILLEGAL_NAME = 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.
    modify itab.
    endloop.
    Thanks in advance.

    Hi,
    this is code example for listbox
    TYPE-POOLS vrm .
    DATA: lt_vrm_values TYPE TABLE OF vrm_value.
    DATA: wa_vrm_values TYPE vrm_value.
    PARAMETER p_list AS LISTBOX VISIBLE LENGTH 10.
    INITIALIZATION.
      wa_vrm_values-key = 'Key1'.
      wa_vrm_values-text = 'Value1'.
      APPEND wa_vrm_values TO lt_vrm_values.
      wa_vrm_values-key = 'Key2'.
      wa_vrm_values-text = 'Value2'.
      APPEND wa_vrm_values TO lt_vrm_values.
      wa_vrm_values-key = 'Key3'.
      wa_vrm_values-text = 'Value3'.
      APPEND wa_vrm_values TO lt_vrm_values.
    AT SELECTION-SCREEN OUTPUT.
      CALL FUNCTION 'VRM_SET_VALUES'
           EXPORTING
                id              = 'P_LIST'
                values          = lt_vrm_values
           EXCEPTIONS
                id_illegal_name = 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.
    To fill it with data from DB, just do select in INITIALIZATION and put that values with same alghoritmus.
    Manas M.
    P.S.: This is very easy question, you should use search ...

  • Table Control Check Box

    Hi,
    i am Displaying a table control in module pool programming
    i need to have check boxes for each item in the table control.
    Regards,
    Vijaya

    HI,
    Refer to the link.
    how to create a check box in table control
    This may help.
    Regards
    Sumit Agarwal

  • Reg: Drop-Down list Box not  displaying values

    Hi Experts,
                     i am publishing a module pool program in the internet using SICF Transaction . In the internet my drop down list box is not displaying the default value  but in my sap it works fine .
    What may be the problem?
    Regards,
    Vikram

    Hello Thorsten Domsalla ,
                      My Problem is in my sap module pool program there is a drop down list box which disaplays  default values its working fine in sap gui but when i access through internet (SICF) Transaction the Drop down list box not listing out default values .
    i am using Integrated ITS Version 7.0 and Support package 08.
    Regards,
    Vikram

  • Reg:Table Control in Custom Screen

    Hi All,
    I am having a requirement of adding a custom screen in vendor master,interms of adding field i done it successfully by using BADI's,but now i added a table control in the custom screen,now whenever am trying to create a new vendor its showing vendor successfully created for the company code,but if i try to open any transaction after that am getting an error like "Express document "Update was terminated" received from author "Reference User Development"" , and if i go for transcation code XK03 if i try to open the particular vendor its showing error "Vendor has not been created".
    Regards
    Arpitam

    Hi Suchithra,
    For each and every fields in the screen will have by default properties as Group number which Group1 and Group3 but when u create a table control manually you might have forgot to maintain the the Group number details because of which it is showing in display rather in change.
    Please maintain the Group details in screen field properties and check. I think it will work.
    Regards,
    Aditya.

  • Reg table control

    hi,
    Created table control with 10 lines, if user enters first line and presses enter , second line is getting disbled.
    i need all the lines in the table control to be in enable mode and if he enters second line it should be captured.
    please help me in sorting out this problem.

    HI Sudha,
    This has been answered many a times, Please do search before posting.
    in PBO.
    MODULE status_0100.
    in Program.
    MODULE status_0100.
    describe table itab  lines tc-lines.
    if tc-lines = 0.
    tc-lines = 100.
    else.
    tc-lines = tc-lines + 100.
    endif.
    endmodule.
    Cheerz
    Ram

  • 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.........

  • Reg : Table control row settings to change mode

    Hi geeks.
            I am working on a requirement where the table control has to be in display mode at the time of prepopulating(initial display).This works fine and could get all columns in display mode for which i used column properties of table control. I could select a row from the table control and created a button above the table control for copy of the row which is added to the last row of the TC. I could get this with out any issues. They want the added row to be in changed mode whereas the other rows selected previously should remain in the display mode. Can anybody help me out to solve.Timely help will be appreciated <removed by moderator>
    Regards  ,
    Kumar.
    Edited by: Vinod Kumar on Aug 2, 2011 9:21 AM

    This thread will assist you.
    [Table control with non editable rows;
    Make use of some flag for identifying the new records that will be appended in itab on the press of the button.
    Then in PBO,
    loop at itab with control tc cursor tc-current_line.
    module editnewrow.
    endloop.
    module editnewrow output.
    if itab-flag  =  'X'.
    loop at screen.
        screen-input  =  1.
        modify screen.
      endloop.
       itab-flag  =  ' '. (resetting back to non-editable state for consequent press of the button)
       modify itab index tc_4000-current_line.
      endif.
    endmodule.

  • Re:Reg table control

    Hi,
       i have 2 fields in table control.
    flag                     ship1
    if flag =y               then i should have this column enabled for writing in table    control   other wise disable
        how to implement logic for it

    if flag = 'X'.
    loop at screen.
      if screen-name = 'flag'.
        screen-invisible = 1.
        modify screen.
      endif.
    endloop.
    else.
    loop at screen.
      if screen-name = 'flag'.
        screen-invisible = 0.
        modify screen.
      endif.
    endloop.
    check with various screen options.....

  • Reg: table control values to be updated during POV event

    Hi all,
          i need to design the screen for table control. which should contain Four input fields and input should be selected by F4 help. So i have used POV event to handle this. Once the user selected values from the F4 help, Immediately it has to populate the Table control fields based on input selection. I have tried several ways but it was not successful.
    Please help me regarding this will be appreciated .
    Regards,
    Sreenivasa Sarma K.

    Hi,
    Make use of the 'SEARCH HELP' property of the fields in the table control.
    Just get the search help names for those 4 fields and place it to this property.
    Also change the 'Poss. Entries Key' property as 1 or 2.
    Regards,
    R.Nagarajan.

  • Reg:Table Controls

    Hi,
       Can anyone please tell  me how to do table controls with screen shots .

    Hi,
    Check the following link:
    http://www.****************/Tutorials/ABAP/TableControl/Demo.htm
    Regards,
    Bhaskar

  • List Box with Variable Entries in a Table Control

    Hi ,
       I have a requirement where a certain column F of the table control should be designed as dropdown list box. The problem is, i have to populate different entries for field F in each row of the Table control.
                                       Field List
    First Line -                   A,B,C
    Second Line -              A,B
    Third Line     -             A
    Is it possible in ABAP to achieve this . I should not use an input help. Can i achieve this with Drop down list ?
    Regards,
    Krishna Chaitanya . A

    Hi Priyaranjan,
    Assoon as you enter records and save it it gets saved , that is ok , but when you do scroll system goes to PAI , so you need to chk the value of ok_code when scroll button is pressed and write the code according to that .
    more over you need to increase the number of lines that can be displayed in a particular table control .
    Try this it may help you .
    <i>Reward points if helpful.</i>
    Regards,
    Amber S

  • Problem when creating list box in table control

    Hi every body ,
                      I am placing a list box in table control ,  the list box is coming perfectly but
    when I am scrolling  or pressing enter the data in that field is clearing.
       if I remove the list box , and i enter the data directly and scrolling or press enter
    the data is not clearing.
    But only for list box only it is be having like that
    what is the problem?
      the code is as follows
    *{   INSERT         DEVK935807                                        1
    *&      Module  glaccuontlist  INPUT
          text
    module glaccuontlist input.
    type-pools vrm.
    tables: zglaccount.
    data:
            name  type vrm_id,
            list  type vrm_values,
            value like line of list.
           clear:value.
           refresh: list.
            name = 'ACGL_ITEM-HKONT'.
            select * from zglaccount.
             value-key = sy-dbcnt.
             value-text = zglaccount-hkont.
             append value to list.
             clear value.
            endselect.
          call function 'VRM_SET_VALUES'
            exporting
              id                    = name
              values                = list
          EXCEPTIONS
            ID_ILLEGAL_NAME       = 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.
    endmodule.                 " glaccuontlist  INPUT
    *}   INSERT
    thanks in advance.\
    srinivas.

    Hi srinivasa,
    try it.
    select * from zglaccount.
    <b>value-key = zglaccount-hkont.</b>
    value-text = zglaccount-hkont.
    append value to list.
    clear value.
    endselect.
    Regards
    Allan Cristian

  • List box problem in table control

    Hi,
    I have 3 list box coloum in my table control.Based on the 1st list box selection i wanna fill the 2nd list box.
    I used function code 'CUS' and made the Fct type <BLANK> but my problem is fuction code triggers PAI but i am not getting the values what i slected in the 1st list box.
    Please help me.
    Regards,
    Karthik.

    Actually i resolved the problem the problem was with the function module...instead of VRM_SET_VALUES i tried F4_help...

  • List box for table control

    Hi,
    I need a list box for an input field in table control.
    In brief. I have 5 fields in table control out of which i have to enter values manually for 1 field and for 1 field i need a list box or drop down and then when i press enter the remaining fields should be populated.
    i got the code working but now they need the drop down list for the second input field.
    If anybody could provide with the code it would be real helpful and  iwas confused whether i need to write code in pov or some where else.
    the field for which i need list box is taken from dictionary .
    any help would be geatly appreciated.
    suchitra

    Refer this link:
    table control Drop down list
    Regards,
    ravi

Maybe you are looking for