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

Help with a very basic select

Former Member
0 Likes
865

Hi, I am embarrassed to say this but I can't figure out why this select isn't working.

SELECT single adrnr INTO w_adrnr FROM lfa1
  WHERE lifnr = w_lifnr.

I know that I have a match in LFA1 where LIFNR = W_LIFNR but the select will not return anything. Can you tell me what [obvious] mistake I have made?

Regards,

Davis

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
845

Just a guess - but does w_lifnr contain the leading zeroes?

Rob

7 REPLIES 7
Read only

Former Member
0 Likes
845

Davis,

did you see data at SE11 ? if so then use

Use Below FM -> pass CONVERSION_EXIT_ALPHA_INPUT

give input w_lifnr and output is w_lifnr

SELECT single adrnr INTO w_adrnr FROM lfa1

WHERE lifnr = w_lifnr.

now see the results

Thanks

Seshu

Read only

0 Likes
845

Seshu, thanks for the reply. Can I call this function module inside a SmartForm? I just tried it and it gives me a syntax error saying that CONVERSION_EXIT_ALPHA_INPUT is unknown. I guess maybe I need to put it in the global definitions?

Regards,

Davis

Read only

Former Member
0 Likes
846

Just a guess - but does w_lifnr contain the leading zeroes?

Rob

Read only

0 Likes
845

No it doesn't, I guess that is the problem.

Rob, thanks for the help. I didn't even think about the leading zeros. Now I feel even dumber than I did 10 minutes ago.

Davis

Message was edited by:

Davis

Read only

Former Member
0 Likes
845

It's working man...

data: w_ADRNR like lfa1-ADRNR.

parameters: w_lifnr like lfa1-lifnr.

start-of-selection.

select single adrnr from lfa1 into w_adrnr where lifnr = w_lifnr.

check sy-subrc eq 0.

write:/ w_adrnr.

Read only

ferry_lianto
Active Contributor
0 Likes
845

Hi,

Your coding seems fine

How did you declare W_ADRNR and W_LIFNR?

Please check table LFA1 (SE16) and see whether you have record for the corresponding LIFNR.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
845

Try:



CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
  EXPORTING
    input  = w_lifnr
  IMPORTING
    output = w_lifnr.

SELECT SINGLE adrnr INTO w_adrnr FROM lfa1
  WHERE lifnr = w_lifnr.

Rob