Skip to Content

Problem with units MARA

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Jan 30, 2008 at 11:44 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 11:44 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 11:46 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.