‎2006 Oct 31 5:34 AM
hi experts,
I am Developing one Screen.In that screen i am using one listbox for year.Here i give my code.
IF YEAR_LIST IS INITIAL.
CLEAR ITAB_YEAR.
SELECT YEAR_A FROM ZRLNG_ACQ INTO CORRESPONDING FIELDS OF TABLE
ITAB_YEAR
WHERE CUSTNO_A = CUST.
CLEAR WA_YEAR.
CLEAR G_LIST.CLEAR VALUE.
LOOP AT ITAB_YEAR INTO WA_YEAR.
VALUE-KEY = WA_YEAR-YEAR_LIST.
VALUE-TEXT = WA_YEAR-YEAR_LIST.
APPEND VALUE TO G_LIST.
ENDLOOP.
SORT G_LIST BY KEY.
CLEAR WA_YEAR.CLEAR ITAB_YEAR.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = 'YEAR_LIST'
VALUES = G_LIST.
ENDIF.
In the above code i am selecting the year(YEAR_A) from the ztable which i created.But i am not getting the data.I checked in debugging mode it does not selects the YEAR_A from table i don't know why.
Please give me a solution.
Thanks in advance.
regards,
Ashok.
‎2006 Oct 31 6:22 AM
Hi Ashok,
did u declare
DATA: g_list TYPE vrm_values.
i have given u one sample code,and it worked for me.So check the where conditions while retrieving the data.
regards,
nagaraj
‎2006 Oct 31 5:37 AM
Hi Ashok,
check one sample code...
TYPE-POOLS: vrm.
PARAMETER: pr_spart TYPE spart AS LISTBOX VISIBLE LENGTH 7.
*AT SELECTION-SCREEN ON VALUE-REQUEST FOR pr_spart.
INITIALIZATION.
*----Code for Drop down list....
DATA: lit_spart_list TYPE vrm_values, "Table for list of Divisions
lwa_spart_list TYPE vrm_value,
lw_name TYPE vrm_id. "Name of parameter with list-box.
*---Assign selected values to table that would be passed to FM VRM_SET_VALUES
CLEAR : lwa_spart_list,
lw_name.
*---Pass required values for list-box display.
lwa_spart_list-key = 'H'.
lwa_spart_list-text = 'HL'.
APPEND lwa_spart_list TO lit_spart_list.
lwa_spart_list-key = 'S'.
lwa_spart_list-text = 'SL'.
APPEND lwa_spart_list TO lit_spart_list.
lwa_spart_list-key = 'P'.
lwa_spart_list-text = 'PP'.
APPEND lwa_spart_list TO lit_spart_list.
lwa_spart_list-key = 'F'.
lwa_spart_list-text = 'FR'.
APPEND lwa_spart_list TO lit_spart_list.
*Name of parameter to which list is to be assigned
lw_name = 'PR_SPART'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = lw_name
values = lit_spart_list
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.
also chek the data base,that it contains value for YEAR_A.
regards,
nagaraj
Message was edited by: nagaraj kumar nishtala
‎2006 Oct 31 5:39 AM
SELECT <b>YEAR</b>_ -
FROM ZRLNG_ACQ INTO CORRESPONDING FIELDS OF TABLE
ITAB_YEAR
WHERE CUSTNO_A = CUST.
CLEAR WA_YEAR.
CLEAR G_LIST.CLEAR VALUE.
LOOP AT ITAB_YEAR INTO WA_YEAR.
VALUE-KEY = WA_YEAR-YEAR_LIST.
VALUE-TEXT = WA_YEAR-YEAR_LIST.
endloop.
just see if u r populating other fields from ur select criteria,,
cause it seems u r populating only one field year_a
into ur itab .
regards,
VIjay
‎2006 Oct 31 5:41 AM
hi,
pls chk the data base,that it contains value for YEAR_A
rgds
anver
‎2006 Oct 31 5:54 AM
hi,
i checked the database table it contains the data.my doubt is 'year' is a key field and 'cust' also a key field.I am selecting the one key field with another key field.
regards,
Ashok.
‎2006 Oct 31 5:57 AM
Hi ashok,
<i>SELECT YEAR_A FROM ZRLNG_ACQ INTO CORRESPONDING FIELDS OF TABLE
ITAB_YEAR
WHERE CUSTNO_A = <b>CUST</b>.</i>
pls chk the where condition.
if it satisfies or not. if the where condition is not correct it will not fetch values.
so see the query with out the where condition.
<b>also check the cust has correct value or not</b>
rgds
anver
if hlped pls mark points
‎2006 Oct 31 6:19 AM
hi,
i checked the where condition.it contains the correct data.there is no problem.
regards,
Ashok.
‎2006 Oct 31 5:42 AM
Hi,
check whather field named 'YEAR_A' is there in internal table ITAB_YEAR?
dafinition of internal table should be
DATA : BEGIN OF ITAB_YEAR OCCURS 0,
YEAR_A LIKE ZRLNG_ACQ-YEAR_A,
END OF ITAB_YEAR.
Looking into your code i feel that internal table definition of your may not be proper.
Kindly take only required field in intenal table.
try to avoid using "into correspoinding" .
REWARD if this helps
Message was edited by: Palak Limbachiya
‎2006 Oct 31 6:16 AM
hi,
i declared the internal table and work area correctly.internal table contains 'year_a'.
regards,
Ashok.
‎2006 Oct 31 5:45 AM
hi
good
did you check in the ztable wheather it contains the value for the value you r giving in teh list box.
check that in se11, if value would be there than it must select that particular value, if value wont be there in the ztable than you wont find out any data.
thanks
mrutyun^
‎2006 Oct 31 6:20 AM
Hi Ashok ,
can u just give ur code (i mean the whole code )..
we are not able to give u the correct solution as the options for the scope are very less.
regards,
vijay.
‎2006 Oct 31 6:22 AM
Hi Ashok,
did u declare
DATA: g_list TYPE vrm_values.
i have given u one sample code,and it worked for me.So check the where conditions while retrieving the data.
regards,
nagaraj
‎2006 Oct 31 6:30 AM
hi Ashok,
this is really bad.
we all give a lot of time into ur problem.
but in the end not a single point for our effort.
i think this not good in forum.
rgds
anver
<b><i>pls mark all helpful answers</i></b>
‎2006 Oct 31 6:34 AM
Agreed with Anversha.
Message was edited by: Palak Limbachiya
‎2006 Oct 31 6:50 AM
hi experts,
Sorry buddies...i am very sorry.
Problem solved.
Problem is in sql query.I should not use
SELECT YEAR_A FROM ZRLNG_ACQ INTO CORRESPONDING FIELDS OF TABLE ITAB_YEAR WHERE CUSTNO_A = CUST_NO.
instead of above statement i should use the below statement.
SELECT YEAR_A FROM ZRLNG_ACQ INTO TABLE ITAB_YEAR WHERE CUSTNO_A = CUST_NO.
Thank you very much for your cooperation.I need this cooperation from you guys for my every doubts.
Once again Sorry.
regards,
Ashok.