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

Internal unit 12, Language EN is not maintained. Error

Former Member
0 Likes
3,712

Hi,

I am trying to upload an Excel file to an internal table using alsm_excel_to_internal_table FM, during the course I am getting this error, here's how..

After getting the data in the Internal Table IT_C type ALSMEX_TABLINE. I am converting the data into an Internal table IT_S as per my DB table.

LOOP AT IT_C INTO WA_C.

AT NEW ROW.

APPEND INITIAL LINE TO IT_S ASSIGNING <STRUC>.

ENDAT.

ASSIGN COMPONENT WA_C-COL OF STRUCTURE <STRUC> TO <FIELD>.

IF SY-SUBRC EQ 0.

<FIELD> = WA_C-VALUE.

ENDIF.

AT END OF ROW.

IF <STRUC> IS NOT INITIAL.

LV_TOT_ROWS = LV_TOT_ROWS + 1. "LV_TOT_ROWS TYPE I

ENDIF.

ENDAT.

ENDLOOP.

And thereafter I am writing the data and getting the above mentioned error.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,170

Hi Hari,

Can I have the screenshot of the Excel File that you are uploading and the corresponding structure of the Internal table that you are mapping against in SAP. So that I can help you.

Regards,

Narayana Reddy A V L.

Hi,

I am trying to upload an Excel file to an internal table using alsm_excel_to_internal_table FM, during the course I am getting this error, here's how..

After getting the data in the Internal Table IT_C type ALSMEX_TABLINE. I am converting the data into an Internal table IT_S as per my DB table.

LOOP AT IT_C INTO WA_C.

AT NEW ROW.

APPEND INITIAL LINE TO IT_S ASSIGNING <STRUC>.

ENDAT.

ASSIGN COMPONENT WA_C-COL OF STRUCTURE <STRUC> TO <FIELD>.

IF SY-SUBRC EQ 0.

<FIELD> = WA_C-VALUE.

ENDIF.

AT END OF ROW.

IF <STRUC> IS NOT INITIAL.

LV_TOT_ROWS = LV_TOT_ROWS + 1. "LV_TOT_ROWS TYPE I

ENDIF.

ENDAT.

ENDLOOP.

And thereafter I am writing the data and getting the above mentioned error.

12 REPLIES 12
Read only

rvinod1982
Contributor
0 Likes
3,170

Hi,

Check the internal table structure and excel file data.

Both should be in sync. Suppose for ex: the 1st field of internal table is of type DBMTR (Amount), then the 1st column of excel file should contain Amount Value only.

Regards,

Vinod

Read only

0 Likes
3,170

Thank you Vinod, but yes both are in sync.

Read only

former_member201275
Active Contributor
0 Likes
3,170

2 possible suggestions:

1. Look at note OSS 431031.

2. log on SAP system with language EN and use t-code CUNI to maintain the unit under language "EN", then try again!

Read only

0 Likes
3,170

Hi, Glen I am new to ABAP programming, and I am unaware of the T-code CUNI can U explain it a little further about it.. Or maybe paste a link explaining everything about CUNI.. Thank you

Read only

0 Likes
3,170

here we go:

http://wiki.scn.sap.com/wiki/display/SI/Unit+of+Measure+related+settings+in+SAP

PS: Have any of the answers people have provided here been helpful to you?

Read only

himanshu_gupta13
Product and Topic Expert
Product and Topic Expert
0 Likes
3,170

Dear Hari,

I think you are putting value 12 in the unit field of internal table and this 12 type unit is not maintained in the CUNI tcode. So, either you made a mistake or made an entry in CUNI in en language...

Refer to below entry

Many Thanks / Himanshu Gupta

Read only

Former Member
0 Likes
3,169

Hi Hari,

I think you are trying to move the UOM (Unit of Measure) from the Excel to Internal table as suggested by Himanshu Gupta.

Excel may have the un-converted UOM. There is a conversion exit for UOM in SAP.

Before moving the value into the <STRUC>, try converting the value by using the conversion exit.(CONVERSION_EXIT_CUNIT_INPUT for Conversion exit for commercial measurement unit INPUT).

You can get the correct conversion exit at the Domain level of the field for which you are trying to copy the contents.

The following is the screen shot for the DOMAIN MEINS (UOM).


Hope this will help you.

Thank you.

Regards,

Narayana Reddy A V L.

Read only

0 Likes
3,169

Your help is much appreciated, and much thanks for the Screenshot.. we have got 2 Quantity Field #1 Netwt type QUAN and Domain MENG13 and Reference Field is ERFME from MSEG table.. So the question is where to give Conversion Routine

Read only

Former Member
0 Likes
3,171

Hi Hari,

Can I have the screenshot of the Excel File that you are uploading and the corresponding structure of the Internal table that you are mapping against in SAP. So that I can help you.

Regards,

Narayana Reddy A V L.

Read only

0 Likes
3,167

Hi,

Here are the screen shot of the Excel Sheet and the DB table, which is exactly the structure of the internal table.. And Thank you very much

Read only

0 Likes
3,167

Hi,

In the database table the 1st field in MANDT. So when uploading data from excel to internal table the data of 1st column will go to MANDT column and not VENBCD.

This could can been easily found out in debugging.

Create a structure without MANDT field and use it in program.

It should work.

Regards,

Vinod

Read only

0 Likes
3,167

Hi Hari,

As   has suggested, create a structure without MANDT field and use it in your program.

The problem with your current code is that the first field (VENBCD) of your excel is going to MANDT field in your structure.

Accordingly, QUNTY value which is 12 is being copied to GEWEI (Which is Weight Unit).

As the weight unit 12 is not defined in your system, your are getting the error

"Internal unit 12, Language EN is not maintained".

Please revert in case of any issue..

Regards,

Narayana Reddy A V L.