‎2007 Jun 13 5:06 PM
I am using Perform to upload two files to two internal table of diffrent structures.
DATA: BEGIN OF itab OCCURS 0,
data(200),
END OF itab.
DATA: BEGIN OF itabtxt OCCURS 0,
f01(4),
f02(10),
f03(18),
f04(3),
f05(3),
f06(6),
f07(25),
f08(10),
f09(20),
f10(8),
f11(50),
f12(10),
f13(12), "+§sr01
END OF itabtxt.
perform load_excel_file using z_x changing itab.
perform load_excel_file using z_x changing itabtxt.
form load_excel_file using p_z_x changing p_itab type table.
data: lzc_filename type string.
lzc_filename = pdatei.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = lzc_filename
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = p_z_x
IMPORTING
FILELENGTH = bytes
tables
data_tab = p_itab
endform.
I am getting error "Actual Parameter ITAB and Formal Parameters P_ITAB are incompatible". Please try to solve the problem.
‎2007 Jun 13 5:13 PM
in PERFORM statement you should have TABLES parameter to get an internal table
I dont think you can use the same PERFORM to upload data into 2 diff internal tables.
Because you need declare TABLES TYPE <Struct>...where <struct> will eb different for both internal tables.
Use macro for this...give like below
data_tab = &1
when you call macro you can pass itab as parameter
Message was edited by:
Aarun Sailyendran Murugesan
‎2007 Jun 13 5:22 PM
Hi,
Try something like this. You can not using same routine with different change parameters of different types.
DATA: BEGIN OF itab occurs 0,
data(200),
END OF itab.
DATA: BEGIN OF itabtxt,
f01(4),
f02(10),
f03(18),
f04(3),
f05(3),
f06(6),
f07(25),
f08(10),
f09(20),
f10(8),
f11(50),
f12(10),
f13(12), "+§sr01
END OF itabtxt.
perform load_excel_file using z_x changing itab itabtxt.
form load_excel_file using p_z_x changing p_itab type table
p_itabtxt type table.
data: lzc_filename type string.
lzc_filename = pdatei.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = lzc_filename
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = p_z_x
IMPORTING
FILELENGTH = bytes
tables
data_tab = p_itab
endform.Rgds,
Naren
‎2007 Jun 13 5:22 PM
Try this :
DATA: BEGIN OF itabtxt OCCURS 0,
f01(4),
f02(10),
f03(18),
f04(3),
f05(3),
f06(6),
f07(25),
f08(10),
f09(20),
f10(8),
f11(50),
f12(10),
f13(12), "+§sr01
END OF itabtxt.
perform load_excel_file tables itab using z_x.
perform load_excel_file tables itabtxt using z_x.
form load_excel_file tables p_itab using p_z_x.
data: lzc_filename type string.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = lzc_filename
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = p_z_x
tables
data_tab = p_itab.
endform.
‎2007 Jun 13 5:29 PM
Hello Mahesh,
Do not use Tables command in subroutine ,it is performance issue,so call diffrent perform statement that what you have.
I have done trace for this type scenario
Thanks
Seshu