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

check Quantity input

Former Member
0 Likes
1,969

Hi,

I'm developing a program which uploads data from a text file (.csv) and creates sales orders.

The user inputs material quantity in a format according to his user profile settings. (decimal point might be , or .)

Now I need to check whether the value input is according to the profile settings, if not I include this record in error log.

If value input is in correct format, I need to convert the value entered to SAP internal format (eg: 34,563 to 34.563) before passing it to bapi.

I used function module CATS_NUMERIC_INPUT_CHECK, but it works for nummbers with upto 2 decimal places. But quatity has 3 decimal places.

Please guide me.

Regards,

Ravi

3 REPLIES 3
Read only

Former Member
0 Likes
900

Hi,

You probably reading text file into an internal table (say it_data).

All filed of you internal table should be of type char.

And before uploading it to BAPI or BDC. You should change format according to user profile settings.

Write it_data-mat_qty to lv_mat_qty.

Then this variable lv_mat_qty will have decimal point as per user profile settings.

Ashutosh

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
900

This thread will help you

Read only

Former Member
0 Likes
900

the FM: CATS_NUMERIC_INPUT_CHECK works for checking quantity input format also. Don't get confused with decimal format of rate and quantity as they are not same