2013 Oct 15 7:43 AM
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.
2013 Oct 15 10:08 AM
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.
2013 Oct 15 7:53 AM
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
2013 Oct 15 7:58 AM
2013 Oct 15 8:00 AM
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!
2013 Oct 15 9:40 AM
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
2013 Oct 16 8:35 AM
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?
2013 Oct 15 8:15 AM
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
2013 Oct 15 8:33 AM
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.
2013 Oct 15 9:35 AM
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
2013 Oct 15 10:08 AM
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.
2013 Oct 16 10:11 AM
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
2013 Oct 16 11:01 AM
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
2013 Oct 16 12:56 PM
Hi Hari,
As Vinod Iyer 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.