F4, Program Varyant, ALV Varyant
Özel Arama yardımı örnekleri :
- Program varyantları için F4,
- Alv grid varyantları için F4,
- Uygulama sunucusunda kullanıcı klasörleri için F4
process after input.
module user_command_0100.
process on value-request.
field gs_obslave-slave-variant_report module m_f4_var_rep.
field gs_obslave-slave-variant_alv module m_f4_variant_alv.
field gs_obslave-slave-email_prog module m_f4_prog_email.
field gs_obslave-slave-trg_dir module m_f4_user_dir.
module user_command_0100.
process on value-request.
field gs_obslave-slave-variant_report module m_f4_var_rep.
field gs_obslave-slave-variant_alv module m_f4_variant_alv.
field gs_obslave-slave-email_prog module m_f4_prog_email.
field gs_obslave-slave-trg_dir module m_f4_user_dir.
module m_f4_var_rep INPUT.
perform f4_variant_report using gs_obslave-slave-report
gs_obslave-editmode
changing gs_obslave-slave-variant_report.
endmodule.
module m_f4_user_dir INPUT.
perform f4_app_server_dir using gs_obslave-editmode
changing gs_obslave-slave-trg_dir.
endmodule.
module m_f4_PROG_EMAIL INPUT.
perform f4_Emailprog using gs_obslave-editmode
changing gs_obslave-slave-email_prog.
endmodule.
module m_f4_variant_alv INPUT.
perform f4_variant_alv using gs_obslave-slave-report
gs_obslave-editmode
changing gs_obslave-slave-variant_alv.
endmodule.
form f4_variant_report using prm_report type raldb_repo
prm_editmode type char1
changing chn_variant type raldb_vari.
data: lv_variant like rsvar-variant .
call function `RS_VARIANT_CATALOG`
exporting
report = prm_report
pop_up = `X`
importing
sel_variant = lv_variant
exceptions
no_report = 1
report_not_existent = 2
report_not_supplied = 3
no_variants = 4
no_variant_selected = 5
variant_not_existent = 6
others = 7
.
if sy-subrc eq 0.
case prm_editmode .
when gc_mode_read.
when others. chn_variant = lv_variant.
endcase.
endif.
endform.
form f4_variant_alv using prm_report type raldb_repo
prm_editmode type char1
changing chn_variant type slis_vari.
data: ls_variant type disvariant .
data: it_default_fieldcat type lvc_t_fcat .
ls_variant-report = prm_report.
call function `LVC_VARIANT_SELECT`
exporting
i_default = space
it_default_fieldcat = it_default_fieldcat
changing
cs_variant = ls_variant
exceptions
wrong_input = 1
fc_not_complete = 2
not_found = 3
program_error = 4
data_missing = 5
others = 6
.
if sy-subrc eq 0.
case prm_editmode .
when gc_mode_read.
when others. chn_variant = ls_variant-variant.
endcase.
endif.
endform.
form f4_emailprog using prm_editmode type char1
changing chn_emailprogname type zsd_e_prog_name.
data: lt_programlar type standard table of ty_program .
data : return_tab like table of ddshretval with header line,
lv_fieldname(50).
select progname
into table lt_programlar
from ztr_prog_email
group by progname .
call function `F4IF_INT_TABLE_VALUE_REQUEST`
exporting
retfield = `PROGNAME`
value_org = `S`
tables
value_tab = lt_programlar
return_tab = return_tab
exceptions
parameter_error = 1
no_values_found = 2
others = 3.
if sy-subrc = 0 .
read table return_tab index 1.
if return_tab-fieldval <> ``.
case prm_editmode .
when gc_mode_read.
when others. move return_tab-fieldval to chn_emailprogname.
endcase.
endif.
endif.
endform. "f4_Emailprog
form f4_app_server_dir using prm_editmode type char1
changing chn_trg_dir type string.
constants: fname_dirname type fieldname value `DIRNAME`.
data: begin of f4_dirname_tab occurs 0,
aliass type dirprofilenames,
dirname type dirname,
svrname type msname2,
end of f4_dirname_tab.
data: dirname_wa like line of f4_dirname_tab,
f4_return_tab type table of ddshretval initial size 0,
f4_return_wa like line of f4_return_tab.
select * from user_dir
into corresponding fields of table f4_dirname_tab.
sort f4_dirname_tab by dirname ascending.
call function `F4IF_INT_TABLE_VALUE_REQUEST`
exporting
retfield = fname_dirname
value_org = `S`
tables
value_tab = f4_dirname_tab
return_tab = f4_return_tab
exceptions
others = 99.
if sy-subrc eq 0.
read table f4_return_tab into f4_return_wa index 1.
if f4_return_wa-FIELDNAME ne ``.
case prm_editmode .
when gc_mode_read.
when others. chn_trg_dir = f4_return_wa-fieldval .
endcase.
endif.
endif.
endform.
prm_editmode type char1
changing chn_variant type raldb_vari.
data: lv_variant like rsvar-variant .
call function `RS_VARIANT_CATALOG`
exporting
report = prm_report
pop_up = `X`
importing
sel_variant = lv_variant
exceptions
no_report = 1
report_not_existent = 2
report_not_supplied = 3
no_variants = 4
no_variant_selected = 5
variant_not_existent = 6
others = 7
.
if sy-subrc eq 0.
case prm_editmode .
when gc_mode_read.
when others. chn_variant = lv_variant.
endcase.
endif.
endform.
form f4_variant_alv using prm_report type raldb_repo
prm_editmode type char1
changing chn_variant type slis_vari.
data: ls_variant type disvariant .
data: it_default_fieldcat type lvc_t_fcat .
ls_variant-report = prm_report.
call function `LVC_VARIANT_SELECT`
exporting
i_default = space
it_default_fieldcat = it_default_fieldcat
changing
cs_variant = ls_variant
exceptions
wrong_input = 1
fc_not_complete = 2
not_found = 3
program_error = 4
data_missing = 5
others = 6
.
if sy-subrc eq 0.
case prm_editmode .
when gc_mode_read.
when others. chn_variant = ls_variant-variant.
endcase.
endif.
endform.
form f4_emailprog using prm_editmode type char1
changing chn_emailprogname type zsd_e_prog_name.
data: lt_programlar type standard table of ty_program .
data : return_tab like table of ddshretval with header line,
lv_fieldname(50).
select progname
into table lt_programlar
from ztr_prog_email
group by progname .
call function `F4IF_INT_TABLE_VALUE_REQUEST`
exporting
retfield = `PROGNAME`
value_org = `S`
tables
value_tab = lt_programlar
return_tab = return_tab
exceptions
parameter_error = 1
no_values_found = 2
others = 3.
if sy-subrc = 0 .
read table return_tab index 1.
if return_tab-fieldval <> ``.
case prm_editmode .
when gc_mode_read.
when others. move return_tab-fieldval to chn_emailprogname.
endcase.
endif.
endif.
endform. "f4_Emailprog
form f4_app_server_dir using prm_editmode type char1
changing chn_trg_dir type string.
constants: fname_dirname type fieldname value `DIRNAME`.
data: begin of f4_dirname_tab occurs 0,
aliass type dirprofilenames,
dirname type dirname,
svrname type msname2,
end of f4_dirname_tab.
data: dirname_wa like line of f4_dirname_tab,
f4_return_tab type table of ddshretval initial size 0,
f4_return_wa like line of f4_return_tab.
select * from user_dir
into corresponding fields of table f4_dirname_tab.
sort f4_dirname_tab by dirname ascending.
call function `F4IF_INT_TABLE_VALUE_REQUEST`
exporting
retfield = fname_dirname
value_org = `S`
tables
value_tab = f4_dirname_tab
return_tab = f4_return_tab
exceptions
others = 99.
if sy-subrc eq 0.
read table f4_return_tab into f4_return_wa index 1.
if f4_return_wa-FIELDNAME ne ``.
case prm_editmode .
when gc_mode_read.
when others. chn_trg_dir = f4_return_wa-fieldval .
endcase.
endif.
endif.
endform.