‎2011 Nov 17 11:39 AM
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.
‎2011 Nov 17 11:52 AM
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.
‎2011 Nov 17 12:12 PM
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.
‎2011 Nov 17 7:08 PM
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.
‎2011 Nov 17 8:45 PM
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
‎2011 Nov 18 4:51 AM
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
‎2011 Nov 23 11:40 AM