‎2007 Feb 21 4:02 AM
How to get drop down help for a field in table control?
Suppose there is a field for employee status in table control. That field can either have 'Permanent' or 'Temporary'. What is the code and where to write the code in module pool? is it in POV?
Please help.
Thanks in advance.
‎2007 Feb 21 4:08 AM
hi
Welcome to SDN
You can have dropdown list box in Table control.
Select any one cell in table control.In attributes dialog box, there is an option for dropdown.
Just select listbox...
This will result in listbox being included for the field.
check this below link also..
http://www.allsaplinks.com/files/using_table_in_screen.pdf
~~Guduri
‎2007 Feb 21 4:08 AM
Hi Saha,
You need to do it as the same way as you do build a static search help for a field in table control. the only diff here is you will have read the screen value based on which you would build your search help internal table using FM
U can Simply use Event PROCESS ON VALUE-REQUEST for Populating the List Box Values in Screen on which u are going to display Table Control.
Suppose We want only few Customer type for field ( WA_CUST-CustomerType )in Table control. Then I will add following code after PBO.
PROCESS ON VALUE-REQUEST.
FIELD WA_CUST-CustomerType
MODULE cust_types.
In Defination of MODULE cust_type
Use the FM 'F4IF_INT_TABLE_VALUE_REQUEST'.
Pass Value_tab to the Above FM which will Contain the Values that you want in Dropdown List.
Regards,
Priyanka.
‎2007 Feb 21 4:18 AM
Hi Priyanka,
I have tried this but it is not working yet....any other way??
‎2007 Feb 21 4:29 AM
Hi Saha,
Check these sample programs.
DEMO_DYNPRO_TABCONT_LOOP Table Control with LOOP - ENDLOOP
DEMO_DYNPRO_TABCONT_LOOP_AT Table Control with LOOP AT ITAB
DEMO_DYNPRO_TABLE_CONTROL_1 Table Control with LOOP Statement
DEMO_DYNPRO_TABLE_CONTROL_2 Table Control with LOOP AT ITAB
demo_dynpro_tabcont_loop - demo example with scrolling.
demo_dynpro_tabcont_loop_at- demo example with table control modification
Regards,
Priyanka.
‎2007 Feb 21 4:10 AM
‎2007 Feb 21 4:13 AM
‎2007 Feb 21 4:13 AM
HI,
Simple and easy thing will be have these values as the fised values for the Domain of the field's TYPE.
You should be able to make a filed as dropdown in the screen painter.
Regards,
Sesh
‎2007 Feb 21 4:26 AM
hi Friend,
You need to follow the following steps for this:
1->go to Screen Painter, choose the column which you need to make as drop down.
2->Click F2 to go tothe properties screen.
3->Select <b>Listbox or Listbox with Key</b> for the <b>DROPDOWN</b> field (3rd field in properties tab)
4->give value for the FCODE field also, to track the actions in SY_UCOMM when the user selects the value.
5->in the ABAP code, you need to include the logic to populate values for this drop down. You can use the function module <b>VRM_SET_VALUES</b> to populate the listbox in each line of the table control. The fucntion module has to be called in the PBO module, which is defined inside the loop...endloop statement in the flow logic.
6->for changing the values based on user selection, you can include the code in the PAI module, checking SY_UCOMM or OK_CODE.
Hope this helps,
Sajan Joseph.
‎2007 Feb 21 4:33 AM
HI
pl set the attributes of the screen field as mentioned in the above posts...
in the following code, i am displaying version id (plaf-verid) in the dropdown..should be useful...thanks
TYPE-POOLS: VRM.
DATA: NAME TYPE VRM_ID, LIST TYPE VRM_VALUES,
VALUE LIKE LINE OF LIST.
NAME = 'H_VERID'. "Your screen field name for which u want dropdown
SELECT VERID FROM MKAL INTO VALUE-KEY WHERE MATNR = P_MATNR AND WERKS = P_WERKS.
VALUE-TEXT = VALUE-KEY.
APPEND VALUE TO LIST.
ENDSELECT.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = NAME
VALUES = LIST
EXCEPTIONS
ID_ILLEGAL_NAME = 1
OTHERS = 2.
ENDIF.
cheers,
Sathish. R