‎2008 Jun 13 11:41 AM
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.
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 ????
‎2008 Jun 13 11:42 AM
Hi,
V_FNAME should have the type RLGRAP-FILENAME.
Regards,
Vamshidhar
‎2008 Jun 13 11:43 AM
hi ,
Change the decleration of v_fname.
DATA: V_FNAME TYPE RLGRAP-FILENAME.
Regards,
Sachin M M
‎2008 Jun 13 11:44 AM
Hi!
Try it like this:
DATA: v_fname TYPE RLGRAP-FILENAME. "instead of string
Regards
Tamá
‎2008 Jun 13 11:45 AM
hi!!!
Instead of the function module 'alsm_excel_internal_table'
try to use the function module 'gui_upload'. U can do it easily...
‎2008 Jun 13 11:46 AM
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
‎2008 Jun 13 11:46 AM
hiii
take v_fname as TYPE C length 128.
or declare as RLGRAP-FILENAME.It will work correctly
reward if useful
thx
twinkal
‎2008 Jun 13 11:53 AM
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.
‎2008 Jun 13 12:00 PM
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