TEST ALV in SAP [BCALV_TEST_GRID_EDITABLE]

SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF; } .L1S31 { font-style: italic; color: #808080; } .L1S32 { color: #3399FF; } .L1S33 { color: #4DA619; } .L1S52 { color: #0000FF; } *&---------------------------------------------------------------------*
*&ReportBCALV_TEST_GRID_EDITABLE*
*&*
*&---------------------------------------------------------------------*
*&*
*&*
*&---------------------------------------------------------------------*
reportbcalv_test_grid_editable.

types:g_ty_s_sflighttypealv_t_t2.

constants:con_sflighttypelvc_fnamevalue'ALV_T_T2'.

*----------------------------------------------------------------------*
*DATA*
*----------------------------------------------------------------------*
include<icon>.
include<symbol>.

classlcl_events_d0100definitiondeferred.

types:g_ty_t_icontypestandardtableoficon,
g_ty_t_iconttypestandardtableoficont,

beginofg_ty_s_onf4,
registertypechar1,
get_beforetypechar1,
change_aftertypechar1,
internal_formattypechar1,
endofg_ty_s_onf4,

beginofg_ty_s_test,
select_amounttypei,
only_db_infotypechar1,
no_info_popuptypechar1,
info_popup_oncetypechar1,
events_info_popuptypelvc_fnameoccurs0,
edit_typetypei,
edit_modetypei,
edit_eventtypei,
edit_fieldstypelvc_fnameoccurs0,
no_row_instypechar1,
no_row_movetypechar1,
onf4typeg_ty_s_onf4,
onf4_fieldstypelvc_fnameoccurs0,
excp_grouptypechar1,
excp_amounttypei,
excp_condensetypechar1,
excp_ledtypechar1,
layo_selectiontypechar1,
layo_no_rowmarktypechar1,
bypassing_buffertypechar1,
buffer_activetypechar1,
endofg_ty_s_test,

beginofg_ty_s_outtab.
includetypeg_ty_s_sflight.
types:checkboxtypechar1,
boxtypechar1,
lightstypechar1,
handle_styletypelvc_t_styl,
handle_hlinktypelvc_s_hype-handle,
handle_drdntypelvc_s_drop-handle,

char(10)typec,
stringtypestring,
int1typeint1,
int2typeint2,
int4typei,
numc(10)typen,
dec(10)typepdecimals2,
fltptypef,
datstyped,
timstypet,
icontypeicon-id,
icon_qinfotypeicon-name,
symboltypeicon-id,
hotspottypestring,
hyperlinktypestring,
buttontypestring,
dropdown_f4typei,
endofg_ty_s_outtab,
g_ty_t_outtabtypetableofg_ty_s_outtab.

constants:con_exittypesy-ucommvalue'EXIT',
con_canctypesy-ucommvalue'CANC',
con_backtypesy-ucommvalue'BACK',
con_savetypesy-ucommvalue'SAVE',

con_truetypechar1value'X',

con_ontypechar1value'1',
con_offtypechar1value'0',

con_edit_gridtypeivalue1,
con_edit_columntypeivalue2,
con_edit_celltypeivalue3,

con_edit_mode_displaytypeivalue1,
con_edit_mode_changetypeivalue2,

con_edit_event_entertypeivalue1,
con_edit_event_modifytypeivalue2.

data:g_fieldtypelvc_s_fcat-fieldname.

data:g_okcodetypesy-ucomm.

data:gs_testtypeg_ty_s_test.

data:gt_outtabtypeg_ty_t_outtab,

gr_container_d0100typereftocl_gui_custom_container,
gr_grid_d0100typereftocl_gui_alv_grid,
gr_events_d0100typereftolcl_events_d0100.

*---------------------------------------------------------------------*
*CLASSlcl_events_d0100DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
classlcl_events_d0100definition.
publicsection.
methods:
double_clickforeventdouble_click
ofcl_gui_alv_grid
importinge_row
e_column
es_row_no,"#ECCALLED

hotspot_clickforeventhotspot_click
ofcl_gui_alv_grid
importinge_row_id
e_column_id
es_row_no,"#ECCALLED

button_clickforeventbutton_click
ofcl_gui_alv_grid
importinges_col_id
es_row_no,"#ECCALLED

data_changedforeventdata_changed
ofcl_gui_alv_grid
importinger_data_changed
e_onf4
e_onf4_before
e_onf4_after,"#ECCALLED

data_changed_finished
foreventdata_changed_finished
ofcl_gui_alv_grid."#ECCALLED

endclass."lcl_events_d0100DEFINITION

*---------------------------------------------------------------------*
*CLASSlcl_events_d0100IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
classlcl_events_d0100implementation.
*---------------------------------------------------------------------*
*METHODdouble_click*
*---------------------------------------------------------------------*
*........*
*---------------------------------------------------------------------*
methoddouble_click.
performd0100_event_double_clickusinge_row
e_column.
endmethod."double_click

*---------------------------------------------------------------------*
*METHODhotspot_click*
*---------------------------------------------------------------------*
*........*
*---------------------------------------------------------------------*
methodhotspot_click.
performd0100_event_hotspot_clickusinge_row_id
e_column_id.
endmethod."hotspot_click

*---------------------------------------------------------------------*
*METHODbutton_click*
*---------------------------------------------------------------------*
*........*
*---------------------------------------------------------------------*
methodbutton_click.
performd0100_event_button_clickusinges_col_id
es_row_no.
endmethod."button_click

methoddata_changed.
performd0100_event_data_changedusinger_data_changed
e_onf4
e_onf4_before
e_onf4_after.
endmethod."data_changed

methoddata_changed_finished.
performd0100_event_data_changed_finis.
endmethod."data_changed_finished
endclass."lcl_events_d0100IMPLEMENTATION

*---------------------------------------------------------------------*
*CLASSrandomDEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
classrandomdefinition.
publicsection.
types:
value(16)typepdecimals0,
numcv(15)typen.
constants:
maxtyperandom=>valuevalue4294967295.
class-methods:
*computesarandomnaturalnumberfromtheset{0,...,random=>max}.
numberreturningvalue(rval)typerandom=>value,
*computesarandomcharacterfromtheset{A-Za-z0-9}
creturningvalue(rval)typechar01,
*computesarandomstringconsistingof"len"randomcharacters
stringimportinglentypei
returningvalue(rval)typestring,
*computesadate
datsreturningvalue(rval)typed,
*computesatime
timereturningvalue(rval)typet,
*computesarandomnumcfromtheset{low,...,high}
numcimportinglowtyperandom=>numcvhightyperandom=>numcv
returningvalue(rval)typerandom=>numcv,
*computesarandomintegerfromtheset{low,...,high}
iimportinglowtypeihightypei
returningvalue(rval)typei,
*computesarandomintegerfromtheset{low,...,high}
int2importinglowtypeint2hightypeint2
returningvalue(rval)typeint2,
*computesarandomintegerfromtheset{low,...,high}
int1importinglowtypeint1hightypeint1
returningvalue(rval)typeint1,
*computesarandomfloatfromtheinterval[low;high]
fimportinglowtypefhightypef
returningvalue(rval)typef,
*computesarandomcharacterfromtheset{A-F0-9}
hexreturningvalue(rval)typechar01,
*computesarandomcharacterfromtheset{0-1}
xreturningvalue(rval)typechar01,
*method"random=>class_constructor"
class_constructor.

privatesection.
class-data:
*precomputedmaximalindex(=stringlength-1)of"random=>chars"
*orof"random=>x_data".
charsmaxtypei,
xmaxtypei,
*randomnumberseedvalue.
*(Usedinmethod"random=>number".)
seedtyperandom=>value.

constants:
*charactersforclass-method"random=>hex"
hex_data(100)typecvalue'ABCDEF'&
'0123456789',
*charactersforclass-method"random=>x"
x_data(100)typecvalue'01',
*charactersforclass-metshod"random=>c"
chars(100)typecvalue'ABCDEFGHIJKLMNOPQRSTUVWXYZ'&
'abcdefghijklmnopqrstuvwxyz'&
'0123456789'.

endclass."randomDEFINITION

*---------------------------------------------------------------------*
*CLASSrandomIMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
classrandomimplementation.
*implementationofthemethodsforrandomizingthevalues
methodx.
data:ritypei.
ri=random=>i(low=0high=random=>xmax).
movex_data+ri(1)torval.
endmethod."x

methodhex.
data:ritypei.
ri=random=>i(low=0high=random=>charsmax).
movehex_data+ri(1)torval.
endmethod."hex

methodnumber.
constants:
a(3)typepvalue67301,"Coefficient
c(1)typepvalue1,"Increment
m(6)typepvalue4294967296."Modulus2**32
random=>seed=(a*random=>seed+c)modm.
rval=random=>seed.
endmethod."number

methodc.
data:
ritypei.
ri=random=>i(low=0high=random=>charsmax).
movechars+ri(1)torval.
endmethod."c

methodstring.
data:
char(1)typec.
clearrval.
dolentimes.
char=random=>c().
concatenatervalcharintorval.
enddo.
endmethod."string

methoddats.
data:l_datetypesy-datum,
l_day(2)typen,
l_month(2)typen,
l_year(4)typen,
l_valuetyperandom=>numcv,
l_lowtyperandom=>numcv,
l_hightyperandom=>numcv.

l_year=sy-datum+0(4).
l_low=l_year-5.
l_high=l_year+5.
l_value=random=>numc(low=l_lowhigh=l_high).
l_year=l_value+11(4).

l_value=random=>numc(low=1high=12).
l_month=l_value+13(2).
casel_month.
when2.
l_high=28.
when4or6or9or11.
l_high=30.
whenothers.
l_high=31.
endcase.

l_value=random=>numc(low=1high=l_high).
l_day=l_value+13(2).

l_date+0(4)=l_year.
l_date+4(2)=l_month.
l_date+6(2)=l_day.

rval=l_date.
endmethod."dats

methodtime.
data:l_timetypet,
l_hour(2)typen,
l_min(2)typen,
l_sec(2)typen,
l_valuetyperandom=>numcv.

l_value=random=>numc(low=0high=60).
l_sec=l_value+13(2).

l_value=random=>numc(low=0high=60).
l_min=l_value+13(2).

l_value=random=>numc(low=1high=24).
l_hour=l_value+13(2).

l_time+0(2)=l_hour.
l_time+2(2)=l_min.
l_time+4(2)=l_sec.

rval=l_time.
endmethod."time

methodnumc.
*Gofrom{0,...,random=>max}to{low,...,high}withABAProunding
data:l_dec(16)typep,
l_char(16)typec.

l_dec=((high-low+1)*random=>number())/random=>max
+'0.5'.
subtract1froml_dec.
addlowtol_dec.

data:lr_type_descrtypereftocl_abap_typedescr,
lr_elem_descrtypereftocl_abap_elemdescr.

lr_type_descr=
cl_abap_typedescr=>describe_by_data(rval).
lr_elem_descr?=lr_type_descr.

l_char=l_dec.
shiftl_charleftdeletingleadingspace.
rval=l_char+0(lr_elem_descr->output_length).
endmethod."i

methodi.
*Gofrom{0,...,random=>max}to{low,...,high}withABAProunding
data:l_dec(16)typep,
l_char(16)typec.

l_dec=((high-low+1)*random=>number())/random=>max
+'0.5'.
subtract1froml_dec.
addlowtol_dec.

data:lr_type_descrtypereftocl_abap_typedescr,
lr_elem_descrtypereftocl_abap_elemdescr.

lr_type_descr=
cl_abap_typedescr=>describe_by_data(rval).
lr_elem_descr?=lr_type_descr.

l_char=l_dec.
shiftl_charleftdeletingleadingspace.
rval=l_char+0(lr_elem_descr->output_length).
endmethod."i

methodint2.
*Gofrom{0,...,random=>max}to{low,...,high}withABAProunding
data:l_dec(16)typep,
l_char(16)typec.

l_dec=((high-low+1)*random=>number())/random=>max
+'0.5'.
subtract1froml_dec.
addlowtol_dec.

data:lr_type_descrtypereftocl_abap_typedescr,
lr_elem_descrtypereftocl_abap_elemdescr.

lr_type_descr=
cl_abap_typedescr=>describe_by_data(rval).
lr_elem_descr?=lr_type_descr.

l_char=l_dec.
shiftl_charleftdeletingleadingspace.
rval=l_char+0(lr_elem_descr->output_length).
endmethod."i

methodint1.
*Gofrom{0,...,random=>max}to{low,...,high}withABAProunding
data:l_dec(16)typep,
l_char(16)typec.

l_dec=((high-low+1)*random=>number())/random=>max
+'0.5'.
subtract1froml_dec.
addlowtol_dec.

data:lr_type_descrtypereftocl_abap_typedescr,
lr_elem_descrtypereftocl_abap_elemdescr.

lr_type_descr=
cl_abap_typedescr=>describe_by_data(rval).
lr_elem_descr?=lr_type_descr.

l_char=l_dec.
shiftl_charleftdeletingleadingspace.
rval=l_char+0(lr_elem_descr->output_length).
endmethod."i

methodf.
*Gofrom{0,...,random=>max}to[low;high]
rval=((high-low)*random=>number())/random=>max
+low.
endmethod."f

methodclass_constructor.
charsmax=strlen(chars)-1.
xmax=strlen(x_data)-1.
seed=1.
endmethod."class_constructor

endclass."randomIMPLEMENTATION

*----------------------------------------------------------------------*
*SELECTION-SCREEN*
*----------------------------------------------------------------------*
selection-screenbeginofblockgenwithframe.
parameters:
p_amounttypeidefault30,
p_dbinfoascheckbox.
selection-screenendofblockgen.

selection-screenbeginofblockinfwithframe.
parameters:
p_inf01ascheckboxdefaultcon_true,
p_inf02ascheckbox.
selection-screenendofblockinf.

selection-screenbeginofblockselwithframetitletext-sel.
parameters:
p_sel01ascheckbox,"NOROWMARK
p_sel02radiobuttongroupsel,"SINGLESELECTION
p_sel03radiobuttongroupsel,"MULTISELECTION
p_sel04radiobuttongroupsel,"CELLSELECTION
p_sel05radiobuttongroupsel."ROW/COLSELECTION
selection-screenendofblocksel.

selection-screenbeginofblocked1withframe.
parameters:
p_gridradiobuttongroupeditdefault'X',
p_colsradiobuttongroupedit.
select-options:
p_colsfforg_fieldnointervalsdefault'CARRID'.
parameters:
p_cellsradiobuttongroupedit.
select-options:
p_cellsfforg_fieldnointervalsdefault'CARRID'.
parameters:
p_noeditradiobuttongroupedit.
selection-screenendofblocked1.

selection-screenbeginofblocked2withframe.
parameters:
p_changeradiobuttongrouptgledefault'X',
p_dispradiobuttongrouptgle.
selection-screenendofblocked2.

selection-screenbeginofblocked3withframe.
parameters:
p_eveditradiobuttongroupeevtdefault'X',
p_evmodradiobuttongroupeevt,
p_noevtradiobuttongroupeevt.
selection-screenendofblocked3.

selection-screenbeginofblocked4withframe.
parameters:
p_rowinsascheckboxdefaultspace,
p_norwmvascheckboxdefaultspace.
selection-screenendofblocked4.

selection-screenbeginofblockof4withframe.
parameters:
p_regf4ascheckbox.

select-options:
p_onf4forg_fieldnointervalsdefault'CARRID'.

selection-screenbeginofline.
selection-screencomment5(30)text-c01forfieldp_f401.
parameters:
p_f401ascheckboxdefaultcon_true."REGISTER
selection-screenendofline.

selection-screenbeginofline.
selection-screencomment5(30)text-c02forfieldp_f402.
parameters:
p_f402ascheckbox."GET_BEFORE
selection-screenendofline.

selection-screenbeginofline.
selection-screencomment5(30)text-c03forfieldp_f403.
parameters:
p_f403ascheckbox."CHANGE_AFTER
selection-screenendofline.

selection-screenbeginofline.
selection-screencomment5(30)text-c04forfieldp_f404.
parameters:
p_f404ascheckbox."INTERNAL_FORMAT
selection-screenendofline.
selection-screenendofblockof4.

selection-screenbeginofblockexpwithframe.
parameters:
p_excp01radiobuttongroupexcp,
p_excp02radiobuttongroupexcp,
p_excp03radiobuttongroupexcp,
p_excp04radiobuttongroupexcp,
p_excp05radiobuttongroupexcp,
p_excp06radiobuttongroupexcp,
p_excp07radiobuttongroupexcp.
parameters:
p_excp_cascheckbox,
p_excp_lascheckbox.
selection-screenendofblockexp.

*----------------------------------------------------------------------*
*ATSELECTION-SCREENONVALUE-REQUEST*
*----------------------------------------------------------------------*
atselection-screenonvalue-requestforp_colsf-low.
performd0100_f4_fcodechangingp_colsf-low.

atselection-screenonvalue-requestforp_cellsf-low.
performd0100_f4_fcodechangingp_cellsf-low.

atselection-screenonvalue-requestforp_onf4-low.
performd0100_f4_fcodechangingp_onf4-low.

*----------------------------------------------------------------------*
*START-OF-SELECTION*
*----------------------------------------------------------------------*
start-of-selection.
gs_test-select_amount=p_amount.
gs_test-only_db_info=p_dbinfo.

gs_test-no_info_popup=p_inf01.
gs_test-info_popup_once=p_inf02.

gs_test-layo_no_rowmark=p_sel01.
casecon_true.
whenp_sel02.
gs_test-layo_selection='B'.
whenp_sel03.
gs_test-layo_selection='C'.
whenp_sel04.
gs_test-layo_selection='D'.
whenp_sel05.
gs_test-layo_selection='A'.
endcase.

casecon_true.
whenp_grid.
gs_test-edit_type=con_edit_grid.
whenp_cols.
gs_test-edit_type=con_edit_column.
loopatp_colsf.
ifnotp_colsf-lowisinitial.
appendp_colsf-lowtogs_test-edit_fields.
endif.
endloop.
whenp_cells.
gs_test-edit_type=con_edit_cell.
loopatp_cellsf.
ifnotp_cellsf-lowisinitial.
appendp_cellsf-lowtogs_test-edit_fields.
endif.
endloop.
endcase.
casecon_true.
whenp_disp.
gs_test-edit_mode=con_edit_mode_display.
whenp_change.
gs_test-edit_mode=con_edit_mode_change.
endcase.
casecon_true.
whenp_evedit.
gs_test-edit_event=con_edit_event_enter.
whenp_evmod.
gs_test-edit_event=con_edit_event_modify.
endcase.
gs_test-no_row_ins=p_rowins.
gs_test-no_row_move=p_norwmv.

ifp_regf4eqcon_true.
loopatp_onf4.
ifnotp_onf4-lowisinitial.
appendp_onf4-lowtogs_test-onf4_fields.
endif.
endloop.
endif.
gs_test-onf4-register=p_f401.
gs_test-onf4-get_before=p_f402.
gs_test-onf4-change_after=p_f403.
gs_test-onf4-internal_format=p_f404.

casecon_true.
whenp_excp01.
gs_test-excp_group='1'.
gs_test-excp_amount=4.
whenp_excp02.
gs_test-excp_group='2'.
gs_test-excp_amount=4.
whenp_excp03.
gs_test-excp_group='3'.
gs_test-excp_amount=4.
whenp_excp04.
gs_test-excp_group='4'.
gs_test-excp_amount=5.
whenp_excp05.
gs_test-excp_group='5'.
gs_test-excp_amount=5.
whenp_excp06.
gs_test-excp_group='6'.
gs_test-excp_amount=3.
whenp_excp07.
gs_test-excp_group='7'.
gs_test-excp_amount=3.
endcase.
gs_test-excp_condense=p_excp_c.
gs_test-excp_led=p_excp_l.

gs_test-bypassing_buffer=space.
gs_test-buffer_active=space.

*----------------------------------------------------------------------*
*END-OF-SELECTION*
*----------------------------------------------------------------------*
end-of-selection.
callscreen100.

*&---------------------------------------------------------------------*
*&Moduled0100_set_statusOUTPUT
*&---------------------------------------------------------------------*
*text
*----------------------------------------------------------------------*
moduled0100_set_statusoutput.
performd0100_set_status.
endmodule."d0100_set_statusOUTPUT

*&---------------------------------------------------------------------*
*&Moduled0100_prepare_containerOUTPUT
*&---------------------------------------------------------------------*
*text
*----------------------------------------------------------------------*
moduled0100_prepare_containeroutput.
performd0100_prepare_container.
endmodule."d0100_prepare_containerOUTPUT

*&---------------------------------------------------------------------*
*&Moduled0100_exitINPUT
*&---------------------------------------------------------------------*
*text
*----------------------------------------------------------------------*
moduled0100_exitinput.
performd0100_exit.
endmodule."d0100_exitINPUT

*&---------------------------------------------------------------------*
*&Moduled0100_fcodeINPUT
*&---------------------------------------------------------------------*
*text
*----------------------------------------------------------------------*
moduled0100_fcodeinput.
performd0100_fcode.
endmodule."d0100_fcodeINPUT

*&---------------------------------------------------------------------*
*&Formd0100_set_status
*&---------------------------------------------------------------------*
*text
*----------------------------------------------------------------------*
formd0100_set_status.

types:beginofl_ty_s_excl,
functypesyucomm,
endofl_ty_s_excl,
l_ty_t_excltypestandardtableofl_ty_s_excl.

data:lt_excltypel_ty_t_excl.

setpf-status'D0100'excludinglt_excl.
settitlebar'D0100'.

endform."d0100_set_status

*&---------------------------------------------------------------------*
*&Formd0100_prepare_container
*&---------------------------------------------------------------------*
*text
*----------------------------------------------------------------------*
formd0100_prepare_container.

data:lt_fcattypelvc_t_fcat,
ls_layotypelvc_s_layo,
ls_varitypedisvariant,
ls_prnttypelvc_s_prnt,
lt_hypetypelvc_t_hype,
l_consistency_checktypechar1.

ifgr_container_d0100isinitial.
ifcl_gui_alv_grid=>offline()isinitial.
createobjectgr_container_d0100
exportingcontainer_name='D0100_CONTAINER'.
endif.

createobjectgr_grid_d0100
exportingi_parent=gr_container_d0100.

performd0100_get_outtab.

performd0100_set_grid_varichangingls_vari.
performd0100_set_grid_layochangingls_layo.
performd0100_set_grid_fcatchanginglt_fcat.
performd0100_set_grid_hypechanginglt_fcat
lt_hype.
performd0100_set_grid_drdnchanginglt_fcat.
performd0100_set_grid_buttchanginglt_fcat.
performd0100_set_grid_onf4.
performd0100_set_grid_events.
performd0100_set_grid_editchangingls_layo
lt_fcat.
ls_prnt-grpchgedit=con_true.

callmethodgr_grid_d0100->set_table_for_first_display
exporting
i_buffer_active=gs_test-buffer_active
i_bypassing_buffer=gs_test-bypassing_buffer
i_consistency_check=l_consistency_check
is_variant=ls_vari
i_save='A'
i_default=con_true
is_layout=ls_layo
is_print=ls_prnt
it_hyperlink=lt_hype
changing
it_outtab=gt_outtab[]
it_fieldcatalog=lt_fcat.
endif.

endform."d0100_prepare_container

*&---------------------------------------------------------------------*
*&Formd0100_exit
*&---------------------------------------------------------------------*
*text
*----------------------------------------------------------------------*
formd0100_exit.

data:l_okcodelikesy-ucomm.

l_okcode=g_okcode.
clearg_okcode.

casel_okcode.
whencon_exitorcon_backorcon_canc.
callmethodgr_grid_d0100->free.
callmethodgr_container_d0100->free.

callmethodcl_gui_cfw=>flush.

cleargr_container_d0100.
cleargr_grid_d0100.
cleargr_events_d0100.

setscreen0.
leavescreen.
endcase.

endform."d0100_exit

*&---------------------------------------------------------------------*
*&Formd0100_fcode
*&---------------------------------------------------------------------*
*text
*----------------------------------------------------------------------*
formd0100_fcode.

data:l_okcodelikesy-ucomm.

l_okcode=g_okcode.
clearg_okcode.

casel_okcode.
whencon_exitorcon_backorcon_canc.
g_okcode=l_okcode.
performd0100_exit.

whencon_save.
callmethodgr_grid_d0100->check_changed_data.

when'TOGGLE'."#ECNOTEXT
data:l_edittypei.

casegs_test-edit_mode.
whencon_edit_mode_change.
gs_test-edit_mode=con_edit_mode_display.
l_edit=con_off.
whencon_edit_mode_display.
gs_test-edit_mode=con_edit_mode_change.
l_edit=con_on.
endcase.

callmethodgr_grid_d0100->set_ready_for_input
exporting
i_ready_for_input=l_edit.
endcase.

endform."d0100_fcode

*&---------------------------------------------------------------------*
*&Formd0100_set_grid_vari
*&---------------------------------------------------------------------*
*text
*----------------------------------------------------------------------*
formd0100_set_grid_varichangingcs_varitypedisvariant.

cs_vari-report=sy-repid.
cs_vari-handle=space.
cs_vari-log_group=space.
cs_vari-username=space.
cs_vari-variant=space.
cs_vari-text=space.
cs_vari-dependvars=space.

endform."d0100_set_grid_vari

*&---------------------------------------------------------------------*
*&Formd0100_set_grid_layo
*&---------------------------------------------------------------------*
*text
*----------------------------------------------------------------------*
formd0100_set_grid_layochangingcs_layotypelvc_s_layo.

*...ALV-Control:AllgemeineAnzeigeoptionen
cs_layo-stylefname=space.

cs_layo-cwidth_opt=con_true.
cs_layo-zebra=space.
cs_layo-smalltitle=space.
cs_layo-graphics=space.
cs_layo-frontend=space.
cs_layo-template=space.

*...ALV-Control:Gridcustomizing
cs_layo-no_colexpd=space.
cs_layo-no_hgridln=space.
cs_layo-no_vgridln=space.
cs_layo-no_rowmark=gs_test-layo_no_rowmark.
cs_layo-no_headers=space.
cs_layo-no_merging=space.
cs_layo-grid_title=space.

cs_layo-no_toolbar=space.

cs_layo-sel_mode=gs_test-layo_selection.

cs_layo-box_fname='BOX'.

cs_layo-sgl_clk_hd=space.

*...ALV-Control:Summenoptionen
cs_layo-totals_bef=space.
cs_layo-no_totline=space.
cs_layo-numc_total=con_true.
cs_layo-no_utsplit=space.

*...ALV-Control:Exceptions
cs_layo-excp_group=gs_test-excp_group.
cs_layo-excp_fname='LIGHTS'.
cs_layo-excp_rolln=space.
cs_layo-excp_conds=gs_test-excp_condense.
cs_layo-excp_led=gs_test-excp_led.

*...ALV-Control:SteuerungInteraktion
cs_layo-detailinit=space.
cs_layo-detailtitl=space.
cs_layo-keyhot=space.
cs_layo-no_keyfix=space.
cs_layo-no_author=space.
clearcs_layo-s_dragdrop.

*...ALV-Control:Farben
cs_layo-info_fname=space.
cs_layo-ctab_fname=space.

*...ALV-Control:Eingabefähigkeit
cs_layo-edit=space.
cs_layo-edit_mode=space.

cs_layo-no_rowins=space.
cs_layo-no_rowmove=space.

*...ALV-Control:Web-Optionen
cs_layo-weblook=space.
cs_layo-webstyle=space.
cs_layo-webrows=space.
cs_layo-webxwidth=space.
cs_layo-webxheight=space.

endform."d0100_set_grid_layo

*&---------------------------------------------------------------------*
*&Formd0100_set_grid_fcat
*&---------------------------------------------------------------------*
*text
*----------------------------------------------------------------------*
formd0100_set_grid_fcatchangingct_fcattypelvc_t_fcat.

data:ls_fcattypelvc_s_fcat,
l_lintypei.

callfunction'LVC_FIELDCATALOG_MERGE'
exporting
i_buffer_active=gs_test-buffer_active
i_structure_name=con_sflight
i_client_never_display=con_true
i_bypassing_buffer=gs_test-bypassing_buffer
changing
ct_fieldcat=ct_fcat[]
exceptions
inconsistent_interface=1
program_error=2
others=3.
ifsy-subrc<>0.
messageidsy-msgidtypesy-msgtynumbersy-msgno
withsy-msgv1sy-msgv2sy-msgv3sy-msgv4.
endif.

checkgs_test-only_db_infoeqspace.

describetablect_fcatlinesl_lin.
add1tol_lin.

clearls_fcat.
ls_fcat-tabname='1'.
ls_fcat-fieldname='CHECKBOX'.
ls_fcat-checkbox=con_true.
ls_fcat-inttype='C'.
ls_fcat-datatype='CHAR'.
ls_fcat-intlen=1.
ls_fcat-col_pos=l_lin.
ls_fcat-scrtext_s=ls_fcat-fieldname.
ls_fcat-scrtext_m=ls_fcat-fieldname.
ls_fcat-scrtext_l=ls_fcat-fieldname.
appendls_fcat<spa

你可能感兴趣的:(C++,c,C#,F#)