Skip to Content
0
Aug 01, 2009 at 05:29 AM

OO Prog

26 Views

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