Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Splitting clipboard import in ABAP

Tags:

clipboard

abap

I'm using CLPB_IMPORT function module to get clipboard to internal table. it's ok. I'am copying two column Excel data. So it fills the table with delimiter '#', like;

  1. 4448#3000
  2. 4449#4000
  3. 4441#5000

But the problem is splitting these strings. I'm trying;

LOOP AT foytab.
    SPLIT foytab-tab  AT '#' INTO temp1 temp2.
ENDLOOP.

But it doesn't split. it puts whole line into temp1. I think the delimiter is not what I thought ('#'). Because when I write a string manually with delimiter '#' it splits.

Do you have any idea how to split this ?

like image 692
Mtok Avatar asked Oct 04 '22 17:10

Mtok


1 Answers

You should not use CLPB_IMPORT since it's explicitly marked as obsolete. Use CL_GUI_FRONTEND_SERVICES=>CLIPBOARD_IMPORT instead.

The data is probably not separated by # but by a tab character. You can check this in the hex view of the debugger. # is just a replacement symbol the UI uses for any unprintable character. If the delimiter is the tab character, you can use the constant CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.

enter image description here

like image 188
vwegert Avatar answered Oct 10 '22 01:10

vwegert