*&---------------------------------------------------------------------*
*& Include ZKSO_EVENT1FROM
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Form insdd
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> p1 text
*&<-- p2 text
*&---------------------------------------------------------------------*
form insdd .
endform.
*&---------------------------------------------------------------------*
*& Form write_data
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> p1 text
*&<-- p2 text
*&---------------------------------------------------------------------*
form write_data .
data gv_char type c length 10 value 'shujuleixing'.
data gv_char2 type c length 30 value ''.
data gv_number type n length 10 value '12.223'.
data gv_data type d value '20231010'.
data gv_dec type p length 10 decimals 2 value '12121.2292222'.
data gv_times type t value '123211'.
data gv_int type i value 234.
write: / 'char:' , gv_char ,
/ 'number:' no-gap , gv_number no-zero no-gap ,
/ 'decmper: ',gv_dec ,
/ 'data:',gv_data,
/'times:',gv_times,
/'int:' no-gap ,gv_int
.write :/'chasub:',gv_char+0(4).
write :/'chasub*:',gv_char+3(*).
write gv_dec to gv_char currency 'USD'.write: / gv_char .write gv_number to gv_char no-zero .
condense gv_char .write: / 'condese:', gv_char .
write:/'--------------'.write gv_dec to gv_char2 no-zero .write :/ gv_char2 .
condense gv_char2 .write :/ 'gv_char2:',gv_char2 no-gap .
endform.
*&---------------------------------------------------------------------*
*& Form write_data1
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> p1 text
*&<-- p2 text
*&---------------------------------------------------------------------*
form write_data1 .
types :begin of gty_data ,
idtype i,
zname type c length 10,
zadd type c length 20,
zschool type c length 20,
end of gty_data .
data gs_data type gty_data .
data gt_data type table of gty_data with header line .
types : begin of gty_father,
zdata type gty_data,
znames type c length 20,
end of gty_father.
clear gs_data .
gs_data-id =1.
gs_data-zname ='swe2'.
gs_data-zadd ='dizhi add '.
gs_data-zschool ='school '.
append gs_data to gt_data .
data gs_father type gty_father .
gs_father-zdata = gs_data .
gs_father-znames ='name kongshaobo'.clear gs_data .
gs_data-id =1.
gs_data-zname ='swe2'.
gs_data-zadd ='dizhi add '.
gs_data-zschool ='school '.
append gs_data to gt_data .write :/ 'sy-subrc:',sy-subrc .write :/ 'sy-uname:',sy-uname .write :/ 'sy-code:',sy-tcode .write :/'sy-datum:',sy-datum ,sy-uzeit.
write :/'sy-repid:',sy-repid .write :/ 'gt_data:', gs_father-zdata-zadd .
endform.
*&---------------------------------------------------------------------*
*& Form write_table
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> p1 text
*&<-- p2 text
*&---------------------------------------------------------------------*
form write_table .
types :begin of gty_data,
idtype i,
zname type c length 10,
zadd type c length 20,
zschool type c length 20,
end of gty_data.
* 标准表
data gt_data type table of gty_data with key id.
* sort表
data gt_sort type sorted table of gty_data with unique key id.
data:lt_line type sorted table of gty_data with non-unique key id.
* hash
data gt_hash type hashed table of gty_data with unique key id zname .
endform.
*&---------------------------------------------------------------------*
*& Form write_zsgc
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> p1 text
*&<-- p2 text
*&---------------------------------------------------------------------*
form write_zsgc .
types :begin of gty_zs,
zid type i,
zname type c length 20,
zadd type c length 20,
zsix type c length 2,
end of gty_zs .
data gs_zs type gty_zs .
data gt_zs type table of gty_zs with header line.
gs_zs-zid =1.
gs_zs-zname ='kong1'.
gs_zs-zadd ='songjiangqu kong you xin1 '.
gs_zs-zsix ='女'.
append gs_zs to gt_zs .
gs_zs-zid =2.
gs_zs-zname ='kong2'.
gs_zs-zadd ='songjiangqu kong you xin '.
gs_zs-zsix ='女'.
append gs_zs to gt_zs .
gs_zs-zid =3.
gs_zs-zname ='kong3'.
gs_zs-zadd ='songjiangqu kong you xin '.
gs_zs-zsix ='女'.
append gs_zs to gt_zs .
data gt_zsadd type table of gty_zs with header line.
gs_zs-zid =4.
gs_zs-zname ='kong3'.
gs_zs-zadd ='songjiangqu kong you xin '.
gs_zs-zsix ='女'.
append gs_zs to gt_zsadd .
gs_zs-zid =5.
gs_zs-zname ='kong3'.
gs_zs-zadd ='songjiangqu kong you xin '.
gs_zs-zsix ='女'.
append gs_zs to gt_zsadd .
insert lines of gt_zsadd into table gt_zs.
insert gs_zs into gt_zs index 1.
insert lines of gt_zsadd from 1 to 2 into table gt_zs.
loop at gt_zs into gs_zs .write :/ gs_zs-zname .
endloop.
gs_zs-zname ='you xin '.
modify gt_zs from gs_zs index 3 transporting zname.
gs_zs-zadd ='yon zai zai '.
modify table gt_zs from gs_zs .if sy-subrc =0.
write: / 'this subrc'.
endif.
loop at gt_zs into gs_zs .write: / 'modity:' ,gs_zs-zname, gs_zs-zadd .
endloop.
data gs_zsl type gty_zs .read table gt_zs into gs_zsl index 1.write: / 'read:' ,gs_zsl-zname, gs_zsl-zadd .read table gt_zs into gs_zsl with key zid =3.write: / 'read3:' ,gs_zsl-zname, gs_zsl-zadd .
delete gt_zs where zid =3.
delete table gt_zs from gs_zs .
delete gt_zs index 1.
clear gt_zs[].
loop at gt_zs into gs_zs .write :/ 'znamedelete:' , gs_zs-zname .
endloop.
endform.