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

error with excel upload

Former Member
0 Likes
990

Hi

it is going to dump.

in the debugging , when it reaches the alsm_excel_internal_table

at filename parameter it is going to dump

in error it is saying the wrong with filename(v_fname).

i have declared v_fname and p_fname as

parameters: P_FNAME LIKE RLGRAP-FILENAME MODIF ID P1,

UNIXFILE LIKE RLGRAP-FILENAME MODIF ID P2.

DATA: V_FNAME TYPE STRING.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
MOVE P_FNAME TO V_FNAME. LEN = STRLEN( V_FNAME ). LEN = LEN - 3. IF V_FNAME+LEN(3) = 'xls'. PERFORM EXCEL_UPLOAD. ELSE. . PERFORM TEXT_UPLOAD. . . . FORM EXCEL_UPLOAD . . CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE' EXPORTING FILENAME = V_FNAME I_BEGIN_COL = '1' I_BEGIN_ROW = '1' I_END_COL = '10' I_END_ROW = '100' TABLES INTERN = I_XLTAB EXCEPTIONS INCONSISTENT_PARAMETERS = 1 UPLOAD_OLE = 2 OTHERS = 3 . IF SY-SUBRC <> 0. ENDIF. ... . . .ENDFORM.

pls give me a suggestion ????

8 REPLIES 8
Read only

Former Member
0 Likes
963

Hi,

V_FNAME should have the type RLGRAP-FILENAME.

Regards,

Vamshidhar

Read only

sachin_mathapati
Contributor
0 Likes
963

hi ,

Change the decleration of v_fname.

DATA: V_FNAME TYPE RLGRAP-FILENAME.

Regards,

Sachin M M

Read only

Former Member
0 Likes
963

Hi!

Try it like this:

DATA: v_fname TYPE RLGRAP-FILENAME. "instead of string

Regards

Tamá

Read only

Former Member
0 Likes
963

hi!!!

Instead of the function module 'alsm_excel_internal_table'

try to use the function module 'gui_upload'. U can do it easily...

Read only

Former Member
0 Likes
963

Hi ,

try to defien like this for getting file path.

parameters : p_file like rlgrap-filename.

at selection-screen on value-request for p_file.

CALL FUNCTION 'F4_FILENAME'

EXPORTING

PROGRAM_NAME = SYST-CPROG

DYNPRO_NUMBER = SYST-DYNNR

  • FIELD_NAME = ' '

IMPORTING

FILE_NAME = v_file.

if v_file is not initial.

p_file = v_file.

endif.

start-of-selection.

u_file = p_file.

use fucntion module for upload data.

Regards,

Vishvesh

Read only

Former Member
0 Likes
963

hiii

take v_fname as TYPE C length 128.

or declare as RLGRAP-FILENAME.It will work correctly

reward if useful

thx

twinkal

Read only

0 Likes
963

hi thanks to all

but i have declared

parameters: p_fname type rlgrap-filename.

data : v_fname type string.

then after f4_filname

i used move p_fname to v_fname.

Read only

0 Likes
963

Hi,

Even though u move p_fname to v_fname , the decleration of v_fname should be of type rlgrap-filename because the filename(of ALSM_EXCEL_TO_INTERNAL_TABLE ) is of type RLGRAP-FILENAME .

Or u can do this

parameters: P_FNAME LIKE string MODIF ID P1,

UNIXFILE LIKE RLGRAP-FILENAME MODIF ID P2.

DATA: V_FNAME TYPE RLGRAP-FILENAME .

LEN = STRLEN( P_FNAME ).

LEN = LEN - 3.

MOVE P_FNAME TO V_FNAME.

IF V_FNAME+LEN(3) = 'xls'.

PERFORM EXCEL_UPLOAD.

ELSE.

. PERFORM TEXT_UPLOAD.

Regards,

Sachin M M

Edited by: Sachin Mathapati on Jun 13, 2008 4:31 PM