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

.xlsx file

Former Member
0 Likes
958

Hi,

CAn anyone let me know how to upload .xlsx file in abap.

Thanks,

Keerthi

Edited by: keerthi kiran varanasi on Jun 11, 2008 6:03 PM

Hi,

CAn anyone let me know how to upload .xlsx file in abap.

Thanks,

Keerthi

Edited by: keerthi kiran varanasi on Jun 11, 2008 6:03 PM

7 REPLIES 7
Read only

Former Member
0 Likes
905

Hi Keerthi,

Check this

CALL FUNCTION 'WS_FILENAME_GET'

EXPORTING

def_path = 'R:\allg\Rohwareneinsatzplan\'

  • mask = '.xlsx '

mode = 'S'

title = 'Rohwareneinsatzplanung'

IMPORTING

filename = p_file

EXCEPTIONS

inv_winsys = 1

no_batch = 2

selection_cancel = 3

selection_error = 4

OTHERS = 5.

Read only

Former Member
0 Likes
905

hi,

use GUI_UPLOAD function module.

Regards

Sandeep Reddy.

Read only

0 Likes
905

Hi,

Thanks for your replies.

ALSM_excel_to_internal_table also worls for .xlsx file as it does for .xls file.

Thnaks,

Keerthi.

Read only

Former Member
0 Likes
905

Hi,

I presume your source data is in .xlsx extn. and you are using Office 2003 or 2000.

Your easiest solution to upload data from this new MS 2007 format lies outside SAP .

Hers is how u do it ..

Google for MS File Format Converters, Not only will this convert your file, outside SAP you will also be able to open files created in Office 2007 while using Office 2003 on the local machine.

Google keyword : MS file converter from 2007 to 2003.

The first Link is that of Microsoft.....follow instructions to download. open your file in regular wayand save as .xls.

Hope this helps

Regards

Shubh

Ps. Kindly reply back if it works for you.

Read only

Former Member
0 Likes
905

Hi Keerti,

I believe you got another function module apart from GUI_UPLOAD which suits your requirement. And I think you got an answer. So please mark the question as answered..

Read only

former_member787646
Contributor
0 Likes
905

Hi,

Try the following code.

TYPE-POOLS: TRUXS.

DATA : T_TAB_RAW_DATA TYPE TRUXS_T_TEXT_DATA.

DATA: BEGIN OF WA OCCURS 0,

FNAME(10) TYPE C,

LNAME(10) TYPE C,

ADDR(10) TYPE C,

CITY(10) TYPE C,

STATE(10) TYPE C,

ZIP(10) TYPE C,

END OF WA.

DATA: NLINES TYPE I, FILELEN(8) TYPE P DECIMALS 2.

PARAMETERS: FILE LIKE RLGRAP-FILENAME.

CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'

EXPORTING

  • I_FIELD_SEPERATOR =

  • I_LINE_HEADER =

I_TAB_RAW_DATA = T_TAB_RAW_DATA

I_FILENAME = FILE

TABLES

I_TAB_CONVERTED_DATA = WA

  • EXCEPTIONS

  • CONVERSION_FAILED = 1

  • OTHERS = 2

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

I think it helps you.

Murthy

Read only

Former Member
0 Likes
905

use the tcode..

CG3Z for this ..