Skip to Content
avatar image
Former Member

Fetching Material Base Unit from MARA in EN language in ABAP

Hi,

My issue is that when I want to retrieve any unit of measure field from any table in SAP using SELECT statement in ABAP, then system will retrieve this unit with code different than what is maintained in EN language.

suppose I want to retrieve base unit of measure for a material (MARA-MEINS), and the unit is PAC, but the retrieved unit code is PAK instead of PAC, and if the material base unit code is KG, then retrieved unit code is ST.

SELECT MATNR MEINS INTO IT_MARA FROM MARA

I assume the system it is retrieving the unit in Deutsch, but not in English. When I retrieve MARA records using T.Code SE16N, then the retrieved unit comes in EN language.

How would retrieve the material units from the SAP standard tables that are defined in EN language which the user is familiar with.

Thank you.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • May 16, 2017 at 11:15 AM

    Why don't you use the same solution, than SE16n or everty standard report/dynpro, use the conversion exit associated to the domain CONVERSION_EXIT_C***T_OUTPUT (or a simple WRITE statement) to convert unit of measure from internal (Deutsch) to external format (logon/current language).

    Add comment
    10|10000 characters needed characters exceeded

  • May 16, 2017 at 12:15 PM

    Please use BAPIs to read business data where possible. Your problem is exactly the type of scenario they avoid.

    For material, BAPI_MATERIAL_GETALL should do the job.

    Edit: Just saw your comment. If you are pulling a table of materials out, there's BAPI_MATERIAL_GETLIST, but I don't think it includes quantities.

    You can also do conversions using string templates, I think it should be possible to do an alpha conversion in an SQL statement, not tried it myself.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 18, 2017 at 04:30 AM

    Thank you all for your support.

    I couldn't understand how to join T006A with MARA table, and BAPI_MATERIAL_GETALL will not help me in my case because I'm also joining other tables related to BOM like STKO and STPO. Finally, I decided to loop through my internal table, pass the internal unit in DE language into FM CONVERSION_EXIT_CUNIT_OUTPUT and get the equivalent in EN language.

    Add comment
    10|10000 characters needed characters exceeded