2006 Jul 07 2:31 PM
Hello,
Say I have a piece of code like below:
FORM UPLOAD_PC_FILE USING P_PATH
P_INTERNAL_TABLE.
P_PCPATH_TOSTRING = P_PATH.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = P_PCPATH_TOSTRING
* FILETYPE = 'ASC'
* HAS_FIELD_SEPARATOR = ' '
* HEADER_LENGTH = 0
* READ_BY_LINE = 'X'
* DAT_MODE = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* CHECK_BOM = ' '
* VIRUS_SCAN_PROFILE =
* NO_AUTH_CHECK = ' '
IMPORTING
* FILELENGTH =
HEADER = WA_INBOUND
TABLES
DATA_TAB = P_INTERNAL_TABLE
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
Do I have to declare the P_INTERNAL_TABLE as an internal table or ABAP will automatically know that this is an internal table (I will always pass in internal tables when I call this form in the main program)?
Thanks a lot!
Regards,
Anyi
2006 Jul 07 2:33 PM
Hi,
Data_itab --> takes any internal table which u pass.
since Data_itab is not a type specific
u declare P_INTERNAL_TABLE as internal table of any type; as per ur requirement it will except.
exam.
data :P_INTERNAL_TABLE type table of z_struc
or
data :P_INTERNAL_TABLE type table of standard_structure
it will except any table; but u have to declare internal table of particular type
Message was edited by: Manoj Gupta
Hi,
Data_itab --> takes any internal table which u pass.
since Data_itab is not a type specific
u declare P_INTERNAL_TABLE as internal table of any type; as per ur requirement it will except.
exam.
data :P_INTERNAL_TABLE type table of z_struc
or
data :P_INTERNAL_TABLE type table of standard_structure
it will except any table; but u have to declare internal table of particular type
Message was edited by: Manoj Gupta
2006 Jul 07 2:33 PM
You must declare it before you use it. In this case, you are declaring it in the signature of the FORM. So here it is declared. But when calling the form you must pass a valid internal table name that has been declared before hand.
For example.
report zrich_0001.
data: <b>itab</b> type table of string.
perform upload tables <b>itab</b>.
*---------------------------------------------------------------------*
* FORM upload *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
* --> L_ITAB *
*---------------------------------------------------------------------*
form upload tables <b>l_itab</b>.
call function 'GUI_UPLOAD'
exporting
filename = 'C:test.txt'
tables
data_tab = <b>l_itab</b>.
endform.Regards,
Rich Heilman
2006 Jul 07 2:33 PM
Hi,
Data_itab --> takes any internal table which u pass.
since Data_itab is not a type specific
u declare P_INTERNAL_TABLE as internal table of any type; as per ur requirement it will except.
exam.
data :P_INTERNAL_TABLE type table of z_struc
or
data :P_INTERNAL_TABLE type table of standard_structure
it will except any table; but u have to declare internal table of particular type
Message was edited by: Manoj Gupta
2006 Jul 07 2:34 PM
Of course yes.
They must be declared as the same type as in the function module.
Regards,
Ravi
2006 Jul 07 2:36 PM
Hi you need to declare the p_path as the type of the variable that you are passing in the Perform of the FORM UPLOAD_PC
Similarily you also need to define the p_internal_table as the type of table that you are passing to the Perform.
2006 Jul 07 2:43 PM
data: path type string.
data itab like mara occurs 0 with header line.
perform upload_pc_file using path tables itab.
FORM upload_pc_file USING P_PATH type string
TABLES P_ITAB STRUCTURE ITAB .
"now use gui_upload here...
ENDFORM. " upload_pc_fileRegards
vijay
2006 Jul 07 2:44 PM
Hi,
U jus have to declare it once before u pass them in ur perform...
The formal parameters need not to be declared again and it can have any name.
Hope this helps u.
Seema.
2006 Jul 07 3:01 PM
hi
good
I DONT THINK YOU HAVE TO DECLARE THE SEPARATE INTERALABLE FOR THIS.
THANKS
MRUTYUN
2006 Jul 07 3:01 PM
hi
good
I DONT THINK YOU HAVE TO DECLARE THE SEPARATE INTERALABLE FOR THIS.
THANKS
MRUTYUN
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |