‎2008 Jul 25 6:23 PM
HI all,
I want to get three data from csks table: like below
TELFX, TELTX, TELX1
i put in selection screen
parameter: P_KOKRS like COBK-KOKRS.
parameters: P_KOSTL like coej-objnr+10(6) obligatory.
i create internal table like below
TYPES: BEGIN OF I_CSKS,
TELFX like CSKS-TELFX,
TELTX like CSKS-TELTX,
TELX1 like CSKS-TELX1,
END OF I_CSKS.
data: W_CSKS TYPE STANDARD TABLE OF I_CSKS WITH HEADER LINE.
my query like below
select TELFX TELTX TELX1 from csks INTO TABLE w_CSKS
WHERE KOKRS = P_KOKRS
and kostl = P_KOSTL.
when i run the program everytime its fail.........
can you please help me
vishal
‎2008 Jul 25 6:32 PM
Hi Vishal,
here the length difference is there.
i mean P_KOSTL is just 6 characters only.
But you are passing this into kostl which is 10 characters length.
so definitely it will fail. check in the table CSKS also
like whether data is there or not.
if both the fields are of same lenght and type then you will get the results
regards,
Venkatesh.
‎2008 Jul 25 6:27 PM
Hi,
Change it like this:
parameters: P_KOSTL like coej-objnr obligatory.
select TELFX TELTX TELX1 from csks INTO TABLE w_CSKS
WHERE KOKRS = P_KOKRS
and kostl = P_KOSTL+10(6).
Regards,
Subramanian
‎2008 Jul 25 6:28 PM
Make sure that for the parameter combination you enter on the selection screen there is at least one entry in the underlying table (check with SE16). If you leave the first parameter empty (P_KOKRS) it will select only those entries from the table where this field is empty as well.
Hope that helps,
Michael
‎2008 Jul 25 6:36 PM
your parameters shoub be in the same type as in CSKS table.
I your particular case, P_KOSTL has to have lenght 10, because KOSTK is Char10.
If I had wroten the code it would looj like:
PARAMETERS: P_KOKRS like CSKS-KOKRS,
P_KOSTL like CSKS-KOSTL OBLIGATORY.
‎2008 Jul 25 6:32 PM
Hi Vishal,
here the length difference is there.
i mean P_KOSTL is just 6 characters only.
But you are passing this into kostl which is 10 characters length.
so definitely it will fail. check in the table CSKS also
like whether data is there or not.
if both the fields are of same lenght and type then you will get the results
regards,
Venkatesh.
‎2008 Jul 25 6:52 PM