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

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

Former Member
0 Likes
703

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.....

3 REPLIES 3
Read only

Former Member
0 Likes
560

Are u using an excell file?

If not (text, csv file), please use function module GUI_UPLOAD

Read only

Former Member
0 Likes
560

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

Read only

Former Member
0 Likes
560

please refer to my post in this thread.it might help.

https://www.sdn.sap.com/irj/sdn/profile?editmode=true&userid=3709716