Skip to Content
0
Former Member
Mar 10, 2010 at 06:44 AM

i_oi_spreadsheet->set_ranges_data problem?

279 Views

Hi all,

My code follows:

  • -----------------------------------------------------------------------------*

  • Build ranges table

  • -----------------------------------------------------------------------------*

clear: wa_range.

wa_range-name = 'range1'.

wa_range-rows = 3.

wa_range-columns = 2.

wa_range-code = 1.

append wa_range to lt_ranges.

clear: wa_range.

wa_range-name = 'range2'.

wa_range-rows = 4.

wa_range-columns = 2.

wa_range-code = 1.

append wa_range to lt_ranges.

  • -----------------------------------------------------------------------------*

  • Build contents table

  • -----------------------------------------------------------------------------*

clear: wa_content.

wa_content-col1 = 'a1'.

wa_content-col2 = 'b1'.

append wa_Content to lt_contents.

...

clear: wa_content.

wa_content-col1 = 'a7'.

wa_content-col2 = 'b7'.

append wa_Content to lt_contents.

  • -----------------------------------------------------------------------------*

  • Build range names table

  • -----------------------------------------------------------------------------*

wa_range_name-name = 'range1'.

wa_range_name-top = 1.

wa_range_name-left = 1.

wa_range_name-rows = 3.

wa_range_name-columns = 2.

append wa_range_name to gt_range_name.

CLEAR: wa_range_name.

wa_range_name-name = 'range2'.

wa_range_name-top = 7.

wa_range_name-left = 1.

wa_range_name-rows = 4.

wa_range_name-columns = 2.

append wa_range_name to gt_range_name.

  • -----------------------------------------------------------------------------*

  • Write to excel file

  • -----------------------------------------------------------------------------*

call method g_spreadsheet->insert_ranges

exporting

ranges = gt_range_name

IMPORTING

ERROR = g_error

RETCODE = g_retcode

.

call method g_spreadsheet->set_ranges_data

exporting

ranges = lt_ranges

contents = lt_contents

IMPORTING

error = g_error

retcode = g_retcode.

  • ------------------------------------------------------------------------------*

But only data of range1 is written to excel while data of range2 is missed.

(g_retcode = 'OK' -> excel export successfully).

I don't know why.

Could you pls help me?

Thanks and regards,

Hung.