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

SYntax error - on Perform Statement

Former Member
0 Likes
864

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
737

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

5 REPLIES 5
Read only

Former Member
0 Likes
737

Hi,

Try this way,

FORM upload_local_file USING p_ps_file1

CHANGING p_i_pa0000[] like i_pa0000.

Regards,

Ali

Read only

Former Member
0 Likes
738

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

Read only

0 Likes
737

Thanks all but both the ways dosent work.

Any more suggestions.

Raju.

Read only

0 Likes
737

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_file

Rob

Read only

0 Likes
737

Hi

no need to put []

Cheers

~Arun