‎2008 Feb 07 10:57 PM
Hello friends,
I have a syntax error in the following code.
the error is The field "P_I_PA0000" is unknown, but there are the following fields
in the function module.
Any suggestions.
Thanks,
Raju.
PARAMETERS: ps_file1like rlgrap-filename " Incoming file 1
DEFAULT 'c:\HR\ZCNV0008.txt' LOWER CASE,
DATA: BEGIN OF i_pa0000 OCCURS 100.
INCLUDE STRUCTURE pa0000.
DATA: END OF i_pa0000.
PERFORM upload_local_file USING ps_file1
CHANGING i_pa0000[].
&----
*& Form upload_local_file
&----
text
----
-->P_PS_FILE1 text
<--P_I_PA0000 text
----
FORM upload_local_file USING p_ps_file1
CHANGING p_i_pa0000[].
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = p_ps_file1
filetype = 'ASC'
TABLES
data_tab = p_i_pa0000[]
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.
ENDFORM. " upload_local_file
‎2008 Feb 07 11:04 PM
Change the perform statement as
PERFORM upload_local_file TABLES i_pa0000 USING ps_file1.
And form as
FORM upload_local_file TABLES p_i_pa0000 STRUCTURE pa000 USING p_ps_file1.
Regards,
Sudhir Atluru
‎2008 Feb 07 11:04 PM
Hi,
Try this way,
FORM upload_local_file USING p_ps_file1
CHANGING p_i_pa0000[] like i_pa0000.
Regards,
Ali
‎2008 Feb 07 11:04 PM
Change the perform statement as
PERFORM upload_local_file TABLES i_pa0000 USING ps_file1.
And form as
FORM upload_local_file TABLES p_i_pa0000 STRUCTURE pa000 USING p_ps_file1.
Regards,
Sudhir Atluru
‎2008 Feb 07 11:09 PM
Thanks all but both the ways dosent work.
Any more suggestions.
Raju.
‎2008 Feb 07 11:23 PM
If it doesn't work, why did you mark it as "solved"?
I think this is what you are trying to do:
PARAMETERS: ps_file1 LIKE rlgrap-filename " Incoming file 1
DEFAULT 'c:\HR\ZCNV0008.txt' LOWER CASE.
DATA: BEGIN OF i_pa0000 OCCURS 100.
INCLUDE STRUCTURE pa0000.
DATA: END OF i_pa0000.
PERFORM upload_local_file
TABLES i_pa0000
USING ps_file1.
*&---------------------------------------------------------------------*
*& Form upload_local_file
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM upload_local_file
TABLES p_i_pa0000
USING p_ps_file1.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = p_ps_file1
filetype = 'ASC'
TABLES
data_tab = p_i_pa0000
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.
ENDFORM. " upload_local_fileRob
‎2008 Feb 07 11:25 PM