‎2008 Jan 17 5:39 AM
Hi all,
I want to use 3 dropdown list at single screen and i select data for diffrent dropdown from diffrent table i want to select data into second list on the base of first list and in third on the base of second list so plz help me.
‎2008 Jan 17 5:55 AM
Hi,
Make the field type as listbox with key in the screen layout editor and assign function codes. Then you can use the function module VRM_SET_VALUES for populating the search help.
like in the pbo you will populate the list for first field.
on selecting a value the control goes to PAI with the function key for field1. There do the validation and select for the second field. Like the same for the other field also.
Use the type pool VRM in top include for using the function module.
Regards,
Renjith Michael.
‎2008 Jan 17 6:10 AM
Hi Renjith Michael,
i have done this but when i select the entry from dropdown list then fields is goes to blank or there will be no any select of fields.
if you will give the sample code for this so it will be very use full for me.
Thnx
Anirudh
‎2008 Jan 17 7:09 AM
Hi,
Sorry for the delay in reply.
Please try like the following code I just tried and worked. Make changes according to your requirement.
PROGRAM sapmztrialsh .
TYPE-POOLS:
vrm.
TABLES: sflight.
DATA : values_c TYPE vrm_values WITH HEADER LINE.
DATA: values_f TYPE vrm_values WITH HEADER LINE.
DATA:
carrid TYPE sflight-carrid,
connid TYPE sflight-connid.
DATA:
ok_code TYPE sy-ucomm,
save_ok TYPE sy-ucomm.
DATA:
it_sflight TYPE TABLE OF sflight,
wa_sflight LIKE LINE OF it_sflight.
*CLEAR values[].
&----
*& Module select_carrid OUTPUT
&----
text
----
MODULE select_carrid OUTPUT.
IF it_sflight IS INITIAL.
CLEAR values[].
SELECT * FROM sflight
UP TO 10 ROWS
INTO CORRESPONDING FIELDS OF TABLE it_sflight
.
LOOP AT it_sflight INTO wa_sflight.
values_c-text = 'This text according to yuo'.
values_c-key = wa_sflight-carrid..
APPEND values_c.
ENDLOOP.
ENDIF.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'CARRID'
values = values_c[]
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.
IF values_f[] IS NOT INITIAL.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'CONNID'
values = values_f[]
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.
ENDIF.
ENDMODULE. " select_carrid OUTPUT
&----
*& Module USER_COMMAND_9000 INPUT
&----
text
----
MODULE user_command_9000 INPUT.
save_ok = ok_code.
CASE save_ok.
WHEN 'CARR'.
CLEAR values[].
LOOP AT it_sflight INTO wa_sflight.
values_f-text = 'Connection'.
values_f-key = wa_sflight-connid..
APPEND values_f.
ENDLOOP.
ENDCASE.
ENDMODULE. " USER_COMMAND_9000 INPUT
Regards,
Renjith Michael.
‎2008 Jan 17 7:21 AM
Hi,
First use VRM_SET_VALUES to get popup from first table. Now use FM DYNP_VALUES_READ to read the value that has been provided in the first screen field. Now based on that read the values through DYNP_VALUES_READ and for the third one get the values based on the second selection screen value.
Thanks and regards,
Atanu
‎2008 Jan 17 7:31 AM
Hi,
If you feel 'VRM_SET_VALUES' to be difficult to use, then you can use the function module F4IF_INT_TABLE_VALUE_REQUEST also.
Just refer to the standard program demo_dropdown_list_box.
Regards,
Renjith Michael.