일반 ALV가 아니고 온라인 ALV를 만들고 있습니다.
ALV 스크린에서 행삭제 버튼을 만들고 싶은데 아는게 없다보니
로직을 어떻게 넣어서 구성해야 할지 잘 모르겠습니다.
현재 ALV 스크린에 기본 버튼은 있는 상태구요 행삽입, 행추가, 행삭제, 행복제 버튼은
없습니다. 지금 필요한것은 행삭제만 필요합니다.
저의 로직을 조금 보여 드리자면 선언부 입니다.
*---------------------------------------------------------------------------*
PROGRAM zscb_test001.
*- A L V -------------------------------------------------------------------*
TYPE-POOLS : slis.
DATA: BEGIN OF gt_exctab OCCURS 10,
button LIKE sy-ucomm,
END OF gt_exctab.
DATA: fieldcat TYPE slis_t_fieldcat_alv,
fieldcat_ln LIKE LINE OF fieldcat,
p_f2code LIKE sy-ucomm VALUE '&ETA'.
DATA: ok_code LIKE sy-ucomm,
save_ok LIKE sy-ucomm,
g_container TYPE scrfname VALUE 'BCALV_GRID_DEMO_0100_CONT1',
grid1 TYPE REF TO cl_gui_alv_grid,
g_custom_container TYPE REF TO cl_gui_custom_container,
gt_fieldcat type lvc_t_fcat,
pt_fieldcat type lvc_t_fcat,
ls_fcat type lvc_s_fcat,
gs_layout TYPE lvc_s_layo,
g_max TYPE i VALUE 100,
l_pos TYPE i VALUE 0,
lt_exclude type ui_functions,
lt_f4 type lvc_t_f4 with header line,
rs_selfield TYPE slis_selfield.
* screen 선언
DATA: gs_zsailing LIKE zsailing_s_001,
gs_zcustom LIKE zcustom_s_001.
* internal table 선언
DATA: BEGIN OF gt_outtab OCCURS 0,
regno LIKE zsailing_t_001-regno, "등록번호
io LIKE zsailing_t_001-io, "구분자
buino LIKE zcustom_t_001-buino, "거래자 등록번호
sdate LIKE zsailing_t_001-sdate, "날짜
bname LIKE zcustom_t_001-bname, "거래자 상호
bcond LIKE zcustom_t_001-bcond, "거래자 업태
beven LIKE zcustom_t_001-beven, "거래자 종목
buibd LIKE zsailing_t_001-buibd, "거래내역 text
blans LIKE zsailing_t_001-blans, "공란수
waers LIKE zsailing_t_001-waers, "통화키
taxpe LIKE zsailing_t_001-taxpe, "항목별 세액
suppr LIKE zsailing_t_001-suppr, "공급가액
taxpr LIKE zsailing_t_001-taxpr, "세액
t_cost1 LIKE zsailing_t_001-suppr, "공급원가
t_cost2 LIKE zsailing_t_001-suppr, "공급가액 + 세액
armcd LIKE zsailing_t_001-armcd, "신고자주류코드(도매)
mccod LIKE zsailing_t_001-mccod, "주류코드(소매)
blank LIKE zsailing_t_001-blank, "공란
celltab TYPE lvc_t_styl,
del(1) TYPE c,
END OF gt_outtab.
DATA: gt_outtab2 LIKE zcustom_t_001 OCCURS 0 WITH HEADER LINE.
DATA: gt_outtab3 LIKE zsailing_t_001 OCCURS 0 WITH HEADER LINE.
* data 선언
DATA: l_flagcurr LIKE zsailing_s_001-waers.
DATA: g_num LIKE zsailing_t_001-regno.
DATA: l_num(4) TYPE c VALUE '0000'.
DATA: lt_celltab TYPE lvc_t_styl,
l_index TYPE i.
테이블을 ALV스크린에 나타낸 펑션입니다.
*--------------------------------------------------------------------------*
form build_fieldcat.
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = 'zsc_s_001'
changing
ct_fieldcat = pt_fieldcat.
loop at pt_fieldcat into ls_fcat.
if ls_fcat-fieldname eq 'BUIBD'
or ls_fcat-fieldname eq 'BLANS'
or ls_fcat-fieldname eq 'WAERS'
or ls_fcat-fieldname eq 'ARMCD'
or ls_fcat-fieldname eq 'MCCOD'
or ls_fcat-fieldname eq 'BLANK'
or ls_fcat-fieldname eq 'SUPPR'
or ls_fcat-fieldname eq 'TAXPE'.
ls_fcat-edit = 'X'.
ls_fcat-checktable = '!'. "do not check foreign keys
modify pt_fieldcat from ls_fcat.
endif.
endloop.
endform.
*--------------------------------------------------------------------------*
저도 slis 를 참고하고는 있는데 초보이다보니 어디서 무엇을 참고해야 할지 감을 못잡겠습니다..;;