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

Create Alv Border

Former Member
0 Likes
755

Hi all,

I want to create a alv with some rows.For this i have some requirements:

In every row contains different numbers of columns.

Which will be displaying like an excel file with differeny columns in different rows.

Sugess How is it possible?

Points will be sured.

Thanks

Sanket Sethi

5 REPLIES 5
Read only

Former Member
0 Likes
620

Hi this will help u.

DOWNLOAD ALV LIST TO EXCEL AUTOMATICALLY

TYPES:

BEGIN OF ty_upload,

field1 TYPE c length 12,

field2 TYPE c length 12,

field3 TYPE c length 12,

END OF ty_upload.

DATA it_upload TYPE STANDARD TABLE OF ty_upload WITH DEFAULT KEY.

DATA wa_upload TYPE ty_upload.

DATA itab TYPE STANDARD TABLE OF alsmex_tabline WITH DEFAULT KEY.

FIELD-SYMBOLS: <wa> type alsmex_tabline.

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

filename = filename

i_begin_col = 1

i_begin_row = 1

i_end_col = 3

i_end_row = 65535

TABLES

intern = itab.

LOOP AT itab ASSIGNING <wa>.

CASE <wa>-col.

WHEN '0001'.

wa_upload-field1 = <wa>-value.

WHEN '0002'.

wa_upload-field2 = <wa>-value.

WHEN '0003'.

wa_upload-field3 = <wa>-value.

ENDCASE.

APPEND wa_upload TO it_upload.

CLEAR wa_upload.

ENDLOOP.

********************************************************************************

CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'

EXPORTING

  • I_FIELD_SEPERATOR =

  • I_LINE_HEADER =

i_filename =

  • I_APPL_KEEP = ' '

tables

i_tab_sap_data =

  • CHANGING

  • I_TAB_CONVERTED_DATA =

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

Another FM –

MS_EXCEL_OLE_STANDARD_DAT

A simple option:

a) form download_file .

call function 'WS_EXCEL'

importing

filename = excel_name

tables

data = itab.

b) call function 'WS_DOWNLOAD'

exporting

filename = o_file

filetype = 'DAT'

tables

data_tab = i_tab

exceptions

file_open_error = 1

file_write_error = 2

invalid_filesize = 3

invalid_type = 4

no_batch = 5

unknown_error = 6

invalid_table_width = 7

gui_refuse_filetransfer = 8

customer_error = 9

no_authority = 10

others = 11.

if sy-subrc = 0.

message 'File is downloaded successfully' type 'I'.

endif.

with regards,

Hema Sundara.

pls give points if it helps u.

Read only

0 Likes
620

Hi Hema,

Actually i am not pick that from an Excel file. I only give the example that it look likes an excel sheet file.

Sanket

Read only

Former Member
0 Likes
620

hi

good

go through this link ,hope this would help you to give some idea about the ALV borders.

thanks

mrutyun^

Read only

0 Likes
620

Hi Mrutyunjaya,

Send the link again plz.

Sanket

Read only

Former Member
0 Likes
620

closed.