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

select query

former_member582701
Contributor
0 Likes
760

Hello!

I have this select:

SELECT SINGLE AUFPL

FROM AFKO

INTO l_aufpl

WHERE AUFNR = i_header-benum.

But i_header-benum has long 10 and AUFNR has long 12. I need compare AUFNR+2(10) with i_header-benum.

Ty

Points are garanteed.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
684

Hello,

Do like this.


concatenate i_header-benum '%' into i_header-benum..
SELECT SINGLE AUFPL
FROM AFKO
INTO l_aufpl
WHERE AUFNR like i_header-benum. " Check here

If useful reward.

Vasanth

5 REPLIES 5
Read only

Former Member
0 Likes
684

Hi

When you are using for all entries and comparing the table fields with other internal table field both the fields should be of same type and length

Move the i_header-benum to 12 CHAR varaible and pass to AUFNR in the where clause.

Reward points for useful Answers

Regards

Anji

Read only

Former Member
0 Likes
685

Hello,

Do like this.


concatenate i_header-benum '%' into i_header-benum..
SELECT SINGLE AUFPL
FROM AFKO
INTO l_aufpl
WHERE AUFNR like i_header-benum. " Check here

If useful reward.

Vasanth

Read only

Former Member
0 Likes
684

Hi

You cant use offset values inside the select query...You have to select the values first inti the internal table then do the search. Anyway inside select it's not possible...

Reward All Helpfull answers..............

Read only

former_member582701
Contributor
0 Likes
684

the problem is that benum is like

0001000324 and aufnr like

XX0001000324.

If i copy benum into a char 12 is not working yet.

____________

ok, % has worked but concatenating into a char 12 and put % before not after.

Biju, you can do it like vasanth has told.

Message was edited by:

Manel Casadesus

Read only

Former Member
0 Likes
684

Hi,

Pass the variables i_neadre-benum and AUFNR to function

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

and store it in to variabales and then compare those 2 variables.

Regards

Jitendra