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

Regarding Internal Conversion

Former Member
0 Likes
839

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
789
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

6 REPLIES 6
Read only

Former Member
0 Likes
789

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

Read only

Former Member
0 Likes
790
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

Read only

0 Likes
789

Hi Kumar,

As you said, I tried using conversion exit input function module, But no use.

Read only

0 Likes
789

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

Read only

0 Likes
789

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

Read only

0 Likes
789

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.