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

Character Conversion

Former Member
0 Likes
716

Hello guys,

I am reading a field in selection screen(DFKKOP-GPART) which is 10 charcters long. This field is then compared in a select query with another field (DFKKZP-SELW1) which is 35 charcters long. Please help. I can use aplha conversion module and pass the selection screen variable to an internal table and then compare it in the select query, but i am already comparing another internal table in that select query.

6 REPLIES 6
Read only

surajarafath
Contributor
0 Likes
681

both the data type will be different how can you compare..?

even you compare that one will that make sense ..?? iam not sure..

anyway try like this..

SELECT...
WHERE  SELW1(10)  eq DFKKOP-GPART.

Read only

Former Member
0 Likes
681

Both of them are CHAR type. I could have used SELW1 = DFKKOP-GPART but GPART is a selection screen text.

So i have to use SELW1 IN DFKKOP-GPART and i cant specify the length if field while using "IN" keyword.

Read only

0 Likes
681

Declara a range LR_SELW1 of type SELW1 and populate if from select option of DFKKOP-GPART and use LR_SELW1 in the select statement.

Read only

Former Member
0 Likes
681

Hi,

Only way you can compare is using off set comparing 10 character. For. ex. +25(10).

Other wise how would system know what to compare?

Hope, helped!!

Reetesh

Read only

Former Member
0 Likes
681

Hi,

1.Declare two variables with type DFKKZP-SELW1

Data: selw1 type DFKKZP-SELW1,

selw2 type DFKKZP-SELW1.

2.use the function module twice like this:

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = selection screen_field_name(DFKKOP-GPART)-low

IMPORTING

OUTPUT = selw1

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = selection screen_field_name(DFKKOP-GPART)-high

IMPORTING

OUTPUT = selw2

3.use selw1 and selw2 in select query like this:

select.......where field_name in (selw1

,selw2).

This will work.

Regards,

Priyanka

Read only

Former Member
0 Likes
681

-