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

Conversion Exits

Former Member
0 Likes
766

Hi all

In my report program, i am calling a conversion exit dynamically(i.e) the name of the conversion exit for a particular data type is generated accordingly.

The data is converted by the conversion exit to the specified format( i used MATNR)

for a value 3 it converted to 000000000000000003 (which is the proper format for MATNR).

but still i am not able to fetch values on the basis of this.

But if in my select option i pass the value of MATNR as 000000000000000003 directly, the correct data is fetched.

Note: For all other fields (such as ebeln, correct data is fetched, so it rules out any problems with the select query)

Plz help.

Thanks & Regards

Ravish Garg

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
720

Hi

Paste the code of that Select statement where you are using the conversion exit for this Material

because nothing wrong with the Material and conversione xit

Reward points for useful Answers

Regards

Anji

3 REPLIES 3
Read only

Former Member
0 Likes
721

Hi

Paste the code of that Select statement where you are using the conversion exit for this Material

because nothing wrong with the Material and conversione xit

Reward points for useful Answers

Regards

Anji

Read only

0 Likes
720

<b>* select statement to get the conversion exit name for the field *</b>

select convexit

into varconv_exit

from dd01l

where domname = vardomname.

endselect.

<b>

  • if conversion exit found for a field *</b>

concatenate 'CONVERSION_EXIT_'

varconv_exit

'_INPUT'

into

varconv_exit.

perform f_conversion_exit

using p_table

p_field

varconv_exit:

changing s_range-low,

s_range-high.

<b>&----


*& Form f_conversion_exit

&----


  • text

----


  • <--P_S_RANGE_LOW text

  • <--P_S_RANGE_HIGH text

----


</b>

form f_conversion_exit using p_tabname

p_fname

p_convexit

changing p_value1.

call function p_convexit

exporting

input = p_value1

importing

output = p_value1

exceptions

length_error = 1

others = 2.

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

endform. " f_conversion_exit

<b>&----


*& Form get_data

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form get_data .</b>

select * into corresponding fields of table <dyn_table>

from (p_table) where (it_where) .

if sy-dbcnt = 0.

write 😕 'No Data matching Your Criteria!'.

leave program.

endif.

endform. " get_data

When i put matnr in the filed name and a value for it,

it gets the right conversion exit name : "CONVERSION_EXIT_MATN1_INPUT" for matnr.

Read only

0 Likes
720

Hi

Do it like this:

if v_convexit ne ' '.

concatenate 'CONVERSION_EXIT_'

v_convexit

'_INPUT'

into

v_convexit.

  • A perform called to call a conversion exit function module

loop at s_range into wa_srange.

perform f_conversion_exit

using p_table

p_field

v_convexit :

changing wa_srange-low,

wa_srange-high .

modify s_range from wa_srange.

endloop.

endif.

Regards

Preeti