‎2010 Jan 25 7:14 AM
Dear Friends,
I have created one selection screen with one selection-options field.
Ex : select-options : s_bukrs for t001-bukrs.
here for this i am providing input as 100 to 110 range. And writing select statement like this,
select * from t001 into table it_t001 where bukrs in s_bukrs.
With this select statment i am getting 1000 company code information. But i didnt provide 1000 as an input on the selection screen, even though it is getting 1000 company code information.
The reason is when i am providing 100-110 range of input on the selection screen, it is converting internally as 0100-0110. Bcoz bukrs data type is char and size is 4. So how to perform internal conversion for this.
Thanks in Advance.
‎2010 Jan 25 7:41 AM
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = s_bukrs
IMPORTING
output = s_bukrs.Use before select query
Edited by: Kumar Manas Mishra on Jan 25, 2010 8:41 AM
‎2010 Jan 25 7:36 AM
Hi,
Either concatenate zeros in front of the values
or the best way is to check for conversion routine for t001-bukrs.
Go to se11 and check domain of bukrs in too1 table,
if there are any conversion routine then call them in your program also.
and after doing conversion only,
pass it in the select query.
Rgds/Abhi
‎2010 Jan 25 7:41 AM
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = s_bukrs
IMPORTING
output = s_bukrs.Use before select query
Edited by: Kumar Manas Mishra on Jan 25, 2010 8:41 AM
‎2010 Jan 25 7:56 AM
Hi Kumar,
As you said, I tried using conversion exit input function module, But no use.
‎2010 Jan 25 8:05 AM
Hello jyotsna dm ,
Give a break point
at AT SELECTION-SECREEN OUTPUT event and see what values are populating in your select-option range table
as far as i know its doing it correctly have tested it ....
and then fire a query no need for any conversion or so
‎2010 Jan 25 8:38 AM
Hi Kumar,
s_bukrs is only a header line of s_bukrs[], so it is not sufficient to perform conversion for this header line. It is necessary for all its lines. So probably something like:
DATA: lv_index TYPE sy-tabix.
LOOP AT s_bukrs[] INTO s_bukrs.
lv_index = sy-tabix.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = s_bukrs-low
IMPORTING
output = s_bukrs-low.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = s_bukrs-high
IMPORTING
output = s_bukrs-high.
MODIFY s_bukrs[] FROM s_bukrs INDEX lv_index.
ENDLOOP.Regards,
Adrian
‎2010 Jan 25 9:50 AM
Jagrik Adrian is right in what he suggests. However you only need a MODIFY s_bukrs. before ENDLOOP. Within a LOOP a modify on a table with a HEADER LINE always takes the current line as the line to be modified.