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: 

ws_upload # problem

muhammad_sohail
Participant
0 Kudos

hi,

I am uploading a file using ws_upload, in my itab every field has extra # character. why this character is in the fields of itab.

Regards,

sohail

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

See this code.


 Declare upload format 
DATA: BEGIN OF ITAB OCCURS 0, 
                  PLANT(2)               TYPE C, 
                  MATERIAL(18)       TYPE C, 
DATA: END OF ITAB. 

PARAMETERS:  F-FILE LIKE RLGRAP-FILENAME DEFAULT 'C:\TEMP\FILE.TXT'.. 

* FILETYPE ->    'BIN' OR 'DAT' OR 'ASC' OR 'IBM' OR 'WK1' OR 'DBF' OR  'SPL' OR 'TRU'. 
call function 'WS_UPLOAD' 
  EXPORTING 
    FILENAME                      = F-FILE 
    FILETYPE                      = 'DAT' 
  tables 
    data_tab                      = ITAB 
  EXCEPTIONS 
    FILE_OPEN_ERROR               = 1 
    FILE_READ_ERROR               = 2 
    NO_BATCH                      = 3 
    GUI_REFUSE_FILETRANSFER       = 4 
    INVALID_TYPE                  = 5 
    OTHERS                        = 6. 

3 REPLIES 3

Former Member
0 Kudos

It's a separator of some sort...one might expect tabs (hex 09) there, perhaps. Use GUI_UPLOAD, WS_UPLOAD is obsolete...try with file_type = 'ASC' , has_field_separator = 'X' and see if that makes a difference.

Former Member
0 Kudos

Hi Muhammad,

Don't use WS_UPLOAD, it is now obsolute.

Use GUI_UPLOAD.

give file type as 'ASC' AND has field separator = 'X' (if you file is tab deliminated).

Regards,

Tutun

Former Member
0 Kudos

Hi,

See this code.


 Declare upload format 
DATA: BEGIN OF ITAB OCCURS 0, 
                  PLANT(2)               TYPE C, 
                  MATERIAL(18)       TYPE C, 
DATA: END OF ITAB. 

PARAMETERS:  F-FILE LIKE RLGRAP-FILENAME DEFAULT 'C:\TEMP\FILE.TXT'.. 

* FILETYPE ->    'BIN' OR 'DAT' OR 'ASC' OR 'IBM' OR 'WK1' OR 'DBF' OR  'SPL' OR 'TRU'. 
call function 'WS_UPLOAD' 
  EXPORTING 
    FILENAME                      = F-FILE 
    FILETYPE                      = 'DAT' 
  tables 
    data_tab                      = ITAB 
  EXCEPTIONS 
    FILE_OPEN_ERROR               = 1 
    FILE_READ_ERROR               = 2 
    NO_BATCH                      = 3 
    GUI_REFUSE_FILETRANSFER       = 4 
    INVALID_TYPE                  = 5 
    OTHERS                        = 6.