cancel
Showing results for 
Search instead for 
Did you mean: 

DOI Excel Problem

Former Member
0 Kudos

Hi,

I use the Method below to create my ranges in Excel.

CALL METHOD spreadsheet->insert_range_dim

EXPORTING name = 'LIFNR'

top = top

left = left

rows = rows

columns = columns

updating = updating

no_flush = no_flush

IMPORTING error = error

retcode = retcode.

second Ranges Name;

CALL METHOD spreadsheet->insert_range_dim

EXPORTING name = 'MATNR'

top = top

left = left

rows = rows

columns = columns

updating = updating

no_flush = no_flush

IMPORTING error = error

retcode = retcode.

After that I use method below to get the names into

t_ranges. Till Now everything is ok.

CALL METHOD cl_spreadsheet->get_ranges_names

IMPORTING

error = error

ranges = t_ranges.

But I just had to change the ranges Names depending on

New Requirements.

So I have changed the Ranges names with method again like this ( I need this time only one Range);

CALL METHOD spreadsheet->insert_range_dim

EXPORTING name = 'MAKTX'

top = top

left = left

rows = rows

columns = columns

updating = updating

no_flush = no_flush

IMPORTING error = error

retcode = retcode.

After this I call Method below to get the name into t_range.

CALL METHOD cl_spreadsheet->get_ranges_names

IMPORTING

error = error

ranges = t_ranges.

But This Time it brings me LIFNR and MAKTX into t_ranges,

although I think I would see only MAKTX in t_ranges.

What is wrong? Why has t_ranges LIFNR and MAKTX? t_ranges has to have only MAKTX.

Do I have to clear the control or other

Elements and how?

Thanks for all.

with my best Regards

Accepted Solutions (0)

Answers (1)

Answers (1)

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Maybe you should be clearing the t_ranges just before adding MAKTX.

clear t_ranges.  refresh t_ranges.

REgards,

Rich HEilman

Former Member
0 Kudos

Do you want to add a third range named MAKTX?

Or do you want to delete LIFNR and MATNR ranges and then add one range named MAKTX?

If you only want one range named MAKTX, you have to call method <b>delete_ranges</b> first. The parameter <i>ranges</i> has to contain LIFNR and MATNR.

Former Member
0 Kudos

Hi Salter,

I only want one Rangename in t_ranges ( MAKTX ).

I'll try it with delete_ranges, when I'm in the office on Monday. This may solve the Problem.

Thanks!

Bye

Former Member
0 Kudos

No, It doesnt make any changes with Method delete_ranges.

I think that old rangenames are in Buffer or in Memory.

How can I delete it or refresh it?

Beserithan

Former Member
0 Kudos

I am using this method and it works in my application under ECC 5.0.

here is a sample from my code...

refresh: gt_soi_range_list.
clear:   gt_soi_range_list.
gt_soi_range_list-name = 'DATA1'.

call method gh_oi_spreadsheet->delete_ranges
  exporting
    no_flush  = ''
    ranges    = gt_soi_range_list
  importing
    error     = gh_oi_error
    retcode   = gh_oi_retcode.
call method gh_oi_error->raise_message
  exporting
    type = 'E'.