10-23-2012 6:49 AM
hello
i have made a form in which i want the value of dropdown2 filtered based on value selected in dropdown1.although it is working if i am giving the values manually but when i am retrieving it from data dictionary values are not filtered.kindly suggest me how to proceed.
10-23-2012 9:19 AM
Hello
I think you have passed wrong internal table in VRM_SET_VALUES as a value parameter.
As you are fetching records in internal table itab1 using select statement
See the following lines of code published by you
SELECT state FROM zbs_state INTO
corresponding fields of itab1 WHERE ZONE1 = 'NORTH'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = zbs_state-state1
values = etab1
Check the bold part in above code . You will clearly find the error
Collect the records in etab1 internal table not in itab1 as you are passing etab1 in FM VRM_SET_VALUES
After fetching from SELECT Statement check sy-subrc whether records have been fecthed or not Accordingly take a call .
Enjoy Coding
Regards
Sandeep
10-23-2012 7:00 AM
Although i could not get what you meant but debug and check when selecting from dictionary the values are updated in dropdown1. Paste that part of code if the problem is still persisting.
10-23-2012 7:52 AM
i am attaching the modules in which i have defined values for dropdown and den the module in which coding is done.
MODULE get OUTPUT.
zbs1_brand-zone = 'ZBS1_BRAND-ZONE1'.
zbs_state-state1 = 'ZBS_STATE-STATE'.
IF etab IS INITIAL.
* wa-text = 'NORTH'.
wa-key = 'NORTH'.
APPEND wa TO etab.
* wa-text = 'EAST'.
wa-key = 'EAST'.
APPEND wa TO etab.
* wa-text = 'SOUTH'.
wa-key = 'SOUTH'.
APPEND wa TO etab.
* wa-text = 'WEST'.
wa-key = 'WEST'.
APPEND wa TO etab.
ENDIF.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = zbs1_brand-zone
values = etab
* 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 etab1 IS INITIAL.
SELECT state
FROM zbs_state
INTO CORRESPONDING FIELDS OF itab1.
wa1-key = itab1-state.
APPEND wa1 TO etab1.
* CLEAR wa1.
ENDSELECT.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = zbs_state-state1
values = etab1
* 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.
MODULE user_command_0001 INPUT.
save_code = ok_code.
CASE save_code.
WHEN 'SELECT'.
CASE zbs1_BRAND-zone1.
WHEN 'NORTH'.
SELECT state FROM zbs_state INTO
corresponding fields of itab1 WHERE ZONE1 = 'NORTH'.
endselect.
ENDCASE.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = zbs_state-state1
values = etab1
.
where select is the function code given in dropdown1.
10-23-2012 8:10 AM
put a breakpoint at PAI and check the condition WHEN 'NORTH' is it going inside and fetching the data to etab1 ?
10-23-2012 8:16 AM
i have checked.it is taking only the last value of dropdown2 and not acc to the condition given.
10-23-2012 8:22 AM
10-23-2012 8:22 AM
while debugging,in itab1 it is taking last value from dropdown2 and in etab1 it is displaying all the values of dropdown2 irrespective of condition given.
10-23-2012 8:35 AM
clear your etab1 , and then fill values from itab1 to etab1 based on the criteria you had given... and then call the function VRM_SET_VALUES
10-23-2012 7:21 AM
10-23-2012 9:19 AM
Hello
I think you have passed wrong internal table in VRM_SET_VALUES as a value parameter.
As you are fetching records in internal table itab1 using select statement
See the following lines of code published by you
SELECT state FROM zbs_state INTO
corresponding fields of itab1 WHERE ZONE1 = 'NORTH'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = zbs_state-state1
values = etab1
Check the bold part in above code . You will clearly find the error
Collect the records in etab1 internal table not in itab1 as you are passing etab1 in FM VRM_SET_VALUES
After fetching from SELECT Statement check sy-subrc whether records have been fecthed or not Accordingly take a call .
Enjoy Coding
Regards
Sandeep
10-23-2012 10:03 AM
thank you my form is complete.since i am a fresher i am learning a lot from you.thank you.