HELP me in alv HIERARCHY
HI,
Can any one send some hierarchial alv progrms.
with warm regards,
khadar.
Hi,
report zwmr_pick_status_report no standard page heading
message-id zw.
Type Pools *
type-pools: icon, slis.
Tables *
tables: tvst,
likp,
t30b,
vekp,
zpallettr,
zvantr.
Types *
types:
begin of ty_data,
lgtor like likp-lgtor, " door
vbeln like likp-vbeln, " delivery
wbstk like vbuk-wbstk, " Goods movement status
kostk like vbuk-kostk, " Picking status
posnr like lips-posnr, " item
route like likp-route, " route
wadat like likp-wadat, " goods issue date
lvsta like vbup-lvsta, " warehouse status
packvorschr like vekp-packvorschr, " pack mnemonic
exidv like vekp-exidv, " handling unit
zpallet_no(10), "like zpallettr-zpallet_no, " pallet no
zcount_check like zpallettr-zcount_check," count check flag
zvan_no(10), "like zvantr-zvan_no, " van no
zvan_print like zvantr-zvan_print, " van manifest print
zeod_print like zvantr-zeod_print, " eod manifest print
zzpackclass like vekp-zzpackclass, " package class
zzti like vekp-zzti, " T.I. value
end of ty_data.
Data *
ranges: r_del for likp-vbeln,
r_lgtor for likp-lgtor.
ranges: r_vanno for zvantr-zvan_no,
r_palno for zpallettr-zpallet_no.
data: begin of number_range occurs 0,
mark(1),
id(3),
num(10) type n,
desc like zpalletmd-zdesc,
end of number_range.
data: t_disp_tab type standard table of zpickdisp,
t_data_tab type ty_data occurs 0 with header line,
t_disp_head type standard table of zpickhead.
data: w_numrnge like number_range,
w_number(10) type n.
data: t_likp like likp occurs 0 with header line,
t_lips like lips occurs 0 with header line,
t_vbuk like vbuk occurs 0 with header line,
t_vbup like vbup occurs 0 with header line,
t_vepo like vepo occurs 0 with header line,
t_vekp like vekp occurs 0 with header line,
t_vantr like zvantr occurs 0 with header line,
t_pallettr like zpallettr occurs 0 with header line,
w_likp like likp,
w_lips like lips,
w_vbuk like vbuk,
w_vbup like vbup,
w_vepo like vepo,
w_vekp like vekp.
ALV DATA *****
data:
g_grid type ref to cl_gui_alv_grid,
g_sort type slis_t_sortinfo_alv,
g_custom_container type ref to cl_gui_custom_container,
g_layout type slis_layout_alv,
gt_fieldcat type slis_t_fieldcat_alv,
t_fldcat like line of gt_fieldcat,
g_keyinfo type slis_keyinfo_alv,
gt_events type slis_t_event,
gs_event type slis_alv_event,
w_sy_repid like sy-repid.
data: begin of seltab occurs 0.
include structure rsparams.
data: end of seltab.
SYSTEM GENERATED TABLE CONTROL DATA ********
DECLARATION OF TABLECONTROL 'TC_TABCON' ITSELF
controls: tc_tabcon type tableview using screen 0100.
LINES OF TABLECONTROL 'TC_TABCON'
data: g_tc_tabcon_lines like sy-loopc.
data: ok_code like sy-ucomm.
Constants *
constants: c_data_class like klah-class value 'DG_DATA',
c_mat_class like rmclf-klart value '001',
c_pack like lips-mtart value 'VERP',
c_a(1) value 'A',
c_b(1) value 'B',
c_c(1) value 'C',
c_yes(1) value 'X',
c_no(1) value ' '.
Selection screen *
standard report select options block
selection-screen begin of block a with frame title text-002.
select-options:
s_wadat for likp-wadat no-extension obligatory. " Goods Issue Date
*parameters: "TR01-
p_vstel like tvst-vstel obligatory. " Shipping Point "TR01-
select-options: "TR01+
p_vstel for tvst-vstel. " Shipping Point "TR01+
select-options:
s_lfart for likp-lfart, " Delivery type
s_lgtor for t30b-lgtor, " Door selection
s_exidv for vekp-exidv, " Handling Unit
s_vbeln for likp-vbeln. " Delivery
parameters:
p_exdata as checkbox. " Show extra columns flag
selection-screen end of block a.
van/pallet specific select options block
selection-screen begin of block b with frame title text-001.
select-options:
s_palno for zpallettr-zpallet_no, " no-extension,
s_vanno for zvantr-zvan_no. " no-extension.
selection-screen end of block b.
Value Request Events *
at selection-screen on value-request for s_palno-low.
clear: number_range, w_number .
refresh number_range.
select numbers and display pop up screen for selection
perform select_pal_nos.
s_palno-low = w_number.
at selection-screen on value-request for s_palno-high.
clear: number_range, w_number .
refresh number_range.
select numbers and display pop up screen for selection
perform select_pal_nos.
s_palno-high = w_number.
at selection-screen on value-request for s_vanno-low.
clear: number_range, w_number .
refresh number_range.
select numbers and display pop up screen for selection
perform select_van_nos.
s_vanno-low = w_number.
at selection-screen on value-request for s_vanno-high.
clear: number_range, w_number .
refresh number_range.
select numbers and display pop up screen for selection
perform select_van_nos.
s_vanno-high = w_number.
At Selection Screen *
at selection-screen.
perform validate_selections.
Initialization *
initialization.
Start of selection *
start-of-selection.
clear all data tables
clear: t_likp,
t_lips,
t_vbuk,
t_vbup,
t_vepo,
t_vantr,
t_pallettr,
w_likp,
w_lips,
w_vbuk,
w_vbup,
w_vepo,
w_vekp.
refresh: t_likp,
t_lips,
t_vbuk,
t_vbup,
t_vepo,
t_vantr,
t_pallettr.
select data for ALV
due to different input parameters being used, to streamline the data
selection process, different selection methods are required
if not s_vanno is initial
or not s_palno is initial.
if selecting by van/pallet number, need to select the data from the
handling unit upwards to delivery
perform select_data_up.
else.
otherwise the data can be selected from the delivery downwards
perform select_data_down.
endif.
End of selection *
end-of-selection.
call hierarchical ALV display function module
call function 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
exporting
i_callback_program = 'ZWMR_PICK_STATUS_REPORT'
i_callback_pf_status_set = 'SET_STATUS'
i_callback_user_command =
'USER_COMMAND' "custom gui status form
is_layout = g_layout "user command form
it_fieldcat = gt_fieldcat
it_sort = g_sort
it_events = gt_events
i_tabname_header = 't_disp_head'
i_tabname_item = 't_disp_tab'
i_structure_name_header = 'ZPICKHEAD'
i_structure_name_item = 'ZPICKDISP'
is_keyinfo = g_keyinfo
tables
t_outtab_header = t_disp_head
t_outtab_item = t_disp_tab.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
FORMS *
Includes inserted by Screen Painter Wizard. DO NOT CHANGE THIS LINE!
include zwmr_pick_status_reporto01 .
include zwmr_pick_status_reporti01 .
include zwmr_pick_status_reportf01 .
*& Form select_pal_nos
select pallet numbers for search help
form select_pal_nos.
data: begin of t_palno occurs 0,
zpallet_no like zpallettr-zpallet_no,
end of t_palno.
select all available pallet numbers
select distinct zpallet_no from zpallettr
into corresponding fields of table t_palno.
loop at t_palno.
get pallet id
select single zpallet_id from zpallettr
into number_range-id
where zpallet_no = t_palno-zpallet_no.
get pallet description
select single zdesc from zpalletmd
into number_range-desc
where zpallet_id = number_range-id.
number_range-num = t_palno-zpallet_no.
append to search help table
append number_range.
endloop.
call pop up dialog box
call screen 0100 starting at 5 5.
endform. " select_pal_nos
*& Form select_van_nos
select van numbers for search help
form select_van_nos.
data: begin of t_vanno occurs 0,
zvan_no like zvantr-zvan_no,
end of t_vanno.
select available van numbers
select distinct zvan_no from zvantr
into corresponding fields of table t_vanno.
loop at t_vanno.
select van id
select single zvan_id from zvantr
into number_range-id
where zvan_no = t_vanno-zvan_no.
select van description (maintained in pallet tables)
select single zdesc from zpalletmd
into number_range-desc
where zpallet_id = number_range-id.
number_range-num = t_vanno-zvan_no.
append to search help table
append number_range.
endloop.
call pop up dialog box
call screen 0100 starting at 5 5.
endform. " select_van_nos
*& Form select_data_down
select data if selecting from delivery down
form select_data_down.
select all deliveries from LIKP that fulfill selection criteria
select * from likp into table t_likp
where vbeln in s_vbeln
and vstel eq p_vstel "TR01-
and vstel in p_vstel
and lgtor in s_lgtor
and wadat in s_wadat
and lfart in s_lfart.
if sy-subrc ne 0.
no data found
message i007.
exit.
endif.
if not t_likp[] is initial.
select sales document headers from VBUK
select * from vbuk into table t_vbuk
for all entries in t_likp
where vbeln eq t_likp-vbeln.
select all relevant delivery items from LIPS
select * from lips into table t_lips
for all entries in t_likp
where vbeln eq t_likp-vbeln
and pstyv ne 'ZPAC'
and pstyv ne 'ZGDP' "TR02+
and lfimg gt 0. "TR01+
endif.
if not t_lips[] is initial.
select all sales document line items from VBUP
select * from vbup into table t_vbup
for all entries in t_lips
where vbeln eq t_lips-vbeln
and posnr = t_lips-posnr.
select corresponding handling unit ID's (venum)
TR03 Replace start
select * from vepo appending corresponding fields of table t_vepo
for all entries in t_lips
where vbeln = t_lips-vbeln
and posnr = t_lips-posnr
and matnr = t_lips-matnr
and charg = t_lips-charg.
select * from vepo
inner join vekp on vepovenum = vekpvenum
appending corresponding fields of table t_vepo
for all entries in t_lips
where vepo~vbeln = t_lips-vbeln
and vepo~posnr = t_lips-posnr
and vepo~matnr = t_lips-matnr
and vepo~charg = t_lips-charg
and vekp~exidv in s_exidv.
TR03 Replace end
endif.
build process table
perform move_to_table.
endform. "select_data_down
*& Form select_data_up
select data if selecting from van/pallet up
form select_data_up.
if not s_vanno is initial.
if van then select van numbers and hence pallet numbers
select * from zvantr into table t_vantr
where zvan_no in s_vanno.
and vstel eq p_vstel."TR01-
if not t_vantr[] is initial.
select * from zpallettr into table t_pallettr
for all entries in t_vantr
where zpallet_no eq t_vantr-zpallet_no.
and vstel eq p_vstel."TR01-
endif.
else.
otherwise can get pallet numbers directly
select * from zpallettr into table t_pallettr
where zpallet_no in s_palno.
and vstel eq p_vstel."TR01-
endif.
if not t_pallettr[] is initial.
from the pallet nos. we can select the handling units
select * from vekp into table t_vekp
for all entries in t_pallettr
where exidv eq t_pallettr-exidv
and exidv ne space
and exidv in s_exidv "TR03+
and ( exida = 'E' "TR01+
or exida = 'F' ). "TR01+
endif.
if not t_vekp[] is initial.
build vbeln range from t_vekp.
loop at t_vekp.
r_del-sign = 'I'.
r_del-option = 'EQ'.
r_del-low = t_vekp-vpobjkey.
append r_del.
endloop.
select all deliveries from LIKP that correspond to HU's
select * from likp into table t_likp
where vbeln in r_del
and wadat in s_wadat
and lfart in s_lfart.
endif.
if not t_likp[] is initial.
select sales document headers from VBUK
select * from vbuk into table t_vbuk
for all entries in t_likp
where vbeln eq t_likp-vbeln.
select all relevant delivery items from LIPS
select * from lips into table t_lips
for all entries in t_likp
where vbeln eq t_likp-vbeln
and pstyv ne 'ZPAC'
and pstyv ne 'ZGDP' "TR02+
and lfimg gt 0. "TR01+
endif.
if not t_lips[] is initial.
select all sales document line items from VBUP
select * from vbup into table t_vbup
for all entries in t_lips
where vbeln eq t_lips-vbeln
and posnr = t_lips-posnr.
select corresponding handling unit ID's (venum)
select * from vepo appending corresponding fields of table t_vepo
for all entries in t_lips
where vbeln = t_lips-vbeln
and posnr = t_lips-posnr
and matnr = t_lips-matnr
and charg = t_lips-charg.
endif.
build process table
perform move_to_table.
endform. "select_data_up
*& Form move_to_table
move data to processing table
form move_to_table.
loop at t_vepo.
clear t_data_tab.
delivery lines.
clear w_lips.
read table t_lips with key vbeln = t_vepo-vbeln
posnr = t_vepo-posnr
into w_lips.
move-corresponding w_lips to t_data_tab.
sales document line items
clear w_vbup.
read table t_vbup with key vbeln = t_vepo-vbeln
posnr = t_vepo-posnr
into w_vbup.
if w_vbup-kosta = space. "TR01-
not relevant for picking
delete t_vepo. "TR01-
continue. "TR01-
else. "TR01-
move-corresponding w_vbup to t_data_tab.
endif. "TR01-
sales doc header
clear w_vbuk.
read table t_vbuk with key vbeln = t_vepo-vbeln
into w_vbuk.
move-corresponding w_vbuk to t_data_tab.
delivery header
clear w_likp.
read table t_likp with key vbeln = t_vepo-vbeln
into w_likp.
move-corresponding w_likp to t_data_tab.
select handling unit info using vepo entry
clear w_vekp.
if t_vekp[] is initial.
select single * from vekp into w_vekp
where venum = t_vepo-venum.
else.
read table t_vekp with key venum = t_vepo-venum
into w_vekp.
if sy-subrc ne 0.
select single * from vekp into w_vekp
where venum = t_vepo-venum.
endif.
endif.
move-corresponding w_vekp to t_data_tab.
select pallet / van load information
select single zpallet_no zcount_check from zpallettr
into (t_data_tab-zpallet_no,
t_data_tab-zcount_check)
where exidv eq w_vekp-exidv.
if not t_data_tab-zpallet_no in s_palno. "TR01+
continue. "TR01+
endif. "TR01+
if sy-subrc = 0.
select single zvan_no zvan_print zeod_print from zvantr
into (t_data_tab-zvan_no,
t_data_tab-zvan_print,
t_data_tab-zeod_print)
where zpallet_no eq t_data_tab-zpallet_no.
if not t_data_tab-zvan_no in s_vanno. "TR01+
continue. "TR01+
endif. "TR01+
endif.
append t_data_tab.
endloop.
*-----> TR01+ start
If the delivery has yet to be packed, then need to include in report
Thus delete t_lips here and if any entries left after looping through
t_vepo, these will also need to be added to t_data_tab
if the selection is by handling unit though we do not want these"TR03+
if s_exidv is initial. "TR03+
loop at t_vepo.
read table t_lips with key vbeln = t_vepo-vbeln
posnr = t_vepo-posnr.
if sy-subrc = 0.
delete t_lips index sy-tabix.
endif.
endloop.
if not t_lips[] is initial.
move any unpacked items to the data table
perform move_lips_to_table.
endif.
endif. "TR03+
*<---- TR01+ End
get relevant status icons
perform select_icons.
prepare ALV data
perform prepare_alv.
endform. " select_data
*& Form select_icons
select icons for display and move data to display table
form select_icons.
data: w_disp_tab like zpickdisp,
w_disp_head like zpickhead,
w_color like zpickdisp-color,
ov_icon like zpickdisp-ov_icon,
gi_icon like zpickdisp-gi_icon,
to_icon like zpickdisp-to_icon,
lp_icon like zpickdisp-lp_icon,
pc_icon like zpickdisp-pc_icon,
lv_icon like zpickdisp-lv_icon,
vm_icon like zpickdisp-vm_icon,
em_icon like zpickdisp-em_icon,
t_ovst_tab like t_disp_tab with header line.
constants: c_col1(3) value 'C10',
c_col2(3) value 'C20'.
sort t_data_tab by lgtor vbeln.
w_color = c_col2.
loop at t_data_tab.
at new lgtor.
fill ALV header table
clear w_disp_head.
w_disp_head-lgtor = t_data_tab-lgtor.
append w_disp_head to t_disp_head.
endat.
goods issue status & overall amber/green only
case t_data_tab-wbstk.
when c_c.
move icon_green_light to gi_icon.
move icon_green_light to ov_icon.
when others.
move icon_red_light to gi_icon.
move icon_yellow_light to ov_icon.
endcase.
transfer order status
case t_data_tab-lvsta.
when c_a.
move icon_red_light to to_icon.
when c_b.
move icon_yellow_light to to_icon.
when c_c.
move icon_green_light to to_icon.
when space.
write N/A
to_icon = 'N/A'.
endcase.
loaded to pallet status
if not t_data_tab-zpallet_no is initial.
move icon_green_light to lp_icon.
else.
move icon_red_light to lp_icon.
endif.
pallet count status
if not t_data_tab-zcount_check is initial.
move icon_green_light to pc_icon.
else.
move icon_red_light to pc_icon.
endif.
loaded to van status
if not t_data_tab-zvan_no is initial.
move icon_green_light to lv_icon.
else.
move icon_red_light to lv_icon.
endif.
van manifest status
if not t_data_tab-zvan_print is initial.
move icon_green_light to vm_icon.
else.
move icon_red_light to vm_icon.
endif.
end of day manifest status
if not t_data_tab-zeod_print is initial.
move icon_green_light to em_icon.
else.
move icon_red_light to em_icon.
endif.
move working data table to display table
move-corresponding t_data_tab to w_disp_tab.
w_disp_tab-ov_icon = ov_icon.
w_disp_tab-gi_icon = gi_icon.
w_disp_tab-to_icon = to_icon.
w_disp_tab-lp_icon = lp_icon.
w_disp_tab-pc_icon = pc_icon.
w_disp_tab-lv_icon = lv_icon.
w_disp_tab-vm_icon = vm_icon.
w_disp_tab-em_icon = em_icon.
w_disp_tab-color = w_color.
fill N/A values for initial fields for display
if w_disp_tab-packvorschr is initial.
w_disp_tab-packvorschr = 'N/A'.
endif.
if w_disp_tab-exidv is initial.
w_disp_tab-exidv = 'N/A'.
endif.
if w_disp_tab-zpallet_no is initial.
write 'N/A' to w_disp_tab-zpallet_no.
endif.
if w_disp_tab-zvan_no is initial.
write 'N/A' to w_disp_tab-zvan_no.
endif.
display different color for new doc number
at end of vbeln.
if w_color = c_col1.
w_color = c_col2.
elseif w_color = c_col2.
w_color = c_col1.
endif.
endat.
append w_disp_tab to t_disp_tab.
clear w_disp_tab.
endloop.
we have all the icons in display but need to check the overall status
as this refers to the line items
green and amber statuses already set and use the same criteria as the
goods issue status unless detected as red here
data: ov_stat_red(1).
clear w_disp_tab.
sort t_disp_tab by vbeln.
loop at t_disp_tab into w_disp_tab.
at new vbeln.
check all line items for delivery
loop at t_data_tab where vbeln = w_disp_tab-vbeln.
if t_data_tab-lvsta = c_a.
set overall status to red
ov_stat_red = c_yes.
exit.
else.
leave green/amber status icon as previosly determined
endif.
endloop.
if ov_stat_red = c_yes.
set overall status to red for all items in that delivery
clear ov_stat_red.
move icon_red_light to w_disp_tab-ov_icon.
modify t_disp_tab from w_disp_tab transporting ov_icon
where vbeln = w_disp_tab-vbeln.
endif.
endat.
endloop.
endform. " select_icons
*& Form fill_layout
fill ALV layout parameters
form fill_layout.
clear g_layout.
g_layout-colwidth_optimize = c_yes. " column width optimisation
g_layout-zebra = space. " alternate line colors
g_layout-box_fieldname = 'MARK'. " checkbox fieldname
g_layout-info_fieldname = 'COLOR'. " highlight row indicator
g_layout-no_vline = space. " vertical line
g_layout-key_hotspot = space. " hotspot field
g_layout-f2code = 'PICK'. " F2 ok_code
g_layout-numc_sum = c_yes. " sum numc fields
g_layout-box_tabname = 't_disp_head'. " checkbox table name
g_layout-expand_fieldname = 'EXPAND'. " expand field name
endform. " fill_layout
*& Form fill_sort
fill ALV sort table
form fill_sort.
data: w_g_sort type slis_sortinfo_alv.
w_g_sort-spos = 1.
w_g_sort-fieldname = 'LGTOR'.
w_g_sort-tabname = 't_disp_tab'.
w_g_sort-up = c_yes.
append w_g_sort to g_sort.
w_g_sort-spos = 2.
w_g_sort-fieldname = 'VBELN'.
w_g_sort-tabname = 't_disp_tab'.
w_g_sort-up = c_yes.
append w_g_sort to g_sort.
w_g_sort-spos = 3.
w_g_sort-fieldname = 'POSNR'.
w_g_sort-tabname = 't_disp_tab'.
w_g_sort-up = c_yes.
append w_g_sort to g_sort.
w_g_sort-spos = 4.
w_g_sort-fieldname = 'WADAT'.
w_g_sort-tabname = 't_disp_tab'.
w_g_sort-up = c_yes.
append w_g_sort to g_sort.
endform. " fill_sort
*& Form fill_fieldcat
Fill field category structure for ALV
form fill_fieldcat.
clear t_fldcat.
create field catalogue for header table
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = 'ZWMR_PICK_STATUS_REPORT'
i_internal_tabname = 't_disp_head'
i_structure_name = 'ZPICKHEAD'
i_client_never_display = c_yes
changing
ct_fieldcat = gt_fieldcat[].
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
ceate field catalogue for items table
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = 'ZWMR_PICK_STATUS_REPORT'
i_internal_tabname = 't_disp_tab'
i_structure_name = 'ZPICKDISP'
i_client_never_display = c_yes
changing
ct_fieldcat = gt_fieldcat[].
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
modify field catalogue for this report
set no display flag if not requested on selection screen
if p_exdata ne c_yes.
t_fldcat-no_out = c_yes.
modify gt_fieldcat from t_fldcat transporting no_out
where fieldname eq 'PACKVORSCHR'
or fieldname eq 'EXIDV'
or fieldname eq 'ZPALLET_NO'
or fieldname eq 'ZVAN_NO'
or fieldname eq 'ZZPACKCLASS'
or fieldname eq 'ZZTI'.
endif.
set no display flag for item level LGTOR field
t_fldcat-no_out = c_yes.
modify gt_fieldcat from t_fldcat transporting no_out
where fieldname eq 'LGTOR'
and tabname eq 't_disp_tab'.
prevent display of technical fields
t_fldcat-tech = c_yes.
modify gt_fieldcat from t_fldcat transporting tech
where fieldname eq 'EXPAND'
or fieldname eq 'SELKZ'.
set vbeln as key
t_fldcat-key = c_yes.
modify gt_fieldcat from t_fldcat transporting key
where fieldname eq 'VBELN'.
prevent scrolling for info fields
t_fldcat-fix_column = c_yes.
modify gt_fieldcat from t_fldcat transporting fix_column
where fieldname eq 'VBELN'.
endform. " fill_fieldcat
*& Form prepare_ALV
Fill ALV parameters
form prepare_alv.
fill ALV key info
g_keyinfo-header01 = 'LGTOR'.
g_keyinfo-item01 = 'LGTOR'.
fill ALV events
gs_event-name = 'TOP_OF_PAGE'.
gs_event-form = 'TOP_OF_PAGE'.
append gs_event to gt_events.
fill ALV sort table
perform fill_sort.
fill ALV layout structure
perform fill_layout.
fill ALV field category
perform fill_fieldcat.
endform. " prepare_ALV
*& Form user_command
form called on user command from ALV list
form user_command using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.
data: index type i,
w_disp_head like line of t_disp_head,
w_door like likp-lgtor.
clear r_lgtor. refresh r_lgtor.
case r_ucomm.
when 'PICK'. " Double click line
when 'VANM'. " Van Manifest button
read the header table where has been selected
loop at t_disp_head into w_disp_head where mark = c_yes.
r_lgtor-sign = 'I'.
r_lgtor-option = 'EQ'.
r_lgtor-low = w_disp_head-lgtor.
append r_lgtor.
endloop.
print the van manifest
perform print_van_manifest tables r_lgtor.
when 'EODM'. " EOD Manifest button
read the header table where has been selected
loop at t_disp_head into w_disp_head where mark = c_yes.
r_lgtor-sign = 'I'.
r_lgtor-option = 'EQ'.
r_lgtor-low = w_disp_head-lgtor.
append r_lgtor.
endloop.
print the end of day manifest
perform print_eod_manifest tables r_lgtor.
when 'REFR'. "Refresh
refresh display
w_sy_repid = sy-repid.
call function 'RS_REFRESH_FROM_SELECTOPTIONS'
exporting
curr_report = w_sy_repid
tables
selection_table = seltab.
exceptions
not_found = 1
no_report = 2
others = 3.
Similar Messages
-
Displaying ALV hierarchy at a certain level
Hi all,
I have an ALV report that shows a hierarchy. This ALV hierarchy is created using std class CL_GUI_ALV_TREE.
The number of hierarchy levels is dynamic and only determined during run time. However I would like to be able to either display all nodes expanded or only the last node unexpanded. In other words I would like to control which hierarhcy level is expanded when the report is first displayed.
Can anyone suggest a way to do this please?
ThanksIf you want to display the sum for a given hierarchy level, you should use CUBESET function.
e.g.
=IF(B2="all",CUBESET("mycube","[Location].[Location Hierarchy].[Department].&[DEPT 07]","all"),Cubemember("MyCube","[Location].[Location Hierarchy].[Department].&[DEPT 07].&["&B1&"]"))
Hope it helps. -
Dear Experts,
Can anyone tell me how to create a ALV Hierarchial report with one HEADER table and multiple ITEM(child) tables.
thanks & regards,
gautamHi you can tray review this code for a example i found in the web and help me:
REPORT Z_TEST_HIESEQ_REPORT.
TABLES: ekko,ekpo.
* selection option
SELECT-OPTIONS s_ebeln FOR ekko-ebeln.
TYPE-POOLS:slis.
* define header table and item table
DATA: BEGIN OF headertab OCCURS 0,
ebeln LIKE ekko-ebeln,
bstyp LIKE ekko-bstyp,
bsart LIKE ekko-bsart,
statu LIKE ekko-statu,
END OF headertab.
DATA: BEGIN OF itemtab OCCURS 0,
ebeln LIKE ekpo-ebeln,
ebelp LIKE ekpo-ebelp,
matnr LIKE ekpo-matnr,
werks LIKE ekpo-werks,
menge LIKE ekpo-menge,
netpr LIKE ekpo-netpr,
peinh LIKE ekpo-peinh,
netwr LIKE ekpo-netwr,
END OF itemtab.
DATA: i_fieldcat TYPE slis_t_fieldcat_alv.
DATA: v_repid LIKE sy-repid.u201Ccurrent program name
DATA: g_tabname_header TYPE slis_tabname,
g_tabname_item TYPE slis_tabname.
* data connect header table and item table
* we can set 5 field as foreign key at same time
DATA: gs_keyinfo TYPE slis_keyinfo_alv.
INITIALIZATION.
v_repid = sy-repid.
START-OF-SELECTION.
PERFORM get_data.
END-OF-SELECTION.
* get field catalog of header table
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = v_repid
i_internal_tabname = 'HEADERTAB'
i_inclname = v_repid
i_bypassing_buffer = 'X'
i_buffer_active = "
CHANGING
ct_fieldcat = i_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <;>; 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1
sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* get field catalog of item table
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'ITEMTAB'
i_inclname = v_repid
i_bypassing_buffer = 'X'
i_buffer_active = "
CHANGING
ct_fieldcat = i_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <;>; 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1
sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* set the header and item table are connected by pur doc number
gs_keyinfo-header01 = 'EBELN'.
gs_keyinfo-item01 = 'EBELN'.
g_tabname_header = 'HEADERTAB'.
g_tabname_item = 'ITEMTAB'.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
i_callback_program = v_repid
it_fieldcat = i_fieldcat
i_save = 'A'
i_tabname_header = g_tabname_header
i_tabname_item = g_tabname_item
is_keyinfo = gs_keyinfo
i_bypassing_buffer = 'X'
i_buffer_active = ' '
TABLES
t_outtab_header = headertab
t_outtab_item = itemtab
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <;>; 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
FORM get_data.
SELECT ebeln bstyp bsart statu
INTO TABLE headertab
FROM ekko
UP TO 100 ROWS
WHERE ebeln IN s_ebeln.
IF NOT headertab[] IS INITIAL.
SELECT ebeln ebelp matnr werks menge netpr peinh netwr
INTO TABLE itemtab
FROM ekpo
FOR ALL ENTRIES IN headertab
WHERE ebeln = headertab-ebeln.
ENDIF.
ENDFORM. "get_data
Edited by: Juan Manuel Garcia on Aug 17, 2010 11:29 PM
Edited by: Juan Manuel Garcia on Aug 17, 2010 11:36 PM -
Alv hierarchy subtotal in 2 fields
Hi gurus,
First, thanks to all those who helped me with my first problem. I have a new question, still regarding subtotal.
The client now wants to have a subtotal in alv hierarchy per vendor and purchase doc. My output displays a subtotal per purchase doc only. Client wants to have an output that would look like this:
VENDOR
PURCH DOC PO AMT.
1
410000001 1000
410000001 2000
410000001 3000 (subtotal per purch doc)
410000002 100
410000002 100 (subtotal per purch doc)
1 3100 (subtotal per vendor)
2
420000001 500
420000001 300
420000001 800 (subtotal per purch doc)
2 800 (subtotal per vendor)
TOTAL 3900
Here's an excerpt of my code:
FORM build_fcat using p_type changing p_fcat.
data lt_fcat type slis_t_fieldcat_alv.
field-symbols <fs_fcat> like line of lt_fcat.
lt_fcat = p_fcat.
loop at lt_fcat assigning <fs_fcat>.
<fs_fcat>-ddictxt = 'L'.
case <fs_fcat>-fieldname.
when 'LIFNR'.
<fs_fcat>-seltext_l = 'VENDOR'.
<fs_fcat>-tabname = 'I_HEADER'.
<fs_fcat>-key = 'X'.
<fs_fcat>-outputlen = 15.
modify lt_fcat from <fs_fcat>.
when 'EBELN'.
<fs_fcat>-seltext_l = 'PURCH DOC'.
<fs_fcat>-tabname = 'I_ITEM'.
<fs_fcat>-key = 'X'.
<fs_fcat>-outputlen = 12.
modify lt_fcat from <fs_fcat>.
when 'RLWRT'.
<fs_fcat>-seltext_l = 'PO AMT.'.
<fs_fcat>-tabname = 'I_ITEM'.
<fs_fcat>-datatype = 'CURR'.
<fs_fcat>-ref_fieldname = 'WAERS'.
<fs_fcat>-ref_tabname = 'I_ITEM'.
<fs_fcat>-do_sum = 'X'.
<fs_fcat>-outputlen = 15.
modify lt_fcat from <fs_fcat>.
endcase.
endloop.
p_fcat = lt_fcat.
ENDFORM.
FORM build_fsort changing p_fsort.
data lt_sort type slis_t_sortinfo_alv.
data ls_sort like line of lt_sort.
ls_sort-spos = 1.
ls_sort-fieldname = 'EBELN'.
ls_sort-tabname = 'I_HEADER'.
ls_sort-up = 'X'.
ls_sort-subtot = 'X'.
append ls_sort to lt_sort.
clear ls_sort.
ls_sort-spos = 2.
ls_sort-fieldname = 'LIFNR'.
ls_sort-tabname = 'I_HEADER'.
ls_sort-up = 'X'.
ls_sort-subtot = 'X'.
append ls_sort to lt_sort.
clear ls_sort.
p_fsort = lt_fsort.
ENDFORM.
FORM modify_key changing p_keyinfo type slis_keyinfo_alv.
clear p_keyinfo.
p_keyinfo-header01 = 'LIFNR'.
p_keyinfo-item01 = 'LIFNR'.
p_keyinfo-header02 = 'EBELN'.
p_keyinfo-item02 = 'EBELN'.
ENDFORM.
Is there a way to meet the client's expected output?
Thanks in advance for all the help and advises.
Points will be rewarded.Sorry I didn't include that earlier. I'm using Citrix so copy-paste of codes outside Citrix is not allowed. I'll just type a shorter version of my it here.
data: begin of i_item occurs 0,
lifnr like ekko-lifnr,
name1 like-lfa1-name1,
ebeln like ekpo_ebeln,
po_dat like ekko-bedat,
rlwrt like ekko-rlwrt,
waers like ekko-waers,
dmbtr like ekko-dmbtr,
end of i_item.
data wa_item like line of i_item,
data: begin of i_header occurs 0,
lifnr like lfa1-lifnr,
name1 like lfa1-name1,
ebeln like ekpo-ebeln,
end of i_header.
data wa_header like line of i_header. -
How can I do a Smartform from an ALV hierarchy? Is this possible?
Please give me any help...
Regards.
HugoHi, thank for your reply.
Well... I've a hierarchy alv report with a status bar... It's working properly.
Now, I want to print a smarform from this report...
this show the alv ************
call function 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
exporting
i_callback_program = vl_repid
is_layout = st_layout
it_fieldcat = t_fieldcat[]
i_tabname_header = 'T_AUX'
i_tabname_item = 'T_OUTPUT'
is_keyinfo = st_key
tables
t_outtab_header = t_aux[]
t_outtab_item = t_output[]
exceptions
program_error = 1
others = 2.
My doubt is in the smartform... I can pass 2 tables as parameters???
-->
call function l_fm_name
exporting
p_gjahr = p_gjahr
p_form = p_form
p_date_d = p_date_d
p_date_h = p_date_h
p_nom = p_nom
tables
gt_salida = gt_salida ???? "Table 1
exceptions
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
others = 5.
I'm sorry for my poor english... -
Help needed Displaying ALV Secondary list without using oops concept
Hi Experts
Help needed Displaying ALV Secondary list without using oops concept.
its urgent
regds
rajasekharhi chk this code
******************TABLES DECLARATION*****************
TABLES : VBAP,MARA.
*****************TYPE POOLS**************************
TYPE-POOLS : SLIS.
****************INTERNAL TABLES**********************
DATA : BEGIN OF IT_VBAP OCCURS 0,
VBELN LIKE VBAP-VBELN, "SALES DOCUMENT
POSNR LIKE VBAP-POSNR, "SALES DOCUMENT ITEM
MATNR LIKE VBAP-MATNR, "MATERIAL NUMBER
END OF IT_VBAP.
****************TEMPORARY VARIABLES******************
DATA : V_VBELN LIKE VBAP-VBELN."SALES DOCUMENT
DATA : V_MTART LIKE MARA-MTART. "MATERIAL TYPE
*****************FIELD CATALOG***********************
DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
****************LAYOUT*******************************
DATA : WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
***************VARIANT*******************************
DATA : G_VARIANT LIKE DISVARIANT.
****************SAVE*********************************
DATA : G_SAVE(1) TYPE C.
*****************EVENTS******************************
DATA : XS_EVENTS TYPE SLIS_ALV_EVENT,
G_EVENTS TYPE SLIS_T_EVENT.
******************PF STATUS**************************
DATA : PF_STATUS TYPE SLIS_FORMNAME VALUE 'SET_PF_STATUS'.
******************USER COMMAND************************
DATA : USER_COMMAND TYPE SLIS_FORMNAME VALUE 'SET_USER_COMMAND',
R_UCOMM LIKE SY-UCOMM.
****************SELECTION SCREEN************************
SELECT-OPTIONS : S_VBELN FOR VBAP-VBELN.
***************AT SELECTION SCREEN*********************
AT SELECTION-SCREEN.
PERFORM VALIDATE.
**************START-OF-SELECTION**************************
START-OF-SELECTION.
PERFORM GET_DETAILS.
PERFORM FIELDCAT.
PERFORM LAYOUT.
PERFORM VARIANT.
PERFORM SAVE.
PERFORM EVENTS.
PERFORM ALV_DISPLAY.
*********************FORMS*******************************************
*& Form validate
text
--> p1 text
<-- p2 text
FORM VALIDATE .
SELECT SINGLE VBELN
FROM VBAP
INTO V_VBELN
WHERE VBELN IN S_VBELN.
IF SY-SUBRC <> 0.
MESSAGE E000 WITH 'enter valid vbeln'.
ENDIF.
ENDFORM. " validate
*& Form get_details
text
--> p1 text
<-- p2 text
FORM GET_DETAILS .
SELECT VBELN
POSNR
MATNR
FROM VBAP
INTO TABLE IT_VBAP
WHERE VBELN IN S_VBELN.
IF SY-SUBRC <> 0.
MESSAGE E000 WITH 'no details found'.
ENDIF.
ENDFORM. " get_details
*& Form fieldcat
text
--> p1 text
<-- p2 text
FORM FIELDCAT .
WA_FIELDCAT-TABNAME = 'IT_VBAP'.
WA_FIELDCAT-FIELDNAME = 'VBELN'.
WA_FIELDCAT-OUTPUTLEN = 10.
WA_FIELDCAT-SELTEXT_L = 'SALES DOC'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_VBAP'.
WA_FIELDCAT-FIELDNAME = 'POSNR'.
WA_FIELDCAT-OUTPUTLEN = 6.
WA_FIELDCAT-SELTEXT_L = 'ITEM'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_VBAP'.
WA_FIELDCAT-FIELDNAME = 'MATNR'.
WA_FIELDCAT-OUTPUTLEN = 18.
WA_FIELDCAT-SELTEXT_L = 'MATERIAL NO'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
ENDFORM. " fieldcat
*& Form LAYOUT
text
--> p1 text
<-- p2 text
FORM LAYOUT .
WA_LAYOUT-ZEBRA = 'X'.
ENDFORM. " LAYOUT
*& Form VARIANT
text
--> p1 text
<-- p2 text
FORM VARIANT .
CLEAR G_VARIANT.
G_VARIANT-REPORT = SY-REPID.
ENDFORM. " VARIANT
*& Form SAVE
text
--> p1 text
<-- p2 text
FORM SAVE .
CLEAR G_SAVE.
G_SAVE = 'A'.
ENDFORM. " SAVE
*& Form EVENTS
text
--> p1 text
<-- p2 text
FORM EVENTS .
CLEAR XS_EVENTS.
XS_EVENTS-NAME = SLIS_EV_TOP_OF_PAGE.
XS_EVENTS-FORM = 'TOP_OF_PAGE'.
APPEND XS_EVENTS TO G_EVENTS.
ENDFORM. " EVENTS
*& Form TOP_OF_PAGE
text
FORM TOP_OF_PAGE.
WRITE :/ ' INTELLI GROUP'.
ENDFORM. "TOP_OF_PAGE
*& Form ALV_DISPLAY
text
--> p1 text
<-- p2 text
FORM ALV_DISPLAY .
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = PF_STATUS
I_CALLBACK_USER_COMMAND = USER_COMMAND
I_STRUCTURE_NAME =
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = G_SAVE
IS_VARIANT = G_VARIANT
IT_EVENTS = G_EVENTS
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_VBAP
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " ALV_DISPLAY
*& Form SET_PF_STATUS
text
FORM SET_PF_STATUS USING EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'Z50651_PFSTATUS' EXCLUDING EXTAB.
ENDFORM. "SET_PF_STATUS
*& Form SET_USER_COMMAND
text
FORM SET_USER_COMMAND USING R_UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN 'DC'.
READ TABLE IT_VBAP INDEX RS_SELFIELD-TABINDEX.
IF SY-SUBRC = 0.
SELECT SINGLE MTART
FROM MARA
INTO V_MTART
WHERE MATNR = IT_VBAP-MATNR.
IF SY-SUBRC <> 0.
MESSAGE E000 WITH 'NO MATERIAL DESCRIPTION FOR SELECTED MATERIAL NO'.
ELSE.
WRITE :/ 'MATERIAL NO :',IT_VBAP-MATNR.
WRITE :/ 'MATERIAL TYPE :' , V_MTART.
ENDIF.
ENDIF.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
WHEN 'CLOSE'.
CALL TRANSACTION 'SE38'.
ENDCASE.
REPORT Z_ALV_INTERACTIVE MESSAGE-ID ZMSG_50651
LINE-SIZE 100
LINE-COUNT 60
NO STANDARD PAGE HEADING.
******************TABLES DECLARATION*****************
TABLES : VBAP,MARA.
*****************TYPE POOLS**************************
TYPE-POOLS : SLIS.
****************INTERNAL TABLES**********************
DATA : BEGIN OF IT_VBAP OCCURS 0,
VBELN LIKE VBAP-VBELN, "SALES DOCUMENT
POSNR LIKE VBAP-POSNR, "SALES DOCUMENT ITEM
MATNR LIKE VBAP-MATNR, "MATERIAL NUMBER
END OF IT_VBAP.
****************TEMPORARY VARIABLES******************
DATA : V_VBELN LIKE VBAP-VBELN."SALES DOCUMENT
DATA : V_MTART LIKE MARA-MTART. "MATERIAL TYPE
*****************FIELD CATALOG***********************
DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
****************LAYOUT*******************************
DATA : WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
***************VARIANT*******************************
DATA : G_VARIANT LIKE DISVARIANT.
****************SAVE*********************************
DATA : G_SAVE(1) TYPE C.
*****************EVENTS******************************
DATA : XS_EVENTS TYPE SLIS_ALV_EVENT,
G_EVENTS TYPE SLIS_T_EVENT.
******************PF STATUS**************************
DATA : PF_STATUS TYPE SLIS_FORMNAME VALUE 'SET_PF_STATUS'.
******************USER COMMAND************************
DATA : USER_COMMAND TYPE SLIS_FORMNAME VALUE 'SET_USER_COMMAND',
R_UCOMM LIKE SY-UCOMM.
****************SELECTION SCREEN************************
SELECT-OPTIONS : S_VBELN FOR VBAP-VBELN.
***************AT SELECTION SCREEN*********************
AT SELECTION-SCREEN.
PERFORM VALIDATE.
**************START-OF-SELECTION**************************
START-OF-SELECTION.
PERFORM GET_DETAILS.
PERFORM FIELDCAT.
PERFORM LAYOUT.
PERFORM VARIANT.
PERFORM SAVE.
PERFORM EVENTS.
PERFORM ALV_DISPLAY.
*********************FORMS*******************************************
*& Form validate
text
--> p1 text
<-- p2 text
FORM VALIDATE .
SELECT SINGLE VBELN
FROM VBAP
INTO V_VBELN
WHERE VBELN IN S_VBELN.
IF SY-SUBRC <> 0.
MESSAGE E000 WITH 'enter valid vbeln'.
ENDIF.
ENDFORM. " validate
*& Form get_details
text
--> p1 text
<-- p2 text
FORM GET_DETAILS .
SELECT VBELN
POSNR
MATNR
FROM VBAP
INTO TABLE IT_VBAP
WHERE VBELN IN S_VBELN.
IF SY-SUBRC <> 0.
MESSAGE E000 WITH 'no details found'.
ENDIF.
ENDFORM. " get_details
*& Form fieldcat
text
--> p1 text
<-- p2 text
FORM FIELDCAT .
WA_FIELDCAT-TABNAME = 'IT_VBAP'.
WA_FIELDCAT-FIELDNAME = 'VBELN'.
WA_FIELDCAT-OUTPUTLEN = 10.
WA_FIELDCAT-SELTEXT_L = 'SALES DOC'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_VBAP'.
WA_FIELDCAT-FIELDNAME = 'POSNR'.
WA_FIELDCAT-OUTPUTLEN = 6.
WA_FIELDCAT-SELTEXT_L = 'ITEM'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_VBAP'.
WA_FIELDCAT-FIELDNAME = 'MATNR'.
WA_FIELDCAT-OUTPUTLEN = 18.
WA_FIELDCAT-SELTEXT_L = 'MATERIAL NO'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
ENDFORM. " fieldcat
*& Form LAYOUT
text
--> p1 text
<-- p2 text
FORM LAYOUT .
WA_LAYOUT-ZEBRA = 'X'.
ENDFORM. " LAYOUT
*& Form VARIANT
text
--> p1 text
<-- p2 text
FORM VARIANT .
CLEAR G_VARIANT.
G_VARIANT-REPORT = SY-REPID.
ENDFORM. " VARIANT
*& Form SAVE
text
--> p1 text
<-- p2 text
FORM SAVE .
CLEAR G_SAVE.
G_SAVE = 'A'.
ENDFORM. " SAVE
*& Form EVENTS
text
--> p1 text
<-- p2 text
FORM EVENTS .
CLEAR XS_EVENTS.
XS_EVENTS-NAME = SLIS_EV_TOP_OF_PAGE.
XS_EVENTS-FORM = 'TOP_OF_PAGE'.
APPEND XS_EVENTS TO G_EVENTS.
ENDFORM. " EVENTS
*& Form TOP_OF_PAGE
text
FORM TOP_OF_PAGE.
WRITE :/ ' INTELLI GROUP'.
ENDFORM. "TOP_OF_PAGE
*& Form ALV_DISPLAY
text
--> p1 text
<-- p2 text
FORM ALV_DISPLAY .
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = PF_STATUS
I_CALLBACK_USER_COMMAND = USER_COMMAND
I_STRUCTURE_NAME =
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = G_SAVE
IS_VARIANT = G_VARIANT
IT_EVENTS = G_EVENTS
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_VBAP
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " ALV_DISPLAY
*& Form SET_PF_STATUS
text
FORM SET_PF_STATUS USING EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'STANDARD' EXCLUDING EXTAB.
ENDFORM. "SET_PF_STATUS
*& Form SET_USER_COMMAND
text
FORM SET_USER_COMMAND USING R_UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN 'DC'.
READ TABLE IT_VBAP INDEX RS_SELFIELD-TABINDEX.
IF SY-SUBRC = 0.
SELECT SINGLE MTART
FROM MARA
INTO V_MTART
WHERE MATNR = IT_VBAP-MATNR.
IF SY-SUBRC <> 0.
MESSAGE E000 WITH 'NO MATERIAL DESCRIPTION FOR SELECTED MATERIAL NO'.
ELSE.
WRITE :/ 'MATERIAL NO :',IT_VBAP-MATNR.
WRITE :/ 'MATERIAL TYPE :' , V_MTART.
SUBMIT SLIS_DUMMY WITH P_MATNR EQ IT_VBAP-MATNR
WITH P_MTART EQ V_MTART.
ENDIF.
ENDIF.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
WHEN 'CLOSE'.
CALL TRANSACTION 'SE38'.
ENDCASE.
plz reward if useful -
Top_of_page is not working in ALV hierarchy?
Hi,
I have written following code for top_of_page using event but which is not working...This report is developed for interactive report.
Note: passed the it_events into ALV hierarchy functional module.
FORM build_event_tab .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 1
IMPORTING
et_events = it_events[].
READ TABLE it_events INTO wa_events WITH KEY form = 'TOP_OF_PAGE'.
IF sy-subrc = 0.
wa_events-form = 'TOP_OF_PAGE'.
APPEND wa_events TO it_events.
ENDIF.
ENDFORM. "Get_events
FORM top_of_page USING document TYPE REF TO cl_dd_document.
DATA: dl_text(255) TYPE c,
lv_cutime TYPE sy-uzeit,
lv_cudt(20) TYPE c.
lv_cudt = sy-datum.
*--Passing Date----*
WRITE lv_cudt TO dl_text.
CONCATENATE 'Date : ' lv_cudt+6(2) '-'
lv_cudt+4(2) '-'
lv_cudt+0(4) INTO dl_text.
CALL METHOD document->add_text
EXPORTING
text = dl_text.
CLEAR : dl_text.
CALL METHOD document->add_gap
EXPORTING
width = 50.
WRITE 'Company Name' TO dl_text.
CALL METHOD document->add_text
EXPORTING
text = dl_text
sap_emphasis = cl_dd_area=>heading
sap_style = cl_dd_area=>heading
sap_color = cl_dd_area=>list_total_inv.
CLEAR : dl_text.
CALL METHOD document->add_gap
EXPORTING
width = 150.
lv_cutime = sy-uzeit.
CONCATENATE 'Time : ' lv_cutime+0(2) ':'
lv_cutime+2(2) ':'
lv_cutime+4(2) INTO dl_text.
CALL METHOD document->add_text
EXPORTING
text = dl_text.
CALL METHOD document->add_gap
EXPORTING
width = 60.
WRITE 'Title' TO dl_text.
CALL METHOD document->add_text
EXPORTING
text = dl_text
sap_emphasis = cl_dd_area=>heading
sap_style = cl_dd_area=>heading
sap_color = cl_dd_area=>list_total_inv.
CLEAR : dl_text.
CALL METHOD document->add_gap
EXPORTING
width = 50.
ENDFORM. "html_top_of_page
Thanks
ShreePERFORM build_fieldcat.
PERFORM build_event_tab.
PERFORM alv_display.
*---Build fieldcat
FORM build_fieldcat.
wa_fieldcat-tabname = 'IT_VENDOR'.
wa_fieldcat-fieldname = 'LIFNR'.
wa_fieldcat-col_pos = '2'.
wa_fieldcat-seltext_l = 'SUPPLIER'.
wa_fieldcat-outputlen = 20.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_VENDOR'.
wa_fieldcat-fieldname = 'NAME1'.
wa_fieldcat-col_pos = '2'.
wa_fieldcat-seltext_l = 'VENDOR NAME'.
wa_fieldcat-outputlen = 40.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-fieldname = 'WERKS'.
wa_fieldcat-col_pos = '1'.
wa_fieldcat-seltext_l = 'Plant'.
wa_fieldcat-outputlen = 5.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-fieldname = 'AWKEY'.
wa_fieldcat-col_pos = '2'.
wa_fieldcat-seltext_l = ' Document'.
wa_fieldcat-hotspot = 'X'.
wa_fieldcat-outputlen = 16.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-fieldname = 'BELNR'.
wa_fieldcat-col_pos = '3'.
wa_fieldcat-seltext_l = 'A/c Document'.
wa_fieldcat-hotspot = 'X'.
wa_fieldcat-outputlen = 16.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-fieldname = 'BUDAT'.
wa_fieldcat-col_pos = '4'.
wa_fieldcat-seltext_l = 'PJ Date'.
wa_fieldcat-outputlen = 16.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-fieldname = 'XBLNR'.
wa_fieldcat-col_pos = '5'.
wa_fieldcat-seltext_l = 'Inv'.
wa_fieldcat-outputlen = 16.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-fieldname = 'BLDAT'.
wa_fieldcat-col_pos = '6'.
wa_fieldcat-seltext_l = 'PJ Date'.
wa_fieldcat-outputlen = 16.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-fieldname = 'DMBTR'.
wa_fieldcat-col_pos = '7'.
wa_fieldcat-seltext_l = 'Bill.Amount'.
wa_fieldcat-outputlen = 19.
wa_fieldcat-do_sum = 'X'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-fieldname = 'HKONT'.
wa_fieldcat-col_pos = '8'.
wa_fieldcat-seltext_l = 'Cost Ctr'.
wa_fieldcat-outputlen = 16.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
ENDFORM. "Build_fieldcat
*----ALV Display-----*
FORM alv_display.
key-header01 = 'LIFNR'.
key-item01 = 'LIFNR'.
DELETE ADJACENT DUPLICATES FROM it_vendor.
DELETE ADJACENT DUPLICATES FROM it_final.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_user_command = 'USER_COMMAND'
i_callback_pf_status_set = 'PFSTATUS'
it_fieldcat = it_fieldcat[]
i_tabname_header = 'IT_VENDOR'
i_tabname_item = 'IT_FINAL'
it_events = it_events[]
is_keyinfo = key
TABLES
t_outtab_header = it_vendor[]
t_outtab_item = it_final[].
ENDFORM. "alv_display
*----interactive method--
FORM user_command USING r_ucomm TYPE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '&IC1'.
READ TABLE it_final INTO wa_final INDEX rs_selfield-tabindex.
IF sy-subrc = 0.
IF rs_selfield-fieldname = 'BELNR'.
SET PARAMETER ID 'BLN' FIELD wa_final-belnr.
SET PARAMETER ID 'BUK' FIELD pa_bukrs.
SET PARAMETER ID 'GJA' FIELD pa_gjahr.
CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
ELSEIF rs_selfield-fieldname = 'AWKEY'.
SET PARAMETER ID 'RBN' FIELD wa_final-awkey.
SET PARAMETER ID 'GJR' FIELD pa_gjahr.
CALL TRANSACTION 'MIR4' AND SKIP FIRST SCREEN.
ELSEIF rs_selfield-fieldname = 'LFBNR'.
SET PARAMETER ID 'BLN' FIELD it_bsak-lfbnr.
SET PARAMETER ID 'BUK' FIELD pa_bukrs.
SET PARAMETER ID 'GJA' FIELD pa_gjahr.
CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
ELSEIF rs_selfield-fieldname = 'EBELN'.
SELECT SINGLE
ebeln
INTO wk_ebeln
FROM ekko
WHERE ebeln = it_bsak-ebeln
AND bstyp = 'F'.
IF sy-subrc EQ 0.
SET PARAMETER ID 'BES' FIELD it_bsak-ebeln.
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ELSE.
SET PARAMETER ID 'VRT' FIELD it_bsak-ebeln.
CALL TRANSACTION 'ME33' AND SKIP FIRST SCREEN.
ENDIF.
ENDIF.
ENDIF.
ENDCASE.
ENDFORM. "user_command
FORM pfstatus USING ut_extab TYPE slis_t_extab.
SET PF-STATUS 'STANDARD_FULLSCREEN' OF PROGRAM 'SAPLKKBL'.
ENDFORM. "pfstatus
*---Authorization check---
FORM bukrs_check.
SELECT SINGLE
butxt "Name of the Company Code / Company
ort01 "City
INTO (wk_company, wk_city) FROM t001
WHERE bukrs = pa_bukrs.
IF sy-subrc <> 0.
MESSAGE 'create your own message' TYPE 'I'.
ENDIF.
ENDFORM. " BUKRS_CHECK
FORM build_event_tab.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = it_events[].
READ TABLE it_events INTO wa_events
WITH KEY name = 'SLIS_EV_TOP_OF_PAGE'.
IF sy-subrc = 0.
wa_events-form = 'TOP_OF_PAGE'.
MODIFY it_events FROM wa_events INDEX sy-tabix.
ENDIF.
READ TABLE it_events INTO wa_events WITH KEY name =
'SLIS_EV_END_OF_PAGE'.
IF sy-subrc = 0.
wa_events-form = 'END_OF_PAGE'.
MODIFY it_events FROM wa_events INDEX sy-tabix.
ENDIF.
ENDFORM. "Get_events
FORM end_of_page.
DATA: it_header TYPE slis_t_listheader,
wa_header TYPE slis_listheader.
wa_header-typ = 'S'.
wa_header-key = 'MATERIAL'.
* wa_line-info = p1.
APPEND wa_header TO it_header.
CLEAR wa_header.
* READ TABLE it_maktx WITH KEY matnr = p1.
wa_header-typ = 'S'.
wa_header-key = 'DESCRIPTION'.
* wa_line-info = it_maktx-maktx.
APPEND wa_header TO it_header.
CLEAR wa_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
* i_logo = 'ENJOYSAP_LOGO'
it_list_commentary = it_header.
ENDFORM. "END_OF_PAGE
FORM top_of_page USING document TYPE REF TO cl_dd_document.
DATA: dl_text(255) TYPE c,
lv_cutime TYPE sy-uzeit,
lv_cudt(20) TYPE c.
lv_cudt = sy-datum.
*--Passing Date----*
WRITE lv_cudt TO dl_text.
CONCATENATE 'Date : ' lv_cudt+6(2) '-'
lv_cudt+4(2) '-'
lv_cudt+0(4) INTO dl_text.
CALL METHOD document->add_text
EXPORTING
text = dl_text.
CLEAR : dl_text.
CALL METHOD document->add_gap
EXPORTING
width = 50.
WRITE 'INCAP CON MFG SER (P) LTD' TO dl_text.
CALL METHOD document->add_text
EXPORTING
text = dl_text
sap_emphasis = cl_dd_area=>heading
sap_style = cl_dd_area=>heading
sap_color = cl_dd_area=>list_total_inv.
CLEAR : dl_text.
CALL METHOD document->add_gap
EXPORTING
width = 150.
lv_cutime = sy-uzeit.
CONCATENATE 'Time : ' lv_cutime+0(2) ':'
lv_cutime+2(2) ':'
lv_cutime+4(2) INTO dl_text.
CALL METHOD document->add_text
EXPORTING
text = dl_text.
CALL METHOD document->add_gap
EXPORTING
width = 60.
WRITE 'Purchase Journal' TO dl_text.
CALL METHOD document->add_text
EXPORTING
text = dl_text
sap_emphasis = cl_dd_area=>heading
sap_style = cl_dd_area=>heading
sap_color = cl_dd_area=>list_total_inv.
CLEAR : dl_text.
CALL METHOD document->add_gap
EXPORTING
width = 50.
ENDFORM. "html_top_of_page -
Setting the ALV Hierarchy tree with grid line between the columns and rows
Hi Experts,
I would like to ask if there is any suggestion on setting the ALV hierarchy tree to be separated by grid line between the columns and rows just like how it is display the same way in normal ALV grid.
Thanks in advance.Hi Lin,
The requirement which you have stated is not possible.
Lin,
Also i have a query regarding BADI ZME_PROCESS_REQ_CUST, which you had raised on SDN. You have marked the question as solved/answered.
Changing the data of a customize field in purchase requisition
Could you please let me know, the steps you did to update the screen fields through the BADI.
I would really appreciate your reply, because i am facing exactly the same problem which you have mentioned.
Thanks,
Best regards,
Prashant -
Multiple levels in ALV Hierarchy
Hi All
How to display Multiple levels in ALV Hierarchy.
I have header and Item Tables but Under Header Expansions I have to display one more Expansion.
Means Multiple levels.Hi,
I think you can check standard program BCALV_TEST_HIERSEQ_LIST
Regards,
Himanshu -
Search help problem in ALV output for field TD24A-DISMM
Hi Abap-Experts,
I have one issue regarding simple ALV report.
I need to display search-help for field DISMM. I have used below code in ALV fieldcatalog.
ts_fieldcat - tabname = 'TD24A'.
ts_fieldcat - tabname = 'DISMM'.
I have attached search-help for fields such as MATNR and WERKS too.
The search-helps are getting displayed for MATNR as well as WERKS.
But, the search-help is not gettting displayed for field DISMM(RP-TYPE) .
The output displayed is done using Simple ALV.
Could anyone please help me and correct my code or logic i have used.Hi,
I have changed code a bit...and used T438A table.
CLEAR ts_fieldcat.
ts_fieldcat-col_pos = '5'.
ts_fieldcat-fieldname = 'DISMM'.
ts_fieldcat-seltext_l = text-014.
ts_fieldcat-outputlen = 2.
ts_fieldcat-reptext_ddic = ''.
ts_fieldcat-ref_tabname = 'T438A'.
ts_fieldcat-ref_fieldname = 'DISMM'.
ts_fieldcat-ddic_outputlen = '2'.
ts_fieldcat-input = 'X'.
APPEND ts_fieldcat TO gt_fieldcat.
still it is not showing me the F4 help in simplae ALV output..
kindly help me -
Hi all,
is it possible to print a different title for each page when you use ALV hierarchy?
For example I need to print the PO number for each page as thet title.
Thanks,
MelTry this..
ip_confing type ref to CL_SALV_WD_CONFIG_TABLE.
"set alv table header
ip_config->if_salv_wd_table_settings~r_header->set_text( 'Test ALV Header functionality' ).
or
data: lr_table_settings type ref to if_salv_wd_table_settings.
data: lr_header type ref to CL_SALV_WD_HEADER.
lr_table_settings ?= l_value.
lr_header = lr_table_settings->get_header( ).
lr_header->set_text( 'FLIGHT LIST SEARCH' ).
Cheers,
Kris. -
Input help of the org. hierarchy
Hello all,
I have two similar enviroments, one with ish version 4.6 and another with version 6.00
The input help of the organizational hierarchy when it is called from nv2000 or report RNLORG01
in 6.00 is very slower than 4.6. (Both enviroments have the same parameters OE_LEVEL and OE_LOAD) There is something I can do to optimize this input help? Thanks in advance.
Regards.There are two more recent notes related to this input help:
Note 1272171 - IS-H: OrgUnit input help does not display all OrgUnits
The input help for organizational units does not display all inter-departmental organizational units
Note 1292719 - IS-H: Input help for nursing OU displays incorrect info
If you call the input help in NV2000 in the field "Nursing OU", the system may not display the name of the nursing OU correctly in some cases. The system displays the name of higher-level departmental OU instead. -
Exception while creating f4 help for editable alv field
hi experts
i have created search help for editable alv field by following link
http://scn.sap.com/docs/DOC-39832
But i m getting an exception : Field symbol has not yet been assigned.
exception area code
read table <tab1> into <ls_wa> index i_row_id.
assign component m_cl_variant->ms_layout-stylefname
of structure <ls_wa> to <l_field>.
read table <l_field> into ls_style
with table key fieldname = is_col_id-fieldname.
if sy-subrc eq 0.
if ls_style-style o mc_style_enabled.
ready_for_input = 1.
exit.
elseif ls_style-style o mc_style_disabled.
ready_for_input = 0.
exit.
endif.
first read statement is giving sy-subrc =4.
PS: exception from method..:IS_READY_FOR_INPUT
kindly helpHello Ankush,
read table <tab1> ASSIGNING <ls_wa> index i_row_id.
IF <ls_wa> IS ASSIGNED.
assign component m_cl_variant->ms_layout-stylefname
of structure <ls_wa> to <l_field>.
read table <l_field> into ls_style
with table key fieldname = is_col_id-fieldname.
if sy-subrc eq 0.
if ls_style-style o mc_style_enabled.
ready_for_input = 1.
exit.
elseif ls_style-style o mc_style_disabled.
ready_for_input = 0.
exit.
endif.
ENDIF.
Regards,
TP -
Hi,
I am doing an ALV report using REUSE_ALV_GRID_DISPLAY . This is my requirement
If user press F4 in field in WERKS then i need to get values from table T001W and also from my custom table YT001W and display, so user can select from the f4 list.
How to do this.
Your help is appreciated
Sa_RDATA : alvgrid TYPE REF TO cl_gui_alv_grid,
custom_container TYPE REF TO cl_gui_custom_container,
fieldcatalog TYPE lvc_t_fcat.
table to contain fields that require f4...............................
DATA : lt_f4 TYPE lvc_t_f4 WITH HEADER LINE.
ok_code declaration...................................................
DATA : ok_code TYPE sy-ucomm.
Tables declaration....................................................
TABLES : zaemp.
Types declaration.....................................................
TYPES : BEGIN OF ty_emp,
code LIKE zaemp-code,
designation LIKE zaemp-designation,
END OF ty_emp.
Internal table declaration............................................
DATA : i_emp TYPE TABLE OF ty_emp.
Workarea declaration..................................................
DATA : wa_emp TYPE ty_emp.
Selection screen parameters...........................................
SELECT-OPTIONS : s_code FOR zaemp-code.
CLASS lcl_event_handler DEFINITION
CLASS lcl_event_handler DEFINITION.
PUBLIC SECTION.
METHODS :
handle_on_f1 FOR EVENT onf1 OF cl_gui_alv_grid
IMPORTING e_fieldname es_row_no er_event_data,
handle_on_f4 for event onf4 of cl_gui_alv_grid
importing e_fieldname es_row_no er_event_data
ENDCLASS.
CLASS lcl_event_handler IMPLEMENTATION
CLASS lcl_event_handler IMPLEMENTATION.
METHOD handle_on_f1.
custom f1 help for code field.......................................
IF e_fieldname = 'code'.
CALL SCREEN 3001.
ENDIF.
to prevent processing of standard f1 help............................
er_event_data->m_event_handled = 'X'.
ENDMETHOD.
Method handle_on_f4.
standard f4 help will be invoked......................................
endmethod.
ENDCLASS.
start of selection....................................................
START-OF-SELECTION.
SELECT code designation FROM zaemp
INTO CORRESPONDING FIELDS OF TABLE i_emp
WHERE code IN s_code.
CALL SCREEN 3000.
*& Module STATUS_3000 OUTPUT
text
MODULE status_3000 OUTPUT.
SET PF-STATUS 'ZTOOL'.
SET TITLEBAR 'ZTITLE'.
IF alvgrid IS INITIAL.
CREATE OBJECT custom_container
EXPORTING
container_name = 'ZCONTAINER'.
CREATE OBJECT alvgrid
EXPORTING
i_parent = custom_container.
PERFORM prepare_f4.
CALL METHOD alvgrid->register_f4_for_fields
EXPORTING
it_f4 = lt_f4[]
creating instance for event handler..................................
DATA : event_handler TYPE REF TO lcl_event_handler.
CREATE OBJECT event_handler.
SET HANDLER event_handler->handle_on_f1 FOR alvgrid.
SET HANDLER event_handler->handle_on_f4 FOR alvgrid.
preparing field catalog..............................................
PERFORM prepare_fieldcatalog CHANGING fieldcatalog.
CALL METHOD alvgrid->set_table_for_first_display
EXPORTING
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME =
IS_VARIANT =
I_SAVE =
I_DEFAULT = 'X'
IS_LAYOUT =
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
CHANGING
it_outtab = i_emp
it_fieldcatalog = fieldcatalog
IT_SORT =
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDMODULE. " STATUS_3000 OUTPUT
preparing field catalog...............................................
FORM prepare_fieldcatalog CHANGING i_fieldcatalog TYPE lvc_t_fcat.
DATA : ls_fcat TYPE lvc_s_fcat.
ls_fcat-fieldname = 'code'.
ls_fcat-ref_table = 'zaemp'.
ls_fcat-coltext = 'EMPLOYEE ID'.
APPEND ls_fcat TO i_fieldcatalog.
CLEAR ls_fcat.
ls_fcat-fieldname = 'designation'.
ls_fcat-ref_table = 'zaemp'.
ls_fcat-coltext = 'EMPLOYEE NAME'.
APPEND ls_fcat TO i_fieldcatalog.
ENDFORM.
*& Module USER_COMMAND_3000 INPUT
text
MODULE user_command_3000 INPUT.
CASE ok_code.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_3000 INPUT
*& Module USER_COMMAND_3001 INPUT
text
MODULE user_command_3001 INPUT.
CASE ok_code.
WHEN 'SAVE'.
LEAVE TO SCREEN 0.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_3001 INPUT
*& Module STATUS_3001 OUTPUT
text
MODULE status_3001 OUTPUT.
SET PF-STATUS 'GUI'.
SET TITLEBAR 'TITLE'.
ENDMODULE. " STATUS_3001 OUTPUT
preparing fields to be registered for f4 help.........................
FORM prepare_f4.
lt_f4-fieldname = 'designation'.
lt_f4-register = 'X'.
lt_f4-getbefore = 'X'.
lt_f4-chngeafter = 'X'.
APPEND lt_f4.
ENDFORM.
Hi
For creating the F4 Help see the sample code and do accordingly
See the following ex:
TYPES: BEGIN OF TY_MBLNR,
MBLNR LIKE MKPF-MBLNR,
END OF TY_MBLNR.
DATA: IT_MBLNR TYPE STANDARD TABLE OF TY_MBLNR WITH HEADER LINE.
data: it_ret like ddshretval occurs 0 with header line.
At selection-screen on value-request for s_mat-low.
Select MBLNR from mkpf into table it_mblnr.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'MBLNR'
PVALKEY = ' '
DYNPPROG = ' '
DYNPNR = ' '
DYNPROFIELD = ' '
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
VALUE_TAB = IT_MBLNR
FIELD_TAB =
RETURN_TAB = IT_RET
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF SY-SUBRC = 0.
read table it_ret index 1.
move it_ret-fieldval to S_mat-low.
ENDIF.
Go through the test program.
REPORT Ztest_HELP .
TABLES : MARA.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS : P_MATNR(10) TYPE C.
SELECTION-SCREEN END OF BLOCK B1.
DATA : BEGIN OF ITAB OCCURS 0,
MATNR TYPE MATNR,
END OF ITAB.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MATNR.
SELECT MATNR
FROM MARA
INTO TABLE ITAB
UP TO 10 ROWS.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'MATERIAL NUMBER'
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'P_MATNR'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = ITAB
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
F4 help -- on editable alv field.
The specified item was not found.
Message was edited by:
Karthikeyan Pandurangan -
How to include F4 help to a alv output field?
Hi All,
I have a sel screen with 2 inputs say x1 and x2. Based on my inputs we have a alv(using OOPS) output where a field say tabname is editable and the values in it are hardcoded.
I have to get a F4 help in this editable field tabname with those hardcoded values from the program say T1 and T2.
If we pres F4 of tabname value, we must get only T1 and T2 from the program.
Please let me know how to do this.
Thanks in advance.Hi Aiswary,
Check the Following program
BCALV_EDIT_08 -
> Integrate Non-Standard F4 Help
BCALV_F4 -
> Possible entries
BCALV_GRID_EDIT_DELTA -
> Example Report for F4 Help of the ALV Grid
BCALV_GRID_F4_HELP_APPLICATION
BCALV_GRID_F4_HELPM01
BCALV_TEST_GRID_EDIT -
> F4 Help
BCALV_TEST_GRID_F4_HELP -
> Example Report for F4 Help of the ALV Grid
Cheers
Ram
Edited by: Ramchander Krishnamraju on Oct 23, 2009 2:20 PM
Maybe you are looking for
-
Converting word 2003 document to pdf
I need to convert a word document to pdf to load to the lulu web site which is a book publishing site. They have specific settings like embedd fonts but no subset embedding. For images use zip compression and 300 dpi. I have set all of these in the d
-
Custom Filter for Date on UWL iview
Hello Experts- I want to display previously approved tasks and current tasks in a UWL iview. As of now in the iview the taks which are displayed are the one which are pending. For this I am planning to add a custom filter to my UWL iview. Can anyone
-
Best external drive and format?
What's the best external drive for backing up imovie files and disc images? What format should the drive be set up in for Mac usage and to accept the imovie projects?
-
Is Using Static functions advisable from performance(speed) point of view
I was wondering if using a static function would be slower than using a normal function, especially when the function is to be accessed by multiple threads since the same memory area is used each time the static function is accessed from any of the t
-
Hi, is it possible to directly show an image that is retrieved physically like the below? out.println("</body><img src='http://192.168.125.125:8988/Application1-Project1-context-root/showworkloadimgservlet'></html>");