‎2008 Apr 02 9:43 AM
Please let me know the error where i am with in the below code for displaying the drop down box.
my fields are WS and EMP, but i want to create the drop down box for WS only
TABLES: ZDROP.
DATA ok_code TYPE sy-ucomm.
Global data
TYPES: BEGIN OF type_WS,
WS type ZDROP-WS,
EMPLID type ZDROP-EMPLID,
END OF type_WS.
DATA itab_WS TYPE STANDARD TABLE OF type_WS.
&----
*& Processing Blocks called by the Runtime Environment *
&----
Event Block START-OF-SELECTION
START-OF-SELECTION.
CALL SCREEN 1.
MODULE create_dropdown_box INPUT.
SELECT WS EMPLID
FROM ZDROP
INTO CORRESPONDING FIELDS OF TABLE itab_WS.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'WS'
value_org = 'S'
TABLES
value_tab = itab_WS
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
ENDMODULE.
&----
*& Module USER_COMMAND_0001 INPUT
&----
text
----
MODULE USER_COMMAND_0001 INPUT.
CASE ok_code.
WHEN 'SELECTED'.
MESSAGE i888(sabapdocu) WITH ZDROP-WS.
ENDCASE.
ENDMODULE. " USER_COMMAND_0001 INPUT
‎2008 Apr 02 10:31 AM
Hi Venkatesh,
I believe you are referring to demo_dropdown_list_box sample program..
the code looks fine but have you entered any values in the table
ZDROP?
go to se11 -> ZDROP -> display ->see how many entries are there...if there are no entries in the table then....that is your problem...
Pls check,revert and reward if helpful
Regards
Byju
‎2008 Apr 02 11:17 AM
Hi i am have the entries in the table friend and thks a lot for solving my problems. I have followed the same program given in ABAPDOCU but it is not working.
can you point out my error.
my fields are WS and EMPLID
‎2008 Apr 04 4:55 AM
‎2008 Apr 04 6:56 AM
Hi, Has your problem been solved ? Then close the thread . Regards, Venkat.O
‎2008 Apr 02 12:26 PM
hi ,
Try using VRM_SET_VALUES function module for your requirement .
Regards,
Ranjita
‎2008 Apr 03 5:13 PM
Venkateshwar reddy,
Just follow the following procedure to get dropdown on S-S or on screen.
To get Drop Drown Box on screen .
Follow these steps.
1.Go to T.Code SE51 and Select Laypout for the Screen.
2.Double click on the field for which u want Dropdown box.
3.Then U will see Name ,Text ,DROPDOWN.Click on that and select List Box
or ListBox with key . Better to to select first one.
4.Save and Activate ur screen .
5.Enter the following piece of code in the PBO of the screen.(Change for ur requirement).
To get Drop Drown Box on Selection-screen for parameter.
1.define parameter.
2.Write down the following code under the event
PARAMETERS: p_drop type pernr-pernr as listbox.AT SELCTION-SCREEN OUTPUT.
6.Observe the above code and change as for ur requirement.
That demo program also ok . Actuall we use VRM_SET_VALUES function module to get the values into dropdown.
I hope that it helps you.
Regards,
Venkat.O
TYPE-POOLS :vrm.
DATA:
i_natio TYPE vrm_values, "-->Table that is passed through FM vrm_set_values
w_natio LIKE LINE OF i_natio.
DATA:
BEGIN OF i_t005t OCCURS 0,
land1 TYPE t005t-land1,
natio TYPE t005t-natio,
END OF i_t005t.
IF i_t005t[] IS INITIAL.
SELECT land1 natio
FROM t005t
INTO TABLE i_t005t
WHERE spras = sy-langu.
IF sy-subrc = 0.
LOOP AT i_t005t .
w_natio-key = i_t005t-land1.
w_natio-text = i_t005t-natio.
APPEND w_natio TO i_natio.
CLEAR w_natio.
ENDLOOP.
ENDIF.
ENDIF.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'I_IT0002-NATIO' "-->Field for which dropdown is needed.
values = i_natio
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.
‎2008 Apr 04 8:08 AM
You have to pass the values for the following exporting parameters of FM also
DYNPPROG = sy-repid
DYNPNR = '1000'
DYNPROFIELD = 'WS'
ie,
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'WS'
DYNPPROG = sy-repid
DYNPNR = '1000'
DYNPROFIELD = 'WS'
value_org = 'S'
TABLES
value_tab = itab_WS
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
Edited by: Rengith Skariah on Apr 4, 2008 9:08 AM