Application Development 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: 

Issue with CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD

Former Member
0 Kudos

Hi all,

Iam using the class CL_GUI_FRONTEND_SERVICES and method GUI_UPLOAD

instead of directly calling the GUI_UPLOAD FM

Please note the difference marked star against it

Let me know what i have to pass

DATA: INP TYPE STRING.

clear : inp.

MOVE in TO INP.

CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD

EXPORTING

FILENAME = INP

FILETYPE = 'ASC'

  • HAS_FIELD_SEPARATOR = SPACE

  • HEADER_LENGTH = 0

  • READ_BY_LINE = 'X'

  • DAT_MODE = SPACE

  • CODEPAGE = SPACE

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • VIRUS_SCAN_PROFILE =

  • IMPORTING

  • FILELENGTH =

  • HEADER =

CHANGING

DATA_TAB = cr *******************************

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

NOT_SUPPORTED_BY_GUI = 17

ERROR_NO_GUI = 18

others = 19

.

The above code gives me an error

"CR" is not type-compatible with formal parameter "DATA_TAB".

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = INP

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 =

TABLES

DATA_TAB = cr *****************************

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

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

When you see carefully CR is passed to DATA_TAB under Tables for FM

But it is passed under CHANGING in class.

Please let me know because iam bound to use the class and method not the fm directly

Thanks

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

I assume that CR is a table with header line, in OO context, header lines are not allowed so you specifically have to state that you are passing the body of the table.


......
*HEADER =
TABLES
DATA_TAB = cr[]      "<-  Like This
EXCEPTIONS
.....

Regards,

Rich Heilman

5 REPLIES 5

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

I assume that CR is a table with header line, in OO context, header lines are not allowed so you specifically have to state that you are passing the body of the table.


......
*HEADER =
TABLES
DATA_TAB = cr[]      "<-  Like This
EXCEPTIONS
.....

Regards,

Rich Heilman

0 Kudos

Hi Rich,

Yes you are right. I don't see any errors.

Can you also tell what is the transaction to check for class and methods

I awrded full points to you

Thanks

0 Kudos

You can use the class builder transaction, SE24.

Regards,

RIch Heilman

0 Kudos

Hi,

I selected gui_method from se24 from classCL_GUI_FRONTEND_SERVICES

and did a where used list.

For some reasons it doesnot return anything , is there a particular reason

Thanks

0 Kudos

how did you checked the where-used-list..

Double click on the method GUI_UPLOAD in that class, now place the cursor on the method name and check out the where-used-list..you will get many programs..some of them

RCSBI010

RFDWZFF0

RFEBBE00

RFEBJP20

RFEKA700