Skip to Content
author's profile photo Former Member
Former Member

Query problem

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 25, 2008 at 05: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 25, 2008 at 05: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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • author's profile photo Former Member
    Former Member
    Posted on Jul 25, 2008 at 05: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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.