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

Problem with units MARA

former_member582701
Contributor
0 Likes
1,409

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
Read only

JozsefSzikszai
Active Contributor
1,252

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

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

3 REPLIES 3
Read only

JozsefSzikszai
Active Contributor
1,253

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

Read only

Former Member
1,252

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

Read only

Former Member
0 Likes
1,252

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