Panodan veri yapıştırma ( Clipboard ) Import
Panodan veri yapıştırma ( Clipboard ) Import
types: begin of ty_bayimalz ,
kunnr type kunnr,
matnr like marc-matnr,
name1 type ZTR_KUNNR_T,
maktx type MAKTX,
end of ty_bayimalz.
types: tty_bayimalz type sorted table of ty_bayimalz with unique key kunnr matnr.
types: tty_bayimalz_std type standard table of ty_bayimalz.
*&---------------------------------------------------------------------*
*& Form f_panodan_al
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
form f_panodan_al changing cht_bayimalz type tty_bayimalz_std
chn_satir_sayisi type int4.
data: ls_bayimalz type ty_bayimalz.
types: begin of ty_data,
text(80) ,
end of ty_data.
data: lt_tab type ty_data occurs 0 .
data: ls_tab type ty_data.
DATA: lv_str_kunnr TYPE string,
lv_str_matnr TYPE string.
call method cl_gui_frontend_services=>clipboard_import
importing
data = lt_tab
* LENGTH =
exceptions
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
others = 4.
if sy-subrc = 0.
loop at lt_tab into ls_tab.
clear: lv_str_kunnr, lv_str_matnr, ls_bayimalz.
split ls_tab-text at cl_abap_char_utilities=>horizontal_tab into lv_str_kunnr lv_str_matnr.
ls_bayimalz-kunnr = lv_str_kunnr.
ls_bayimalz-matnr = lv_str_matnr.
if sy-subrc = 0 .
append ls_bayimalz to cht_bayimalz .
elseif sy-subrc = 4.
* WRITE: / `Split error:`, DATA_WA-TEXT.
endif.
endloop.
else.
* message id sy-msgid type sy-msgty number sy-msgno
* with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
describe table cht_bayimalz lines chn_satir_sayisi .
endform. "f_panodan_al