‎2008 Jan 22 3:27 PM
Hi experts,
I have a doubt in fn module..
i gave the flat file data as
matnr mbrsh mtart maktx meins
z58723 m roh dfsdfsd kg
z57934 m roh rsdrss ea
when i am uploading from excel to mm01 t.code
in matnr it takes z58723 and in
mbrsh it takes z not m and in mtart it takes z587 not roh....
i think u can understand.....help me please.....
‎2008 Jan 22 3:48 PM
Are u using an excell file?
If not (text, csv file), please use function module GUI_UPLOAD
‎2008 Jan 22 3:55 PM
Hello,
Check with this sample.
DATA: G_T_FILE LIKE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
*download the excel data into an internal table
IF NOT P_FILE IS INITIAL.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = P_FILE
I_BEGIN_COL = G_C_START_COL
I_BEGIN_ROW = G_C_START_ROW
I_END_COL = G_C_END_COL
I_END_ROW = G_C_END_ROW
TABLES
INTERN = G_T_FILE
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE E000(SU) WITH TEXT-004.
ENDIF.
ENDIF.
LOOP AT G_T_FILE.
IF G_T_FILE-COL = '1'.
G_T_DEBI-KUNNR = G_T_FILE-VALUE.
ENDIF.
IF G_T_FILE-COL = '2'.
G_T_DEBI-LAND1 = G_T_FILE-VALUE.
ENDIF.
IF G_T_FILE-COL = '3'.
G_T_DEBI-VBUND = G_T_FILE-VALUE.
ENDIF.
IF G_T_FILE-COL = '4'.
G_T_DEBI-AKONT = G_T_FILE-VALUE.
ENDIF.
AT END OF ROW.
APPEND G_T_DEBI.
CLEAR G_T_DEBI.
ENDAT.
ENDLOOP.
Cheers,
Vasanth
‎2008 Jan 23 5:22 AM
please refer to my post in this thread.it might help.
https://www.sdn.sap.com/irj/sdn/profile?editmode=true&userid=3709716