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: 

OO Prog

former_member207019
Participant
0 Kudos

Dear Friends,

I got this error,

Error : Literals that take up more than one linenot permitted.

REPORT  ZLCL_SAMPLE no standard page heading
                       line-size 100
                       line-count 100               .

data : begin of wa_file,
        name(30) type c,
        mobile(12) type c,
       end of wa_file.

data : it_file like table of wa_file.

class lcl_file definition.

public section.

methods : upload importing im_file type string
                           im_sep type c
                  changing it_contact like it_file.
endclass.

**** class implementation
class lcl_file implementation.

***method implemenation
method upload.
CALL FUNCTION 'GUI_UPLOAD'
  EXPORTING
   FILENAME = 'C:\Documents and Settings\Administrator\Desktop\file.txt'
   HAS_FIELD_SEPARATOR           = im_sep
  TABLES
    DATA_TAB                      = it_contact.

endmethod.
endclass.

start-of-selection.

data : o_file type ref to lcl_file.

create object o_file .

call method o_file->upload exporting im_file = 'C:\Documents and Settings\Administrator
\Desktop\file.txt'
        im_sep = 'X'   changing
       it_contact = it_file.

loop at it_file into wa_file.
  write:/ wa_file-name,wa_file-mobile.
endloop.

Edited by: jyotsna dm on Aug 1, 2009 7:29 AM

Edited by: Matt on Aug 1, 2009 12:35 PM - removed comments for formatting

1 ACCEPTED SOLUTION

former_member555112
Active Contributor
0 Kudos

Hi,

i checked your code but I am not getting teh error.

I think the problem is beacause of the filename.

You are giving your filename within quotes with a line break.

So you get that error.

First of all do not pass such long texts within quotes to the filename parameter.

Declare a variable and pass to it.

If you want the file browser feature in windows then use method 'FILE_OPEN_DIALOG' of class CL_GUI_FRONTEND_SERVICES.

Regards,

Ankur Parab

3 REPLIES 3

former_member555112
Active Contributor
0 Kudos

Hi,

i checked your code but I am not getting teh error.

I think the problem is beacause of the filename.

You are giving your filename within quotes with a line break.

So you get that error.

First of all do not pass such long texts within quotes to the filename parameter.

Declare a variable and pass to it.

If you want the file browser feature in windows then use method 'FILE_OPEN_DIALOG' of class CL_GUI_FRONTEND_SERVICES.

Regards,

Ankur Parab

0 Kudos

Please use a meaningful subject in future There is a limit of around 2500 characters to a post. If you wish to retain formatting, you need to removed any code not germane to the issue. This I have done for you. And immediately I see that Ankur Parab is correct:

>You are giving your filename within quotes with a line break.

>so you get that error.

You can follow his suggestions. Or you may want to check the settings on your editor, which may be limited to 72 char rows. With most recent systems, you can have much longer rows than that.

matt

0 Kudos

Thank you, issue solved.