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: 

Problem with units MARA

former_member582701
Contributor
0 Kudos

Hi all,

I have next issue:

When i do:

SELECT meins

FROM MARA

INTO l_meins

WHERE mara = i_matnr-matnr.

IF l_meins EQ 'TS'......

The value of l_meins should be TS but select returns TH. But when you go to MARA through SE16 and insert the matnr and meins (with TS) you obtain the result but MEINS has TH value. Again, if you do a double click in the line, MEINS appears with TS.

Are there any FM to convert TH into TS?

I can't use T006 talbe because i have the same issue.

Thx

1 ACCEPTED SOLUTION

JozsefSzikszai
Active Contributor

hi Manel,

this happens because there are conversion exits behind MEINS. This means, everything is stored in German in the database, but displayed in logon language (you can turn this off in SE16). In ABAP you have to handle this accordingly.

The following FMs are used for the conversion:

CONVERSION_EXIT_CUNIT_INPUT

CONVERSION_EXIT_CUNIT_OUTPUT

hope this helps

ec

3 REPLIES 3

JozsefSzikszai
Active Contributor

hi Manel,

this happens because there are conversion exits behind MEINS. This means, everything is stored in German in the database, but displayed in logon language (you can turn this off in SE16). In ABAP you have to handle this accordingly.

The following FMs are used for the conversion:

CONVERSION_EXIT_CUNIT_INPUT

CONVERSION_EXIT_CUNIT_OUTPUT

hope this helps

ec

Former Member

In the data element MEINS, there is a domain MEINS. navigating to this domain you can see there is a conversion exit bound to that domain.

so these two FM´s might be quite useful for you.

CONVERSION_EXIT_CUNIT_INPUT

CONVERSION_EXIT_CUNIT_OUTPUT

Former Member
0 Kudos

Some values stored in database tables are not the same when they are displayed.

This is because they pass through conversion routine when they are displayed.

If you check the converison routine for MEINS in its domain, it is CUNIT

i.e FMs :CONVERSION_EXIT_CUNIT_INPUT

CONVERSION_EXIT_CUNIT_OUTPUT

Execute the FM CONVERSION_EXIT_CUNIT_INPUT to find out the storage value.

INPUT= TS will give OUTPUT=TH

Execute the FM CONVERSION_EXIT_CUNIT_OUTPUT to find out the display value.

INPUT= TH will give OUTPUT=TS

In code you will always have to use the storage value i.e TH in your case.

Else if you want to convert it to TH use the FM CONVERSION_EXIT_CUNIT_INPUT