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

BAPI does not return the expected/correct UOM

Former Member
0 Likes
1,860

All,

Can someone please help me determine why the BAPI BAPI_MATERIAL_GET_ALL returns a German UOM for a material when it is configured in the Material Master as English. For example in MM03 I see three UOMs configured for the material with GAL being the default. When the BAPI runs the data received specifies the UOM to be GLL, which is the German version of GAL. Any ideas or suggestions to fix this? I've tried this with both a German and English user and the BAPI data is always the same.

Thanks.

Sam

6 REPLIES 6
Read only

Former Member
0 Likes
1,372

We run ECC 6.0 in our company and we noticed a similar issue with BAPI_MATERIAL_GETALL reporting UOM in GERMAN. Our default lang. is English and I am trying to find a resolution to this issue. Really appreciate if someone could suggest how to resolve this issue. Thanks!

Read only

Former Member
0 Likes
1,372

Hi,

BAPI is always returning the data in the Input format. The Input format of GAL is GLL. In table level also you will see the same. What you see is ithe output format in MM03. Use CONVERSION_EXIT_CUNIT_OUTPUT to convert GLL to GAL. Even if you login in French you should get the same result.

I hope this helps.

Regards.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,372

BAPI works in internal format (so the "german" language internal code of unit of measure) ([Internal and External Data Formats|http://help.sap.com/saphelp_nw04/helpdata/en/a5/3ec9ea4ac011d1894e0000e829fbbd/content.htm])

Fields in BAPI parameters must be presented in the internal form used in the database and not in a form formatted in the BAPI interface.

Reason : The internal format is used since the server cannot anticipate client-specific data.

So i you want to display data in external format you must convert it, you can use classical conversion exit FM, or WRITE statement, or even use BAPI BapiService.DataConversionInt2Ext1 (BAPI_CONVERSION_INT2EXT1)

Regards,

Raymond

Read only

madhu_vadlamani
Active Contributor
0 Likes
1,372

HI sam,

Check as Raymond suggested.You have to convert that UOM by using FM.

Regards,

Madhu.

Read only

0 Likes
1,372

'GLL' is the ISO-Code for 'GAL' (at least as SAP is concerned). The BAPI always uses the ISO-code, and the conversion is done with FM 'UNIT_OF_MEASURE_SAP_TO_ISO'.

Read only

0 Likes
1,372

The BAPI always uses the ISO-code

There is always a field for internal value, when BAPI returns values it fills both fields, when it receives it only uses ISO code if internal field is empty/not sent. Here BAPI_MATERIAL_GET_ALL returns in CLIENTDATA two fields for the base unit: BASE_UOM (internal code, i.e. german) and BASE_UOM_ISO (ISO code) - You can perform some check by generating some MAP2 FM via transaction BDBS (those generated FM use the required FM to code from and to ISO code)

Read ([Internal and External Data Formats|http://help.sap.com/saphelp_nw04/helpdata/en/a5/3ec9ea4ac011d1894e0000e829fbbd/content.htm])

  • * ISO codes

In an SAP System, ISO codes are currently supported for language, country, currency, and unit of measure fields.

If you use one or more of these fields in your BAPI you have to make two fields available for each of these fields in the BAPI interface: one field containing the SAP code and another containing its corresponding ISO code. Use the naming convention, Fieldname_for_SAPCode_ISO for the field containing the ISO code.

Implement the BAPI as follows:

o When you export data from the BAPI both fields must contain corresponding values.

o When you import data into the BAPI the ISO code is only significant if no value was given in the SAP code.

Regards,

Raymond