07-21-2008 9:00 AM
hi all,
I have designed a screen in se51, and using it i a modulepool program. I have filled values in the drop down using the FM "VRM_SET_VALUES" in the PBO of the screen.
But i also want to know which option the user selected, so that i can code according to user selections.
But i dont know how to read the values selected on screen in the drop down, is there any FM for that too.....??
Kindly help me, or let me know if some other way also exists....
All help will be appreciated...!!!!
07-21-2008 9:47 AM
There is no need of Any Function for that.
You can simply use that screen field and check the value in the PAI.
In PAI you will get the value.
You will pass the value to the FM VRM_SET_VALUES function that is the screen field, the value what ever selected will be stored in that field it self.
VALUE = 'SCREEN_FIELD'
if screen_field = '1'.
Do some thing based on this...
endif.
07-21-2008 9:40 AM
Hi,
Please check the Program
DEMO_DYNPRO_DROPDOWN_LISTBOX
awrd points if helpful
Bhupal
07-21-2008 9:47 AM
There is no need of Any Function for that.
You can simply use that screen field and check the value in the PAI.
In PAI you will get the value.
You will pass the value to the FM VRM_SET_VALUES function that is the screen field, the value what ever selected will be stored in that field it self.
VALUE = 'SCREEN_FIELD'
if screen_field = '1'.
Do some thing based on this...
endif.
07-21-2008 10:29 AM
HI Vijay,
thanks for the prompt reply.
but when i use the screen field, i gives an error saying the "field xxxxxxxx is unknown".
do i need to declare the screen field some where ...???
how to get around this prob now....??
07-21-2008 9:51 AM
Hi,
To retrieve the values of drop down we use FM ''VRM_GET_VALUES'' in PAI.
MODULE user_command_9000 INPUT.
* function module to get the list box values.
g_name1 = c_status.
CALL FUNCTION 'VRM_GET_VALUES'
EXPORTING
id = g_name1
IMPORTING
values = g_list1
EXCEPTIONS
id_not_found = 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.
READ TABLE g_list1 INTO g_wa_list WITH KEY key = g_status.
IF sy-subrc EQ 0.
g_status = g_wa_list-text.
ENDIF.
ENDMODULE.
In TOP we have :
DATA: g_name1 TYPE vrm_id,
g_list1 TYPE vrm_values,
g_wa_list LIKE LINE OF g_list1,
g_value_1 LIKE LINE OF g_list1,
g_status(20) TYPE c.
In select query we can directly use then according to the condition.:
select ...
from...
into .....
where status = g_status.
hope this helps.
plz reward if useful.
thanks,
dhanashri.
Edited by: Dhanashri Pawar on Jul 21, 2008 10:52 AM
07-21-2008 10:08 AM
Hi,
You just check the value of variable which you have used to declare the checkbox.
Regards,
Rajesh Akarte
07-21-2008 10:37 AM
u create a screen in that double click on the field in which user will give input..
attributes screen open inthat FCTCODE option -->
give some name.
use the same name in PAI
like this
CASE sy-ucomm.
WHEN 'SELECT'.(FCTCODENAME)
SELECT city1 FROM adrc INTO city1 WHERE post_code1 = li_list1.
IF city1 IS NOT INITIAL.
l_value-key = '' .
l_value-text = city1.
APPEND l_value TO li_list2.
CLEAR l_value.
ENDIF.
ENDSELECT.
l_name = 'CITY1'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = l_name
values = li_list2
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
ENDCASE.
Regards
Anbu
Edited by: Anbu B on Jul 21, 2008 11:37 AM