Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

please validate my select stmt.

Former Member
0 Likes
1,007

what is wrong in my select stmt. kindly validate me.

DATA : v_charvalue TYPE atwrt.

SELECT atwrt

UP TO 1 ROWS

INTO v_charvalue

FROM ausp

WHERE objek = mcha-matnr

AND atinn = 'US_FRENCH_ON'

AND klart = '101'.

ENDSELECT.

When I try to select using se16

with the the values the record is getting selected.

How ever My above select stmt is not fetching value for me.

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
944

Because of ATINN Field,check it once in AUSP Table ATINN is a 10size numeric char field

but in where condition you are mentioning values as US_FRENCH_ON it one is 12 char..

Hope it will helpful

6 REPLIES 6
Read only

Former Member
0 Likes
945

Because of ATINN Field,check it once in AUSP Table ATINN is a 10size numeric char field

but in where condition you are mentioning values as US_FRENCH_ON it one is 12 char..

Hope it will helpful

Read only

Former Member
0 Likes
944

DATA : v_charvalue TYPE atwrt.

SELECT atwrt
UP TO 1 ROWS
INTO v_charvalue
FROM ausp
WHERE objek = mcha-matnr
AND atinn = 'US_FRENCH_ON'                 " ATINN is NUMC(10) Field which will not hold characters
AND klart = '101'.
ENDSELECT.

Just check the table again for the data.

Regards,

Gurpreet

Read only

Former Member
0 Likes
944

Please debug and see mcha-matnr has some value or not . As this code is working fine for me when i use constant value in where clause.

Read only

0 Likes
944

As for ATINN u have used the character string 'US_.........' which is fine. But as ATINN is NUMC type it has default value as some no.

So u have to use a conversion routine for it.

CONVERSION_EXIT_ATINN_INPUT

In the above FM u can give ur ATINN text value abnd u will get the corresponding NUMC ATINN value which u have to pass in ur select query. This wil surely solve the problem.

Read only

Former Member
0 Likes
944

Thank you

Edited by: Pranavjeet on Apr 29, 2009 8:54 AM

Read only

Former Member
0 Likes
944

Hi Kumar,

The field ATINN has CONVERSION EXIT, so you need to convert it first before you use it in the SELECT statement. Follow this example:

DATA: atinn TYPE atinn.

CALL FUNCTION 'CONVERSION_EXIT_ATINN_INPUT'
  EXPORTING
    input  =  'US_FRENCH_ON'
  IMPORTING
    output = atinn.

DATA : v_charvalue TYPE atwrt.

SELECT atwrt
UP TO 1 ROWS
INTO v_charvalue
FROM ausp
WHERE objek = mcha-matnr
AND atinn = atinn
AND klart = '101'.
ENDSELECT.

Regards,

Lim...