Application Development 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: 

Somebody clarify me about Conversion_exit Function module usage after data upload

kirankumark2
Participant
0 Kudos

I have developed an upload program with 2 columns (Material and Quantity) using ALSM_EXCEL_TO_INTERNAL_TABLE Function module. Once file path is selected this FM Returns an internal table with column wise data. Now, if i want to pass this column wise data to my internal table, In this case please clarify me about below

1.Is it necessary to use CONVERSION_EXIT_ALPHA_INPUT on Material number field as user is uploading this data from excel?

2. Once my internal table is filled i need to pass same data to MARA table to check availability of material as user uploading bulk data through Excel, Can i use my uploaded data internal table directly to MARA select query (using FOR ALL ENTRIES) or am i need to Loop it and use CONVERSION_EXIT.

+

1 ACCEPTED SOLUTION

bbalci
Contributor
0 Kudos

Hi Kiran,

There are internal and external formats for different fields , for Material Number internal format includes zeroes in the beginning and external format doesn't.
For example "00000....11" is internal format and just "11" is external format.

1- Yes you need to use conversion exits before updating any table in database,
by just looping and and calling conversion exit function modules.

But actually correct conversion exit for material number is CONVERSION_EXIT_MATN1_INPUT.

To find correct conversion exit : Go to SE11 > Display MARA table > Double click on MATNR field and then Go to domain and open "Definition" tab .. You'll see "MATN1" is the conversion exit there.
Double click on it and you'll see conversion exit functions on a popup

2 - For a better performance , I would first make a loop and make conversions on fields,
and then I would read MARA table by a SELECT with FOR ALL ENTRIES and check whether material number valid or not.

I hope it was useful
Bulent Balci

4 REPLIES 4

bbalci
Contributor
0 Kudos

Hi Kiran,

There are internal and external formats for different fields , for Material Number internal format includes zeroes in the beginning and external format doesn't.
For example "00000....11" is internal format and just "11" is external format.

1- Yes you need to use conversion exits before updating any table in database,
by just looping and and calling conversion exit function modules.

But actually correct conversion exit for material number is CONVERSION_EXIT_MATN1_INPUT.

To find correct conversion exit : Go to SE11 > Display MARA table > Double click on MATNR field and then Go to domain and open "Definition" tab .. You'll see "MATN1" is the conversion exit there.
Double click on it and you'll see conversion exit functions on a popup

2 - For a better performance , I would first make a loop and make conversions on fields,
and then I would read MARA table by a SELECT with FOR ALL ENTRIES and check whether material number valid or not.

I hope it was useful
Bulent Balci

0 Kudos

Thanks for your Reply. Could you please clarify me about these also

1. Can't i use CONVERSION_EXIT_ALPHA_INPUT Function module ..Instead of CONVERSION_EXIT_MATN1_INPUT..Could you please differentiate these two.

2. In the same program i am using method FILE_SAVE_DIALOG to download an empty template only with column headings for user reference sample upload format, If i want to download an Excel sheet template to my desktop from SAP what parameters am i need to pass to above method and GUI_DOWNLOAD method. I am bit confused about Excel download Logic parameters. There is an EXPORT parameter called default_extension in FILE_SAVE_DIALOG.....what is the use of this parameter

and

In GUI_DOWNLOAD method filetype parameter is there. What values do i need to pass to get Excel template download from SAP to desktop.

bbalci
Contributor
0 Kudos

Hi,

1- In this case you can use Alpha instead of Matn1 conversion .. there is no difference. But just for your future integration codes, for any database field , I wanted to explain how to pick a conversion exit.

2. Check class cl_gui_frontend_services and try to find examples.

I wish you success

Bulent Balci

0 Kudos

Thank you so much for your time on clarifying my Doubts..