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

GUI_upload

Former Member
0 Likes
4,226

Hi ,

I want to upload a Excel file .Please tell me ,i can use GUI_upload or not . As i read in the documentaion of this function oly ASC and BIN file are mentiones there .

Rgds,

Premraj

Edited by: PremRaj kaushik on Jan 19, 2009 9:24 AM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,033

Hi,

You can use GUI_UPLOAD using file type parameter as 'ASC' for uploading Excel file.

Best regards,

Prashant

9 REPLIES 9
Read only

Former Member
0 Likes
3,034

Hi,

You can use GUI_UPLOAD using file type parameter as 'ASC' for uploading Excel file.

Best regards,

Prashant

Read only

Former Member
0 Likes
3,033

Hi,

U can also use ws_upload for the same and use F1 to get the help on Filetype like ASC or DAT

Regards

Mudit

Read only

Former Member
0 Likes
3,033

Hello Prem,

pls search SCN before posting your therad. so that we can avoid the duplicates

refer to this link:

Thanks!!

Read only

Former Member
0 Likes
3,033

Hi,

Use FN Module TEXT_CONVERT_XLS_TO_SAP'

Declare Type pools: TYPE-POOLS: truxs.

Declare Data: Data i_raw TYPE truxs_t_text_data.

Declare Parameter : p_fname TYPE rlgrap-filename.

Better to Have a it_excel all fields in Char or string type. in order to avoid type mismatches.

Call FN Module and pass variables

FORM file_upload_fname USING p_fname TYPE rlgrap-filename.

CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'

EXPORTING

i_field_seperator = 'X'

i_tab_raw_data = i_raw

i_filename = p_fname

TABLES

i_tab_converted_data = it_excel.

IF sy-subrc 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

To delete header line

IF it_excel IS NOT INITIAL.

DELETE it_excel INDEX 1.

ELSE.

MESSAGE i000(0k) WITH 'No Data in Excel File'.

ENDIF.

ENDFORM. " FILE_UPLOAD_FNAME

Regards,

shiva

Read only

Former Member
0 Likes
3,033

Hi ,

Use fm ALSM_EXCEL_TO_INTERNAL_TABLE to upload data frm excel.

Regards,

Radhika

Read only

Former Member
0 Likes
3,033

Hi PremRaj,

You can use function module GUI_UPLOAD

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename =

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 =

  • 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.

Here by giving file type as 'ASC', you can upload Excel format file into you abap program.

Hope it helps you.

Regards

Mansi

Read only

Former Member
0 Likes
3,033

Hi,

You can use GUI_UPLOAD or WS_UPLOAD and select filetype is 'ASC' for uploading teh excel file.

Regards,

Jyothi CH.

Edited by: Jyothi Chinnabathuni on Jan 19, 2009 4:21 PM

Read only

Former Member
0 Likes
3,033

Hi,

Use FM "ALSM_EXCEL_TO_INTERNAL_TABLE " uploading excel file. In this FM you can give column and row specification.

You can also use FM "GUI_UPLOAD" .

Regards

Md.MahaboobKhan

Read only

Former Member
0 Likes
3,033

Hi,

You can also use OLE to download it in excel file.

search in SDN for that.

regards,

Lokesh