*---------------------------------------------------------------------*
*    generated viewmaintenance function pool
*   generation date: 30.12.2012 at 22:57:55 by user CREYTZ
*   view maintenance generator version: #001407#
*---------------------------------------------------------------------*
*******************************************************************
*   System-defined Include-files.                                 *
*******************************************************************
*---------------------------------------------------------------------*
*    generated viewmaintenance function pool top
*   generation date: 30.12.2012 at 22:57:55 by user CREYTZ
*   view maintenance generator version: #001407#
*---------------------------------------------------------------------*
FUNCTION-POOL ZSOFTCOPY_DBM MESSAGE-ID SV. TABLES: e070, e071k, e071,
tadir, dderr, tddat, objh. TYPE-POOLS: cxtab, cmpwl, vimty, slctr,
trwbo, scpr, slis, szadr. CLASS: cl_abap_char_utilities DEFINITION
LOAD. TABLES: sadr, sadr2, sadr3, sadr4, sadr5. DATA: sadr_keylen TYPE
i, sadr_namtab_read TYPE c. DATA: maint_stat LIKE vimstatus.
FIELD-SYMBOLS: <vim_ctotal> TYPE ANY, <vim_cextract> TYPE ANY,
<vim_xtotal> TYPE x, <vim_xextract> TYPE x, <vim_total_struc> TYPE ANY,
<vim_extract_struc> TYPE ANY, <vim_tot_txt_struc> TYPE ANY,
<vim_ext_txt_struc> TYPE ANY, <f1> TYPE ANY, <name> TYPE ANY, <table1>
TYPE ANY, <table2> TYPE ANY, <orig_key> TYPE x, <client> TYPE ANY,
<vim_total_key> TYPE ANY, <vim_extract_key> TYPE ANY, <vim_xtotal_key>
TYPE x, <vim_xextract_key> TYPE x, <vim_client_initial> TYPE ANY.
FIELD-SYMBOLS: <table1_x> TYPE x, <table2_x> TYPE x, <f1_x> TYPE x,
<table1_wa> TYPE ANY, <table1_wax> TYPE x, <f1_wax> TYPE x,
<vim_corr_keyx> TYPE x, <initial_x> TYPE x. FIELD-SYMBOLS: <mark> TYPE
ANY, <action> TYPE ANY, <xmark> TYPE ANY, <xact> TYPE ANY, <initial>
TYPE ANY, <status> STRUCTURE vimstatus DEFAULT maint_stat,
<address_number> TYPE ANY, <user_exit_field> TYPE ANY, <replace_field>
TYPE ANY, <vim_begdate> LIKE sy-datum, <vim_new_begdate> LIKE sy-datum,
<vim_enddate> LIKE sy-datum, <vim_enddate_mask> TYPE ANY,
<vim_mainkey_mask> TYPE ANY, <vim_prtfky_wa> TYPE ANY,
<vim_prtfky_extract> TYPE ANY, <vim_prtfky_total> TYPE ANY,
<vim_begdate_mask> TYPE ANY, <vim_collapsed_keyx> TYPE x,
<vim_collapsed_logkeyx> TYPE x, <vim_collapsed_key_afx> TYPE x,
<vim_merged_keyx> TYPE x, <vim_total_address_number> TYPE ANY,
<vim_addr_handle_x> TYPE x, <vim_h_mkey> TYPE x, <vim_h_old_mkey> TYPE
x, <vim_h_coll_mkey> TYPE x, <vim_h_merged_key> TYPE x,
<vim_h_coll_bfkey> TYPE x, <vim_h_coll_logkey> TYPE x, <vim_f1_beforex>
TYPE x, <vim_f1_afterx> TYPE x, <vim_mkey_beforex> TYPE x,
<vim_mkey_afterx> TYPE x, <vim_tot_mkey_beforex> TYPE x,
<vim_tot_mkey_afterx> TYPE x, <vim_ext_mkey_beforex> TYPE x,
<vim_ext_mkey_afterx> TYPE x, <vim_old_mkey_beforex> TYPE x,
<vim_old_mkey_afterx> TYPE x, <vim_collapsed_mkey_bfx> TYPE x,
<vim_f1_before>, <vim_f1_after>, <vim_mkey_before>, <vim_mkey_after>,
<vim_tot_mkey_before>, <vim_tot_mkey_after>, <vim_ext_mkey_before>,
<vim_ext_mkey_after>, <vim_old_mkey_before>, <vim_old_mkey_after>,
<vim_collapsed_key_af>, <vim_collapsed_logkey>, <vim_merged_key>,
<vim_collapsed_key>. FIELD-SYMBOLS: <subsetfield> TYPE ANY,
<rdonlyfield> TYPE ANY, <value> TYPE ANY, <state> STRUCTURE vimstatus
DEFAULT maint_stat, <vim_tctrl> TYPE cxtab_control, <vim_sellist> TYPE
table, <vim_ck_sellist> TYPE table, <vim_field_value> TYPE ANY,
<vim_scrform_name> TYPE ANY, <vim_auth_sellist> TYPE table.
FIELD-SYMBOLS: <table1_text> TYPE ANY, <table1_xtext> TYPE x,
<total_text> TYPE ANY, <extract_text> TYPE ANY, <vim_xtotal_text> TYPE
x, <vim_xextract_text> TYPE x, <action_text> TYPE ANY, <xact_text> TYPE
ANY, <extract_enti> TYPE ANY, <vim_xextract_enti> TYPE x, <textkey>
TYPE ANY, <initial_textkey> TYPE ANY, <textkey_x> TYPE x,
<initial_textkey_x> TYPE x, <text_initial> TYPE ANY, <text_initial_x>
TYPE x, <vim_text_enddate> TYPE ANY. FIELD-SYMBOLS: <vim_texttab> TYPE
table, <vim_read_langus> TYPE table. types: vim_ko200_tab_type type
table of ko200. TYPES: BEGIN OF state_vector, type(1) TYPE c, action(1)
TYPE c, mode(1) TYPE c, data(1) TYPE c, mark(1) TYPE c, delete(1) TYPE
c, fill1(1) TYPE c, fill2(1) TYPE c, END OF state_vector, vim_tabkey
TYPE tabl4096, BEGIN OF vim_tabkey_c, line(255) TYPE c, END OF
vim_tabkey_c, BEGIN OF vim_ck_selcond, field LIKE vimnamtab-bastabfld,
operator(2) TYPE c, hk1(1) TYPE c, value LIKE vimsellist-value, hk2(1)
TYPE c, and LIKE vimsellist-and_or, END OF vim_ck_selcond,
vimexclfldtab TYPE STANDARD TABLE OF vimexclfld WITH DEFAULT KEY
INITIAL SIZE 10, BEGIN OF vimexclfldtabsline, viewname LIKE
tvdir-tabname, excl_pos_tab TYPE vimexclfldtab, excl_rpl_tab TYPE
vimexclfldtab, excl_que_tab TYPE vimexclfldtab, END OF
vimexclfldtabsline, vimexclfldtabs TYPE SORTED TABLE OF
vimexclfldtabsline WITH UNIQUE KEY viewname, BEGIN OF
vim_delim_entr_tl, index1 TYPE i, index2 TYPE i, index3 TYPE i,
index_corr(1) TYPE c, END OF vim_delim_entr_tl, BEGIN OF
vim_collapsed_mkeys_tl, mkey_bf TYPE vim_tabkey_c, mainkey TYPE
vim_tabkey_c, log_key TYPE vim_tabkey_c, END OF vim_collapsed_mkeys_tl,
BEGIN OF vim_merged_entr_tl, new_key TYPE vim_tabkey, merged_key TYPE
vim_tabkey, new_begdate TYPE d, new_enddate TYPE d, merged_begdate TYPE
d, merged_enddate TYPE d, END OF vim_merged_entr_tl, BEGIN OF
vim_ale_keyspec_objs, oname LIKE objh-objectname, otype LIKE
objh-objecttype, END OF vim_ale_keyspec_objs, vim_flds_tab_type TYPE
TABLE OF fieldname, vimnamtab_type type table of vimnamtab. CONSTANTS:
ultra_short_tab TYPE i VALUE 32, very_short_tab TYPE i VALUE 48,
short_tab TYPE i VALUE 64, middle_tab TYPE i VALUE 128, long_tab TYPE i
VALUE 256, very_long_tab TYPE i VALUE 512, ultra_long_tab TYPE i VALUE
4096, vim_max_keylen_show TYPE i VALUE 120, vim_max_textfields TYPE i
VALUE 8, vim_max_keyfields TYPE i VALUE 10. TYPES:
vim_line_ul(ultra_long_tab) TYPE c, vim_line_vl(very_long_tab) TYPE c,
vim_line_l(long_tab) TYPE c, vim_line_m(middle_tab) TYPE c,
vim_line_s(short_tab) TYPE c, vim_line_vs(very_short_tab) TYPE c,
vim_line_us(ultra_short_tab) TYPE c, vim_tab_ul TYPE vim_line_ul OCCURS
0, vim_tab_vl TYPE vim_line_vl OCCURS 0, vim_tab_l TYPE vim_line_l
OCCURS 0, vim_tab_m TYPE vim_line_m OCCURS 0, vim_tab_s TYPE vim_line_s
OCCURS 0, vim_tab_vs TYPE vim_line_vs OCCURS 0, vim_tab_us TYPE
vim_line_us OCCURS 0. TYPES: BEGIN OF vim_variable_tab, valid_idx LIKE
sy-index, tab_us TYPE vim_tab_us, tab_vs TYPE vim_tab_vs, tab_s TYPE
vim_tab_s, tab_m TYPE vim_tab_m, tab_l TYPE vim_tab_l, tab_vl TYPE
vim_tab_vl, tab_ul TYPE vim_tab_ul, END OF vim_variable_tab. TYPES:
BEGIN OF vim_tabdata_record, viewname LIKE tvdir-tabname, sel_langus
LIKE t002-spras OCCURS 0, all_langus(1) TYPE c, tabdata TYPE
vim_variable_tab, END OF vim_tabdata_record. DATA:
vim_internal_ltext_call(1) TYPE c. CONSTANTS: read(4) TYPE c VALUE
'READ', edit(4) TYPE c VALUE 'EDIT', read_and_edit(4) TYPE c VALUE
'RDED', vim_read_text(4) TYPE c VALUE 'RTXT',  save(4) TYPE c VALUE
'SAVE', reset_list(4) TYPE c VALUE 'ORGL', reset_entry(4) TYPE c VALUE
'ORGD', switch_to_show_mode(4) TYPE c VALUE 'ANZG',
switch_to_update_mode(4) TYPE c VALUE 'AEND',
switch_transp_to_upd_mode(4) TYPE c VALUE 'TRAE', get_another_view(4)
TYPE c VALUE 'ATAB', back(4) TYPE c VALUE 'BACK', end(4) TYPE c VALUE
'ENDE', canc(4) TYPE c VALUE 'ABR ', transport(4) VALUE 'TRSP',
subset(1) TYPE c VALUE 'S', authority type sychar01 value 'A',
ddic_marks(2) TYPE c VALUE 'XB', vim_subset_marks(2) TYPE c VALUE 'SB',
vim_subset_marks_mult(4) TYPE c VALUE 'SBMA',  rdonly(1) TYPE c VALUE
'R', vim_hidden(1) TYPE c VALUE 'H', adrnbr(1) TYPE c VALUE 'A',
usrexi(1) TYPE c VALUE 'X', client_length LIKE sy-fdpos VALUE '3',
vim_datum_length LIKE sy-fdpos VALUE '8', vim_spras_length LIKE
sy-fdpos VALUE '1', fname_length TYPE i VALUE '30', compl_form_offs
LIKE sy-fdpos VALUE '6', corr_form_offs LIKE sy-fdpos VALUE '11',
transporter LIKE tadir-pgmid VALUE 'R3TR', transp_object LIKE
tadir-object VALUE 'TABU', vim_view_type LIKE e071k-mastertype VALUE
'VDAT', vim_clus_type LIKE e071k-mastertype VALUE 'CDAT', vim_tran_type
LIKE e071k-mastertype VALUE 'TDAT', vim_deleted_key LIKE tadir-pgmid
VALUE '(DL)', vim_unlockable_object LIKE e071k-mastertype VALUE '(UO)',
vim_lockable_object LIKE e071k-mastertype VALUE '(LO)',
vim_long_objname LIKE e071k-objname VALUE '(?TABKEY?)',
vim_71k_name_length TYPE i VALUE '30', vim_transport_denied(1) TYPE c
VALUE 'V', sortflag_with_existency LIKE e071k-sortflag VALUE '2',
sortflag_without_existency LIKE e071k-sortflag VALUE '3', e071_objfunc
LIKE e071-objfunc VALUE 'K', state_vect_prefix(7) TYPE c VALUE
'STATUS_', state_vect_prefix_length TYPE i VALUE '7',
sap_cust_classes(2) TYPE c VALUE 'EG', sap_only_classes(1) TYPE c VALUE
'S', sap_cust_ctrl_classes(1) TYPE c VALUE 'E', no_transport_classes(1)
TYPE c VALUE 'L', no_transport_log_classes(1) TYPE c VALUE 'W',
application_delivery_classes(1) TYPE c VALUE 'A',
customizing_delivery_classes(3) TYPE c VALUE 'CEG',
nbrd_texts_prefix(10) TYPE c VALUE 'SVIM_TEXT_',
nbrd_texts_prefix_length TYPE i VALUE '10', master_fpool(8) TYPE c
VALUE 'SAPLSVIM', vim_position_info_len TYPE i VALUE '30',
vim_position_info_lg1 TYPE i VALUE '13', vim_position_info_lg2 TYPE i
VALUE '6', vim_position_info_lg3 TYPE i VALUE '10', vim_reset(1) TYPE c
VALUE 'O', vim_replace(1) TYPE c VALUE 'R', vim_upgrade(1) TYPE c VALUE
'U', vim_direct_upgrade(1) TYPE c VALUE 'C', vim_undelete(1) TYPE c
VALUE 'D', vim_delimit(1) TYPE c VALUE 'G', vim_delete(1) TYPE c VALUE
'L', vim_extedit(1) TYPE c VALUE 'E', vim_import(1) TYPE c VALUE 'I',
vim_import_no_dialog TYPE c VALUE 'D', vim_import_with_dialog TYPE c
VALUE 'H', vim_time_dep_dpl_modif_form(30) TYPE c VALUE
'TIME_DEPENDENT_DISPLAY_MODIF', vim_view(1) TYPE c VALUE 'V',
vim_tabl(1) TYPE c VALUE 'S', vim_clst(1) TYPE c VALUE 'C', vim_tran(1)
TYPE c VALUE 'T', vim_logo(1) TYPE c VALUE 'L', vim_cust(4) TYPE c
VALUE 'CUST', vim_syst(4) TYPE c VALUE 'SYST', vim_cust_syst(4) TYPE c
VALUE 'CUSY', vim_appl(4) TYPE c VALUE 'APPL', vim_noact(1) TYPE c
VALUE 'N', vim_log(1) TYPE c VALUE '1', vim_locked(1) TYPE c VALUE '2',
vim_local_clnt(1) TYPE c VALUE '3', vim_nocliindep_cust(1) TYPE c VALUE
'1', vim_noreposichanges(1) TYPE c VALUE '2', vim_noreposiandcust(1)
TYPE c VALUE '3', vim_frm_text_upd_flag(19) TYPE c VALUE
'SET_TXT_UPDATE_FLAG', vim_frm_fill_textkey(19) TYPE c VALUE
'FILL_TEXTTAB_KEY_UC', vim_max_trsp_keylength TYPE i VALUE '120',
vim_max_trsp_identical_key TYPE i VALUE '119', vim_char_inttypes(5)
TYPE c VALUE 'CDNST', vim_not_importable type objimp value '1'.
CONSTANTS: einstufig(1) TYPE c VALUE 'E', zweistufig(1) TYPE c VALUE
'Z', anzeigen(1) TYPE c VALUE 'S', aendern(1) TYPE c VALUE 'U',
vim_ds_loeschen(1) TYPE c VALUE 'D', hinzufuegen(1) TYPE c VALUE 'A',
kopieren(1) TYPE c VALUE 'C', profil_hinzufuegen TYPE c VALUE 'R',
transportieren(1) TYPE c VALUE 'T', pruefen(1) TYPE c VALUE 'P',
zurueckholen(1) TYPE c VALUE 'Z', task_add(1) TYPE c VALUE 'E',
task_del(1) TYPE c VALUE 'F', gesamtdaten(1) TYPE c VALUE 'G',
auswahldaten(1) TYPE c VALUE 'X', markiert(1) TYPE c VALUE 'M',
nicht_markiert(1) TYPE c VALUE ' ', detail_bild(1) TYPE c VALUE 'D',
list_bild(1) TYPE c VALUE 'L', geloescht(1) TYPE c VALUE 'D',
nicht_geloescht(1) TYPE c VALUE ' ', by_field_contents(1) TYPE c VALUE
'I', expanded(1) TYPE c VALUE ' ', collapsed(1) TYPE c VALUE 'C',
collapsed_displd(1) TYPE c VALUE 'D', update_geloescht(1) TYPE c VALUE
'Y', neuer_geloescht(1) TYPE c VALUE 'X', dummy_geloescht(1) TYPE c
VALUE 'Z', neuer_eintrag(1) TYPE c VALUE 'N', uebergehen(1) TYPE c
VALUE '*', leer(1) TYPE c VALUE 'L', original(1) TYPE c VALUE ' ',
bcset_only(1) TYPE c VALUE 'B'. CONSTANTS: vim_scrform_domain LIKE
dd03p-domname VALUE 'TDFORM', vim_delim_date_domain LIKE dd03p-domname
VALUE 'DATUM', vim_begdate_dtel1 LIKE dd03p-rollname VALUE 'BEGDATUM',
vim_begdate_dtel2 LIKE dd03p-rollname VALUE 'BEGDA', vim_begdate_dtel3
LIKE dd03p-rollname VALUE 'ISH_BEGDT', vim_begdate_dtel4 LIKE
dd03p-rollname VALUE 'VIM_BEGDA', vim_enddate_dtel1 LIKE dd03p-rollname
VALUE 'ENDDATUM', vim_enddate_dtel2 LIKE dd03p-rollname VALUE 'ENDDA',
vim_enddate_dtel3 LIKE dd03p-rollname VALUE 'ISH_ENDDT',
vim_enddate_dtel4 LIKE dd03p-rollname VALUE 'VIM_ENDDA', BEGIN OF
vim_adrnbr_domains, dom1 LIKE dd03p-domname VALUE 'ADRNR', dom2 LIKE
dd03p-domname VALUE 'CADRNR', dom3 LIKE dd03p-domname VALUE
'AD_ADDRNUM', END OF vim_adrnbr_domains, vim_addr_e071k_master TYPE
sobj_name VALUE 'ADDRESS',  vim_addr_e071k_master_46 TYPE sobj_name
VALUE 'ADDRESS_4.6'.  CONSTANTS: vim_sbscr_prog LIKE d020s-prog VALUE
'SAPLSVCM', vim_sbscr_dnum LIKE d020s-dnum VALUE '0101',
vim_locked_in_corr LIKE vimstatus-corr_nbr VALUE 'LOCKED',
vim_dummy_mainkey TYPE c VALUE 'K', vim_no_mkey_not_procsd(1) TYPE c
VALUE 'X', vim_no_mkey_procsd_patt(2) TYPE c VALUE 'XY',
vim_no_mkey_not_procsd_patt(2) TYPE c VALUE 'YX', vim_source_entry(1)
TYPE c VALUE 'O', vim_clidep(1) TYPE x VALUE '02',
vim_auth_initial_check(1) TYPE c VALUE 'I',
vim_auth_switch_to_update_mode(1) TYPE c VALUE 'U',
vim_auth_requested_check(1) TYPE c VALUE 'R'. CONSTANTS:
vim_tb_read_single_form(23) TYPE c VALUE 'TABLE_READ_SINGLE_ENTRY'.
DATA: compl_formname(30) TYPE c VALUE 'COMPL_', corr_formname(30) TYPE
c VALUE 'CORR_MAINT_', BEGIN OF vim_read_single_form, prefix(18) TYPE c
VALUE 'READ_SINGLE_ENTRY_', viewname LIKE tvdir-tabname, END OF
vim_read_single_form, BEGIN OF vim_read_single_form_40, prefix(12) TYPE
c VALUE 'READ_SINGLE_', viewname LIKE tvdir-tabname, END OF
vim_read_single_form_40. DATA: status TYPE state_vector, BEGIN OF
title, action(1) TYPE c VALUE 'U', mode(1) TYPE c VALUE 'L', data(1)
TYPE c VALUE 'G', END OF title. DATA: vim_for_alignment_only TYPE f,
vim_view_wax TYPE tabl8000, vim_ctabkeylen TYPE sy-fleng. DATA:
vim_ale_keyspec_check(1) TYPE c, vim_ale_keyspec_objtab TYPE
vim_ale_keyspec_objs OCCURS 1 WITH HEADER LINE,
vim_delim_expa_excluded(1) TYPE c, vim_auth_event(1) TYPE c,
vim_auth_action(1) TYPE c, vim_auth_rc LIKE sy-subrc, vim_auth_msgid
LIKE sy-msgid, vim_auth_msgno LIKE sy-msgno, vim_auth_msgv1 LIKE
sy-msgv1, vim_auth_msgv2 LIKE sy-msgv2, vim_auth_msgv3 LIKE sy-msgv3,
vim_auth_msgv4 LIKE sy-msgv4, vim_no_warning_for_cliindep(1) TYPE c,
vim_begdate_is_ro(1) TYPE c, vim_addr_field_selection LIKE
addr1_fsel-fisel, vim_addr_keywords LIKE addr1_keyw, vim_addr_titlebar
LIKE sy-title, vim_addr_chng_deflt_comm_types LIKE addr_comm,
vim_addr_frame_text LIKE addr_frame, vim_addr_excluded_functions LIKE
vimexclfun OCCURS 0 WITH HEADER LINE, vim_upgr_address_number LIKE
addr1_sel-addrnumber, vim_skip_adr_maint TYPE xfeld,
vim_texttab_is_ro(1) TYPE c, vim_system_type(10) TYPE c,
vim_nbr_of_scrfrm_pointers TYPE i, vim_enq_s_u_rc LIKE sy-subrc,
vim_addr_e071k_tab LIKE TABLE OF e071k INITIAL SIZE 0,
vim_addr_e071_tab LIKE TABLE OF e071 INITIAL SIZE 0, vim_tsadrv LIKE
tsadrv, vim_addr_group LIKE tsadrv-addr_group, vim_addr_basetable LIKE
dd03l-tabname, vim_addr_bastab_field LIKE dd03l-fieldname,
vim_show_consistency_alert(1) TYPE c VALUE 'X', vim_import_testmode(1)
TYPE c, vim_import_forcemode(1) TYPE c, vim_import_profile(1) TYPE c,
vim_profile_errorkey LIKE SCPRACPR-TABLEKEY, vim_abort_saving(1) TYPE
c, vim_import_no_message(1) TYPE c, vim_single_entry_function TYPE
vimty_tcode, vim_single_entry_ins_key_input LIKE tvdir-flag,
vim_import_mode_active(1) TYPE c, vim_last_logged_message TYPE
vimty_message, vim_copy_call_level TYPE i, vim_nr_entries_to_copy TYPE
i, vim_no_dialog(1) TYPE c, vim_modify_screen(1) TYPE c, vim_object
LIKE vimdesc-viewname, vim_objfield LIKE vimnamtab-viewfield,
vim_results_of_ext_mod LIKE vimmodres, vim_called_by_cluster(1) TYPE c,
vim_calling_cluster TYPE vcl_name, vim_enqueue_range(1) TYPE c,
vim_view_name LIKE vimdesc-viewname, replace_mode(1) TYPE c,
vim_restore_mode(1) TYPE c, vim_external_mode(1) TYPE c,
vim_extcopy_mode(1) TYPE c, vim_special_mode(1) TYPE c,
vim_special_adjust_mode(1) TYPE c, vim_adjust_middle_level_mode(1) TYPE
c, maint_mode TYPE c, update_flag(1) TYPE c VALUE ' ', adrnbr_roflag(1)
TYPE c VALUE ' ', block_sw TYPE c VALUE ' ', block_1 LIKE sy-tabix,
block_2 LIKE sy-tabix, liste LIKE d020s-dnum, detail LIKE d020s-dnum,
returncode LIKE ocus-returncode, viewtitle LIKE ocus-tabtitle, tablen
LIKE ocus-tablen, keylen LIKE ocus-keylen, anzahl TYPE i, answer(1)
TYPE c, neuer(1) TYPE c VALUE 'N', ok_code LIKE sy-ucomm, function LIKE
sy-ucomm, relation(2) TYPE c VALUE 'EQ', counter LIKE sy-fdpos,
mark_extract TYPE i, mark_total TYPE i, l LIKE sy-tabix, o TYPE i, pos
TYPE i, refcnt TYPE i, newcnt TYPE i, orgcnt TYPE i, last_view_info
LIKE dd02v-tabname, vim_last_objh_view LIKE dd02v-tabname,
vim_act_dynp_view LIKE dd02v-tabname, vim_ale_edit_lock(1) TYPE c,
vim_ale_msgid LIKE sy-msgid, vim_ale_msgno LIKE sy-msgno, vim_ale_msgv1
LIKE sy-msgv1, vim_ale_msgv2 LIKE sy-msgv2, vim_ale_msgv3 LIKE
sy-msgv3, vim_ale_msgv4 LIKE sy-msgv4, last_corr_number LIKE
e070-trkorr, fill_extr_first_proc TYPE c, f LIKE d021s-fnam,
e071k_tab_modified TYPE c, sel_field_for_replace(30) TYPE c,
sel_field_for_replace_l(30) TYPE c, corr_nbr LIKE e070-trkorr,
master_type LIKE tadir-object VALUE 'TABU', master_name LIKE
tadir-obj_name, vim_client_state LIKE t000-cccoractiv,
get_corr_keytab(1) TYPE c, last_ext_modif_view LIKE tvdir-tabname,
deta_mark_safe(1) TYPE c, ignored_entries_exist(1) TYPE c,
corr_action(1) TYPE c, replace_texttable_field(1) TYPE c,
nbrd_texts_alr_read(1) TYPE c, svim_text_001(35) TYPE c,
svim_text_002(35) TYPE c, svim_text_003(35) TYPE c, svim_text_004(35)
TYPE c, svim_text_005(35) TYPE c, svim_text_006(35) TYPE c,
svim_text_007(35) TYPE c, svim_text_008(35) TYPE c, svim_text_009(35)
TYPE c, svim_text_010(35) TYPE c, svim_text_011(35) TYPE c,
svim_text_012(35) TYPE c, svim_text_013(35) TYPE c, svim_text_014(35)
TYPE c, svim_text_015(35) TYPE c, svim_text_016(35) TYPE c,
svim_text_017(35) TYPE c, svim_text_018(35) TYPE c, svim_text_019(35)
TYPE c, svim_text_020(35) TYPE c, svim_text_021(35) TYPE c,
svim_text_022(35) TYPE c, svim_text_023(35) TYPE c, svim_text_024(35)
TYPE c, svim_text_025(35) TYPE c, svim_text_026(35) TYPE c,
svim_text_027(13) TYPE c, svim_text_028(06) TYPE c, svim_text_029(20)
TYPE c, svim_text_030(35) TYPE c, svim_text_031(35) TYPE c,
svim_text_032(35) TYPE c, svim_text_033(35) TYPE c, svim_text_034(35)
TYPE c, svim_text_035(35) TYPE c, svim_text_036(35) TYPE c,
svim_text_037(35) TYPE c, svim_text_038(35) TYPE c, svim_text_039(35)
TYPE c, svim_text_040(35) TYPE c, svim_text_041(20) TYPE c,
svim_text_042(20) TYPE c, svim_text_043(40) TYPE c, svim_text_044(40)
TYPE c, svim_text_045(20) TYPE c, svim_text_046(20) TYPE c,
svim_text_104(19) TYPE c, svim_text_p01(20) TYPE c, svim_text_p02(20)
TYPE c, svim_text_p03(20) TYPE c, svim_text_prb(40) TYPE c,
svim_text_prc(40) TYPE c, svim_text_pre(40) TYPE c, svim_text_prf(70)
TYPE c, svim_text_prg(70) TYPE c, svim_text_pri(40) TYPE c,
svim_text_prj(40) TYPE c, vim_marked(1) TYPE c, vim_frame_field LIKE
dd25v-ddtext, vim_position_info(42) TYPE c, vim_position_info_mask(42)
TYPE c, vim_fpool_name LIKE trdir-name, vim_posi_push(25) TYPE c,
temporal_delimitation_happened TYPE c, vim_mkey_after_exists(1) TYPE c,
vim_no_mainkey_exists(1) TYPE c, nbr_of_added_dummy_entries TYPE i,
vim_next_screen LIKE tvdir-liste, vim_leave_screen(1) TYPE c,
vim_prtfky_assigned(1) TYPE c, vim_temp_delim_alr_checked(1) TYPE c,
vim_ignore_collapsed_mainkeys(1) TYPE c, vim_corr_obj_viewname LIKE
tvdir-tabname, vim_last_source_system LIKE tadir-srcsystem,
vim_slct_functiontext(20) TYPE c, vim_comp_menue_text(20) TYPE c,
vim_key_alr_checked(1) TYPE c, vim_keyrange_alr_checked(1) TYPE c,
vim_prt_fky_flds_updated(1) TYPE c, vim_exit_11_12_active(1) TYPE c,
BEGIN OF vim_default_rfc_dest, viewname LIKE tvdir-tabname, rfcdest
LIKE rfcdes-rfcdest, END OF vim_default_rfc_dest, BEGIN OF
vim_default_upgr_clnt, viewname LIKE tvdir-tabname, client LIKE
sy-mandt, END OF vim_default_upgr_clnt, vim_title_name LIKE
vimdesc-ddtext, vim_tabctrl_active(1) TYPE c, vim_tc_cols TYPE
cxtab_column, vim_local_char1(1) TYPE c. FIELD-SYMBOLS: <key_date> TYPE
ANY. DATA: BEGIN OF d0001_field_tab OCCURS 10, begin TYPE d, end TYPE
d, mark(1) TYPE c, END OF d0001_field_tab, d0001_cursor TYPE i, BEGIN
OF d0001_status, type(1) TYPE c, action(1) TYPE c, mode(1) TYPE c,
data(1) TYPE c, mark(1) TYPE c, delete(1) TYPE c, fill1(1) TYPE c,
fill2(1) TYPE c, spec_mode TYPE c, END OF d0001_status,
d0001_input_flag(1) TYPE c, vim_mainkey TYPE vim_tabkey_c, current_date
TYPE d, date_to_delimit TYPE d, date_to_posit TYPE d, vim_old_viewkey
TYPE vim_tabkey_c, date_safe TYPE d, vim_old_st_selected(1) TYPE c,
BEGIN OF vim_memory_id_1, viewname LIKE vimdesc-viewname, user LIKE
sy-uname, END OF vim_memory_id_1, BEGIN OF vim_memory_id_2, viewname
LIKE vimdesc-viewname, user LIKE sy-uname, END OF vim_memory_id_2,
vim_date_mask(8) TYPE c VALUE '++++++++', vim_coll_mkeys_first(1) TYPE
c, vim_merge_begin TYPE i, vim_merge_end TYPE i, vim_begdate_entered(1)
TYPE c, BEGIN OF vim_begdate_name, tabname LIKE vimdesc-viewname,
dash(1) TYPE c VALUE '-', fieldname LIKE vimnamtab-viewfield, END OF
vim_begdate_name, BEGIN OF vim_enddate_name, tabname LIKE
vimdesc-viewname, dash(1) TYPE c VALUE '-', fieldname LIKE
vimnamtab-viewfield, END OF vim_enddate_name, vim_last_coll_mainkeys_ix
TYPE i, vim_coll_mainkeys_beg_ix TYPE i VALUE 1,
check_all_keyr_scnd_time(1) TYPE c, vim_tdep_title(19) type c.
CONSTANTS: vim_init_date TYPE d VALUE '00000000'. DATA: aktuell(10)
TYPE n, maximal(10) TYPE n, index LIKE sy-tabix, exind LIKE sy-tabix,
mandant LIKE sy-mandt, curline LIKE sy-tabix, curpage LIKE sy-tabix
VALUE 1, firstline LIKE sy-tabix VALUE 1, nextline LIKE sy-tabix VALUE
1,  anz_lines LIKE sy-tabix, anz_pages LIKE sy-tabix, maxlines LIKE
sy-tabix, destpage LIKE sy-tabix, looplines LIKE sy-tabix. TYPES: BEGIN
OF vim_pr_tab_type, recnumber LIKE scprvals-recnumber, action TYPE
char1, keys_fix, align TYPE f, keys(1024) TYPE x, txt_in_sy_langu_exsts
TYPE xfeld, align2 TYPE f, textrecord TYPE vim_line_ul, END OF
vim_pr_tab_type. TYPES: BEGIN OF vim_pr_fields_type, recnumber LIKE
scprvals-recnumber, keys_fix(1), fields TYPE vimty_fields_tab_type, END
OF vim_pr_fields_type, vimsellist_type TYPE TABLE OF vimsellist, BEGIN
OF bc_key_type, trkorr like e071k-trkorr, pgmid like e071k-pgmid,
object like e071k-object, objname like e071k-objname, as4pos like
e071k-as4pos, mastertype like e071k-mastertype, mastername like
e071k-mastername, viewname like e071k-viewname, objfunc like
e071k-objfunc, bc_tabkey like scpractr-tabkey, sortflag like
e071k-sortflag, flag like e071k-flag, lang like e071k-lang, activity
like e071k-activity, END OF bc_key_type, bc_keytab_type type table of
bc_key_type, vim_bc_tab_logs TYPE TABLE OF scpractr, vim_bc_del_records
TYPE TABLE OF scprreca, vim_bc_values_lang_type TYPE TABLE OF
scpr_vall. DATA: vim_pr_fields TYPE TABLE OF vim_pr_fields_type INITIAL
SIZE 15, vim_pr_fields_wa TYPE vim_pr_fields_type, vim_coming_from_img,
vim_pr_tab TYPE TABLE OF vim_pr_tab_type, vim_profile_values TYPE TABLE
OF scpr_vals INITIAL SIZE 50, vim_bc_entry_list TYPE
vimty_bc_entry_list_ttype, vim_bc_entry_list_wa TYPE
vimty_bc_entry_list_type, vim_pr_activating, vim_bc_keys_fix(3),
vim_set_from_bc_pbo, vim_bc_chng_allowed TYPE xfeld, vim_pr_records
TYPE i. DATA: vim_actopts TYPE SCPRACTOPT, vim_bcset_id TYPE scpr_id.
CONSTANTS: vim_profile_fix(3) VALUE 'FIX', vim_profile_fixkey(3) VALUE
'FKY', vim_profile_use(3) VALUE 'USE', vim_profile_key(3) VALUE 'KEY',
vim_profile_usekey(3) VALUE 'UKY', vim_pr_error VALUE 'E', vim_pr_open
VALUE 'O', vim_pr_some_fix VALUE 'S', vim_pr_all_fix VALUE 'A',
vim_pr_into_view VALUE 'V', vim_profile_found VALUE 'X',
vim_pr_imp_unchecked VALUE 'Y', vim_writing_bc_imp_log VALUE 'W'. DATA:
vim_pr_stat_txt_me LIKE smp_dyntxt, vim_pr_stat_txt_ch LIKE smp_dyntxt,
vim_pr_stat_txt_ta LIKE smp_dyntxt, vim_pr_stat_txt_or LIKE smp_dyntxt.
DATA: vim_adj_header LIKE vimdesc OCCURS 1, vim_adj_namtab LIKE
vimnamtab OCCURS 0, vim_adj_dbasellist LIKE vimsellist OCCURS 0. DATA:
vim_locked_addresses LIKE SORTED TABLE OF adrc-addrnumber WITH UNIQUE
KEY table_line INITIAL SIZE 10 WITH HEADER LINE. DATA: BEGIN OF
vim_addresses_to_save OCCURS 10, viewname LIKE tvdir-tabname,
addrnumber LIKE adrc-addrnumber, handle LIKE addr1_dia-handle, END OF
vim_addresses_to_save. DATA: BEGIN OF textpool_tab OCCURS 30. INCLUDE
STRUCTURE textpool. DATA: END OF textpool_tab. DATA: BEGIN OF
exclude_tab OCCURS 10, field LIKE d021s-fnam, END OF exclude_tab. DATA:
excl_rpl_tab TYPE vimexclfldtab WITH HEADER LINE, excl_que_tab TYPE
vimexclfldtab WITH HEADER LINE, excl_pos_tab TYPE vimexclfldtab WITH
HEADER LINE, vim_excl_xxx_tab_safe TYPE vimexclfldtabs WITH HEADER
LINE. DATA: BEGIN OF vim_corr_objtab OCCURS 10. INCLUDE STRUCTURE e071.
DATA: lockable(1) TYPE c, END OF vim_corr_objtab. DATA: BEGIN OF
vim_corr_entryobjtab OCCURS 10. INCLUDE STRUCTURE ko200. DATA:
lockable(1) TYPE c, END OF vim_corr_entryobjtab. DATA: BEGIN OF
e071k_tab OCCURS 100. INCLUDE STRUCTURE e071k. DATA: END OF e071k_tab.
DATA: vim_alv_fcat TYPE slis_t_fieldcat_alv, vim_alv_events TYPE
slis_t_event, vim_alv_print TYPE slis_print_alv, vim_alv_layout TYPE
slis_layout_alv, vim_alv_variant LIKE disvariant, vim_var_save,
vim_var_default, vim_alv_value_length TYPE intlen, vim_alv_called_by
TYPE char30, alv_value_tab TYPE TABLE OF tabl8000 initial size 500.
DATA: align_value_tab TYPE f, BEGIN OF value_tab OCCURS 1, line(4096),
END OF value_tab. DATA: BEGIN OF structure_table OCCURS 20. INCLUDE
STRUCTURE dfies. DATA: END OF structure_table. DATA: vim_list_header
TYPE slis_t_listheader. DATA: vim_delim_entries TYPE STANDARD TABLE OF
vim_delim_entr_tl WITH DEFAULT KEY INITIAL SIZE 10 WITH HEADER LINE.
DATA: BEGIN OF vim_sval_tab OCCURS 1. INCLUDE STRUCTURE sval. DATA: END
OF vim_sval_tab. DATA: vim_collapsed_mainkeys TYPE STANDARD TABLE OF
vim_collapsed_mkeys_tl WITH DEFAULT KEY INITIAL SIZE 1 WITH HEADER
LINE. DATA: vim_merged_entries TYPE STANDARD TABLE OF
vim_merged_entr_tl WITH DEFAULT KEY INITIAL SIZE 1 WITH HEADER LINE.
DATA: BEGIN OF vim_copied_indices OCCURS 10, ix LIKE sy-tabix, ex_ix
LIKE sy-tabix, level TYPE i, END OF vim_copied_indices. DATA:
vim_wheretab LIKE vimwheretb OCCURS 10, imp_results TYPE
slctr_tables_keys WITH HEADER LINE. DATA: vim_texttab_container TYPE
vim_tabdata_record OCCURS 0 WITH HEADER LINE,
vim_texttab_container_index LIKE sy-tabix, vim_d0100_fdescr_ini TYPE
vimty_screen_fdescr_tab. RANGES: mark_functions FOR sy-ucomm,
adrnbr_domain FOR sadr-adrnr, exted_functions FOR sy-ucomm,
vim_guid_domain FOR vimnamtab-domname, vim_begda_types FOR
dd03p-rollname, vim_endda_types FOR dd03p-rollname. CONSTANTS:
vim_docu_prog LIKE iwreferenc-programm VALUE 'SAPLSVIM',
vim_docu_extension LIKE iwreferenc-spec_text VALUE
'SM30 USER INTERFACE'. CONSTANTS: vim_template_dynpro TYPE x VALUE
'20', vim_standard_dynpro TYPE x VALUE 'C0'. DATA: vim_oc_inst TYPE REF
TO cl_viewfields_org_crit. DATA vim_dba_sel_kept TYPE
svorg_vimsellist_type. DATA: BEGIN OF STATUS_ZSOFTCOPY_STRIP . INCLUDE
STRUCTURE VIMSTATUS. DATA: END OF STATUS_ZSOFTCOPY_STRIP . CONTROLS:
TCTRL_ZSOFTCOPY_STRIP TYPE TABLEVIEW USING SCREEN '0001'. DATA: BEGIN
OF STATUS_ZSOFTCOPY_TABLE . INCLUDE STRUCTURE VIMSTATUS. DATA: END OF
STATUS_ZSOFTCOPY_TABLE . CONTROLS: TCTRL_ZSOFTCOPY_TABLE TYPE TABLEVIEW
USING SCREEN '0002'. DATA: BEGIN OF STATUS_ZSOFTCOPY_TEXT . INCLUDE
STRUCTURE VIMSTATUS. DATA: END OF STATUS_ZSOFTCOPY_TEXT . CONTROLS:
TCTRL_ZSOFTCOPY_TEXT TYPE TABLEVIEW USING SCREEN '0003'. DATA: BEGIN OF
STATUS_ZSOFTCOPY_VARID . INCLUDE STRUCTURE VIMSTATUS. DATA: END OF
STATUS_ZSOFTCOPY_VARID . CONTROLS: TCTRL_ZSOFTCOPY_VARID TYPE TABLEVIEW
USING SCREEN '0004'. TABLES: *ZSOFTCOPY_STRIP . TABLES:
 *ZSOFTCOPY_TABLE . TABLES: *ZSOFTCOPY_TEXT . TABLES: *ZSOFTCOPY_TEXTT
. TABLES: *ZSOFTCOPY_VARID . TABLES: ZSOFTCOPY_STRIP . TABLES:
ZSOFTCOPY_TABLE . TABLES: ZSOFTCOPY_TEXT . TABLES: ZSOFTCOPY_TEXTT .
TABLES: ZSOFTCOPY_VARID . DATA: BEGIN OF EXTRACT_UL OCCURS 0,
LINE(4096), END OF EXTRACT_UL, BEGIN OF EXTRACT_VL OCCURS 0, LINE(512),
END OF EXTRACT_VL, BEGIN OF EXTRACT_L OCCURS 0, LINE(256), END OF
EXTRACT_L, BEGIN OF EXTRACT_M OCCURS 0, LINE(128), END OF EXTRACT_M,
BEGIN OF EXTRACT_S OCCURS 0, LINE(64), END OF EXTRACT_S, BEGIN OF
EXTRACT_VS OCCURS 0, LINE(48), END OF EXTRACT_VS, BEGIN OF EXTRACT_US
OCCURS 0, LINE(32), END OF EXTRACT_US. DATA: BEGIN OF TOTAL_UL OCCURS
0, LINE(4096), END OF TOTAL_UL, BEGIN OF TOTAL_VL OCCURS 0, LINE(512),
END OF TOTAL_VL, BEGIN OF TOTAL_L OCCURS 0, LINE(256), END OF TOTAL_L,
BEGIN OF TOTAL_M OCCURS 0, LINE(128), END OF TOTAL_M, BEGIN OF TOTAL_S
OCCURS 0, LINE(64), END OF TOTAL_S, BEGIN OF TOTAL_VS OCCURS 0,
LINE(48), END OF TOTAL_VS, BEGIN OF TOTAL_US OCCURS 0, LINE(32), END OF
TOTAL_US. DATA: BEGIN OF MOD_ELEM_TAB OCCURS 100, LINES(4096), END OF
MOD_ELEM_TAB. DATA: FORBIDDEN_FUNC_NAME_CHARS(9) VALUE '\$!§%&''##',
FORBIDDEN_AREA_NAME_CHARS(9) VALUE '\$!§%&''##'. FUNCTION $$UNIT$$
TABLEFRAME_ZSOFTCOPY_DBM IMPORTING VALUE(VIEW_ACTION) DEFAULT 'S'
VALUE(VIEW_NAME) LIKE !DD02V-TABNAME VALUE(CORR_NUMBER) LIKE
!E070-TRKORR DEFAULT ' ' TABLES !DBA_SELLIST STRUCTURE !VIMSELLIST
!DPL_SELLIST STRUCTURE !VIMSELLIST !EXCL_CUA_FUNCT STRUCTURE
!VIMEXCLFUN !X_HEADER STRUCTURE !VIMDESC !X_NAMTAB STRUCTURE !VIMNAMTAB
EXCEPTIONS !MISSING_CORR_NUMBER. PERFORM TABLEFRAME TABLES X_HEADER
X_NAMTAB DBA_SELLIST DPL_SELLIST EXCL_CUA_FUNCT USING CORR_NUMBER
VIEW_ACTION VIEW_NAME. ENDFUNCTION.  FUNCTION $$UNIT$$
TABLEPROC_ZSOFTCOPY_DBM IMPORTING VALUE(FCODE) DEFAULT 'RDED'
VALUE(VIEW_ACTION) DEFAULT 'S' VALUE(VIEW_NAME) LIKE !DD02V-TABNAME
VALUE(CORR_NUMBER) LIKE !E070-TRKORR DEFAULT ' ' EXPORTING
VALUE(LAST_ACT_ENTRY) VALUE(UCOMM) VALUE(UPDATE_REQUIRED) TABLES
!CORR_KEYTAB STRUCTURE !E071K !DBA_SELLIST STRUCTURE !VIMSELLIST
!DPL_SELLIST STRUCTURE !VIMSELLIST !EXCL_CUA_FUNCT STRUCTURE
!VIMEXCLFUN !EXTRACT !TOTAL !X_HEADER STRUCTURE !VIMDESC !X_NAMTAB
STRUCTURE !VIMNAMTAB EXCEPTIONS !MISSING_CORR_NUMBER
!SAVING_CORRECTION_FAILED $$GLOBAL. PERFORM TABLEPROC. ENDFUNCTION.
FORM table_call_function TABLES dba_sellist dpl_sellist x_header
STRUCTURE vimdesc x_namtab excl_cua_funct USING value(tcf_fcode)
value(tcf_tabtype) tcf_upd_flag. DATA: function_name LIKE
tfdir-funcname VALUE 'TABLEPROC_', prefix_len TYPE i VALUE '10'. READ
TABLE x_header INDEX 1. MOVE x_header-area TO function_name+prefix_len.
IF function_name CA forbidden_func_name_chars. PERFORM
replace_forbidden_chars USING forbidden_func_name_chars function_name.
ENDIF. CASE tcf_tabtype. WHEN 'ULTRA_SHORT'. CALL FUNCTION
function_name EXPORTING fcode = tcf_fcode view_action = maint_mode
view_name = x_header-viewname corr_number = corr_nbr IMPORTING ucomm =
function update_required = tcf_upd_flag TABLES dba_sellist =
dba_sellist dpl_sellist = dpl_sellist excl_cua_funct = excl_cua_funct
x_header = x_header x_namtab = x_namtab corr_keytab = e071k_tab extract
= extract_us total = total_us EXCEPTIONS missing_corr_number = 01
saving_correction_failed = 03. WHEN 'VERY_SHORT'. CALL FUNCTION
function_name EXPORTING fcode = tcf_fcode view_action = maint_mode
view_name = x_header-viewname corr_number = corr_nbr IMPORTING ucomm =
function update_required = tcf_upd_flag TABLES dba_sellist =
dba_sellist dpl_sellist = dpl_sellist excl_cua_funct = excl_cua_funct
x_header = x_header x_namtab = x_namtab corr_keytab = e071k_tab extract
= extract_vs total = total_vs EXCEPTIONS missing_corr_number = 01
saving_correction_failed = 03. WHEN 'SHORT'. CALL FUNCTION
function_name EXPORTING fcode = tcf_fcode view_action = maint_mode
view_name = x_header-viewname corr_number = corr_nbr IMPORTING ucomm =
function update_required = tcf_upd_flag TABLES dba_sellist =
dba_sellist dpl_sellist = dpl_sellist excl_cua_funct = excl_cua_funct
x_header = x_header x_namtab = x_namtab corr_keytab = e071k_tab extract
= extract_s total = total_s EXCEPTIONS missing_corr_number = 01
saving_correction_failed = 03. WHEN 'MIDDLE'. CALL FUNCTION
function_name EXPORTING fcode = tcf_fcode view_action = maint_mode
view_name = x_header-viewname corr_number = corr_nbr IMPORTING ucomm =
function update_required = tcf_upd_flag TABLES dba_sellist =
dba_sellist dpl_sellist = dpl_sellist excl_cua_funct = excl_cua_funct
x_header = x_header x_namtab = x_namtab corr_keytab = e071k_tab extract
= extract_m total = total_m EXCEPTIONS missing_corr_number = 01
saving_correction_failed = 03. WHEN 'LONG'. CALL FUNCTION function_name
EXPORTING fcode = tcf_fcode view_action = maint_mode view_name =
x_header-viewname corr_number = corr_nbr IMPORTING ucomm = function
update_required = tcf_upd_flag TABLES dba_sellist = dba_sellist
dpl_sellist = dpl_sellist excl_cua_funct = excl_cua_funct x_header =
x_header x_namtab = x_namtab corr_keytab = e071k_tab extract =
extract_l total = total_l EXCEPTIONS missing_corr_number = 01
saving_correction_failed = 03. WHEN 'VERY_LONG'. CALL FUNCTION
function_name EXPORTING fcode = tcf_fcode view_action = maint_mode
view_name = x_header-viewname corr_number = corr_nbr IMPORTING ucomm =
function update_required = tcf_upd_flag TABLES dba_sellist =
dba_sellist dpl_sellist = dpl_sellist excl_cua_funct = excl_cua_funct
x_header = x_header x_namtab = x_namtab corr_keytab = e071k_tab extract
= extract_vl total = total_vl EXCEPTIONS missing_corr_number = 01
saving_correction_failed = 03. WHEN 'ULTRA_LONG'. CALL FUNCTION
function_name EXPORTING fcode = tcf_fcode view_action = maint_mode
view_name = x_header-viewname corr_number = corr_nbr IMPORTING ucomm =
function update_required = tcf_upd_flag TABLES dba_sellist =
dba_sellist dpl_sellist = dpl_sellist excl_cua_funct = excl_cua_funct
x_header = x_header x_namtab = x_namtab corr_keytab = e071k_tab extract
= extract_ul total = total_ul EXCEPTIONS missing_corr_number = 01
saving_correction_failed = 03. ENDCASE. ENDFORM. FORM table_get_data.
CONSTANTS maxsellines TYPE i VALUE 500. DATA: tgd_sellist LIKE
vimsellist OCCURS 10, tgd_sel LIKE vimsellist, tgd_sellangu LIKE
vimsellist, short_sellist LIKE vimsellist OCCURS 10, short_sel LIKE
vimsellist, tgd_ind TYPE i, tgd_field LIKE vimnamtab-viewfield,
selnumber TYPE i, selindex TYPE i, selcut TYPE i, selpieces TYPE i.
FIELD-SYMBOLS: <text_key>. DATA: primtab TYPE REF TO data, texttab TYPE
REF TO data, w_texttab_save TYPE REF TO data, w_texttab TYPE REF TO
data, text_keyflds TYPE vim_flds_tab_type. FIELD-SYMBOLS: <primtab>
TYPE STANDARD TABLE, <texttab> TYPE SORTED TABLE, <w_texttab> TYPE ANY,
<w_texttab_save> TYPE ANY, <textline_x> TYPE x. REFRESH total. CLEAR
total. IF x_header-selection NE space. DESCRIBE TABLE dba_sellist LINES
selnumber. IF selnumber > maxsellines. CLEAR selpieces. CLEAR selindex.
CREATE DATA primtab TYPE STANDARD TABLE OF (x_header-maintview). ASSIGN
primtab->* TO <primtab>. WHILE selindex < selnumber. selpieces =
selpieces + maxsellines. REFRESH short_sellist. CLEAR selcut. WHILE
selcut EQ 0 AND selindex < selnumber. selindex = selindex + 1. READ
TABLE dba_sellist INTO short_sel INDEX selindex. APPEND short_sel TO
short_sellist. IF selindex > selpieces AND short_sel-and_or NE 'AND'.
selcut = 1. ENDIF. ENDWHILE. CLEAR short_sel-and_or. MODIFY
short_sellist FROM short_sel INDEX selindex. CALL FUNCTION
'VIEW_FILL_WHERETAB' EXPORTING tablename = x_header-maintview TABLES
sellist = short_sellist wheretab = vim_wheretab x_namtab = x_namtab
EXCEPTIONS no_conditions_for_table = 01. SELECT * FROM
(x_header-maintview) APPENDING TABLE <primtab> WHERE (vim_wheretab).
CLEAR selcut. ENDWHILE. ELSE. CALL FUNCTION 'VIEW_FILL_WHERETAB'
EXPORTING tablename = x_header-maintview TABLES sellist = dba_sellist
wheretab = vim_wheretab x_namtab = x_namtab EXCEPTIONS
no_conditions_for_table = 01. CREATE DATA primtab TYPE STANDARD TABLE
OF (x_header-maintview). ASSIGN primtab->* TO <primtab>. SELECT * FROM
(x_header-maintview) INTO TABLE <primtab> WHERE (vim_wheretab). ENDIF.
ELSE. REFRESH vim_wheretab. CREATE DATA primtab TYPE STANDARD TABLE OF
(x_header-maintview). ASSIGN primtab->* TO <primtab>. SELECT * FROM
(x_header-maintview) INTO TABLE <primtab>. ENDIF. IF
x_header-texttbexst EQ space. LOOP AT <primtab> INTO <vim_total_struc>.
APPEND total. ENDLOOP. SORT total BY <vim_xtotal_key>.
<status>-alr_sorted = 'R'. IF x_header-selection EQ space AND
x_header-delmdtflag NE space. PERFORM build_mainkey_tab_0. ENDIF. LOOP
AT total. CLEAR: <action>, <mark>. MODIFY total. IF x_header-selection
EQ space AND x_header-delmdtflag NE space. PERFORM build_mainkey_tab_1.
ENDIF. ENDLOOP. IF x_header-selection EQ space AND x_header-delmdtflag
NE space. PERFORM build_mainkey_tab_2. ENDIF. ELSE. PERFORM
vim_get_text_keyflds USING x_header-texttab CHANGING text_keyflds.
CREATE DATA texttab TYPE SORTED TABLE OF (x_header-texttab) WITH UNIQUE
KEY (text_keyflds). ASSIGN texttab->* TO <texttab>. IF
x_header-selection NE space. DESCRIBE TABLE dba_sellist LINES
selnumber. selindex = 0. WHILE selindex < selnumber. selindex =
selindex + 1. READ TABLE dba_sellist INTO tgd_sel INDEX selindex. READ
TABLE x_namtab WITH KEY viewfield = tgd_sel-viewfield texttabfld =
space. CHECK x_namtab-keyflag = 'X'. tgd_sel-viewfield =
x_namtab-txttabfldn. READ TABLE x_namtab WITH KEY viewfield =
tgd_sel-viewfield texttabfld = 'X'. tgd_sel-tabix = sy-tabix. IF
tgd_sel-and_or NE 'AND' OR selindex = 1. READ TABLE x_namtab WITH KEY
primtabkey = 0 keyflag = 'X'. tgd_sellangu-viewfield =
x_namtab-viewfield. tgd_sellangu-tabix = sy-tabix.
tgd_sellangu-operator = 'EQ'. tgd_sellangu-value = sy-langu.
tgd_sellangu-and_or = 'AND'. IF tgd_sellangu-value EQ space.
tgd_sellangu-initial = 'X'. ENDIF. tgd_sellangu-cond_kind =
dpl_sellist-cond_kind. CLEAR tgd_sellangu-converted. APPEND
tgd_sellangu TO tgd_sellist. ENDIF. APPEND tgd_sel TO tgd_sellist.
ENDWHILE. DESCRIBE TABLE tgd_sellist. READ TABLE tgd_sellist INDEX
sy-tfill INTO tgd_sel. IF tgd_sel-and_or NE space. CLEAR
tgd_sel-and_or. MODIFY tgd_sellist INDEX sy-tfill FROM tgd_sel. ENDIF.
ELSE. LOOP AT x_namtab WHERE keyflag NE space AND texttabfld NE space
AND primtabkey EQ 0. tgd_sel-viewfield = x_namtab-viewfield.
tgd_sel-tabix = sy-tabix. tgd_sel-operator = 'EQ'. tgd_sel-value =
sy-langu. tgd_sel-and_or = space. IF tgd_sel-value EQ space.
tgd_sel-initial = 'X'. ENDIF. APPEND tgd_sel TO tgd_sellist. EXIT.
ENDLOOP. ENDIF. DESCRIBE TABLE tgd_sellist LINES selnumber. IF
selnumber > maxsellines. CLEAR selpieces. CLEAR selindex. WHILE
selindex < selnumber. selpieces = selpieces + maxsellines. REFRESH
short_sellist. CLEAR selcut. WHILE selcut EQ 0 AND selindex <
selnumber. selindex = selindex + 1. READ TABLE tgd_sellist INTO
short_sel INDEX selindex. APPEND short_sel TO short_sellist. IF
selindex > selpieces AND short_sel-and_or NE 'AND'. selcut = 1. ENDIF.
ENDWHILE. CLEAR short_sel-and_or. MODIFY short_sellist FROM short_sel
INDEX selindex. CALL FUNCTION 'VIEW_FILL_WHERETAB' EXPORTING tablename
= x_header-texttab only_cnds_for_keyflds = 'X' TABLES sellist =
short_sellist wheretab = vim_wheretab x_namtab = x_namtab EXCEPTIONS
no_conditions_for_table = 01. SELECT * FROM (x_header-texttab)
APPENDING TABLE <texttab> WHERE (vim_wheretab). CLEAR selcut. ENDWHILE.
ELSE. CALL FUNCTION 'VIEW_FILL_WHERETAB' EXPORTING tablename =
x_header-texttab only_cnds_for_keyflds = 'X' TABLES sellist =
tgd_sellist wheretab = vim_wheretab x_namtab = x_namtab EXCEPTIONS
no_conditions_for_table = 01. SELECT * FROM (x_header-texttab) INTO
TABLE <texttab> WHERE (vim_wheretab). ENDIF. IF x_header-selection EQ
space AND x_header-delmdtflag NE space. PERFORM build_mainkey_tab_0.
ENDIF. CREATE DATA w_texttab_save TYPE (x_header-texttab). CREATE DATA
w_texttab TYPE (x_header-texttab). ASSIGN: w_texttab->* TO <w_texttab>,
w_texttab_save->* TO <w_texttab_save>, <w_texttab_save> TO <textline_x>
CASTING. LOOP AT <primtab> INTO <vim_total_struc>. CLEAR <w_texttab>.
PERFORM fill_texttab_key_uc USING <vim_total_struc> CHANGING
<w_texttab>. IF <w_texttab> NE <w_texttab_save>. READ TABLE <texttab>
INTO <w_texttab_save> FROM <w_texttab>. IF sy-subrc = 0. ELSE. MOVE
<text_initial> TO <w_texttab_save>. ENDIF. ENDIF. MOVE <textline_x> TO
<vim_xtotal_text>. CLEAR: <action>, <mark>, <action_text>. APPEND
total. IF x_header-selection EQ space AND x_header-delmdtflag NE space.
PERFORM build_mainkey_tab_1. ENDIF. ENDLOOP. SORT total BY
<vim_xtotal_key>. <status>-alr_sorted = 'R'. IF x_header-selection EQ
space AND x_header-delmdtflag NE space. PERFORM build_mainkey_tab_2.
ENDIF. ENDIF. IF x_header-selection NE space. PERFORM
check_dynamic_select_options. ENDIF. ENDFORM. FORM table_db_upd. DATA:
modified_entries TYPE i, prt_frky_entries TYPE i, rc TYPE i, h_ix TYPE
i, primtab_mod TYPE REF TO data, primtab_mod_wa TYPE REF TO data,
texttab_mod TYPE REF TO data, w_texttab_mod TYPE REF TO data,
e071_loctab TYPE vim_ko200_tab_type. FIELD-SYMBOLS: <mod_elem_tab> TYPE
STANDARD TABLE, <h_keyx> TYPE x, <mod_elem_wa> TYPE ANY, <texttab> TYPE
STANDARD TABLE, <w_texttab> TYPE ANY, <textline_x> TYPE x. CREATE DATA
primtab_mod TYPE TABLE OF (x_header-maintview). CREATE DATA
primtab_mod_wa TYPE (x_header-maintview). ASSIGN: primtab_mod->* TO
<mod_elem_tab>, primtab_mod_wa->* TO <mod_elem_wa>. LOOP AT total.
CHECK ( <action> EQ geloescht OR <action> EQ update_geloescht OR
<action> EQ neuer_geloescht ). IF <action> EQ neuer_geloescht. IF
status-delete EQ geloescht. READ TABLE extract WITH KEY
<vim_xtotal_key>. IF sy-subrc EQ 0. DELETE extract INDEX sy-tabix.
ENDIF. ENDIF. DELETE total. ELSE. APPEND <vim_total_struc> TO
<mod_elem_tab>. ADD 1 TO modified_entries. IF x_header-texttbexst EQ
space. IF status-delete EQ geloescht. READ TABLE extract WITH KEY
<vim_xtotal_key>. IF sy-subrc EQ 0. DELETE extract INDEX sy-tabix.
ENDIF. ENDIF. DELETE total. ENDIF. ENDIF. ENDLOOP. IF modified_entries
NE 0. DELETE (x_header-maintview) FROM TABLE <mod_elem_tab>. ENDIF. IF
x_header-texttbexst NE space. CLEAR modified_entries. CREATE DATA
texttab_mod TYPE STANDARD TABLE OF (x_header-texttab). CREATE DATA
w_texttab_mod TYPE (x_header-texttab). ASSIGN: texttab_mod->* TO
<texttab>, w_texttab_mod->* TO <w_texttab>, <w_texttab> TO <textline_x>
CASTING. LOOP AT <mod_elem_tab> INTO <table1_wa>. READ TABLE total WITH
KEY <f1_wax> BINARY SEARCH. h_ix = sy-tabix. IF x_header-ptfrkyexst NE
space. PERFORM create_wheretab_new USING x_namtab[] <vim_total_struc>
<vim_tot_txt_struc> x_header-maintview 'X' rc. IF rc NE 0.
prt_frky_entries = 1. ELSE. SELECT COUNT(*) FROM (x_header-maintview)
UP TO 1 ROWS WHERE (vim_wheretab). prt_frky_entries = sy-dbcnt. ENDIF.
ELSE. CLEAR prt_frky_entries. ENDIF. IF prt_frky_entries EQ 0. MOVE
<vim_xtotal_text> TO <textline_x>. APPEND <w_texttab> TO <texttab>. ADD
1 TO modified_entries. ENDIF. IF status-delete EQ geloescht. READ TABLE
extract WITH KEY <vim_xtotal_key> TRANSPORTING NO FIELDS. IF sy-subrc
EQ 0. DELETE extract INDEX sy-tabix. ENDIF. ENDIF. DELETE total INDEX
h_ix. ENDLOOP. IF modified_entries NE 0. DO modified_entries TIMES.
READ TABLE <texttab> INTO <w_texttab> INDEX 1. PERFORM
create_wheretab_new USING x_namtab[] <vim_total_struc>
<vim_tot_txt_struc> x_header-texttab space rc. SELECT * FROM
(x_header-texttab) APPENDING TABLE <texttab> WHERE (vim_wheretab).
ENDDO. DELETE (x_header-texttab) FROM TABLE <texttab>. ENDIF. ENDIF.
REFRESH: <mod_elem_tab>. CLEAR modified_entries. LOOP AT total. CHECK
<action> EQ aendern. APPEND <vim_total_struc> TO <mod_elem_tab>. ADD 1
TO modified_entries. IF x_header-texttbexst EQ space OR <action_text>
EQ original. READ TABLE extract WITH KEY <vim_xtotal_key>. <action> =
original. IF sy-subrc = 0. <xact> = original. MODIFY extract INDEX
sy-tabix. ENDIF. MODIFY total. ENDIF. ENDLOOP. IF modified_entries NE
0. UPDATE (x_header-maintview) FROM TABLE <mod_elem_tab>. ENDIF. IF
x_header-texttbexst NE space. REFRESH <texttab>. CLEAR
modified_entries. LOOP AT total. CHECK <action_text> EQ aendern. MOVE
<vim_xtotal_text> TO <textline_x>. APPEND <w_texttab> TO <texttab>. ADD
1 TO modified_entries. READ TABLE extract WITH KEY <vim_xtotal_key>. IF
<action> EQ aendern. <action> = original. <xact> = original. ENDIF.
<action_text> = original. <xact_text> = original. IF sy-subrc = 0.
MODIFY extract INDEX sy-tabix. ENDIF. MODIFY total. ENDLOOP. IF
modified_entries NE 0. UPDATE (x_header-texttab) FROM TABLE <texttab>.
ENDIF. ENDIF. REFRESH: <mod_elem_tab>. CLEAR modified_entries. LOOP AT
total. CHECK <action> EQ neuer_eintrag. APPEND <vim_total_struc> TO
<mod_elem_tab>. ADD 1 TO modified_entries. IF x_header-texttbexst EQ
space OR <action_text> EQ original. READ TABLE extract WITH KEY
<vim_xtotal_key>. <action> = original. IF sy-subrc = 0. <xact> =
original. MODIFY extract INDEX sy-tabix. ENDIF. MODIFY total. ENDIF.
ENDLOOP. IF modified_entries NE 0. INSERT (x_header-maintview) FROM
TABLE <mod_elem_tab>. ENDIF. IF x_header-texttbexst NE space. REFRESH
<texttab>. CLEAR modified_entries. LOOP AT total. CHECK <action_text>
EQ neuer_eintrag. MOVE <vim_xtotal_text> TO <textline_x>. APPEND
<w_texttab> TO <texttab>. ADD 1 TO modified_entries. READ TABLE extract
WITH KEY <vim_xtotal_key>. IF <action> EQ neuer_eintrag. <action> =
original. <xact> = original. ENDIF. <action_text> = original.
<xact_text> = original. IF sy-subrc = 0. MODIFY extract INDEX sy-tabix.
ENDIF. MODIFY total. ENDLOOP. IF modified_entries NE 0. INSERT
(x_header-texttab) FROM TABLE <texttab> ACCEPTING DUPLICATE KEYS. IF
sy-subrc NE 0. UPDATE (x_header-texttab) FROM TABLE <texttab>. ENDIF.
ENDIF. ENDIF. CLEAR: <status>-upd_flag, <status>-upd_checkd. MESSAGE
s018(sv). ENDFORM. FORM table_read_single_entry. DATA: tab TYPE REF TO
data, texttab TYPE REF TO data, textline TYPE REF TO data.
FIELD-SYMBOLS: <tab> TYPE STANDARD TABLE, <texttab> TYPE STANDARD
TABLE, <textline> TYPE ANY, <textline_x> TYPE x. CREATE DATA tab TYPE
STANDARD TABLE OF (x_header-maintview). ASSIGN tab->* TO <tab>. CALL
FUNCTION 'DB_SELECT_GENERIC_TABLE' EXPORTING tablename =
x_header-maintview genkey = <f1_x> genkey_ln = x_header-keylen TABLES
inttab = <tab> EXCEPTIONS db_error = 12 not_found = 04 wrong_param =
08. IF sy-subrc > 4. RAISE get_table_error. ENDIF. READ TABLE <tab>
INTO <table1> INDEX 1. IF sy-subrc <> 0. MOVE <initial> TO <table1>.
ENDIF. IF x_header-texttbexst NE space. CREATE DATA texttab TYPE
STANDARD TABLE OF (x_header-texttab). CREATE DATA textline TYPE
(x_header-texttab). ASSIGN: texttab->* TO <texttab>, textline->* TO
<textline>, <textline> TO <textline_x> CASTING. CALL FUNCTION
'DB_SELECT_GENERIC_TABLE' EXPORTING tablename = x_header-texttab genkey
= <textkey_x> genkey_ln = x_header-textkeylen TABLES inttab = <texttab>
EXCEPTIONS db_error = 12 not_found = 04 wrong_param = 08. IF sy-subrc >
4. RAISE get_table_error. ENDIF. READ TABLE <texttab> INTO
<table1_text> INDEX 1. IF sy-subrc <> 0. MOVE <text_initial> TO
<table1_text>. CLEAR sy-subrc. ENDIF. ENDIF. ENDFORM. FORM
set_txt_update_flag. IF <textkey_x> EQ <initial_textkey_x> OR
status-action EQ kopieren OR neuer EQ 'J' OR <xact> EQ leer OR (
temporal_delimitation_happened EQ 'X' AND x_header-delmdtflag EQ 'B' ).
PERFORM fill_texttab_key_uc USING <table1> <table1_text>. ENDIF. IF
status-action EQ hinzufuegen. <status>-upd_flag = 'X'. ELSE. TRANSLATE
<status>-upd_flag USING ' TEX'. ENDIF. ENDFORM. FORM fill_texttab_key
USING enti_wa text_wa. FIELD-SYMBOLS: <enti>, <text>. DATA: index TYPE
i. LOOP AT x_namtab WHERE texttabfld NE space AND keyflag NE space.
index = x_namtab-position - x_header-tablen. ASSIGN
text_wa+index(x_namtab-flength) TO <text>. IF x_namtab-primtabkey EQ
space. MOVE sy-langu TO <text>. ELSE. index = x_namtab-primtabkey. READ
TABLE x_namtab INDEX index. IF sy-subrc EQ 0. ASSIGN
enti_wa+x_namtab-position(x_namtab-flength) TO <enti>. MOVE <enti> TO
<text>. ENDIF. ENDIF. ENDLOOP. ENDFORM. FORM fill_texttab_key_uc USING
enti_wa CHANGING text_wa. FIELD-SYMBOLS: <namtab> TYPE vimnamtab,
<namtab2> TYPE vimnamtab, <enti> TYPE ANY, <text> TYPE ANY. DATA: index
TYPE i. LOOP AT x_namtab ASSIGNING <namtab> WHERE texttabfld NE space
AND keyflag NE space. ASSIGN COMPONENT <namtab>-viewfield OF STRUCTURE
text_wa TO <text>. IF <namtab>-primtabkey EQ space. MOVE sy-langu TO
<text>. ELSE. index = <namtab>-primtabkey. READ TABLE x_namtab
ASSIGNING <namtab2> INDEX index. IF sy-subrc EQ 0. ASSIGN COMPONENT
<namtab2>-viewfield OF STRUCTURE enti_wa TO <enti>. MOVE <enti> TO
<text>. ENDIF. ENDIF. ENDLOOP. ENDFORM. FORM create_wheretab_new USING
cw_namtab LIKE x_namtab[] total_struc TYPE any total_txt_struc TYPE any
value(cw_table) LIKE vimdesc-viewname value(cw_enti_key) TYPE xfeld
cw_rc TYPE i. DATA: cw_sellist LIKE vimsellist OCCURS 10, cw_sel LIKE
vimsellist, first(1) TYPE c VALUE 'X', w_namtab TYPE vimnamtab.
FIELD-SYMBOLS: <cw_value> TYPE ANY, <w_namtab2> TYPE vimnamtab. LOOP AT
cw_namtab INTO w_namtab WHERE keyflag NE space AND texttabfld NE space
AND primtabkey NE 0. CHECK w_namtab-datatype NE 'CLNT' OR first EQ
space. TRANSLATE first USING 'X '. IF cw_enti_key NE space. READ TABLE
cw_namtab INDEX w_namtab-primtabkey ASSIGNING <w_namtab2>. ASSIGN
COMPONENT <w_namtab2>-viewfield OF STRUCTURE total_struc TO <cw_value>.
cw_sel-viewfield = <w_namtab2>-viewfield. ELSE. ASSIGN COMPONENT
w_namtab-viewfield OF STRUCTURE total_txt_struc TO <cw_value>.
cw_sel-viewfield = w_namtab-viewfield. ENDIF. cw_sel-tabix = sy-tabix.
cw_sel-operator = 'EQ'. cw_sel-and_or = 'AND'. CALL FUNCTION
'VIEW_CONVERSION_OUTPUT' EXPORTING tabname = cw_table fieldname =
cw_sel-viewfield value_intern = <cw_value> outputlen =
w_namtab-outputlen intlen = w_namtab-flength IMPORTING value_extern =
cw_sel-value. IF cw_sel-value EQ space. cw_sel-initial = 'X'. ENDIF.
CASE w_namtab-inttype. WHEN 'F'. cw_sel-fltp_value = <cw_value>. WHEN
'D'. cw_sel-date_value = <cw_value>. WHEN 'T'. cw_sel-time_value =
<cw_value>. WHEN 'P'. cw_sel-pckd_value(w_namtab-flength) = <cw_value>.
WHEN 'N'. cw_sel-numc_value(w_namtab-flength) = <cw_value>. WHEN 'C'.
cw_sel-invd_value(w_namtab-flength) = <cw_value>. WHEN 'I'.
cw_sel-int4_value = <cw_value>. WHEN 'X'. CASE w_namtab-datatype. WHEN
'INT1'. cw_sel-int1_value = <cw_value>. WHEN 'INT2'. cw_sel-int2_value
= <cw_value>. WHEN 'INT4'. cw_sel-int4_value = <cw_value>. WHEN 'RAW'.
cw_sel-raw_value(w_namtab-flength) = <cw_value>. ENDCASE. ENDCASE.
cw_sel-converted = 'X'. APPEND cw_sel TO cw_sellist. CLEAR cw_sel.
ENDLOOP. DESCRIBE TABLE cw_sellist. READ TABLE cw_sellist INTO cw_sel
INDEX sy-tfill. IF cw_sel-and_or NE space. CLEAR cw_sel-and_or. MODIFY
cw_sellist INDEX sy-tfill FROM cw_sel. ENDIF. CALL FUNCTION
'VIEW_FILL_WHERETAB' EXPORTING tablename = cw_table
only_cnds_for_keyflds = 'X' TABLES sellist = cw_sellist wheretab =
vim_wheretab x_namtab = cw_namtab EXCEPTIONS no_conditions_for_table =
01. cw_rc = sy-subrc. ENDFORM. FORM create_wheretab TABLES cw_namtab
STRUCTURE vimnamtab USING value(cw_total) value(cw_table) LIKE
vimdesc-viewname value(cw_enti_key) TYPE c cw_rc TYPE i. DATA:
cw_sellist LIKE vimsellist OCCURS 10, cw_sel LIKE vimsellist, first(1)
TYPE c VALUE 'X'. FIELD-SYMBOLS: <cw_value>. LOOP AT cw_namtab WHERE
keyflag NE space AND texttabfld NE space AND primtabkey NE 0. CHECK
cw_namtab-datatype NE 'CLNT' OR first EQ space. TRANSLATE first USING
'X '. IF cw_enti_key EQ space. SUBTRACT x_header-tablen FROM
cw_namtab-position. ENDIF. ASSIGN
cw_total+cw_namtab-position(cw_namtab-flength) TO <cw_value>. IF
cw_enti_key NE space. READ TABLE cw_namtab INDEX cw_namtab-primtabkey.
ENDIF. cw_sel-viewfield = cw_namtab-viewfield. cw_sel-tabix = sy-tabix.
cw_sel-operator = 'EQ'. cw_sel-and_or = 'AND'. CALL FUNCTION
'VIEW_CONVERSION_OUTPUT' EXPORTING value_intern = <cw_value> inttype =
cw_namtab-inttype datatype = cw_namtab-datatype decimals =
cw_namtab-decimals convexit = cw_namtab-convexit sign = cw_namtab-sign
outputlen = cw_namtab-outputlen intlen = cw_namtab-flength IMPORTING
value_extern = cw_sel-value. IF cw_sel-value EQ space. cw_sel-initial =
'X'. ENDIF. CLEAR cw_sel-converted. APPEND cw_sel TO cw_sellist.
ENDLOOP. DESCRIBE TABLE cw_sellist. READ TABLE cw_sellist INTO cw_sel
INDEX sy-tfill. IF cw_sel-and_or NE space. CLEAR cw_sel-and_or. MODIFY
cw_sellist INDEX sy-tfill FROM cw_sel. ENDIF. CALL FUNCTION
'VIEW_FILL_WHERETAB' EXPORTING tablename = cw_table
only_cnds_for_keyflds = 'X' TABLES sellist = cw_sellist wheretab =
vim_wheretab x_namtab = cw_namtab EXCEPTIONS no_conditions_for_table =
01. cw_rc = sy-subrc. ENDFORM. FORM tableframe TABLES header STRUCTURE
vimdesc namtab STRUCTURE vimnamtab dbasellist STRUCTURE vimsellist
dplsellist STRUCTURE vimsellist exclcuafunct STRUCTURE vimexclfun USING
corrnumber viewaction viewname. DATA: enqueue_processed TYPE c,
table_type(11) TYPE c, table_length TYPE i. READ TABLE header INDEX 1.
table_length = header-tablen / cl_abap_char_utilities=>charsize + 2. IF
header-texttbexst NE space. table_length = table_length +
header-texttablen / cl_abap_char_utilities=>charsize + 1. ENDIF. IF
table_length LE ultra_short_tab. MOVE 'ULTRA_SHORT' TO table_type.
FREE: extract_vs, total_vs, extract_s, total_s, extract_m, total_m,
extract_l, total_l, extract_vl, total_vl, extract_ul, total_ul. ELSEIF
table_length LE very_short_tab. MOVE 'VERY_SHORT' TO table_type. FREE:
extract_us, total_us, extract_s, total_s, extract_m, total_m,
extract_l, total_l, extract_vl, total_vl, extract_ul, total_ul. ELSEIF
table_length LE short_tab. MOVE 'SHORT' TO table_type. FREE:
extract_us, total_us, extract_vs, total_vs, extract_m, total_m,
extract_l, total_l, extract_vl, total_vl, extract_ul, total_ul. ELSEIF
table_length LE middle_tab. MOVE 'MIDDLE' TO table_type. FREE:
extract_us, total_us, extract_vs, total_vs, extract_s, total_s,
extract_l, total_l, extract_vl, total_vl, extract_ul, total_ul. ELSEIF
table_length LE long_tab. MOVE 'LONG' TO table_type. FREE: extract_us,
total_us, extract_vs, total_vs, extract_s, total_s, extract_m, total_m,
extract_vl, total_vl, extract_ul, total_ul. ELSEIF table_length LE
very_long_tab. MOVE 'VERY_LONG' TO table_type. FREE: extract_us,
total_us, extract_vs, total_vs, extract_s, total_s, extract_m, total_m,
extract_l, total_l, extract_ul, total_ul. ELSEIF table_length LE
ultra_long_tab. MOVE 'ULTRA_LONG' TO table_type. FREE: extract_us,
total_us, extract_vs, total_vs, extract_s, total_s, extract_m, total_m,
extract_l, total_l, extract_vl, total_vl. ENDIF. maint_mode =
viewaction. corr_nbr = corrnumber. DO. PERFORM table_call_function
TABLES dbasellist dplsellist header namtab exclcuafunct USING read
table_type update_flag. CASE sy-subrc. WHEN 1. RAISE
missing_corr_number. ENDCASE. DO. DO. PERFORM table_call_function
TABLES dbasellist dplsellist header namtab exclcuafunct USING edit
table_type <status>-upd_flag. CASE sy-subrc. WHEN 1. IF maint_mode EQ
transportieren AND viewaction EQ aendern. MOVE viewaction TO
maint_mode. ELSE. RAISE missing_corr_number. ENDIF. WHEN OTHERS. EXIT.
ENDCASE. ENDDO. IF function EQ back. function = end. ENDIF. IF (
function EQ switch_to_show_mode OR function EQ get_another_view OR
function EQ switch_transp_to_upd_mode OR function EQ end ) AND
<status>-upd_flag NE space. PERFORM beenden. CASE sy-subrc. WHEN 0.
PERFORM table_call_function TABLES dbasellist dplsellist header namtab
exclcuafunct USING save table_type <status>-upd_flag. CASE sy-subrc.
WHEN 0. IF <status>-upd_flag EQ space. EXIT. ENDIF. WHEN 1. RAISE
missing_corr_number. WHEN 3. ENDCASE. WHEN 8. EXIT. WHEN 12. ENDCASE.
ELSEIF function EQ transport. IF <status>-upd_flag NE space. PERFORM
transportieren. CASE sy-subrc. WHEN 0. PERFORM table_call_function
TABLES dbasellist dplsellist header namtab exclcuafunct USING save
table_type <status>-upd_flag. CASE sy-subrc. WHEN 0. maint_mode =
transportieren. WHEN 1. RAISE missing_corr_number. WHEN 3. ENDCASE.
WHEN 8. EXIT. WHEN 12. ENDCASE. ELSE. maint_mode = transportieren.
ENDIF. ELSEIF function EQ reset_list OR function EQ reset_entry OR
function EQ save. PERFORM table_call_function TABLES dbasellist
dplsellist header namtab exclcuafunct USING function table_type
<status>-upd_flag. CASE sy-subrc. WHEN 1. RAISE missing_corr_number.
WHEN 3. ENDCASE. ELSE. EXIT. ENDIF. ENDDO. CASE function. WHEN
switch_to_show_mode. PERFORM enqueue USING 'D' header-frm_af_enq. CLEAR
enqueue_processed. maint_mode = anzeigen. WHEN switch_to_update_mode.
PERFORM enqueue USING 'E' header-frm_af_enq. IF sy-subrc EQ 0. MOVE 'X'
TO enqueue_processed. maint_mode = aendern. ENDIF. WHEN
switch_transp_to_upd_mode. maint_mode = aendern. WHEN transport.
maint_mode = transportieren. WHEN OTHERS. IF enqueue_processed NE
space. PERFORM enqueue USING 'D' header-frm_af_enq. ENDIF. PERFORM
before_leaving_frame_function USING header-frm_bf_end. EXIT. ENDCASE.
ENDDO. ENDFORM. FORM tableproc. IF last_view_info NE view_name. PERFORM
initialisieren. ENDIF. PERFORM justify_action_mode. MOVE: view_action
TO maint_mode, corr_number TO corr_nbr. IF fcode EQ read OR fcode EQ
read_and_edit. PERFORM prepare_read_request. IF x_header-frm_rp_get NE
space. PERFORM (x_header-frm_rp_get) IN PROGRAM (sy-repid). ELSE.
PERFORM table_get_data. ENDIF. IF fcode EQ read_and_edit. fcode = edit.
ENDIF. ENDIF. CASE fcode. WHEN edit. PERFORM call_dynpro. PERFORM
check_upd. WHEN save. PERFORM prepare_saving. IF <status>-upd_flag NE
space. IF x_header-frm_rp_upd NE space. PERFORM (x_header-frm_rp_upd)
IN PROGRAM. ELSE. IF sy-subrc EQ 0. PERFORM table_db_upd. ENDIF. ENDIF.
PERFORM after_saving. ENDIF. WHEN reset_list. PERFORM reset_entries
USING list_bild. WHEN reset_entry. PERFORM reset_entries USING
detail_bild. ENDCASE. MOVE: <status>-upd_flag TO update_required,
function TO ucomm. ENDFORM. FORM replace_forbidden_chars USING
value(forbidden_chars) name. FIELD-SYMBOLS: <code>. DATA:
suspect_char(1) TYPE c, code(2) TYPE c. DO. IF name CA forbidden_chars.
ASSIGN name+sy-fdpos(1) TO <code>. MOVE <code> TO suspect_char. ASSIGN
<code> TO <code> TYPE 'X'. MOVE <code> TO code. REPLACE suspect_char
WITH code INTO name. ELSE. EXIT. ENDIF. ENDDO. ENDFORM. FORM
vim_get_text_keyflds USING p_texttabname TYPE tabname CHANGING
p_text_keyflds TYPE vim_flds_tab_type. STATICS: texttabname_save TYPE
tabname, text_keyflds_save TYPE vim_flds_tab_type. FIELD-SYMBOLS:
<namtab> TYPE vimnamtab. REFRESH p_text_keyflds. IF texttabname_save =
p_texttabname. APPEND LINES OF text_keyflds_save TO p_text_keyflds.
ELSE. texttabname_save = p_texttabname. REFRESH text_keyflds_save. LOOP
AT x_namtab ASSIGNING <namtab> WHERE texttabfld NE space AND keyflag NE
space. APPEND <namtab>-viewfield TO p_text_keyflds. ENDLOOP. APPEND
LINES OF p_text_keyflds TO text_keyflds_save. ENDIF. ENDFORM. MODULE
SET_TXT_UPDATE_FLAG. PERFORM SET_TXT_UPDATE_FLAG. ENDMODULE. FORM
vim_get_texttab_data TABLES langus STRUCTURE h_t002 CHANGING texttab
TYPE table. DATA: tgd_sellist LIKE vimsellist OCCURS 10, tgd_sel LIKE
vimsellist, wheretab_line LIKE vimwheretb, spras_value(3) TYPE c,
keylen TYPE i, l TYPE i, sellist_l TYPE i, tbx TYPE i, and_or_str(6)
TYPE c, left_par(1) TYPE c, tmp_texttab TYPE REF TO data,
tmp_texttab_wa TYPE REF TO data, texttab_tabix LIKE sy-tabix, align1
type f, texttab_wa TYPE vim_line_ul, align2 type f, view_wa TYPE
tabl8000, map_error TYPE xfeld. FIELD-SYMBOLS: <tmp_texttab> TYPE
STANDARD TABLE, <tmp_texttab_wa> TYPE ANY, <tmp_texttab_wax> TYPE x,
<view_key> TYPE x, <next_spras> TYPE spras, <curr_spras> TYPE spras,
<h_texttab> TYPE x, <h_texttab_wa> TYPE x, <viewkey_in_texttab> TYPE x,
<texttab_struc> TYPE ANY. CREATE DATA: tmp_texttab TYPE STANDARD TABLE
OF (x_header-texttab), tmp_texttab_wa TYPE (x_header-texttab). ASSIGN:
tmp_texttab->* TO <tmp_texttab>, tmp_texttab_wa->* TO <tmp_texttab_wa>,
<tmp_texttab_wa> TO <tmp_texttab_wax> CASTING. IF x_header-selection NE
space. LOOP AT dba_sellist INTO tgd_sel WHERE value <> space OR initial
= 'X'. LOOP AT x_namtab WHERE viewfield EQ tgd_sel-viewfield AND
keyflag NE space AND txttabfldn NE space. tgd_sel-viewfield =
x_namtab-txttabfldn. tgd_sel-tabix = sy-tabix. APPEND tgd_sel TO
tgd_sellist. EXIT. ENDLOOP. ENDLOOP. ENDIF. DESCRIBE TABLE tgd_sellist
LINES sellist_l. IF sellist_l > 0. READ TABLE tgd_sellist INDEX
sellist_l INTO tgd_sel. IF tgd_sel-and_or NE space. CLEAR
tgd_sel-and_or. MODIFY tgd_sellist INDEX sellist_l FROM tgd_sel. ENDIF.
CALL FUNCTION 'VIEW_FILL_WHERETAB' EXPORTING tablename =
x_header-texttab only_cnds_for_keyflds = 'X' is_texttable = 'X' TABLES
sellist = tgd_sellist wheretab = vim_wheretab x_namtab = x_namtab
EXCEPTIONS no_conditions_for_table = 01. IF sy-subrc = 1. sellist_l =
0. ENDIF. ELSE. REFRESH vim_wheretab. ENDIF. DESCRIBE TABLE langus
LINES l. IF l > 1. and_or_str = 'OR'. IF sellist_l > 0. left_par = '('.
ENDIF. ENDIF. tbx = 1. spras_value = ''' '''. LOOP AT langus.
spras_value+1(1) = langus-spras. IF tbx = l. IF l > 1 AND sellist_l >
0. and_or_str = ' ) AND'. ELSEIF l = 1 AND sellist_l > 0. and_or_str =
' AND'. ELSE. CLEAR and_or_str. ENDIF. ENDIF. CONCATENATE left_par
x_header-sprasfield 'EQ' spras_value and_or_str INTO wheretab_line
SEPARATED BY space. INSERT wheretab_line INTO vim_wheretab INDEX tbx.
CLEAR left_par. tbx = tbx + 1. ENDLOOP. SELECT * FROM
(x_header-texttab) INTO TABLE <tmp_texttab> WHERE (vim_wheretab). IF
x_header-delmdtflag <> space AND x_header-ptfrkyexst = 'X'. keylen =
x_header-after_keyc - vim_datum_length *
cl_abap_char_utilities=>charsize. ELSE. keylen = x_header-after_keyc.
ENDIF. ASSIGN: view_wa(keylen) TO <view_key>, texttab_wa TO
<h_texttab_wa> CASTING, <h_texttab_wa>(keylen) TO <viewkey_in_texttab>,
<h_texttab_wa>+keylen(x_header-texttablen) TO <h_texttab>, <h_texttab>
TO <texttab_struc> CASTING TYPE (x_header-texttab), COMPONENT
x_header-sprasfield OF STRUCTURE <texttab_struc> TO <next_spras>,
COMPONENT x_header-sprasfield OF STRUCTURE <tmp_texttab_wa> TO
<curr_spras>. LOOP AT <tmp_texttab> INTO <tmp_texttab_wa>. PERFORM
map_texttabkey_to_viewkey TABLES x_namtab USING x_header
<tmp_texttab_wax> x_header-textkeylen x_header-genertxtrp CHANGING
<view_key> map_error. CHECK map_error = space. CLEAR texttab_wa. READ
TABLE texttab WITH KEY <view_key> INTO texttab_wa BINARY SEARCH.
texttab_tabix = sy-tabix. IF sy-subrc = 0 AND <viewkey_in_texttab> =
<view_key> AND <next_spras> < <curr_spras>. LOOP AT texttab FROM
texttab_tabix INTO texttab_wa. IF <viewkey_in_texttab> <> <view_key> OR
<next_spras> >= <curr_spras>. texttab_tabix = sy-tabix. EXIT. ELSEIF
<next_spras> < <curr_spras>. texttab_tabix = sy-tabix + 1. ENDIF.
ENDLOOP. ENDIF. IF <next_spras> <> <curr_spras> OR <viewkey_in_texttab>
<> <view_key>. CLEAR texttab_wa. <viewkey_in_texttab> = <view_key>.
<texttab_struc> = <tmp_texttab_wa>. INSERT texttab_wa INTO texttab
INDEX texttab_tabix. ELSE. <texttab_struc> = <tmp_texttab_wa>. MODIFY
texttab FROM texttab_wa INDEX texttab_tabix. ENDIF. ENDLOOP. ENDFORM.
FORM vim_read_texttab_entry. DATA: texttab_wa TYPE vim_line_ul,
texttab_tabix LIKE sy-tabix, keylen TYPE i, offset TYPE i,
modify_texttab(1) TYPE c, tmp_texttab TYPE ref to data, w_tmp_texttab
type ref to data. FIELD-SYMBOLS: <h_texttab_wa> type x,
<viewkey_in_texttab> type x, <texttab_key> type x, <texttab_fields>,
<texttab_action> type c, <extract_key> type x, <tmp_texttab> type
standard table, <w_tmp_texttab> type any, <w_tmp_texttab_x> type x. IF
x_header-delmdtflag <> space AND x_header-ptfrkyexst = 'X'. ASSIGN
<vim_ext_mkey_beforex> TO <extract_key>. keylen = x_header-keylen -
vim_datum_length * cl_abap_char_utilities=>charsize. ELSE. ASSIGN
<vim_xextract_key> TO <extract_key>. keylen = x_header-after_keyc.
ENDIF. READ TABLE <vim_texttab> WITH KEY <extract_key> BINARY SEARCH
TRANSPORTING NO FIELDS. IF sy-subrc = 0. texttab_tabix = sy-tabix.
ELSE. EXIT. ENDIF. ASSIGN: texttab_wa TO <h_texttab_wa> casting,
<h_texttab_wa>+keylen(x_header-textkeylen) TO <texttab_key>,
<h_texttab_wa>+keylen(x_header-texttablen) TO <texttab_fields>. offset
= ( keylen + x_header-texttablen ) / cl_abap_char_utilities=>charsize.
ASSIGN texttab_wa+offset(1) TO <texttab_action>. create data
tmp_texttab type standard table of (x_header-texttab). create data
w_tmp_texttab type (x_header-texttab). assign: tmp_texttab->* to
<tmp_texttab>, w_tmp_texttab->* to <w_tmp_texttab>, <w_tmp_texttab> to
<w_tmp_texttab_x> casting. LOOP AT <vim_texttab> FROM texttab_tabix
INTO texttab_wa. IF <viewkey_in_texttab> <> <extract_key>. EXIT. ENDIF.
IF <texttab_action> = neuer_eintrag. DELETE <vim_texttab>.
modify_texttab = 'X'. ELSEIF <texttab_action> <> original. refresh
<tmp_texttab>. CALL FUNCTION 'DB_SELECT_GENERIC_TABLE' EXPORTING genkey
= <texttab_key> genkey_ln = x_header-textkeylen tablename =
x_header-texttab TABLES inttab = <tmp_texttab> EXCEPTIONS db_error = 12
not_found = 04 wrong_param = 08. IF sy-subrc > 4. RAISE
get_table_error. ENDIF. READ TABLE <tmp_texttab> into <w_tmp_texttab>
INDEX 1. IF sy-subrc = 0. <texttab_fields> =
<w_tmp_texttab_x>(x_header-texttablen). <texttab_action> = original.
MODIFY <vim_texttab> FROM texttab_wa. modify_texttab = 'X'. ELSE.
DELETE <vim_texttab>. modify_texttab = 'X'. ENDIF. ENDIF. ENDLOOP. IF
modify_texttab = 'X'. MODIFY vim_texttab_container INDEX
vim_texttab_container_index. CLEAR sy-subrc. ELSE. sy-subrc = 4. ENDIF.
ENDFORM. FORM vim_texttab_db_update. DATA: modified_entries TYPE i,
texttab_modified(1) TYPE c, keylen TYPE i, offset TYPE i, align type f,
texttab_wa TYPE vim_line_ul, tmp_texttab TYPE REF TO data,
w_tmp_texttab TYPE REF TO data. FIELD-SYMBOLS: <tmp_texttab> TYPE
STANDARD TABLE, <w_tmp_texttab> TYPE ANY, <h_texttab_wa> TYPE x,
<h_texttab_fields> TYPE x, <texttab_fields> TYPE ANY, <texttab_action>.
CLEAR texttab_modified. CHECK x_header-texttbexst <> space. IF
x_header-delmdtflag <> space AND x_header-ptfrkyexst = 'X'. keylen =
x_header-after_keyc - vim_datum_length *
cl_abap_char_utilities=>charsize. ELSE. keylen = x_header-after_keyc.
ENDIF. CREATE DATA: tmp_texttab TYPE STANDARD TABLE OF
(x_header-texttab), w_tmp_texttab TYPE (x_header-texttab). ASSIGN:
tmp_texttab->* TO <tmp_texttab>, w_tmp_texttab->* TO <w_tmp_texttab>,
texttab_wa TO <h_texttab_wa> CASTING,
<h_texttab_wa>+keylen(x_header-texttablen) TO <h_texttab_fields>,
<h_texttab_fields> TO <texttab_fields> CASTING TYPE (x_header-texttab).
offset = ( keylen + x_header-aft_txttbc ) /
cl_abap_char_utilities=>charsize. ASSIGN texttab_wa+offset(1) TO
<texttab_action>. LOOP AT <vim_texttab> INTO texttab_wa. CHECK
<texttab_action> EQ geloescht OR <texttab_action> EQ neuer_geloescht OR
<texttab_action> EQ update_geloescht. DELETE <vim_texttab>.
texttab_modified = 'X'. ENDLOOP. CLEAR modified_entries. REFRESH
<tmp_texttab>. LOOP AT <vim_texttab> INTO texttab_wa. CHECK
<texttab_action> EQ aendern. APPEND <texttab_fields> TO <tmp_texttab>.
modified_entries = modified_entries + 1. <texttab_action> = original.
MODIFY <vim_texttab> FROM texttab_wa. ENDLOOP. IF modified_entries > 0.
UPDATE (x_header-texttab) FROM TABLE <tmp_texttab>. texttab_modified =
'X'. ENDIF. CLEAR modified_entries. REFRESH <tmp_texttab>. LOOP AT
<vim_texttab> INTO texttab_wa. CHECK <texttab_action> EQ neuer_eintrag.
APPEND <texttab_fields> TO <tmp_texttab>. modified_entries =
modified_entries + 1. <texttab_action> = original. MODIFY <vim_texttab>
FROM texttab_wa. ENDLOOP. IF modified_entries > 0. INSERT
(x_header-texttab) FROM TABLE <tmp_texttab> ACCEPTING DUPLICATE KEYS.
texttab_modified = 'X'. ENDIF. IF texttab_modified = 'X'. MODIFY
vim_texttab_container INDEX vim_texttab_container_index. ENDIF.
ENDFORM. FORM vim_read_texttab_all_langus. DATA: langus_selected(1)
TYPE c, curr_sptxt LIKE t002t-sptxt, sel_langus LIKE h_t002 OCCURS 0
WITH HEADER LINE. CALL FUNCTION 'VIEW_GET_LANGUAGES' EXPORTING
all_without_selection = 'X' IMPORTING languages_selected =
langus_selected curr_sptxt = curr_sptxt TABLES languages = sel_langus.
IF x_header-frm_tl_get NE space. PERFORM (x_header-frm_tl_get) IN
PROGRAM (x_header-fpoolname) TABLES sel_langus. ELSE. PERFORM
vim_read_texttab_for_langus TABLES sel_langus USING ' '. ENDIF.
ENDFORM. FORM vim_call_ltext_exit USING maint_mode TYPE c exitform TYPE
vimfrmname CHANGING texttable_entry TYPE vimty_textmaint_record
modified TYPE c. DATA: text_wa TYPE vim_line_ul, textmaint_field TYPE
vimty_textfield, pgm_name LIKE sy-repid, offset LIKE sy-fdpos.
FIELD-SYMBOLS: <text_wa> TYPE x, <text_wa_struc> TYPE ANY, <texttabkey>
TYPE x, <txtfld> TYPE ANY. CLEAR modified. IF vim_internal_ltext_call =
space. PERFORM (exitform) IN PROGRAM (sy-repid). ELSE. READ TABLE
x_header INDEX 1. ASSIGN: text_wa TO <text_wa> CASTING, <text_wa> TO
<text_wa_struc> CASTING TYPE (x_header-texttab), texttable_entry-keys
TO <texttabkey> CASTING. PERFORM map_viewkey_to_texttabkey TABLES
x_namtab USING x_header texttable_entry-spras <texttabkey> CHANGING
<text_wa>. LOOP AT texttable_entry-texttab INTO textmaint_field. READ
TABLE x_namtab INDEX textmaint_field-namtab_idx. IF x_namtab-lowercase
= space. TRANSLATE textmaint_field-text TO UPPER CASE. ENDIF. IF
x_namtab-txttabfldn = space. ASSIGN COMPONENT x_namtab-bastabfld OF
STRUCTURE <text_wa_struc> TO <txtfld>. ELSE. ASSIGN COMPONENT
x_namtab-txttabfldn OF STRUCTURE <text_wa_struc> TO <txtfld>. ENDIF.
<txtfld> = textmaint_field-text. ENDLOOP. PERFORM (exitform) IN PROGRAM
(x_header-fpoolname) USING maint_mode CHANGING text_wa modified. IF
modified = 'X'. IF maint_mode = 'U'. LOOP AT texttable_entry-texttab
INTO textmaint_field. READ TABLE x_namtab INDEX
textmaint_field-namtab_idx. ASSIGN COMPONENT x_namtab-txttabfldn OF
STRUCTURE <text_wa_struc> TO <txtfld>. textmaint_field-text = <txtfld>.
MODIFY texttable_entry-texttab FROM textmaint_field. ENDLOOP.
texttable_entry-action = 'X'. ELSE. CLEAR modified. ENDIF. ENDIF.
ENDIF. ENDFORM. FORM vim_set_languages. DATA: dummy_langus LIKE h_t002
OCCURS 0. CALL FUNCTION 'VIEW_GET_LANGUAGES' EXPORTING new_selection =
'X' TABLES languages = dummy_langus EXCEPTIONS no_languages_possible =
1. IF sy-subrc = 1. MESSAGE s160(sv). ENDIF. ENDFORM. FORM
vim_reset_texttab USING viewname LIKE tvdir-tabname. READ TABLE
vim_texttab_container WITH KEY viewname = viewname BINARY SEARCH. IF
sy-subrc = 0. FREE vim_texttab_container-tabdata-tab_us. FREE
vim_texttab_container-tabdata-tab_vs. FREE
vim_texttab_container-tabdata-tab_s. FREE
vim_texttab_container-tabdata-tab_m. FREE
vim_texttab_container-tabdata-tab_l. FREE
vim_texttab_container-tabdata-tab_vl. FREE
vim_texttab_container-tabdata-tab_ul. FREE
vim_texttab_container-sel_langus. CLEAR
vim_texttab_container-all_langus. MODIFY vim_texttab_container INDEX
sy-tabix. ENDIF. ENDFORM. FORM vim_multi_langu_text_maint. DATA:
langus_selected(1) TYPE c, curr_sptxt LIKE t002t-sptxt, sel_langus LIKE
h_t002 OCCURS 0 WITH HEADER LINE, texttab_for_output TYPE
vimty_multilangu_texttab, maint_mode(1) TYPE c, textmodif(1) TYPE c,
f_called_by_viewmaint TYPE c. CALL FUNCTION 'VIEW_GET_LANGUAGES'
IMPORTING languages_selected = langus_selected curr_sptxt = curr_sptxt
TABLES languages = sel_langus EXCEPTIONS no_languages_possible = 1. IF
sy-subrc = 1. MESSAGE s160(sv). EXIT. ELSEIF langus_selected = ' '.
MESSAGE s153(sv). EXIT. ENDIF. IF x_header-frm_tl_get NE space. PERFORM
(x_header-frm_tl_get) IN PROGRAM (x_header-fpoolname) TABLES
sel_langus. ELSE. PERFORM vim_read_texttab_for_langus TABLES sel_langus
USING ' '. ENDIF. REFRESH texttab_for_output. PERFORM
vim_fill_texttab_for_maint TABLES sel_langus USING curr_sptxt CHANGING
texttab_for_output. IF status-action EQ anzeigen OR status-action EQ
transportieren. maint_mode = 'R'. ELSE. maint_mode = 'U'. ENDIF. IF
x_namtab IS NOT INITIAL AND x_header IS NOT INITIAL.
f_called_by_viewmaint = 'X'. ENDIF. CALL FUNCTION
'VIEW_MULTI_LANGU_TEXT_MAINT' EXPORTING mode = maint_mode
ltext_exit_form = x_header-frm_tltext called_by_viewmaint =
f_called_by_viewmaint IMPORTING vim_texttable_modified = textmodif
TABLES vim_d0100_fielddescr = vim_d0100_fdescr_ini vim_texttable =
texttab_for_output x_header = x_header x_namtab = x_namtab. IF
maint_mode = 'U' AND textmodif = 'X'. PERFORM vim_update_texttab USING
texttab_for_output. MODIFY vim_texttab_container INDEX
vim_texttab_container_index. ENDIF. IF status-mode = list_bild. LOOP AT
extract. CHECK <xmark> = markiert. CLEAR <xmark>. MODIFY extract.
mark_extract = mark_extract - 1. READ TABLE total WITH KEY
<vim_xextract_key> BINARY SEARCH. IF sy-subrc = 0 AND <mark> =
markiert. CLEAR <mark>. MODIFY total INDEX sy-tabix. mark_total =
mark_total - 1. ENDIF. ENDLOOP. ENDIF. ENDFORM. FORM
vim_select_textfields. DATA: nr_of_fields TYPE i. nr_of_fields = 0.
LOOP AT x_namtab WHERE keyflag <> 'X' AND ( texttabfld = 'X' OR
txttabfldn <> space ) AND ( readonly = space OR readonly = 'R' ).
x_namtab-textfldsel = 'X'. nr_of_fields = nr_of_fields + 1. MODIFY
x_namtab. IF nr_of_fields >= vim_max_textfields. EXIT. ENDIF. ENDLOOP.
ENDFORM. FORM vim_initialize_d0100. DATA: fdescr_wa TYPE
vimty_screen_fdescr. REFRESH vim_d0100_fdescr_ini. CLEAR fdescr_wa.
fdescr_wa-active = 'X'. fdescr_wa-name = 'VIM_D0100_WORKAREA-KEY1'.
APPEND fdescr_wa TO vim_d0100_fdescr_ini. CLEAR fdescr_wa-active.
fdescr_wa-name = 'VIM_D0100_WORKAREA-KEY2'. APPEND fdescr_wa TO
vim_d0100_fdescr_ini. fdescr_wa-name = 'VIM_D0100_WORKAREA-KEY3'.
APPEND fdescr_wa TO vim_d0100_fdescr_ini. fdescr_wa-name =
'VIM_D0100_WORKAREA-KEY4'. APPEND fdescr_wa TO vim_d0100_fdescr_ini.
fdescr_wa-name = 'VIM_D0100_WORKAREA-KEY5'. APPEND fdescr_wa TO
vim_d0100_fdescr_ini. fdescr_wa-name = 'VIM_D0100_WORKAREA-KEY6'.
APPEND fdescr_wa TO vim_d0100_fdescr_ini. fdescr_wa-name =
'VIM_D0100_WORKAREA-KEY7'. APPEND fdescr_wa TO vim_d0100_fdescr_ini.
fdescr_wa-name = 'VIM_D0100_WORKAREA-KEY8'. APPEND fdescr_wa TO
vim_d0100_fdescr_ini. fdescr_wa-name = 'VIM_D0100_WORKAREA-KEY9'.
APPEND fdescr_wa TO vim_d0100_fdescr_ini. fdescr_wa-name =
'VIM_D0100_WORKAREA-KEY10'. APPEND fdescr_wa TO vim_d0100_fdescr_ini.
fdescr_wa-vislength = 10. fdescr_wa-active = 'X'. fdescr_wa-name =
'VIM_D0100_WORKAREA-SPTXT'. APPEND fdescr_wa TO vim_d0100_fdescr_ini.
fdescr_wa-name = 'VIM_D0100_WORKAREA-TEXT1'. fdescr_wa-textfld = 'X'.
APPEND fdescr_wa TO vim_d0100_fdescr_ini. CLEAR fdescr_wa-active.
fdescr_wa-textfld = 'X'. fdescr_wa-name = 'VIM_D0100_WORKAREA-TEXT2'.
APPEND fdescr_wa TO vim_d0100_fdescr_ini. fdescr_wa-name =
'VIM_D0100_WORKAREA-TEXT3'. APPEND fdescr_wa TO vim_d0100_fdescr_ini.
fdescr_wa-name = 'VIM_D0100_WORKAREA-TEXT4'. APPEND fdescr_wa TO
vim_d0100_fdescr_ini. fdescr_wa-name = 'VIM_D0100_WORKAREA-TEXT5'.
APPEND fdescr_wa TO vim_d0100_fdescr_ini. fdescr_wa-name =
'VIM_D0100_WORKAREA-TEXT6'. APPEND fdescr_wa TO vim_d0100_fdescr_ini.
fdescr_wa-name = 'VIM_D0100_WORKAREA-TEXT7'. APPEND fdescr_wa TO
vim_d0100_fdescr_ini. fdescr_wa-name = 'VIM_D0100_WORKAREA-TEXT8'.
APPEND fdescr_wa TO vim_d0100_fdescr_ini. ENDFORM. FORM
vim_actualize_d0100. DATA: fdescr_wa TYPE vimty_screen_fdescr,
next_tabix LIKE sy-tabix, nr_of_field TYPE i, tot_keylen TYPE i,
vislen_0(1) TYPE c, max_textlen TYPE i, tmp_len TYPE i, nr_of_text TYPE
i. FIELD-SYMBOLS: <title> LIKE vimnamtab-scrtext. PERFORM
vim_select_textfields. CLEAR: max_textlen, nr_of_text. LOOP AT x_namtab
WHERE textfldsel = 'X'. nr_of_text = nr_of_text + 1. IF max_textlen <
x_namtab-outputlen. max_textlen = x_namtab-outputlen. ENDIF. ENDLOOP.
IF max_textlen > 30. max_textlen = 30. ENDIF. CLEAR: tot_keylen,
nr_of_field, vislen_0. LOOP AT x_namtab WHERE keyflag = 'X' AND
texttabfld <> 'X'. CHECK x_namtab-datatype <> 'CLNT' OR
x_namtab-position > 0. CHECK x_namtab-readonly <> 'S' AND
x_namtab-readonly <> 'H'. CHECK x_header-delmdtflag = space OR
x_header-ptfrkyexst = space OR x_namtab-domname <>
vim_delim_date_domain OR ( x_namtab-rollname NOT in VIM_BEGDA_TYPES and
X_NAMTAB-ROLLNAME not IN vim_endda_types ). nr_of_field = nr_of_field +
1. tot_keylen = tot_keylen + x_namtab-outputlen. IF nr_of_field <=
vim_max_keyfields. READ TABLE vim_d0100_fdescr_ini INDEX nr_of_field
INTO fdescr_wa. fdescr_wa-title = x_namtab-scrtext. fdescr_wa-active =
'X'. fdescr_wa-fixlength = x_namtab-outputlen. tmp_len = tot_keylen +
max_textlen. IF vislen_0 = 'X'. fdescr_wa-vislength = 0. ELSEIF tmp_len
> 70. fdescr_wa-vislength = 70 - max_textlen - ( tot_keylen -
x_namtab-outputlen ). vislen_0 = 'X'. IF fdescr_wa-vislength < 0.
fdescr_wa-vislength = 0. ENDIF. ELSE. fdescr_wa-vislength =
fdescr_wa-fixlength. ENDIF. IF nr_of_field < vim_max_keyfields. MODIFY
vim_d0100_fdescr_ini FROM fdescr_wa INDEX nr_of_field. ENDIF. ELSE.
fdescr_wa-fixlength = fdescr_wa-fixlength + x_namtab-outputlen + 1.
ENDIF. ENDLOOP. IF nr_of_field >= vim_max_keyfields. fdescr_wa-title =
'...'. fdescr_wa-active = 'X'. fdescr_wa-vislength = 0. MODIFY
vim_d0100_fdescr_ini FROM fdescr_wa INDEX vim_max_keyfields. ELSE.
next_tabix = nr_of_field + 1. LOOP AT vim_d0100_fdescr_ini INTO
fdescr_wa FROM next_tabix TO vim_max_keyfields. CLEAR fdescr_wa-active.
fdescr_wa-fixlength = 0. fdescr_wa-vislength = 0. CLEAR
fdescr_wa-title. MODIFY vim_d0100_fdescr_ini FROM fdescr_wa. ENDLOOP.
ENDIF. next_tabix = vim_max_keyfields + 1. LOOP AT x_namtab WHERE
textfldsel = 'X'. IF x_namtab-readonly = space OR x_namtab-readonly =
'R'. next_tabix = next_tabix + 1. READ TABLE vim_d0100_fdescr_ini INDEX
next_tabix INTO fdescr_wa. IF x_namtab-readonly = space.
fdescr_wa-active = 'X'. ELSEIF x_namtab-readonly = 'R'.
fdescr_wa-active = 'R'. ENDIF. fdescr_wa-title = x_namtab-scrtext.
fdescr_wa-fixlength = x_namtab-outputlen. fdescr_wa-vislength =
x_namtab-outputlen. MODIFY vim_d0100_fdescr_ini FROM fdescr_wa INDEX
next_tabix. ENDIF. ENDLOOP. next_tabix = next_tabix + 1. LOOP AT
vim_d0100_fdescr_ini INTO fdescr_wa FROM next_tabix. CLEAR
fdescr_wa-active. fdescr_wa-fixlength = 0. fdescr_wa-vislength = 0.
CLEAR fdescr_wa-title. MODIFY vim_d0100_fdescr_ini FROM fdescr_wa.
ENDLOOP. ENDFORM. FORM vim_read_texttab_for_langus TABLES sel_langus
STRUCTURE h_t002 USING all_langus TYPE c. DATA: diff_langus_exist(1)
TYPE c, diff_langus LIKE h_t002 OCCURS 0 WITH HEADER LINE. IF
vim_texttab_container-all_langus = 'X'. EXIT. ENDIF.
vim_texttab_container-all_langus = all_langus. REFRESH diff_langus.
CLEAR diff_langus_exist. LOOP AT sel_langus. READ TABLE
<vim_read_langus> WITH KEY sel_langus-spras TRANSPORTING NO FIELDS
BINARY SEARCH. IF sy-subrc <> 0. INSERT sel_langus-spras INTO
<vim_read_langus> INDEX sy-tabix. diff_langus = sel_langus-spras.
APPEND diff_langus. diff_langus_exist = 'X'. ENDIF. ENDLOOP. IF
diff_langus_exist = 'X' OR all_langus = 'X'. IF diff_langus_exist =
'X'. PERFORM vim_get_texttab_data TABLES diff_langus CHANGING
<vim_texttab>. ENDIF. MODIFY vim_texttab_container INDEX
vim_texttab_container_index. ENDIF. ENDFORM. FORM
vim_fill_texttab_for_maint TABLES sel_langus STRUCTURE h_t002 USING
curr_sptxt LIKE t002t-sptxt CHANGING texttab_for_maint TYPE
vimty_multilangu_texttab. DATA: textmaint_record TYPE
vimty_textmaint_record, textmaint_field TYPE vimty_textfield, align1
TYPE f, texttab_wa TYPE vim_line_ul, align2 TYPE f, tmp_wa TYPE
tabl8000, condense(1) TYPE c, texttab_tabix LIKE sy-tabix,
extract_index LIKE sy-tabix, keylen type i. FIELD-SYMBOLS:
<extract_key> TYPE x, <next_spras> TYPE spras, <text_rec_key> TYPE x,
<h_texttab_wa> TYPE x, <viewkey_in_texttab> TYPE x, <txtfld> TYPE ANY,
<h_tmp> TYPE x, <tmp_struc> TYPE ANY, <h_texttab> TYPE x,
<texttab_struc> TYPE ANY. IF x_header-delmdtflag <> space AND
x_header-ptfrkyexst = 'X'. condense = 'X'. ASSIGN
<vim_ext_mkey_beforex> TO <extract_key>. keylen = x_header-after_keyc -
vim_datum_length * cl_abap_char_utilities=>charsize. CLEAR
<vim_old_mkey_beforex>. ELSE. ASSIGN <vim_xextract_key> TO
<extract_key>. keylen = x_header-after_keyc. CLEAR condense. ENDIF.
ASSIGN: texttab_wa TO <h_texttab_wa> CASTING, <h_texttab_wa>(keylen) TO
<viewkey_in_texttab>, <h_texttab_wa>+keylen(x_header-texttablen) TO
<h_texttab>, tmp_wa+keylen(x_header-texttablen) TO <h_tmp>, <h_texttab>
TO <texttab_struc> CASTING TYPE (x_header-texttab), <h_tmp> TO
<tmp_struc> CASTING TYPE (x_header-texttab), COMPONENT
x_header-sprasfield OF STRUCTURE <texttab_struc> TO <next_spras>,
textmaint_record-keys TO <text_rec_key> CASTING. IF status-mode =
list_bild. extract_index = 1. ELSE. extract_index = nextline. ENDIF.
LOOP AT extract FROM extract_index. CHECK status-mode = detail_bild OR
<xmark> = markiert. CHECK condense = ' ' OR <vim_old_mkey_beforex> <>
<vim_ext_mkey_beforex>. IF condense = 'X'. <vim_old_mkey_beforex> =
<vim_ext_mkey_beforex>. ENDIF. CLEAR textmaint_record. <text_rec_key> =
<extract_key>. PERFORM vim_external_repr_for_key TABLES
textmaint_record-keytab USING <vim_xextract_key>.
textmaint_record-spras = sy-langu. textmaint_record-sptxt = curr_sptxt.
IF x_header-bastab = space. LOOP AT x_namtab WHERE textfldsel = 'X'.
textmaint_field-namtab_idx = sy-tabix. textmaint_field-outplen =
x_namtab-flength. ASSIGN COMPONENT x_namtab-viewfield OF STRUCTURE
<vim_extract_struc> TO <txtfld>. textmaint_field-text = <txtfld>.
APPEND textmaint_field TO textmaint_record-texttab. ENDLOOP. ELSE. LOOP
AT x_namtab WHERE textfldsel = 'X'. textmaint_field-namtab_idx =
sy-tabix. textmaint_field-outplen = x_namtab-flength. ASSIGN COMPONENT
x_namtab-viewfield OF STRUCTURE <vim_ext_txt_struc> TO <txtfld>.
textmaint_field-text = <txtfld>. APPEND textmaint_field TO
textmaint_record-texttab. ENDLOOP. ENDIF. APPEND textmaint_record TO
texttab_for_maint. CLEAR: <viewkey_in_texttab>, <texttab_struc>. READ
TABLE <vim_texttab> WITH KEY <extract_key> INTO texttab_wa.
texttab_tabix = sy-tabix. LOOP AT sel_langus. CLEAR textmaint_record.
<text_rec_key> = <extract_key>. textmaint_record-spras =
sel_langus-spras. textmaint_record-sptxt = sel_langus-sptxt. IF
<viewkey_in_texttab> = <extract_key> AND <next_spras> <
sel_langus-spras. LOOP AT <vim_texttab> FROM texttab_tabix INTO
texttab_wa. IF <viewkey_in_texttab> <> <extract_key> OR <next_spras> >=
sel_langus-spras. texttab_tabix = sy-tabix. EXIT. ENDIF. ENDLOOP.
ENDIF. IF <next_spras> <> sel_langus-spras OR <viewkey_in_texttab> <>
<extract_key>. CLEAR <tmp_struc>. ELSE. tmp_wa = <h_texttab_wa>. ENDIF.
LOOP AT x_namtab WHERE textfldsel = 'X'. textmaint_field-namtab_idx =
sy-tabix. textmaint_field-outplen = x_namtab-flength. ASSIGN COMPONENT
x_namtab-bastabfld OF STRUCTURE <tmp_struc> TO <txtfld>.
textmaint_field-text = <txtfld>. APPEND textmaint_field TO
textmaint_record-texttab. ENDLOOP. APPEND textmaint_record TO
texttab_for_maint. ENDLOOP. IF status-mode = detail_bild. EXIT. ENDIF.
ENDLOOP. ENDFORM. FORM vim_external_repr_for_key TABLES keytab USING
int_key TYPE x. DATA: keynr TYPE i, keyfield TYPE vimty_textfield,
namtab_idx LIKE sy-tabix. FIELD-SYMBOLS: <i_value> TYPE ANY, <e_value>
TYPE c. CLEAR: keynr, keyfield. REFRESH keytab. MOVE int_key TO
<table1_wax>. LOOP AT x_namtab WHERE keyflag = 'X' AND texttabfld <>
'X'. namtab_idx = sy-tabix. CHECK x_namtab-datatype <> 'CLNT' OR
x_header-clidep = space. CHECK x_namtab-readonly <> 'S' AND
x_namtab-readonly <> 'H'. CHECK x_header-delmdtflag = space OR
x_header-ptfrkyexst = space OR x_namtab-domname <>
vim_delim_date_domain OR ( x_namtab-rollname NOT in VIM_BEGDA_TYPES and
X_NAMTAB-ROLLNAME not IN vim_endda_types ). keynr = keynr + 1. IF keynr
> vim_max_keyfields. keyfield-text+keyfield-outplen(1) = '|'.
keyfield-outplen = keyfield-outplen + 1. ENDIF. ASSIGN COMPONENT
x_namtab-viewfield OF STRUCTURE <table1_wa> TO <i_value>. ASSIGN
keyfield-text+keyfield-outplen(x_namtab-outputlen) TO <e_value>. CALL
FUNCTION 'VIEW_CONVERSION_OUTPUT' EXPORTING value_intern = <i_value>
tabname = x_header-maintview fieldname = x_namtab-viewfield outputlen =
x_namtab-outputlen intlen = x_namtab-flength IMPORTING value_extern =
<e_value>. IF keynr < vim_max_keyfields. keyfield-namtab_idx =
namtab_idx. keyfield-outplen = x_namtab-outputlen. APPEND keyfield TO
keytab. CLEAR keyfield. ELSE. keyfield-outplen = keyfield-outplen +
x_namtab-outputlen. ENDIF. ENDLOOP. IF keynr >= vim_max_keyfields.
APPEND keyfield TO keytab. ENDIF. ENDFORM. FORM vim_fill_view_key USING
texttab_wa TYPE vim_line_ul CHANGING view_key spras LIKE t002-spras.
LOOP AT x_namtab WHERE txttabfldn <> space AND keyflag <> space.
view_key+x_namtab-position(x_namtab-flength) =
texttab_wa+x_namtab-texttabpos(x_namtab-flength). ENDLOOP. spras =
texttab_wa+x_header-sprasfdpos(vim_spras_length). ENDFORM. FORM
vim_update_texttab USING texttab_for_maint TYPE
vimty_multilangu_texttab. DATA: textmaint_record TYPE
vimty_textmaint_record, textmaint_field TYPE vimty_textfield, align
TYPE f, texttab_wa TYPE vim_line_ul, search_key TYPE tabl8000, offset
LIKE sy-fdpos, keylen LIKE sy-fdpos, extract_index LIKE sy-tabix,
total_index LIKE sy-tabix, texttab_tabix LIKE sy-tabix, new_entry(1)
TYPE c, keylen_char type i. FIELD-SYMBOLS: <search_key> TYPE x,
<rec_key> TYPE x, <curr_spras> TYPE ANY, <h_texttab_wa> TYPE x,
<viewkey_in_texttab> TYPE x, <texttab_key> TYPE x, <texttab_struc> TYPE
ANY, <h_texttab> TYPE x, <tot_fld> TYPE ANY, <ext_fld> TYPE ANY,
<texttab_action> TYPE c, <t_action>, <e_action>. IF x_header-delmdtflag
<> space AND x_header-ptfrkyexst = 'X'. keylen = x_header-after_keyc -
vim_datum_length * cl_abap_char_utilities=>charsize. ELSE. keylen =
x_header-after_keyc. ENDIF. keylen_char = keylen /
cl_abap_char_utilities=>charsize. ASSIGN: search_key(keylen) TO
<search_key>, textmaint_record-keys(keylen_char) TO <rec_key> CASTING,
texttab_wa TO <h_texttab_wa> CASTING, <h_texttab_wa>(keylen) TO
<viewkey_in_texttab>, <h_texttab_wa>+keylen(x_header-textkeylen) TO
<texttab_key>, <h_texttab_wa>+keylen(x_header-texttablen) TO
<h_texttab>, <h_texttab> TO <texttab_struc> CASTING TYPE
(x_header-texttab), COMPONENT x_header-sprasfield OF STRUCTURE
<texttab_struc> TO <curr_spras>. offset = keylen + x_header-aft_txttbc.
ASSIGN <h_texttab_wa>+offset(cl_abap_char_utilities=>charsize) TO
<texttab_action> CASTING. IF x_header-bastab = 'X'. ASSIGN
<action_text> TO <t_action>. ASSIGN <xact_text> TO <e_action>. ELSE.
ASSIGN <action> TO <t_action>. ASSIGN <xact> TO <e_action>. ENDIF. LOOP
AT texttab_for_maint INTO textmaint_record. IF textmaint_record-spras =
sy-langu. <search_key> = <rec_key>. READ TABLE extract WITH KEY
<search_key> BINARY SEARCH. extract_index = sy-tabix. ENDIF. CHECK
textmaint_record-action = 'X'. IF textmaint_record-spras = sy-langu.
READ TABLE total WITH KEY <search_key> BINARY SEARCH. total_index =
sy-tabix. IF x_header-bastab = 'X' AND <vim_xextract_text> =
<text_initial_x>. PERFORM map_viewkey_to_texttabkey TABLES x_namtab
USING x_header sy-langu <vim_xtotal> CHANGING <vim_xextract_text>.
PERFORM map_viewkey_to_texttabkey TABLES x_namtab USING x_header
sy-langu <vim_xtotal> CHANGING <vim_xtotal_text>. <e_action> =
neuer_eintrag. <t_action> = neuer_eintrag. ELSEIF <e_action> =
original. <e_action> = aendern. <t_action> = aendern. ENDIF. LOOP AT
textmaint_record-texttab INTO textmaint_field. READ TABLE x_namtab
INDEX textmaint_field-namtab_idx. IF x_namtab-lowercase = space.
TRANSLATE textmaint_field-text TO UPPER CASE. ENDIF. IF x_header-bastab
= 'X'. ASSIGN: COMPONENT x_namtab-viewfield OF STRUCTURE
<vim_ext_txt_struc> TO <ext_fld>, COMPONENT x_namtab-viewfield OF
STRUCTURE <vim_tot_txt_struc> TO <tot_fld>. ELSE. ASSIGN: COMPONENT
x_namtab-viewfield OF STRUCTURE <vim_extract_struc> TO <ext_fld>,
COMPONENT x_namtab-viewfield OF STRUCTURE <vim_total_struc> TO
<tot_fld>. ENDIF. <tot_fld> = textmaint_field-text. <ext_fld> =
textmaint_field-text. ENDLOOP. MODIFY extract INDEX extract_index.
MODIFY total INDEX total_index. ELSE. CLEAR: <h_texttab_wa>,
<texttab_struc>. READ TABLE <vim_texttab> WITH KEY <search_key> INTO
texttab_wa BINARY SEARCH. texttab_tabix = sy-tabix. IF
<viewkey_in_texttab> = <search_key> AND <curr_spras> <
textmaint_record-spras. LOOP AT <vim_texttab> FROM texttab_tabix INTO
texttab_wa. IF <viewkey_in_texttab> <> <search_key> OR <curr_spras> >=
textmaint_record-spras. texttab_tabix = sy-tabix. EXIT. ELSEIF
<curr_spras> < textmaint_record-spras. texttab_tabix = sy-tabix + 1.
ENDIF. ENDLOOP. ENDIF. IF <viewkey_in_texttab> <> <search_key> OR
<curr_spras> <> textmaint_record-spras. CLEAR: <texttab_struc>.
new_entry = 'X'. <viewkey_in_texttab> = <search_key>. <texttab_action>
= neuer_eintrag. PERFORM map_viewkey_to_texttabkey TABLES x_namtab
USING x_header textmaint_record-spras <viewkey_in_texttab> CHANGING
<texttab_key>. ELSE. CLEAR new_entry. ENDIF. LOOP AT
textmaint_record-texttab INTO textmaint_field. READ TABLE x_namtab
INDEX textmaint_field-namtab_idx. IF x_namtab-lowercase = space.
TRANSLATE textmaint_field-text TO UPPER CASE. ENDIF. IF x_header-bastab
= 'X'. ASSIGN: COMPONENT x_namtab-viewfield OF STRUCTURE
<texttab_struc> TO <ext_fld>. ELSE. ASSIGN: COMPONENT
x_namtab-BASTABFLD OF STRUCTURE <texttab_struc> TO <ext_fld>. ENDIF.
<ext_fld> = textmaint_field-text. ENDLOOP. IF <texttab_action> =
original. <texttab_action> = aendern. ENDIF. IF new_entry = 'X'. INSERT
texttab_wa INTO <vim_texttab> INDEX texttab_tabix. ELSE. MODIFY
<vim_texttab> FROM texttab_wa INDEX texttab_tabix. ENDIF. ENDIF.
ENDLOOP. ENDFORM. FORM vim_temp_delim_texttab USING value(enddate)
value(orig_key) TYPE x. DATA: texttab_orig TYPE vim_line_ul,
texttab_new TYPE vim_line_ul, align TYPE f, old_key TYPE tabl8000,
orig_tabix LIKE sy-tabix, new_tabix LIKE sy-tabix, len TYPE i, offset
TYPE i, langus_selected(1) TYPE c, curr_sptxt LIKE t002t-sptxt,
sel_langus LIKE h_t002 OCCURS 0 WITH HEADER LINE. FIELD-SYMBOLS:
<texttab_orig_x> TYPE x, <txttb_orig_struc> TYPE ANY, <viewkey_in_orig>
TYPE x, <texttab_new_x> TYPE x, <txttb_new_struc> TYPE ANY,
<viewkey_in_new> TYPE x, <spras_in_orig> TYPE spras, <spras_in_new>
TYPE spras, <date_in_textkey_new> LIKE sy-datum, <action_in_orig>,
<action_in_new>, <textfields_in_new> TYPE x, <textfields_in_orig> TYPE
x, <h_old_key> TYPE x, <old_key_enddate> LIKE sy-datum, <old_keyx> TYPE
x, <old_key_struc> TYPE ANY. CALL FUNCTION 'VIEW_GET_LANGUAGES'
EXPORTING all_without_selection = 'X' IMPORTING languages_selected =
langus_selected curr_sptxt = curr_sptxt TABLES languages = sel_langus.
IF x_header-frm_tl_get NE space. PERFORM (x_header-frm_tl_get) IN
PROGRAM (x_header-fpoolname) TABLES sel_langus. ELSE. PERFORM
vim_read_texttab_for_langus TABLES sel_langus USING 'X'. ENDIF. READ
TABLE <vim_texttab> WITH KEY orig_key BINARY SEARCH TRANSPORTING NO
FIELDS. CHECK sy-subrc = 0. orig_tabix = sy-tabix. ASSIGN: texttab_orig
TO <texttab_orig_x> CASTING, <texttab_orig_x>(x_header-keylen) TO
<viewkey_in_orig>, <texttab_orig_x>+x_header-after_keyc TO
<txttb_orig_struc> CASTING TYPE (x_header-texttab), COMPONENT
x_header-sprasfield OF STRUCTURE <txttb_orig_struc> TO <spras_in_orig>.
ASSIGN: texttab_new TO <texttab_new_x> CASTING,
<texttab_new_x>(x_header-keylen) TO <viewkey_in_new>,
<texttab_new_x>+x_header-after_keyc TO <txttb_new_struc> CASTING TYPE
(x_header-texttab), COMPONENT x_header-sprasfield OF STRUCTURE
<txttb_new_struc> TO <spras_in_new>. offset = x_header-after_keyc +
x_header-textkeylen. len = x_header-aft_txttbc - x_header-textkeylen.
ASSIGN: <texttab_new_x>+offset(len) TO <textfields_in_new>,
<texttab_orig_x>+offset(len) TO <textfields_in_orig>. ASSIGN: old_key
TO <h_old_key> CASTING, <h_old_key>(x_header-keylen) TO <old_keyx>,
old_key TO <old_key_struc> CASTING TYPE (x_header-maintview). LOOP AT
x_namtab WHERE keyflag = 'X' AND ( texttabfld = 'X' OR txttabfldn <>
space ) AND domname EQ vim_delim_date_domain AND ( rollname IN
vim_begda_types OR rollname IN vim_endda_types ). EXIT. ENDLOOP. ASSIGN
COMPONENT x_namtab-viewfield OF STRUCTURE <txttb_new_struc> TO
<date_in_textkey_new>. offset = ( x_header-after_keyc +
x_header-aft_txttbc ) / cl_abap_char_utilities=>charsize. ASSIGN
texttab_orig+offset(1) TO <action_in_orig>. ASSIGN
texttab_new+offset(1) TO <action_in_new>. LOOP AT <vim_texttab> INTO
texttab_orig FROM orig_tabix. IF <viewkey_in_orig> <> orig_key. EXIT.
ENDIF. READ TABLE <vim_texttab> WITH KEY <vim_xtotal_key> INTO
texttab_new BINARY SEARCH. new_tabix = sy-tabix. IF <viewkey_in_new> =
<vim_xtotal_key> AND <spras_in_new> < <spras_in_orig>. LOOP AT
<vim_texttab> FROM new_tabix INTO texttab_new. IF <viewkey_in_new> <>
<vim_xtotal_key> OR <spras_in_new> >= <spras_in_orig>. new_tabix =
sy-tabix. EXIT. ELSEIF <spras_in_new> < <spras_in_orig>. new_tabix =
sy-tabix + 1. ENDIF. ENDLOOP. ENDIF. IF <viewkey_in_new> <>
<vim_xtotal_key> OR <spras_in_new> <> <spras_in_orig>. texttab_new =
texttab_orig. <viewkey_in_new> = <vim_xtotal_key>.
<date_in_textkey_new> = <vim_enddate>. <action_in_new> = neuer_eintrag.
INSERT texttab_new INTO <vim_texttab> INDEX new_tabix. ELSE. IF
<action_in_new> = original. <action_in_new> = aendern. ENDIF.
<textfields_in_new> = <textfields_in_orig>. MODIFY <vim_texttab> FROM
texttab_new INDEX new_tabix. ENDIF. ENDLOOP. <old_keyx> =
<vim_xtotal_key>. LOOP AT x_namtab WHERE keyflag = 'X' AND ( texttabfld
= 'X' OR txttabfldn <> space ) AND domname EQ vim_delim_date_domain AND
( rollname IN vim_begda_types OR rollname IN vim_endda_types ). EXIT.
ENDLOOP. ASSIGN COMPONENT x_namtab-viewfield OF STRUCTURE
<old_key_struc> TO <old_key_enddate>. <old_key_enddate> = enddate. READ
TABLE <vim_texttab> WITH KEY <old_keyx> BINARY SEARCH TRANSPORTING NO
FIELDS. IF sy-subrc = 0. LOOP AT <vim_texttab> INTO texttab_orig FROM
sy-tabix. IF <viewkey_in_orig> <> <old_keyx>. EXIT. ENDIF. IF
<action_in_orig> = neuer_eintrag. DELETE <vim_texttab>. ELSE. CLEAR
<textfields_in_orig>. IF <action_in_orig> = original. <action_in_orig>
= aendern. ENDIF. MODIFY <vim_texttab> FROM texttab_orig. ENDIF.
ENDLOOP. ENDIF. MODIFY vim_texttab_container INDEX
vim_texttab_container_index. ENDFORM. FORM vim_check_upd_texttab. DATA:
texttab_wa TYPE vim_line_ul, offset TYPE i. FIELD-SYMBOLS:
<texttab_action>. IF x_header-delmdtflag <> space AND
x_header-ptfrkyexst = 'X'. offset = x_header-after_keyc -
vim_datum_length * cl_abap_char_utilities=>charsize. ELSE. offset =
x_header-after_keyc. ENDIF. offset = ( offset + x_header-aft_txttbc ) /
cl_abap_char_utilities=>charsize. ASSIGN texttab_wa+offset(1) TO
<texttab_action>. LOOP AT <vim_texttab> INTO texttab_wa. CHECK
<texttab_action> <> original. MOVE 'X' TO <status>-upd_flag. EXIT.
ENDLOOP. ENDFORM. FORM vim_set_texttab_action_delete. DATA:
texttab_tabix LIKE sy-tabix, offset TYPE i, texttab_wa TYPE
vim_line_ul. FIELD-SYMBOLS: <h_texttab_wa> TYPE x, <texttab_action>
TYPE char01, <viewkey_in_texttab> TYPE x, <total_key> TYPE x. IF
x_header-delmdtflag <> space AND x_header-ptfrkyexst = 'X'. offset =
x_header-after_keyc - vim_datum_length *
cl_abap_char_utilities=>charsize. ASSIGN <vim_tot_mkey_beforex> TO
<total_key>. ELSE. offset = x_header-after_keyc. ASSIGN
<vim_xtotal_key> TO <total_key>. ENDIF. ASSIGN: texttab_wa TO
<h_texttab_wa> CASTING, <h_texttab_wa>(offset) TO <viewkey_in_texttab>.
offset = ( offset + x_header-aft_txttbc ) /
cl_abap_char_utilities=>charsize. ASSIGN texttab_wa+offset(1) TO
<texttab_action>. LOOP AT <vim_texttab> INTO texttab_wa. CHECK
<texttab_action> = geloescht OR <texttab_action> = update_geloescht OR
<texttab_action> = neuer_geloescht. TRANSLATE <texttab_action> USING
'D XNYU'. MODIFY <vim_texttab> FROM texttab_wa. ENDLOOP. LOOP AT total.
CHECK <action> = update_geloescht OR <action> = geloescht OR <action> =
neuer_geloescht. READ TABLE <vim_texttab> WITH KEY <total_key> BINARY
SEARCH TRANSPORTING NO FIELDS. IF sy-subrc = 0. texttab_tabix =
sy-tabix. LOOP AT <vim_texttab> FROM texttab_tabix INTO texttab_wa. IF
<viewkey_in_texttab> <> <total_key>. EXIT. ENDIF. TRANSLATE
<texttab_action> USING ' DNXUY'. MODIFY <vim_texttab> FROM texttab_wa.
ENDLOOP. ENDIF. ENDLOOP. ENDFORM. FORM vim_texttab_modif_for_key
CHANGING modif. DATA: texttab_wa TYPE vim_line_ul, texttab_tabix LIKE
sy-tabix, keylen TYPE i, offset TYPE i. FIELD-SYMBOLS: <h_texttab_wa>
TYPE x, <texttab_action> type xfeld, <viewkey_in_texttab> type x,
<extract_key> type x. IF x_header-delmdtflag <> space AND
x_header-ptfrkyexst = 'X'. ASSIGN <vim_ext_mkey_beforex> TO
<extract_key>. keylen = x_header-after_keyc - vim_datum_length *
cl_abap_char_utilities=>charsize. ELSE. ASSIGN <vim_xextract_key> TO
<extract_key>. keylen = x_header-after_keyc. ENDIF. CLEAR modif. READ
TABLE <vim_texttab> WITH KEY <vim_xextract_key> BINARY SEARCH
TRANSPORTING NO FIELDS. IF sy-subrc = 0. texttab_tabix = sy-tabix.
ELSE. EXIT. ENDIF. ASSIGN: texttab_wa TO <h_texttab_wa> CASTING,
<h_texttab_wa>(keylen) TO <viewkey_in_texttab>. offset = ( keylen +
x_header-aft_txttbc ) / cl_abap_char_utilities=>charsize. ASSIGN
texttab_wa+offset(1) TO <texttab_action>. LOOP AT <vim_texttab> FROM
texttab_tabix INTO texttab_wa. IF <viewkey_in_texttab> <>
<extract_key>. EXIT. ELSEIF <texttab_action> <> original. modif = 'X'.
EXIT. ENDIF. ENDLOOP. ENDFORM. FORM vim_text_keytab_entries USING
value(vake_action) TYPE c vake_rc TYPE i value(p_keylen) TYPE syfleng
value(p_txtkeylen) TYPE syfleng. DATA: rc1 LIKE sy-subrc, offset TYPE
i, texttab_wa TYPE vim_line_ul. FIELD-SYMBOLS: <h_texttab_wa> type x,
<texttab_action> type c, <texttab_key> type x, <x_header2> TYPE
vimdesc. IF x_header-delmdtflag <> space AND x_header-ptfrkyexst = 'X'.
p_keylen = p_keylen - vim_datum_length *
cl_abap_char_utilities=>charsize. ENDIF. ASSIGN: texttab_wa to
<h_texttab_wa> casting, <h_texttab_wa>+p_keylen(x_header-textkeylen) TO
<texttab_key>. offset = p_keylen + x_header-aft_txttbc. ASSIGN
<h_texttab_wa>+offset(cl_abap_char_utilities=>charsize) TO
<texttab_action> casting. corr_keytab = e071k. corr_keytab-objname =
x_header-texttab. vake_rc = 8. LOOP AT <vim_texttab> INTO texttab_wa.
CHECK <texttab_action> <> original AND <texttab_action> <>
neuer_geloescht. MOVE <texttab_key> TO <vim_corr_keyx>(p_txtkeylen).
PERFORM update_corr_keytab USING vake_action rc1. IF rc1 = 0. CLEAR
vake_rc. ELSE. IF vake_action EQ pruefen. vake_rc = 8. EXIT. ENDIF.
ENDIF. ENDLOOP. ENDFORM. FORM vim_text_keytab_entry USING
value(viewkey) TYPE x value(vake_action) TYPE c vake_rc TYPE i. DATA:
rc1 LIKE sy-subrc, sys_type(10) TYPE c, keylen TYPE i, offset TYPE i,
tbx LIKE sy-tabix, align TYPE f, texttab_wa TYPE vim_line_ul, key_wa
TYPE vim_line_ul, wheretab LIKE vimwheretb OCCURS 0 WITH HEADER LINE,
tmp_sellist LIKE vimsellist OCCURS 0 WITH HEADER LINE, tmp_texttab TYPE
REF TO data, w_tmp_texttab type ref to data. FIELD-SYMBOLS:
<tmp_texttab> TYPE STANDARD TABLE, <texttab_wax> TYPE x, <texttab_x>
TYPE x, <texttab_struc> TYPE ANY, <texttab_key> TYPE x,
<texttab_action> TYPE c, <keyvalue> TYPE ANY, <lang> TYPE spras,
<viewkey_in_texttab>, <viewkey> TYPE x. vake_rc = 8. corr_keytab =
e071k. corr_keytab-objname = x_header-texttab. IF x_header-generictrp
<> space OR x_header-genertxtrp <> space. keylen = x_header-maxtrkeyln.
ELSE. keylen = x_header-keylen. ENDIF. CALL 'C_SAPGPARAM' ID 'NAME'
FIELD 'transport/systemtype' ID 'VALUE' FIELD sys_type. ASSIGN:
viewkey(keylen) TO <viewkey> CASTING. IF
vim_texttab_container-all_langus = 'X'. ASSIGN: texttab_wa TO
<texttab_wax> CASTING, <texttab_wax>+keylen(x_header-texttablen) TO
<texttab_x>, <texttab_x>(x_header-textkeylen) TO <texttab_key>,
<texttab_x> TO <texttab_struc> CASTING TYPE (x_header-texttab),
COMPONENT x_header-sprasfield OF STRUCTURE <texttab_struc> TO <lang>.
IF x_header-delmdtflag <> space AND x_header-ptfrkyexst = 'X'. keylen =
keylen - vim_datum_length * cl_abap_char_utilities=>charsize. ENDIF.
ASSIGN <texttab_wax>(keylen) TO <viewkey_in_texttab>. offset = keylen +
x_header-aft_txttbc. ASSIGN
<texttab_wax>+offset(cl_abap_char_utilities=>charsize) TO
<texttab_action> CASTING. READ TABLE <vim_texttab> WITH KEY <viewkey>
BINARY SEARCH TRANSPORTING NO FIELDS. IF sy-subrc = 0. LOOP AT
<vim_texttab> INTO texttab_wa FROM sy-tabix. CHECK <texttab_action> <>
neuer_eintrag. IF <viewkey_in_texttab> <> <viewkey>. EXIT. ENDIF. MOVE
<texttab_key> TO <vim_corr_keyx>(x_header-textkeylen). PERFORM
update_corr_keytab USING vake_action rc1. IF rc1 = 0. CLEAR vake_rc.
ELSE. IF vake_action EQ pruefen. vake_rc = 8. EXIT. ENDIF. ENDIF.
ENDLOOP. ELSE. CLEAR vake_rc. ENDIF. ELSE. REFRESH wheretab.
tmp_sellist-operator = 'EQ'. tmp_sellist-and_or = 'AND'. MOVE <viewkey>
TO <f1_wax>. LOOP AT x_namtab WHERE keyflag NE space AND txttabfldn <>
space. tmp_sellist-tabix = sy-tabix. ASSIGN COMPONENT
x_namtab-viewfield OF STRUCTURE <table1_wa> TO <keyvalue>.
tmp_sellist-viewfield = x_namtab-txttabfldn. IF x_namtab-inttype = 'C'
and x_namtab-convexit = space. tmp_sellist-value = <keyvalue>. ELSE.
CALL FUNCTION 'VIEW_CONVERSION_OUTPUT' EXPORTING value_intern =
<keyvalue> tabname = x_header-maintview fieldname = x_namtab-viewfield
inttype = x_namtab-inttype datatype = x_namtab-datatype decimals =
x_namtab-decimals convexit = x_namtab-convexit sign = x_namtab-sign
outputlen = x_namtab-outputlen intlen = x_namtab-flength IMPORTING
value_extern = tmp_sellist-value EXCEPTIONS OTHERS = 1. ENDIF. APPEND
tmp_sellist. tbx = sy-tabix. ENDLOOP. IF tbx > 0. CLEAR
tmp_sellist-and_or. MODIFY tmp_sellist INDEX tbx. CALL FUNCTION
'VIEW_FILL_WHERETAB' EXPORTING tablename = x_header-texttab
only_cnds_for_keyflds = 'X' is_texttable = 'X' TABLES sellist =
tmp_sellist wheretab = wheretab x_namtab = x_namtab EXCEPTIONS
no_conditions_for_table = 01. CREATE DATA tmp_texttab TYPE STANDARD
TABLE OF (x_header-texttab). CREATE DATA w_tmp_texttab TYPE
(x_header-texttab). ASSIGN: tmp_texttab->* TO <tmp_texttab>,
w_tmp_texttab->* to <texttab_struc>, <texttab_struc> TO <texttab_wax>
CASTING, <texttab_wax>(x_header-textkeylen) TO <texttab_key>, COMPONENT
x_header-sprasfield OF STRUCTURE <texttab_struc> TO <lang>. SELECT *
FROM (x_header-texttab) INTO TABLE <tmp_texttab> WHERE (wheretab). IF
sy-subrc = 0. LOOP AT <tmp_texttab> INTO <texttab_struc>. MOVE
<texttab_key> TO <vim_corr_keyx>(x_header-textkeylen). PERFORM
update_corr_keytab USING vake_action rc1. IF rc1 = 0. CLEAR vake_rc.
ELSE. IF vake_action EQ pruefen. vake_rc = 8. EXIT. ENDIF. ENDIF.
ENDLOOP. ELSE. CLEAR vake_rc. ENDIF. ENDIF. ENDIF. ENDFORM. FORM
vim_copy_texttab_entry USING value(new_key) TYPE x value(orig_key) TYPE
x. DATA: texttab_orig TYPE vim_line_ul, texttab_new TYPE vim_line_ul,
orig_tabix LIKE sy-tabix, new_tabix LIKE sy-tabix, len TYPE i, offset
TYPE i, langus_selected(1) TYPE c, curr_sptxt LIKE t002t-sptxt,
sel_langus LIKE h_t002 OCCURS 0 WITH HEADER LINE. FIELD-SYMBOLS:
<texttab_orig_x> TYPE x, <h_texttab_orig_x> TYPE x, <txttb_orig_struc>
TYPE ANY, <viewkey_in_orig> TYPE x, <texttab_new_x> TYPE x,
<h_texttab_new_x> TYPE x, <txttb_new_struc> TYPE ANY, <viewkey_in_new>
TYPE x, <spras_in_orig> TYPE spras, <spras_in_new> TYPE spras,
<action_in_orig>, <action_in_new>, <textfields_in_new> TYPE x,
<textfields_in_orig> TYPE x, <textkey_in_new> TYPE x. CALL FUNCTION
'VIEW_GET_LANGUAGES' EXPORTING all_without_selection = 'X' IMPORTING
languages_selected = langus_selected curr_sptxt = curr_sptxt TABLES
languages = sel_langus. IF x_header-frm_tl_get NE space. PERFORM
(x_header-frm_tl_get) IN PROGRAM (x_header-fpoolname) TABLES
sel_langus. ELSE. PERFORM vim_read_texttab_for_langus TABLES sel_langus
USING 'X'. ENDIF. READ TABLE <vim_texttab> WITH KEY orig_key BINARY
SEARCH TRANSPORTING NO FIELDS. CHECK sy-subrc = 0. orig_tabix =
sy-tabix. ASSIGN: texttab_orig TO <texttab_orig_x> CASTING,
<texttab_orig_x>(x_header-keylen) TO <viewkey_in_orig>,
<texttab_orig_x>+x_header-after_keyc(x_header-texttablen) TO
<h_texttab_orig_x>, <h_texttab_orig_x> TO <txttb_orig_struc> CASTING
TYPE (x_header-texttab), COMPONENT x_header-sprasfield OF STRUCTURE
<txttb_orig_struc> TO <spras_in_orig>. ASSIGN: texttab_new TO
<texttab_new_x> CASTING, <texttab_new_x>(x_header-keylen) TO
<viewkey_in_new>,
<texttab_new_x>+x_header-after_keyc(x_header-textkeylen) TO
<textkey_in_new>,
<texttab_new_x>+x_header-after_keyc(x_header-texttablen) TO
<h_texttab_new_x>, <h_texttab_new_x> TO <txttb_new_struc> CASTING TYPE
(x_header-texttab), COMPONENT x_header-sprasfield OF STRUCTURE
<txttb_new_struc> TO <spras_in_new>. offset = x_header-after_keyc +
x_header-textkeylen. len = x_header-aft_txttbc - x_header-textkeylen.
ASSIGN: <texttab_new_x>+offset(len) TO <textfields_in_new>,
<texttab_orig_x>+offset(len) TO <textfields_in_orig>. offset = (
x_header-after_keyc + x_header-aft_txttbc ) /
cl_abap_char_utilities=>charsize. ASSIGN texttab_orig+offset(1) TO
<action_in_orig>. ASSIGN texttab_new+offset(1) TO <action_in_new>. LOOP
AT <vim_texttab> INTO texttab_orig FROM orig_tabix. IF
<viewkey_in_orig> <> orig_key. EXIT. ENDIF. READ TABLE <vim_texttab>
WITH KEY new_key INTO texttab_new BINARY SEARCH. new_tabix = sy-tabix.
IF <viewkey_in_new> = new_key AND <spras_in_new> < <spras_in_orig>.
LOOP AT <vim_texttab> FROM new_tabix INTO texttab_new. IF
<viewkey_in_new> <> new_key OR <spras_in_new> >= <spras_in_orig>.
new_tabix = sy-tabix. EXIT. ELSEIF <spras_in_new> < <spras_in_orig>.
new_tabix = sy-tabix + 1. ENDIF. ENDLOOP. ENDIF. IF <viewkey_in_new> <>
new_key OR <spras_in_new> <> <spras_in_orig>. texttab_new =
texttab_orig. <viewkey_in_new> = new_key. PERFORM
map_viewkey_to_texttabkey TABLES x_namtab USING x_header
<spras_in_orig> new_key CHANGING <textkey_in_new>. <action_in_new> =
neuer_eintrag. INSERT texttab_new INTO <vim_texttab> INDEX new_tabix.
ELSE. IF <action_in_new> = original. <action_in_new> = aendern. ENDIF.
<textfields_in_new> = <textfields_in_orig>. MODIFY <vim_texttab> FROM
texttab_new INDEX new_tabix. ENDIF. ENDLOOP. MODIFY
vim_texttab_container INDEX vim_texttab_container_index. ENDFORM. FORM
get_profiles USING p_selected TYPE c. DATA: cobj_type VALUE 'V'. IF
x_header-bastab NE space. cobj_type = vim_tabl. ENDIF. CLEAR
vim_pr_activating. CALL FUNCTION 'SCPR_SHOW_OUT_OF_VIEW' EXPORTING
tabname = x_header-viewname tabtype = cobj_type preselection =
p_selected cluster = vim_called_by_cluster TABLES header = x_header
namtab = x_namtab sellist = <vim_ck_sellist> EXCEPTIONS user_abort = 1
no_profile_found = 2 profile_dont_exist = 3 no_data = 4 OTHERS = 5.
CASE sy-subrc. WHEN 2. MESSAGE s820(sv). WHEN 3. IF cobj_type = 'S'.
MESSAGE s822(sv) WITH x_header-viewname. ELSE. MESSAGE s821(sv) WITH
x_header-viewname. ENDIF. ENDCASE. ENDFORM. FORM import_profile USING
actopts TYPE scpractopt. DATA: ext_field(1000), pr_field(1000), next, i
TYPE i VALUE 1, extr_lin TYPE i, len_text TYPE i, profile_used,
imported_to_all VALUE 'X'. FIELD-SYMBOLS: <pr_field>, <bc_total_key>,
<bc_total>, <bc_total_action>, <bc_total_mark>, <w_record> TYPE
vim_pr_tab_type. len_text = x_header-texttablen - x_header-textkeylen.
CASE status-action. WHEN aendern. IF status-mode = list_bild. LOOP AT
vim_pr_tab ASSIGNING <w_record>. IF <w_record>-action = aendern. LOOP
AT extract. CHECK <w_record>-keys = <vim_xextract_key>. PERFORM
bcset_force_into_entry USING <w_record> aendern actopts. MODIFY
extract. EXIT. ENDLOOP. ELSE. MOVE <initial_x> TO <vim_xextract>.
<vim_xextract_key> = <w_record>-keys. PERFORM bcset_force_into_entry
USING <w_record> neuer_eintrag actopts. APPEND extract. ADD 1 TO
maxlines. ENDIF. ENDLOOP. SORT extract BY <vim_xextract_key>. ELSE.
LOOP AT vim_pr_tab ASSIGNING <w_record> WHERE action = neuer_eintrag.
MOVE <initial_x> TO <vim_xextract>. <vim_xextract_key> =
<w_record>-keys. PERFORM bcset_force_into_entry USING <w_record>
neuer_eintrag actopts. APPEND extract. ADD 1 TO maxlines. ENDLOOP. LOOP
AT vim_pr_tab ASSIGNING <w_record> WHERE action = aendern. CLEAR
profile_used. LOOP AT extract. CHECK <w_record>-keys =
<vim_xextract_key>. PERFORM bcset_force_into_entry USING <w_record>
aendern actopts. MODIFY extract. profile_used = 'X'. EXIT. ENDLOOP. IF
profile_used = space. LOOP AT total INTO extract. CHECK <w_record>-keys
= <vim_xextract_key>. PERFORM bcset_force_into_entry USING <w_record>
aendern actopts. APPEND extract. ADD 1 TO maxlines. EXIT. ENDLOOP.
ENDIF. ENDLOOP. SORT extract BY <vim_xextract_key>. ENDIF. WHEN
hinzufuegen. IF status-mode = list_bild. DESCRIBE TABLE extract LINES
extr_lin. LOOP AT vim_pr_tab ASSIGNING <w_record> WHERE action =
neuer_eintrag. IF extr_lin LE i. CLEAR extract. MOVE leer TO <xact>.
APPEND extract. ENDIF. LOOP AT extract FROM i. CHECK <xact> = leer. i =
sy-tabix + 1. ADD 1 TO maxlines. <vim_xextract_key> = <w_record>-keys.
PERFORM bcset_force_into_entry USING <w_record> neuer_eintrag actopts.
MODIFY extract. EXIT. ENDLOOP. ENDLOOP. ELSE. MOVE <initial_x> TO
<vim_xextract>. LOOP AT vim_pr_tab ASSIGNING <w_record> WHERE action =
neuer_eintrag. <vim_xextract_key> = <w_record>-keys. PERFORM
bcset_force_into_entry USING <w_record> neuer_eintrag actopts. APPEND
extract. ADD 1 TO maxlines. ENDLOOP. ENDIF. LOOP AT vim_pr_tab
ASSIGNING <w_record> WHERE action = aendern. LOOP AT total INTO
extract. CHECK <w_record>-keys = <vim_xextract_key>. PERFORM
bcset_force_into_entry USING <w_record> aendern actopts. APPEND
extract. EXIT. ENDLOOP. ENDLOOP. SORT extract BY <vim_xextract_key>.
ENDCASE. ENDFORM. FORM get_profile_status CHANGING vim_pr_tab LIKE
vim_pr_tab vim_pr_fields LIKE vim_pr_fields[]. DATA: w_profile TYPE
scpr_vals, w_vim_pr_tab TYPE vim_pr_tab_type, w_vim_pr_fields TYPE
vim_pr_fields_type, recnumber LIKE scprvals-recnumber, text(1000),
value LIKE vimsellist-value, gottext, first, rc LIKE sy-subrc,
fieldname TYPE fnam_____4. FIELD-SYMBOLS: <pr_key>, <x_keys> TYPE x,
<x_text> TYPE x, <bc_val> TYPE ANY, <imp_val> TYPE ANY, <keys_struc>
TYPE ANY, <text_struc> TYPE ANY. ASSIGN: w_vim_pr_tab-keys TO <x_keys>
CASTING, <x_keys> TO <keys_struc> CASTING TYPE (x_header-maintview). IF
x_header-bastab <> space AND x_header-texttbexst <> space. ASSIGN:
w_vim_pr_tab-textrecord TO <x_text> CASTING, <x_text> TO <text_struc>
CASTING TYPE (x_header-texttab). ENDIF. RANGES dont_use FOR
scprvals-recnumber. dont_use-sign = 'E'. dont_use-option = 'EQ'. LOOP
AT vim_pr_tab INTO w_vim_pr_tab. READ TABLE vim_pr_fields INTO
w_vim_pr_fields WITH KEY recnumber = w_vim_pr_tab-recnumber. <x_keys> =
<initial_x>(x_header-keylen). IF x_header-bastab <> space AND
x_header-texttbexst <> space. <x_text> = <initial_textkey_x>. ENDIF.
LOOP AT x_namtab WHERE keyflag = 'X' AND texttabfld IS INITIAL. IF
x_namtab-datatype = 'CLNT' AND x_header-clidep <> space. DELETE TABLE
w_vim_pr_fields-fields WITH TABLE KEY fieldname = x_namtab-viewfield.
MODIFY TABLE vim_pr_fields FROM w_vim_pr_fields. ELSE. CLEAR w_profile.
READ TABLE vim_profile_values INTO w_profile WITH KEY tablename =
x_header-viewname fieldname = x_namtab-viewfield recnumber =
w_vim_pr_tab-recnumber. IF w_profile-flag = vim_profile_fixkey. CASE
w_vim_pr_tab-keys_fix. WHEN space. w_vim_pr_tab-keys_fix =
vim_pr_all_fix. WHEN vim_pr_open. w_vim_pr_tab-keys_fix =
vim_pr_some_fix. ENDCASE. ELSE. CASE w_vim_pr_tab-keys_fix. WHEN space.
w_vim_pr_tab-keys_fix = vim_pr_open. WHEN vim_pr_all_fix.
w_vim_pr_tab-keys_fix = vim_pr_some_fix. ENDCASE. ENDIF. IF
x_namtab-readonly <> subset. CONCATENATE x_header-maintview
x_namtab-viewfield INTO fieldname SEPARATED BY '-'. ASSIGN:
w_profile-value TO <bc_val> CASTING TYPE (fieldname), COMPONENT
x_namtab-viewfield OF STRUCTURE <keys_struc> TO <imp_val>. <imp_val> =
<bc_val>. IF x_header-bastab <> space AND x_header-texttbexst <> space.
ASSIGN COMPONENT x_namtab-txttabfldn OF STRUCTURE <text_struc> TO
<imp_val>. <imp_val> = <bc_val>. ENDIF. ENDIF. w_vim_pr_fields-keys_fix
= w_vim_pr_tab-keys_fix. MODIFY vim_pr_fields FROM w_vim_pr_fields
TRANSPORTING keys_fix WHERE recnumber = w_vim_pr_fields-recnumber.
ENDIF. ENDLOOP. IF x_header-bastab <> space AND x_header-texttbexst <>
space AND w_vim_pr_tab-keys_fix <> vim_pr_error. CLEAR recnumber. IF
vim_pr_records > 1. WHILE gottext = space. gottext = 'X'. first = 'X'.
LOOP AT vim_profile_values INTO w_profile WHERE tablename =
x_header-texttab AND recnumber IN dont_use[]. IF first = 'X'. recnumber
= w_profile-recnumber. CLEAR first. ELSE. IF recnumber <>
w_profile-recnumber. IF gottext <> space. EXIT. ENDIF. recnumber =
w_profile-recnumber. ENDIF. ENDIF. IF w_profile-flag+2 = 'Y'. IF
w_profile-fieldname = x_header-sprasfield. IF w_profile-value(1) <>
sy-langu. dont_use-low = recnumber. APPEND dont_use. CLEAR: text,
gottext. CONTINUE. ENDIF. ELSE. READ TABLE x_namtab WITH KEY viewfield
= w_profile-fieldname keyflag = 'X' texttabfld = 'X'. CONCATENATE
x_header-texttab x_namtab-txttabfldn INTO fieldname SEPARATED BY '-'.
ASSIGN: w_profile-value TO <bc_val> CASTING TYPE (fieldname), COMPONENT
x_namtab-txttabfldn OF STRUCTURE <text_struc> TO <imp_val>. IF
<imp_val> <> <bc_val>. CLEAR gottext. dont_use-low = recnumber. APPEND
dont_use. CONTINUE. ENDIF. ENDIF. ENDIF. ENDLOOP. ENDWHILE. IF gottext
<> space. recnumber = w_profile-recnumber. ENDIF. ELSEIF vim_pr_records
= 1. ASSIGN COMPONENT x_header-sprasfield OF STRUCTURE <text_struc> TO
<imp_val>. <imp_val> = sy-langu. READ TABLE vim_profile_values INTO
w_profile WITH KEY tablename = x_header-texttab fieldname =
x_header-sprasfield value = sy-langu. IF sy-subrc = 0. recnumber =
w_profile-recnumber. ENDIF. ENDIF. IF NOT recnumber IS INITIAL. LOOP AT
x_namtab WHERE keyflag = space AND texttabfld = 'X'. CONCATENATE
x_header-texttab x_namtab-viewfield INTO fieldname SEPARATED BY '-'.
READ TABLE vim_profile_values INTO w_profile WITH KEY tablename =
x_header-texttab recnumber = recnumber fieldname = x_namtab-viewfield.
ASSIGN: w_profile-value TO <bc_val> CASTING TYPE (fieldname), COMPONENT
x_namtab-viewfield OF STRUCTURE <text_struc> TO <imp_val>. <imp_val> =
<bc_val>. APPEND w_profile-fieldname TO w_vim_pr_fields-fields.
ENDLOOP. ELSE. MOVE <text_initial_x> TO <x_text>. ENDIF. ENDIF. MODIFY
vim_pr_tab FROM w_vim_pr_tab. MODIFY TABLE vim_pr_fields FROM
w_vim_pr_fields. ENDLOOP. ENDFORM. FORM activate_profile CHANGING
p_selected TYPE c. DATA: pr_rc TYPE i, pr_funcsafe(4), pr_counter TYPE
i, pr_mark_entries VALUE 'X', hf1 TYPE i, hf TYPE i, cobj_type VALUE
'V', pr_key_da, pr_recnumber TYPE scpr_recnr, bc_id TYPE scpr_id,
bc_rec_found(1) TYPE c, actopts TYPE scpractopt. STATICS: viewname LIKE
vimdesc-viewname. FIELD-SYMBOLS: <pr_f1> TYPE x, <w_record> TYPE
vim_pr_tab_type, <bc_key> TYPE x. CHECK status-action NE anzeigen AND
status-action NE transportieren. CLEAR vim_pr_activating. IF p_selected
IS INITIAL. REFRESH: vim_profile_values, vim_pr_tab. ELSE. IF
vim_called_by_cluster <> space AND viewname <> x_header-viewname.
viewname = x_header-viewname. IF 'AU' CA status-action. PERFORM
get_pr_nbr_records USING vim_profile_values x_header CHANGING pr_rc
bc_id vim_pr_records vim_pr_tab vim_pr_fields. PERFORM
get_profile_status CHANGING vim_pr_tab vim_pr_fields. ENDIF. ENDIF.
ENDIF. PERFORM bcset_key_check_in_total. PERFORM markiere_alle USING
nicht_markiert. PERFORM import_profile USING actopts. IF
vim_called_by_cluster <> space. CALL FUNCTION
'VIEWCLUSTER_PR_IMPORT_CTRL' EXPORTING viewname = x_header-viewname
action = 'M' TABLES profile_values = vim_profile_values EXCEPTIONS
wrong_parameter = 1 OTHERS = 2. ENDIF. replace_mode = 'X'.
vim_special_mode = vim_upgrade. ASSIGN <vim_xtotal>(x_header-tablen) TO
<pr_f1> CASTING. LOOP AT extract. CHECK <xact> = aendern OR <xact> =
neuer_eintrag. CLEAR vim_bc_entry_list_wa. vim_bc_entry_list_wa-id =
bc_id. vim_bc_entry_list_wa-viewname = x_header-viewname. hf =
sy-tabix. READ TABLE total WITH KEY <vim_xextract_key> BINARY SEARCH.
IF sy-subrc EQ 0. hf1 = sy-tabix. IF <xact> EQ neuer_eintrag AND
<action> EQ geloescht OR <action> EQ neuer_geloescht OR <action> EQ
update_geloescht. status-delete = geloescht. <xact> = <action>. MODIFY
extract. pr_funcsafe = function. clear pr_rc. PERFORM
vim_mark_and_process USING hf 'UNDO' hf1 pr_rc. CLEAR status-delete.
function = pr_funcsafe. CHECK pr_rc NE 4. IF pr_rc EQ 8. EXIT. ENDIF.
READ TABLE extract INDEX hf. READ TABLE total WITH KEY
<vim_xextract_key> BINARY SEARCH. hf1 = sy-tabix. <xact> = aendern.
MODIFY extract. ENDIF. IF <vim_xtotal_key> = <vim_xextract_key>.
<action> = aendern. MODIFY total INDEX hf1. IF x_header-bastab NE space
AND x_header-texttbexst NE space. TRANSLATE <status>-upd_flag USING
' ETX'. ELSE. <status>-upd_flag = 'X'. ENDIF. ENDIF. ENDIF. CLEAR
vim_pr_fields_wa. CLEAR bc_rec_found. LOOP AT vim_pr_tab ASSIGNING
<w_record>. ASSIGN <w_record>-keys(x_header-keylen) TO <bc_key>. CHECK
<bc_key> = <vim_xextract_key>. bc_rec_found = 'X'. READ TABLE
vim_pr_fields INTO vim_pr_fields_wa WITH KEY recnumber =
<w_record>-recnumber. vim_bc_entry_list_wa-id = bc_id.
vim_bc_entry_list_wa-recnumber = <w_record>-recnumber.
vim_bc_entry_list_wa-keys = <bc_key>. vim_bc_entry_list_wa-action =
neuer_eintrag. INSERT LINES OF vim_pr_fields_wa-fields INTO TABLE
vim_bc_entry_list_wa-fields. EXIT. ENDLOOP. CHECK NOT bc_rec_found IS
INITIAL. IF <xact> <> aendern OR <pr_f1> <> <table2_x>. CHECK NOT
vim_pr_fields_wa IS INITIAL. <status>-prof_found = vim_pr_into_view.
PERFORM vim_modify_view_entry USING hf pr_rc. <status>-prof_found =
vim_profile_found. CHECK pr_rc NE 4. IF pr_rc EQ 8. EXIT. ENDIF. ENDIF.
READ TABLE total WITH KEY <vim_xtotal_key> BINARY SEARCH TRANSPORTING
NO FIELDS. IF <mark> EQ nicht_markiert. <mark> = markiert. ADD 1 TO
mark_total. MODIFY total INDEX sy-tabix. ENDIF. extract = total. MODIFY
extract. INSERT vim_bc_entry_list_wa INTO TABLE vim_bc_entry_list. IF
sy-subrc = 4. MODIFY TABLE vim_bc_entry_list FROM vim_bc_entry_list_wa.
ENDIF. ADD 1 TO pr_counter. ENDLOOP. IF pr_counter < vim_pr_records.
MESSAGE s818(sv) WITH pr_counter vim_pr_records. ELSE. MESSAGE
s819(sv). ENDIF. nextline = 1. CLEAR: vim_special_mode, replace_mode.
PERFORM fill_extract. IF status-action EQ hinzufuegen. status-action =
aendern. title-action = aendern. CLEAR <status>-selected. ENDIF. IF
status-mode = detail_bild. vim_next_screen = liste. vim_leave_screen =
'X'. ENDIF. ENDFORM. FORM set_profile_key_attributes USING p_name LIKE
vim_objfield CHANGING p_screen_input LIKE screen-input p_modify_screen
LIKE vim_modify_screen. DATA: w_field TYPE vimty_fields_type.
p_screen_input = '0'. CASE vim_pr_fields_wa-keys_fix. WHEN vim_pr_open.
p_screen_input = '1'. p_modify_screen = 'X'. WHEN vim_pr_all_fix.
p_screen_input = '0'. WHEN vim_pr_some_fix. READ TABLE
vim_pr_fields_wa-fields INTO w_field WITH KEY fieldname = p_name. IF
w_field-flag <> vim_profile_fixkey. p_screen_input = '1'.
p_modify_screen = 'X'. ENDIF. ENDCASE. ENDFORM. FORM
profile_put_into_wa USING p_bc_set LIKE vim_profile_values p_record
TYPE vim_pr_tab_type p_header TYPE vimdesc p_namtab LIKE x_namtab[]
p_subset TYPE xfeld p_action TYPE char1 actopts type scpractopt
CHANGING p_field. DATA: w_profile TYPE scpr_vals, fieldname TYPE
fnam_____4, old_guid TYPE REF TO data, tabname_wa TYPE objs-tabname,
objecttype TYPE objs-objecttype VALUE 'S'. STATICS: loc_viewname TYPE
objs-objectname, piecelist TYPE TABLE OF objs-tabname. FIELD-SYMBOLS:
<namtab> TYPE vimnamtab, <field> TYPE ANY, <old_guid> TYPE ANY,
<work_area> TYPE ANY, <bc_value> type any. CONSTANTS: no_standard(1)
TYPE c VALUE 'F', stan(3) TYPE c VALUE 'USE'. ASSIGN p_field TO
<work_area> CASTING TYPE (p_header-maintview). LOOP AT p_namtab
ASSIGNING <namtab> WHERE keyflag = space AND texttabfld = space. ASSIGN
COMPONENT <namtab>-viewfield OF STRUCTURE <work_area> TO <field>.
CONCATENATE p_header-maintview <namtab>-viewfield INTO fieldname
SEPARATED BY '-'. IF <namtab>-domname IN vim_guid_domain. IF p_action =
neuer. ELSE. IF p_record-keys_fix = vim_pr_all_fix. IF
p_header-frm_af_uid <> space. CREATE DATA old_guid TYPE (fieldname).
ASSIGN: old_guid->* TO <old_guid>. <old_guid> = <field>. ENDIF. ELSE.
CONTINUE. ENDIF. ENDIF. ENDIF. CASE <namtab>-readonly. WHEN space. READ
TABLE p_bc_set INTO w_profile WITH KEY tablename = p_header-viewname
fieldname = <namtab>-viewfield recnumber = p_record-recnumber
TRANSPORTING flag value. CHECK sy-subrc = 0. ASSIGN w_profile-value TO
<bc_value> CASTING TYPE (fieldname). if actopts-no_standrd NE
no_standard OR w_profile-flag NE stan. <field> = <bc_value>. endif.
WHEN rdonly OR vim_hidden. IF p_header-viewname NE loc_viewname.
loc_viewname = p_header-viewname. REFRESH piecelist. IF p_header-bastab
EQ space. objecttype = 'V'. ENDIF. SELECT tabname FROM objs INTO
tabname_wa WHERE objectname = p_header-viewname AND objecttype =
objecttype. APPEND tabname_wa TO piecelist. ENDSELECT. ENDIF. READ
TABLE p_bc_set INTO w_profile WITH KEY tablename = p_header-viewname
fieldname = <namtab>-viewfield recnumber = p_record-recnumber
TRANSPORTING flag value. CHECK sy-subrc = 0. READ TABLE piecelist INTO
tabname_wa WITH KEY <namtab>-bastabname. IF sy-subrc EQ 0. ASSIGN
w_profile-value TO <bc_value> CASTING TYPE (fieldname). IF
actopts-no_standrd NE no_standard OR w_profile-flag NE stan. <field> =
<bc_value>. ENDIF. ENDIF. WHEN subset. CHECK p_subset <> space. ASSIGN
COMPONENT <namtab>-viewfield OF STRUCTURE <initial> TO <bc_value>.
ENDCASE. IF <namtab>-domname IN vim_guid_domain AND p_record-keys_fix =
vim_pr_all_fix AND p_header-frm_af_uid <> space. PERFORM
(p_header-frm_af_uid) IN PROGRAM (p_header-fpoolname) USING <old_guid>
CHANGING <field> <work_area>. ENDIF. ENDLOOP. ENDFORM. FORM
get_pr_nbr_records USING vim_profile_values LIKE vim_profile_values
x_header TYPE vimdesc CHANGING p_rc like sy-subrc p_bc_id TYPE scpr_id
vim_pr_records TYPE i vim_pr_tab LIKE vim_pr_tab vim_pr_fields LIKE
vim_pr_fields. DATA: w_vim_pr_tab TYPE vim_pr_tab_type, first VALUE
'X', w_vim_pr_fields TYPE vim_pr_fields_type, w_fields TYPE
vimty_fields_type, recnumber TYPE scpr_recnr. FIELD-SYMBOLS:
<profile_value> LIKE LINE OF vim_profile_values. REFRESH: vim_pr_tab,
vim_pr_fields. CLEAR: vim_pr_records, p_rc. LOOP AT vim_profile_values
ASSIGNING <profile_value> WHERE tablename = x_header-viewname. IF
<profile_value>-recnumber <> recnumber. recnumber =
<profile_value>-recnumber. IF first = space. APPEND w_vim_pr_tab TO
vim_pr_tab. APPEND w_vim_pr_fields TO vim_pr_fields. CLEAR
w_vim_pr_fields. ENDIF. CLEAR first. w_vim_pr_fields-recnumber =
w_vim_pr_tab-recnumber = <profile_value>-recnumber. ADD 1 TO
vim_pr_records. ENDIF. w_fields-fieldname = <profile_value>-fieldname.
w_fields-flag = <profile_value>-flag. APPEND w_fields TO
w_vim_pr_fields-fields. ENDLOOP. p_rc = sy-subrc. CHECK sy-subrc = 0.
APPEND w_vim_pr_tab TO vim_pr_tab. APPEND w_vim_pr_fields TO
vim_pr_fields. p_bc_id = <profile_value>-id. ENDFORM. FORM
get_pr_field_from_sel USING p_pr_sellist TYPE vimsellist_type
p_pr_namtab LIKE vimnamtab CHANGING p_sel_value LIKE dpl_sellist-value
p_rc LIKE sy-subrc. DATA: w_sellist LIKE vimsellist, first. p_rc = 1.
first = 'X'. LOOP AT p_pr_sellist INTO w_sellist. CHECK
w_sellist-viewfield = p_pr_namtab-viewfield. IF first = space OR
w_sellist-operator <> 'EQ'. CLEAR p_sel_value. p_rc = 2. EXIT. ELSE.
MOVE w_sellist-value(p_pr_namtab-flength) TO
p_sel_value(p_pr_namtab-flength). p_rc = 0. ENDIF. CLEAR first.
ENDLOOP. ENDFORM. FORM vim_pr_mand_fields. LOOP AT SCREEN. CHECK
screen-required <> '0'. vim_pr_activating = 'X'. SET SCREEN detail.
LEAVE SCREEN. ENDLOOP. ENDFORM. FORM bcset_key_check_in_total. DATA:
w_record TYPE vim_pr_tab_type. FIELD-SYMBOLS: <bc_key> TYPE x. ASSIGN
w_record-keys(x_header-keylen) TO <bc_key>. LOOP AT vim_pr_tab INTO
w_record. CLEAR w_record-action. READ TABLE total WITH KEY <bc_key>
BINARY SEARCH TRANSPORTING NO FIELDS. IF sy-subrc = 0. w_record-action
= aendern. ELSE. w_record-action = neuer_eintrag. ENDIF. MODIFY
vim_pr_tab FROM w_record. ENDLOOP. ENDFORM. FORM bcset_force_into_entry
USING p_record TYPE vim_pr_tab_type p_action TYPE char1 actopts TYPE
scpractopt. field-symbols: <textrec_x> type x. IF <xmark> =
nicht_markiert. <xmark> = markiert. ADD 1 TO mark_extract. ENDIF.
<xact> = p_action. PERFORM profile_put_into_wa USING vim_profile_values
p_record x_header x_namtab[] 'X' p_action actopts CHANGING
<vim_xextract>. IF x_header-texttbexst <> space AND x_header-bastab <>
space. assign p_record-textrecord(x_header-texttablen) to <textrec_x>
casting. move <textrec_x> to <vim_xextract_text>. ENDIF. ENDFORM. FORM
detailbild. IF status-mode NE list_bild OR status-type NE zweistufig.
MESSAGE i001(sv). EXIT. ENDIF. nextline = firstline + l - 1. IF l EQ 0
OR nextline GT maxlines. MESSAGE s032(sv). MOVE firstline TO nextline.
EXIT. ENDIF. IF mark_extract > 0. PERFORM set_mark_only USING nextline.
ENDIF. IF x_header-delmdtflag NE space. TRANSLATE vim_no_mainkey_exists
USING vim_no_mkey_not_procsd_patt. ENDIF. PERFORM process_detail_screen
USING 'S'. ENDFORM. FORM detail_abbrechen. IF replace_mode EQ space AND
( sy-datar NE space OR ( x_header-bastab EQ space OR
x_header-texttbexst EQ space ) AND <table1_x> NE <table2_x> OR
x_header-bastab NE space AND x_header-texttbexst NE space AND (
<table1_x> NE <vim_xextract_enti> OR <table1_xtext> NE
<vim_xextract_text> ) ). CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING titel = svim_text_007 textline1 = svim_text_009 textline2 =
svim_text_006 defaultoption = 'N' cancel_display = ' ' IMPORTING answer
= answer. IF answer NE 'J'. EXIT. ENDIF. ENDIF. IF status-action EQ
kopieren. SET SCREEN 0. LEAVE SCREEN. ENDIF. IF maxlines LE 1. IF
status-action EQ hinzufuegen. status-action = aendern. title-action =
aendern. CLEAR <status>-selected. ENDIF. PERFORM fill_extract. nextline
= 1. ENDIF. neuer = 'N'. IF vim_single_entry_function EQ space.
<status>-upd_flag = space. IF replace_mode EQ space AND
vim_special_mode NE vim_delete. l = nextline - <status>-firstline + 1.
IF l LE 0 OR l GT looplines. l = 1. ENDIF. nextline =
<status>-firstline. SET SCREEN liste. ELSE. SET SCREEN 0. CLEAR
vim_act_dynp_view. ENDIF. ELSE. function = end. SET SCREEN 0. CLEAR
vim_act_dynp_view. PERFORM update_status. ENDIF. LEAVE SCREEN. ENDFORM.
FORM detail_back. DATA:count TYPE i. CASE status-action. WHEN aendern.
PERFORM update_tab. WHEN hinzufuegen. move <f1_x> to <f1_wax>. PERFORM
update_tab. neuer = 'N'. SORT extract BY <vim_xextract_key>. READ TABLE
extract WITH KEY <f1_x>. firstline = 1. IF sy-tabix GT looplines AND
looplines GT 0. count = ( sy-tabix - firstline ) div looplines + 1. DO
count TIMES. firstline = firstline + looplines - 1. ENDDO. MOVE
firstline TO <status>-firstline. ENDIF. l = sy-tabix - firstline + 1.
MOVE l TO <status>-cur_line. MOVE <initial> TO <table1>. IF
x_header-bastab NE space AND x_header-texttbexst NE space. MOVE
<text_initial_x> TO <table1_xtext>. ENDIF. ENDCASE. IF status-data EQ
auswahldaten AND maxlines LE 1. <table1_wax> = <vim_xextract>. IF
status-delete = geloescht. status-delete = nicht_geloescht.
title-action = aendern. PERFORM markiere_alle USING nicht_markiert.
ENDIF. IF status-action EQ hinzufuegen. status-action = aendern.
title-action = aendern. CLEAR <status>-selected. ENDIF. IF
x_header-delmdtflag NE space. <vim_h_mkey>(x_header-keylen) = <f1_x>.
LOOP AT vim_collapsed_mainkeys. IF vim_collapsed_mainkeys-mkey_bf EQ
space. if <vim_collapsed_mkey_bfx> NE <vim_mkey_beforex>.
<vim_collapsed_mkey_bfx> = <vim_collapsed_logkeyx>. endif. CLEAR
vim_collapsed_mainkeys-log_key. ENDIF. <f1_x> = <vim_h_coll_mkey>.
<vim_enddate_mask> = space. <vim_h_coll_mkey> = <f1_x>. MODIFY
vim_collapsed_mainkeys. ENDLOOP. IF vim_delim_expa_excluded NE space.
DELETE excl_cua_funct WHERE function EQ 'EXPA'. CLEAR
vim_delim_expa_excluded. ENDIF. IF status-action = aendern AND
title-action = hinzufuegen. title-action = aendern. ENDIF. ENDIF.
PERFORM fill_extract. READ TABLE extract WITH KEY <f1_wax>. IF sy-subrc
EQ 0. nextline = sy-tabix. ELSE. nextline = 1. ENDIF. ELSE. MOVE
firstline TO nextline. ENDIF. vim_next_screen = liste. vim_leave_screen
= 'X'. ENDFORM. FORM detail_exit_command. DATA: answer. function =
ok_code. CLEAR vim_old_viewkey. TRANSLATE vim_no_mainkey_exists USING
vim_no_mkey_not_procsd_patt. CASE ok_code. WHEN 'ABR '. CLEAR ok_code.
PERFORM detail_abbrechen. WHEN 'IGN '. PERFORM ignorieren. WHEN 'UPRF'.
CHECK vim_pr_activating = space. IF NOT function IS INITIAL. PERFORM
vim_pr_mand_fields. ENDIF. WHEN 'GPRF'. CHECK vim_pr_activating =
space. PERFORM vim_pr_mand_fields . ENDCASE. ENDFORM. FORM detail_init.
CONSTANTS: forward VALUE 'X'. IF function NE space. status-mode =
detail_bild. title-mode = detail_bild. IF <xmark> EQ markiert.
status-mark = markiert. ELSE. status-mark = nicht_markiert. ENDIF. IF
status-action NE kopieren AND neuer NE 'J'. IF <status>-selected =
by_field_contents AND nextline > maxlines. nextline = 1. ENDIF. IF
x_header-subsetflag NE space AND replace_mode EQ space. PERFORM
fill_subsetfields. ENDIF. if nextline > maxlines. PERFORM read_table
USING maxlines. else. PERFORM read_table USING nextline. endif. IF
x_header-subsetflag NE space. PERFORM complete_subsetfields. ENDIF.
ENDIF. IF vim_special_mode EQ vim_delimit. MOVE vim_sval_tab-value TO
<vim_new_begdate>. ENDIF. ENDIF. CLEAR: vim_key_alr_checked,
vim_keyrange_alr_checked. vim_act_dynp_view = x_header-viewname.
PERFORM set_title USING title <name>. CASE replace_mode. WHEN space. IF
neuer NE 'X'. IF vim_special_mode NE vim_delete. PERFORM set_pf_status
USING status. ELSE. PERFORM set_pf_status USING 'REPLACE'. ENDIF.
ENDIF. WHEN OTHERS. PERFORM set_pf_status USING 'REPLACE'. ENDCASE.
ENDFORM. FORM detail_loesche. DATA: tot_ix LIKE sy-tabix, rec LIKE
sy-subrc, delete_fix_value(1) TYPE c, entry_contains_fix_val(1) TYPE c,
w_field TYPE vimty_fields_type, bc_fix_del_info_sent(1) TYPE c VALUE
' '. delete_fix_value = vim_bc_chng_allowed. IF vim_bc_chng_allowed =
space. READ TABLE vim_bc_entry_list INTO vim_bc_entry_list_wa WITH
TABLE KEY viewname = x_header-viewname keys = <vim_xextract_key>. IF
sy-subrc = 0. CLEAR entry_contains_fix_val. LOOP at
vim_bc_entry_list_wa-fields into w_field. IF w_field-flag =
vim_profile_fix. entry_contains_fix_val = 'X'. ENDIF. ENDLOOP. IF
entry_contains_fix_val = 'X'. IF bc_fix_del_info_sent EQ SPACE AND
<status>-bcfixdelinfosent NE 'Y'. bc_fix_del_info_sent = 'X'.
<status>-bcfixdelinfosent = 'X'. MESSAGE i177(SV). ENDIF. ELSE.
delete_fix_value = 'X'. ENDIF. ELSE. delete_fix_value = 'X'. ENDIF.
ENDIF. CHECK delete_fix_value EQ 'X'. IF <xmark> NE uebergehen. READ
TABLE total WITH KEY <vim_xextract_key> BINARY SEARCH. MOVE sy-tabix TO
tot_ix. IF x_header-existency EQ 'M'. PERFORM
check_if_entry_can_be_deleted. IF sy-subrc NE 0. <xmark> = uebergehen.
ignored_entries_exist = 'X'. MODIFY extract INDEX nextline. <mark> =
uebergehen. MODIFY total INDEX tot_ix. EXIT. ENDIF. ENDIF. PERFORM
logical_delete_from_total USING tot_ix. IF <xmark> EQ markiert.
mark_total = mark_total - 1. mark_extract = mark_extract - 1. ENDIF. IF
x_header-delmdtflag NE space. IF vim_special_mode NE vim_upgrade.
PERFORM check_if_entry_is_to_display USING 'L' <vim_xtotal_key> space
<vim_begdate>. ELSE. CLEAR sy-subrc. ENDIF. ENDIF. IF
x_header-delmdtflag EQ space OR sy-subrc LT 8. rec = sy-subrc. DELETE
extract INDEX nextline. IF rec EQ 4. LOOP AT total. PERFORM select
USING <status>-selected. CHECK sy-subrc EQ 0. CHECK
<vim_tot_mkey_beforex> EQ <vim_old_mkey_beforex> AND (
vim_mkey_after_exists EQ space OR <vim_tot_mkey_afterx> EQ
<vim_old_mkey_afterx> ). vim_mainkey = vim_old_viewkey. extract =
total. PERFORM mod_extract_and_mainkey_tab USING 'I' nextline. EXIT.
ENDLOOP. ENDIF. ENDIF. IF vim_special_mode EQ vim_upgrade. counter = 1.
EXIT. ENDIF. IF ignored_entries_exist EQ space AND maxlines GT 1.
MESSAGE s013(sv). ELSE. MESSAGE i013(sv). ENDIF. ENDIF. IF
<status>-mark_only <> space. DESCRIBE TABLE extract LINES maxlines. IF
mark_extract = 0. nextline = 1. vim_next_screen = liste.
vim_leave_screen = 'X'. ELSE. nextline = nextline - 1. PERFORM
get_marked_entry USING 'X' CHANGING nextline rec. IF rec <> 0. nextline
= nextline + 1. PERFORM get_marked_entry USING space CHANGING nextline
rec. ENDIF. IF rec <> 0. nextline = 1. vim_next_screen = liste.
vim_leave_screen = 'X'. ELSE. PERFORM get_page_and_position USING
nextline looplines CHANGING firstline l. ENDIF. ENDIF. ELSE. DESCRIBE
TABLE extract LINES maxlines. IF maxlines EQ 0. nextline = 1. IF
status-action EQ hinzufuegen. status-action = aendern. title-action =
aendern. ENDIF. PERFORM fill_extract. vim_next_screen = liste.
vim_leave_screen = 'X'. ENDIF. IF nextline GT maxlines. nextline =
maxlines. ENDIF. ENDIF. READ TABLE total INDEX tot_ix. CLEAR
vim_old_viewkey. TRANSLATE vim_no_mainkey_exists USING
vim_no_mkey_not_procsd_patt. ENDFORM. FORM detail_markiere. IF neuer EQ
'J'. EXIT. ENDIF. PERFORM update_tab. PERFORM markiere USING nextline.
CLEAR function. ENDFORM. FORM detail_markierte. DATA: rc LIKE sy-subrc.
IF status-mode NE list_bild OR status-type NE zweistufig. MESSAGE
i001(sv). EXIT. ENDIF. IF mark_extract = 0. PERFORM detailbild. EXIT.
ENDIF. <status>-mark_only = 'X'. nextline = 0. PERFORM get_marked_entry
USING 'X' CHANGING nextline rc. IF rc <> 0. PERFORM detailbild. EXIT.
ENDIF. IF x_header-delmdtflag NE space. TRANSLATE vim_no_mainkey_exists
USING vim_no_mkey_not_procsd_patt. ENDIF. PERFORM process_detail_screen
USING 'S'. ENDFORM. FORM detail_pai. CLEAR: vim_next_screen,
vim_leave_screen. MOVE: status-data TO <status>-st_data, status-mode TO
<status>-st_mode, status-delete TO <status>-st_delete, status-action TO
<status>-st_action, title TO <status>-title, maxlines TO
<status>-maxlines, mark_extract TO <status>-mk_xt, mark_total TO
<status>-mk_to, function TO <status>-fcode. IF x_header-ptfrkyexst NE
space. PERFORM consistency_prt_frky_fields USING 'X'. ENDIF. IF
<status>-prof_found <> space. CLEAR vim_pr_fields_wa. ENDIF. IF
vim_special_mode NE vim_upgrade AND temporal_delimitation_happened NE
space AND status-action NE kopieren. PERFORM update_tab. PERFORM
after_temporal_delimitation. CLEAR temporal_delimitation_happened.
PERFORM check_if_entry_is_to_display USING 'L' <f1_x> space
<vim_begdate>. IF status-action EQ hinzufuegen. IF function NE 'NEXT'.
CASE sy-subrc. WHEN 0. PERFORM read_table USING nextline. WHEN 4. READ
TABLE extract WITH KEY <f1_x>. nextline = sy-tabix. extract = total.
CLEAR function. WHEN OTHERS. LOOP AT extract. CHECK
<vim_ext_mkey_beforex> EQ <vim_f1_beforex> AND ( vim_mkey_after_exists
EQ space OR <vim_ext_mkey_afterx> EQ <vim_f1_afterx> ). nextline =
sy-tabix. EXIT. ENDLOOP. extract = total. CLEAR function. ENDCASE.
ENDIF. ELSE. IF sy-subrc EQ 0. ADD 1 TO exind. nextline = exind. ENDIF.
ENDIF. ENDIF. CLEAR ok_code. IF replace_mode NE space AND (
vim_special_mode NE vim_upgrade OR NOT function IN exted_functions ).
PERFORM update_tab. vim_next_screen = 0. vim_leave_screen = 'X'. EXIT.
ELSEIF vim_special_mode EQ vim_delete. vim_next_screen = 0.
vim_leave_screen = 'X'. EXIT. ENDIF. IF vim_single_entry_function NE
space AND function NE space. IF vim_single_entry_ins_key_input EQ
space. TRANSLATE status-action USING 'AU'. status-data = gesamtdaten.
ENDIF. IF function EQ 'UEBE'. function = 'ENDE'. ENDIF. ENDIF. CASE
function. WHEN 'ADDR'. PERFORM address_maintain. WHEN 'AEND'. PERFORM
anzg_to_aend. WHEN 'ALCO'. PERFORM selektiere USING transportieren.
WHEN 'ALMK'. PERFORM selektiere USING markiert. WHEN 'ALNC'. PERFORM
selektiere USING space. WHEN 'ALOE'. PERFORM selektiere USING
geloescht. WHEN 'ALNW'. PERFORM selektiere USING neuer_eintrag. WHEN
'ANZG'. PERFORM update_tab. IF l EQ 0. MOVE: 1 TO l, 1 TO
<status>-cur_line. ENDIF. vim_next_screen = 0. vim_leave_screen = 'X'.
WHEN 'ATAB'. PERFORM update_tab. IF l EQ 0. MOVE: 1 TO l, 1 TO
<status>-cur_line. ENDIF. vim_next_screen = 0. vim_leave_screen = 'X'.
WHEN 'BCCH'. PERFORM vim_chng_fix_flds. WHEN 'BCSH'. PERFORM
vim_bc_show_fix_flds. WHEN 'DELE'. PERFORM loeschen. IF replace_mode NE
space. <status>-mk_to = mark_total. <status>-mk_xt = mark_extract.
vim_next_screen = 0. vim_leave_screen = 'X'. EXIT. ENDIF. WHEN 'DELM'.
PERFORM delimitation. WHEN 'ENDE'. PERFORM update_tab. IF l EQ 0. MOVE:
1 TO l, 1 TO <status>-cur_line. ENDIF. vim_next_screen = 0.
vim_leave_screen = 'X'. WHEN 'EXPA'. WHEN 'FDOC'. PERFORM
show_function_docu. CLEAR function. WHEN 'KOPE'. counter = 0. PERFORM
kopiere. WHEN 'KOPF'. PERFORM kopiere_eintrag USING <orig_key>. WHEN
'LANG'. PERFORM vim_set_languages. CLEAR function. WHEN 'MKEZ'. PERFORM
detail_markiere. WHEN 'NEWL'. PERFORM update_tab. CLEAR
<status>-mark_only. PERFORM hinzufuegen. WHEN 'NEXT'. PERFORM
naechster. WHEN 'ORDR'. PERFORM order_administration. WHEN 'ORGI'.
PERFORM original_holen. WHEN 'POSI'. PERFORM popup_positionieren. WHEN
'PREV'. PERFORM voriger. WHEN 'PRMO'. PERFORM update_tab. PERFORM
list_alv. WHEN 'PROT'. PERFORM logs_analyse. WHEN 'PRST'. PERFORM
update_tab. PERFORM list_alv. WHEN 'SAVE'. PERFORM update_tab. IF
status-action EQ hinzufuegen. SORT extract BY <vim_xextract_key>. READ
TABLE extract WITH KEY <vim_xextract_key>. <status>-cur_line = l =
sy-tabix - firstline + 1. ENDIF. vim_next_screen = 0. vim_leave_screen
= 'X'. WHEN 'SCRF'. PERFORM update_tab. PERFORM
vim_sapscript_form_maint. WHEN 'SEAR'. PERFORM update_tab. PERFORM
suchen. WHEN 'SELU'. PERFORM selektiere USING aendern. WHEN 'TEXT'.
PERFORM update_tab. PERFORM vim_multi_langu_text_maint. WHEN 'TREX'.
MOVE geloescht TO corr_action. PERFORM update_corr. IF replace_mode NE
space. <status>-mk_to = mark_total. <status>-mk_xt = mark_extract.
vim_next_screen = 0. vim_leave_screen = 'X'. EXIT. ENDIF. WHEN 'TRIN'.
MOVE hinzufuegen TO corr_action. PERFORM update_corr. IF replace_mode
NE space. <status>-mk_to = mark_total. <status>-mk_xt = mark_extract.
vim_next_screen = 0. vim_leave_screen = 'X'. EXIT. ENDIF. WHEN 'TRSP'.
IF x_header-cursetting NE space AND x_header-flag EQ
vim_transport_denied. x_header-flag = x_header-cursetting. TRANSLATE
x_header-flag USING 'X YX'. MODIFY x_header INDEX 1. ENDIF.
vim_next_screen = 0. vim_leave_screen = 'X'. WHEN 'UEBE'. PERFORM
detail_back. WHEN 'UPRF'. message s175(SV). WHEN 'UNDO'. PERFORM
zurueckholen. IF replace_mode NE space. <status>-mk_to = mark_total.
<status>-mk_xt = mark_extract. vim_next_screen = 0. vim_leave_screen =
'X'. EXIT. ENDIF. WHEN '    '. IF vim_prt_fky_flds_updated NE space.
CLEAR vim_prt_fky_flds_updated. PERFORM update_tab. ELSE. IF
x_header-frm_h_flds NE space. PERFORM (x_header-frm_h_flds) IN PROGRAM.
ENDIF. IF neuer EQ 'J' AND vim_key_alr_checked EQ space. IF
x_header-frm_on_new NE space. PERFORM (x_header-frm_on_new) IN PROGRAM.
ENDIF. ENDIF. PERFORM check_key. ENDIF. WHEN OTHERS. IF
vim_called_by_cluster NE space. CALL FUNCTION 'VIEWCLUSTER_NEXT_ACTION'
EXPORTING detail = 'X' IMPORTING leave_screen = vim_leave_screen
CHANGING fcode = function. IF vim_leave_screen NE space. PERFORM
update_tab. vim_next_screen = 0. ENDIF. ENDIF. ENDCASE. ENDFORM. FORM
detail_zurueckholen. DATA: tot_ix LIKE sy-tabix, msg_type(1) TYPE c,
msg_no LIKE sy-msgno, rc LIKE sy-subrc. IF x_header-delmdtflag NE
space. counter = 1. PERFORM temporal_delimitation. ENDIF. IF <xmark> EQ
markiert. mark_total = mark_total - 1. mark_extract = mark_extract - 1.
ENDIF. READ TABLE total WITH KEY <vim_xextract_key> BINARY SEARCH. MOVE
sy-tabix TO tot_ix. PERFORM logical_undelete_total USING sy-tabix. IF
temporal_delimitation_happened NE space. CLEAR vim_delim_entries.
PERFORM check_if_entry_is_to_display USING 'L' <vim_xtotal_key> space
<vim_begdate>. IF sy-subrc LT 8. vim_delim_entries-index3 = nextline.
IF sy-subrc EQ 4. LOOP AT total. CHECK <action> EQ geloescht OR
<action> EQ neuer_geloescht OR <action> EQ update_geloescht. CHECK
<vim_tot_mkey_beforeX> EQ <vim_old_mkey_beforeX> AND (
vim_mkey_after_exists EQ space OR <vim_tot_mkey_afterX> EQ
<vim_old_mkey_afterX> ). vim_delim_entries-index1 = sy-tabix.
vim_delim_entries-index2 = vim_delim_entries-index3. EXIT. ENDLOOP.
ENDIF. APPEND vim_delim_entries. ENDIF. PERFORM
after_temporal_delimitation. CLEAR temporal_delimitation_happened.
ELSE. IF replace_mode NE space AND vim_external_mode EQ space. extract
= total. MODIFY extract INDEX nextline. ELSE. DELETE extract INDEX
nextline. SUBTRACT 1 FROM maxlines. ENDIF. ENDIF. IF replace_mode EQ
space. IF counter GT 1. msg_no = '002'. ELSE. msg_no = '003'. ENDIF. IF
ignored_entries_exist EQ space. msg_type = 'S'. ELSE. msg_type = 'W'.
ENDIF. MESSAGE ID 'SV' TYPE msg_type NUMBER msg_no WITH counter. IF
nextline NE 1 AND nextline GT maxlines. nextline = maxlines. ENDIF. IF
maxlines EQ 0. title-action = aendern. status-delete = nicht_geloescht.
vim_next_screen = liste. vim_leave_screen = 'X'. ELSEIF
<status>-mark_only <> space. IF mark_extract = 0. nextline = 1.
vim_next_screen = liste. vim_leave_screen = 'X'. ELSE. nextline =
nextline - 1. PERFORM get_marked_entry USING 'X' CHANGING nextline rc.
IF rc <> 0. nextline = nextline + 1. PERFORM get_marked_entry USING
space CHANGING nextline rc. ENDIF. IF rc <> 0. nextline = 1.
vim_next_screen = liste. vim_leave_screen = 'X'. ELSE. PERFORM
get_page_and_position USING nextline looplines CHANGING firstline l.
ENDIF. ENDIF. ENDIF. READ TABLE total INDEX tot_ix. ELSE. counter = 1.
ENDIF. CLEAR vim_old_viewkey. TRANSLATE vim_no_mainkey_exists USING
vim_no_mkey_not_procsd_patt. ENDFORM. FORM get_marked_entry USING
p_forward TYPE sychar01 CHANGING p_index LIKE sy-tabix p_rc LIKE
sy-subrc. DATA: bw_index LIKE sy-tabix. p_rc = 4. IF p_forward IS
INITIAL. bw_index = p_index - 1. WHILE bw_index > 0. READ TABLE extract
INDEX bw_index. IF <xmark> = markiert. p_index = bw_index. CLEAR p_rc.
EXIT. ENDIF. bw_index = bw_index - 1. ENDWHILE. ELSE. p_index = p_index
+ 1. LOOP AT extract FROM p_index. CHECK <xmark> = markiert. p_index =
sy-tabix. CLEAR p_rc. EXIT. ENDLOOP. IF p_rc > 0. p_index = p_index -
1. ENDIF. ENDIF. ENDFORM. FORM naechster. DATA: last_list_pos LIKE
sy-tabix, rc LIKE sy-subrc. IF status-action NE anzeigen AND
status-action NE transportieren AND status-mode NE list_bild. PERFORM
update_tab. ENDIF. IF <status>-mark_only = space. nextline = nextline +
1. IF nextline GT maxlines. IF status-action NE hinzufuegen. nextline =
maxlines. MESSAGE s008(sv). EXIT. ELSE. IF status-type EQ zweistufig
AND status-mode EQ detail_bild. neuer = 'J'. MOVE <initial> TO
<table1>. MOVE <table1> TO <vim_extract_struc>. IF x_header-bastab NE
space AND x_header-texttbexst NE space. MOVE: <text_initial_x> TO
<table1_xtext>, <table1_xtext> TO <vim_xextract_text>. ENDIF. nextline
= maxlines + 1. ELSE. nextline = nextline - 1. MESSAGE s008(sv). ENDIF.
ENDIF. ENDIF. ELSE. PERFORM get_marked_entry USING 'X' CHANGING
nextline rc. IF rc <> 0. MESSAGE s830(sv). EXIT. ENDIF. ENDIF. IF
looplines = 0. l = nextline - firstline + 1. MOVE l TO
<status>-cur_line. ELSEIF looplines = 1. firstline = l = 1. MOVE:
firstline TO <status>-firstline, l TO <status>-cur_line. ELSEIF
looplines > 1. IF status-mode EQ detail_bild. last_list_pos = firstline
+ looplines - 1. IF nextline GT last_list_pos. IF <status>-mark_only =
space. firstline = firstline + looplines - 1. l = 2. ELSE. PERFORM
get_page_and_position USING nextline looplines CHANGING firstline l.
ENDIF. MOVE: firstline TO <status>-firstline, l TO <status>-cur_line.
ELSE. IF status-mode NE list_bild. l = nextline - firstline + 1. MOVE l
TO <status>-cur_line. ENDIF. ENDIF. ENDIF. ENDIF. ENDFORM. FORM
set_mark_only USING p_index LIKE sy-tabix. DATA: rc LIKE sy-subrc.
PERFORM check_marked USING p_index CHANGING rc. IF rc = 0.
<status>-mark_only = 'X'. ENDIF. ENDFORM. FORM process_detail_screen
USING value(mode) TYPE c. DATA: modulpool LIKE trdir-name,
no_input_happened(1) TYPE c, state_action(1) TYPE c. IF detail NE
'0000'. IF mode EQ 'S'. SET SCREEN detail. LEAVE SCREEN. ELSE. PERFORM
vim_imp_call_screen USING detail. ENDIF. ELSE. RAISE
detail_scr_nbr_missing. ENDIF. ENDFORM. FORM voriger. DATA: rc LIKE
sy-subrc, n TYPE i. IF status-action NE anzeigen AND status-action NE
transportieren AND status-mode NE list_bild. PERFORM update_tab. ENDIF.
IF <status>-mark_only = space. nextline = nextline - 1. IF nextline LE
0. nextline = 1. MESSAGE s007(sv). ELSEIF nextline LT firstline. IF
looplines > firstline. firstline = 1. l = nextline. ELSE. firstline =
firstline - looplines + 1. l = looplines - 1. ENDIF. MOVE: firstline TO
<status>-firstline, l TO <status>-cur_line. ELSE. l = nextline -
firstline + 1. MOVE l TO <status>-cur_line. ENDIF. ELSE. n = nextline
DIV ( looplines - 1 ). PERFORM get_marked_entry USING space CHANGING
nextline rc. IF rc > 0. MESSAGE s831(sv). ELSE. IF nextline LT
firstline. PERFORM get_page_and_position USING nextline looplines
CHANGING firstline l. MOVE: firstline TO <status>-firstline, l TO
<status>-cur_line. ELSE. l = nextline - firstline + 1. MOVE l TO
<status>-cur_line. ENDIF. ENDIF. ENDIF. ENDFORM. FORM check_marked
USING p_index LIKE sy-tabix CHANGING p_rc LIKE sy-subrc. p_rc = 4. READ
TABLE extract INDEX p_index. IF sy-subrc = 0 AND <xmark> = markiert.
CLEAR p_rc. ENDIF. ENDFORM. FORM get_page_and_position USING p_line
LIKE sy-tabix p_looplines LIKE sy-tabix CHANGING p_first LIKE sy-tabix
p_pageline LIKE sy-tabix. DATA: m TYPE i. m = p_line DIV ( p_looplines
- 1 ). p_first = m * ( p_looplines - 1 ) + 1. p_pageline = p_line MOD (
p_looplines - 1 ). ENDFORM. FORM vim_modify_detail_screen. DATA:
dummyflag TYPE xfeld. CLEAR vim_set_from_bc_pbo. IF replace_mode =
space AND status-action = aendern AND vim_bc_chng_allowed = space. READ
TABLE vim_bc_entry_list INTO vim_bc_entry_list_wa WITH TABLE KEY
viewname = x_header-viewname keys = <vim_xextract_key>. IF sy-subrc =
0. vim_set_from_bc_pbo = 'X'. ENDIF. ENDIF. LOOP AT SCREEN. SPLIT
screen-name AT '-' INTO vim_object vim_objfield. IF status-action EQ
anzeigen OR status-action EQ transportieren OR status-delete EQ
geloescht. screen-input = '0'. ELSE. IF screen-group1 EQ 'KEY' AND
screen-required NE 0 AND screen-input NE '0'. screen-input = '0'.
ENDIF. IF status-action EQ hinzufuegen OR status-action EQ kopieren. IF
neuer CO 'XJ' . IF screen-group1 EQ 'KEY'. IF (
vim_single_entry_function NE 'INS' OR vim_single_entry_ins_key_input NE
space ) AND ( x_header-existency NE 'M' OR screen-name EQ
vim_enddate_name ). screen-input = '1'. ENDIF. IF
vim_single_entry_function EQ 'INS'. screen-request = '1'. sy-subrc = 8.
ENDIF. ENDIF. IF vim_special_mode EQ vim_upgrade AND function NE
'DELE'. IF <status>-prof_found = vim_pr_into_view AND screen-group1 =
'KEY'. PERFORM set_profile_key_attributes USING vim_objfield CHANGING
screen-input vim_modify_screen. CLEAR vim_modify_screen. ENDIF.
screen-request = '1'. sy-subrc = 8. ENDIF. ENDIF. IF vim_pr_activating
<> space. IF screen-required = '1'. screen-required = '0'. ENDIF.
ENDIF. ELSE. IF replace_mode NE space. CASE vim_special_mode. WHEN
vim_replace. IF screen-name EQ sel_field_for_replace_l. screen-request
= '1'. sy-subrc = 8. IF screen-invisible = '1'. screen-input = '1'.
ENDIF. ENDIF. WHEN vim_upgrade. IF NOT function IN exted_functions.
screen-request = '1'. sy-subrc = 8. ENDIF. ENDCASE. ELSE. IF
vim_special_mode EQ vim_delete. screen-input = '0'. ENDIF. IF
x_header-delmdtflag NE space AND x_header-existency EQ 'U' AND
screen-name EQ vim_begdate_name. screen-input = '0'. ENDIF. ENDIF. IF
status-action = aendern AND neuer <> 'J'. IF vim_set_from_bc_pbo <>
space. PERFORM vim_bc_logs_use USING vim_objfield vim_bc_entry_list_wa
CHANGING screen dummyflag. ENDIF. ENDIF. ENDIF. ENDIF. IF <xmark> EQ
markiert AND <status>-mark_only = space. screen-intensified = '1'.
ENDIF. IF vim_objfield <> space AND vim_object = x_header-maintview.
LOOP AT x_namtab WHERE viewfield = vim_objfield AND ( texttabfld =
space OR keyflag = space ). IF x_namtab-readonly = vim_hidden.
screen-active = '0'. ELSEIF x_namtab-readonly = rdonly. screen-input =
'0'. ENDIF. EXIT. ENDLOOP. ENDIF. MODIFY SCREEN. ENDLOOP. ENDFORM. FORM
list_alv. STATICS: texttab_begin LIKE sy-tabix, textlen TYPE intlen,
unittab TYPE tabname, unitname TYPE fieldname, cukytab TYPE tabname,
cukyname TYPE fieldname, glob_unitvalue(3) TYPE c, glob_cukyvalue TYPE
vim_cuky. DATA: textfld_no, textoffset TYPE intlen, rc LIKE sy-subrc,
progname LIKE sy-repid, value_len TYPE intlen, w_alv_value_tab TYPE
tabl8000. FIELD-SYMBOLS: <alv_fcat> LIKE LINE OF vim_alv_fcat,
<textfields>. IF x_header-frm_bf_prn <> space. PERFORM drucken_ztp_alt.
EXIT. ENDIF. IF NOT vim_alv_fcat[] IS INITIAL. READ TABLE vim_alv_fcat
ASSIGNING <alv_fcat> INDEX 1. IF <alv_fcat>-ref_tabname <> view_name.
UNASSIGN <alv_fcat>. FREE vim_alv_fcat. ENDIF. ENDIF. IF vim_alv_fcat[]
IS INITIAL. PERFORM fill_alv_fieldcat CHANGING vim_alv_fcat
texttab_begin vim_alv_value_length unittab unitname glob_unitvalue
cukytab cukyname glob_cukyvalue. PERFORM define_alv_callbacks CHANGING
vim_alv_events. PERFORM make_list_commentary USING unittab unitname
glob_unitvalue cukytab cukyname glob_cukyvalue CHANGING
vim_list_header. PERFORM make_alv_layout CHANGING vim_alv_layout
vim_alv_print. PERFORM init_alv_variant CHANGING vim_var_save
vim_var_default vim_alv_variant. vim_alv_called_by = 'VIM_CALL_ALV'.
ENDIF. REFRESH alv_value_tab. IF status-mode = list_bild. LOOP AT
extract. w_alv_value_tab = <vim_xextract>. APPEND w_alv_value_tab TO
alv_value_tab. ENDLOOP. ELSE. w_alv_value_tab = <vim_xextract>. APPEND
w_alv_value_tab TO alv_value_tab. ENDIF. IF x_header-bastab <> space
AND x_header-texttbexst <> space. textlen = x_header-aft_txttbc -
x_header-aft_txtkc. PERFORM maintain_alv_value_tab_text USING textlen.
ELSE. vim_alv_value_length = x_header-tablen. ENDIF. IF
x_header-frm_bf_alv <> space. PERFORM (x_header-frm_bf_alv) IN PROGRAM
(sy-repid). CHECK NOT alv_value_tab[] IS INITIAL. ENDIF. PERFORM
check_list_before_alv CHANGING rc. CHECK rc = 0. progname = sy-repid.
CALL FUNCTION 'REUSE_ALV_TABLE_CREATE' EXPORTING it_fieldcat =
vim_alv_fcat i_callback_program = progname i_formname =
vim_alv_called_by. FREE alv_value_tab. ENDFORM. FORM drucken_ztp_alt.
DATA: rc_safe LIKE sy-subrc, texttab_begin LIKE sy-tabix, x TYPE i,
entifct_begin LIKE sy-tabix, len TYPE i, after_text_assigned TYPE c,
hname LIKE d021s-fnam. DATA: fcat_entry TYPE slis_fieldcat_alv, i TYPE
i, cukytab TYPE tabname, unittab TYPE tabname, rc LIKE sy-subrc,
cukyname TYPE fieldname, unitname TYPE fieldname, cukyvalue TYPE
vim_cuky, unitvalue TYPE vim_unit, length TYPE doffset, cukylength TYPE
doffset, fcat_entry2 TYPE slis_fieldcat_alv, progname LIKE sy-repid,
alv_called_by TYPE char30 VALUE 'VIM_CALL_ALV'. FIELD-SYMBOLS:
<before_text>, <text>, <after_text>, <cuky>, <unit>, <value> TYPE
tabl8000, <w_value_tab_x> TYPE x. CLEAR structure_table. DESCRIBE TABLE
structure_table. IF sy-tfill NE 0. READ TABLE structure_table INDEX 1.
ENDIF. IF structure_table-tabname NE view_name. CALL FUNCTION
'VIEW_GET_FIELDTAB' EXPORTING view_name = view_name TABLES fieldtab =
structure_table. IF x_header-bastab NE space AND x_header-texttbexst NE
space AND x_header-maintview = x_header-viewname. LOOP AT x_namtab
WHERE texttabfld NE space AND keyflag NE space. texttab_begin =
sy-tabix. EXIT. ENDLOOP. LOOP AT x_namtab WHERE texttabfld EQ space AND
keyflag EQ space. entifct_begin = sy-tabix. EXIT. ENDLOOP. IF sy-subrc
NE 0. LOOP AT structure_table FROM texttab_begin WHERE keyflag NE
space. DELETE structure_table. ENDLOOP. ELSE. WHILE sy-subrc EQ 0. LOOP
AT structure_table FROM texttab_begin. DELETE structure_table. IF
structure_table-keyflag EQ space. EXIT. ENDIF. ENDLOOP. IF sy-subrc EQ
0. INSERT structure_table INDEX entifct_begin. ADD: 1 TO entifct_begin,
1 TO texttab_begin. ENDIF. ENDWHILE. ENDIF. len = 0. LOOP AT
structure_table. structure_table-offset = len. structure_table-position
= sy-tabix. IF 'CNDT' CS structure_table-inttype. x = (
structure_table-offset + cl_abap_char_utilities=>charsize ) MOD
cl_abap_char_utilities=>charsize. IF x NE 0. structure_table-offset =
structure_table-offset + cl_abap_char_utilities=>charsize - x. ENDIF.
ELSE. CASE structure_table-datatype. WHEN 'INT2' OR 'PREC'. x = (
structure_table-offset + 2 ) MOD 2. IF x NE 0. structure_table-offset =
structure_table-offset + 2 - x. ENDIF. WHEN 'INT4'. x = (
structure_table-offset + 4 ) MOD 4. IF x NE 0. structure_table-offset =
structure_table-offset + 4 - x. ENDIF. WHEN 'FLTP'. x = (
structure_table-offset + 8 ) MOD 8. IF x NE 0. structure_table-offset =
structure_table-offset + 8 - x. ENDIF. ENDCASE. ENDIF. MODIFY
structure_table. len = structure_table-offset + structure_table-intlen.
ENDLOOP. ENDIF. IF x_header-hiddenflag NE space. LOOP AT x_namtab WHERE
readonly EQ vim_hidden OR domname IN vim_guid_domain. LOOP AT
structure_table WHERE fieldname EQ x_namtab-viewfield. DELETE
structure_table. EXIT. ENDLOOP. ENDLOOP. len = 0. LOOP AT
structure_table. structure_table-offset = len. structure_table-position
= sy-tabix. IF 'CNDT' CS structure_table-inttype. x = (
structure_table-offset + cl_abap_char_utilities=>charsize ) MOD
cl_abap_char_utilities=>charsize. IF x NE 0. structure_table-offset =
structure_table-offset + cl_abap_char_utilities=>charsize - x. ENDIF.
ELSE. CASE structure_table-datatype. WHEN 'INT2' OR 'PREC'. x = (
structure_table-offset + 2 ) MOD 2. IF x NE 0. structure_table-offset =
structure_table-offset + 2 - x. ENDIF. WHEN 'INT4'. x = (
structure_table-offset + 4 ) MOD 4. IF x NE 0. structure_table-offset =
structure_table-offset + 4 - x. ENDIF. WHEN 'FLTP'. x = (
structure_table-offset + 8 ) MOD 8. IF x NE 0. structure_table-offset =
structure_table-offset + 8 - x. ENDIF. ENDCASE. ENDIF. MODIFY
structure_table. len = structure_table-offset + structure_table-intlen.
ENDLOOP. ENDIF. ENDIF. ASSIGN value_tab TO <w_value_tab_x> CASTING. IF
x_header-bastab NE space AND x_header-texttbexst NE space  AND
x_header-maintview = x_header-viewname. CLEAR value_tab. IF status-mode
EQ list_bild. LOOP AT extract. PERFORM build_valtab_hfields. ENDLOOP.
ELSE. PERFORM build_valtab_hfields. ENDIF. ELSE. CLEAR value_tab. IF
x_header-hiddenflag EQ space AND x_header-fieldorder EQ space. IF
status-mode EQ list_bild. LOOP AT extract. MOVE <vim_xextract> TO
<w_value_tab_x>(x_header-tablen). APPEND value_tab. ENDLOOP. ELSE. MOVE
<vim_xextract> TO <w_value_tab_x>(x_header-tablen). APPEND value_tab.
ENDIF. ELSE. IF status-mode EQ list_bild. LOOP AT extract. PERFORM
build_valtab_hfields. ENDLOOP. ELSE. PERFORM build_valtab_hfields.
ENDIF. ENDIF. ENDIF. IF x_header-frm_bf_prn NE space. PERFORM
(x_header-frm_bf_prn) IN PROGRAM (sy-repid). ENDIF. CHECK NOT
value_tab[] IS INITIAL. REFRESH vim_alv_fcat. LOOP AT structure_table.
CLEAR fcat_entry. PERFORM conv_dfies_fcat USING structure_table
sy-tabix CHANGING fcat_entry. APPEND fcat_entry TO vim_alv_fcat.
ENDLOOP. length = structure_table-offset + structure_table-intlen.
DESCRIBE TABLE vim_alv_fcat LINES i. LOOP AT vim_alv_fcat INTO
fcat_entry WHERE datatype = 'CURR' OR datatype = 'QUAN'. CASE
fcat_entry-datatype. WHEN 'CURR'. READ TABLE x_namtab WITH KEY
viewfield = fcat_entry-cfieldname TRANSPORTING NO FIELDS. IF sy-subrc
<> 0. READ TABLE x_namtab WITH KEY viewfield = fcat_entry-fieldname.
cukytab = x_namtab-reftable. cukyname = x_namtab-reffield. CONCATENATE
x_namtab-reftable '-' x_namtab-reffield INTO hname. ASSIGN (hname) TO
<cuky>. IF sy-subrc = 0. fcat_entry-currency = cukyvalue = <cuky>.
ENDIF. ENDIF. WHEN 'QUAN'. READ TABLE x_namtab WITH KEY viewfield =
fcat_entry-qfieldname TRANSPORTING NO FIELDS. IF sy-subrc <> 0. READ
TABLE x_namtab WITH KEY viewfield = fcat_entry-fieldname. unittab =
x_namtab-reftable. unitname = x_namtab-reffield. CONCATENATE
x_namtab-reftable '-' x_namtab-reffield INTO hname. ASSIGN (hname) TO
<unit>. IF sy-subrc = 0. fcat_entry-quantity = unitvalue = <unit>.
ENDIF. ENDIF. ENDCASE. MODIFY vim_alv_fcat FROM fcat_entry. ENDLOOP.
REFRESH alv_value_tab. LOOP AT value_tab. APPEND <w_value_tab_x> TO
alv_value_tab. ENDLOOP. FREE value_tab. IF NOT cukyname IS INITIAL.
LOOP AT alv_value_tab ASSIGNING <value>. <value>+length = cukyvalue.
ENDLOOP. length = length + cukylength. ENDIF. IF NOT unitname IS
INITIAL. LOOP AT alv_value_tab ASSIGNING <value>. <value>+length =
unitvalue. ENDLOOP. ENDIF. PERFORM define_alv_callbacks CHANGING
vim_alv_events. PERFORM make_list_commentary USING unittab unitname
unitvalue cukytab cukyname cukyvalue CHANGING vim_list_header. PERFORM
make_alv_layout CHANGING vim_alv_layout vim_alv_print. PERFORM
init_alv_variant CHANGING vim_var_save vim_var_default vim_alv_variant.
progname = sy-repid. PERFORM check_list_before_alv CHANGING rc. CHECK
rc = 0. CALL FUNCTION 'REUSE_ALV_TABLE_CREATE' EXPORTING it_fieldcat =
vim_alv_fcat i_callback_program = progname i_formname = alv_called_by.
FREE alv_value_tab. ENDFORM. FORM make_list_commentary USING p_unittab
TYPE tabname p_unitname TYPE fieldname p_unitvalue TYPE any  p_cukytab
TYPE tabname p_cukyname TYPE fieldname p_cukyvalue TYPE vim_cuky
CHANGING p_list_header TYPE slis_t_listheader. DATA: h_header TYPE
slis_listheader, text(40), w_dfies TYPE dfies. REFRESH p_list_header.
h_header-typ = 'H'. h_header-info = x_header-ddtext. APPEND h_header TO
p_list_header. h_header-typ = 'S'. IF x_header-bastab NE space AND
x_header-texttbexst NE space AND x_header-maintview =
x_header-viewname. h_header-key = svim_text_p01. ELSE. h_header-key =
svim_text_p02. ENDIF. h_header-info = x_header-viewname. APPEND
h_header TO p_list_header. IF x_header-clidep <> space. h_header-key =
svim_text_p03. h_header-info = sy-mandt. APPEND h_header TO
p_list_header. ENDIF. IF p_unitname <> space. CLEAR h_header.
h_header-typ = 'S'. PERFORM vim_get_reffield_alv USING p_unitname
p_unittab CHANGING w_dfies. IF w_dfies <> space. IF w_dfies-scrtext_m
<> space. h_header-key = w_dfies-scrtext_m(20). ELSE. IF
w_dfies-scrtext_l <> space. h_header-key = w_dfies-scrtext_l(20). ELSE.
IF w_dfies-scrtext_s <> space. h_header-key = w_dfies-scrtext_s(10).
ELSE. IF w_dfies-reptext <> space. h_header-key = w_dfies-reptext(20).
ELSE. h_header-key = w_dfies-fieldname. ENDIF. ENDIF. ENDIF. ENDIF.
ENDIF. h_header-info = p_unitvalue. APPEND h_header TO p_list_header.
ENDIF. IF p_cukyname <> space. CLEAR h_header. h_header-typ = 'S'.
PERFORM vim_get_reffield_alv USING p_cukyname p_cukytab CHANGING
w_dfies. IF w_dfies <> space. IF w_dfies-scrtext_m <> space.
h_header-key = w_dfies-scrtext_m(20). ELSE. IF w_dfies-scrtext_l <>
space. h_header-key = w_dfies-scrtext_l(20). ELSE. IF w_dfies-scrtext_s
<> space. h_header-key = w_dfies-scrtext_s(10). ELSE. IF
w_dfies-reptext <> space. h_header-key = w_dfies-reptext(20). ELSE.
h_header-key = w_dfies-fieldname. ENDIF. ENDIF. ENDIF. ENDIF. ENDIF.
h_header-info = p_cukyvalue. APPEND h_header TO p_list_header. ENDIF.
ENDFORM. FORM define_alv_callbacks CHANGING p_alv_events TYPE
slis_t_event. DATA: h_event TYPE slis_alv_event. CONSTANTS:
formname_top_of_list TYPE slis_formname VALUE 'ALV_TOP_OF_LIST',
formname_top_of_page TYPE slis_formname VALUE 'ALV_TOP_OF_PAGE',
formname_end_of_page TYPE slis_formname VALUE 'ALV_END_OF_PAGE',
formname_end_of_list TYPE slis_formname VALUE 'ALV_END_OF_LIST'.
REFRESH p_alv_events. CALL FUNCTION 'REUSE_ALV_EVENTS_GET' EXPORTING
i_list_type = 0 IMPORTING et_events = p_alv_events. READ TABLE
p_alv_events WITH KEY name = slis_ev_top_of_list INTO h_event. IF
sy-subrc = 0. h_event-form = formname_top_of_list. APPEND h_event TO
p_alv_events. ENDIF. READ TABLE p_alv_events WITH KEY name =
slis_ev_top_of_page INTO h_event. IF sy-subrc = 0. h_event-form =
formname_top_of_page. APPEND h_event TO p_alv_events. ENDIF. READ TABLE
p_alv_events WITH KEY name = slis_ev_end_of_page INTO h_event. IF
sy-subrc = 0. h_event-form = formname_end_of_page. APPEND h_event TO
p_alv_events. ENDIF. READ TABLE p_alv_events WITH KEY name =
slis_ev_end_of_list INTO h_event. IF sy-subrc = 0. h_event-form =
formname_end_of_list. APPEND h_event TO p_alv_events. ENDIF. ENDFORM.
FORM alv_top_of_list. CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING it_list_commentary = vim_list_header. ENDFORM. FORM
alv_top_of_page. WRITE AT (sy-linsz) sy-datum RIGHT-JUSTIFIED. ENDFORM.
FORM alv_end_of_page. WRITE AT (sy-linsz) sy-pagno CENTERED. ENDFORM.
FORM make_alv_layout CHANGING p_alv_layout TYPE slis_layout_alv
p_alv_print TYPE slis_print_alv. CLEAR p_alv_layout.
p_alv_layout-colwidth_optimize = 'X'. p_alv_layout-f2code = '&ETA'.
p_alv_layout-detail_popup = 'X'. p_alv_print-no_print_listinfos = 'X'.
ENDFORM. FORM fill_alv_fieldcat CHANGING p_vim_alv_fcat TYPE
slis_t_fieldcat_alv texttab_begin LIKE sy-tabix p_value_length TYPE
intlen p_unittab TYPE tabname p_unitname TYPE fieldname p_unitvalue
TYPE any  p_cukytab TYPE tabname p_cukyname TYPE fieldname p_cukyvalue
TYPE vim_cuky. DATA: fcat_header TYPE slis_fieldcat_alv, textfld_no
TYPE i, fcat_reffield TYPE slis_fieldcat_alv, rc LIKE sy-subrc, first
TYPE xfeld VALUE 'X', list_width TYPE outputlen, i TYPE i,
first_func_field TYPE i, text_outp_len TYPE outputlen, fldno(2) TYPE n,
strln TYPE i, hname TYPE fnam_____4, maintview, global_unit_set,
global_cuky_set. CONSTANTS: max_list_width TYPE i VALUE 250.
FIELD-SYMBOLS: <alv_fcat> LIKE LINE OF p_vim_alv_fcat, <alv_fcat2> LIKE
LINE OF p_vim_alv_fcat, <x_namt> LIKE LINE OF x_namtab, <cuky> TYPE
vim_cuky, <unit> TYPE ANY. REFRESH p_vim_alv_fcat. CLEAR: p_unitname,
p_cukyname, p_unitvalue, p_cukyvalue, p_value_length. IF
x_header-bastab EQ space OR x_header-texttbexst EQ space OR
x_header-maintview NE x_header-viewname. maintview = 'X'. ENDIF. LOOP
AT x_namtab ASSIGNING <x_namt> WHERE texttabfld = space OR keyflag =
space. i = i + 1. fcat_header-col_pos = i. fcat_header-fieldname =
<x_namt>-viewfield. IF maintview = space. fcat_header-ref_tabname =
<x_namt>-bastabname. ELSE. fcat_header-ref_tabname =
x_header-maintview. ENDIF. fcat_header-key = <x_namt>-keyflag.
fcat_header-seltext_l = <x_namt>-scrtext_l. fcat_header-seltext_m =
<x_namt>-scrtext_m. fcat_header-seltext_s = <x_namt>-scrtext_s.
fcat_header-reptext_ddic = <x_namt>-reptext. fcat_header-datatype =
<x_namt>-datatype. fcat_header-inttype = <x_namt>-inttype.
fcat_header-ddic_outputlen = <x_namt>-outputlen. fcat_header-intlen =
<x_namt>-flength. fcat_header-lowercase = <x_namt>-lowercase. CASE
<x_namt>-datatype. WHEN 'CLNT'. IF x_header-clidep <> space.
fcat_header-tech = 'X'. ENDIF. WHEN 'CURR'. READ TABLE x_namtab WITH
KEY viewfield = <x_namt>-reffield TRANSPORTING NO FIELDS. IF sy-subrc =
0 AND <x_namt>-reftable = x_header-maintview.  fcat_header-cfieldname =
<x_namt>-reffield. ELSE. IF p_cukyvalue IS INITIAL. p_cukytab =
<x_namt>-reftable. p_cukyname = <x_namt>-reffield. CONCATENATE
<x_namt>-reftable '-' <x_namt>-reffield INTO hname. ASSIGN (hname) TO
<cuky>. IF sy-subrc = 0. fcat_header-currency = p_cukyvalue = <cuky>.
ENDIF. ELSE. fcat_header-currency = p_cukyvalue. ENDIF. ENDIF. WHEN
'QUAN'. READ TABLE x_namtab WITH KEY viewfield = <x_namt>-reffield
TRANSPORTING NO FIELDS. IF sy-subrc = 0 AND <x_namt>-reftable =
x_header-maintview.  fcat_header-qfieldname = <x_namt>-reffield. ELSE.
IF p_unitvalue IS INITIAL. p_unittab = <x_namt>-reftable. p_unitname =
<x_namt>-reffield. CONCATENATE <x_namt>-reftable '-' <x_namt>-reffield
INTO hname. ASSIGN (hname) TO <unit>. IF sy-subrc = 0.
fcat_header-quantity = p_unitvalue = <unit>. ENDIF. ELSE.
fcat_header-quantity = p_unitvalue. ENDIF. ENDIF. ENDCASE. IF
<x_namt>-readonly = vim_hidden OR <x_namt>-domname IN vim_guid_domain.
fcat_header-tech = 'X'. ELSE. list_width = list_width +
<x_namt>-outputlen + 1. ENDIF. p_value_length = p_value_length +
fcat_header-intlen. APPEND fcat_header TO p_vim_alv_fcat. CLEAR
fcat_header. CHECK <x_namt>-texttabfld <> space. textfld_no =
textfld_no + 1. CHECK <x_namt>-readonly <> vim_hidden. IF first <>
space. texttab_begin = i. CLEAR first. ENDIF. text_outp_len =
text_outp_len + <x_namt>-outputlen. ENDLOOP. first = 'X'. CLEAR i. IF
x_header-bastab NE space AND x_header-texttbexst NE space AND
x_header-maintview = x_header-viewname. LOOP AT p_vim_alv_fcat
ASSIGNING <alv_fcat> WHERE key = space. IF first <> space.
first_func_field = <alv_fcat>-col_pos. CLEAR first. ENDIF. IF sy-tabix
< texttab_begin. <alv_fcat>-col_pos = <alv_fcat>-col_pos + textfld_no.
ELSE. i = i + 1. <alv_fcat>-col_pos = first_func_field + i - 1. ENDIF.
ENDLOOP. first = 'X'. SORT p_vim_alv_fcat BY col_pos. ENDIF. IF
list_width > max_list_width. list_width = i = 1. LOOP AT p_vim_alv_fcat
ASSIGNING <alv_fcat>. list_width = list_width +
<alv_fcat>-ddic_outputlen + 1. IF list_width > max_list_width. i = i +
1. list_width = <alv_fcat>-ddic_outputlen + 1. ENDIF.
<alv_fcat>-row_pos = i. ENDLOOP. ENDIF. IF maintview = space. LOOP AT
p_vim_alv_fcat ASSIGNING <alv_fcat>. i = sy-tabix. CLEAR fldno. LOOP AT
p_vim_alv_fcat ASSIGNING <alv_fcat2> WHERE fieldname =
<alv_fcat>-fieldname. CHECK sy-tabix <> i. <alv_fcat2>-ref_fieldname =
<alv_fcat2>-fieldname. ADD 1 TO fldno. CONCATENATE
<alv_fcat2>-fieldname fldno INTO <alv_fcat2>-fieldname. IF sy-subrc <>
0. strln = strlen( <alv_fcat2>-fieldname ) - 2. CONCATENATE
<alv_fcat2>-fieldname(strln) fldno INTO <alv_fcat2>-fieldname. ENDIF.
ENDLOOP. ENDLOOP. ENDIF. ENDFORM. FORM vim_call_alv TABLES value_tab.
DATA: progname LIKE sy-repid. FIELD-SYMBOLS: <alv_value_tab_x> TYPE
tabl8000, <value_tab_x> TYPE x. REFRESH value_tab. ASSIGN value_tab TO
<value_tab_x> CASTING. LOOP AT alv_value_tab ASSIGNING
<alv_value_tab_x>. <value_tab_x> = <alv_value_tab_x>. APPEND value_tab.
ENDLOOP. progname = sy-repid. CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING i_callback_program = progname is_layout = vim_alv_layout
it_fieldcat = vim_alv_fcat i_default = vim_var_default i_save =
vim_var_save is_variant = vim_alv_variant it_events = vim_alv_events
is_print = vim_alv_print TABLES t_outtab = value_tab[] EXCEPTIONS
program_error = 1 OTHERS = 2. IF sy-subrc NE 0. RAISE print_error.
ENDIF. ENDFORM. FORM maintain_alv_value_tab_text USING p_textlen TYPE
intlen. DATA: x TYPE i, record TYPE tabl8000, textoffset TYPE intlen,
BEGIN OF new_offs, ref_tabname TYPE tabname, fieldname TYPE viewfield,
ref_fieldname TYPE fieldname, offset TYPE tabfdpos, END OF new_offs.
STATICS: t_fld_offs LIKE SORTED TABLE OF new_offs WITH UNIQUE KEY
ref_tabname fieldname ref_fieldname INITIAL SIZE 1, viewname TYPE
viewname. FIELD-SYMBOLS: <x_namt> LIKE LINE OF x_namtab, <alv_fcat>
TYPE slis_fieldcat_alv, <alv_val>. IF viewname <> x_header-viewname.
viewname = x_header-viewname. REFRESH t_fld_offs. new_offs-offset =
x_header-after_keyc. LOOP AT vim_alv_fcat ASSIGNING <alv_fcat> WHERE
key = space. new_offs-ref_tabname = <alv_fcat>-ref_tabname.
new_offs-fieldname = <alv_fcat>-fieldname. new_offs-ref_fieldname =
<alv_fcat>-ref_fieldname. IF 'CNDT' CS <alv_fcat>-inttype. x = (
new_offs-offset + cl_abap_char_utilities=>charsize ) MOD
cl_abap_char_utilities=>charsize. IF x NE 0. new_offs-offset =
new_offs-offset + cl_abap_char_utilities=>charsize - x. ENDIF. ELSE.
CASE <alv_fcat>-datatype. WHEN 'INT2' OR 'PREC'. x = ( new_offs-offset
+ 2 ) MOD 2. IF x NE 0. new_offs-offset = new_offs-offset + 2 - x.
ENDIF. WHEN 'INT4'. x = ( new_offs-offset + 4 ) MOD 4. IF x NE 0.
new_offs-offset = new_offs-offset + 4 - x. ENDIF. WHEN 'FLTP'. x = (
new_offs-offset + 8 ) MOD 8. IF x NE 0. new_offs-offset =
new_offs-offset + 8 - x. ENDIF. ENDCASE. ENDIF. INSERT new_offs INTO
TABLE t_fld_offs. new_offs-offset = new_offs-offset +
<alv_fcat>-intlen. ENDLOOP. ENDIF. textoffset = x_header-after_tabc +
x_header-aft_txtkc. LOOP AT alv_value_tab ASSIGNING <alv_val>.
record(x_header-after_keyc) = <alv_val>(x_header-after_keyc). IF
p_textlen > 0. record+x_header-after_keyc(p_textlen) =
<alv_val>+textoffset(p_textlen). ENDIF. LOOP AT x_namtab ASSIGNING
<x_namt> WHERE keyflag = space AND texttabfld = space. READ TABLE
t_fld_offs INTO new_offs WITH TABLE KEY ref_tabname =
<x_namt>-bastabname fieldname = <x_namt>-viewfield ref_fieldname =
space. IF sy-subrc = 0. record+new_offs-offset(<x_namt>-flength) =
<alv_val>+<x_namt>-position(<x_namt>-flength). ELSE. READ TABLE
t_fld_offs INTO new_offs WITH KEY ref_tabname = <x_namt>-bastabname
ref_fieldname = <x_namt>-viewfield. IF sy-subrc = 0.
record+new_offs-offset(<x_namt>-flength) =
<alv_val>+<x_namt>-position(<x_namt>-flength). ENDIF. ENDIF. ENDLOOP.
CLEAR <alv_val>. <alv_val> = record. ENDLOOP. ENDFORM. FORM
vim_get_reffield_alv USING value(p_reffield) TYPE fieldname
value(p_reftable) TYPE tabname CHANGING p_dfies TYPE dfies. DATA:
dfies_tab TYPE TABLE OF dfies. CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING tabname = p_reftable fieldname = p_reffield langu = sy-langu
TABLES dfies_tab = dfies_tab EXCEPTIONS not_found = 1 internal_error =
2 OTHERS = 3. IF sy-subrc <> 0. EXIT. ELSE. READ TABLE dfies_tab INTO
p_dfies INDEX 1. ENDIF. ENDFORM. FORM conv_dfies_fcat USING p_dfies
LIKE dfies i TYPE i CHANGING p_fcat_reffield TYPE slis_fieldcat_alv.
p_fcat_reffield-col_pos = i. p_fcat_reffield-fieldname =
p_dfies-fieldname. p_fcat_reffield-ref_tabname = p_dfies-tabname.
p_fcat_reffield-key = p_dfies-keyflag. p_fcat_reffield-seltext_l =
p_dfies-scrtext_l. p_fcat_reffield-seltext_m = p_dfies-scrtext_m.
p_fcat_reffield-seltext_s = p_dfies-scrtext_s.
p_fcat_reffield-reptext_ddic = p_dfies-reptext.
p_fcat_reffield-datatype = p_dfies-datatype. p_fcat_reffield-inttype =
p_dfies-inttype. p_fcat_reffield-ddic_outputlen = p_dfies-outputlen.
p_fcat_reffield-intlen = p_dfies-intlen. p_fcat_reffield-lowercase =
p_dfies-lowercase. CASE p_dfies-datatype. WHEN 'CLNT'. CHECK
x_header-clidep <> space AND p_fcat_reffield-key <> space.
p_fcat_reffield-tech = 'X'. WHEN 'CURR'. p_fcat_reffield-cfieldname =
p_dfies-reffield. WHEN 'QUAN'. p_fcat_reffield-qfieldname =
p_dfies-reffield. ENDCASE. ENDFORM. FORM init_alv_variant CHANGING
p_save p_default p_variant STRUCTURE disvariant. CONCATENATE
x_header-viewname sy-repid INTO p_variant-report. p_save = 'A'.
p_default = 'X'. ENDFORM. FORM alv_end_of_list. WRITE AT /(sy-linsz)
sy-pagno CENTERED. ENDFORM. FORM initialisieren. LOCAL: counter. TYPES:
BEGIN OF i_fnamecnt, name LIKE vimsellist-viewfield, cnt TYPE i, END OF
i_fnamecnt. DATA: keydate_alr_assigned(1) TYPE c, program LIKE
d020s-prog, namlen TYPE i, length TYPE i, name(25) TYPE c, fname(50)
TYPE c, dynnr LIKE liste, i_fnametb TYPE SORTED TABLE OF i_fnamecnt
WITH UNIQUE KEY name, i_fnameln TYPE i_fnamecnt, initexclfldtabs(1)
TYPE c, i_objtype LIKE objh-objecttype, f_fieldname(50) type c. DATA:
h_f1(70) TYPE c, h_f2(8) TYPE c, h_f3(20) TYPE c. FIELD-SYMBOLS: <m1>,
<mili> TYPE ANY, <x_namtab> TYPE vimnamtab, <f_fld_value> TYPE any. IF
nbrd_texts_alr_read EQ space. CALL 'C_SAPGPARAM' ID 'NAME' FIELD
'transport/systemtype' ID 'VALUE' FIELD vim_system_type. PERFORM
set_numbered_texts. length = vim_position_info_lg1 + 2 +
vim_position_info_lg3. IF sy-langu = 'J'. REPLACE ';;' IN svim_text_027
WITH '  '. ENDIF. WRITE: svim_text_027 TO
vim_position_info_mask(vim_position_info_lg1), svim_text_028 TO
vim_position_info_mask+length(vim_position_info_lg2). vim_posi_push =
'@3Y@'. vim_posi_push+4 = svim_text_029. MOVE: 'I' TO
mark_functions-sign, 'I' TO adrnbr_domain-sign, 'I' TO
exted_functions-sign, 'EQ' TO mark_functions-option, 'EQ' TO
adrnbr_domain-option, 'EQ' TO exted_functions-option, space TO
mark_functions-high, space TO adrnbr_domain-high, space TO
exted_functions-high. MOVE 'ADDR' TO mark_functions-low. APPEND
mark_functions. MOVE 'ALMK' TO mark_functions-low. APPEND
mark_functions. MOVE 'DELE' TO mark_functions-low. APPEND
mark_functions. MOVE 'DELM' TO mark_functions-low. APPEND
mark_functions. MOVE 'EXPA' TO mark_functions-low. APPEND
mark_functions. MOVE 'KOPE' TO mark_functions-low. APPEND
mark_functions. MOVE 'MKLO' TO mark_functions-low. APPEND
mark_functions. MOVE 'ORGI' TO mark_functions-low. APPEND
mark_functions. MOVE 'REPL' TO mark_functions-low. APPEND
mark_functions. MOVE 'TEXT' TO mark_functions-low. APPEND
mark_functions. MOVE 'TREX' TO mark_functions-low. APPEND
mark_functions. MOVE 'TRIN' TO mark_functions-low. APPEND
mark_functions. MOVE 'UNDO' TO mark_functions-low. APPEND
mark_functions. MOVE 'BCSH' TO mark_functions-low. APPEND
mark_functions. MOVE 'UNDO' TO exted_functions-low. APPEND
exted_functions. MOVE 'DELE' TO exted_functions-low. APPEND
exted_functions. MOVE 'TRIN' TO exted_functions-low. APPEND
exted_functions. MOVE 'TREX' TO exted_functions-low. APPEND
exted_functions. PERFORM vim_fill_vim_guid_domain. PERFORM
vim_fill_date_type. DO. ASSIGN COMPONENT sy-index OF STRUCTURE
vim_adrnbr_domains TO <m1>. IF sy-subrc NE 0. EXIT. ENDIF. MOVE <m1> TO
adrnbr_domain-low. APPEND adrnbr_domain. ENDDO. PERFORM
vim_initialize_d0100. MOVE 'X' TO nbrd_texts_alr_read. ENDIF. READ
TABLE x_header INDEX 1. IF x_header-existency NE 'R'. IF
x_header-bastab EQ space OR ( x_header-maintview NE x_header-viewname
AND x_header-bastab NE space ). i_objtype = 'V'. ELSE. i_objtype = 'S'.
ENDIF. SELECT SINGLE * FROM objh WHERE objectname EQ x_header-viewname
AND objecttype EQ i_objtype. IF sy-subrc NE 0. MESSAGE a138(sv) WITH
x_header-viewname x_header-area. ENDIF. ENDIF. CLEAR:
vim_nbr_of_scrfrm_pointers. vim_view_name =
vim_addresses_to_save-viewname = x_header-viewname. MOVE:
x_header-liste TO liste, x_header-detail TO detail. CASE x_header-type.
WHEN '1'. MOVE einstufig TO status-type. WHEN '2'. MOVE zweistufig TO
status-type. ENDCASE. counter = strlen( x_header-ddtext ). IF counter
EQ 0. counter = 1. x_header-ddtext(1) = '?'. ENDIF. vim_title_name =
x_header-ddtext. ASSIGN: vim_title_name(counter) TO <name>. MOVE <name>
TO vim_frame_field. IF x_header-bastab NE space. MOVE: 'STATUS_' TO
name, x_header-maintview TO name+7. ASSIGN (name) TO <status>. MOVE:
'*' TO name, x_header-maintview TO name+1. ASSIGN (x_header-maintview)
TO <table1>. IF sy-subrc = 4. MESSAGE a173(sv) WITH x_header-maintview
x_header-area. ENDIF. ASSIGN (name) TO <initial> CASTING TYPE
(x_header-maintview). loop at x_namtab where datatype = 'TIMS'.
CONCATENATE '<initial>' x_namtab-viewfield into f_fieldname SEPARATED
BY '-'. assign (f_fieldname) to <f_fld_value>. clear <f_fld_value> with
space. endloop. IF x_header-texttbexst NE space. MOVE x_header-texttab
TO name+1. ASSIGN: (x_header-texttab) TO <table1_text>, (name) TO
<text_initial>, <table1_text> TO <table1_xtext> CASTING,
<table1_xtext>(x_header-textkeylen) TO <textkey_x>, <text_initial> TO
<text_initial_x> CASTING, <text_initial_x>(x_header-textkeylen) TO
<initial_textkey_x>. IF x_header-generictrp <> 'X' AND
cl_abap_char_utilities=>charsize = 1. ASSIGN:
<table1_text>(x_header-textkeylen) TO <textkey>,
<text_initial>(x_header-textkeylen) TO <initial_textkey>. ELSE. ASSIGN:
<table1_xtext> TO <textkey>, <initial_textkey_x> TO <initial_textkey>.
ENDIF. ENDIF. IF x_header-viewname = x_header-maintview. CLEAR
e071k-viewname. master_type = transp_object. ELSE. e071k-viewname =
view_name. master_type = vim_view_type. ENDIF. ELSE. loop at x_namtab
where datatype = 'TIMS'. CONCATENATE '<initial>' x_namtab-viewfield
into f_fieldname SEPARATED BY '-'. assign (f_fieldname) to
<f_fld_value>. clear <f_fld_value> with space. endloop. WRITE:
x_header-maintview TO compl_formname+compl_form_offs,
x_header-maintview TO corr_formname+corr_form_offs. MOVE: view_name TO
e071k-viewname, vim_view_type TO master_type. ENDIF. MOVE: 'TCTRL_' TO
name, x_header-maintview TO name+6. DATA: h LIKE d020s, f LIKE d021s
OCCURS 10, e LIKE d022s OCCURS 10, m LIKE d023s OCCURS 10, e_h LIKE
d022s, i_dynid(44) TYPE c. i_dynid = x_header-fpoolname. i_dynid+40(4)
= x_header-liste. IMPORT DYNPRO h f e m ID i_dynid. IF sy-subrc EQ 0.
LOOP AT e INTO e_h WHERE line CS name. EXIT. ENDLOOP. IF sy-subrc EQ 0.
vim_tabctrl_active = 'X'. ELSE. CLEAR vim_tabctrl_active. ENDIF. ASSIGN
h-mili TO <mili> CASTING TYPE x. IF <mili> O vim_template_dynpro.
h-mili = h-mili - vim_template_dynpro. EXPORT DYNPRO h f e m ID
i_dynid. GENERATE DYNPRO h f e m ID i_dynid MESSAGE h_f1 LINE h_f2 WORD
h_f3. ENDIF. ELSE. CLEAR vim_tabctrl_active. ENDIF. IF x_header-type =
'2'. i_dynid+40(4) = x_header-detail. IMPORT DYNPRO h f e m ID i_dynid.
ASSIGN h-mili TO <mili> CASTING TYPE x. IF sy-subrc = 0 AND <mili> O
vim_template_dynpro. h-mili = h-mili - vim_template_dynpro. EXPORT
DYNPRO h f e m ID i_dynid. GENERATE DYNPRO h f e m ID i_dynid MESSAGE
h_f1 LINE h_f2 WORD h_f3. ENDIF. ENDIF. IF vim_tabctrl_active NE space.
ASSIGN (name) TO <vim_tctrl>. IF sy-subrc EQ 0. vim_tabctrl_active =
'X'. IF last_view_info <> space. REFRESH CONTROL name FROM SCREEN
x_header-liste. ENDIF. IF vim_restore_mode EQ space.
<status>-l_sel_mode = <vim_tctrl>-line_sel_mode. ENDIF. IF
x_header-maintview <> x_header-viewname. LOOP AT x_namtab WHERE
readonly = vim_hidden. CONCATENATE x_header-maintview '-'
x_namtab-viewfield INTO fname. LOOP AT <vim_tctrl>-cols INTO
vim_tc_cols WHERE screen-name = fname. vim_tc_cols-vislength = 0.
vim_tc_cols-invisible = '1'. MODIFY <vim_tctrl>-cols FROM vim_tc_cols.
EXIT. ENDLOOP. ENDLOOP. ENDIF. ELSE. CLEAR vim_tabctrl_active. ENDIF.
ENDIF. vim_ctabkeylen = x_header-after_keyc /
cl_abap_char_utilities=>charsize. IF x_header-clidep NE space. READ
TABLE x_namtab ASSIGNING <x_namtab> WITH KEY datatype = 'CLNT'. ASSIGN
COMPONENT <x_namtab>-viewfield OF STRUCTURE <table1> TO <client>.
ASSIGN COMPONENT <x_namtab>-viewfield OF STRUCTURE <initial> TO
<vim_client_initial>. <vim_client_initial> = sy-mandt. ELSE. ASSIGN
mandant TO <vim_client_initial>. ENDIF. master_name = view_name.
ASSIGN: (x_header-maintview) TO <table1_x> CASTING,
<table1_x>(x_header-keylen) TO <f1_x>, vim_view_wax TO <table1_wa>
CASTING TYPE (x_header-maintview), vim_view_wax TO <table1_wax>
CASTING, <table1_wax>(x_header-keylen) TO <f1_wax> CASTING. IF
x_header-generictrp <> 'X' AND cl_abap_char_utilities=>charsize = 1.
ASSIGN <table1>(vim_ctabkeylen) TO <f1>. ELSE. ASSIGN <f1_x> TO <f1>.
ENDIF. PERFORM vim_set_init_from_sellist USING x_header-maintview
x_namtab[] dba_sellist[] vim_hidden CHANGING <initial>. IF
last_view_info NE space. MOVE: last_view_info TO
vim_excl_xxx_tab_safe-viewname, excl_pos_tab[] TO
vim_excl_xxx_tab_safe-excl_pos_tab, excl_rpl_tab[] TO
vim_excl_xxx_tab_safe-excl_rpl_tab, excl_que_tab[] TO
vim_excl_xxx_tab_safe-excl_que_tab. MODIFY TABLE vim_excl_xxx_tab_safe.
IF sy-subrc NE 0. INSERT TABLE vim_excl_xxx_tab_safe. ENDIF. ENDIF.
READ TABLE vim_excl_xxx_tab_safe WITH TABLE KEY viewname =
x_header-viewname. IF sy-subrc EQ 0. excl_pos_tab[] =
vim_excl_xxx_tab_safe-excl_pos_tab. excl_rpl_tab[] =
vim_excl_xxx_tab_safe-excl_rpl_tab. excl_que_tab[] =
vim_excl_xxx_tab_safe-excl_que_tab. ELSE. REFRESH: excl_rpl_tab,
excl_que_tab, excl_pos_tab, exclude_tab. CLEAR: excl_rpl_tab,
excl_que_tab, excl_pos_tab, exclude_tab. initexclfldtabs = 'X'. ENDIF.
IF x_header-subsetflag NE space OR x_header-adrnbrflag NE space OR
x_header-rdonlyflag NE space OR x_header-usrexiflag NE space OR
x_header-hiddenflag NE space OR x_header-scrfrmflag NE space OR
x_header-guidflag NE space. LOOP AT x_namtab WHERE readonly NE space OR
domname IN adrnbr_domain OR domname EQ vim_scrform_domain OR domname IN
vim_guid_domain. IF x_namtab-domname IN adrnbr_domain. ASSIGN COMPONENT
x_namtab-viewfield OF STRUCTURE <table1> TO <address_number>. MOVE
x_namtab-readonly TO adrnbr_roflag. vim_addr_basetable =
x_namtab-bastabname. vim_addr_bastab_field = x_namtab-bastabfld. CHECK
initexclfldtabs NE space. MOVE x_namtab-viewfield TO
excl_rpl_tab-fieldname. MOVE x_namtab-viewfield TO
excl_que_tab-fieldname. MOVE x_namtab-viewfield TO
excl_pos_tab-fieldname. COLLECT excl_rpl_tab. COLLECT excl_que_tab.
COLLECT excl_pos_tab. CONTINUE. ELSEIF x_namtab-domname EQ
vim_scrform_domain. ASSIGN COMPONENT x_namtab-viewfield OF STRUCTURE
<table1> TO <vim_scrform_name>. ADD 1 TO vim_nbr_of_scrfrm_pointers.
ELSEIF x_namtab-domname IN vim_guid_domain. MOVE x_namtab-viewfield TO
excl_rpl_tab-fieldname. MOVE x_namtab-viewfield TO
excl_que_tab-fieldname. MOVE x_namtab-viewfield TO
excl_pos_tab-fieldname. COLLECT excl_rpl_tab. COLLECT excl_que_tab.
COLLECT excl_pos_tab. CONTINUE. ENDIF. CHECK initexclfldtabs NE space.
CASE x_namtab-readonly. WHEN subset. MOVE x_namtab-viewfield TO
excl_rpl_tab-fieldname. MOVE x_namtab-viewfield TO
excl_que_tab-fieldname. APPEND excl_rpl_tab. APPEND excl_que_tab. WHEN
usrexi. MOVE x_namtab-viewfield TO excl_rpl_tab-fieldname. MOVE
x_namtab-viewfield TO excl_que_tab-fieldname. MOVE x_namtab-viewfield
TO excl_pos_tab-fieldname. APPEND excl_rpl_tab. APPEND excl_que_tab.
APPEND excl_pos_tab. WHEN vim_hidden. MOVE x_namtab-viewfield TO
excl_rpl_tab-fieldname. MOVE x_namtab-viewfield TO
excl_que_tab-fieldname. MOVE x_namtab-viewfield TO
excl_pos_tab-fieldname. APPEND excl_rpl_tab. APPEND excl_que_tab.
APPEND excl_pos_tab. WHEN rdonly. MOVE x_namtab-viewfield TO
excl_rpl_tab-fieldname. APPEND excl_rpl_tab. ENDCASE. ENDLOOP. ENDIF.
IF x_header-scrfrmflag NE space AND vim_nbr_of_scrfrm_pointers EQ 1.
mark_functions-low = 'SCRF'. APPEND mark_functions. ELSE. DELETE
mark_functions WHERE low EQ 'SCRF'. ENDIF. IF x_header-selection NE
space AND initexclfldtabs NE space. i_fnameln-cnt = 1. LOOP AT
dba_sellist WHERE ddic CO ddic_marks AND ( negation EQ space AND
operator EQ 'EQ' OR negation EQ 'NOT' AND operator EQ 'NE' ).
i_fnameln-name = dba_sellist-viewfield. COLLECT i_fnameln INTO
i_fnametb. ENDLOOP. LOOP AT i_fnametb INTO i_fnameln WHERE cnt EQ 1.
excl_rpl_tab-fieldname = i_fnameln-name. COLLECT excl_rpl_tab.
excl_que_tab-fieldname = i_fnameln-name. COLLECT excl_que_tab. ENDLOOP.
ENDIF. IF x_header-delmdtflag NE space. VIM_TDEP_TITLE = svim_text_104.
CLEAR: vim_old_viewkey, vim_old_st_selected. REFRESH vim_sval_tab.
CLEAR vim_sval_tab. MOVE: x_header-viewname TO vim_sval_tab-tabname,
x_header-maintview TO vim_begdate_name-tabname, x_header-maintview TO
vim_enddate_name-tabname, 'X' TO vim_sval_tab-field_obl, sy-datum TO
vim_sval_tab-value. vim_begdate_name-dash = vim_enddate_name-dash =
'-'. IF x_header-delmdtflag EQ 'E'. ASSIGN d0001_field_tab-end TO
<key_date>. ELSE. ASSIGN d0001_field_tab-begin TO <key_date>. ENDIF.
ASSIGN: vim_mainkey TO <vim_h_mkey> CASTING, vim_old_viewkey TO
<vim_h_old_mkey> CASTING, vim_collapsed_mainkeys-mainkey TO
<vim_h_coll_mkey> CASTING, vim_collapsed_mainkeys-log_key TO
<vim_h_coll_logkey> CASTING, vim_collapsed_mainkeys-mkey_bf TO
<vim_h_coll_bfkey> CASTING, vim_merged_entries-merged_key TO
<vim_h_merged_key> CASTING. LOOP AT x_namtab WHERE domname EQ
vim_delim_date_domain AND ( rollname IN vim_begda_types OR rollname IN
vim_endda_types ). IF x_namtab-rollname IN vim_begda_types. IF
x_header-delmdtflag EQ 'E'. IF x_namtab-texttabfld EQ space. ASSIGN
COMPONENT x_namtab-viewfield OF STRUCTURE <table1> TO
<vim_new_begdate>. ASSIGN COMPONENT x_namtab-viewfield OF STRUCTURE
<table1> TO <vim_begdate_mask> CASTING TYPE c. MOVE: x_namtab-viewfield
TO vim_sval_tab-fieldname, x_namtab-viewfield TO
vim_begdate_name-fieldname. vim_begdate_is_ro = x_namtab-readonly.
ENDIF. ELSE. CHECK keydate_alr_assigned EQ space. keydate_alr_assigned
= 'X'. IF x_namtab-texttabfld EQ space. ASSIGN COMPONENT
x_namtab-viewfield OF STRUCTURE <table1> TO <vim_enddate_mask> CASTING
TYPE c. IF x_namtab-position GT 0. IF x_header-generictrp <> 'X'.
length = x_namtab-position DIV cl_abap_char_utilities=>charsize.
ASSIGN: <table1>(length) TO <vim_f1_before> CASTING TYPE c,
vim_mainkey(length) TO <vim_mkey_before> CASTING TYPE c,
vim_old_viewkey(length) TO <vim_old_mkey_before> CASTING TYPE c. ENDIF.
IF NOT ( <vim_f1_before> IS ASSIGNED OR <vim_mkey_before> IS ASSIGNED
OR <vim_old_mkey_before> IS ASSIGNED ). ASSIGN:
<table1_x>(x_namtab-position) TO <vim_f1_before> CASTING TYPE x,
<vim_h_mkey>(x_namtab-position) TO <vim_mkey_before> CASTING TYPE x,
<vim_h_old_mkey>(x_namtab-position) TO <vim_old_mkey_before> CASTING
TYPE x. ENDIF. ASSIGN: <table1_x>(x_namtab-position) TO
<vim_f1_beforex>, <vim_h_mkey>(x_namtab-position) TO
<vim_mkey_beforex>, <vim_h_old_mkey>(x_namtab-position) TO
<vim_old_mkey_beforex>, <vim_h_coll_bfkey>(x_namtab-position) TO
<vim_collapsed_mkey_bfx>. CLEAR vim_no_mainkey_exists. ELSE. ASSIGN:
vim_dummy_mainkey TO <vim_mkey_before> TYPE 'C', <vim_mkey_before> TO
<vim_old_mkey_before>, <vim_mkey_before> TO <vim_f1_before>,
vim_dummy_mainkey TO <vim_mkey_beforex> CASTING, <vim_mkey_beforex> TO
<vim_old_mkey_beforex>, <vim_mkey_beforex> TO <vim_f1_beforex>,
<vim_mkey_beforex> TO <vim_collapsed_mkey_bfx>. vim_no_mainkey_exists =
'X'. ENDIF. MOVE x_namtab-viewfield TO vim_enddate_name-fieldname.
PERFORM vim_assign_mainkey_after USING sy-tabix. ENDIF. ENDIF. ELSE. IF
x_header-delmdtflag EQ 'E'. CHECK keydate_alr_assigned EQ space.
keydate_alr_assigned = 'X'. IF x_namtab-texttabfld EQ space. ASSIGN
COMPONENT x_namtab-viewfield OF STRUCTURE <table1> TO
<vim_enddate_mask> CASTING TYPE c. IF x_namtab-position GT 0. IF
x_header-generictrp <> 'X'. length = x_namtab-position DIV
cl_abap_char_utilities=>charsize. ASSIGN: <table1>(length) TO
<vim_f1_before> CASTING TYPE c, vim_mainkey(length) TO
<vim_mkey_before> CASTING TYPE c, vim_old_viewkey(length) TO
<vim_old_mkey_before> CASTING TYPE c. ENDIF. IF NOT ( <vim_f1_before>
IS ASSIGNED OR <vim_mkey_before> IS ASSIGNED OR <vim_old_mkey_before>
IS ASSIGNED ). ASSIGN: <table1_x>(x_namtab-position) TO <vim_f1_before>
CASTING TYPE x, vim_mainkey(x_namtab-position) TO <vim_mkey_before>
CASTING TYPE x, vim_old_viewkey(x_namtab-position) TO
<vim_old_mkey_before> CASTING TYPE x. ENDIF. ASSIGN:
<table1_x>(x_namtab-position) TO <vim_f1_beforex>,
<vim_h_mkey>(x_namtab-position) TO <vim_mkey_beforex>,
<vim_h_old_mkey>(x_namtab-position) TO <vim_old_mkey_beforex>,
<vim_h_coll_bfkey>(x_namtab-position) TO <vim_collapsed_mkey_bfx>.
CLEAR vim_no_mainkey_exists. ELSE. ASSIGN: vim_dummy_mainkey TO
<vim_mkey_before> TYPE 'C', <vim_mkey_before> TO <vim_old_mkey_before>,
<vim_mkey_before> TO <vim_f1_before>, vim_dummy_mainkey TO
<vim_mkey_beforex> CASTING, <vim_mkey_beforex> TO
<vim_old_mkey_beforex>, <vim_mkey_beforex> TO <vim_f1_beforex>,
<vim_mkey_beforex> TO <vim_collapsed_mkey_bfx>. vim_no_mainkey_exists =
'X'. ENDIF. MOVE x_namtab-viewfield TO vim_enddate_name-fieldname.
PERFORM vim_assign_mainkey_after USING sy-tabix. ENDIF. ELSE. IF
x_namtab-texttabfld EQ space. ASSIGN COMPONENT x_namtab-viewfield OF
STRUCTURE <table1> TO <vim_new_begdate>. ASSIGN COMPONENT
x_namtab-viewfield OF STRUCTURE <table1> TO <vim_begdate_mask> CASTING
TYPE c. MOVE: x_namtab-viewfield TO vim_sval_tab-fieldname,
x_namtab-viewfield TO vim_begdate_name-fieldname. vim_begdate_is_ro =
x_namtab-readonly. ENDIF. ENDIF. ENDIF. ENDLOOP. APPEND vim_sval_tab.
CONDENSE: vim_begdate_name NO-GAPS, vim_enddate_name NO-GAPS. MOVE:
x_header-viewname TO vim_memory_id_1-viewname, sy-uname TO
vim_memory_id_1-user. IMPORT vim_collapsed_mainkeys FROM MEMORY ID
vim_memory_id_1. IF sy-subrc NE 0. REFRESH vim_collapsed_mainkeys.
ENDIF. ASSIGN: <vim_h_coll_mkey>(x_header-keylen) TO
<vim_collapsed_keyx>, <vim_h_coll_logkey>(x_header-keylen) TO
<vim_collapsed_logkeyx>, <vim_h_merged_key>(x_header-keylen) TO
<vim_merged_keyx>. IF x_header-generictrp <> 'X'. ASSIGN:
vim_collapsed_mainkeys-mainkey(x_header-keylen) TO <vim_collapsed_key>,
vim_collapsed_mainkeys-log_key(x_header-keylen) TO
<vim_collapsed_logkey>, vim_merged_entries-merged_key(x_header-keylen)
TO <vim_merged_key>. ELSE. ASSIGN: <vim_collapsed_keyx> TO
<vim_collapsed_key>, <vim_collapsed_logkeyx> TO <vim_collapsed_logkey>,
<vim_merged_keyx> TO <vim_merged_key>. ENDIF. ENDIF. ASSIGN
vim_mainkey(x_header-keylen) TO <vim_mainkey_mask>. CLEAR
vim_prtfky_assigned. IF vim_called_by_cluster NE space. master_type =
vim_clus_type. master_name = vim_calling_cluster. ENDIF. MOVE:
transporter TO e071-pgmid, master_type TO e071-object, master_name TO
e071-obj_name, e071_objfunc TO e071-objfunc, transporter TO
e071k-pgmid, transp_object TO e071k-object, space TO e071k-as4pos,
master_type TO e071k-mastertype, master_name TO e071k-mastername, space
TO e071k-objfunc, space TO e071k-flag. PERFORM vim_get_img_activity
CHANGING e071k-activity. IF x_header-existency EQ space OR
x_header-existency EQ 'M'. MOVE sortflag_with_existency TO
e071k-sortflag. ELSE. MOVE sortflag_without_existency TO
e071k-sortflag. ENDIF. REFRESH vim_corr_objtab. CLEAR
vim_corr_obj_viewname. IF x_header-texttbexst <> space. PERFORM
vim_initialize_texttab. vim_texttab_is_ro = 'X'. LOOP AT x_namtab WHERE
keyflag EQ space AND bastabname EQ x_header-texttab AND readonly NE
rdonly. CLEAR vim_texttab_is_ro. EXIT. ENDLOOP. ENDIF. CLEAR looplines.
vim_coming_from_img = 'N'. IF vim_called_by_cluster = space. ELSE. CALL
FUNCTION 'VIEWCLUSTER_PR_IMPORT_CTRL' EXPORTING viewname =
x_header-viewname action = 'P' CHANGING coming_from_img =
vim_coming_from_img EXCEPTIONS wrong_parameter = 1 OTHERS = 2. ENDIF.
last_view_info = view_name. PERFORM vim_maint_selflag USING 'I'
CHANGING x_header-selection. ENDFORM. FORM vim_initialize_texttab.
DATA: idx LIKE sy-tabix, texttab_l TYPE i. READ TABLE
vim_texttab_container WITH KEY viewname = view_name BINARY SEARCH.
vim_texttab_container_index = sy-tabix. IF sy-subrc <> 0. CLEAR
vim_texttab_container-tabdata-valid_idx. REFRESH
vim_texttab_container-tabdata-tab_us. REFRESH
vim_texttab_container-tabdata-tab_vs. REFRESH
vim_texttab_container-tabdata-tab_s. REFRESH
vim_texttab_container-tabdata-tab_m. REFRESH
vim_texttab_container-tabdata-tab_l. REFRESH
vim_texttab_container-tabdata-tab_vl. REFRESH
vim_texttab_container-tabdata-tab_ul. REFRESH
vim_texttab_container-sel_langus. CLEAR vim_texttab_container.
vim_texttab_container-viewname = view_name. texttab_l = (
x_header-after_keyc + x_header-aft_txttbc ) /
cl_abap_char_utilities=>charsize + 1. IF texttab_l LE ultra_short_tab.
vim_texttab_container-tabdata-valid_idx = 2. ELSEIF texttab_l LE
very_short_tab. vim_texttab_container-tabdata-valid_idx = 3. ELSEIF
texttab_l LE short_tab. vim_texttab_container-tabdata-valid_idx = 4.
ELSEIF texttab_l LE middle_tab. vim_texttab_container-tabdata-valid_idx
= 5. ELSEIF texttab_l LE long_tab.
vim_texttab_container-tabdata-valid_idx = 6. ELSEIF texttab_l LE
very_long_tab. vim_texttab_container-tabdata-valid_idx = 7. ELSEIF
texttab_l LE ultra_long_tab. vim_texttab_container-tabdata-valid_idx =
8. ENDIF. INSERT vim_texttab_container INDEX
vim_texttab_container_index. ENDIF. idx =
vim_texttab_container-tabdata-valid_idx. ASSIGN COMPONENT idx OF
STRUCTURE vim_texttab_container-tabdata TO <vim_texttab>. ASSIGN
vim_texttab_container-sel_langus TO <vim_read_langus>. ENDFORM. FORM
vim_fill_vim_guid_domain. MOVE: 'I' TO vim_guid_domain-sign, 'EQ' TO
vim_guid_domain-option. MOVE 'SYSUUID' TO vim_guid_domain-low. APPEND
vim_guid_domain. MOVE 'SYSUUID_C' TO vim_guid_domain-low. APPEND
vim_guid_domain. MOVE 'SYSUUID_22' TO vim_guid_domain-low. APPEND
vim_guid_domain. MOVE 'SYSUUID_25' TO vim_guid_domain-low. APPEND
vim_guid_domain. ENDFORM. FORM vim_set_init_from_sellist USING
p_tabname TYPE tabname p_namtab LIKE x_namtab[] p_sellist LIKE
dba_sellist[] p_maintdesc TYPE vfldroflag CHANGING p_init TYPE any.
DATA: count TYPE i, h_ix TYPE i, rcode TYPE xfeld, tabfld TYPE
tabfield. FIELD-SYMBOLS: <namtab> TYPE vimnamtab, <sel_wa> TYPE
vimsellist, <value> TYPE ANY. LOOP AT p_namtab ASSIGNING <namtab> WHERE
readonly = p_maintdesc. CLEAR: rcode, count, h_ix. LOOP AT p_sellist
ASSIGNING <sel_wa> WHERE viewfield EQ <namtab>-viewfield AND ( negation
EQ space AND operator EQ 'EQ' OR negation EQ 'NOT' AND operator EQ 'NE'
) AND ( ddic CO 'XB' OR ddic CO 'SB' ). ADD 1 TO count. CHECK
<sel_wa>-and_or EQ space OR <sel_wa>-and_or EQ 'AND'. rcode = 'X'. h_ix
= sy-tabix. ENDLOOP. IF rcode = space OR count > 1. CLEAR: rcode,
count. LOOP AT p_sellist ASSIGNING <sel_wa> WHERE viewfield EQ
<namtab>-viewfield AND ( negation EQ space AND operator EQ 'EQ' OR
negation EQ 'NOT' AND operator EQ 'NE' ) AND ( ddic EQ 'A' ). ADD 1 TO
count. CHECK <sel_wa>-and_or EQ space OR <sel_wa>-and_or EQ 'AND'.
rcode = 'X'. h_ix = sy-tabix. ENDLOOP. ENDIF. IF rcode <> space AND
count = 1. ASSIGN COMPONENT <namtab>-viewfield OF STRUCTURE p_init TO
<value>. CHECK sy-subrc = 0. tabfld-tabname = p_tabname.
tabfld-fieldname = tabfld-lfieldname = <namtab>-viewfield. CALL
FUNCTION 'RS_CONV_EX_2_IN' EXPORTING input_external = <sel_wa>-value
table_field = tabfld IMPORTING output_internal = <value> EXCEPTIONS
OTHERS = 1. IF sy-subrc <> 0. CLEAR <value>. ENDIF. ENDIF. ENDLOOP.
ENDFORM. FORM vim_fill_date_type. MOVE: 'I' TO vim_begda_types-sign,
'EQ' TO vim_begda_types-option. MOVE vim_begdate_dtel1 TO
vim_begda_types-low. APPEND vim_begda_types. MOVE vim_begdate_dtel2 TO
vim_begda_types-low. APPEND vim_begda_types. MOVE vim_begdate_dtel3 TO
vim_begda_types-low. APPEND vim_begda_types. MOVE vim_begdate_dtel4 TO
vim_begda_types-low. APPEND vim_begda_types. MOVE vim_enddate_dtel1 TO
vim_begda_types-low. APPEND vim_begda_types TO vim_endda_types. MOVE
vim_enddate_dtel2 TO vim_begda_types-low. APPEND vim_begda_types TO
vim_endda_types. MOVE vim_enddate_dtel3 TO vim_begda_types-low. APPEND
vim_begda_types TO vim_endda_types. MOVE vim_enddate_dtel4 TO
vim_begda_types-low. APPEND vim_begda_types TO vim_endda_types.
ENDFORM. FORM vim_process_assigns. DATA: length TYPE i,
keydate_alr_assigned(1) TYPE c, tablength TYPE i, texttablength TYPE i,
keylen_bef_date TYPE i, xlength type i. TRANSLATE vim_prtfky_assigned
USING 'XY'. ASSIGN: <initial> TO <initial_x> CASTING, total TO
<vim_ctotal> CASTING TYPE c, total TO <vim_total_struc> CASTING TYPE
(x_header-maintview), total to <vim_xtotal> casting, extract TO
<vim_cextract> CASTING TYPE c, extract TO <vim_extract_struc> CASTING
TYPE (x_header-maintview), extract to <vim_xextract> casting,
corr_keytab-tabkey to <vim_corr_keyx> casting. tablength =
x_header-after_tabc / cl_abap_char_utilities=>charsize. texttablength =
x_header-aft_txttbc / cl_abap_char_utilities=>charsize. IF
x_header-bastab NE space AND x_header-texttbexst NE space. length =
tablength + texttablength. xlength = x_header-texttablen +
x_header-tablen. ASSIGN: <vim_ctotal>+tablength(texttablength) TO
<total_text>, <vim_xtotal>+x_header-after_tabc(x_header-texttablen) to
<vim_xtotal_text>, <vim_xtotal_text> to <vim_tot_txt_struc> casting
type (x_header-texttab), <vim_cextract>(tablength) TO <extract_enti>,
<vim_cextract>+tablength(texttablength) TO <extract_text>,
<vim_xextract>+x_header-after_tabc(x_header-texttablen) to
<vim_xextract_text>, <vim_xextract_text> to <vim_ext_txt_struc> casting
type (x_header-texttab). ELSE. length = tablength. xlength =
x_header-tablen. ENDIF. ASSIGN: <vim_ctotal>+length(1) TO <action>,
<action>+1(1) TO <mark>, <vim_cextract>(length) TO <table2>,
<vim_xextract>(xlength) to <table2_x>, <vim_xextract>(x_header-tablen)
to <vim_xextract_enti>, <vim_cextract>+length(1) TO <xact>, <xact>+1(1)
TO <xmark>, <vim_ctotal>(vim_ctabkeylen) TO <vim_total_key>,
<vim_cextract>(vim_ctabkeylen) TO <vim_extract_key>,
<vim_xtotal>(x_header-keylen) TO <vim_xtotal_key>,
<vim_xextract>(x_header-keylen) TO <vim_xextract_key>. IF
x_header-bastab NE space AND x_header-texttbexst NE space. ASSIGN:
<mark>+1(1) TO <action_text>, <xmark>+1(1) TO <xact_text>. ENDIF. IF
x_header-adrnbrflag NE space. assign vim_addresses_to_save-handle to
<vim_addr_handle_x> casting. LOOP AT x_namtab WHERE domname IN
adrnbr_domain. ASSIGN COMPONENT x_namtab-viewfield OF STRUCTURE
<vim_total_struc> TO <vim_total_address_number>. EXIT. ENDLOOP. ENDIF.
IF x_header-delmdtflag NE space. LOOP AT x_namtab WHERE domname EQ
vim_delim_date_domain AND ( rollname in vim_begda_types or rollname in
vim_endda_types ). IF x_namtab-rollname in vim_begda_types. IF
x_header-delmdtflag EQ 'E'. IF x_namtab-texttabfld EQ space. ASSIGN
COMPONENT x_namtab-viewfield OF STRUCTURE <vim_total_struc> TO
<vim_begdate>. ENDIF. ELSE. CHECK keydate_alr_assigned EQ space OR
keydate_alr_assigned EQ 'E' AND x_namtab-texttabfld NE space OR
keydate_alr_assigned EQ 'T' AND x_namtab-texttabfld EQ space. IF
x_namtab-texttabfld EQ space. TRANSLATE keydate_alr_assigned USING
' ETX'. ASSIGN COMPONENT x_namtab-viewfield OF STRUCTURE
<vim_total_struc> TO <vim_enddate>. IF x_namtab-position GT 0. ASSIGN:
<vim_xtotal>(x_namtab-position) TO <vim_tot_mkey_beforex> casting,
<vim_xextract>(x_namtab-position) TO <vim_ext_mkey_beforex> casting.
keylen_bef_date = x_namtab-position DIV
cl_abap_char_utilities=>charsize. ASSIGN: <vim_ctotal>(keylen_bef_date)
TO <vim_tot_mkey_before> TYPE 'C', <vim_cextract>(keylen_bef_date) TO
<vim_ext_mkey_before> TYPE 'C'. ELSE. ASSIGN: vim_dummy_mainkey TO
<vim_tot_mkey_beforex> casting , vim_dummy_mainkey TO
<vim_tot_mkey_beforex> casting , vim_dummy_mainkey TO
<vim_tot_mkey_before> TYPE 'C', <vim_tot_mkey_before> TO
<vim_ext_mkey_before> TYPE 'C'. ENDIF. IF vim_mkey_after_exists NE
space. PERFORM vim_assign_mkey_after_2 USING sy-tabix. ENDIF. ELSE.
TRANSLATE keydate_alr_assigned USING ' TEX'. ASSIGN COMPONENT
x_namtab-viewfield OF STRUCTURE <vim_tot_txt_struc> TO
<vim_text_enddate>. ENDIF. ENDIF. ELSE. IF x_header-delmdtflag EQ 'E'.
CHECK keydate_alr_assigned EQ space OR keydate_alr_assigned EQ 'E' AND
x_namtab-texttabfld NE space OR keydate_alr_assigned EQ 'T' AND
x_namtab-texttabfld EQ space. IF x_namtab-texttabfld EQ space.
TRANSLATE keydate_alr_assigned USING ' ETX'. ASSIGN COMPONENT
x_namtab-viewfield OF STRUCTURE <vim_total_struc> TO <vim_enddate>. IF
x_namtab-position GT 0. ASSIGN: <vim_xtotal>(x_namtab-position) TO
<vim_tot_mkey_beforex> casting, <vim_xextract>(x_namtab-position) TO
<vim_ext_mkey_beforex> casting. keylen_bef_date = x_namtab-position DIV
cl_abap_char_utilities=>charsize. ASSIGN: <vim_ctotal>(keylen_bef_date)
TO <vim_tot_mkey_before> TYPE 'C', <vim_cextract>(keylen_bef_date) TO
<vim_ext_mkey_before> TYPE 'C'. ELSE. ASSIGN: vim_dummy_mainkey TO
<vim_tot_mkey_beforex> casting , vim_dummy_mainkey TO
<vim_ext_mkey_beforex> casting , vim_dummy_mainkey TO
<vim_tot_mkey_before> TYPE 'C', <vim_tot_mkey_before> TO
<vim_ext_mkey_before> TYPE 'C'. ENDIF. IF vim_mkey_after_exists NE
space. PERFORM vim_assign_mkey_after_2 USING sy-tabix. ENDIF. ELSE.
TRANSLATE keydate_alr_assigned USING ' TEX'. ASSIGN COMPONENT
x_namtab-viewfield OF STRUCTURE <vim_tot_txt_struc> TO
<vim_text_enddate>. ENDIF. ELSE. IF x_namtab-texttabfld EQ space.
ASSIGN COMPONENT x_namtab-viewfield OF STRUCTURE <vim_total_struc> TO
<vim_begdate>. ENDIF. ENDIF. ENDIF. ENDLOOP. ENDIF. ENDFORM. FORM
vim_assign_mkey_after_2 USING value(vama2_tabix) TYPE i.
LOCAL:x_namtab. DATA: vama_ix TYPE i, keylen TYPE i, position TYPE i.
FIELD-SYMBOLS: <x_namtab> TYPE vimnamtab. check vim_mkey_after_exists
<> space. vama_ix = vama2_tabix + 1. READ TABLE x_namtab ASSIGNING
<x_namtab> INDEX vama_ix. vama_ix = x_header-keylen -
<x_namtab>-position. ASSIGN: <vim_xtotal>+<x_namtab>-position(vama_ix)
TO <vim_tot_mkey_afterx>, <vim_xextract>+<x_namtab>-position(vama_ix)
TO <vim_ext_mkey_afterx>. IF x_header-generictrp <> 'X'. keylen =
x_header-keylen / cl_abap_char_utilities=>charsize. position =
<x_namtab>-position / cl_abap_char_utilities=>charsize. vama_ix =
keylen - position. ASSIGN: <vim_ctotal>+position(vama_ix) TO
<vim_tot_mkey_after> TYPE 'C', <vim_cextract>+position(vama_ix) TO
<vim_ext_mkey_after> TYPE 'C'. ELSE. ASSIGN:
<vim_xtotal>+<x_namtab>-position(vama_ix) TO <vim_tot_mkey_after>,
<vim_xextract>+<x_namtab>-position(vama_ix) TO <vim_ext_mkey_after>.
ENDIF. ENDFORM. FORM vim_assign_mainkey_after USING value(vama_tabix)
TYPE i. DATA: vama_ix TYPE i, length TYPE i. FIELD-SYMBOLS: <x_namtab>
TYPE vimnamtab. vama_ix = vama_tabix + 1. READ TABLE x_namtab ASSIGNING
<x_namtab> INDEX vama_ix. IF sy-subrc EQ 0 AND <x_namtab>-texttabfld EQ
space AND <x_namtab>-position LT x_header-keylen. vama_ix =
x_header-keylen - <x_namtab>-position. ASSIGN:
<table1_x>+<x_namtab>-position(vama_ix) TO <vim_f1_afterx>,
<vim_h_coll_mkey>+<x_namtab>-position(vama_ix) TO
<vim_collapsed_key_afx>, <vim_h_mkey>+<x_namtab>-position(vama_ix) TO
<vim_mkey_afterx>, <vim_h_old_mkey>+<x_namtab>-position(vama_ix) TO
<vim_old_mkey_afterx>. IF x_header-generictrp <> 'X'. length =
<x_namtab>-position DIV cl_abap_char_utilities=>charsize. vama_ix =
vama_ix DIV cl_abap_char_utilities=>charsize. ASSIGN:
<table1>+length(vama_ix) TO <vim_f1_after>,
vim_collapsed_mainkeys-mainkey+length(vama_ix) TO
<vim_collapsed_key_af>, vim_mainkey+length(vama_ix) TO
<vim_mkey_after>, vim_old_viewkey+length(vama_ix) TO
<vim_old_mkey_after>. ELSE. ASSIGN: <vim_f1_afterx> TO <vim_f1_after>,
<vim_collapsed_key_afx> TO <vim_collapsed_key_af>, <vim_mkey_afterx> TO
<vim_mkey_after>, <vim_old_mkey_afterx> TO <vim_old_mkey_after>. ENDIF.
vim_mkey_after_exists = 'X'. CLEAR vim_no_mainkey_exists. ELSE. CLEAR
vim_mkey_after_exists. ENDIF. ENDFORM. FORM SET_POSITION_INFO USING
VALUE(SPI_POSITION) TYPE I VALUE(SPI_ENTRIES) TYPE I. DATA: HF1 TYPE I,
HF2 TYPE I, HF3 TYPE I, P_VIM_POSITION_INFO_LEN TYPE I. MOVE
VIM_POSITION_INFO_MASK TO VIM_POSITION_INFO. HF1 =
VIM_POSITION_INFO_LG1 + 1. IF SPI_ENTRIES EQ 0. HF3 = 0. ELSE. HF3 =
SPI_POSITION. ENDIF. WRITE HF3 TO
VIM_POSITION_INFO+HF1(VIM_POSITION_INFO_LG3) NO-SIGN. HF1 =
VIM_POSITION_INFO_LG1 + VIM_POSITION_INFO_LG2 + VIM_POSITION_INFO_LG3 +
3. WRITE SPI_ENTRIES TO VIM_POSITION_INFO+HF1(VIM_POSITION_INFO_LG3)
NO-SIGN. DO. CONDENSE VIM_POSITION_INFO. CALL METHOD
cl_scp_linebreak_util=>get_visual_stringlength EXPORTING im_string =
VIM_POSITION_INFO IM_LANGU = SY-LANGU IMPORTING EX_POS_VIS =
P_VIM_POSITION_INFO_LEN . IF sy-subrc <> 0. ENDIF. HF2 =
VIM_POSITION_INFO_LEN - P_VIM_POSITION_INFO_LEN. IF HF2 GT 0. SHIFT
VIM_POSITION_INFO RIGHT BY HF2 PLACES. ENDIF. IF HF2 GE 0. EXIT. ENDIF.
HF1 = STRLEN( SVIM_TEXT_028 ). REPLACE SVIM_TEXT_028 LENGTH HF1 WITH
'/' INTO VIM_POSITION_INFO. IF SY-SUBRC NE 0. HF1 = STRLEN(
SVIM_TEXT_027 ) + HF2 - 1. IF HF1 GT 0. WRITE '.' TO
VIM_POSITION_INFO+HF1(1). ADD 1 TO HF1. HF2 = - HF2. WRITE '          '
TO VIM_POSITION_INFO+HF1(HF2). ELSE. EXIT. ENDIF. ENDIF. ENDDO.
ENDFORM. FORM SET_NUMBERED_TEXTS. DATA: NAME(20) TYPE C. FIELD-SYMBOLS:
<M1>. READ TEXTPOOL MASTER_FPOOL INTO TEXTPOOL_TAB LANGUAGE SY-LANGU.
SORT TEXTPOOL_TAB BY ID KEY. MOVE NBRD_TEXTS_PREFIX TO NAME. LOOP AT
TEXTPOOL_TAB WHERE ID EQ 'I'. WRITE TEXTPOOL_TAB-KEY TO
NAME+NBRD_TEXTS_PREFIX_LENGTH. ASSIGN (NAME) TO <M1>. IF SY-SUBRC = 0.
MOVE TEXTPOOL_TAB-ENTRY TO <M1>. ENDIF. ENDLOOP. ENDFORM. FORM
INIT_STATE_VECTOR. NEXTLINE = 1. MOVE: NICHT_GELOESCHT TO
<STATUS>-ST_DELETE, GESAMTDATEN TO <STATUS>-ST_DATA, GESAMTDATEN TO
TITLE-DATA, LIST_BILD TO <STATUS>-ST_MODE, LIST_BILD TO TITLE-MODE,
MAINT_MODE TO <STATUS>-ST_ACTION, MAINT_MODE TO TITLE-ACTION,
<STATUS>-CORR_NBR TO <STATUS>-L_CORR_NBR, CORR_NBR TO
<STATUS>-CORR_NBR, TITLE TO <STATUS>-TITLE, 1 TO <STATUS>-CUR_LINE, 1
TO <STATUS>-FIRSTLINE, 0 TO <STATUS>-MK_XT, 0 TO <STATUS>-MK_TO, 0 TO
<STATUS>-MAXLINES, 0 TO <STATUS>-CUR_OFFSET, SPACE TO <STATUS>-FCODE,
SPACE TO <STATUS>-CUR_FIELD, SPACE TO <STATUS>-UPD_FLAG, SPACE TO
<STATUS>-CRCNTSKNWN, SPACE TO <STATUS>-KEYTBMODFD, SPACE TO
<STATUS>-DLCLALRCKD, SPACE TO <STATUS>-TR_ALRCHKD, 'x' TO
<STATUS>-INITIALIZD, NICHT_MARKIERT TO BLOCK_SW. IF MAINT_MODE =
STATUS-ACTION OR MAINT_MODE = ANZEIGEN. CLEAR <STATUS>-PROF_FOUND.
ENDIF. CLEAR <STATUS>-NEWADRCNT. CLEAR FILL_EXTR_FIRST_PROC. TRANSLATE
<STATUS>-ALR_SORTED USING 'RXX '. CLEAR: VIM_OLD_VIEWKEY,
VIM_OLD_ST_SELECTED. TRANSLATE VIM_NO_MAINKEY_EXISTS USING
VIM_NO_MKEY_NOT_PROCSD_PATT. LAST_CORR_NUMBER = <STATUS>-L_CORR_NBR.
ENDFORM. FORM SET_STATUS_NOKEYSELCNDS. CLEAR <STATUS>-NOKEYSLCDS. LOOP
AT <VIM_CK_SELLIST> INTO DPL_SELLIST. READ TABLE X_NAMTAB INDEX
DPL_SELLIST-TABIX. IF X_NAMTAB-KEYFLAG EQ SPACE. <STATUS>-NOKEYSLCDS =
'X'. EXIT. ENDIF. ENDLOOP. <STATUS>-INITIALIZD = 'X'. ENDFORM. FORM
exclude_cua_functions. MOVE 'SLCT' TO excl_cua_funct-function. COLLECT
excl_cua_funct. IF x_header-delmdtflag EQ space. MOVE 'DELM' TO
excl_cua_funct-function. COLLECT excl_cua_funct. MOVE 'EXPA' TO
excl_cua_funct-function. COLLECT excl_cua_funct. TRANSLATE
x_header-existency USING 'MU'. MODIFY x_header INDEX 1. ELSEIF
vim_begdate_is_ro NE space. MOVE 'DELM' TO excl_cua_funct-function.
COLLECT excl_cua_funct. MODIFY x_header INDEX 1. ENDIF. CASE
x_header-existency. WHEN 'U'. MOVE 'NEWL' TO excl_cua_funct-function.
COLLECT excl_cua_funct. MOVE 'ALNW' TO excl_cua_funct-function. COLLECT
excl_cua_funct. MOVE 'ALOE' TO excl_cua_funct-function. COLLECT
excl_cua_funct. MOVE 'DELE' TO excl_cua_funct-function. COLLECT
excl_cua_funct. MOVE 'KOPE' TO excl_cua_funct-function. COLLECT
excl_cua_funct. MOVE 'DELM' TO excl_cua_funct-function. COLLECT
excl_cua_funct. WHEN 'M'. MOVE 'NEWL' TO excl_cua_funct-function.
COLLECT excl_cua_funct. WHEN 'R'. MOVE 'AEND' TO
excl_cua_funct-function. COLLECT excl_cua_funct. ENDCASE. IF
x_header-clidep EQ space OR sy-mandt EQ '000'. MOVE 'COMP' TO
excl_cua_funct-function. COLLECT excl_cua_funct. IF x_header-clidep EQ
space. MOVE 'CMPO' TO excl_cua_funct-function. COLLECT excl_cua_funct.
ENDIF. ENDIF. IF x_header-flag NE space AND x_header-cursetting EQ 'Y'
AND NOT ( x_header-frm_e071 NE space OR x_header-frm_e071ks NE space OR
x_header-frm_e071ka NE space ). MOVE 'TRSP' TO excl_cua_funct-function.
COLLECT excl_cua_funct. ENDIF. IF x_header-adrnbrflag EQ space. MOVE
'ADDR' TO excl_cua_funct-function. COLLECT excl_cua_funct. ELSE. LOOP
AT excl_cua_funct WHERE function EQ 'ADDR'. DELETE excl_cua_funct.
ENDLOOP. ENDIF. IF x_header-scrfrmflag EQ space. MOVE 'SCRF' TO
excl_cua_funct-function. COLLECT excl_cua_funct. ELSE. LOOP AT
excl_cua_funct WHERE function EQ 'SCRF'. DELETE excl_cua_funct.
ENDLOOP. ENDIF. IF x_header-texttbexst EQ space. MOVE 'LANG' TO
excl_cua_funct-function. COLLECT excl_cua_funct. MOVE 'TEXT' TO
excl_cua_funct-function. COLLECT excl_cua_funct. ENDIF. IF
vim_coming_from_img = 'N'. MOVE 'GPRF' TO excl_cua_funct-function.
COLLECT excl_cua_funct. MOVE 'UPRF' TO excl_cua_funct-function. COLLECT
excl_cua_funct. ELSE. IF maint_mode = anzeigen. MOVE 'UPRF' TO
excl_cua_funct-function. COLLECT excl_cua_funct. ELSE. DELETE
excl_cua_funct WHERE function = 'UPRF'. ENDIF. ENDIF. IF
<status>-bcfixnochg = space. MOVE 'BCCH' TO excl_cua_funct-function.
COLLECT excl_cua_funct. MOVE 'BCSH' TO excl_cua_funct-function. COLLECT
excl_cua_funct. ELSE. DELETE excl_cua_funct WHERE function = 'BCCH'.
DELETE excl_cua_funct WHERE function = 'BCSH'. ENDIF. ENDFORM. FORM
set_pf_status USING value(sps_status). DATA: sps_state LIKE sy-pfkey,
sps_stat TYPE state_vector. CASE x_header-gui_prog. WHEN master_fpool.
MOVE sps_status TO sps_state. CALL FUNCTION 'VIEW_SET_PF_STATUS'
EXPORTING status = sps_state objimp = x_header-importable TABLES
excl_cua_funct = excl_cua_funct. WHEN sy-repid. MOVE sps_status TO
sps_stat. IF sps_stat-action EQ anzeigen OR sps_stat-action EQ
transportieren OR ( sy-mandt EQ '000' AND vim_system_type NE 'SAP' ) OR
x_header-importable = vim_not_importable. vim_comp_menue_text =
svim_text_045. ELSE. vim_comp_menue_text = svim_text_046. ENDIF.
vim_pr_stat_txt_ch = svim_text_prb. vim_pr_stat_txt_ta = svim_text_prc.
vim_pr_stat_txt_me = svim_text_pri. vim_pr_stat_txt_or = svim_text_prj.
SET PF-STATUS sps_status EXCLUDING excl_cua_funct. WHEN OTHERS. RAISE
wrong_gui_programm. ENDCASE. ENDFORM. FORM set_title USING st_title
st_title_text. DATA: st_state LIKE sy-pfkey. CASE x_header-gui_prog.
WHEN master_fpool. MOVE st_title TO st_state. CALL FUNCTION
'VIEW_SET_PF_STATUS' EXPORTING status = st_state title = 'X' title_text
= st_title_text objimp = x_header-importable TABLES excl_cua_funct =
excl_cua_funct. WHEN sy-repid. SET TITLEBAR st_title WITH
st_title_text. WHEN OTHERS. RAISE wrong_gui_programm. ENDCASE. ENDFORM.
FORM justify_action_mode. DATA: action_changed(1) TYPE c, assigned(1)
TYPE c. DATA: i_statetab LIKE adrstatus OCCURS 0 WITH HEADER LINE,
i_messnbr LIKE sy-msgno. FIELD-SYMBOLS: <f_fld_value> TYPE any. IF
fcode = vim_read_text. PERFORM vim_read_texttab_all_langus. EXIT.
ENDIF. LOOP AT x_namtab WHERE datatype = 'TIMS'. ASSIGN COMPONENT
x_namtab-viewfield of STRUCTURE <initial> TO <f_fld_value>. IF
<f_fld_value> <> SPACE. CLEAR <f_fld_value> WITH SPACE. ENDIF. ENDLOOP.
IF x_header-selection EQ space. DESCRIBE TABLE dba_sellist. IF sy-tfill
GT 0. MOVE 'X' TO x_header-selection. MODIFY x_header INDEX 1. ELSE.
DESCRIBE TABLE dpl_sellist. IF sy-tfill GT 0. MOVE 'X' TO
x_header-selection. MODIFY x_header INDEX 1. ENDIF. ENDIF. ELSEIF
x_header-selection = 'X'. DESCRIBE TABLE dba_sellist. IF sy-tfill GT 0.
IF last_view_info EQ view_name. PERFORM vim_set_init_from_sellist USING
x_header-maintview x_namtab[] dba_sellist[] vim_hidden CHANGING
<initial>. ENDIF. ENDIF. ENDIF. IF x_header-adrnbrflag NE space. CALL
FUNCTION 'ADDR_TSADRV_READ' EXPORTING ddic_tablename =
vim_addr_basetable ddic_fieldname = vim_addr_bastab_field IMPORTING
tsadrv_wa = vim_tsadrv EXCEPTIONS entry_not_found = 1. IF sy-subrc NE
0. IF x_header-adrnbrflag EQ 'N'. MESSAGE i287(am) WITH
vim_addr_basetable vim_addr_bastab_field. CLEAR x_header-adrnbrflag.
MODIFY x_header INDEX 1. ELSE. IF vim_system_type EQ 'SAP'. MESSAGE
i290(am) WITH vim_addr_basetable vim_addr_bastab_field. ELSE. MESSAGE
i291(am) WITH vim_addr_basetable vim_addr_bastab_field. ENDIF. ENDIF.
ELSE. IF vim_tsadrv-addr_group IS INITIAL. IF x_header-adrnbrflag EQ
'N'. i_messnbr = '292'. ELSE. IF vim_system_type EQ 'SAP'. i_messnbr =
'288'. ELSE. i_messnbr = '289'. ENDIF. ENDIF. MESSAGE ID 'AM' TYPE 'I'
NUMBER i_messnbr WITH vim_addr_basetable vim_addr_bastab_field
vim_tsadrv-tablename vim_tsadrv-fieldname. CLEAR x_header-adrnbrflag.
MODIFY x_header INDEX 1. ELSE. vim_addr_group = vim_tsadrv-addr_group.
IF x_header-adrnbrflag EQ 'O'. CALL FUNCTION 'ADDR_GET_STATUS_INFO'
TABLES status_table = i_statetab. READ TABLE i_statetab WITH KEY
constant = vim_tsadrv-addr_group. IF sy-subrc NE 0. CLEAR
i_statetab-value. ENDIF. TRANSLATE i_statetab-value USING ' OXN'.
x_header-adrnbrflag = i_statetab-value. MODIFY x_header INDEX 1. ENDIF.
ENDIF. ENDIF. ENDIF. PERFORM vim_process_assigns. IF
<status>-initializd EQ space. CALL FUNCTION 'VRM_REFRESH_VALUES'. IF
x_header-frm_af_ini NE space. ASSIGN dba_sellist-*sys* TO
<vim_sellist>. vim_enqueue_range = x_header-subsetflag. assigned = 'X'.
PERFORM (x_header-frm_af_ini) IN PROGRAM (sy-repid). ENDIF. DELETE
dba_sellist WHERE ddic = 'M'. DESCRIBE TABLE dba_sellist. IF sy-tfill
GT 0. READ TABLE dba_sellist INDEX sy-tfill. CLEAR dba_sellist-and_or.
MODIFY dba_sellist INDEX sy-tabix. ENDIF. ENDIF. IF view_action EQ
aendern AND function EQ switch_to_update_mode AND vim_enq_s_u_rc NE 0.
MOVE anzeigen TO view_action. action_changed = 'X'. ENDIF. IF
x_header-existency EQ rdonly AND ( view_action EQ aendern OR
view_action EQ transportieren ). MOVE anzeigen TO view_action.
action_changed = 'X'. MESSAGE i044(sv). ENDIF. IF <status>-corr_nbr EQ
vim_locked_in_corr AND ( view_action EQ aendern OR view_action EQ
transportieren ). MOVE anzeigen TO view_action. action_changed = 'X'.
ENDIF. IF view_action EQ aendern. IF vim_last_objh_view NE view_name.
PERFORM vim_set_ale_edit_lock. ENDIF. IF vim_ale_edit_lock NE space.
MOVE anzeigen TO view_action. action_changed = 'X'. MESSAGE ID
vim_ale_msgid TYPE 'I' NUMBER vim_ale_msgno WITH vim_ale_msgv1
vim_ale_msgv2 vim_ale_msgv3 vim_ale_msgv4. ENDIF. ENDIF. IF
x_header-frm_on_aut NE space AND <status>-initializd EQ space.
vim_auth_action = view_action. vim_auth_event = vim_auth_initial_check.
ASSIGN dba_sellist[] TO <vim_auth_sellist>. PERFORM
(x_header-frm_on_aut) IN PROGRAM. IF vim_auth_rc NE 0. MESSAGE ID
vim_auth_msgid TYPE 'I' NUMBER vim_auth_msgno WITH vim_auth_msgv1
vim_auth_msgv2 vim_auth_msgv3 vim_auth_msgv4. CASE vim_auth_rc. WHEN 4.
MOVE anzeigen TO view_action. action_changed = 'X'. WHEN 8. RAISE
missing_corr_number. ENDCASE. ENDIF. ENDIF. IF action_changed NE space.
IF assigned EQ space. ASSIGN dba_sellist-*sys* TO <vim_sellist>.
vim_enqueue_range = x_header-subsetflag. ENDIF. PERFORM enqueue USING
'D' x_header-frm_af_enq. ENDIF. IF x_header-texttbexst <> space.
PERFORM vim_actualize_d0100. ENDIF. ENDFORM. FORM
VIM_SET_ALE_EDIT_LOCK. DATA: I_EDITLOCK(1) TYPE C. VIM_LAST_OBJH_VIEW =
VIEW_NAME. REFRESH VIM_ALE_KEYSPEC_OBJTAB. IF X_HEADER-FLAG EQ SPACE.
PERFORM VIM_CHECK_ALE_EDIT_LOCK USING E071-OBJECT I_EDITLOCK.
VIM_ALE_EDIT_LOCK = I_EDITLOCK. IF VIM_ALE_EDIT_LOCK NE SPACE. EXIT.
ENDIF. ENDIF. IF X_HEADER-FRM_E071 NE SPACE. IF VIM_CORR_OBJ_VIEWNAME
NE X_HEADER-VIEWNAME. PERFORM (X_HEADER-FRM_E071) IN PROGRAM
(SY-REPID). CLEAR VIM_CORR_OBJ_VIEWNAME. ENDIF. LOOP AT
VIM_CORR_OBJTAB. PERFORM VIM_CHECK_ALE_EDIT_LOCK USING
VIM_CORR_OBJTAB-OBJECT I_EDITLOCK. VIM_ALE_EDIT_LOCK = I_EDITLOCK. IF
VIM_ALE_EDIT_LOCK NE SPACE. EXIT. ENDIF. ENDLOOP. ENDIF. ENDFORM. FORM
VIM_CHECK_ALE_EDIT_LOCK USING VALUE(VCAEL_OBJECT) LIKE E071-OBJECT
VCAEL_LOCK TYPE C. DATA: OBJ_TYPE LIKE OBJH-OBJECTTYPE, OBJ_NAME LIKE
OBJH-OBJECTNAME. OBJ_NAME = MASTER_NAME. CASE VCAEL_OBJECT. WHEN
VIM_VIEW_TYPE. OBJ_TYPE = VIM_VIEW. WHEN TRANSP_OBJECT. OBJ_TYPE =
VIM_TABL. WHEN VIM_CLUS_TYPE. OBJ_TYPE = VIM_CLST. WHEN VIM_TRAN_TYPE.
OBJ_TYPE = VIM_TRAN. WHEN OTHERS. OBJ_TYPE = VIM_LOGO. OBJ_NAME =
VCAEL_OBJECT. ENDCASE. CALL FUNCTION 'ALE_EDIT_CHECK' EXPORTING
OBJECTTYPE = OBJ_TYPE OBJECTNAME = OBJ_NAME IMPORTING SOMEKEYS_NOEDIT =
VIM_ALE_KEYSPEC_CHECK EXCEPTIONS NO_CALL = 1 NO_EDIT = 2. IF SY-SUBRC
GT 1. VCAEL_LOCK = 'X'. VIM_ALE_MSGID = SY-MSGID. VIM_ALE_MSGNO =
SY-MSGNO. VIM_ALE_MSGV1 = SY-MSGV1. VIM_ALE_MSGV2 = SY-MSGV2.
VIM_ALE_MSGV3 = SY-MSGV3. VIM_ALE_MSGV4 = SY-MSGV4. ELSE. CLEAR
VCAEL_LOCK. IF VIM_ALE_KEYSPEC_CHECK NE SPACE AND OBJ_TYPE NE VIM_LOGO.
VIM_ALE_KEYSPEC_OBJTAB-ONAME = OBJ_NAME. VIM_ALE_KEYSPEC_OBJTAB-OTYPE =
OBJ_TYPE. APPEND VIM_ALE_KEYSPEC_OBJTAB. ENDIF. ENDIF. ENDFORM. FORM
VIM_SAPSCRIPT_FORM_MAINT. LOCAL: STATUS-MODE. DATA: VSFM_TABLE LIKE
VIMDESC-VIEWNAME, VSFM_FLAG(1) TYPE C, VSFM_FIELD LIKE
VIMNAMTAB-VIEWFIELD, VSFM_HF TYPE I. IF X_HEADER-SCRFRMFLAG EQ SPACE.
MESSAGE E001(SV). EXIT. ENDIF. IF VIM_NBR_OF_SCRFRM_POINTERS GT 1. IF
STATUS-MODE EQ DETAIL_BILD. GET CURSOR FIELD F. ENDIF. SPLIT F AT '-'
INTO VSFM_TABLE VSFM_FIELD. IF X_HEADER-BASTAB NE SPACE AND
X_HEADER-TEXTTBEXST NE SPACE AND VSFM_TABLE EQ X_HEADER-TEXTTAB.
VSFM_FLAG = 'X'. ENDIF. READ TABLE X_NAMTAB WITH KEY VIEWFIELD =
VSFM_FIELD TEXTTABFLD = VSFM_FLAG. IF X_NAMTAB-DOMNAME NE
VIM_SCRFORM_DOMAIN. MESSAGE S161(SV). CLEAR FUNCTION. EXIT. ENDIF.
ASSIGN component x_namtab-viewfield of structure <TABLE1> TO
<VIM_SCRFORM_NAME>. IF STATUS-MODE EQ LIST_BILD. VSFM_HF = FIRSTLINE +
L - 1. STATUS-MODE = DETAIL_BILD. ELSE. VSFM_HF = NEXTLINE. ENDIF. READ
TABLE EXTRACT INDEX VSFM_HF. PERFORM MOVE_EXTRACT_TO_VIEW_WA. ENDIF. IF
STATUS-MODE EQ LIST_BILD. LOOP AT EXTRACT. CHECK <XMARK> EQ MARKIERT.
PERFORM MOVE_EXTRACT_TO_VIEW_WA. CALL FUNCTION 'EDIT_FORM' EXPORTING
FORM = <VIM_SCRFORM_NAME> DISPLAY = 'X' EXCEPTIONS UNKNOWN_ACTIVITY = 1
UNKNOWN_COMPONENT = 2. IF SY-SUBRC NE 0. MESSAGE ID SY-MSGID TYPE 'I'
NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. CONTINUE.
ENDIF. <XMARK> = NICHT_MARKIERT. MODIFY EXTRACT. READ TABLE TOTAL WITH
KEY <VIM_xEXTRACT_KEY> BINARY SEARCH. <MARK> = NICHT_MARKIERT. MODIFY
TOTAL INDEX SY-TABIX. SUBTRACT: 1 FROM MARK_EXTRACT, 1 FROM MARK_TOTAL.
ENDLOOP. ELSE. CALL FUNCTION 'EDIT_FORM' EXPORTING FORM =
<VIM_SCRFORM_NAME> DISPLAY = 'X' EXCEPTIONS UNKNOWN_ACTIVITY = 1
UNKNOWN_COMPONENT = 2. IF SY-SUBRC NE 0. MESSAGE ID SY-MSGID TYPE 'I'
NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. CLEAR
FUNCTION. EXIT. ENDIF. IF <XMARK> EQ MARKIERT. <XMARK> =
NICHT_MARKIERT. MODIFY EXTRACT INDEX NEXTLINE. READ TABLE TOTAL WITH
KEY <VIM_xEXTRACT_KEY> BINARY SEARCH. <MARK> = NICHT_MARKIERT. MODIFY
TOTAL INDEX SY-TABIX. SUBTRACT: 1 FROM MARK_EXTRACT, 1 FROM MARK_TOTAL.
ENDIF. ENDIF. CLEAR FUNCTION. ENDFORM. FORM aend_to_anzg. IF
status-action EQ anzeigen. MESSAGE i001(sv). ELSE. IF NOT vim_oc_inst
IS INITIAL. MESSAGE s764(sv). ENDIF. ENDIF. ENDFORM. FORM anzg_to_aend.
DATA: rc LIKE sy-subrc, dummy TYPE scpr_id, value(200) TYPE c,
value_is_external TYPE xfeld, lfieldname TYPE fnam_____4, keyvalues
TYPE occheckkeyflds, w_keyvalue TYPE occheckkey, oc_rangetab TYPE TABLE
OF vimsellist, lines TYPE i, any_substflds_initial TYPE xfeld, field1
LIKE sy-msgv1, field2 LIKE sy-msgv2, field3 LIKE sy-msgv3, field4 LIKE
sy-msgv4. FIELD-SYMBOLS: <w_dba_sel> TYPE vimsellist, <x_namtab> TYPE
vimnamtab, <value> TYPE c. IF status-action NE anzeigen AND
status-action NE transportieren. MESSAGE i001(sv). ELSE. IF
status-action EQ anzeigen. IF x_header-newgener EQ space. CALL FUNCTION
'VIEW_AUTHORITY_CHECK' EXPORTING view_action = aendern view_name =
view_name no_warning_for_clientindep = vim_no_warning_for_cliindep
CHANGING org_crit_inst = vim_oc_inst EXCEPTIONS no_authority = 8
no_clientindependent_authority = 9 no_linedependent_authority = 11. rc
= sy-subrc. IF sy-subrc = 11. MOVE: sy-msgid TO vim_auth_msgid,
sy-msgno TO vim_auth_msgno, sy-msgv1 TO vim_auth_msgv1, sy-msgv2 TO
vim_auth_msgv2, sy-msgv3 TO vim_auth_msgv3, sy-msgv4 TO vim_auth_msgv4.
ENDIF. ENDIF. IF x_header-frm_on_aut NE space. vim_auth_action =
aendern. vim_auth_event = vim_auth_switch_to_update_mode. ASSIGN
<vim_ck_sellist> TO <vim_auth_sellist>. PERFORM (x_header-frm_on_aut)
IN PROGRAM. IF vim_auth_rc NE 0. rc = 10. ENDIF. ENDIF. ENDIF. CASE rc.
WHEN 0. IF NOT vim_oc_inst IS INITIAL AND vim_called_by_cluster =
space. INSERT LINES OF dba_sellist[] INTO TABLE oc_rangetab. LOOP AT
x_namtab ASSIGNING <x_namtab> WHERE keyflag <> space AND readonly =
subset. DELETE oc_rangetab WHERE viewfield = <x_namtab>-viewfield.
ENDLOOP. IF sy-subrc = 0. DESCRIBE TABLE oc_rangetab LINES lines. if
lines > 0. READ TABLE oc_rangetab ASSIGNING <w_dba_sel> INDEX lines.
CLEAR <w_dba_sel>-and_or. endif. ENDIF. CALL METHOD
vim_oc_inst->check_oc_auth_vim_sellist EXPORTING sellist = oc_rangetab
action = '02' EXCEPTIONS no_auth = 1 OTHERS = 2. IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2
sy-msgv3 sy-msgv4. EXIT. ENDIF. IF x_header-subsetflag <> space. CALL
METHOD vim_oc_inst->build_key_value_tab EXPORTING entry = <initial>
IMPORTING keyvalues = keyvalues. LOOP AT keyvalues INTO w_keyvalue.
READ TABLE x_namtab ASSIGNING <x_namtab> WITH KEY viewfield =
w_keyvalue-keyname. CHECK <x_namtab>-readonly <> subset. DELETE
keyvalues. ENDLOOP. CALL METHOD vim_oc_inst->check_oc_authority
EXPORTING activity = '02' CHANGING key_values = keyvalues EXCEPTIONS
no_auth = 1 key_incomplete = 2 OTHERS = 4. IF sy-subrc = 1. MOVE:
sy-msgv1 TO field1, sy-msgv2 TO field2, sy-msgv3 TO field3, sy-msgv4 TO
field4. MESSAGE i763(sv) WITH field1 field2 field3 field4. LOOP AT
keyvalues INTO w_keyvalue WHERE noauth <> space. READ TABLE dba_sellist
ASSIGNING <w_dba_sel> WITH KEY viewfield = w_keyvalue-keyname. CLEAR:
<w_dba_sel>-value, <w_dba_sel>-initial, <w_dba_sel>-from_auth. ENDLOOP.
CALL FUNCTION 'TABLE_RANGE_INPUT' EXPORTING table = x_header-viewname
oc_inst = vim_oc_inst TABLES sellist = dba_sellist x_header = x_header
x_namtab = x_namtab EXCEPTIONS cancelled_by_user = 1 no_input = 2
OTHERS = 3. IF sy-subrc <> 0. EXIT. ENDIF. ENDIF. ELSE. MESSAGE
s764(sv). ENDIF. ENDIF. IF status-action EQ transportieren. function =
switch_transp_to_upd_mode. CLEAR <status>-crcntsknwn. IF
<status>-corr_enqud NE space. CALL FUNCTION 'DEQUEUE_E_TRKORR'
EXPORTING trkorr = <status>-corr_nbr. CLEAR <status>-corr_enqud. ENDIF.
IF x_header-cursetting NE space. CLEAR: vim_corr_obj_viewname,
<status>-tr_alrchkd. ENDIF. ELSE. CLEAR vim_corr_obj_viewname. IF
<status>-prof_found = vim_profile_found AND vim_pr_records = 0. PERFORM
get_pr_nbr_records USING vim_profile_values x_header CHANGING rc dummy
vim_pr_records vim_pr_tab vim_pr_fields. PERFORM get_profile_status
CHANGING vim_pr_tab vim_pr_fields. PERFORM bcset_key_check_in_total.
ENDIF. ENDIF. vim_next_screen = 0. vim_leave_screen = 'X'. WHEN 8.
MESSAGE i051(sv). WHEN 9. MESSAGE ID 'TB' TYPE 'I' NUMBER 109. WHEN 10
OR 11. MESSAGE ID vim_auth_msgid TYPE 'I' NUMBER vim_auth_msgno WITH
vim_auth_msgv1 vim_auth_msgv2 vim_auth_msgv3 vim_auth_msgv4. ENDCASE.
ENDIF. ENDFORM. FORM beenden. DATA: line1(30) TYPE c, handle TYPE
ad_handle, adrnum TYPE ad_addrnum. CASE function. WHEN 'ANZG'. line1 =
svim_text_001. WHEN 'ATAB'. line1 = svim_text_008. WHEN 'ENDE'. line1 =
svim_text_003. ENDCASE. CALL FUNCTION 'POPUP_TO_CONFIRM_STEP' EXPORTING
titel = line1 textline1 = svim_text_018 textline2 = svim_text_019
IMPORTING answer = answer. CASE answer. WHEN 'J'. sy-subrc = 0. WHEN
'N'. CLEAR <status>-upd_flag. IF maint_mode EQ transportieren.
<status>-keytbinvld = 'X'. ELSEIF maint_mode EQ aendern. LOOP AT
vim_addresses_to_save. IF vim_addresses_to_save-addrnumber CP '@NEW*'.
CLEAR adrnum. handle = vim_addresses_to_save-handle. ELSE. CLEAR
handle. adrnum = vim_addresses_to_save-addrnumber. ENDIF. CALL FUNCTION
'ADDR_SINGLE_RESET' EXPORTING address_number = adrnum address_handle =
handle EXCEPTIONS OTHERS = 1. IF sy-subrc <> 0. ENDIF. ENDLOOP. REFRESH
vim_addresses_to_save. ENDIF. sy-subrc = 8. WHEN 'A'. sy-subrc = 12.
ENDCASE. ENDFORM. FORM liste_back. IF status-action EQ hinzufuegen.
status-action = <status>-st_action = aendern. title-action = aendern.
CLEAR <status>-selected. neuer = 'N'. ENDIF. IF status-delete =
geloescht. status-delete = <status>-st_delete = nicht_geloescht.
title-action = aendern. PERFORM markiere_alle USING nicht_markiert.
ENDIF. IF x_header-delmdtflag NE space. LOOP AT vim_collapsed_mainkeys.
IF vim_collapsed_mainkeys-mkey_bf EQ space.
vim_collapsed_mainkeys-mkey_bf = vim_collapsed_mainkeys-log_key. CLEAR
vim_collapsed_mainkeys-log_key. ENDIF. <f1_x> = <vim_h_coll_mkey>.
<vim_enddate_mask> = space. <vim_h_coll_mkey> = <f1_x>. MODIFY
vim_collapsed_mainkeys. ENDLOOP. IF vim_delim_expa_excluded NE space.
DELETE excl_cua_funct WHERE function EQ 'EXPA'. CLEAR
vim_delim_expa_excluded. ENDIF. IF status-action = aendern AND
title-action = hinzufuegen. title-action = aendern. ENDIF. ENDIF.
PERFORM fill_extract. nextline = 1. mark_extract = mark_total. SET
SCREEN liste. LEAVE SCREEN. ENDFORM. FORM LISTE_ABBRECHEN. IF SY-DATAR
NE SPACE. CALL FUNCTION 'POPUP_TO_CONFIRM_STEP' EXPORTING TITEL =
SVIM_TEXT_005 TEXTLINE1 = SVIM_TEXT_009 TEXTLINE2 = SVIM_TEXT_006
DEFAULTOPTION = 'N' CANCEL_DISPLAY = ' ' IMPORTING ANSWER = ANSWER. IF
ANSWER EQ 'J'. NEUER = 'N'. IF STATUS-ACTION EQ KOPIEREN. SET SCREEN 0.
ELSE. SET SCREEN LISTE. NEXTLINE = FIRSTLINE. ENDIF. CLEAR
<STATUS>-UPD_FLAG. LEAVE SCREEN. ELSE. CLEAR FUNCTION. ENDIF. ELSE. IF
VIM_SINGLE_ENTRY_FUNCTION NE SPACE. TRANSLATE STATUS-ACTION USING 'AU'.
STATUS-MODE = GESAMTDATEN. ENDIF. CASE STATUS-ACTION. WHEN HINZUFUEGEN.
PERFORM LISTE_BACK. WHEN KOPIEREN. SET SCREEN 0. WHEN OTHERS. FUNCTION
= 'BACK'. SET SCREEN 0. CLEAR VIM_ACT_DYNP_VIEW. PERFORM UPDATE_STATUS.
ENDCASE. LEAVE SCREEN. ENDIF. ENDFORM. FORM IGNORIEREN.
<STATUS>-UPD_FLAG = SPACE. IF STATUS-ACTION EQ KOPIEREN OR
VIM_SPECIAL_MODE EQ VIM_DELETE. SET SCREEN 0. LEAVE SCREEN. ENDIF.
NEUER = 'N'. IF REPLACE_MODE EQ SPACE. CLEAR FUNCTION. IF STATUS-ACTION
EQ HINZUFUEGEN. FUNCTION = 'NEWL'. PERFORM HINZUFUEGEN. ELSE. SET
SCREEN LISTE. LEAVE SCREEN. ENDIF. ELSE. CLEAR VIM_ACT_DYNP_VIEW. SET
SCREEN 0. LEAVE SCREEN. ENDIF. ENDFORM. FORM BLAETTERN. DATA:
B_OVERLAPPING(1) TYPE C VALUE 'X'. IF MAXLINES EQ 0. EXIT. ENDIF. IF
STATUS-ACTION EQ KOPIEREN OR LOOPLINES EQ 1. CLEAR B_OVERLAPPING.
ENDIF. CALL FUNCTION 'SCROLLING_IN_TABLE' EXPORTING ENTRY_TO = MAXLINES
LOOPS = LOOPLINES OK_CODE = FUNCTION ENTRY_ACT = FIRSTLINE
LAST_PAGE_FULL = ' ' OVERLAPPING = B_OVERLAPPING IMPORTING ENTRY_NEW =
NEXTLINE. ENDFORM. FORM CHECK_UPD. data: leave. CHECK STATUS-ACTION NE
ANZEIGEN. IF <STATUS>-UPD_FLAG EQ SPACE. IF STATUS-ACTION EQ
TRANSPORTIEREN. MOVE <STATUS>-KEYTBMODFD TO <STATUS>-UPD_FLAG. ELSE.
LOOP AT TOTAL. CHECK <ACTION> NE ORIGINAL. MOVE 'X' TO
<STATUS>-UPD_FLAG. EXIT. ENDLOOP. IF <STATUS>-UPD_FLAG EQ SPACE AND
X_HEADER-BASTAB NE SPACE AND X_HEADER-TEXTTBEXST NE SPACE. LOOP AT
TOTAL. CHECK <ACTION_TEXT> NE ORIGINAL. MOVE 'X' TO <STATUS>-UPD_FLAG.
EXIT. ENDLOOP. ENDIF. IF <STATUS>-UPD_FLAG EQ SPACE AND
X_HEADER-TEXTTBEXST <> SPACE. PERFORM VIM_CHECK_UPD_TEXTTAB. ENDIF. IF
<STATUS>-UPD_FLAG EQ SPACE AND X_HEADER-ADRNBRFLAG EQ 'N'. DESCRIBE
TABLE VIM_ADDRESSES_TO_SAVE. IF SY-TFILL GT 0. MOVE 'X' TO
<STATUS>-UPD_FLAG. ENDIF. ENDIF. ENDIF. ENDIF. IF X_HEADER-FRM_AF_CHK
NE SPACE AND STATUS-ACTION NE TRANSPORTIEREN. PERFORM
(X_HEADER-FRM_AF_CHK) IN PROGRAM (SY-REPID). ENDIF. if
<status>-upd_flag = space and vim_called_by_cluster = space and (
function = back OR function = end ). perform vim_add_img_notices_pai
using 'E' changing leave. if leave = space. clear function. endif.
endif. MOVE 'X' TO <STATUS>-UPD_CHECKD. ENDFORM. FORM
popup_positionieren. DATA: pp_program LIKE sy-repid, hf1 TYPE i, hf2
TYPE i, dummy type xfeld. IF status-action NE anzeigen AND
status-action NE transportieren AND status-mode NE list_bild. PERFORM
update_tab. ENDIF. pp_program = sy-repid. <table1> = <initial>. CALL
FUNCTION 'TABLE_GET_KEY_TO_SET_CUR_ROW' EXPORTING table =
x_header-maintview f4_programname = pp_program f4_formname =
'F4_POSITIONIEREN' IMPORTING table_key = dummy TABLES sellist =
<vim_ck_sellist> exclude_fields = excl_pos_tab CHANGING table_key_new =
<f1_x> EXCEPTIONS cancelled_by_user = 01 table_not_found = 02. CHECK
sy-subrc EQ 0000. IF x_header-frm_h_flds NE space. PERFORM
(x_header-frm_h_flds) IN PROGRAM. ENDIF. IF x_header-frm_rp_pos NE
space. PERFORM (x_header-frm_rp_pos) IN PROGRAM. ELSEIF status-action
EQ hinzufuegen AND status-mode EQ list_bild. nextline = 0. LOOP AT
extract. IF <xact> EQ leer. EXIT. ENDIF. CHECK <vim_xextract_key> LE
<f1_x>. hf1 = sy-tabix. CHECK <vim_xextract_key> EQ <f1_x>. nextline =
sy-tabix. EXIT. ENDLOOP. IF nextline EQ 0. IF hf1 EQ maxlines. nextline
= hf1. ELSE. nextline = hf1 + 1. ENDIF. ENDIF. ELSE. READ TABLE extract
WITH KEY <f1_x> BINARY SEARCH TRANSPORTING NO FIELDS. nextline =
sy-tabix. IF sy-subrc = 8 AND nextline GT 1. nextline = nextline - 1.
ENDIF. ENDIF. IF status-mode EQ detail_bild. READ TABLE extract INDEX
nextline. IF <xmark> <> markiert. CLEAR <status>-mark_only. ENDIF. hf2
= firstline + looplines - 1. IF looplines EQ 0. l = 1. MOVE: l TO
<status>-cur_line, nextline TO <status>-firstline. hf1 = 0. ELSEIF
nextline GE firstline AND nextline LE hf2. ELSEIF nextline LT
firstline. firstline = nextline. ELSE. firstline = nextline. ENDIF. l =
nextline - firstline + 1. MOVE: firstline TO <status>-firstline, l TO
<status>-cur_line. ELSE. MOVE 1 TO l. ENDIF. ENDFORM. FORM
f4_positionieren USING value(tabname) TYPE tabname value(fieldname)
TYPE fieldname value(display) CHANGING returncode value TYPE any.
STATICS: field_tab TYPE TABLE OF dfies INITIAL SIZE 20. DATA:
tabval(132) TYPE c, v_tab LIKE TABLE OF tabval INITIAL SIZE 500,
w_dfies TYPE dfies, return_tab TYPE TABLE OF ddshretval INITIAL SIZE 1,
BEGIN OF out_conv_function, prefix(16) TYPE c VALUE 'CONVERSION_EXIT_',
exit LIKE vimnamtab-convexit, suffix(7) TYPE c VALUE '_OUTPUT', END OF
out_conv_function, f4_length TYPE i. FIELD-SYMBOLS: <hf1>, <dfies> TYPE
dfies, <retval> TYPE ddshretval. READ TABLE field_tab INDEX 1 ASSIGNING
<dfies>. IF sy-subrc <> 0 OR <dfies>-tabname <> x_header-maintview.
REFRESH field_tab. f4_length = 0. IF x_header-tablen > 1000. LOOP AT
x_namtab. IF x_header-clidep NE space. CHECK sy-tabix NE 1. ENDIF. IF
x_namtab-keyflag NE space OR x_namtab-datatype EQ 'CHAR' AND
x_namtab-flength GE 10 AND x_namtab-lowercase NE space. f4_length =
f4_length + x_namtab-outputlen. ENDIF. ENDLOOP. ENDIF. IF f4_length <
1000. LOOP AT x_namtab. IF x_header-clidep NE space. CHECK sy-tabix NE
1. ENDIF. CHECK x_namtab-readonly <> vim_hidden. IF x_header-bastab NE
space AND x_header-texttbexst NE space. CHECK x_namtab-keyflag NE space
AND x_namtab-texttabfld EQ space OR x_namtab-keyflag EQ space AND
x_namtab-texttabfld NE space. ELSE. CHECK x_namtab-keyflag NE space OR
x_namtab-datatype EQ 'CHAR' AND x_namtab-flength GE 10 AND
x_namtab-lowercase NE space. ENDIF. IF x_namtab-texttabfld NE space.
w_dfies-tabname = x_header-texttab. ELSE. w_dfies-tabname =
x_header-maintview. ENDIF. w_dfies-fieldname = x_namtab-viewfield.
APPEND w_dfies TO field_tab. ENDLOOP. ELSE. MESSAGE I810(SV) WITH
x_header-viewname. LOOP AT x_namtab. IF x_header-clidep NE space. CHECK
sy-tabix NE 1. ENDIF. CHECK x_namtab-readonly <> vim_hidden. IF
x_header-bastab NE space AND x_header-texttbexst NE space. CHECK
x_namtab-keyflag NE space AND x_namtab-texttabfld EQ space OR
x_namtab-keyflag EQ space AND x_namtab-texttabfld NE space. ELSE. CHECK
x_namtab-keyflag NE space. ENDIF. IF x_namtab-texttabfld NE space.
w_dfies-tabname = x_header-texttab. ELSE. w_dfies-tabname =
x_header-maintview. ENDIF. w_dfies-fieldname = x_namtab-viewfield.
append w_dfies to field_tab. ENDLOOP. ENDIF. ENDIF. LOOP AT extract.
LOOP AT field_tab ASSIGNING <dfies>. READ TABLE x_namtab WITH KEY
viewfield = <dfies>-fieldname. IF x_header-bastab NE space AND
x_header-texttbexst NE space. IF x_namtab-keyflag EQ space AND
x_namtab-texttabfld NE space. ASSIGN COMPONENT x_namtab-viewfield OF
STRUCTURE <vim_ext_txt_struc> TO <hf1>. ELSEIF x_namtab-keyflag NE
space AND x_namtab-texttabfld EQ space. ASSIGN COMPONENT
x_namtab-viewfield OF STRUCTURE <vim_extract_struc> TO <hf1>. ENDIF.
ELSE. ASSIGN COMPONENT x_namtab-viewfield OF STRUCTURE
<vim_extract_struc> TO <hf1>. ENDIF. CHECK <hf1> IS ASSIGNED. WRITE
<hf1> TO tabval(x_namtab-outputlen). APPEND tabval TO v_tab. CLEAR
tabval. ENDLOOP. ENDLOOP. CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING retfield = fieldname display = display TABLES value_tab =
v_tab field_tab = field_tab return_tab = return_tab EXCEPTIONS
parameter_error = 1 no_values_found = 2 OTHERS = 3. IF sy-subrc = 0.
READ TABLE return_tab INDEX 1 ASSIGNING <retval>. IF sy-subrc = 0.
value = <retval>-fieldval. ENDIF. ELSE. MESSAGE ID sy-msgid TYPE
sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. ENDFORM. FORM LISTE_MARKIERE. INDEX = FIRSTLINE + L - 1. IF L EQ
0 OR INDEX GT MAXLINES. MESSAGE S032(SV). EXIT. ENDIF. PERFORM MARKIERE
USING INDEX. ENDFORM. FORM MARKIERE_BLOCK. INDEX = FIRSTLINE + L - 1.
IF L EQ 0 OR INDEX GT MAXLINES. MESSAGE S032(SV). EXIT. ENDIF. PERFORM
MARKIERE USING INDEX. IF BLOCK_SW EQ MARKIERT. BLOCK_2 = INDEX.
BLOCK_SW = NICHT_MARKIERT. ELSE. BLOCK_1 = INDEX. BLOCK_SW = MARKIERT.
MESSAGE S066(SV). EXIT. ENDIF. COUNTER = 0. LOOP AT EXTRACT. COUNTER =
COUNTER + 1. IF BLOCK_1 LE BLOCK_2. CHECK COUNTER BETWEEN BLOCK_1 AND
BLOCK_2. ELSE. CHECK COUNTER BETWEEN BLOCK_2 AND BLOCK_1. ENDIF. READ
TABLE TOTAL WITH KEY <VIM_xEXTRACT_KEY> BINARY SEARCH. IF <XMARK> NE
MARKIERT. MARK_EXTRACT = MARK_EXTRACT + 1. MARK_TOTAL = MARK_TOTAL + 1.
ENDIF. <XMARK> = MARKIERT. <MARK> = MARKIERT. MODIFY TOTAL INDEX
SY-TABIX. MODIFY EXTRACT. ENDLOOP. ENDFORM. FORM MARKIERE USING I. READ
TABLE EXTRACT INDEX I. READ TABLE TOTAL WITH KEY <VIM_xEXTRACT_KEY>
BINARY SEARCH. IF <XMARK> EQ MARKIERT. <XMARK> = NICHT_MARKIERT. <MARK>
= NICHT_MARKIERT. MARK_EXTRACT = MARK_EXTRACT - 1. MARK_TOTAL =
MARK_TOTAL - 1. ELSE. <XMARK> = MARKIERT. <MARK> = MARKIERT.
MARK_EXTRACT = MARK_EXTRACT + 1. MARK_TOTAL = MARK_TOTAL + 1. ENDIF.
MODIFY TOTAL INDEX SY-TABIX. MODIFY EXTRACT INDEX I. ENDFORM. FORM
MARKIERE_ALLE USING ACTION. CHECK MAXLINES NE 0. LOOP AT EXTRACT. CHECK
<XACT> NE LEER. CHECK <XMARK> NE ACTION. READ TABLE TOTAL WITH KEY
<VIM_xEXTRACT_KEY> BINARY SEARCH. <XMARK> = ACTION. <MARK> = ACTION.
MODIFY TOTAL INDEX SY-TABIX. MODIFY EXTRACT. IF ACTION EQ MARKIERT.
ADD: 1 TO MARK_EXTRACT, 1 TO MARK_TOTAL. ELSE. SUBTRACT: 1 FROM
MARK_EXTRACT, 1 FROM MARK_TOTAL. CLEAR BLOCK_SW. ENDIF. ENDLOOP.
ENDFORM. FORM LISTE_ZURUECKHOLEN. DATA: IX TYPE I. COUNTER = 0. LOOP AT
EXTRACT. CHECK <XMARK> EQ MARKIERT. IF X_HEADER-DELMDTFLAG NE SPACE. IX
= SY-TABIX. PERFORM MOVE_EXTRACT_TO_VIEW_WA. PERFORM
TEMPORAL_DELIMITATION. ENDIF. COUNTER = COUNTER + 1. READ TABLE TOTAL
WITH KEY <VIM_xEXTRACT_KEY> BINARY SEARCH. PERFORM
LOGICAL_UNDELETE_TOTAL USING SY-TABIX. MARK_TOTAL = MARK_TOTAL - 1.
MARK_EXTRACT = MARK_EXTRACT - 1. IF REPLACE_MODE NE SPACE AND
VIM_EXTERNAL_MODE EQ SPACE. <XACT> = <ACTION>. <XMARK> =
NICHT_MARKIERT. MODIFY EXTRACT. ELSE. IF TEMPORAL_DELIMITATION_HAPPENED
NE SPACE. CLEAR VIM_DELIM_ENTRIES. VIM_DELIM_ENTRIES-INDEX3 = IX.
APPEND VIM_DELIM_ENTRIES. ELSE. DELETE EXTRACT. ENDIF. ENDIF. ENDLOOP.
IF TEMPORAL_DELIMITATION_HAPPENED NE SPACE. PERFORM
AFTER_TEMPORAL_DELIMITATION. CLEAR TEMPORAL_DELIMITATION_HAPPENED.
ENDIF. CHECK REPLACE_MODE EQ SPACE. DESCRIBE TABLE EXTRACT LINES
MAXLINES. IF IGNORED_ENTRIES_EXIST EQ SPACE. MESSAGE S002(SV) WITH
COUNTER. ELSE. MESSAGE W002(SV) WITH COUNTER. ENDIF. IF MAXLINES EQ 0.
TITLE-ACTION = AENDERN. STATUS-DELETE = NICHT_GELOESCHT. ENDIF.
ENDFORM. FORM logical_undelete_total USING value(cur_index) TYPE i.
CASE <action>. WHEN neuer_geloescht. <action> = neuer_eintrag. WHEN
geloescht. <action> = original. WHEN update_geloescht. <action> =
aendern. ENDCASE. IF x_header-bastab NE space AND x_header-texttbexst
NE space. CASE <action_text>. WHEN neuer_geloescht. <action_text> =
neuer_eintrag. WHEN geloescht. <action_text> = original. WHEN
update_geloescht. <action_text> = aendern. WHEN dummy_geloescht.
<action_text> = original. <vim_xtotal_text> = <text_initial_x>.
ENDCASE. ENDIF. <mark> = nicht_markiert. MODIFY total INDEX cur_index.
ENDFORM. FORM selektiere USING param. DATA: rec LIKE sy-subrc VALUE 9,
s_screenmode(1) TYPE c VALUE 'S'. IF status-action EQ hinzufuegen.
status-action = aendern. title-action = aendern. ENDIF. IF status-mode
EQ detail_bild. PERFORM update_tab. ENDIF. REFRESH extract. CLEAR
vim_mainkey. l = 1. TRANSLATE vim_no_mainkey_exists USING
vim_no_mkey_not_procsd_patt. LOOP AT total. PERFORM select USING param.
CHECK sy-subrc EQ 0. IF x_header-delmdtflag NE space. PERFORM
check_and_modify_mainkey_tab USING rec. IF rec NE 0.
vim_coll_mainkeys_beg_ix = vim_last_coll_mainkeys_ix. ENDIF. CHECK rec
LT 8. IF rec EQ 4. rec = 9. ENDIF. ENDIF. extract = total. APPEND
extract. ENDLOOP. vim_coll_mainkeys_beg_ix = 1. IF rec NE 9 AND rec NE
0. PERFORM mod_extract_and_mainkey_tab USING 'A' 0. ENDIF. IF param EQ
geloescht. status-delete = geloescht. title-action = geloescht. ENDIF.
<status>-selected = param. DESCRIBE TABLE extract LINES maxlines.
status-data = auswahldaten. title-data = auswahldaten. nextline = 1. IF
maxlines EQ 0. status-delete = nicht_geloescht. title-action =
nicht_geloescht. PERFORM fill_extract. PERFORM set_pf_status USING
status. MESSAGE i004(sv). SET SCREEN liste. LEAVE SCREEN. ENDIF. IF
maxlines EQ 1. MESSAGE s005(sv). IF vim_single_entry_function NE space.
IF status-type EQ zweistufig. <status>-firstline = <status>-cur_line =
nextline. PERFORM process_detail_screen USING 'C'. ELSE. CALL SCREEN
liste. ENDIF. ELSE. IF status-type EQ zweistufig. <status>-firstline =
<status>-cur_line = nextline. PERFORM process_detail_screen USING 'S'.
ENDIF. ENDIF. ELSE. IF status-mode EQ detail_bild. vim_next_screen =
liste. vim_leave_screen = 'X'. ENDIF. MESSAGE s006(sv) WITH maxlines.
ENDIF. ENDFORM. FORM normal_select. FIELD-SYMBOLS: <ns_tab> TYPE table,
<vim_tot_txt_struc_loc> TYPE ANY. sy-subrc = 8. CHECK <action> NE
neuer_geloescht AND <action> NE update_geloescht AND <action> NE
geloescht. CLEAR sy-subrc. IF x_header-selection NE space. IF
vim_special_adjust_mode NE space. ASSIGN dba_sellist[] TO <ns_tab>.
ELSE. ASSIGN dpl_sellist[] TO <ns_tab>. ENDIF. IF x_header-bastab <>
space AND x_header-texttbexst <> space. ASSIGN <vim_tot_txt_struc> TO
<vim_tot_txt_struc_loc>. ELSE. ASSIGN <vim_total_struc> TO
<vim_tot_txt_struc_loc>. ENDIF. CALL FUNCTION 'TABLE_RANGE_CHECK'
EXPORTING tabname = x_header-maintview entry = total entry_text =
<vim_tot_txt_struc_loc> ddic = 'N' key = 'N' ignore_blank_subsetfields
= 'N' TABLES x_namtab = x_namtab x_header = x_header sellist = <ns_tab>
EXCEPTIONS entry_not_fits = 1 no_value_for_subset_ident = 2. IF
sy-subrc EQ 2. RAISE no_value_for_subset_ident. ENDIF. ENDIF. ENDFORM.
FORM select USING param. FIELD-SYMBOLS: <vim_tot_txt_struc_loc> TYPE
ANY. sy-subrc = 8. IF param EQ space AND status-action NE
transportieren.  PERFORM normal_select. ELSE. CASE param. WHEN
geloescht. CHECK <action> EQ geloescht OR <action> EQ neuer_geloescht
OR <action> EQ update_geloescht. CLEAR sy-subrc. IF x_header-selection
NE space. IF x_header-bastab <> space AND x_header-texttbexst <> space.
ASSIGN <vim_tot_txt_struc> TO <vim_tot_txt_struc_loc>. ELSE. ASSIGN
<vim_total_struc> TO <vim_tot_txt_struc_loc>. ENDIF. CALL FUNCTION
'TABLE_RANGE_CHECK' EXPORTING tabname = x_header-maintview entry =
total entry_text = <vim_tot_txt_struc_loc> ddic = 'N' key = 'N'
ignore_blank_subsetfields = 'N' TABLES x_namtab = x_namtab x_header =
x_header sellist = dpl_sellist EXCEPTIONS entry_not_fits = 1
no_value_for_subset_ident = 2. IF sy-subrc EQ 2. RAISE
no_value_for_subset_ident. ENDIF. ENDIF. WHEN markiert. IF
status-delete EQ geloescht. CHECK <action> EQ geloescht OR <action> EQ
neuer_geloescht OR <action> EQ update_geloescht. ENDIF. CHECK <mark> EQ
param. CLEAR sy-subrc. IF x_header-selection NE space. IF
x_header-bastab <> space AND x_header-texttbexst <> space. ASSIGN
<vim_tot_txt_struc> TO <vim_tot_txt_struc_loc>. ELSE. ASSIGN
<vim_total_struc> TO <vim_tot_txt_struc_loc>. ENDIF. CALL FUNCTION
'TABLE_RANGE_CHECK' EXPORTING tabname = x_header-maintview entry =
total entry_text = <vim_tot_txt_struc_loc> ddic = 'N' key = 'N'
ignore_blank_subsetfields = 'N' TABLES x_namtab = x_namtab x_header =
x_header sellist = dpl_sellist EXCEPTIONS entry_not_fits = 1
no_value_for_subset_ident = 2. IF sy-subrc EQ 2. RAISE
no_value_for_subset_ident. ENDIF. ENDIF. WHEN bcset_only. READ TABLE
vim_bc_entry_list INTO vim_bc_entry_list_wa WITH TABLE KEY viewname =
x_header-viewname keys = <vim_xtotal_key>. IF sy-subrc NE 0. sy-subrc =
8. ENDIF. CHECK sy-subrc EQ 0. IF x_header-selection NE space. IF
x_header-bastab <> space AND x_header-texttbexst <> space. ASSIGN
<vim_tot_txt_struc> TO <vim_tot_txt_struc_loc>. ELSE. ASSIGN
<vim_total_struc> TO <vim_tot_txt_struc_loc>. ENDIF. CALL FUNCTION
'TABLE_RANGE_CHECK' EXPORTING tabname = x_header-maintview entry =
total entry_text = <vim_tot_txt_struc_loc> ddic = 'N' key = 'N'
ignore_blank_subsetfields = 'N' TABLES x_namtab = x_namtab x_header =
x_header sellist = dpl_sellist EXCEPTIONS entry_not_fits = 1
no_value_for_subset_ident = 2. IF sy-subrc EQ 2. RAISE
no_value_for_subset_ident. ENDIF. ENDIF. WHEN by_field_contents.
PERFORM normal_select. CHECK sy-subrc EQ 0. IF x_header-bastab NE space
AND x_header-texttbexst NE space. CALL FUNCTION 'QUERY_CHECK' EXPORTING
record = <vim_total_struc> textrecord = <vim_tot_txt_struc> EXCEPTIONS
no_hits_in_record = 4 parameter_error = 8. ELSE. CALL FUNCTION
'QUERY_CHECK' EXPORTING record = <vim_total_struc> EXCEPTIONS
no_hits_in_record = 4 parameter_error = 8. ENDIF. WHEN OTHERS. IF
x_header-bastab NE space AND x_header-texttbexst NE space AND param EQ
aendern. CHECK <action> EQ param OR <action_text> EQ param OR <action>
NE neuer_eintrag AND <action_text> EQ neuer_eintrag. ELSE. CHECK
<action> EQ param. ENDIF. CLEAR sy-subrc. IF x_header-selection NE
space. IF x_header-bastab <> space AND x_header-texttbexst <> space.
ASSIGN <vim_tot_txt_struc> TO <vim_tot_txt_struc_loc>. ELSE. ASSIGN
<vim_total_struc> TO <vim_tot_txt_struc_loc>. ENDIF. CALL FUNCTION
'TABLE_RANGE_CHECK' EXPORTING tabname = x_header-maintview entry =
total entry_text = <vim_tot_txt_struc_loc> ddic = 'N' key = 'N'
ignore_blank_subsetfields = 'N' TABLES x_namtab = x_namtab x_header =
x_header sellist = dpl_sellist EXCEPTIONS entry_not_fits = 1
no_value_for_subset_ident = 2. IF sy-subrc EQ 2. RAISE
no_value_for_subset_ident. ENDIF. ENDIF. ENDCASE. ENDIF. ENDFORM. FORM
fill_extract. DATA: rec LIKE sy-subrc VALUE 9, total_safe(4096) TYPE c,
indei TYPE i, hf TYPE i VALUE 1. FIELD-SYMBOLS: <begdate_mask>.
REFRESH: extract. CLEAR extract. CLEAR vim_mainkey. TRANSLATE
vim_no_mainkey_exists USING vim_no_mkey_not_procsd_patt. IF
x_header-delmdtflag NE space. ASSIGN <vim_new_begdate> TO
<begdate_mask> TYPE 'C'. ENDIF. LOOP AT total. PERFORM normal_select.
CHECK sy-subrc EQ 0. IF x_header-delmdtflag NE space AND
vim_ignore_collapsed_mainkeys EQ space. PERFORM
check_and_modify_mainkey_tab USING rec. IF rec NE 0.
vim_coll_mainkeys_beg_ix = vim_last_coll_mainkeys_ix. ENDIF. CHECK rec
LT 8. IF rec EQ 4. rec = 9. ENDIF. ENDIF. extract = total. APPEND
extract. ENDLOOP. vim_coll_mainkeys_beg_ix = 1. IF rec NE 9 AND rec NE
0. PERFORM mod_extract_and_mainkey_tab USING 'A' 0. ENDIF. DESCRIBE
TABLE extract LINES maxlines. mark_extract = mark_total. status-data =
gesamtdaten. title-data = gesamtdaten. CLEAR <status>-selected. IF
maxlines EQ 0. PERFORM vim_send_sv005_or_sv766 USING '766' 'RESET'. IF
function NE 'DELE' AND function NE 'SAVE'. IF x_header-selection EQ
space AND fill_extr_first_proc EQ space. IF NOT vim_oc_inst IS INITIAL
AND ( ( <status>-st_action = aendern AND NOT
vim_oc_inst->oc_selcrit_maint_tab IS INITIAL ) OR ( 'ST' CS
<status>-st_action AND NOT vim_oc_inst->oc_selcrit_read_tab IS INITIAL
) ). MESSAGE s766(sv). ELSE. MESSAGE s065(sv). ENDIF. MOVE 'X' TO
fill_extr_first_proc. ELSE. MESSAGE s004(sv). ENDIF. ENDIF. EXIT.
ELSEIF maxlines EQ 1. PERFORM vim_maintain_single_set. ELSEIF NOT
vim_oc_inst IS INITIAL AND function NE 'DELE' AND function NE 'SAVE'.
IF ( <status>-st_action = aendern AND NOT
vim_oc_inst->oc_selcrit_maint_tab IS INITIAL ) OR ( 'ST' CS
<status>-st_action AND NOT vim_oc_inst->oc_selcrit_read_tab IS INITIAL
). PERFORM vim_send_sv005_or_sv766 USING '766' 'SENDIT'. ENDIF. ELSE.
PERFORM vim_send_sv005_or_sv766 USING '766' 'RESET'. ENDIF. ENDFORM.
FORM mod_extract_and_mainkey_tab USING value(meamt_mode) TYPE c
value(meamt_index) TYPE i. CASE meamt_mode. WHEN 'A'. APPEND extract.
WHEN 'I'. IF meamt_index EQ 0. INSERT extract. ELSE. INSERT extract
INDEX meamt_index. ENDIF. WHEN 'M'. IF meamt_index EQ 0. MODIFY
extract. ELSE. MODIFY extract INDEX meamt_index. ENDIF. ENDCASE. LOOP
AT vim_collapsed_mainkeys. CHECK <vim_collapsed_mkey_bfx> EQ
<vim_mkey_beforex> AND <vim_collapsed_keyx> NE <vim_xextract_key>. IF
vim_mkey_after_exists NE space. CHECK <vim_collapsed_key_afx> EQ
<vim_mkey_afterx>. ENDIF. <vim_collapsed_keyx> = <vim_xextract_key>. if
<vim_collapsed_mkey_bfx> NE <vim_ext_mkey_beforex>.
<vim_collapsed_mkey_bfx> = <vim_ext_mkey_beforex>. endif. MODIFY
vim_collapsed_mainkeys. ENDLOOP. ENDFORM. FORM
check_and_modify_mainkey_tab USING cammt_rec. CHECK
vim_ignore_collapsed_mainkeys EQ space. IF vim_no_mainkey_exists EQ
vim_no_mkey_not_procsd OR <vim_tot_mkey_beforex> NE <vim_mkey_beforex>
OR ( vim_mkey_after_exists NE space AND <vim_tot_mkey_afterx> NE
<vim_mkey_afterx> ). IF cammt_rec NE 9 AND cammt_rec NE 0. PERFORM
mod_extract_and_mainkey_tab USING 'A' 0. CLEAR cammt_rec. ENDIF.
<vim_h_mkey>(x_header-keylen) = <vim_xtotal_key>. extract = total.
TRANSLATE vim_no_mainkey_exists USING vim_no_mkey_procsd_patt. ELSE.
CHECK cammt_rec NE 9 AND cammt_rec NE 0. ENDIF. PERFORM
check_if_entry_is_to_display USING space <vim_xtotal_key> 'X'
<vim_begdate>. cammt_rec = sy-subrc. ENDFORM. FORM
check_if_entry_is_to_display USING value(key_local) TYPE char01
value(key_in) TYPE any value(mod_flag) TYPE char01 value(begdate) TYPE
d. DATA: rec TYPE i, act_entry_flag(1) TYPE c. LOCAL: total, extract.
FIELD-SYMBOLS: <key_x> TYPE x, <key_h> TYPE x. CLEAR: <table1_wa>.
<f1_wax> = <f1_x>. ASSIGN: key_in TO <key_h> CASTING,
<key_h>(x_header-keylen) TO <key_x>. MOVE <key_x> TO <f1_x>. IF
mod_flag NE space AND x_header-delmdtflag EQ 'E' AND begdate LE
sy-datum AND <vim_enddate_mask> GE sy-datum OR x_header-delmdtflag EQ
'B' AND begdate GE sy-datum AND <vim_enddate_mask> LE sy-datum.
act_entry_flag = 'X'. ENDIF. LOOP AT vim_collapsed_mainkeys FROM
vim_coll_mainkeys_beg_ix. CHECK <vim_collapsed_mkey_bfx> =
<vim_f1_beforex>. IF vim_mkey_after_exists NE space. CHECK
<vim_collapsed_key_afx> EQ <vim_f1_afterx>. ENDIF.
vim_last_coll_mainkeys_ix = sy-tabix. IF act_entry_flag NE space. IF
mod_flag EQ 'D'. READ TABLE extract WITH KEY <vim_collapsed_keyx>
TRANSPORTING NO FIELDS. IF sy-subrc EQ 0. DELETE extract INDEX
sy-tabix. ENDIF. ENDIF. IF <key_x> NE <vim_collapsed_keyx>.
<vim_collapsed_keyx> = <key_x>. <vim_xtotal_key> = <key_x>. if
<vim_collapsed_mkey_bfx> ne <vim_tot_mkey_beforex>.
<vim_collapsed_mkey_bfx> = <vim_tot_mkey_beforex>. endif. MODIFY
vim_collapsed_mainkeys. ENDIF. rec = 4. ELSE. IF <key_x> NE
<vim_collapsed_keyx>. rec = 8. ELSE. rec = 4. ENDIF. ENDIF. EXIT.
ENDLOOP. IF sy-subrc NE 0. CLEAR rec. ENDIF. IF key_local NE space.
<f1_x> = <f1_wax>. ENDIF. sy-subrc = rec. ENDFORM. FORM read_table
USING ind. IF replace_mode NE space OR vim_special_mode EQ vim_delete.
EXIT. ENDIF. READ TABLE extract INDEX ind. MOVE sy-tabix TO exind. IF
sy-subrc NE 0. MOVE <initial> TO <table1>. MOVE <table1> TO
<vim_extract_struc>. IF x_header-bastab NE space AND
x_header-texttbexst NE space. MOVE: <text_initial_x> TO
<vim_xextract_text>, <text_initial_x> to <table1_xtext>. ENDIF. IF
status-mode EQ detail_bild AND status-action EQ hinzufuegen AND neuer
EQ 'N'. neuer = 'J'. ENDIF. ELSE. PERFORM move_extract_to_view_wa.
ENDIF. ENDFORM. FORM update_tab. DATA: rc_safe LIKE sy-subrc, tabix
LIKE sy-tabix, h_ix TYPE i, begdate_safe TYPE d, enddate_safe TYPE d.
CHECK status-action NE anzeigen. CHECK status-action NE transportieren.
CHECK status-delete NE geloescht. IF <status>-upd_flag EQ space. neuer
= 'N'. EXIT. ENDIF. IF status-type EQ einstufig AND status-action EQ
hinzufuegen. IF ( ( x_header-bastab EQ space OR x_header-texttbexst EQ
space ) AND <table2_x> EQ <initial_x> OR x_header-bastab NE space AND
x_header-texttbexst NE space AND <vim_xextract_enti> EQ <initial_x> OR
( vim_special_mode EQ vim_upgrade OR vim_single_entry_function NE space
) ) AND <xact> EQ leer. neuer = 'J'. ELSE. neuer = 'N'. ENDIF. ENDIF.
IF x_header-frm_h_flds NE space. PERFORM (x_header-frm_h_flds) IN
PROGRAM. ENDIF. IF neuer EQ 'J'. IF x_header-guidflag <> space. PERFORM
vim_make_guid USING space. ENDIF. IF x_header-frm_on_new NE space.
PERFORM (x_header-frm_on_new) IN PROGRAM. ENDIF. PERFORM check_key.
MOVE: sy-subrc TO rc_safe, sy-tabix TO tabix. IF x_header-adrnbrflag NE
space. IF vim_special_mode NE vim_upgrade. PERFORM address_maintain.
ELSE. PERFORM vim_address_adjust. ENDIF. ENDIF. IF
vim_called_by_cluster NE space AND vim_extcopy_mode NE space. h_ix =
nextline + 1. READ TABLE extract INDEX h_ix. DELETE extract INDEX h_ix.
IF x_header-texttbexst <> space. PERFORM vim_copy_texttab_entry USING
<f1_x> <vim_xextract_key>. ENDIF. PERFORM vim_store_state_info. CALL
FUNCTION 'VIEWCLUSTER_COPY_DEPENDENT' EXPORTING view_name =
x_header-viewname maintview = x_header-maintview status_mode =
status-mode workarea = extract new_entry = <table1> no_dialog =
vim_external_mode. ENDIF. PERFORM nicht_vorhanden USING rc_safe tabix.
ELSE. IF vim_special_mode EQ vim_upgrade. PERFORM vim_address_adjust.
ENDIF. IF vim_called_by_cluster NE space. CALL FUNCTION
'VIEWCLUSTER_CHECK_MASTER_ENTRY' EXPORTING check_entry = <table1>
view_name = x_header-viewname EXCEPTIONS invalid_key = 1 invalid_value
= 2. IF sy-subrc NE 0. IF status-mode EQ list_bild. SET CURSOR FIELD
sy-msgv1 LINE l. ELSE. SET CURSOR FIELD sy-msgv1. ENDIF. MESSAGE ID
sy-msgid TYPE 'E' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3
sy-msgv4. ENDIF. ENDIF. MOVE exind TO index. READ TABLE total WITH KEY
<f1_x> BINARY SEARCH. IF vim_special_mode NE vim_upgrade. PERFORM
vorhanden. ELSE. PERFORM update_entry USING 'X'. ENDIF. ENDIF. MOVE
space TO <status>-upd_flag. ENDFORM. FORM VORHANDEN. PERFORM
UPDATE_ENTRY USING SPACE. ENDFORM. FORM update_entry USING
value(ue_total_only). DATA: rec LIKE sy-subrc, tabix LIKE sy-tabix.
tabix = sy-tabix. IF <status>-upd_flag EQ 'X' OR <status>-upd_flag EQ
'E' OR <status>-upd_flag EQ 'Y'. IF x_header-customauth CO
sap_cust_ctrl_classes OR vim_ale_keyspec_check NE space. PERFORM
check_allowed_keyranges. ENDIF. move <table1> to <vim_total_struc>. IF
<xact> EQ original. <action> = aendern. ELSE. <action> = <xact>. ENDIF.
ENDIF. IF x_header-bastab NE space AND x_header-texttbexst NE space AND
<status>-upd_flag EQ 'X' OR <status>-upd_flag EQ 'T' OR
<status>-upd_flag EQ 'Y'. IF x_header-customauth CO
sap_cust_ctrl_classes OR vim_ale_keyspec_check NE space. PERFORM
check_allowed_keyranges. ENDIF. IF <status>-upd_flag NE 'Y'. IF
<vim_xtotal_text> EQ <text_initial_x>. <action_text> = neuer_eintrag.
ELSE. IF <xact_text> EQ original. <action_text> = aendern. ELSE.
<action_text> = <xact_text>. ENDIF. ENDIF. ENDIF. MOVE <table1_xtext>
TO <vim_xtotal_text>. ENDIF. IF replace_mode NE space. <mark> =
nicht_markiert. ELSE. <mark> = <xmark>. ENDIF. MODIFY total INDEX
tabix. IF ue_total_only EQ space. IF x_header-delmdtflag NE space.
PERFORM check_if_entry_is_to_display USING 'L' <vim_xtotal_key> 'X'
<vim_begdate>. rec = sy-subrc. ENDIF. extract = total. IF
x_header-delmdtflag EQ space OR rec LT 8. MODIFY extract INDEX index.
ENDIF. ENDIF. ENDFORM. FORM nicht_vorhanden USING rc tabind. DATA: dum
TYPE i VALUE 0. move <table1> to <vim_total_struc>. IF x_header-bastab
NE space AND x_header-texttbexst NE space. MOVE <table1_xtext> TO
<vim_xtotal_text>. IF <status>-upd_flag EQ 'X' OR <status>-upd_flag EQ
'T'. <action_text> = neuer_eintrag. ENDIF. ENDIF. <action> =
neuer_eintrag. CASE rc. WHEN 0. MODIFY total INDEX tabind. WHEN 4.
INSERT total INDEX tabind. WHEN 8. APPEND total. ENDCASE. IF
vim_special_mode NE vim_upgrade AND status-action NE kopieren. IF
status-mode EQ list_bild. IF vim_single_entry_function EQ space. CLEAR
<xmark>. APPEND extract. ELSE. nbr_of_added_dummy_entries = 0. ENDIF.
extract = total. MODIFY extract INDEX nextline. ELSE. IF
x_header-delmdtflag NE space. PERFORM check_if_entry_is_to_display
USING 'L' <vim_xtotal_key> 'D' <vim_begdate>. IF sy-subrc EQ 0. PERFORM
check_new_mainkey. IF sy-subrc EQ 0. READ TABLE vim_collapsed_mainkeys
WITH KEY <vim_xtotal_key> BINARY SEARCH TRANSPORTING NO FIELDS.
<vim_collapsed_keyx> = <vim_xtotal_key>. <vim_collapsed_mkey_bfx> =
<vim_tot_mkey_before>. INSERT vim_collapsed_mainkeys INDEX sy-tabix.
ENDIF. CLEAR sy-subrc. ENDIF. ENDIF. IF x_header-delmdtflag EQ space OR
sy-subrc LT 8. extract = total. APPEND extract. exind = sy-tabix.
ENDIF. ENDIF. ENDIF. neuer = 'N'. DESCRIBE TABLE extract LINES
maxlines. IF status-mode EQ list_bild. SUBTRACT
nbr_of_added_dummy_entries FROM maxlines. dum = maxlines - firstline -
sy-loopc + 1. IF dum EQ 0. destpage = maxlines. ENDIF. ENDIF. ENDFORM.
FORM check_new_mainkey. LOCAL: total, <table1>. DATA: hf TYPE i, rec
TYPE i. MOVE: <vim_xtotal_key> TO <f1_x>. READ TABLE total WITH KEY
<f1_x> BINARY SEARCH TRANSPORTING NO FIELDS. IF sy-subrc EQ 0. hf =
sy-tabix - 1. READ TABLE total INDEX hf. IF <vim_tot_mkey_beforex> EQ
<vim_f1_beforex> AND ( vim_mkey_after_exists EQ space OR
<vim_tot_mkey_afterx> EQ <vim_f1_afterx> ). rec = 8. ELSE. hf = hf + 2.
READ TABLE total INDEX hf. IF <vim_tot_mkey_beforex> EQ
<vim_f1_beforex> AND ( vim_mkey_after_exists EQ space OR
<vim_tot_mkey_afterx> EQ <vim_f1_afterx> ). rec = 8. ENDIF. ENDIF.
ENDIF. sy-subrc = rec. ENDFORM. FORM hinzufuegen. DATA: h_screenmode(1)
TYPE c VALUE 'S'. CASE status-action. WHEN hinzufuegen. nextline =
maxlines. WHEN aendern. REFRESH extract. maxlines = 0. nextline =
<status>-cur_line = 1. IF status-type EQ zweistufig. firstline =
<status>-firstline = nextline. ENDIF. IF vim_single_entry_function EQ
'INS'. h_screenmode = 'C'. ENDIF. WHEN OTHERS. MESSAGE i001(sv). EXIT.
ENDCASE. MOVE <initial> TO <table1>. IF x_header-clidep NE space. MOVE
sy-mandt TO <client>. ENDIF. MOVE <table1> TO <vim_extract_struc>. IF
x_header-bastab NE space AND x_header-texttbexst NE space. MOVE:
<text_initial> TO <table1_text>, <table1_xtext> TO <vim_xextract_text>.
ENDIF. status-action = hinzufuegen. <status>-selected = neuer_eintrag.
status-data = auswahldaten. title-action = hinzufuegen. title-data =
auswahldaten. neuer = 'J'. IF status-type EQ zweistufig. PERFORM
process_detail_screen USING h_screenmode. ELSE. IF
vim_single_entry_function EQ 'INS'. nbr_of_added_dummy_entries = 1.
ELSEIF looplines EQ 0. MOVE 50 TO nbr_of_added_dummy_entries. ELSE.
MOVE looplines TO nbr_of_added_dummy_entries. ENDIF. MOVE leer TO
<xact>. clear <xmark>. DO nbr_of_added_dummy_entries TIMES. APPEND
extract. ENDDO. IF h_screenmode EQ 'S'. SET SCREEN liste. LEAVE SCREEN.
ELSE. CALL SCREEN liste. ENDIF. ENDIF. ENDFORM. FORM check_key. DATA: s
LIKE sy-tabix, mess_type(1) TYPE c VALUE 'E', ck_tabix TYPE i,
ck_check_tab LIKE vimdesc-viewname, ck_slcnds_nokey(1) TYPE c,
ck_clause TYPE vim_ck_selcond, ck_wa TYPE REF TO data, ck_wheretab LIKE
vimwheretb OCCURS 10, ck_rc LIKE sy-subrc, oc_keys TYPE occheckkeyflds,
n(1) TYPE n, ocmes TYPE fieldname, field1 TYPE fieldname, field2 TYPE
fieldname, field3 TYPE fieldname, field4 TYPE fieldname, w_oc_keys TYPE
occheckkey, fieldname TYPE fnam_____4. FIELD-SYMBOLS: <ck_1> TYPE ANY,
<noauth> TYPE fieldname, <namtab> TYPE vimnamtab, <ck_wa> TYPE ANY,
<table1_txt_loc> type any. CHECK neuer CO 'JX'. IF vim_key_alr_checked
NE space. READ TABLE total WITH KEY <f1_x> BINARY SEARCH. EXIT. ELSE.
vim_key_alr_checked = 'X'. ENDIF. IF x_header-customauth CO
sap_cust_classes OR vim_ale_keyspec_check NE space. PERFORM
check_allowed_keyranges. ENDIF. IF NOT vim_oc_inst IS INITIAL. CALL
METHOD vim_oc_inst->build_key_value_tab EXPORTING entry = <table1>
IMPORTING keyvalues = oc_keys. CALL METHOD
vim_oc_inst->check_oc_authority EXPORTING activity = '02' CHANGING
key_values = oc_keys EXCEPTIONS no_auth = 1 wrong_parameter = 3 OTHERS
= 4. CASE sy-subrc. WHEN 1. PERFORM set_pf_status USING 'ERROR'. CLEAR
vim_key_alr_checked. LOOP AT oc_keys INTO w_oc_keys WHERE noauth = 'X'.
n = n + 1. CONCATENATE 'FIELD' n INTO ocmes. IF n <= '4'. ASSIGN
(ocmes) TO <noauth>. READ TABLE x_namtab ASSIGNING <namtab> WITH KEY
viewfield = w_oc_keys-keyname. CHECK sy-subrc = 0. IF
<namtab>-scrtext_s <> space. <noauth> = <namtab>-scrtext_s. ELSE.
<noauth> = w_oc_keys-keyname. ENDIF. ELSE. ENDIF. ENDLOOP. MESSAGE
e757(sv) WITH field1 field2 field3 field4. WHEN OTHERS. ENDCASE. ENDIF.
IF x_header-selection NE space. if x_header-bastab <> space and
x_header-texttbexst <> space. assign <table1_text> to <table1_txt_loc>.
else. assign <table1> to <table1_txt_loc>. endif. CALL FUNCTION
'TABLE_RANGE_CHECK' EXPORTING tabname = x_header-maintview entry =
<table1> entry_text = <table1_txt_loc> ddic = 'J' key = 'J'
ignore_blank_subsetfields = 'N' TABLES x_namtab = x_namtab x_header =
x_header sellist = <vim_ck_sellist> EXCEPTIONS entry_not_fits = 1. IF
sy-subrc EQ 1. PERFORM set_pf_status USING 'ERROR'. CLEAR
vim_key_alr_checked. MESSAGE e033(sv). ENDIF. ENDIF. IF
vim_called_by_cluster = space AND ( vim_import_mode_active <> space OR
vim_special_mode = vim_upgrade ). CALL FUNCTION 'VIEW_FORKEY_CHECK'
EXPORTING viewname = view_name entry = <table1> TABLES namtab =
x_namtab EXCEPTIONS forkey_error = 1. IF sy-subrc EQ 1. PERFORM
set_pf_status USING 'ERROR'. CLEAR vim_key_alr_checked. MESSAGE ID
sy-msgid TYPE 'E' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3
sy-msgv4. ENDIF. ENDIF. READ TABLE total WITH KEY <f1_x> BINARY SEARCH.
ck_tabix = sy-tabix. IF sy-subrc NE 0 AND x_header-selection NE space
AND <status>-nokeyslcds NE space. IF x_header-bastab EQ space.
ck_check_tab = x_header-roottab. ELSE. ck_check_tab =
x_header-maintview. ENDIF. LOOP AT x_namtab WHERE keyflag NE space. IF
x_header-bastab NE space AND x_header-texttbexst NE space. CHECK
x_namtab-texttabfld EQ space. ELSEIF x_header-bastab EQ space. CHECK
x_namtab-bastabname EQ x_header-roottab. ENDIF. PERFORM
vim_ck_append_wheretab TABLES ck_wheretab USING ck_clause. IF
x_header-bastab EQ space. ck_clause-field = x_namtab-bastabfld. ELSE.
ck_clause-field = x_namtab-viewfield. ENDIF. ck_clause-operator = 'EQ'.
ck_clause-hk1 = ''''. ck_clause-hk2 = ''''. ck_clause-and = 'AND'. IF
x_namtab-inttype CO 'DTN'. ASSIGN COMPONENT x_namtab-viewfield OF
STRUCTURE <table1> TO <ck_1> CASTING TYPE c. ELSE. CONCATENATE
x_header-maintview x_namtab-viewfield INTO fieldname SEPARATED BY '-'.
ASSIGN COMPONENT x_namtab-viewfield OF STRUCTURE <table1> TO <ck_1>
CASTING TYPE (fieldname). ENDIF. ck_clause-value = <ck_1>. ENDLOOP.
CLEAR ck_clause-and. PERFORM vim_ck_append_wheretab TABLES ck_wheretab
USING ck_clause. CREATE DATA ck_wa TYPE (ck_check_tab). ASSIGN ck_wa->*
TO <ck_wa>. SELECT SINGLE * INTO <ck_wa> FROM (ck_check_tab) WHERE
(ck_wheretab). IF sy-subrc EQ 8. RAISE impossible_error. ENDIF. ck_rc =
sy-subrc. ELSE. ck_rc = sy-subrc. ENDIF. IF ck_rc NE 0 AND
vim_called_by_cluster NE space. CALL FUNCTION
'VIEWCLUSTER_CHECK_MASTER_ENTRY' EXPORTING check_entry = <table1>
view_name = x_header-viewname EXCEPTIONS invalid_key = 1 invalid_value
= 2. IF sy-subrc NE 0. IF status-mode EQ list_bild. SET CURSOR FIELD
sy-msgv1 LINE l. ELSE. SET CURSOR FIELD sy-msgv1. ENDIF. CLEAR
vim_key_alr_checked. PERFORM set_pf_status USING 'ERROR'. MESSAGE ID
sy-msgid TYPE 'E' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3
sy-msgv4. ENDIF. ENDIF. sy-subrc = ck_rc. sy-tabix = ck_tabix. CHECK
ck_rc EQ 0. IF x_header-delmdtflag NE space AND status-mode EQ
detail_bild. mess_type = 'S'. ENDIF. PERFORM set_pf_status USING
'ERROR'. CLEAR vim_key_alr_checked. IF <action> EQ geloescht OR
<action> EQ neuer_geloescht OR <action> EQ update_geloescht. MESSAGE ID
'SV' TYPE mess_type NUMBER '010'. ELSE. MESSAGE ID 'SV' TYPE mess_type
NUMBER '009'. ENDIF. IF x_header-delmdtflag NE space AND status-mode EQ
detail_bild. <vim_h_old_mkey>(x_header-keylen) = <f1_x>. TRANSLATE
neuer USING 'JX'. CLEAR: function, ok_code. LEAVE SCREEN. ENDIF.
ENDFORM. FORM VIM_CK_APPEND_WHERETAB TABLES VCAW_WHERETAB STRUCTURE
VIMWHERETB USING VALUE(LINE) TYPE VIM_CK_SELCOND. DATA: BEGIN OF HF,
F1(1) TYPE C, F2 LIKE VIMSELLIST-VALUE, F3(1) TYPE C, END OF HF. DATA:
len TYPE i,l_line(134) TYPE c. CONSTANTS: wheretab_length TYPE i VALUE
72. CHECK NOT LINE IS INITIAL. IF LINE-VALUE EQ SPACE. HF = ''' '''.
ELSE. CONCATENATE: LINE-HK1 LINE-VALUE LINE-HK2 INTO HF. ENDIF.
CONCATENATE: LINE-FIELD LINE-OPERATOR HF LINE-AND INTO VCAW_WHERETAB
SEPARATED BY SPACE. IF SY-SUBRC EQ 0. APPEND VCAW_WHERETAB. ELSE.
CONCATENATE: LINE-FIELD LINE-OPERATOR INTO VCAW_WHERETAB SEPARATED BY
SPACE. APPEND VCAW_WHERETAB. CONCATENATE: HF LINE-AND INTO l_line
SEPARATED BY SPACE. vcaw_wheretab = l_line. APPEND vcaw_wheretab. len =
strlen( l_line ). IF len > wheretab_length. CLEAR vcaw_wheretab.
vcaw_wheretab = l_line+wheretab_length. APPEND vcaw_wheretab. ENDIF. IF
line-and <> space. vcaw_wheretab = line-and. APPEND VCAW_WHERETAB.
ENDIF. ENDIF. ENDFORM. FORM liste_loesche. DATA: rec LIKE sy-subrc,
delete_fix_value(1) TYPE c, entry_contains_fix_val(1) TYPE c, w_field
TYPE vimty_fields_type, bc_fix_del_info_sent(1) TYPE c VALUE ' '. READ
TABLE extract INDEX firstline. IF x_header-delmdtflag <> space.
<vim_h_old_mkey>(x_header-keylen) = <vim_xextract_key>. ENDIF. counter
= 0. LOOP AT extract. CHECK <xmark> EQ markiert. delete_fix_value =
vim_bc_chng_allowed. IF vim_bc_chng_allowed = space. READ TABLE
vim_bc_entry_list INTO vim_bc_entry_list_wa WITH TABLE KEY viewname =
x_header-viewname keys = <vim_xextract_key>. IF sy-subrc = 0. CLEAR
entry_contains_fix_val. LOOP at vim_bc_entry_list_wa-fields into
w_field. IF w_field-flag = vim_profile_fix. entry_contains_fix_val =
'X'. ENDIF. ENDLOOP. IF entry_contains_fix_val = 'X'. IF
bc_fix_del_info_sent EQ SPACE AND <status>-bcfixdelinfosent NE 'Y'.
bc_fix_del_info_sent = 'X'. <status>-bcfixdelinfosent = 'X'. MESSAGE
i177(SV). ENDIF. ELSE. delete_fix_value = 'X'. ENDIF. ELSE.
delete_fix_value = 'X'. ENDIF. ENDIF. CHECK delete_fix_value EQ 'X'.
READ TABLE total WITH KEY <vim_xextract_key> BINARY SEARCH. rec =
sy-tabix. IF x_header-existency EQ 'M'. PERFORM
check_if_entry_can_be_deleted. IF sy-subrc NE 0. <xmark> = uebergehen.
ignored_entries_exist = 'X'. MODIFY extract. <mark> = uebergehen.
MODIFY total INDEX rec. CONTINUE. ENDIF. ENDIF. PERFORM
delete_check_keyrange. CASE sy-subrc. WHEN 0. WHEN 4. CONTINUE. WHEN 8.
EXIT. ENDCASE. counter = counter + 1. PERFORM logical_delete_from_total
USING rec. IF x_header-delmdtflag NE space. IF vim_special_mode NE
vim_upgrade. PERFORM check_if_entry_is_to_display USING 'L'
<vim_xtotal_key> space <vim_begdate>. ELSE. CLEAR sy-subrc. ENDIF. CASE
sy-subrc. WHEN 0. DELETE extract. WHEN 4. <f1_x> = <vim_xtotal_key>.
CLEAR <vim_enddate_mask>. <vim_h_old_mkey>(x_header-keylen) = <f1_x>.
<vim_h_mkey> = <vim_xtotal_key>. rec = 8. LOOP AT total. PERFORM select
USING <status>-selected. CHECK sy-subrc EQ 0. CHECK
<vim_tot_mkey_beforex> EQ <vim_f1_beforex> AND ( vim_mkey_after_exists
EQ space OR <vim_tot_mkey_afterx> EQ <vim_f1_afterx> ). extract =
total. PERFORM mod_extract_and_mainkey_tab USING 'M' 0. CLEAR rec.
EXIT. ENDLOOP. IF rec NE 0. DELETE extract. ENDIF. ENDCASE. ELSE.
DELETE extract. ENDIF. mark_total = mark_total - 1. mark_extract =
mark_extract - 1. ENDLOOP. CHECK vim_special_mode NE vim_upgrade.
DESCRIBE TABLE extract LINES maxlines. IF status-action EQ hinzufuegen.
SUBTRACT nbr_of_added_dummy_entries FROM maxlines. ENDIF. IF
ignored_entries_exist EQ space AND maxlines GT 0. MESSAGE s011(sv) WITH
counter. ELSE. MESSAGE i011(sv) WITH counter. ENDIF. IF
x_header-delmdtflag <> space. <f1_x> = <vim_h_old_mkey>. ENDIF. READ
TABLE extract WITH KEY <f1_x>. IF sy-subrc NE 8. rec = firstline +
looplines - 1. IF sy-tabix GT rec OR nextline GT maxlines. nextline =
sy-tabix. ENDIF. ELSE. nextline = 1. ENDIF. IF maxlines EQ 0 AND
status-action EQ hinzufuegen. status-action = aendern. title-action =
aendern. l = 1. o = 0. ENDIF. CLEAR vim_old_viewkey. TRANSLATE
vim_no_mainkey_exists USING vim_no_mkey_not_procsd_patt. ENDFORM. FORM
logical_delete_from_total USING value(cur_index) TYPE i. CASE <action>.
WHEN neuer_eintrag. <action> = neuer_geloescht. WHEN original. <action>
= geloescht. WHEN aendern. <action> = update_geloescht. ENDCASE. IF
x_header-bastab NE space AND x_header-texttbexst NE space. CASE
<action_text>. WHEN neuer_eintrag. <action_text> = neuer_geloescht.
WHEN original. IF <vim_xtotal_text> NE <text_initial_x>. <action_text>
= geloescht. ELSE. PERFORM (vim_frm_fill_textkey) IN PROGRAM (sy-repid)
USING <vim_total_struc> <vim_tot_txt_struc>. <action_text> =
dummy_geloescht. ENDIF. WHEN aendern. <action_text> = update_geloescht.
ENDCASE. ENDIF. <mark> = nicht_markiert. MODIFY total INDEX cur_index.
ENDFORM. FORM check_if_entry_can_be_deleted. LOCAL: <f1_x>, total,
<vim_xextract_key>. DATA: hf TYPE i, rec TYPE i VALUE 8.
<vim_xextract_key> = <f1_x> = <vim_xtotal_key>. CLEAR
<vim_enddate_mask>. READ TABLE total WITH KEY <f1_x> BINARY SEARCH
TRANSPORTING NO FIELDS. hf = sy-tabix. LOOP AT total FROM hf. IF
<vim_tot_mkey_beforex> NE <vim_f1_beforex> OR ( vim_mkey_after_exists
NE space AND <vim_tot_mkey_afterx> NE <vim_f1_afterx> ). EXIT. ENDIF.
CHECK <action> NE geloescht AND <action> NE neuer_geloescht AND
<action> NE update_geloescht AND <vim_xtotal_key> NE
<vim_xextract_key>. CLEAR rec. EXIT. ENDLOOP. sy-subrc = rec. ENDFORM.
FORM suchen. DESCRIBE TABLE exclude_tab. IF sy-tfill GT 0. PERFORM
consider_old_exclude_tab TABLES excl_que_tab. ENDIF. CALL FUNCTION
'QUERY_GET_OPERATION' EXPORTING table = x_header-maintview TABLES
exclude_fields = excl_que_tab EXCEPTIONS table_not_found = 0004
no_valid_fields = 0008 cancelled_by_user = 0012. CASE sy-subrc. WHEN 0.
WHEN 8. MESSAGE s039(sv) WITH view_name. EXIT. WHEN OTHERS. EXIT.
ENDCASE. status-data = auswahldaten. title-data = auswahldaten. IF
title-action EQ geloescht. status-delete = nicht_geloescht.
title-action = aendern. ENDIF. REFRESH extract. LOOP AT total. PERFORM
select USING by_field_contents. CHECK sy-subrc EQ 0. extract = total.
APPEND extract. ENDLOOP. <status>-selected = by_field_contents.
DESCRIBE TABLE extract LINES maxlines. nextline = 1. IF maxlines EQ 0.
PERFORM fill_extract. MESSAGE s004(sv). EXIT. ENDIF. IF maxlines EQ 1.
MESSAGE s005(sv). IF status-type EQ zweistufig. PERFORM read_table
USING maxlines. PERFORM process_detail_screen USING 'S'. ENDIF. ELSE.
IF status-mode EQ detail_bild. vim_next_screen = liste.
vim_leave_screen = 'X'. ENDIF. ENDIF. MESSAGE s006(sv) WITH maxlines.
mark_extract = 0. LOOP AT extract. IF <xmark> EQ markiert. mark_extract
= mark_extract + 1. ENDIF. ENDLOOP. IF x_header-delmdtflag <> space.
LOOP AT extract. LOOP AT vim_collapsed_mainkeys. CHECK
<vim_collapsed_mkey_bfx> = <vim_ext_mkey_beforex> AND
<vim_collapsed_keyx> <> <vim_xextract_key>. DELETE
vim_collapsed_mainkeys. ENDLOOP. ENDLOOP. ENDIF. ENDFORM. FORM
CONSIDER_OLD_EXCLUDE_TAB TABLES NEW_EXCLUDE_TAB STRUCTURE VIMEXCLFLD.
DATA: BEGIN OF VIEWNAME_PATTERN, VIEWNAME LIKE VIMDESC-VIEWNAME,
WILDCARD(1) TYPE C VALUE '*', END OF VIEWNAME_PATTERN.
VIEWNAME_PATTERN-VIEWNAME = X_HEADER-MAINTVIEW. CONDENSE
VIEWNAME_PATTERN NO-GAPS. LOOP AT EXCLUDE_TAB WHERE FIELD CP
VIEWNAME_PATTERN. SHIFT EXCLUDE_TAB-FIELD UP TO '-'. SHIFT
EXCLUDE_TAB-FIELD. NEW_EXCLUDE_TAB-FIELDNAME = EXCLUDE_TAB-FIELD.
COLLECT NEW_EXCLUDE_TAB. ENDLOOP. ENDFORM. FORM replace. DATA:
firstline_safe TYPE i. DESCRIBE TABLE exclude_tab. IF sy-tfill GT 0.
PERFORM consider_old_exclude_tab TABLES excl_rpl_tab. ENDIF. CALL
FUNCTION 'REPLACE_GET_FIELD' EXPORTING table = x_header-maintview
IMPORTING name_of_selected_field = sel_field_for_replace TABLES
exclude_fields = excl_rpl_tab EXCEPTIONS cancelled_by_user = 0004
no_valid_fields = 8. CASE sy-subrc. WHEN 4. function = 'ABR '. EXIT.
WHEN 8. MESSAGE s039(sv) WITH view_name. EXIT. ENDCASE. LOOP AT
x_namtab WHERE viewfield EQ sel_field_for_replace. IF x_header-bastab
NE space AND x_header-texttbexst NE space AND x_namtab-texttabfld NE
space. assign component x_namtab-viewfield of structure
<vim_ext_txt_struc> to <replace_field>. else. assign component
x_namtab-viewfield of structure <vim_extract_struc> to <replace_field>.
endif. IF x_header-bastab NE space AND x_header-texttbexst NE space.
MOVE x_namtab-texttabfld TO replace_texttable_field. ELSE. CLEAR
replace_texttable_field. ENDIF. ENDLOOP. IF replace_texttable_field EQ
space. CONCATENATE x_header-maintview sel_field_for_replace INTO
sel_field_for_replace_l SEPARATED BY '-'. ELSE. CONCATENATE
x_header-texttab sel_field_for_replace INTO sel_field_for_replace_l
SEPARATED BY '-'. ENDIF. IF x_header-frm_bf_rpl NE space. PERFORM
(x_header-frm_bf_rpl) IN PROGRAM (sy-repid). ENDIF. PERFORM
set_pf_status USING 'REPLACE'. replace_mode = 'X'. vim_special_mode =
vim_replace. counter = 0. firstline_safe = firstline. LOOP AT extract.
CHECK <xmark> EQ markiert. nextline = exind = sy-tabix. IF
replace_texttable_field EQ space. CALL FUNCTION 'REPLACE_SET_VALUE'
EXPORTING old_table = <vim_xextract> IMPORTING new_table = <table1_x>.
IF x_header-bastab NE space AND x_header-texttbexst NE space.
<table1_xtext> = <vim_xextract_text>. ENDIF. ELSE. MOVE
<vim_extract_struc> TO <table1>. CALL FUNCTION 'REPLACE_SET_VALUE'
EXPORTING old_table = <vim_xextract_text> IMPORTING new_table =
<table1_xtext>. ENDIF. CASE status-type. WHEN einstufig. CALL SCREEN
liste. WHEN zweistufig. PERFORM process_detail_screen USING 'C'.
<vim_extract_struc> = <table1>. IF x_header-bastab NE space AND
x_header-texttbexst NE space. <vim_xextract_text> = <table1_xtext>.
ENDIF. ENDCASE. CHECK ok_code NE 'IGN '. IF function EQ 'ABR '. EXIT.
ENDIF. counter = counter + 1. SUBTRACT 1 FROM mark_extract. SUBTRACT 1
FROM mark_total. ENDLOOP. firstline = nextline = firstline_safe.
replace_mode = vim_special_mode = space. MESSAGE s012(sv) WITH counter.
IF x_header-frm_af_rpl NE space. PERFORM (x_header-frm_af_rpl) IN
PROGRAM (sy-repid). ENDIF. ENDFORM. FORM kopiere. DATA: z LIKE sy-tabix
VALUE 1, stat TYPE c, dum1 TYPE i. status-action = kopieren. MOVE
status-data TO stat. status-data = auswahldaten. title-data =
auswahldaten. ADD 1 TO vim_copy_call_level. IF vim_special_mode EQ
vim_delimit. title-action = vim_delimit. ENDIF. ASSIGN
<vim_xextract_key> TO <orig_key>. IF status-mode EQ list_bild. LOOP AT
extract. IF <xmark> NE markiert. DELETE extract. ELSE. <xmark> =
nicht_markiert. MODIFY extract. ENDIF. ENDLOOP. mark_extract =
<status>-mk_xt = 0. nextline = 1. DESCRIBE TABLE extract LINES
maxlines. IF vim_copy_call_level = 1. VIM_NR_ENTRIES_TO_COPY =
maxlines. ENDIF. IF status-type EQ einstufig. IF vim_special_mode NE
vim_delimit. MESSAGE s024(sv). ELSE. MESSAGE s124(sv). ENDIF. CALL
SCREEN liste. IF function NE 'ABR '. DESCRIBE TABLE vim_copied_indices.
IF sy-tfill LT VIM_NR_ENTRIES_TO_COPY.  LOOP AT extract. READ TABLE
vim_copied_indices WITH KEY level = vim_copy_call_level ex_ix = z. IF
sy-subrc EQ 0. DELETE extract. ELSE. <xmark> = markiert. MODIFY
extract. ENDIF. ADD 1 TO z. ENDLOOP. PERFORM kopiere. ENDIF. ENDIF.
ELSE. LOOP AT extract. IF vim_special_mode NE vim_delimit. neuer = 'J'.
MESSAGE s025(sv). ELSE. MESSAGE s125(sv). ENDIF. PERFORM
move_extract_to_view_wa. PERFORM process_detail_screen USING 'C'. neuer
= 'N'. <status>-upd_flag = space. IF temporal_delimitation_happened NE
space. CLEAR temporal_delimitation_happened. ENDIF. IF vim_special_mode
EQ vim_delimit. REFRESH vim_delim_entries. ENDIF. IF function EQ
'ABR '. EXIT. ENDIF. ENDLOOP. ENDIF. IF vim_copy_call_level GT 1.
SUBTRACT 1 FROM vim_copy_call_level. EXIT. ENDIF. IF vim_special_mode
NE vim_delimit AND counter LE 1. PERFORM fill_extract. mark_extract =
mark_total. title-data = gesamtdaten. IF counter EQ 1. READ TABLE
vim_copied_indices INDEX 1. READ TABLE total INDEX
vim_copied_indices-ix. IF x_header-delmdtflag EQ space. READ TABLE
extract WITH KEY <vim_xtotal_key> TRANSPORTING NO FIELDS. nextline =
sy-tabix. ELSE. nextline = 0. LOOP AT vim_collapsed_mainkeys. check
<vim_collapsed_mkey_bfx> = <vim_tot_mkey_beforex>. IF
vim_mkey_after_exists NE space. CHECK <vim_collapsed_key_afx> EQ
<vim_tot_mkey_afterx>. ENDIF. READ TABLE extract WITH KEY
<vim_collapsed_keyx> TRANSPORTING NO FIELDS. nextline = sy-tabix. EXIT.
ENDLOOP. IF sy-subrc NE 0 OR nextline EQ 0. READ TABLE extract WITH KEY
<vim_xtotal_key> TRANSPORTING NO FIELDS. IF sy-subrc NE 0. nextline =
1. ELSE. nextline = sy-tabix. ENDIF. ENDIF. ENDIF. ELSE. nextline = 1.
ENDIF. ELSE. status-action = title-action = hinzufuegen. status-data =
title-data = auswahldaten. <status>-selected = neuer_eintrag. REFRESH:
extract, vim_delim_entries. CLEAR: vim_mainkey,
temporal_delimitation_happened. TRANSLATE vim_no_mainkey_exists USING
vim_no_mkey_not_procsd_patt. mark_extract = 0. LOOP AT
vim_copied_indices. READ TABLE total INDEX vim_copied_indices-ix.
extract = total. APPEND extract. IF x_header-delmdtflag NE space. LOOP
AT vim_collapsed_mainkeys. check <vim_collapsed_mkey_bfx> =
<vim_ext_mkey_beforex>. IF vim_mkey_after_exists NE space. CHECK
<vim_collapsed_key_afx> EQ <vim_ext_mkey_afterx>. ENDIF. READ TABLE
excl_cua_funct WITH KEY function = 'EXPA'. IF sy-subrc NE 0. APPEND
'EXPA' TO excl_cua_funct. vim_delim_expa_excluded = 'X'. ENDIF.
vim_collapsed_mainkeys-log_key = vim_collapsed_mainkeys-mkey_bf. CLEAR
vim_collapsed_mainkeys-mkey_bf. MODIFY vim_collapsed_mainkeys. EXIT.
ENDLOOP. ENDIF. ENDLOOP. vim_coll_mainkeys_beg_ix = 1. nextline = 1.
ENDIF. l = 1. DESCRIBE TABLE extract LINES maxlines. ELSE. CLEAR
<status>-mark_only. IF vim_special_mode NE vim_delimit. neuer = 'J'.
MESSAGE s025(sv). ELSE. MESSAGE s125(sv). ENDIF. PERFORM
process_detail_screen USING 'C'. neuer = 'N'. <status>-upd_flag =
space. IF function NE 'IGN ' AND function NE 'ABR '. IF
vim_special_mode NE vim_delimit. IF status-mark EQ markiert. READ TABLE
extract WITH KEY <orig_key> BINARY SEARCH. IF sy-subrc EQ 0. <xmark> =
nicht_markiert. MODIFY extract INDEX sy-tabix. SUBTRACT 1 FROM
mark_extract. ENDIF. ENDIF. ELSE. IF temporal_delimitation_happened NE
space. PERFORM after_temporal_delimitation. ENDIF. ENDIF. READ TABLE
total WITH KEY <f1_x> BINARY SEARCH. extract = total. IF
x_header-delmdtflag NE space. PERFORM check_if_entry_is_to_display
USING 'L' <vim_xtotal_key> 'D' <vim_begdate>. IF sy-subrc EQ 0. PERFORM
check_new_mainkey. IF sy-subrc EQ 0. READ TABLE vim_collapsed_mainkeys
WITH KEY <vim_tot_mkey_beforex> BINARY SEARCH TRANSPORTING NO FIELDS.
<vim_collapsed_keyx> = <vim_xtotal_key>. <vim_collapsed_mkey_bfx> =
<vim_tot_mkey_beforex>. INSERT vim_collapsed_mainkeys INDEX sy-tabix.
ENDIF. CLEAR sy-subrc. ENDIF. ENDIF. IF x_header-delmdtflag EQ space OR
sy-subrc LT 8. READ TABLE extract WITH KEY <vim_xextract_key> BINARY
SEARCH TRANSPORTING NO FIELDS. CASE sy-subrc. WHEN 0. MODIFY extract
INDEX sy-tabix. WHEN 4. INSERT extract INDEX sy-tabix. WHEN 8. APPEND
extract. ENDCASE. MOVE: sy-tabix TO exind, sy-tabix TO nextline. ENDIF.
IF looplines GT 0. IF nextline LE firstline. dum1 = ( firstline -
nextline ) / looplines. ADD 1 TO dum1. DO dum1 TIMES. firstline =
firstline - looplines + 1. ENDDO. IF firstline LE 0. firstline = 1.
ENDIF. ELSE. dum1 = firstline + looplines - 1. IF nextline GT dum1.
dum1 = ( nextline - firstline ) / looplines. DO dum1 TIMES. firstline =
firstline + looplines - 1. ENDDO. ENDIF. ENDIF. l = nextline -
firstline + 1. ELSE. l = nextline. ENDIF. MOVE: firstline TO
<status>-firstline, l TO <status>-cur_line. DESCRIBE TABLE extract
LINES maxlines. ENDIF. MOVE: stat TO status-data, stat TO title-data.
ENDIF. REFRESH vim_copied_indices. SUBTRACT 1 FROM vim_copy_call_level.
IF vim_special_mode NE vim_delimit. MESSAGE s014(sv) WITH counter.
ELSE. IF counter EQ 1. MESSAGE s122(sv). ELSE. MESSAGE s123(sv) WITH
counter. ENDIF. ENDIF. status-action = aendern. IF title-action NE
hinzufuegen. title-action = aendern. ENDIF. CLEAR vim_old_viewkey.
TRANSLATE vim_no_mainkey_exists USING vim_no_mkey_not_procsd_patt. IF
function EQ 'ABR '. vim_next_screen = liste. vim_leave_screen = 'X'.
ELSEIF function NE 'IGN '. IF vim_special_mode EQ vim_delimit AND
status-mode EQ detail_bild. function = 'DETA'. ELSE. CLEAR function.
ENDIF. ENDIF. ENDFORM. FORM kopiere_eintrag USING origin. DATA:
ke_index LIKE sy-tabix, ke_rc LIKE sy-subrc, ke_hf TYPE i.
field-symbols: <x_origin> type x. IF status-mode EQ list_bild AND
function NE 'KOPF' AND <status>-upd_flag EQ space. EXIT. ENDIF. assign
origin to <x_origin> casting. IF vim_special_mode NE vim_delimit. IF
x_header-guidflag <> space. PERFORM vim_make_guid using space. ENDIF.
IF x_header-frm_on_new NE space. IF replace_mode NE space.
<status>-mk_to = mark_total. <status>-mk_xt = mark_extract.
vim_next_screen = 0. vim_leave_screen = 'X'. EXIT. ENDIF. PERFORM
(x_header-frm_on_new) IN PROGRAM (sy-repid). ENDIF. IF <f1_x> EQ
<x_origin>. PERFORM set_pf_status USING 'ERROR'. MESSAGE e015(sv).
EXIT. ELSE. neuer = 'J'. PERFORM check_key. neuer = 'N'. CHECK sy-subrc
NE 0. MOVE: sy-subrc TO ke_rc, sy-tabix TO ke_index. ENDIF. ELSE. READ
TABLE total WITH KEY <f1_x> BINARY SEARCH. MOVE: sy-subrc TO ke_rc,
sy-tabix TO ke_index. ENDIF. IF vim_special_mode NE vim_delimit. IF
x_header-bastab NE space AND x_header-texttbexst NE space AND
<status>-upd_flag EQ 'E'. PERFORM (vim_frm_text_upd_flag) IN PROGRAM.
ENDIF. IF x_header-adrnbrflag NE space. PERFORM address_maintain.
ENDIF. IF x_header-texttbexst <> space. PERFORM vim_copy_texttab_entry
USING <f1_x> <vim_xextract_key>. ENDIF. IF vim_called_by_cluster NE
space. PERFORM vim_store_state_info. CALL FUNCTION
'VIEWCLUSTER_COPY_DEPENDENT' EXPORTING view_name = x_header-viewname
maintview = x_header-maintview status_mode = status-mode workarea =
extract new_entry = <table1> no_dialog = vim_external_mode. PERFORM
vim_restore_state_info. ENDIF. ENDIF. IF vim_special_mode NE
vim_delimit OR ke_rc NE 0. <action> = neuer_eintrag. <mark> =
nicht_markiert. ELSE. IF <action> EQ original. <action> = aendern.
ENDIF. ENDIF. ADD 1 TO counter. MOVE <table1> TO <vim_total_struc>. IF
x_header-bastab NE space AND x_header-texttbexst NE space AND
<status>-upd_flag EQ 'X' OR <status>-upd_flag EQ 'T'. MOVE
<table1_xtext> TO <vim_xtotal_text>. IF vim_special_mode NE vim_delimit
OR ke_rc NE 0. MOVE neuer_eintrag TO <action_text>. ELSE. IF
<action_text> EQ original. <action_text> = aendern. ENDIF. ENDIF.
ENDIF. vim_copied_indices-ex_ix = nextline. vim_copied_indices-level =
vim_copy_call_level. CASE ke_rc. WHEN 0. MODIFY total INDEX ke_index.
READ TABLE vim_copied_indices WITH KEY ix = ke_index BINARY SEARCH
TRANSPORTING NO FIELDS. IF sy-subrc NE 0. vim_copied_indices-ix =
ke_index. INSERT vim_copied_indices INDEX sy-tabix. ENDIF. WHEN 4.
INSERT total INDEX ke_index. READ TABLE vim_copied_indices WITH KEY ix
= ke_index BINARY SEARCH TRANSPORTING NO FIELDS. vim_copied_indices-ix
= ke_index. INSERT vim_copied_indices INDEX sy-tabix. ke_hf = sy-tabix
+ 1. LOOP AT vim_copied_indices FROM ke_hf. ADD 1 TO
vim_copied_indices-ix. MODIFY vim_copied_indices. ENDLOOP. WHEN 8.
APPEND total. vim_copied_indices-ix = ke_index. APPEND
vim_copied_indices. ENDCASE. neuer = 'N'. <status>-upd_flag = space.
READ TABLE total WITH KEY <x_origin> BINARY SEARCH. IF sy-subrc = 0 AND
<mark> EQ markiert. <mark> = nicht_markiert. SUBTRACT 1 FROM
mark_total. MODIFY total INDEX sy-tabix. ENDIF. IF status-mode EQ
detail_bild. vim_next_screen = 0. vim_leave_screen = 'X'. ENDIF.
ENDFORM. FORM call_dynpro. DATA: state_init TYPE c, rc LIKE sy-subrc,
dpl_sel_entries TYPE i, cd_specmode_safe(1) TYPE c, addr_e071k LIKE
e071k, cd_addr_71ktab LIKE e071k OCCURS 0, object_key TYPE ad_objkey,
max_trsp_keylength_in_byte type i. field-symbols: <object_keyx> type x.
max_trsp_keylength_in_byte = vim_max_trsp_keylength *
cl_abap_char_utilities=>charsize. CASE vim_adjust_middle_level_mode.
WHEN space. WHEN subset OR 'X'. vim_special_mode = vim_direct_upgrade.
IF vim_adjust_middle_level_mode EQ subset. x_namtab[] = vim_adj_namtab.
ENDIF. WHEN 'L'. CLEAR vim_adjust_middle_level_mode. function = 'ENDE'.
EXIT. ENDCASE. IF <status>-initializd EQ space. PERFORM
init_state_vector. ENDIF. DESCRIBE TABLE dpl_sellist LINES
dpl_sel_entries. IF x_header-selection EQ space. IF dpl_sel_entries GT
0. MOVE 'X' TO x_header-selection. MODIFY x_header INDEX 1. ASSIGN
dpl_sellist-*sys* TO <vim_ck_sellist>. ELSE. DESCRIBE TABLE
dba_sellist. IF sy-tfill GT 0. MOVE 'X' TO x_header-selection. MODIFY
x_header INDEX 1. ENDIF. ASSIGN dba_sellist-*sys* TO <vim_ck_sellist>.
ENDIF. ELSE. IF dpl_sel_entries GT 0. ASSIGN dpl_sellist-*sys* TO
<vim_ck_sellist>. ELSE. ASSIGN dba_sellist-*sys* TO <vim_ck_sellist>.
ENDIF. ENDIF. PERFORM vim_maint_selflag USING 'I' CHANGING
x_header-selection. IF <status>-alr_sorted EQ space. SORT total BY
<vim_xtotal_key>. MOVE 'X' TO <status>-alr_sorted. ENDIF. PERFORM
exclude_cua_functions. IF x_header-frm_on_aut NE space AND
<status>-auth_check NE space. vim_auth_action = view_action.
vim_auth_event = vim_auth_requested_check. ASSIGN <vim_ck_sellist> TO
<vim_auth_sellist>. PERFORM (x_header-frm_on_aut) IN PROGRAM. IF
vim_auth_rc NE 0. PERFORM vim_process_message USING vim_auth_msgid 'I'
'E' vim_auth_msgno vim_auth_msgv1 vim_auth_msgv2 vim_auth_msgv3
vim_auth_msgv4. CASE vim_auth_rc. WHEN 4. maint_mode = anzeigen.
excl_cua_funct-function = 'AEND'. COLLECT excl_cua_funct. WHEN 8. RAISE
missing_corr_number. ENDCASE. ENDIF. ENDIF. IF maint_mode NE anzeigen
AND maint_mode NE transportieren AND <status>-dlclalrckd EQ space. IF
vim_system_type NE 'SAP' AND x_header-customauth CO sap_only_classes.
PERFORM vim_process_message USING 'SV' 'I' 'I' '137' space space space
space. ENDIF. MOVE 'X' TO <status>-dlclalrckd. ENDIF. IF
x_header-subsetflag NE space AND <status>-sbsid_rcvd CO ' R'. PERFORM
init_subset_keyfields. ENDIF. IF x_header-selection NE space AND
<status>-selcd_rcvd EQ space. LOOP AT dpl_sellist WHERE ddic EQ space
OR ( operator EQ 'GE' OR operator EQ 'GT' OR operator EQ 'LE' OR
operator EQ 'LT' ). MOVE 'X' TO state_init. EXIT. ENDLOOP. IF sy-subrc
NE 0. DESCRIBE TABLE total. IF <status>-maxlines NE sy-tfill AND
<status>-st_data EQ gesamtdaten. IF x_header-delmdtflag NE space. IF
<status>-maxlines = 0. MOVE 'X' TO state_init. ENDIF. ELSE. MOVE 'X' TO
state_init. ENDIF. ENDIF. ENDIF. IF state_init NE space. CLEAR:
<status>-maxlines, <status>-cur_field, <status>-cur_offset. MOVE: 1 TO
<status>-cur_line, 1 TO <status>-firstline, nicht_geloescht TO
<status>-st_delete, maint_mode TO <status>-st_action, list_bild TO
<status>-st_mode. PERFORM set_status_nokeyselcnds. ENDIF. MOVE 'X' TO
<status>-selcd_rcvd. ENDIF. IF <status>-initializd EQ 'x'. PERFORM
set_status_nokeyselcnds. ENDIF. IF maint_mode NE anzeigen AND corr_nbr
NE space AND corr_nbr NE <status>-corr_nbr. MOVE: <status>-corr_nbr TO
<status>-l_corr_nbr, corr_nbr TO <status>-corr_nbr. ENDIF. IF
maint_mode EQ transportieren. PERFORM request_corr_number. IF
x_header-flag EQ vim_transport_denied. MESSAGE i142(sv). function =
ucomm = end. EXIT. ENDIF. ELSEIF maint_mode EQ aendern. PERFORM
check_transp_objs_for_maint USING rc. CASE rc. WHEN 4. maint_mode =
anzeigen. excl_cua_funct-function = 'AEND'. COLLECT excl_cua_funct.
WHEN 8. RAISE missing_corr_number. ENDCASE. ELSE. vim_client_state =
vim_noact. ENDIF. MOVE: maint_mode TO status-action, <status>-st_delete
TO status-delete, <status>-st_data TO status-data, <status>-title TO
title, <status>-firstline TO firstline, <status>-mk_xt TO mark_extract,
<status>-mk_to TO mark_total, <status>-cur_line TO l,
<status>-cur_field TO f, <status>-cur_offset TO o, <status>-maxlines TO
maxlines, maint_mode TO title-action, firstline TO nextline. IF
status-action EQ aendern AND <status>-st_action EQ hinzufuegen. MOVE:
<status>-st_action TO status-action, <status>-st_action TO
title-action. ENDIF. IF <status>-st_delete EQ geloescht. DESCRIBE TABLE
extract LINES maxlines. IF maxlines EQ 0. CLEAR status-delete. MOVE
list_bild TO <status>-st_mode. ENDIF. ELSEIF <status>-st_mode =
detail_bild AND <status>-st_action <> hinzufuegen. DESCRIBE TABLE
extract LINES maxlines. IF maxlines EQ 0. MOVE list_bild TO
<status>-st_mode. ENDIF. ENDIF. IF ( status-action EQ transportieren
AND <status>-l_corr_nbr NE <status>-corr_nbr ) OR ( vim_client_state EQ
vim_log AND 'ST' NS status-action ) . PERFORM prepare_corr. ENDIF. IF
status-action EQ transportieren AND get_corr_keytab NE space. PERFORM
get_keytab. ENDIF. IF status-action EQ transportieren AND
<status>-crcntsknwn EQ space. LOOP AT vim_addr_e071k_tab INTO
addr_e071k. addr_e071k-trkorr = <status>-corr_nbr. MODIFY
vim_addr_e071k_tab FROM addr_e071k. ENDLOOP. LOOP AT total. MOVE
<vim_total_struc> TO <table1>. IF x_header-bastab EQ space. PERFORM
(corr_formname) IN PROGRAM (sy-repid) USING pruefen rc. ELSE.
corr_keytab = e071k. corr_keytab-objname = x_header-maintview. IF
x_header-keylen GT max_trsp_keylength_in_byte. MOVE <vim_xtotal_key> TO
<vim_corr_keyx>(x_header-maxtrkeyln). ELSE. MOVE <vim_xtotal_key> TO
<vim_corr_keyx>(x_header-keylen). ENDIF. PERFORM update_corr_keytab
USING pruefen rc. IF rc EQ 0. IF x_header-texttbexst NE space AND
<vim_xtotal_text> NE <text_initial_x>. corr_keytab = e071k.
corr_keytab-objname = x_header-texttab. IF x_header-textkeylen GT
max_trsp_keylength_in_byte. MOVE <vim_xtotal_text> TO
<vim_corr_keyx>(x_header-maxtrkeyln). ELSE. MOVE <vim_xtotal_text> TO
<vim_corr_keyx>(x_header-textkeylen). ENDIF. PERFORM update_corr_keytab
USING pruefen rc. ENDIF. ENDIF. ENDIF. IF rc = 0 AND
x_header-texttbexst <> space AND vim_texttab_is_ro EQ space. PERFORM
vim_text_keytab_entry USING <vim_xtotal_key> pruefen rc. ENDIF. IF rc
EQ 0. MOVE transportieren TO <action>. IF x_header-adrnbrflag EQ 'O'
AND <address_number> NE space. PERFORM vim_address_keytab_entries USING
pruefen rc. ELSEIF x_header-adrnbrflag EQ 'N' AND <address_number> NE
space. APPEND LINES OF vim_addr_e071k_tab TO cd_addr_71ktab. assign
object_key to <object_keyx> casting. move <vim_xtotal_key> to
<object_keyx>(x_header-keylen). CALL FUNCTION 'ADDR_TRANSPORT_ENTRIES'
EXPORTING addrnumber = <address_number> table_name = vim_addr_basetable
field_name = vim_addr_bastab_field objkey = object_key TABLES e071k_tab
= cd_addr_71ktab. vim_exit_11_12_active = 'X'. LOOP AT cd_addr_71ktab
INTO corr_keytab WHERE mastername = vim_addr_e071k_master_46 or
mastername = vim_addr_e071k_master. PERFORM update_corr_keytab USING
pruefen rc. IF rc NE 0. EXIT. ENDIF. ENDLOOP. CLEAR
vim_exit_11_12_active. ENDIF. IF rc EQ 0. IF x_header-frm_e071ks NE
space. vim_exit_11_12_active = 'X'. MOVE pruefen TO corr_action.
PERFORM (x_header-frm_e071ks) IN PROGRAM (sy-repid). IF sy-subrc NE 0.
CLEAR <action>. ENDIF. CLEAR vim_exit_11_12_active. ENDIF. ELSE. CLEAR
<action>. ENDIF. ELSE. CLEAR <action>. ENDIF. IF maxlines GT 0 AND
vim_special_mode NE vim_extedit. READ TABLE extract WITH KEY <f1_x>. IF
sy-subrc EQ 0. MOVE: <mark> TO <xmark>, <action> TO <xact>. MODIFY
extract INDEX sy-tabix. ENDIF. ENDIF. MODIFY total. ENDLOOP. MOVE 'X'
TO <status>-crcntsknwn. ENDIF. IF vim_restore_mode NE space.
status-mode = <status>-st_mode. CLEAR vim_restore_mode. EXIT. ENDIF. IF
vim_special_mode NE vim_extedit. CASE vim_single_entry_function. WHEN
space OR 'UPD' OR 'SHOW'. IF <status>-st_mode EQ detail_bild. MOVE:
'DETA' TO function, nextline TO firstline. nextline = firstline + l -
1. DESCRIBE TABLE extract LINES maxlines. IF maxlines EQ 0. IF
<status>-st_action EQ hinzufuegen. neuer = 'J'. ELSE. PERFORM
fill_extract. ENDIF. ENDIF. PERFORM process_detail_screen USING 'C'.
ELSE. CALL SCREEN liste. ENDIF. WHEN 'INS'. function = 'NEWL'. PERFORM
hinzufuegen. WHEN 'DEL'. cd_specmode_safe = vim_special_mode.
vim_special_mode = vim_extedit. READ TABLE total INTO extract INDEX 1.
<xact> = geloescht. APPEND extract. PERFORM vim_external_edit.
vim_special_mode = cd_specmode_safe. excl_cua_funct-function = 'UNDO'.
COLLECT excl_cua_funct. PERFORM selektiere USING geloescht. ENDCASE.
MOVE: function TO ucomm. IF status-mode = detail_bild. last_act_entry =
nextline. ELSE. last_act_entry = <status>-firstline + <status>-cur_line
- 1. ENDIF. ELSE. PERFORM vim_external_edit. <status>-maxlines = 0.
ENDIF. IF function NE 'ORGD' AND function NE 'ORGL' AND function NE
'SAVE' AND function NE 'TRSP' AND function NE 'TRAE'. IF
x_header-subsetflag NE space AND <status>-sbsid_rcvd NE 'S'. CLEAR
<status>-sbsid_rcvd. ENDIF. IF x_header-selection NE space AND
<status>-selcd_rcvd NE space. CLEAR <status>-selcd_rcvd. ENDIF. IF
x_header-delmdtflag NE space. EXPORT vim_collapsed_mainkeys TO MEMORY
ID vim_memory_id_1. ENDIF. ASSIGN dba_sellist-*sys* TO <vim_sellist>.
vim_enqueue_range = x_header-subsetflag. ENDIF. ENDFORM. FORM
VIM_STORE_STATE_INFO. MOVE: STATUS-DATA TO <STATUS>-ST_DATA,
STATUS-MODE TO <STATUS>-ST_MODE, STATUS-DELETE TO <STATUS>-ST_DELETE,
STATUS-ACTION TO <STATUS>-ST_ACTION, TITLE TO <STATUS>-TITLE, MAXLINES
TO <STATUS>-MAXLINES, F TO <STATUS>-CUR_FIELD, O TO
<STATUS>-CUR_OFFSET, FUNCTION TO <STATUS>-FCODE. IF L EQ 0. MOVE 1 TO
<STATUS>-CUR_LINE. ELSE. MOVE L TO <STATUS>-CUR_LINE. ENDIF. ENDFORM.
FORM VIM_RESTORE_STATE_INFO. STATUS-DATA = <STATUS>-ST_DATA.
STATUS-MODE = <STATUS>-ST_MODE. STATUS-DELETE = <STATUS>-ST_DELETE.
STATUS-ACTION = <STATUS>-ST_ACTION. TITLE = <STATUS>-TITLE. MAXLINES =
<STATUS>-MAXLINES. F = <STATUS>-CUR_FIELD. O = <STATUS>-CUR_OFFSET.
FUNCTION = <STATUS>-FCODE. L = <STATUS>-CUR_LINE. ENDFORM. FORM
vim_external_edit. TYPES: vee_sellist LIKE vimsellist OCCURS 10. DATA:
ee_rc TYPE i, upd_flags(3) TYPE c, del_flags(3) TYPE c, h_flag(1) TYPE
c, repmode_safe(1) TYPE c, specmode_safe(1) TYPE c, extmode_safe(1)
TYPE c, vee_results LIKE vimmodres, h_ix TYPE i. FIELD-SYMBOLS:
<h_sellist> TYPE vee_sellist, <hf> TYPE ANY. IF maint_mode EQ anzeigen.
vee_results-rc_udl = vee_results-rc_ins = vee_results-rc_upd =
vee_results-rc_del = vee_results-rc_tin = vee_results-rc_del = 8.
vim_results_of_ext_mod = vee_results. EXIT. ENDIF. MOVE: aendern TO
upd_flags, neuer_eintrag TO upd_flags+1, kopieren TO upd_flags+2,
geloescht TO del_flags, update_geloescht TO del_flags+1,
neuer_geloescht TO del_flags+2. repmode_safe = replace_mode.
replace_mode = 'X'. specmode_safe = vim_special_mode. vim_special_mode
= vim_upgrade. extmode_safe = vim_external_mode. vim_external_mode =
'X'. maxlines = 1. clear <status>-bcfixdelinfosent. LOOP AT extract. IF
<xact> EQ zurueckholen. h_flag = status-delete. status-delete =
geloescht. PERFORM vim_mark_and_process USING sy-tabix 'UNDO'
vee_results-nbr_of_udl vee_results-rc_udl. status-delete = h_flag.
ee_rc = vee_results-rc_udl. ELSEIF <xact> CO upd_flags. IF <xact> EQ
kopieren. h_ix = sy-tabix + 1. vim_extcopy_mode = 'X'. <xact> =
neuer_eintrag. ASSIGN <vim_ck_sellist> TO <h_sellist>. LOOP AT
<h_sellist> INTO dpl_sellist WHERE value EQ space AND initial EQ space.
READ TABLE x_namtab INDEX dpl_sellist-tabix. IF sy-subrc EQ 0. IF
x_header-bastab = space. ASSIGN COMPONENT x_namtab-viewfield OF
STRUCTURE <vim_total_struc> TO <hf>. ELSE. IF x_namtab-texttabfld NE
space. ASSIGN COMPONENT x_namtab-viewfield OF STRUCTURE
<vim_ext_txt_struc> TO <hf>. ELSE. ASSIGN COMPONENT x_namtab-viewfield
OF STRUCTURE <vim_extract_struc> TO <hf>. ENDIF. ENDIF. READ TABLE
extract INTO total INDEX h_ix. dpl_sellist-value = <hf>. IF <hf> EQ
space. dpl_sellist-initial = 'X'. ENDIF. CLEAR dpl_sellist-converted.
MODIFY <h_sellist> FROM dpl_sellist. ENDIF. ENDLOOP. ENDIF. h_flag =
<xact>. PERFORM vim_modify_view_entry USING sy-tabix ee_rc. CLEAR
vim_extcopy_mode. DELETE extract. IF ee_rc EQ 0. IF h_flag EQ
neuer_eintrag. ADD 1 TO vee_results-nbr_of_ins. ELSE. ADD 1 TO
vee_results-nbr_of_upd. ENDIF. ELSE. IF h_flag EQ neuer_eintrag.
vee_results-rc_ins = ee_rc. ELSE. vee_results-rc_upd = ee_rc. ENDIF.
ENDIF. ELSEIF <xact> CO del_flags. PERFORM vim_mark_and_process USING
sy-tabix 'DELE' vee_results-nbr_of_del vee_results-rc_del. ee_rc =
vee_results-rc_del. ELSEIF <xact> EQ task_add. PERFORM
vim_mark_and_process USING sy-tabix 'TRIN' vee_results-nbr_of_tin
vee_results-rc_tin. ee_rc = vee_results-rc_tin. ELSEIF <xact> EQ
task_del. PERFORM vim_mark_and_process USING sy-tabix 'TREX'
vee_results-nbr_of_tex vee_results-rc_tex. ee_rc = vee_results-rc_tex.
ENDIF. IF ee_rc EQ 8. EXIT. ENDIF. IF <status>-bcfixdelinfosent EQ 'X'.
<status>-bcfixdelinfosent = 'Y'. ENDIF. ENDLOOP. clear
<status>-bcfixdelinfosent. vim_results_of_ext_mod = vee_results.
replace_mode = repmode_safe. vim_special_mode = specmode_safe.
vim_external_mode = extmode_safe. ENDFORM. FORM VIM_MARK_AND_PROCESS
USING VALUE(VMAP_EXIX) TYPE I VALUE(VMAP_OKCODE) LIKE OK_CODE VMAP_NBR
TYPE I VMAP_RC TYPE I. DATA: VMAP_I_RC TYPE I. READ TABLE TOTAL WITH
KEY <VIM_xEXTRACT_KEY> BINARY SEARCH. <MARK> = MARKIERT. ADD 1 TO
MARK_TOTAL. MODIFY TOTAL INDEX SY-TABIX. <XACT> = <ACTION>. <XMARK> =
MARKIERT. ADD 1 TO MARK_EXTRACT. MODIFY EXTRACT. PERFORM
VIM_PROCESS_VIEW_ENTRY USING VMAP_EXIX VMAP_OKCODE VMAP_I_RC. IF
VMAP_I_RC EQ 0. ADD 1 TO VMAP_NBR. ELSE. VMAP_RC = VMAP_I_RC. ENDIF.
ENDFORM. FORM check_dynamic_select_options. DATA: total_ix TYPE i VALUE
'2', flag. DATA: cdso_sellist LIKE vimsellist OCCURS 10,
oc_to_be_checked TYPE xfeld, keyvalues TYPE occheckkeyflds, activity
TYPE xuval. FIELD-SYMBOLS: <vim_tot_txt_struc_loc> TYPE ANY. IF
x_header-delmdtflag NE space. PERFORM build_mainkey_tab_0. ENDIF. IF
x_header-subsetflag NE space. MOVE 'R' TO <status>-sbsid_rcvd. LOOP AT
dba_sellist WHERE ddic CO vim_subset_marks AND value EQ space AND
initial EQ space. CLEAR <status>-sbsid_rcvd. EXIT. ENDLOOP. ENDIF. READ
TABLE total INDEX 1. IF sy-subrc NE 0. EXIT. ENDIF. IF NOT vim_oc_inst
IS INITIAL. CALL METHOD vim_oc_inst->get_to_be_checked IMPORTING
to_be_checked = oc_to_be_checked. IF oc_to_be_checked <> space. IF
<status>-st_action = anzeigen. activity = svorg_read. ELSE. activity =
svorg_maint. ENDIF. LOOP AT total. CALL METHOD
vim_oc_inst->build_key_value_tab EXPORTING entry = total IMPORTING
keyvalues = keyvalues. CALL METHOD vim_oc_inst->check_oc_authority
EXPORTING activity = activity CHANGING key_values = keyvalues
EXCEPTIONS no_auth = 1 key_incomplete = 2 OTHERS = 4. IF sy-subrc = 1.
DELETE total. ENDIF. ENDLOOP. ENDIF. ENDIF. LOOP AT dba_sellist. IF
dba_sellist-ddic CO ddic_marks. READ TABLE x_namtab INDEX
dba_sellist-tabix. IF x_namtab-texttabfld NE space OR x_header-bastab
EQ space AND x_namtab-bastabname NE x_header-roottab. CLEAR
dba_sellist-ddic. ENDIF. ENDIF. APPEND dba_sellist TO cdso_sellist.
ENDLOOP. IF x_header-bastab <> space AND x_header-texttbexst <> space.
ASSIGN <vim_tot_txt_struc> TO <vim_tot_txt_struc_loc>. ELSE. ASSIGN
<vim_total_struc> TO <vim_tot_txt_struc_loc>. ENDIF. CALL FUNCTION
'TABLE_RANGE_CHECK' EXPORTING tabname = x_header-maintview entry =
total entry_text = <vim_tot_txt_struc_loc> ddic = 'N' key = 'N'
ignore_blank_subsetfields = 'J' TABLES x_namtab = x_namtab x_header =
x_header sellist = cdso_sellist EXCEPTIONS entry_not_fits = 1
no_value_for_subset_ident = 2. CASE sy-subrc. WHEN 0. IF
x_header-delmdtflag NE space. PERFORM build_mainkey_tab_1. flag = 'X'.
ENDIF. WHEN 1. DELETE total INDEX 1. SUBTRACT 1 FROM total_ix. WHEN 2.
CLEAR <status>-sbsid_rcvd. ENDCASE. LOOP AT total FROM total_ix. CALL
FUNCTION 'TABLE_RANGE_CHECK' EXPORTING tabname = x_header-maintview
entry = total entry_text = <vim_tot_txt_struc_loc> ddic = 'N' key = 'N'
ignore_blank_subsetfields = 'J' TABLES x_namtab = x_namtab x_header =
x_header sellist = cdso_sellist EXCEPTIONS entry_not_fits = 1
no_value_for_subset_ident = 2. CASE sy-subrc. WHEN 0. IF
x_header-delmdtflag NE space. PERFORM build_mainkey_tab_1. flag = 'X'.
ENDIF. WHEN 1. DELETE total. WHEN 2. CLEAR <status>-sbsid_rcvd.
ENDCASE. ENDLOOP. IF flag NE space. PERFORM build_mainkey_tab_2. ENDIF.
ENDFORM. FORM modify_tables USING value(tab_index). CLEAR
<status>-upd_flag. IF <xmark> EQ markiert. SUBTRACT: 1 FROM
<status>-mk_xt, 1 FROM <status>-mk_to. ENDIF. READ TABLE total WITH KEY
<vim_xextract_key> BINARY SEARCH. MOVE <table1> TO <vim_extract_struc>.
IF x_header-bastab NE space AND x_header-texttbexst NE space. MOVE:
<table1_xtext> TO <vim_xextract_text>, original TO <xact_text>. ENDIF.
<xmark> = nicht_markiert. <xact> = original. IF tab_index NE 0. MODIFY
extract INDEX tab_index. ENDIF. total = extract. MODIFY total INDEX
sy-tabix. IF x_header-frm_on_org NE space. PERFORM
(x_header-frm_on_org) IN PROGRAM (sy-repid). ENDIF. ENDFORM. FORM
init_subset_keyfields. DATA: all_flds_blank TYPE c VALUE 'X',
state_init TYPE c. FIELD-SYMBOLS: <key> type x. ASSIGN
<initial_x>(x_header-keylen) TO <key>. clear <table1_wa>. MOVE <key> TO
<f1_wax>. IF <status>-sbsid_rcvd NE space. CALL FUNCTION
'VIEW_INIT_SUBST_KEYFLDS' EXPORTING visk_tabname = x_header-maintview
workarea_in = <initial> IMPORTING workarea_out = <initial>
all_fields_blank = all_flds_blank state_init_necessary = state_init
TABLES sellist = dba_sellist x_namtab = x_namtab. ELSE. CALL FUNCTION
'VIEW_INIT_SUBST_KEYFLDS' EXPORTING visk_tabname = x_header-maintview
workarea_in = <initial> IMPORTING workarea_out = <initial>
all_fields_blank = all_flds_blank state_init_necessary = state_init
TABLES sellist = dpl_sellist x_namtab = x_namtab. IF all_flds_blank NE
space. RAISE no_value_for_subset_ident. ENDIF. IF <key> NE <f1_wax>.
MOVE 'X' TO state_init. ELSE. LOOP AT x_namtab where keyflag <> SPACE
AND readonly = subset AND position >= x_header-keylen. MOVE 'X' TO
state_init. EXIT. ENDLOOP. ENDIF. IF state_init NE space. CLEAR:
<status>-maxlines, <status>-cur_field, <status>-cur_offset. MOVE: 1 TO
<status>-cur_line, 1 TO <status>-firstline, maint_mode TO
<status>-st_action, nicht_geloescht TO <status>-st_delete, list_bild TO
<status>-st_mode. PERFORM set_status_nokeyselcnds. ELSE. LOOP AT
dpl_sellist TRANSPORTING NO FIELDS WHERE ddic EQ space OR ( operator EQ
'GE' OR operator EQ 'GT' OR operator EQ 'LE' OR operator EQ 'LT' ).
EXIT. ENDLOOP. IF sy-subrc <> 0 and <status>-maxlines <> 0.
<status>-selcd_rcvd = 'X'. ENDIF. ENDIF. ENDIF. ENDFORM. FORM
init_subset_fctfields USING value(formname) value(progname). DATA:
alr_read TYPE c. LOOP AT x_namtab WHERE readonly EQ subset AND keyflag
EQ space. ASSIGN component x_namtab-viewfield of structure <initial> TO
<subsetfield>. ASSIGN component x_namtab-viewfield of structure
<table1> TO <value>. IF alr_read EQ space. MOVE <initial> TO <table1>.
IF x_header-clidep NE space. MOVE sy-mandt TO <client>. ENDIF. IF
x_header-frm_rp_cpl NE space. PERFORM (x_header-frm_rp_cpl) IN PROGRAM
(sy-repid). ELSEIF formname NE compl_formname OR progname NE sy-repid.
PERFORM (formname) IN PROGRAM (progname) USING <table1>. ELSEIF
maxlines EQ 0. PERFORM (compl_formname) IN PROGRAM (sy-repid) USING
<table1> IF FOUND. ELSE. READ TABLE extract INDEX 1. MOVE
<vim_extract_struc> TO <table1>. ENDIF. IF vim_called_by_cluster NE
space. CALL FUNCTION 'VIEWCLUSTER_COMPL_SUBSET_VALUE' EXPORTING
view_name = x_header-viewname CHANGING workarea = <table1>. ENDIF. MOVE
'X' TO alr_read. ENDIF. MOVE <value> TO <subsetfield>. ENDLOOP. IF
sy-subrc NE 0 AND maxlines EQ 0. MOVE <initial> TO <table1>. ENDIF.
ENDFORM. FORM FILL_SUBSETFIELDS. DATA: progname LIKE sy-repid. IF
<STATUS>-SBSID_RCVD CO ' R'. progname = sy-repid. PERFORM
INIT_SUBSET_FCTFIELDS USING COMPL_FORMNAME progname. TRANSLATE
<STATUS>-SBSID_RCVD USING ' XRS'. ELSE. IF MAXLINES EQ 0 OR
VIM_CALLED_BY_CLUSTER NE SPACE. MOVE <INITIAL> TO <TABLE1>. ENDIF.
ENDIF. ENDFORM. FORM COMPLETE_EXPROFIELDS. IF X_HEADER-FRM_RP_CPL NE
SPACE. PERFORM (X_HEADER-FRM_RP_CPL) IN PROGRAM. ELSE. PERFORM
(COMPL_FORMNAME) IN PROGRAM (SY-REPID) USING <TABLE1> IF FOUND. ENDIF.
IF VIM_CALLED_BY_CLUSTER NE SPACE. CALL FUNCTION
'VIEWCLUSTER_COMPL_SUBSET_VALUE' EXPORTING VIEW_NAME =
X_HEADER-VIEWNAME CHANGING WORKAREA = <TABLE1>. ENDIF. ENDFORM. FORM
complete_subsetfields. FIELD-SYMBOLS: <namtab> TYPE vimnamtab. LOOP AT
x_namtab ASSIGNING <namtab> WHERE readonly EQ subset AND keyflag EQ
space. ASSIGN: COMPONENT <namtab>-viewfield OF STRUCTURE <initial> TO
<value>, COMPONENT <namtab>-viewfield OF STRUCTURE <table1> TO
<subsetfield>. MOVE <value> TO <subsetfield>. ENDLOOP. ENDFORM. FORM
X_ENQUEUE TABLES XE_SELLIST STRUCTURE VIMSELLIST USING VALUE(XE_NAME)
VALUE(XE_ACT) VALUE(EXIT_FORM) VALUE(XE_ENQRNG). DATA: VIEWNAME_SAFE
LIKE VIMDESC-VIEWNAME, ENQ_RANGE_SAFE(1) TYPE C. VIEWNAME_SAFE =
VIM_VIEW_NAME. ENQ_RANGE_SAFE = VIM_ENQUEUE_RANGE. VIM_VIEW_NAME =
XE_NAME. VIM_ENQUEUE_RANGE = XE_ENQRNG. ASSIGN XE_SELLIST-*SYS* TO
<VIM_SELLIST>. PERFORM ENQUEUE USING XE_ACT EXIT_FORM. VIM_VIEW_NAME =
VIEWNAME_SAFE. VIM_ENQUEUE_RANGE = ENQ_RANGE_SAFE. ENDFORM. FORM
enqueue USING value(e_act) value(exit_form). CALL FUNCTION
'VIEW_ENQUEUE' EXPORTING view_name = vim_view_name action = e_act
enqueue_mode = 'E' enqueue_range = vim_enqueue_range TABLES sellist =
<vim_sellist> EXCEPTIONS foreign_lock = 1 system_failure = 2
table_not_found = 5 client_reference = 7. DATA: rc LIKE sy-subrc. CASE
sy-subrc. WHEN 1. MESSAGE i049(sv) WITH sy-msgv1. sy-subrc = 1. WHEN 2.
MESSAGE a050(sv) WITH view_name. WHEN 3. MESSAGE a037(sv) WITH
view_name. WHEN 5. MESSAGE a028(sv) WITH view_name. WHEN 7. MESSAGE
w054(sv) WITH sy-mandt. sy-subrc = 7. ENDCASE. rc = sy-subrc. IF
exit_form NE space. PERFORM (exit_form) IN PROGRAM (sy-repid). ENDIF.
IF e_act EQ 'E'. IF sy-subrc <> 0. vim_enq_s_u_rc = sy-subrc. ELSEIF rc
<> 0. vim_enq_s_u_rc = rc. ELSE. vim_enq_s_u_rc = 0. ENDIF. ENDIF.
ENDFORM. FORM LISTE_ADDRESS_MAINTAIN. IF X_HEADER-ADRNBRFLAG EQ SPACE.
MESSAGE E001(SV). EXIT. ENDIF. LOOP AT EXTRACT. CHECK <XMARK> EQ
MARKIERT. MOVE SY-TABIX TO EXIND. PERFORM MOVE_EXTRACT_TO_VIEW_WA.
PERFORM ADDRESS_MAINTAIN. PERFORM UPDATE_TAB. ENDLOOP. ENDFORM. FORM
address_maintain. DATA: mode, return TYPE i, kz, answer, am_save(1)
TYPE c, am_pos LIKE sy-fdpos, am_length LIKE sy-fdpos, func_name TYPE
rs38l_fnam. DATA: am_handletab LIKE addr1_dia OCCURS 1 WITH HEADER
LINE, am_sel LIKE addr1_sel, am_address LIKE addr1_val, am_ucomm LIKE
sy-ucomm, am_title LIKE sy-title. DATA: keytab TYPE TABLE OF
vimty_textfield, keytab_wa TYPE vimty_textfield, am_key TYPE
vimty_max_textline. FIELD-SYMBOLS: <am_title> TYPE c, <am_key> TYPE c,
<am_handle_x> TYPE x, <namtab> TYPE vimnamtab, <keyfld> TYPE ANY. IF
x_header-adrnbrflag EQ space. MESSAGE e001(sv). EXIT. ENDIF. IF
status-action NE anzeigen AND status-action NE transportieren AND
adrnbr_roflag EQ space. MOVE svim_text_012 TO am_title. ELSE. MOVE
svim_text_017 TO am_title. ENDIF. am_pos = strlen( am_title ).
am_length = 70 - am_pos. ASSIGN am_title+am_pos(am_length) TO
<am_title>. MOVE ':' TO <am_title>. ADD 2 TO am_pos. SUBTRACT 2 FROM
am_length. ASSIGN am_title+am_pos(am_length) TO <am_title>. CLEAR
am_pos. PERFORM vim_external_repr_for_key TABLES keytab USING <f1_x>.
LOOP AT keytab INTO keytab_wa. CONCATENATE am_key keytab_wa-text INTO
am_key SEPARATED BY space. am_pos = am_pos + keytab_wa-outplen + 1. IF
am_pos > am_length. EXIT. ENDIF. ENDLOOP. IF sy-subrc = 0. ASSIGN
am_key(am_pos) TO <am_key>. MOVE <am_key> TO <am_title>. ENDIF. ASSIGN
am_handletab-handle TO <am_handle_x> CASTING. IF x_header-adrnbrflag EQ
'O'. IF <address_number> NE space. SELECT adrnr FROM sadr INTO
sadr-adrnr WHERE adrnr EQ <address_number>. EXIT. ENDSELECT. IF
sy-subrc NE 0. CALL FUNCTION 'ADDR_CONVERT_ADRC_TO_SADR' CHANGING
address_number = <address_number>. ENDIF. ENDIF. MOVE <address_number>
TO sadr-adrnr. kz = space. IF status-action NE anzeigen AND
status-action NE transportieren AND adrnbr_roflag EQ space. IF
<address_number> EQ space. mode = 'A'. ELSE. mode = 'M'. ENDIF. IF
status-action EQ kopieren. IF <address_number> NE space. SELECT * FROM
sadr WHERE adrnr EQ <address_number>. kz = 'X'. EXIT. ENDSELECT. ELSE.
CLEAR sadr. ENDIF. CLEAR <address_number>. mode = 'A'. ENDIF. ELSE.
mode = 'D'. ENDIF. func_name = 'ADDRESS_MAINTAIN'. DO. CALL FUNCTION
func_name EXPORTING adrswa_in = sadr processing_status = mode
kennzeichen = kz save_intern = 'X' title = am_title IMPORTING
adrswa_out = sadr returncode = return update_flag = am_save EXCEPTIONS
not_found = 4. IF sy-subrc NE 0. IF status-action NE anzeigen AND
status-action NE transportieren AND adrnbr_roflag EQ space. CALL
FUNCTION 'POPUP_TO_CONFIRM_WITH_MESSAGE' EXPORTING diagnosetext1 =
svim_text_013 diagnosetext2 = <am_key> diagnosetext3 = svim_text_014
textline1 = svim_text_015 titel = svim_text_016 IMPORTING answer =
answer. IF answer EQ 'J'. mode = 'A'. ELSE. return = 4. EXIT. ENDIF.
ELSE. MESSAGE i055(sv) WITH <am_key>. return = 4. EXIT. ENDIF. ELSE.
EXIT. ENDIF. ENDDO. IF status-action NE anzeigen AND status-action NE
transportieren AND adrnbr_roflag EQ space. IF return NE 4 AND
sadr-adrnr NE <address_number> OR am_save NE space. MOVE: 'X' TO
<status>-upd_flag, sadr-adrnr TO <address_number>. ENDIF. ENDIF. CLEAR
am_ucomm. ELSE. IF status-action NE anzeigen AND status-action NE
transportieren AND adrnbr_roflag EQ space. IF status-action EQ
kopieren. IF <address_number> NE space. IF <address_number> NP '@NEW*'.
am_sel-addrnumber = <address_number>. ELSE. am_sel-addrhandle = <f1_x>.
ENDIF. CALL FUNCTION 'ADDR_GET' EXPORTING address_selection = am_sel
IMPORTING address_value = am_address EXCEPTIONS parameter_error = 1
address_not_exist = 2 version_not_exist = 3 internal_error = 4. IF
sy-subrc EQ 0. MOVE-CORRESPONDING am_address TO am_handletab. ENDIF.
ENDIF. CLEAR <address_number>. am_handletab-maint_mode = 'CREATE'.
ELSE. IF <address_number> EQ space. am_handletab-maint_mode = 'CREATE'.
ELSE. am_handletab-maint_mode = 'CHANGE'. ENDIF. ENDIF. ELSE. IF
<address_number> IS INITIAL. MESSAGE i055(sv) WITH <am_key>. EXIT.
ENDIF. am_handletab-maint_mode = 'DISPLAY'. ENDIF. IF
am_handletab-maint_mode EQ 'CREATE' OR <address_number> CP '@NEW*'.
<am_handle_x>(x_header-keylen) = <f1_x>. ELSE. CLEAR
am_handletab-handle. ENDIF. IF <address_number> NP '@NEW*'.
am_handletab-addrnumber = <address_number>. ELSE. CLEAR
am_handletab-addrnumber. ENDIF. am_handletab-addr_group =
vim_addr_group. APPEND am_handletab. CLEAR: vim_addr_field_selection,
vim_addr_keywords, vim_addr_chng_deflt_comm_types, vim_addr_frame_text,
vim_addr_excluded_functions. REFRESH vim_addr_excluded_functions.
vim_addr_titlebar = am_title. CLEAR vim_skip_adr_maint. IF
x_header-frm_bf_adr NE space. PERFORM (x_header-frm_bf_adr) IN PROGRAM.
ENDIF. CHECK vim_skip_adr_maint IS INITIAL. CALL FUNCTION
'ADDR_DIALOG_PREPARE' EXPORTING field_selection =
vim_addr_field_selection keywords = vim_addr_keywords titlebar =
vim_addr_titlebar change_default_comm_types =
vim_addr_chng_deflt_comm_types frame_text = vim_addr_frame_text TABLES
excluded_functions = vim_addr_excluded_functions EXCEPTIONS
internal_error = 1 OTHERS = 2. IF am_handletab-maint_mode EQ 'CHANGE'
AND am_handletab-addrnumber NE space. READ TABLE vim_locked_addresses
FROM am_handletab-addrnumber TRANSPORTING NO FIELDS. IF sy-subrc NE 0.
CALL FUNCTION 'ADDR_ENQUEUE' EXPORTING address_number =
am_handletab-addrnumber EXCEPTIONS address_not_exist = 1 foreign_lock =
2 system_failure = 3 internal_error = 4. CASE sy-subrc. WHEN 0. INSERT
am_handletab-addrnumber INTO TABLE vim_locked_addresses. WHEN 1. IF
status-action NE anzeigen AND status-action NE transportieren AND
adrnbr_roflag EQ space. CALL FUNCTION 'POPUP_TO_CONFIRM_WITH_MESSAGE'
EXPORTING diagnosetext1 = svim_text_013 diagnosetext2 = <am_key>
diagnosetext3 = svim_text_014 textline1 = svim_text_015 titel =
svim_text_016 IMPORTING answer = answer. IF answer EQ 'J'.
am_handletab-maint_mode = 'CREATE'. IF <address_number> NP '@NEW*'.
<am_handle_x>(x_header-keylen) = <f1_x>. CLEAR am_handletab-addrnumber.
ENDIF. MODIFY am_handletab INDEX 1. ELSE. EXIT. ENDIF. ELSE. MESSAGE
i055(sv) WITH <am_key>. EXIT. ENDIF. WHEN 2. MESSAGE i049(sv) WITH
sy-msgv1. am_handletab-maint_mode = 'DISPLAY'. WHEN OTHERS. MESSAGE
i050(sv) WITH <am_key>. am_handletab-maint_mode = 'DISPLAY'. ENDCASE.
ENDIF. ENDIF. DO. CALL FUNCTION 'ADDR_DIALOG' IMPORTING ok_code =
am_ucomm TABLES number_handle_tab = am_handletab EXCEPTIONS
address_not_exist = 1 group_not_valid = 2 parameter_error = 3
internal_error = 4. CASE sy-subrc. WHEN 0. READ TABLE am_handletab
INDEX 1. EXIT. WHEN 1. IF status-action NE anzeigen AND status-action
NE transportieren AND adrnbr_roflag EQ space. CALL FUNCTION
'POPUP_TO_CONFIRM_WITH_MESSAGE' EXPORTING diagnosetext1 = svim_text_013
diagnosetext2 = <am_key> diagnosetext3 = svim_text_014 textline1 =
svim_text_015 titel = svim_text_016 IMPORTING answer = answer. IF
answer EQ 'J'. READ TABLE am_handletab INDEX 1. am_handletab-maint_mode
= 'CREATE'. IF <address_number> NP '@NEW*'.
<am_handle_x>(x_header-keylen) = <f1_x>. CLEAR am_handletab-addrnumber.
ENDIF. MODIFY am_handletab INDEX 1. ELSE. am_ucomm = 'CANC'. EXIT.
ENDIF. ELSE. MESSAGE i055(sv) WITH <am_key>. am_ucomm = 'CANC'. EXIT.
ENDIF. WHEN OTHERS. MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno WITH
sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. am_ucomm = 'CANC'. EXIT. ENDCASE.
ENDDO. IF am_handletab-maint_mode EQ 'CHANGE' AND
am_handletab-addrnumber NE space AND ( am_ucomm EQ 'CANC' OR
am_handletab-updateflag EQ space ). READ TABLE vim_locked_addresses
FROM am_handletab-addrnumber TRANSPORTING NO FIELDS. IF sy-subrc EQ 0.
CALL FUNCTION 'ADDR_DEQUEUE' EXPORTING address_number =
am_handletab-addrnumber EXCEPTIONS address_not_exist = 1 internal_error
= 2. ENDIF. ENDIF. IF status-action NE anzeigen AND status-action NE
transportieren AND adrnbr_roflag EQ space. IF am_ucomm NE 'CANC'. IF
am_handletab-maint_mode EQ 'CREATE'. <address_number> = '@NEW'.
<address_number>+4(6) = <status>-newadrcnt. ADD 1 TO
<status>-newadrcnt. <status>-upd_flag = 'X'. ENDIF. IF
am_handletab-updateflag NE space. READ TABLE vim_addresses_to_save WITH
KEY viewname = x_header-viewname addrnumber = <address_number> BINARY
SEARCH TRANSPORTING NO FIELDS. IF sy-subrc NE 0.
vim_addresses_to_save-addrnumber = <address_number>. CLEAR
vim_addresses_to_save-handle. <vim_addr_handle_x>(x_header-keylen) =
<f1_x>. INSERT vim_addresses_to_save INDEX sy-tabix. ENDIF. IF
vim_client_state EQ vim_log AND x_header-flag NE vim_transport_denied.
<status>-upd_flag = 'X'. ENDIF. ENDIF. ENDIF. ENDIF. CLEAR return.
ENDIF. IF status-action NE kopieren AND status-action NE hinzufuegen
AND vim_single_entry_function NE 'INS'. IF return NE 4 AND am_ucomm NE
'CANC'. IF <xmark> EQ markiert. <xmark> = nicht_markiert. IF
<status>-upd_flag EQ space. MODIFY extract INDEX exind. READ TABLE
total WITH KEY <vim_xextract_key> BINARY SEARCH. <mark> =
nicht_markiert. MODIFY total INDEX sy-tabix. ENDIF. SUBTRACT: 1 FROM
mark_extract, 1 FROM mark_total. ENDIF. ENDIF. CLEAR function. ENDIF.
ENDFORM. FORM original_holen. DATA: count1 TYPE i, count2 TYPE i,
count3 TYPE i, sum TYPE i, texttab_mod(1) TYPE c. IF status-action NE
aendern OR status-delete EQ geloescht. MESSAGE i001(sv). EXIT. ENDIF.
IF status-mode EQ list_bild. LOOP AT extract. CLEAR texttab_mod. CHECK
<xmark> EQ markiert. ADD 1 TO count1. IF x_header-texttbexst <> space.
PERFORM vim_texttab_modif_for_key CHANGING texttab_mod. ENDIF. IF
x_header-bastab NE space AND x_header-texttbexst NE space. CHECK <xact>
EQ neuer_eintrag OR ( <xact> EQ original AND <xact_text> EQ original
AND texttab_mod EQ space ). ELSE. CHECK <xact> EQ neuer_eintrag OR (
<xact> EQ original AND texttab_mod EQ space ). ENDIF. IF <xact> EQ
neuer_eintrag. ADD 1 TO count2. ELSE. ADD 1 TO count3. ENDIF. ENDLOOP.
ELSE. ADD 1 TO count1. CASE <xact>. WHEN neuer_eintrag. ADD 1 TO
count2. WHEN original. CLEAR texttab_mod. IF x_header-texttbexst <>
space. PERFORM vim_texttab_modif_for_key CHANGING texttab_mod. ENDIF.
IF x_header-bastab NE space AND x_header-texttbexst NE space. IF
sy-datar EQ space AND <table1> EQ <vim_extract_struc> AND
<table1_xtext> EQ <vim_xextract_text> AND texttab_mod EQ space. ADD 1
TO count3. ENDIF. ELSE. IF sy-datar EQ space AND <table1> EQ
<vim_extract_struc> AND texttab_mod EQ space. ADD 1 TO count3. ENDIF.
ENDIF. ENDCASE. ENDIF. sum = count2 + count3. IF count1 EQ 0. MESSAGE
s056(sv). ELSEIF count1 EQ count2. IF count1 EQ 1. MESSAGE s057(sv). IF
status-mode EQ detail_bild. CLEAR function. ENDIF. ELSE. MESSAGE
s058(sv). ENDIF. ELSEIF count1 EQ count3. IF count1 EQ 1. MESSAGE
s059(sv). ELSE. MESSAGE s060(sv). ENDIF. ELSEIF count1 EQ sum. MESSAGE
s061(sv) WITH count3 count2. ELSE. CALL FUNCTION
'POPUP_TO_CONFIRM_STEP' EXPORTING titel = svim_text_010 textline1 =
svim_text_009 textline2 = svim_text_011 IMPORTING answer = answer. IF
answer EQ 'J'. IF status-mode EQ list_bild. function = 'ORGL'. ELSE. IF
<xact> NE original OR texttab_mod NE space. function = 'ORGD'. ELSE.
answer = 'N'. ENDIF. ENDIF. IF answer = 'J'. vim_next_screen = 0.
vim_leave_screen = 'X'. ENDIF. ELSE. CLEAR function. ENDIF. ENDIF.
ENDFORM. FORM ORDER_ADMINISTRATION. DATA: RC LIKE SY-SUBRC. IF
STATUS-ACTION EQ ANZEIGEN AND VIM_CORR_OBJ_VIEWNAME NE
X_HEADER-VIEWNAME. CLEAR E071-TRKORR. PERFORM GET_TRANSP_INFO.
VIM_CORR_OBJ_VIEWNAME = X_HEADER-VIEWNAME. ENDIF. IF X_HEADER-FLAG EQ
VIM_TRANSPORT_DENIED. MESSAGE S001(SV). EXIT. ENDIF. DO. CALL FUNCTION
'TR_TASK_OVERVIEW' EXPORTING IV_USERNAME = SY-UNAME IV_CATEGORY =
OBJH-OBJCATEG IV_CLIENT = SY-MANDT EXCEPTIONS INVALID_CATEGORY = 01
OTHERS = 02. RC = SY-SUBRC. IF SY-SUBRC EQ 1 AND OBJH-OBJCATEG EQ
VIM_CUST_SYST OR OBJH-OBJCATEG EQ VIM_APPL. OBJH-OBJCATEG = VIM_SYST.
CONTINUE. ENDIF. EXIT. ENDDO. IF RC NE 0. MESSAGE ID SY-MSGID TYPE 'I'
NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF. CLEAR
FUNCTION. ENDFORM. FORM get_transp_info. LOCAL: e071. DATA: obj_type
LIKE objh-objecttype, last_category LIKE objh-objcateg, last_clidep
LIKE objh-clidep VALUE 'X', gti_e071 LIKE e071, last_protect LIKE
objh-protect, gti_cliindep_state(1) TYPE c, gti_x030l LIKE x030l,
gti_tabname TYPE tabname, gti_client_role LIKE t000-cccategory,
gti_flag_safe(1) TYPE c, cursetting TYPE cursetting, addr_e071k LIKE
e071k, importable TYPE objimp value '4', tr_result LIKE
trpari-s_checked, addr_e071k2 LIKE e071k. gti_flag_safe =
x_header-flag. IF x_header-customauth CO no_transport_classes.
x_header-flag = vim_transport_denied. CLEAR: x_header-frm_e071,
x_header-frm_e071ks, x_header-frm_e071ka. IF maint_mode EQ aendern.
MOVE 'TRSP' TO excl_cua_funct-function. COLLECT excl_cua_funct. ELSEIF
maint_mode EQ transportieren. MESSAGE i128(sv) WITH
x_header-customauth. RAISE missing_corr_number. ENDIF. MOVE 'ORDR' TO
excl_cua_funct-function. COLLECT excl_cua_funct. sy-subrc = 9. ELSEIF
x_header-customauth CO no_transport_log_classes. IF x_header-frm_e071
EQ space AND x_header-frm_e071ks EQ space AND x_header-frm_e071ka EQ
space. x_header-flag = vim_transport_denied. IF maint_mode EQ aendern.
MOVE 'TRSP' TO excl_cua_funct-function. COLLECT excl_cua_funct. ELSEIF
maint_mode EQ transportieren. MESSAGE i128(sv) WITH
x_header-customauth. RAISE missing_corr_number. ENDIF. MOVE 'ORDR' TO
excl_cua_funct-function. COLLECT excl_cua_funct. ELSE. x_header-flag =
'X'. ENDIF. sy-subrc = 9. ENDIF. IF sy-subrc EQ 9. MODIFY x_header
INDEX 1. ENDIF. CALL FUNCTION 'VIEW_GET_CLIENT_STATE' IMPORTING
transp_state = vim_client_state cliindep_state = gti_cliindep_state
client_state = gti_client_role. IF x_header-clidep NE space AND
x_header-customauth CN sap_only_classes. CASE vim_client_state. WHEN
vim_local_clnt. IF maint_mode EQ aendern OR maint_mode EQ anzeigen.
excl_cua_funct-function = 'TRSP'. COLLECT excl_cua_funct.
excl_cua_funct-function = 'ORDR'. COLLECT excl_cua_funct. x_header-flag
= vim_transport_denied. ELSE. MESSAGE i130(sv) WITH sy-mandt. RAISE
missing_corr_number. ENDIF. WHEN vim_locked. ENDCASE. ELSE.
vim_client_state = vim_log. ENDIF. REFRESH vim_corr_objtab. gti_e071 =
e071. IF x_header-frm_e071 NE space. PERFORM (x_header-frm_e071) IN
PROGRAM (sy-repid). ENDIF. IF gti_flag_safe EQ space. APPEND gti_e071
TO vim_corr_objtab. IF x_header-adrnbrflag EQ 'N'. REFRESH:
vim_addr_e071k_tab, vim_addr_e071_tab. CALL FUNCTION
'ADDR_TRANSPORT_TDAT_ENTRIES' TABLES e071k_tab = vim_addr_e071k_tab.
addr_e071k2 = e071k. LOOP AT vim_addr_e071k_tab INTO addr_e071k.
gti_e071-object = addr_e071k2-mastertype = addr_e071k-mastertype.
gti_e071-obj_name = addr_e071k2-mastername = addr_e071k-mastername.
APPEND gti_e071 TO vim_addr_e071_tab. APPEND gti_e071 TO
vim_corr_objtab. MODIFY vim_addr_e071k_tab FROM addr_e071k2. ENDLOOP.
ENDIF. ELSEIF x_header-frm_e071 EQ space AND x_header-frm_e071ks EQ
space AND x_header-frm_e071ka EQ space. APPEND gti_e071 TO
vim_corr_objtab. x_header-flag = vim_transport_denied. MODIFY x_header
INDEX 1. IF maint_mode EQ aendern. MOVE 'TRSP' TO
excl_cua_funct-function. COLLECT excl_cua_funct. ENDIF. MOVE 'ORDR' TO
excl_cua_funct-function. COLLECT excl_cua_funct. gti_flag_safe = '@'.
ENDIF. LOOP AT vim_corr_objtab. CASE vim_corr_objtab-object. WHEN
vim_view_type. obj_type = vim_view. WHEN transp_object. obj_type =
vim_tabl. WHEN vim_tran_type. obj_type = vim_tran. WHEN vim_clus_type.
obj_type = vim_clst. WHEN OTHERS. obj_type = vim_logo. ENDCASE. IF
obj_type NE vim_logo. SELECT SINGLE * FROM objh WHERE objectname EQ
vim_corr_objtab-obj_name AND objecttype EQ obj_type. ELSE. SELECT
SINGLE * FROM objh WHERE objectname EQ vim_corr_objtab-object AND
objecttype EQ obj_type. ENDIF. IF sy-subrc NE 0. IF obj_type NE
vim_logo. IF x_header-viewname EQ vim_corr_objtab-obj_name AND (
x_header-bastab EQ space AND vim_corr_objtab-object EQ vim_view_type OR
x_header-bastab NE space AND vim_corr_objtab-object EQ transp_object )
OR vim_called_by_cluster NE space AND vim_calling_cluster EQ
vim_corr_objtab-obj_name AND vim_corr_objtab-object EQ vim_clus_type.
IF x_header-clidep EQ space. IF x_header-customauth CO
customizing_delivery_classes. objh-objcateg = vim_cust_syst. ELSEIF
x_header-customauth CO sap_only_classes. objh-objcateg = vim_syst.
ELSEIF x_header-customauth CO application_delivery_classes.
objh-objcateg = vim_appl. ELSE. objh-objcateg = vim_syst. ENDIF. ELSE.
IF x_header-customauth CO customizing_delivery_classes. objh-objcateg =
vim_cust. ELSEIF x_header-customauth CO sap_only_classes. objh-objcateg
= vim_cust_syst. ELSEIF x_header-customauth CO
application_delivery_classes. objh-objcateg = vim_appl. ELSE.
objh-objcateg = vim_syst. ENDIF. ENDIF. objh-clidep = x_header-clidep.
ELSE. IF vim_corr_objtab-object EQ transp_object. gti_tabname =
vim_corr_objtab-obj_name. CALL FUNCTION 'DDIF_NAMETAB_GET' EXPORTING
tabname = gti_tabname IMPORTING x030l_wa = gti_x030l EXCEPTIONS
not_found = 1 OTHERS = 2. IF sy-subrc EQ 0 AND gti_x030l-flagbyte O
vim_clidep. objh-objcateg = vim_cust. objh-clidep = 'X'. ELSE.
objh-objcateg = vim_syst. objh-clidep = space. ENDIF. ELSE.
objh-objcateg = vim_syst. objh-clidep = space. ENDIF. ENDIF. ELSE.
objh-objcateg = vim_syst. objh-clidep = space. vim_corr_objtab-lockable
= 'X'. MODIFY vim_corr_objtab. ENDIF. ELSE. IF objh-cursetting <>
space. cursetting = objh-cursetting. ENDIF. IF objh-importable <> space
AND objh-importable < importable. importable = objh-importable. ENDIF.
IF objh-protect NE space. IF objh-objectname EQ x_header-viewname AND (
x_header-bastab EQ space AND objh-objecttype EQ vim_view OR
x_header-bastab NE space AND objh-objecttype EQ vim_tabl ). IF
x_header-frm_e071 EQ space AND x_header-frm_e071ks EQ space AND
x_header-frm_e071ka EQ space. x_header-flag = vim_transport_denied.
MOVE 'TRSP' TO excl_cua_funct-function. COLLECT excl_cua_funct. MOVE
'ORDR' TO excl_cua_funct-function. COLLECT excl_cua_funct. ELSE.
x_header-flag = 'X'. DELETE vim_corr_objtab. ENDIF. MODIFY x_header
INDEX 1. ENDIF. ENDIF. IF objh-checkid EQ 'L'. vim_corr_objtab-lockable
= 'X'. MODIFY vim_corr_objtab. ENDIF. ENDIF. IF ( objh-objcateg EQ
vim_syst OR objh-objcateg EQ vim_cust_syst ) AND last_category NE
vim_syst. last_category = objh-objcateg. ENDIF. IF objh-clidep EQ
space. last_clidep = objh-clidep. ENDIF. ENDLOOP. IF sy-subrc NE 0. IF
( x_header-frm_e071 NE space OR x_header-frm_e071ks EQ space AND
x_header-frm_e071ka EQ space ). x_header-flag = vim_transport_denied.
MODIFY x_header INDEX 1. IF maint_mode EQ aendern. MOVE 'TRSP' TO
excl_cua_funct-function. COLLECT excl_cua_funct. ENDIF. MOVE 'ORDR' TO
excl_cua_funct-function. COLLECT excl_cua_funct. ENDIF. EXIT. ELSEIF
gti_flag_safe EQ '@'. REFRESH vim_corr_objtab. ENDIF. IF objh-objcateg
NE vim_syst AND ( last_category EQ vim_syst OR last_category EQ
vim_cust_syst ). objh-objcateg = last_category. ENDIF. objh-clidep =
last_clidep. IF cursetting NE space. x_header-cursetting =
x_header-flag. TRANSLATE x_header-cursetting USING ' XXY'. MODIFY
x_header INDEX 1. ENDIF. IF importable <> 4. x_header-importable =
importable. MODIFY x_header INDEX 1. ENDIF. IF maint_mode EQ aendern
AND objh-clidep NE space AND cursetting NE space AND gti_client_role EQ
'P'. x_header-flag = vim_transport_denied. MODIFY x_header INDEX 1.
MOVE 'ORDR' TO excl_cua_funct-function. COLLECT excl_cua_funct. EXIT.
ENDIF. IF x_header-flag NE vim_transport_denied AND vim_client_state EQ
vim_locked AND ( objh-objcateg EQ vim_cust OR objh-objcateg EQ
vim_cust_syst ) AND maint_mode EQ aendern. MESSAGE i430(tk) WITH
sy-mandt. maint_mode = status-action = anzeigen. ASSIGN
dba_sellist-*sys* TO <vim_sellist>. vim_enqueue_range =
x_header-subsetflag. PERFORM enqueue USING 'D' space. EXIT. ENDIF. CASE
gti_cliindep_state. WHEN vim_noact. WHEN vim_nocliindep_cust. IF
maint_mode EQ aendern AND objh-objcateg = vim_cust_syst. CHECK
x_header-flag NE vim_transport_denied. MESSAGE i731(tk). maint_mode =
status-action = anzeigen. ASSIGN dba_sellist-*sys* TO <vim_sellist>.
vim_enqueue_range = x_header-subsetflag. PERFORM enqueue USING 'D'
space. vim_client_state = vim_noact. EXIT. ENDIF. WHEN
vim_noreposiandcust. IF maint_mode EQ aendern AND ( objh-objcateg =
vim_syst OR objh-objcateg = vim_cust_syst ). CHECK x_header-flag NE
vim_transport_denied. MESSAGE i730(tk). maint_mode = status-action =
anzeigen. ASSIGN dba_sellist-*sys* TO <vim_sellist>. vim_enqueue_range
= x_header-subsetflag. PERFORM enqueue USING 'D' space.
vim_client_state = vim_noact. EXIT. ENDIF. WHEN vim_noreposichanges.
LOOP AT vim_corr_objtab INTO e071. CALL FUNCTION 'TR_CHECK_TYPE'
EXPORTING wi_e071 = e071 IMPORTING pe_result = tr_result. IF 'TLP' CS
tr_result. MESSAGE i729(tk). IF x_header-flag NE vim_transport_denied.
maint_mode = status-action = anzeigen. ASSIGN dba_sellist-*sys* TO
<vim_sellist>. vim_enqueue_range = x_header-subsetflag. PERFORM enqueue
USING 'D' space. vim_client_state = vim_noact. ENDIF. EXIT. ENDIF.
ENDLOOP. ENDCASE. ENDFORM. FORM request_corr_number. DATA: rc LIKE
sy-subrc, e071_safe LIKE e071. CHECK maint_mode EQ transportieren. IF
<status>-l_corr_nbr NE space. IF <status>-corr_nbr NE
<status>-l_corr_nbr. CLEAR: <status>-tr_alrchkd, <status>-corr_enqud.
ELSE. IF vim_external_mode EQ space. TRANSLATE <status>-tr_alrchkd
USING 'Xx'. ENDIF. ENDIF. ENDIF. PERFORM vim_get_img_activity CHANGING
e071-activity. IF vim_corr_obj_viewname NE x_header-viewname. CLEAR
e071-trkorr. PERFORM get_transp_info. CHECK x_header-flag NE
vim_transport_denied. ENDIF. IF <status>-tr_alrchkd EQ space. e071_safe
= e071. CLEAR vim_last_source_system. LOOP AT vim_corr_objtab WHERE
lockable NE space. e071 = vim_corr_objtab. PERFORM
check_lockable_object USING e071 rc. CASE rc. WHEN 4. maint_mode =
anzeigen. WHEN 8. RAISE missing_corr_number. ENDCASE. IF maint_mode EQ
anzeigen OR x_header-flag EQ vim_transport_denied. EXIT. ENDIF.
ENDLOOP. e071 = e071_safe. ENDIF. CHECK maint_mode NE anzeigen AND
x_header-flag NE vim_transport_denied. vim_corr_obj_viewname =
x_header-viewname. IF <status>-corr_nbr NE space AND corr_nbr EQ space
AND <status>-corr_enqud EQ space. CALL FUNCTION 'ENQUEUE_E_TRKORR'
EXPORTING trkorr = <status>-corr_nbr EXCEPTIONS foreign_lock = 01
system_failure = 02. CASE sy-subrc. WHEN 1. MESSAGE s092(sv) WITH
<status>-corr_nbr. WHEN 2. MESSAGE a095(sv) WITH <status>-corr_nbr.
ENDCASE. <status>-corr_enqud = 'X'. ENDIF. DESCRIBE TABLE
vim_corr_objtab. IF <status>-corr_nbr EQ space AND sy-tfill GT 0. DO.
CALL FUNCTION 'TR_ORDER_CHOICE_CORRECTION' EXPORTING iv_category =
objh-objcateg iv_cli_dep = objh-clidep IMPORTING ev_order =
<status>-order_nbr ev_task = <status>-corr_nbr EXCEPTIONS
invalid_category = 01 no_correction_selected = 02. CASE sy-subrc. WHEN
1. IF objh-objcateg NE vim_syst AND objh-objcateg NE vim_cust. CASE
objh-objcateg. WHEN vim_cust_syst. objh-objcateg = vim_syst. WHEN
vim_appl. objh-objcateg = vim_syst. WHEN OTHERS. MESSAGE ID sy-msgid
TYPE 'I' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
RAISE missing_corr_number. ENDCASE. CONTINUE. ENDIF. WHEN 2. CLEAR
vim_corr_obj_viewname. RAISE missing_corr_number. ENDCASE. CALL
FUNCTION 'ENQUEUE_E_TRKORR' EXPORTING trkorr = <status>-corr_nbr
EXCEPTIONS foreign_lock = 01 system_failure = 02. CASE sy-subrc. WHEN
1. MESSAGE s092(sv) WITH <status>-corr_nbr. CONTINUE. WHEN 2. MESSAGE
a095(sv) WITH <status>-corr_nbr. CONTINUE. ENDCASE. IF (
last_corr_number NE space AND <status>-corr_nbr NE last_corr_number )
OR <status>-tr_alrchkd EQ space. LOOP AT corr_keytab. READ TABLE
vim_corr_objtab WITH KEY pgmid = corr_keytab-pgmid object =
corr_keytab-object obj_name = corr_keytab-objname. CHECK sy-subrc = 0
AND vim_corr_objtab-lockable = space. CLEAR vim_corr_objtab-trkorr.
MODIFY vim_corr_objtab INDEX sy-tabix. ENDLOOP. REFRESH corr_keytab.
MOVE <status>-corr_nbr TO last_corr_number. ELSEIF last_corr_number EQ
space. LOOP AT corr_keytab WHERE ( mastertype EQ vim_unlockable_object
OR mastertype EQ vim_lockable_object ). IF corr_keytab-trkorr EQ space.
corr_keytab-trkorr = <status>-corr_nbr. MODIFY corr_keytab. ELSE. READ
TABLE vim_corr_objtab WITH KEY pgmid = corr_keytab-pgmid object =
corr_keytab-object obj_name = corr_keytab-objname. IF sy-subrc = 0.
corr_keytab-trkorr = <status>-corr_nbr. MODIFY corr_keytab. ENDIF.
ENDIF. ENDLOOP. ENDIF. EXIT. ENDDO. <status>-corr_enqud = 'X'. ENDIF.
MOVE: <status>-corr_nbr TO e071k-trkorr, <status>-corr_nbr TO
e071-trkorr, <status>-corr_nbr TO e070-trkorr. TRANSLATE
<status>-tr_alrchkd USING ' x'. ENDFORM. FORM CHECK_LOCKABLE_OBJECT
USING CLO_E071 STRUCTURE E071 CLO_RETURN TYPE I. DATA: CLO_TADIR LIKE
TADIR, CLO_DDERR LIKE DDERR, CLO_LOCKED(1) TYPE C, CLO_LOCKABLE(1) TYPE
C, CLO_EDITABLE(1) TYPE C, CLO_LOCK_TASK LIKE E071-TRKORR,
CLO_LOCK_USER LIKE SY-UNAME, CLO_LOCK_ORDER LIKE E071-TRKORR,
CLO_TRANSPORTABLE(1) TYPE C, CLO_ICORR LIKE E070-TRKORR, CLO_TE071 LIKE
KO200 OCCURS 0, CLO_TTADIR LIKE TADIR OCCURS 0, CLO_TE071K LIKE E071K
OCCURS 0. APPEND CLO_E071 TO CLO_TE071. CALL FUNCTION
'TR_EDIT_CHECK_OBJECTS_KEYS' EXPORTING WI_ORDER = CLO_E071-TRKORR
WI_WITH_DIALOG = 'R' WI_SEND_MESSAGE = ' ' IMPORTING WE_TASK =
CLO_E071-TRKORR TABLES WT_E071 = CLO_TE071 WT_E071K = CLO_TE071K
WT_TADIR = CLO_TTADIR EXCEPTIONS CANCEL_EDIT_APPEND_ERROR_KEYS = 1
CANCEL_EDIT_APPEND_ERROR_OBJCT = 2 CANCEL_EDIT_APPEND_ERROR_ORDER = 3
CANCEL_EDIT_BUT_SE01 = 4 CANCEL_EDIT_NO_HEADER_OBJECT = 5
CANCEL_EDIT_NO_ORDER_SELECTED = 6 CANCEL_EDIT_REPAIRED_OBJECT = 7
CANCEL_EDIT_SYSTEM_ERROR = 8 CANCEL_EDIT_TADIR_MISSING = 9
CANCEL_EDIT_TADIR_UPDATE_ERROR = 10 CANCEL_EDIT_UNKNOWN_DEVCLASS = 11
CANCEL_EDIT_UNKNOWN_OBJECTTYPE = 12 CANCEL_EDIT_NO_CHECK_CALL = 13
CANCEL_EDIT_CATEGORY_MIXTURE = 14 CANCEL_EDIT_USER_AFTER_ERROR = 15
CANCEL_EDIT_CUSTOM_OBJ_AT_SAP = 16 CANCEL_EDIT_ACCESS_DENIED = 17
SHOW_ONLY_CLOSED_SYSTEM = 18 SHOW_ONLY_CONSOLIDATION_LEVEL = 19
SHOW_ONLY_DDIC_IN_CUSTOMER_SYS = 20 SHOW_ONLY_DELIVERY_SYSTEM = 21
SHOW_ONLY_DIFFERENT_ORDERTYPES = 22 SHOW_ONLY_DIFFERENT_TASKTYPES = 23
SHOW_ONLY_ENQUEUE_FAILED = 24 SHOW_ONLY_GENERATED_OBJECT = 25
SHOW_ONLY_ILL_LOCK = 26 SHOW_ONLY_LOCK_ENQUEUE_FAILED = 27
SHOW_ONLY_MIXED_ORDERS = 28 SHOW_ONLY_MIX_LOCAL_TRANSP_OBJ = 29
SHOW_ONLY_NO_SHARED_REPAIR = 30 SHOW_ONLY_OBJECT_LOCKED = 31
SHOW_ONLY_REPAIRED_OBJECT = 32 SHOW_ONLY_SHOW_CLIENT = 33
SHOW_ONLY_TADIR_MISSING = 34 SHOW_ONLY_UNKNOWN_DEVCLASS = 35
SHOW_ONLY_CLOSED_CLIENT = 36 SHOW_ONLY_CLOSED_ALE_OBJECT = 37
SHOW_ONLY_UNALLOWED_SUPERUSER = 38 SHOW_ONLY_NO_REPAIR_SYSTEM = 39
SHOW_ONLY_NO_LICENSE = 40 SHOW_ONLY_CENTRAL_BASIS = 41
SHOW_ONLY_USER_AFTER_ERROR = 42 SHOW_ONLY_OBJECT_NOT_PATCHABLE = 43. IF
SY-SUBRC NE 0. MESSAGE ID SY-MSGID TYPE 'I' NUMBER SY-MSGNO WITH
SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. IF SY-SUBRC LE 17. CLO_RETURN = 8.
EXIT. ELSE. CLO_RETURN = 4. <STATUS>-CORR_NBR = VIM_LOCKED_IN_CORR.
EXIT. ENDIF. ELSE. READ TABLE CLO_TE071 INTO CLO_E071 INDEX 1. READ
TABLE CLO_TTADIR INTO CLO_TADIR INDEX 1. IF CLO_TADIR-DEVCLASS IS
INITIAL. CALL FUNCTION 'TR_EDIT_CHECK_OBJECTS_KEYS' EXPORTING WI_ORDER
= CLO_E071-TRKORR WI_WITH_DIALOG = 'X' WI_SEND_MESSAGE = ' ' IMPORTING
WE_TASK = CLO_E071-TRKORR TABLES WT_E071 = CLO_TE071 WT_E071K =
CLO_TE071K WT_TADIR = CLO_TTADIR EXCEPTIONS
CANCEL_EDIT_APPEND_ERROR_KEYS = 1 CANCEL_EDIT_APPEND_ERROR_OBJCT = 2
CANCEL_EDIT_APPEND_ERROR_ORDER = 3 CANCEL_EDIT_BUT_SE01 = 4
CANCEL_EDIT_NO_HEADER_OBJECT = 5 CANCEL_EDIT_NO_ORDER_SELECTED = 6
CANCEL_EDIT_REPAIRED_OBJECT = 7 CANCEL_EDIT_SYSTEM_ERROR = 8
CANCEL_EDIT_TADIR_MISSING = 9 CANCEL_EDIT_TADIR_UPDATE_ERROR = 10
CANCEL_EDIT_UNKNOWN_DEVCLASS = 11 CANCEL_EDIT_UNKNOWN_OBJECTTYPE = 12
CANCEL_EDIT_NO_CHECK_CALL = 13 CANCEL_EDIT_CATEGORY_MIXTURE = 14
CANCEL_EDIT_USER_AFTER_ERROR = 15 CANCEL_EDIT_CUSTOM_OBJ_AT_SAP = 16
CANCEL_EDIT_ACCESS_DENIED = 17 SHOW_ONLY_CLOSED_SYSTEM = 18
SHOW_ONLY_CONSOLIDATION_LEVEL = 19 SHOW_ONLY_DDIC_IN_CUSTOMER_SYS = 20
SHOW_ONLY_DELIVERY_SYSTEM = 21 SHOW_ONLY_DIFFERENT_ORDERTYPES = 22
SHOW_ONLY_DIFFERENT_TASKTYPES = 23 SHOW_ONLY_ENQUEUE_FAILED = 24
SHOW_ONLY_GENERATED_OBJECT = 25 SHOW_ONLY_ILL_LOCK = 26
SHOW_ONLY_LOCK_ENQUEUE_FAILED = 27 SHOW_ONLY_MIXED_ORDERS = 28
SHOW_ONLY_MIX_LOCAL_TRANSP_OBJ = 29 SHOW_ONLY_NO_SHARED_REPAIR = 30
SHOW_ONLY_OBJECT_LOCKED = 31 SHOW_ONLY_REPAIRED_OBJECT = 32
SHOW_ONLY_SHOW_CLIENT = 33 SHOW_ONLY_TADIR_MISSING = 34
SHOW_ONLY_UNKNOWN_DEVCLASS = 35 SHOW_ONLY_CLOSED_CLIENT = 36
SHOW_ONLY_CLOSED_ALE_OBJECT = 37 SHOW_ONLY_UNALLOWED_SUPERUSER = 38
SHOW_ONLY_NO_REPAIR_SYSTEM = 39 SHOW_ONLY_NO_LICENSE = 40
SHOW_ONLY_CENTRAL_BASIS = 41 SHOW_ONLY_USER_AFTER_ERROR = 42
SHOW_ONLY_OBJECT_NOT_PATCHABLE = 43. IF SY-SUBRC NE 0. MESSAGE ID
SY-MSGID TYPE 'I' NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3
SY-MSGV4. IF SY-SUBRC LE 17. CLO_RETURN = 8. EXIT. ELSE. CLO_RETURN =
4. <STATUS>-CORR_NBR = VIM_LOCKED_IN_CORR. EXIT. ENDIF. ELSE. READ
TABLE CLO_TE071 INTO CLO_E071 INDEX 1. READ TABLE CLO_TTADIR INTO
CLO_TADIR INDEX 1. ENDIF. ENDIF. ENDIF. IF CLO_TADIR IS INITIAL. CALL
FUNCTION 'TR_CHECK_OBJECT_LOCK' EXPORTING WI_OBJECT = CLO_E071-OBJECT
WI_OBJNAME = CLO_E071-OBJ_NAME WI_PGMID = CLO_E071-PGMID IMPORTING
WE_LOCKABLE_OBJECT = CLO_LOCKABLE WE_LOCKED = CLO_LOCKED WE_LOCK_TASK =
CLO_LOCK_TASK WE_LOCK_TASK_USER = CLO_LOCK_USER WE_LOCK_ORDER =
CLO_LOCK_ORDER WE_OBJECT_EDITABLE = CLO_EDITABLE
WE_POSSIBLE_USER_EDIT_TASK = CLO_ICORR EXCEPTIONS EMPTY_KEY = 01
NO_SYSTEMNAME = 02 NO_SYSTEMTYPE = 03 UNALLOWED_LOCK_ORDER = 04. IF
SY-SUBRC NE 0. MESSAGE I095(SV) WITH E071-TRKORR. CLO_RETURN = 8. EXIT.
ENDIF. IF CLO_LOCKABLE EQ SPACE. VIM_CORR_OBJTAB-LOCKABLE = SPACE.
MODIFY VIM_CORR_OBJTAB. EXIT. ELSE. MESSAGE I095(SV) WITH E071-TRKORR.
CLO_RETURN = 8. EXIT. ENDIF. ENDIF. CALL FUNCTION
'VIEW_GET_DEVCLASS_STATE' EXPORTING DEV_CLASS = CLO_TADIR-DEVCLASS
IMPORTING TRANSPORT_POSSIBLE = CLO_TRANSPORTABLE EXCEPTIONS NOT_FOUND =
01. IF CLO_TRANSPORTABLE EQ SPACE. X_HEADER-FLAG =
VIM_TRANSPORT_DENIED. MODIFY X_HEADER INDEX 1. ELSE. IF
VIM_LAST_SOURCE_SYSTEM EQ SPACE. VIM_LAST_SOURCE_SYSTEM =
CLO_TADIR-SRCSYSTEM. ELSE. IF CLO_TADIR-SRCSYSTEM EQ SY-SYSID. IF
VIM_LAST_SOURCE_SYSTEM NE SY-SYSID. MESSAGE I134(SV). CLO_RETURN = 4.
<STATUS>-CORR_NBR = VIM_LOCKED_IN_CORR. EXIT. ENDIF. ELSE. IF
VIM_LAST_SOURCE_SYSTEM EQ SY-SYSID. MESSAGE I134(SV). CLO_RETURN = 4.
<STATUS>-CORR_NBR = VIM_LOCKED_IN_CORR. EXIT. ENDIF. ENDIF. ENDIF. CALL
FUNCTION 'TR_CHECK_OBJECT_LOCK' EXPORTING WI_OBJECT = CLO_E071-OBJECT
WI_OBJNAME = CLO_E071-OBJ_NAME WI_PGMID = CLO_E071-PGMID IMPORTING
WE_LOCKABLE_OBJECT = CLO_LOCKABLE WE_LOCKED = CLO_LOCKED WE_LOCK_TASK =
CLO_LOCK_TASK WE_LOCK_TASK_USER = CLO_LOCK_USER WE_LOCK_ORDER =
CLO_LOCK_ORDER WE_OBJECT_EDITABLE = CLO_EDITABLE
WE_POSSIBLE_USER_EDIT_TASK = CLO_ICORR EXCEPTIONS EMPTY_KEY = 01
NO_SYSTEMNAME = 02 NO_SYSTEMTYPE = 03 UNALLOWED_LOCK_ORDER = 04. IF
SY-SUBRC NE 0. MESSAGE I095(SV) WITH E071-TRKORR. CLO_RETURN = 8. EXIT.
ENDIF. IF CLO_LOCKABLE EQ SPACE. VIM_CORR_OBJTAB-LOCKABLE = SPACE.
MODIFY VIM_CORR_OBJTAB. EXIT. ENDIF. IF CLO_LOCKED NE SPACE. IF
CLO_EDITABLE EQ SPACE. MESSAGE I132(SV) WITH CLO_LOCK_TASK
CLO_LOCK_USER. CLO_RETURN = 4. <STATUS>-CORR_NBR = VIM_LOCKED_IN_CORR.
EXIT. ELSE. CLO_E071-TRKORR = CLO_ICORR. ENDIF. ENDIF. ENDIF. IF
<STATUS>-CORR_NBR NE SPACE AND CLO_E071-TRKORR NE SPACE. IF
CLO_E071-TRKORR NE <STATUS>-CORR_NBR. IF <STATUS>-ORDER_NBR NE
CLO_LOCK_ORDER. MESSAGE I129(SV). CLO_RETURN = 4. <STATUS>-CORR_NBR =
VIM_LOCKED_IN_CORR. EXIT. ENDIF. VIM_CORR_OBJTAB-TRKORR =
CLO_E071-TRKORR. MODIFY VIM_CORR_OBJTAB. ENDIF. ELSE. IF
<STATUS>-CORR_NBR EQ SPACE. <STATUS>-CORR_NBR = CLO_E071-TRKORR.
<STATUS>-ORDER_NBR = CLO_LOCK_ORDER. ENDIF. ENDIF. TRANSLATE
<STATUS>-TR_ALRCHKD USING ' x'. CLEAR CLO_RETURN. ENDFORM. FORM
check_transp_objs_for_maint USING ctofm_return TYPE i. DATA:
obj_appendable(1) TYPE c, rc LIKE sy-subrc, e071_safe LIKE e071,
last_order LIKE e071-trkorr, ctofm_ko200_tab LIKE ko200 OCCURS 10,
ctofm_keytab_safe LIKE corr_keytab OCCURS 50, last_corr LIKE
e071-trkorr. CLEAR ctofm_return. CHECK maint_mode EQ aendern. PERFORM
vim_get_img_activity CHANGING e071-activity. IF vim_corr_obj_viewname
NE x_header-viewname. CLEAR e071-trkorr. PERFORM get_transp_info. CHECK
x_header-flag NE vim_transport_denied. IF maint_mode EQ anzeigen.
ctofm_return = 4. EXIT. ENDIF. ELSE. IF NOT objh IS INITIAL. IF
x_header-importable IS INITIAL. x_header-importable = objh-importable.
ENDIF. ENDIF. ENDIF. CHECK vim_client_state EQ vim_log. IF
<status>-corr_nbr NE <status>-l_corr_nbr. CLEAR: <status>-tr_alrchkd,
<status>-corr_enqud. ENDIF. IF <status>-tr_alrchkd NE space.
vim_corr_obj_viewname = x_header-viewname. EXIT. ENDIF. e071_safe =
e071. CLEAR vim_last_source_system. LOOP AT vim_corr_objtab WHERE
lockable NE space. e071 = vim_corr_objtab. PERFORM
check_lockable_object USING e071 ctofm_return. IF ctofm_return NE 0 OR
x_header-flag EQ vim_transport_denied. EXIT. ENDIF. ENDLOOP. IF
ctofm_return NE 0 OR x_header-flag EQ vim_transport_denied. e071 =
e071_safe. EXIT. ENDIF. vim_corr_obj_viewname = x_header-viewname. LOOP
AT vim_corr_objtab WHERE lockable EQ space. e071 = vim_corr_objtab.
APPEND e071 TO ctofm_ko200_tab. ENDLOOP. IF sy-subrc EQ 0. LOOP AT
corr_keytab. LOOP AT vim_corr_objtab WHERE lockable EQ space AND object
EQ corr_keytab-mastertype AND obj_name EQ corr_keytab-mastername. EXIT.
ENDLOOP. CHECK sy-subrc NE 0. APPEND corr_keytab TO ctofm_keytab_safe.
DELETE corr_keytab. ENDLOOP. last_order = <status>-order_nbr. last_corr
= <status>-corr_nbr. CALL FUNCTION 'TR_OBJECTS_CHECK' IMPORTING
we_order = <status>-order_nbr we_task = <status>-corr_nbr
we_objects_appendable = obj_appendable TABLES wt_ko200 =
ctofm_ko200_tab wt_e071k = corr_keytab EXCEPTIONS
cancel_edit_other_error = 1 show_only_other_error = 2 OTHERS = 3. IF
sy-subrc NE 0. rc = sy-subrc. MESSAGE ID sy-msgid TYPE 'I' NUMBER
sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. IF rc = 2.
ctofm_return = 4. e071 = e071_safe. EXIT. ELSE. ctofm_return = 8. e071
= e071_safe. EXIT. ENDIF. ENDIF. IF <status>-corr_nbr NE space AND
last_corr NE space. IF last_corr NE <status>-corr_nbr. IF
<status>-order_nbr NE last_order. MESSAGE i129(sv). ctofm_return = 4.
e071 = e071_safe. EXIT. ENDIF. ENDIF. ELSE. IF <status>-corr_nbr EQ
space. <status>-corr_nbr = last_corr. <status>-order_nbr = last_order.
ENDIF. ENDIF. LOOP AT ctofm_keytab_safe INTO corr_keytab. APPEND
corr_keytab. ENDLOOP. IF obj_appendable EQ space. vim_client_state =
vim_noact. ENDIF. ENDIF. e071 = e071_safe. <status>-tr_alrchkd = 'x'.
ENDFORM. FORM vim_get_img_activity CHANGING p_activity TYPE
e071-activity. CALL FUNCTION 'READ_IMG_ACTIVITY_FROM_MEMORY' IMPORTING
img_activity = p_activity. ENDFORM. FORM prepare_corr. DATA: x030l_sadr
type x030l, pc_objtype LIKE objs-objecttype, pc_maint_mode(1) TYPE c.
CHECK x_header-flag NE vim_transport_denied. CHECK maint_mode EQ
transportieren OR vim_client_state EQ vim_log. IF <status>-tr_alrchkd
EQ 'x'. IF x_header-generictrp NE space and vim_import_profile NE 'X'.
MESSAGE i141(sv) WITH vim_max_trsp_keylength vim_max_trsp_identical_key
x_header-maxtrkeyln. ELSEIF x_header-genertxtrp NE space and
vim_import_profile NE 'X'. MESSAGE i141(sv) WITH vim_max_trsp_keylength
vim_max_trsp_identical_key x_header-maxtrtxkln. ENDIF. DESCRIBE TABLE
vim_corr_objtab. IF sy-tfill GT 0. CLEAR corr_keytab. MOVE
x_header-viewname TO corr_keytab-mastername. LOOP AT vim_corr_objtab.
IF vim_corr_objtab-lockable EQ space. corr_keytab-mastertype =
vim_unlockable_object. ELSE. corr_keytab-mastertype =
vim_lockable_object. ENDIF. MOVE: vim_corr_objtab-pgmid TO
corr_keytab-pgmid, vim_corr_objtab-object TO corr_keytab-object,
vim_corr_objtab-objfunc TO corr_keytab-objfunc,
vim_corr_objtab-activity TO corr_keytab-activity. sy-fdpos = strlen(
vim_corr_objtab-obj_name ). IF sy-fdpos GT vim_71k_name_length.
corr_keytab-objname = vim_long_objname. corr_keytab-tabkey =
vim_corr_objtab-obj_name. ELSE. corr_keytab-objname =
vim_corr_objtab-obj_name. ENDIF. READ TABLE corr_keytab WITH KEY pgmid
= corr_keytab-pgmid object = corr_keytab-object objname =
corr_keytab-objname objfunc = corr_keytab-objfunc mastertype =
corr_keytab-mastertype mastername = corr_keytab-mastername TRANSPORTING
NO FIELDS. CHECK sy-subrc NE 0. IF vim_corr_objtab-trkorr EQ space.
MOVE: <status>-corr_nbr TO corr_keytab-trkorr, <status>-corr_nbr TO
vim_corr_objtab-trkorr. MODIFY vim_corr_objtab. ELSE.
corr_keytab-trkorr = vim_corr_objtab-trkorr. ENDIF. corr_keytab-flag =
'V'. APPEND corr_keytab. ENDLOOP. ENDIF. ENDIF. IF maint_mode EQ
transportieren. MOVE 'X' TO get_corr_keytab. IF <status>-keytbinvld EQ
space. LOOP AT vim_corr_objtab WHERE lockable EQ space. LOOP AT
corr_keytab WHERE mastertype EQ vim_corr_objtab-object AND mastername
EQ vim_corr_objtab-obj_name. EXIT. ENDLOOP. IF sy-subrc EQ 0. CLEAR
get_corr_keytab. ENDIF. ENDLOOP. ELSE. LOOP AT vim_corr_objtab WHERE
lockable EQ space. LOOP AT corr_keytab WHERE mastertype EQ
vim_corr_objtab-object AND mastername EQ vim_corr_objtab-obj_name.
DELETE corr_keytab. ENDLOOP. ENDLOOP. ENDIF. ENDIF. MOVE
<status>-corr_nbr TO <status>-l_corr_nbr. <status>-tr_alrchkd = 'X'. IF
( status-action EQ transportieren OR vim_client_state EQ vim_log ) AND
x_header-adrnbrflag EQ 'O' AND sadr_namtab_read EQ space. CALL FUNCTION
'DDIF_NAMETAB_GET' EXPORTING tabname = 'SADR' IMPORTING X030L_WA =
x030l_sadr EXCEPTIONS OTHERS = 2. IF sy-subrc EQ 0. MOVE 'X' TO
sadr_namtab_read. sadr_keylen = x030l_sadr-keylen /
cl_abap_char_utilities=>charsize. IF x_header-bastab EQ space.
pc_objtype = 'V'. ELSE. pc_objtype = 'S'. ENDIF. CALL FUNCTION
'VIEW_CHECK_OBJ_LIST_FOR_ADDR' EXPORTING objectname = x_header-viewname
objecttype = pc_objtype EXCEPTIONS not_all_address_tables_in_list = 01.
IF sy-subrc NE 0. pc_maint_mode = x_header-bastab. TRANSLATE
pc_maint_mode USING ' VXS'. CALL FUNCTION 'OBJ_GENERATE' EXPORTING
iv_objectname = x_header-viewname iv_objecttype = pc_maint_mode
iv_maint_mode = aendern iv_no_correction = 'X' EXCEPTIONS OTHERS = 5.
ENDIF. ELSE. RAISE nametab_get_failed. ENDIF. ENDIF. ENDFORM. FORM
update_corr. LOCAL: x_header. DATA: rc LIKE sy-subrc, fails TYPE i,
flag TYPE c, rc1 LIKE sy-subrc, uc_addr_71ktab LIKE e071k OCCURS 0,
addr_e071k LIKE e071k, object_key TYPE ad_objkey, keylen TYPE syfleng,
txtkeylen TYPE syfleng, sys_type(10) TYPE c, texttab_wa TYPE REF TO
data, max_trsp_keylength_in_byte type i. FIELD-SYMBOLS: <adr_obj_key>
TYPE x, <texttab_wa> TYPE ANY, <texttab_wax> TYPE x, <lang> TYPE ANY.
CHECK maint_mode EQ aendern OR maint_mode EQ transportieren. CHECK
x_header-flag NE vim_transport_denied. max_trsp_keylength_in_byte =
vim_max_trsp_keylength * cl_abap_char_utilities=>charsize. CALL
'C_SAPGPARAM' ID 'NAME' FIELD 'transport/systemtype' ID 'VALUE' FIELD
sys_type. IF x_header-keylen GT max_trsp_keylength_in_byte. keylen =
x_header-maxtrkeyln. ELSE. keylen = x_header-keylen. ENDIF. IF
x_header-textkeylen GT max_trsp_keylength_in_byte. txtkeylen =
x_header-maxtrtxkln. ELSE. txtkeylen = x_header-textkeylen. ENDIF. IF
x_header-adrnbrflag EQ 'N'. ASSIGN object_key TO <adr_obj_key> CASTING.
LOOP AT vim_addr_e071k_tab INTO addr_e071k. e071k-trkorr =
<status>-corr_nbr. ENDLOOP. ENDIF. IF status-action EQ transportieren.
CHECK vim_client_state NE vim_local_clnt. IF status-mode EQ list_bild.
IF ( x_header-frm_e071ks NE space OR x_header-flag EQ space ) AND
vim_called_by_cluster NE space. PERFORM vim_store_state_info. CALL
FUNCTION 'VIEWCLUSTER_TRANS_DEPENDENT' EXPORTING view_name =
x_header-viewname action = corr_action status_mode = status-mode
workarea = extract no_dialog = vim_external_mode corr_number =
<status>-corr_nbr. ENDIF. CLEAR counter. LOOP AT extract. CHECK <xmark>
EQ markiert. PERFORM move_extract_to_view_wa. IF x_header-flag EQ
space. IF x_header-bastab EQ space. PERFORM (corr_formname) IN PROGRAM
(sy-repid) USING corr_action rc. ELSE. corr_keytab = e071k.
corr_keytab-objname = x_header-maintview. MOVE <vim_xextract_key> TO
<vim_corr_keyx>(keylen). PERFORM update_corr_keytab USING corr_action
rc. IF x_header-texttbexst NE space AND <vim_xextract_text> NE
<text_initial_x>. corr_keytab = e071k. corr_keytab-objname =
x_header-texttab. MOVE <vim_xextract_text> TO
<vim_corr_keyx>(txtkeylen). PERFORM update_corr_keytab USING
corr_action rc1. IF rc1 EQ 0. MOVE rc1 TO rc. ENDIF. ENDIF. ENDIF. IF
x_header-texttbexst <> space AND vim_texttab_is_ro EQ space. PERFORM
vim_text_keytab_entry USING <vim_xextract_key> corr_action rc1. IF rc1
EQ 0. MOVE rc1 TO rc. ENDIF. ENDIF. IF x_header-adrnbrflag EQ 'O' AND
<address_number> NE space. PERFORM vim_address_keytab_entries USING
corr_action rc1. IF rc1 EQ 0. MOVE rc1 TO rc. ENDIF. ELSEIF
x_header-adrnbrflag EQ 'N' AND <address_number> NE space. APPEND LINES
OF vim_addr_e071k_tab TO uc_addr_71ktab. <adr_obj_key>(keylen) =
<vim_xextract_key>. CALL FUNCTION 'ADDR_TRANSPORT_ENTRIES' EXPORTING
addrnumber = <address_number> table_name = vim_addr_basetable
field_name = vim_addr_bastab_field objkey = object_key TABLES e071k_tab
= uc_addr_71ktab. vim_exit_11_12_active = 'X'. LOOP AT uc_addr_71ktab
INTO corr_keytab WHERE mastername = vim_addr_e071k_master_46 OR
mastername = vim_addr_e071k_master. PERFORM update_corr_keytab USING
corr_action rc1. IF rc1 EQ 0. MOVE rc1 TO rc. ENDIF. ENDLOOP. REFRESH
uc_addr_71ktab. CLEAR vim_exit_11_12_active. ENDIF. ENDIF. IF
x_header-frm_e071ks NE space. vim_exit_11_12_active = 'X'. PERFORM
(x_header-frm_e071ks) IN PROGRAM (sy-repid). IF sy-subrc EQ 0. MOVE
sy-subrc TO rc. ENDIF. CLEAR vim_exit_11_12_active. ELSE. IF
x_header-frm_e071 NE space AND x_header-frm_e071ka EQ space.
<status>-keytbmodfd = 'X'. ENDIF. IF x_header-flag NE space. EXIT.
ENDIF. ENDIF. IF rc NE 0. ADD 1 TO fails. IF replace_mode NE space.
READ TABLE total WITH KEY <vim_xextract_key> BINARY SEARCH. <mark> =
<xmark> = nicht_markiert. MODIFY total INDEX sy-tabix. MODIFY extract.
SUBTRACT: 1 FROM mark_total, 1 FROM mark_extract. ok_code = 'IGN '.
ENDIF. ELSE. READ TABLE total WITH KEY <vim_xextract_key> BINARY
SEARCH. <mark> = <xmark> = nicht_markiert. CASE corr_action. WHEN
hinzufuegen. MOVE transportieren TO <action>. WHEN geloescht. CLEAR
<action>. ENDCASE. <xact> = <action>. MODIFY total INDEX sy-tabix.
MODIFY extract. SUBTRACT: 1 FROM mark_total, 1 FROM mark_extract.
ENDIF. ADD 1 TO counter. ENDLOOP. IF counter GT fails. IF fails GT 0.
MOVE 4 TO rc. ELSE. CLEAR rc. ENDIF. ELSE. MOVE 8 TO rc. ENDIF. IF
replace_mode EQ space. IF corr_action EQ hinzufuegen. IF counter EQ 1.
IF rc EQ 0. MESSAGE s098(sv) WITH <status>-corr_nbr. ELSE. MESSAGE
s107(sv) WITH <status>-corr_nbr. ENDIF. ELSE. SUBTRACT fails FROM
counter. CASE rc. WHEN 0. MESSAGE s105(sv) WITH counter
<status>-corr_nbr. WHEN 4. MESSAGE s109(sv) WITH counter fails
<status>-corr_nbr. WHEN 8. MESSAGE s108(sv) WITH fails
<status>-corr_nbr. ENDCASE. ENDIF. ELSE. IF counter EQ 1. IF rc EQ 0.
MESSAGE s099(sv) WITH <status>-corr_nbr. ELSE. MESSAGE s110(sv) WITH
<status>-corr_nbr. ENDIF. ELSE. SUBTRACT fails FROM counter. CASE rc.
WHEN 0. MESSAGE s106(sv) WITH counter <status>-corr_nbr. WHEN 4.
MESSAGE s111(sv) WITH counter fails <status>-corr_nbr. WHEN 8. MESSAGE
s112(sv) WITH fails <status>-corr_nbr. ENDCASE. ENDIF. ENDIF. ENDIF.
ELSE. IF x_header-flag EQ space. IF x_header-bastab EQ space. PERFORM
(corr_formname) IN PROGRAM (sy-repid) USING corr_action rc. ELSE.
corr_keytab = e071k. corr_keytab-objname = x_header-maintview. MOVE
<table1_x> TO <vim_corr_keyx>(keylen). PERFORM update_corr_keytab USING
corr_action rc. IF x_header-texttbexst NE space AND <table1_text> NE
<text_initial>. corr_keytab = e071k. corr_keytab-objname =
x_header-texttab. MOVE <table1_xtext> TO <vim_corr_keyx>(txtkeylen).
PERFORM update_corr_keytab USING corr_action rc1. IF rc1 EQ 0. MOVE rc1
TO rc. ENDIF. ENDIF. ENDIF. IF x_header-texttbexst <> space AND
vim_texttab_is_ro EQ space. PERFORM vim_text_keytab_entry USING
<table1_x> corr_action rc1. IF rc1 EQ 0. MOVE rc1 TO rc. ENDIF. ENDIF.
IF x_header-adrnbrflag EQ 'O' AND <address_number> NE space. PERFORM
vim_address_keytab_entries USING corr_action rc1. IF rc1 EQ 0. MOVE rc1
TO rc. ENDIF. ELSEIF x_header-adrnbrflag EQ 'N' AND <address_number> NE
space. APPEND LINES OF vim_addr_e071k_tab TO uc_addr_71ktab.
<adr_obj_key>(keylen) = <vim_xextract_key>. CALL FUNCTION
'ADDR_TRANSPORT_ENTRIES' EXPORTING addrnumber = <address_number>
table_name = vim_addr_basetable field_name = vim_addr_bastab_field
objkey = object_key TABLES e071k_tab = uc_addr_71ktab.
vim_exit_11_12_active = 'X'. LOOP AT uc_addr_71ktab INTO corr_keytab
WHERE mastername = vim_addr_e071k_master_46 OR mastername =
vim_addr_e071k_master. PERFORM update_corr_keytab USING corr_action
rc1. IF rc1 EQ 0. MOVE rc1 TO rc. ENDIF. ENDLOOP. REFRESH
uc_addr_71ktab. CLEAR vim_exit_11_12_active. ENDIF. ENDIF. IF
x_header-frm_e071ks NE space. vim_exit_11_12_active = 'X'. PERFORM
(x_header-frm_e071ks) IN PROGRAM (sy-repid). IF sy-subrc EQ 0. MOVE
sy-subrc TO rc. ENDIF. CLEAR vim_exit_11_12_active. ELSE. IF
x_header-frm_e071 NE space AND x_header-frm_e071ka EQ space. IF
x_header-flag NE space. <status>-keytbmodfd = 'E'. ELSE.
<status>-keytbmodfd = 'X'. ENDIF. ENDIF. ENDIF. IF <status>-keytbmodfd
NE 'E'. IF vim_called_by_cluster NE space. PERFORM
vim_store_state_info. CALL FUNCTION 'VIEWCLUSTER_TRANS_DEPENDENT'
EXPORTING view_name = x_header-viewname action = corr_action
status_mode = status-mode workarea = extract no_dialog =
vim_external_mode corr_number = <status>-corr_nbr. ENDIF. ELSE.
<status>-keytbmodfd = 'X'. ENDIF. READ TABLE total WITH KEY
<vim_xextract_key> BINARY SEARCH. IF rc EQ 0. CASE corr_action. WHEN
hinzufuegen. MOVE transportieren TO <action>. WHEN geloescht. CLEAR
<action>. ENDCASE. <xact> = <action>. MOVE 'X' TO flag. ELSE. IF
replace_mode NE space. ok_code = 'IGN '. ENDIF. ENDIF. IF <xmark> EQ
markiert. <mark> = <xmark> = nicht_markiert. SUBTRACT: 1 FROM
mark_total, 1 FROM mark_extract. MOVE 'X' TO flag. ENDIF. IF flag NE
space. MODIFY total INDEX sy-tabix. MODIFY extract INDEX nextline.
ENDIF. IF replace_mode EQ space. IF corr_action EQ hinzufuegen. IF rc
EQ 0. MESSAGE s098(sv) WITH <status>-corr_nbr. ELSE. MESSAGE s107(sv)
WITH <status>-corr_nbr. ENDIF. ELSE. IF rc EQ 0. MESSAGE s099(sv) WITH
<status>-corr_nbr. ELSE. MESSAGE s110(sv) WITH <status>-corr_nbr.
ENDIF. ENDIF. ENDIF. ENDIF. ELSE. CHECK vim_client_state EQ vim_log.
corr_action = hinzufuegen. LOOP AT vim_corr_objtab WHERE objfunc NE
space. LOOP AT corr_keytab WHERE mastertype EQ vim_corr_objtab-object
AND mastername EQ vim_corr_objtab-obj_name. DELETE corr_keytab.
ENDLOOP. ENDLOOP. LOOP AT total. IF x_header-flag EQ space. IF
x_header-bastab EQ space. CHECK <action> NE original AND <action> NE
neuer_geloescht. MOVE <vim_total_struc> TO <table1>. PERFORM
(corr_formname) IN PROGRAM (sy-repid) USING corr_action rc. ELSE. IF
x_header-texttbexst EQ space. CHECK <action> NE original AND <action>
NE neuer_geloescht. ELSE. CHECK <action> NE original AND <action> NE
neuer_geloescht OR <action_text> NE original AND <action_text> NE
neuer_geloescht. ENDIF. MOVE <vim_total_struc> TO <table1>. corr_keytab
= e071k. corr_keytab-objname = x_header-maintview. MOVE
<vim_xtotal_key> TO <vim_corr_keyx>(keylen). PERFORM update_corr_keytab
USING corr_action rc. IF x_header-texttbexst NE space AND
<vim_xtotal_text> NE <text_initial_x>. corr_keytab = e071k.
corr_keytab-objname = x_header-texttab. MOVE <vim_xtotal_text> TO
<vim_corr_keyx>(txtkeylen). PERFORM update_corr_keytab USING
corr_action rc1. ENDIF. ENDIF. IF x_header-adrnbrflag EQ 'O' AND
<address_number> NE space. PERFORM vim_address_keytab_entries USING
corr_action rc1. ELSEIF x_header-adrnbrflag EQ 'N' AND <address_number>
NE space. READ TABLE vim_addresses_to_save WITH KEY viewname =
x_header-viewname addrnumber = <address_number> BINARY SEARCH
TRANSPORTING NO FIELDS. IF sy-subrc NE 0. APPEND LINES OF
vim_addr_e071k_tab TO uc_addr_71ktab. <adr_obj_key>(keylen) =
<vim_xtotal_key>. CALL FUNCTION 'ADDR_TRANSPORT_ENTRIES' EXPORTING
addrnumber = <address_number> table_name = vim_addr_basetable
field_name = vim_addr_bastab_field objkey = object_key TABLES e071k_tab
= uc_addr_71ktab. vim_exit_11_12_active = 'X'. LOOP AT uc_addr_71ktab
INTO corr_keytab WHERE mastername = vim_addr_e071k_master_46 OR
mastername = vim_addr_e071k_master. PERFORM update_corr_keytab USING
corr_action rc1. IF rc1 EQ 0. MOVE rc1 TO rc. ENDIF. ENDLOOP. REFRESH
uc_addr_71ktab. CLEAR vim_exit_11_12_active. ENDIF. ENDIF. ENDIF. IF
x_header-frm_e071ks NE space. vim_exit_11_12_active = 'X'. PERFORM
(x_header-frm_e071ks) IN PROGRAM (sy-repid). CLEAR
vim_exit_11_12_active. ELSE. IF x_header-flag NE space. EXIT. ENDIF.
ENDIF. ENDLOOP. IF x_header-flag EQ space AND x_header-texttbexst <>
space. PERFORM vim_text_keytab_entries USING corr_action rc1 keylen
txtkeylen. ENDIF. ENDIF. IF x_header-frm_e071ka NE space.
vim_exit_11_12_active = 'X'. PERFORM (x_header-frm_e071ka) IN PROGRAM
(sy-repid). CLEAR vim_exit_11_12_active. IF status-action EQ
transportieren AND x_header-flag NE space AND x_header-frm_e071 NE
space AND x_header-frm_e071ks EQ space AND vim_called_by_cluster NE
space. PERFORM vim_store_state_info. CALL FUNCTION
'VIEWCLUSTER_TRANS_DEPENDENT' EXPORTING view_name = x_header-viewname
action = corr_action status_mode = status-mode workarea = extract
no_dialog = vim_external_mode corr_number = <status>-corr_nbr. ENDIF.
ENDIF. ENDFORM. FORM vim_address_keytab_entries USING
value(vake_action) TYPE c vake_rc TYPE i. STATICS: sadr2_keylen type
syfleng. DATA: rc1 LIKE sy-subrc, x030l_wa type x030l. if sadr2_keylen
is initial. CALL FUNCTION 'DDIF_NAMETAB_GET' EXPORTING tabname =
'SADR2' IMPORTING X030L_WA = x030l_wa EXCEPTIONS OTHERS = 2. IF
sy-subrc = 0. sadr2_keylen = x030l_wa-keylen /
cl_abap_char_utilities=>charsize. else. RAISE nametab_get_failed.
ENDIF. endif. SELECT SINGLE * FROM sadr WHERE adrnr EQ
<address_number>. IF sy-subrc NE 0. CALL FUNCTION
'ADDR_CONVERT_ADRC_TO_SADR' CHANGING address_number = <address_number>.
IF <address_number> NE space. SELECT SINGLE * FROM sadr WHERE adrnr EQ
<address_number>. ELSE. EXIT. ENDIF. ENDIF. vake_rc = 8. PERFORM
vim_addr_keytab_entries_intern USING 'SADR' sadr sadr_keylen
vake_action rc1. IF rc1 EQ 0. CLEAR vake_rc. ELSE. IF vake_action EQ
pruefen. EXIT. ENDIF. ENDIF. SELECT COUNT(*) FROM sadr2 WHERE adrnr EQ
sadr-adrnr. CLEAR sadr2. MOVE: sadr-mandt TO sadr2-mandt, sadr-adrnr TO
sadr2-adrnr, '*' TO sadr2-stdfl. IF sy-dbcnt GT 0. PERFORM
vim_addr_keytab_entries_intern USING 'SADR2' sadr2 sadr2_keylen
vake_action rc1. IF rc1 EQ 0. CLEAR vake_rc. ELSE. IF vake_action EQ
pruefen. vake_rc = 8. EXIT. ENDIF. ENDIF. ENDIF. SELECT COUNT(*) FROM
sadr3 WHERE adrnr EQ sadr-adrnr. IF sy-dbcnt GT 0. sadr3 = sadr2.
PERFORM vim_addr_keytab_entries_intern USING 'SADR3' sadr3 sadr2_keylen
vake_action rc1. IF rc1 EQ 0. CLEAR vake_rc. ELSE. IF vake_action EQ
pruefen. vake_rc = 8. EXIT. ENDIF. ENDIF. ENDIF. SELECT COUNT(*) FROM
sadr4 WHERE adrnr EQ sadr-adrnr. IF sy-dbcnt GT 0. sadr4 = sadr2.
PERFORM vim_addr_keytab_entries_intern USING 'SADR4' sadr4 sadr2_keylen
vake_action rc1. IF rc1 EQ 0. CLEAR vake_rc. ELSE. IF vake_action EQ
pruefen. vake_rc = 8. EXIT. ENDIF. ENDIF. ENDIF. SELECT COUNT(*) FROM
sadr5 WHERE adrnr EQ sadr-adrnr. IF sy-dbcnt GT 0. sadr5 = sadr2.
PERFORM vim_addr_keytab_entries_intern USING 'SADR5' sadr5 sadr2_keylen
vake_action rc1. IF rc1 EQ 0. CLEAR vake_rc. ELSE. IF vake_action EQ
pruefen. vake_rc = 8. ENDIF. ENDIF. ENDIF. ENDFORM. FORM
vim_addr_keytab_entries_intern USING value(vakei_tabname) TYPE tabname
value(vakei_table) value(vakei_keylen) TYPE i value(vakei_action) TYPE
sychar01 vakei_rc type sy-subrc. corr_keytab = e071k.
corr_keytab-objname = vakei_tabname. MOVE vakei_table TO
corr_keytab-tabkey(vakei_keylen). vim_exit_11_12_active = 'X'. PERFORM
update_corr_keytab USING vakei_action vakei_rc. CLEAR
vim_exit_11_12_active. ENDFORM. FORM update_corr_keytab USING
value(uet_action) uet_rc. DATA: e071k_safe LIKE e071k, asteriskpos TYPE
i. MOVE: 1 TO uet_rc, corr_keytab TO e071k_safe. IF
vim_exit_11_12_active EQ space. IF e071k_safe-objname EQ
x_header-texttab. IF x_header-genertxtrp NE space. asteriskpos =
x_header-trtxgkpos / cl_abap_char_utilities=>charsize. CHECK
e071k_safe-tabkey NE space. e071k_safe-tabkey+asteriskpos = '*'. ENDIF.
ELSE. asteriskpos = x_header-trgkeypos /
cl_abap_char_utilities=>charsize. IF x_header-generictrp NE space.
e071k_safe-tabkey+asteriskpos = '*'. ENDIF. ENDIF. ELSE. CLEAR
e071k_safe-viewname. ENDIF. CASE uet_action. WHEN hinzufuegen. IF
e071k_safe-object EQ transp_object. LOOP AT corr_keytab WHERE objname
EQ e071k_safe-objname AND tabkey EQ e071k_safe-tabkey AND mastername EQ
e071k_safe-mastername. IF corr_keytab-pgmid EQ vim_deleted_key. MOVE
e071k_safe TO corr_keytab. MODIFY corr_keytab. CLEAR uet_rc. ENDIF.
EXIT. ENDLOOP. ELSE. LOOP AT corr_keytab WHERE pgmid EQ
e071k_safe-pgmid AND object EQ e071k_safe-object AND objname EQ
e071k_safe-objname AND tabkey EQ e071k_safe-tabkey AND mastername EQ
e071k_safe-mastername. IF corr_keytab-objfunc EQ 'D'. MOVE e071k_safe
TO corr_keytab. MODIFY corr_keytab. CLEAR uet_rc. ENDIF. EXIT. ENDLOOP.
ENDIF. IF sy-subrc NE 0. MOVE e071k_safe TO corr_keytab. APPEND
corr_keytab. CLEAR uet_rc. ENDIF. WHEN geloescht. IF e071k_safe-object
EQ transp_object. LOOP AT corr_keytab WHERE objname EQ
e071k_safe-objname AND tabkey EQ e071k_safe-tabkey AND mastername EQ
e071k_safe-mastername AND pgmid NE vim_deleted_key. corr_keytab-pgmid =
vim_deleted_key. MODIFY corr_keytab. CLEAR uet_rc. EXIT. ENDLOOP. ELSE.
IF e071k_safe-mastername EQ space. e071k_safe-mastername = master_name.
ENDIF. LOOP AT corr_keytab WHERE pgmid EQ e071k_safe-pgmid AND object
EQ e071k_safe-object AND objname EQ e071k_safe-objname AND tabkey EQ
e071k_safe-tabkey AND mastername EQ e071k_safe-mastername. IF
corr_keytab-objfunc NE 'D'. corr_keytab-objfunc = 'D'. MODIFY
corr_keytab. CLEAR uet_rc. ENDIF. EXIT. ENDLOOP. IF sy-subrc NE 0. MOVE
e071k_safe TO corr_keytab. corr_keytab-objfunc = 'D'. APPEND
corr_keytab. CLEAR uet_rc. ENDIF. ENDIF. WHEN pruefen. IF
e071k_safe-object EQ transp_object. LOOP AT corr_keytab WHERE objname
EQ e071k_safe-objname AND tabkey EQ e071k_safe-tabkey AND mastername EQ
e071k_safe-mastername AND pgmid NE vim_deleted_key. CLEAR uet_rc. EXIT.
ENDLOOP. ELSE. LOOP AT corr_keytab WHERE pgmid EQ e071k_safe-pgmid AND
object EQ e071k_safe-object AND objname EQ e071k_safe-objname AND
tabkey EQ e071k_safe-tabkey AND mastername EQ e071k_safe-mastername AND
objfunc NE 'D'. CLEAR uet_rc. EXIT. ENDLOOP. ENDIF. WHEN
vim_writing_bc_imp_log. APPEND corr_keytab. ENDCASE. IF uet_rc EQ 0 AND
uet_action NE pruefen. MOVE 'X' TO <status>-keytbmodfd. ENDIF. ENDFORM.
FORM corr_upd. DATA: ko200 LIKE ko200, cu_e071k_tab LIKE e071k OCCURS
100, cu_e071_tab LIKE e071 OCCURS 10, cu_trpar LIKE trpar_int OCCURS 1,
cu_trmess LIKE trmess_int OCCURS 1, cu_tadir LIKE tadir, cu_e071_htb
LIKE e071 OCCURS 10, cu_dderr LIKE dderr, cu_corr_keytab_safe LIKE
corr_keytab OCCURS 50, cu_corr_keyhtb LIKE corr_keytab OCCURS 50,
lockable_objects_exist(1) TYPE c, e071_safe LIKE e071, cu_ko200_tab
LIKE ko200 OCCURS 10, cu_last_corr LIKE e071-trkorr, w_cu_ko200 LIKE
ko200, corr_for_insert LIKE e071-trkorr, rc LIKE sy-subrc, cu_new_locks
LIKE strlocktab OCCURS 10, cu_begix TYPE i, cu_hobjfunc(1) TYPE c,
cu_tdevc LIKE tdevc, cu_order_type LIKE e070-trfunction,
cu_obj_not_chkd(1) TYPE c, cu_task_type LIKE e070-trfunction,
cu_appendable(1) TYPE c, cu_request TYPE trwbo_request, cu_category
LIKE vim_syst, cu_corr_objtab LIKE LINE OF vim_corr_objtab OCCURS 0,
cu_last_cat LIKE vim_syst, cu_h_flag(1) TYPE c, cu_h_e071 LIKE e071,
cuiorder LIKE e071-trkorr, cuitask LIKE e071-trkorr. DATA:
lt_edt_objects TYPE tredt_objects, ls_edt_object TYPE LINE OF
tredt_objects. FIELD-SYMBOLS: <ls_e071> TYPE e071. FIELD-SYMBOLS:
<vim_corr_objtab> LIKE vim_corr_objtab, <e071> LIKE e071. CHECK
maint_mode EQ transportieren OR vim_client_state EQ vim_log. CHECK
x_header-flag NE vim_transport_denied. cu_h_flag = x_header-flag. IF
vim_corr_obj_viewname NE x_header-viewname. REFRESH vim_corr_objtab.
ELSE. cu_corr_objtab = vim_corr_objtab[]. ENDIF. e071_safe = e071.
CLEAR e071. LOOP AT corr_keytab WHERE mastername EQ x_header-viewname
AND ( mastertype EQ vim_unlockable_object OR mastertype EQ
vim_lockable_object ). MOVE: corr_keytab-trkorr TO e071-trkorr,
corr_keytab-pgmid TO e071-pgmid, corr_keytab-object TO e071-object,
corr_keytab-objfunc TO e071-objfunc, corr_keytab-activity TO
e071-activity. IF corr_keytab-objname EQ vim_long_objname.
e071-obj_name = corr_keytab-tabkey. ELSE. e071-obj_name =
corr_keytab-objname. ENDIF. APPEND e071 TO cu_e071_tab. READ TABLE
vim_corr_objtab WITH KEY pgmid = e071-pgmid object = e071-object
obj_name = e071-obj_name TRANSPORTING NO FIELDS. IF sy-subrc NE 0.
MOVE-CORRESPONDING e071 TO vim_corr_objtab. IF corr_keytab-mastertype
EQ vim_unlockable_object. vim_corr_objtab-lockable = space. ELSE.
vim_corr_objtab-lockable = lockable_objects_exist = 'X'. ENDIF. APPEND
vim_corr_objtab. IF corr_keytab-flag EQ 'V'. IF vim_corr_obj_viewname
NE x_header-viewname. APPEND vim_corr_objtab TO cu_corr_objtab. ENDIF.
ELSE. cu_obj_not_chkd = 'X'. ENDIF. ELSEIF corr_keytab-mastertype EQ
vim_lockable_object. lockable_objects_exist = 'X'. ENDIF. ENDLOOP. LOOP
AT cu_e071_tab INTO e071. LOOP AT corr_keytab WHERE mastertype EQ
e071-object AND mastername EQ e071-obj_name AND pgmid EQ
vim_deleted_key. corr_keytab-pgmid = transporter. APPEND corr_keytab TO
cu_e071k_tab. DELETE corr_keytab. ENDLOOP. ENDLOOP.
vim_corr_obj_viewname = x_header-viewname. LOOP AT corr_keytab. IF
x_header-flag NE space AND x_header-frm_e071 EQ space AND (
x_header-frm_e071ka NE space OR x_header-frm_e071ks NE space ). IF
corr_keytab-objname EQ vim_long_objname. READ TABLE cu_e071_tab WITH
KEY object = corr_keytab-object obj_name = corr_keytab-tabkey
TRANSPORTING NO FIELDS. ELSE. READ TABLE cu_e071_tab WITH KEY object =
corr_keytab-object obj_name = corr_keytab-objname TRANSPORTING NO
FIELDS. ENDIF. IF sy-subrc EQ 0. DELETE corr_keytab. ENDIF. ELSE. READ
TABLE cu_e071_tab WITH KEY object = corr_keytab-mastertype obj_name =
corr_keytab-mastername TRANSPORTING NO FIELDS. ENDIF. CHECK sy-subrc NE
0. APPEND corr_keytab TO cu_corr_keytab_safe. DELETE corr_keytab.
ENDLOOP. IF maint_mode EQ aendern AND lockable_objects_exist EQ space
AND cu_obj_not_chkd NE space. LOOP AT cu_e071_tab ASSIGNING <e071>.
MOVE-CORRESPONDING <e071> TO w_cu_ko200. APPEND w_cu_ko200 TO
cu_ko200_tab. ENDLOOP. CALL FUNCTION 'TR_OBJECTS_CHECK' IMPORTING
we_order = cuiorder we_task = cuitask we_objects_appendable =
cu_appendable TABLES wt_ko200 = cu_ko200_tab wt_e071k = corr_keytab
EXCEPTIONS cancel_edit_other_error = 1 show_only_other_error = 2 OTHERS
= 3. IF sy-subrc NE 0 OR cu_appendable EQ space. rc = sy-subrc. LOOP AT
cu_corr_keytab_safe INTO corr_keytab. APPEND corr_keytab. ENDLOOP. e071
= e071_safe. vim_corr_objtab[] = cu_corr_objtab. IF rc NE 0. MESSAGE ID
sy-msgid TYPE 'I' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3
sy-msgv4. RAISE saving_correction_failed. ELSE. sy-subrc = rc. EXIT.
ENDIF. ELSEIF cuiorder NE space OR cuitask NE space. <status>-order_nbr
= cuiorder. <status>-corr_nbr = cuitask. ENDIF. REFRESH cu_ko200_tab.
ENDIF. IF maint_mode EQ aendern AND lockable_objects_exist NE space OR
maint_mode EQ transportieren AND cu_obj_not_chkd NE space. IF
cu_obj_not_chkd NE space. CLEAR vim_last_source_system. LOOP AT
vim_corr_objtab WHERE lockable NE space. READ TABLE cu_corr_objtab WITH
KEY pgmid = vim_corr_objtab-pgmid object = vim_corr_objtab-object
obj_name = vim_corr_objtab-obj_name TRANSPORTING NO FIELDS. CHECK
sy-subrc NE 0. e071 = vim_corr_objtab. PERFORM check_lockable_object
USING e071 rc. IF rc NE 0 OR x_header-flag EQ vim_transport_denied.
x_header-flag = cu_h_flag. MODIFY x_header INDEX 1. MESSAGE i162(sv)
WITH vim_corr_objtab-pgmid vim_corr_objtab-object
vim_corr_objtab-obj_name. IF maint_mode EQ aendern. rc = 9. EXIT. ELSE.
DELETE vim_corr_objtab. ENDIF. ENDIF. ENDLOOP. DESCRIBE TABLE
vim_corr_objtab. IF maint_mode EQ aendern AND rc NE 0 OR sy-tfill EQ 0.
LOOP AT cu_corr_keytab_safe INTO corr_keytab. APPEND corr_keytab.
ENDLOOP. e071 = e071_safe. RAISE saving_correction_failed. ENDIF.
ENDIF. IF <status>-corr_nbr EQ space. LOOP AT vim_corr_objtab INTO
e071. CALL FUNCTION 'TR_CHECK_TYPE' EXPORTING wi_e071 = e071 IMPORTING
we_tadir = cu_tadir we_category = cu_category. CHECK cu_category EQ
vim_syst OR cu_category EQ vim_cust_syst OR cu_category EQ vim_appl.
cu_last_cat = vim_syst. cu_h_e071 = e071. ENDLOOP. IF cu_last_cat EQ
space. cu_category = vim_cust. ELSE. cu_category = cu_last_cat. e071 =
cu_h_e071. ENDIF. CALL FUNCTION 'TRINT_GET_REQUEST_TYPE' EXPORTING
iv_pgmid = e071-pgmid iv_object = e071-object iv_obj_name =
e071-obj_name iv_category = cu_category is_tadir = cu_tadir is_tdevc =
cu_tdevc IMPORTING ev_request_type = cu_order_type ev_task_type =
cu_task_type EXCEPTIONS internal_error = 1 no_request_needed = 2
cts_initialization_failure = 3 OTHERS = 4. CASE sy-subrc. WHEN 0. WHEN
2. cu_order_type = 'K'. cu_task_type = 'S'. WHEN OTHERS. LOOP AT
cu_corr_keytab_safe INTO corr_keytab. APPEND corr_keytab. ENDLOOP. e071
= e071_safe. vim_corr_objtab[] = cu_corr_objtab. MESSAGE ID sy-msgid
TYPE 'I' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
RAISE saving_correction_failed. ENDCASE. DO. CALL FUNCTION
'TRINT_ORDER_CHOICE' EXPORTING wi_order_type = cu_order_type
wi_task_type = cu_task_type wi_category = cu_category wi_cli_dep =
space IMPORTING we_order = <status>-order_nbr we_task =
<status>-corr_nbr TABLES wt_e071 = cu_e071_tab wt_e071k = corr_keytab
EXCEPTIONS no_correction_selected = 1 display_mode = 2
object_append_error = 3 recursive_call = 4 OTHERS = 5. IF sy-subrc NE
0. LOOP AT cu_corr_keytab_safe INTO corr_keytab. APPEND corr_keytab.
ENDLOOP. e071 = e071_safe. vim_corr_objtab[] = cu_corr_objtab. IF
sy-subrc NE 1. MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno WITH
sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. RAISE
saving_correction_failed. ENDIF. IF maint_mode EQ transportieren. CALL
FUNCTION 'ENQUEUE_E_TRKORR' EXPORTING trkorr = <status>-corr_nbr
EXCEPTIONS foreign_lock = 01 system_failure = 02. CASE sy-subrc. WHEN
0. WHEN 1. MESSAGE s092(sv) WITH <status>-corr_nbr. CONTINUE. WHEN 2.
MESSAGE a095(sv) WITH <status>-corr_nbr. CONTINUE. ENDCASE.
<status>-corr_enqud = 'X'. EXIT. ELSE. EXIT. ENDIF. ENDDO. ENDIF. LOOP
AT cu_e071_tab INTO e071 WHERE trkorr EQ space. e071-trkorr =
<status>-corr_nbr. MODIFY cu_e071_tab FROM e071. LOOP AT
vim_corr_objtab WHERE pgmid = e071-pgmid AND object = e071-object AND
obj_name = e071-obj_name. vim_corr_objtab-trkorr = <status>-corr_nbr.
MODIFY vim_corr_objtab. EXIT. ENDLOOP. sy-fdpos = strlen( e071-obj_name
). IF sy-fdpos GT vim_71k_name_length. READ TABLE corr_keytab WITH KEY
pgmid = e071-pgmid object = e071-object objname = vim_long_objname
tabkey = e071-obj_name. ELSE. READ TABLE corr_keytab WITH KEY pgmid =
e071-pgmid object = e071-object objname = e071-obj_name. ENDIF. IF
sy-subrc EQ 0. corr_keytab-trkorr = <status>-corr_nbr. MODIFY
corr_keytab INDEX sy-tabix. ENDIF. ENDLOOP. ENDIF. IF maint_mode EQ
transportieren OR lockable_objects_exist NE space. SORT cu_e071_tab BY
trkorr. LOOP AT cu_e071_tab INTO e071 WHERE objfunc NE 'D'. cu_begix =
sy-tabix + 1. EXIT. ENDLOOP. IF sy-subrc EQ 0. APPEND e071 TO
cu_e071_htb. LOOP AT corr_keytab WHERE mastertype EQ e071-object AND
mastername EQ e071-obj_name. APPEND corr_keytab TO cu_corr_keyhtb.
ENDLOOP. cu_last_corr = e071-trkorr. LOOP AT cu_e071_tab INTO e071 FROM
cu_begix WHERE objfunc NE 'D'. IF e071-trkorr NE cu_last_corr. LOOP AT
cu_e071_htb ASSIGNING <ls_e071>. MOVE-CORRESPONDING <ls_e071> TO
ls_edt_object. APPEND ls_edt_object TO lt_edt_objects. ENDLOOP. CALL
FUNCTION 'TR_EC_CUST_ORIG_LANG' EXPORTING it_objects = lt_edt_objects
iv_checkmode = ' ' iv_dialog = 'X' CHANGING ct_keys = cu_corr_keyhtb
EXCEPTIONS cancel = 1 display_only = 2 OTHERS = 3. IF sy-subrc <> 0.
ENDIF. CALL FUNCTION 'TRINT_APPEND_TO_COMM_ARRAYS' EXPORTING wi_trkorr
= cu_last_corr TABLES wt_e071 = cu_e071_htb wt_e071k = cu_corr_keyhtb
wt_trmess_int = cu_trmess wt_trpar_int = cu_trpar EXCEPTIONS OTHERS =
08. IF sy-subrc NE 0. LOOP AT cu_corr_keytab_safe INTO corr_keytab.
APPEND corr_keytab. ENDLOOP. e071 = e071_safe. vim_corr_objtab[] =
cu_corr_objtab. MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno WITH
sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. RAISE saving_correction_failed.
ENDIF. REFRESH: cu_e071_htb, cu_corr_keyhtb. cu_last_corr =
e071-trkorr. ENDIF. APPEND e071 TO cu_e071_htb. LOOP AT corr_keytab
WHERE mastertype EQ e071-object AND mastername EQ e071-obj_name. APPEND
corr_keytab TO cu_corr_keyhtb. ENDLOOP. ENDLOOP. ENDIF. DESCRIBE TABLE
cu_e071_htb. IF sy-tfill NE 0. LOOP AT cu_e071_htb ASSIGNING <ls_e071>.
MOVE-CORRESPONDING <ls_e071> TO ls_edt_object. APPEND ls_edt_object TO
lt_edt_objects. ENDLOOP. CALL FUNCTION 'TR_EC_CUST_ORIG_LANG' EXPORTING
it_objects = lt_edt_objects iv_checkmode = ' ' iv_dialog = 'X' CHANGING
ct_keys = cu_corr_keyhtb EXCEPTIONS cancel = 1 display_only = 2 OTHERS
= 3. IF sy-subrc <> 0. ENDIF. CALL FUNCTION
'TRINT_APPEND_TO_COMM_ARRAYS' EXPORTING wi_trkorr = e071-trkorr TABLES
wt_e071 = cu_e071_htb wt_e071k = cu_corr_keyhtb wt_trmess_int =
cu_trmess wt_trpar_int = cu_trpar EXCEPTIONS key_check_keysyntax_error
= 1 ob_check_obj_error = 2 tr_lockmod_failed = 3 tr_lock_enqueue_failed
= 4 tr_wrong_order_type = 5 tr_order_update_error = 6 file_access_error
= 7 ob_no_systemname = 8 OTHERS = 9. IF sy-subrc NE 0. LOOP AT
cu_corr_keytab_safe INTO corr_keytab. APPEND corr_keytab. ENDLOOP. e071
= e071_safe. vim_corr_objtab[] = cu_corr_objtab. MESSAGE ID sy-msgid
TYPE 'I' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
RAISE saving_correction_failed. ENDIF. ENDIF. IF maint_mode EQ
transportieren. LOOP AT cu_e071_tab INTO e071 WHERE objfunc NE space.
IF e071-objfunc EQ 'K'. CALL FUNCTION 'TRINT_DELETE_COMM_KEYS'
EXPORTING wi_e071 = e071 wi_trkorr = <status>-corr_nbr TABLES wt_e071k
= cu_e071k_tab EXCEPTIONS e070_update_error = 01 keys_protected = 02
order_already_released = 03 unallowed_ordertyp = 04 user_not_owner = 05
wrong_client = 06. IF sy-subrc NE 0. LOOP AT cu_corr_keytab_safe INTO
corr_keytab. APPEND corr_keytab. ENDLOOP. e071 = e071_safe.
vim_corr_objtab[] = cu_corr_objtab. MESSAGE ID sy-msgid TYPE 'I' NUMBER
sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. RAISE
saving_correction_failed. ELSE. LOOP AT corr_keytab WHERE mastertype EQ
e071-object AND mastername EQ e071-obj_name. EXIT. ENDLOOP. ENDIF.
ELSEIF e071-objfunc EQ 'D'. sy-subrc = 8. ELSE. CLEAR sy-subrc. ENDIF.
IF sy-subrc NE 0. cu_hobjfunc = e071-objfunc. cu_request-objects =
cu_e071_tab. cu_request-objects_filled = 'X'. CALL FUNCTION
'TRINT_DELETE_COMM_OBJECT_KEYS' EXPORTING is_e071_delete = e071
iv_dialog_flag = ' ' CHANGING cs_request = cu_request EXCEPTIONS OTHERS
= 8. IF sy-subrc NE 0. LOOP AT cu_corr_keytab_safe INTO corr_keytab.
APPEND corr_keytab. ENDLOOP. e071 = e071_safe. vim_corr_objtab[] =
cu_corr_objtab. MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno WITH
sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. RAISE saving_correction_failed.
ENDIF. IF sy-subrc EQ 0 AND cu_hobjfunc EQ 'D'. DELETE
cu_corr_keytab_safe WHERE pgmid EQ e071-pgmid AND object EQ e071-object
AND ( objname EQ e071-obj_name OR objname EQ vim_long_objname AND
tabkey EQ e071-obj_name ) AND objfunc EQ e071-objfunc. ENDIF. ENDIF.
ENDLOOP. CLEAR: <status>-keytbmodfd, <status>-upd_flag. MESSAGE
s096(sv) WITH <status>-corr_nbr. ENDIF. ELSE. ASSIGN vim_corr_objtab TO
<vim_corr_objtab>. LOOP AT vim_corr_objtab. MOVE-CORRESPONDING
<vim_corr_objtab> TO w_cu_ko200. APPEND w_cu_ko200 TO cu_ko200_tab.
ENDLOOP. IF <status>-order_nbr NE space. corr_for_insert =
<status>-order_nbr. ELSE. corr_for_insert = <status>-corr_nbr. ENDIF.
CALL FUNCTION 'TR_OBJECTS_INSERT' EXPORTING wi_order = corr_for_insert
IMPORTING we_order = <status>-order_nbr we_task = <status>-corr_nbr
TABLES wt_ko200 = cu_ko200_tab wt_e071k = corr_keytab EXCEPTIONS
cancel_edit_other_error = 4 show_only_other_error = 6 OTHERS = 8. IF
sy-subrc NE 0. rc = sy-subrc. LOOP AT cu_corr_keytab_safe INTO
corr_keytab. APPEND corr_keytab. ENDLOOP. e071 = e071_safe.
vim_corr_objtab[] = cu_corr_objtab. IF rc GT 4. MESSAGE ID sy-msgid
TYPE 'I' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. RAISE saving_correction_failed. ENDIF. PERFORM
vim_synchronizer_call USING cu_ko200_tab[] corr_keytab[] space. ENDIF.
IF maint_mode EQ aendern. IF x_header-flag NE space AND
x_header-frm_e071 EQ space AND ( x_header-frm_e071ks NE space OR
x_header-frm_e071ka NE space ). REFRESH corr_keytab. ELSE. DELETE
corr_keytab WHERE mastertype NE vim_unlockable_object AND mastertype NE
vim_lockable_object. ENDIF. ENDIF. LOOP AT cu_corr_keytab_safe INTO
corr_keytab. IF corr_keytab-mastername EQ x_header-viewname AND (
corr_keytab-mastertype EQ vim_unlockable_object OR
corr_keytab-mastertype EQ vim_lockable_object ). corr_keytab-trkorr =
<status>-corr_nbr. ENDIF. APPEND corr_keytab. ENDLOOP. SUBTRACT
sy-subrc FROM sy-subrc. e071 = e071_safe. LOOP AT vim_corr_objtab. READ
TABLE cu_corr_objtab WITH KEY pgmid = vim_corr_objtab-pgmid object =
vim_corr_objtab-object obj_name = vim_corr_objtab-obj_name TRANSPORTING
NO FIELDS. CHECK sy-subrc NE 0. DELETE vim_corr_objtab. ENDLOOP.
e071-trkorr = <status>-corr_nbr. last_corr_number = <status>-l_corr_nbr
= <status>-corr_nbr. CLEAR <status>-keytbmodfd. FREE: cu_e071k_tab,
cu_trmess, cu_trpar, cu_e071_tab, cu_corr_keytab_safe, cu_ko200_tab,
cu_e071_htb, cu_new_locks. ENDFORM. FORM TRANSPORTIEREN. CALL FUNCTION
'POPUP_TO_CONFIRM_WITH_MESSAGE' EXPORTING TITEL = SVIM_TEXT_020
DIAGNOSETEXT1 = SVIM_TEXT_018 DIAGNOSETEXT2 = SVIM_TEXT_021
DIAGNOSETEXT3 = SVIM_TEXT_022 TEXTLINE1 = SVIM_TEXT_023 TEXTLINE2 =
SVIM_TEXT_019 IMPORTING ANSWER = ANSWER. CASE ANSWER. WHEN 'J'.
SY-SUBRC = 0. WHEN 'N'. CLEAR <STATUS>-UPD_FLAG. SY-SUBRC = 8. WHEN
'A'. SY-SUBRC = 12. ENDCASE. ENDFORM. FORM GET_KEYTAB. LOCAL: E071.
LOOP AT VIM_CORR_OBJTAB INTO E071. CALL FUNCTION 'TRINT_READ_COMM_KEYS'
EXPORTING WI_APPENDING = 'X' WI_E071 = E071 WI_TRKORR =
<STATUS>-CORR_NBR TABLES WT_E071K = CORR_KEYTAB. ENDLOOP. CLEAR:
<STATUS>-KEYTBMODFD, GET_CORR_KEYTAB, <STATUS>-KEYTBINVLD. ENDFORM.
FORM prepare_read_request. DATA: action TYPE activ_auth,
oc_to_be_checked TYPE xfeld, sellines TYPE i. PERFORM
init_state_vector. PERFORM vim_reset_texttab USING view_name. PERFORM
vim_bc_logs_get USING view_name x_header x_namtab[] CHANGING
vim_bc_entry_list. IF vim_adjust_middle_level_mode EQ subset.
vim_adj_header = x_header[]. CLEAR x_header-subsetflag. MODIFY x_header
INDEX 1. vim_adj_namtab = x_namtab[]. LOOP AT x_namtab WHERE readonly
EQ subset AND keyflag NE space. CLEAR x_namtab-readonly. MODIFY
x_namtab. ENDLOOP. vim_adj_dbasellist = dba_sellist[]. LOOP AT
dba_sellist WHERE ddic CO vim_subset_marks. IF dba_sellist-value IS
INITIAL AND dba_sellist-initial EQ space. DELETE dba_sellist. ELSE.
TRANSLATE dba_sellist-ddic USING 'S BX'. MODIFY dba_sellist. ENDIF.
ENDLOOP. DESCRIBE TABLE dba_sellist. IF sy-tfill GT 0. READ TABLE
dba_sellist INDEX sy-tfill. CLEAR dba_sellist-and_or. MODIFY
dba_sellist INDEX sy-tabix. ENDIF. ENDIF. IF vim_called_by_cluster =
space. DELETE dba_sellist WHERE from_auth <> space AND ddic <> 'S' and
ddic <> 'B'. DESCRIBE TABLE dba_sellist LINES sellines. IF sellines GT
0. READ TABLE dba_sellist INDEX sellines. CLEAR dba_sellist-and_or.
MODIFY dba_sellist INDEX sy-tabix. ENDIF. ENDIF. IF NOT vim_oc_inst IS
INITIAL. IF <status>-st_action = anzeigen. action = svorg_read. ELSE.
action = svorg_maint. ENDIF. CALL METHOD
vim_oc_inst->combine_vimsel_with_auth EXPORTING action = action
CHANGING sellist = dba_sellist[]. CALL METHOD
vim_oc_inst->get_to_be_checked IMPORTING to_be_checked =
oc_to_be_checked. IF oc_to_be_checked <> space or x_header-bastab <>
space. PERFORM vim_maint_selflag USING 'S' CHANGING x_header-selection.
ENDIF. ENDIF. ENDFORM. FORM VIM_FILL_WHERETAB. CALL FUNCTION
'VIEW_FILL_WHERETAB' EXPORTING TABLENAME = X_HEADER-ROOTTAB TABLES
SELLIST = DBA_SELLIST WHERETAB = VIM_WHERETAB X_NAMTAB = X_NAMTAB
EXCEPTIONS NO_CONDITIONS_FOR_TABLE = 01. ENDFORM. FORM edit_view_entry
TABLES ext tot header STRUCTURE vimdesc namtab STRUCTURE vimnamtab
sellist STRUCTURE vimsellist USING value(entry) value(action). DATA:
state_vect_name(37) TYPE c, rc LIKE sy-subrc, pos LIKE sy-fdpos,
texttablename(31) TYPE c VALUE '*          ', mmark(1) TYPE c, tab_rc
LIKE sy-subrc, tab_ix LIKE sy-tabix, dummy_tab LIKE vimexclfun OCCURS
1, name(20) TYPE c. FIELD-SYMBOLS: <tot_x> TYPE x, <ext_x> TYPE x,
<ent_x> TYPE x, <viewkey> TYPE x, <act> TYPE c, <xact> TYPE c, <mrk>
TYPE c, <xmrk> TYPE c, <txt_act> TYPE c, <tot_struc> TYPE ANY,
<ent_struc> TYPE ANY, <tot_txt> TYPE x, <ent_txt> TYPE x, <ent_txt2>
TYPE x, <tot_txt_struc> TYPE ANY, <txt_init> TYPE ANY. READ TABLE
header INDEX 1. pos = header-after_tabc. ASSIGN: tot TO <tot_x>
CASTING, ext TO <ext_x> CASTING, entry TO <ent_x> CASTING, <tot_x> TO
<tot_struc> CASTING TYPE (header-maintview), <ent_x> TO <ent_struc>
CASTING TYPE (header-maintview). IF header-bastab NE space AND
header-texttbexst NE space. ADD header-aft_txttbc TO pos. MOVE
header-texttab TO texttablename+1. ASSIGN:
<tot_x>+header-after_tabc(header-texttablen) TO <tot_txt>,
<ent_x>+header-after_tabc(header-texttablen) TO <ent_txt>, <tot_txt> TO
<tot_txt_struc> CASTING TYPE (header-texttab), (texttablename) TO
<txt_init>. ENDIF. ASSIGN: <ent_x>(header-keylen) TO <viewkey>,
<tot_x>+pos(cl_abap_char_utilities=>charsize) TO <act> CASTING,
<ext_x>+pos(cl_abap_char_utilities=>charsize) TO <xact> CASTING. ADD
cl_abap_char_utilities=>charsize TO pos. ASSIGN:
<tot_x>+pos(cl_abap_char_utilities=>charsize) TO <mrk> CASTING,
<ext_x>+pos(cl_abap_char_utilities=>charsize) TO <xmrk> CASTING. IF
header-bastab NE space AND header-texttbexst NE space. ADD
cl_abap_char_utilities=>charsize TO pos. ASSIGN
<tot_x>+pos(cl_abap_char_utilities=>charsize) TO <txt_act> CASTING.
ENDIF. IF header-viewname NE last_ext_modif_view. MOVE
state_vect_prefix TO state_vect_name. WRITE header-maintview TO
state_vect_name+state_vect_prefix_length. ASSIGN (state_vect_name) TO
<state>. MOVE header-viewname TO last_ext_modif_view. ENDIF. READ TABLE
tot WITH KEY <viewkey> BINARY SEARCH. tab_rc = sy-subrc. tab_ix =
sy-tabix. IF sy-subrc EQ 0. CASE action. WHEN 'DEL'. CASE <act>. WHEN
neuer_eintrag. <act> = neuer_geloescht. WHEN original. <act> =
geloescht. WHEN aendern. <act> = update_geloescht. ENDCASE. IF
header-bastab NE space AND header-texttbexst NE space. CASE <txt_act>.
WHEN neuer_eintrag. <txt_act> = neuer_geloescht. WHEN original. IF
<tot_txt_struc> NE <txt_init>. <txt_act> = geloescht. ENDIF. WHEN
aendern. <txt_act> = update_geloescht. ENDCASE. ENDIF. mmark = <mrk>.
IF <mrk> EQ markiert. <mrk> = nicht_markiert. SUBTRACT 1 FROM
<state>-mk_to. ENDIF. MODIFY tot INDEX sy-tabix. READ TABLE ext WITH
KEY <viewkey>. IF sy-subrc EQ 0. IF mmark EQ markiert. SUBTRACT 1 FROM
<state>-mk_xt. ENDIF. DELETE ext INDEX sy-tabix. SUBTRACT 1 FROM
<state>-maxlines. ENDIF. WHEN 'UPD'. IF header-bastab NE space AND
header-texttbexst NE space. IF <tot_txt> NE <ent_txt>. IF
<tot_txt_struc> EQ <txt_init>. <txt_act> = neuer_eintrag. ELSE. IF
<txt_act> EQ original. <txt_act> = aendern. ENDIF. ENDIF. MOVE
<ent_txt> TO <tot_txt>. ENDIF. ENDIF. MOVE <ent_struc> TO <tot_struc>.
IF <act> EQ original. <act> = aendern. ENDIF. MODIFY tot INDEX
sy-tabix. READ TABLE ext WITH KEY <viewkey>. IF sy-subrc EQ 0. MOVE tot
TO ext. MODIFY ext INDEX sy-tabix. ENDIF. WHEN 'UDL'. CASE <act>. WHEN
neuer_geloescht. <act> = neuer_eintrag. WHEN geloescht. <act> =
original. WHEN update_geloescht. <act> = aendern. WHEN OTHERS. rc = 8.
ENDCASE. IF rc EQ 0. IF header-bastab NE space AND header-texttbexst NE
space. CASE <txt_act>. WHEN neuer_geloescht. <txt_act> = neuer_eintrag.
WHEN geloescht. <txt_act> = original. WHEN update_geloescht. <txt_act>
= aendern. ENDCASE. ENDIF. MODIFY tot INDEX sy-tabix. READ TABLE ext
WITH KEY <viewkey>. IF sy-subrc EQ 0. IF <state>-selected EQ geloescht.
DELETE ext INDEX sy-tabix. ELSE. <xmrk> = <mrk>. <xact> = <act>. MODIFY
ext INDEX sy-tabix. ENDIF. ENDIF. ENDIF. WHEN 'IGN'. IF <mrk> EQ
markiert. MOVE uebergehen TO <mrk>. MODIFY tot INDEX sy-tabix. READ
TABLE ext WITH KEY <viewkey>. IF sy-subrc EQ 0. <xmrk> = <mrk>. MODIFY
ext INDEX sy-tabix. ENDIF. ENDIF. rc = 1. WHEN 'MRK'. IF <mrk> EQ
markiert. MOVE nicht_markiert TO <mrk>. ELSE. MOVE markiert TO <mrk>.
ENDIF. MODIFY tot INDEX sy-tabix. IF <mrk> EQ markiert. ADD 1 TO
<state>-mk_to. ELSE. SUBTRACT 1 FROM <state>-mk_to. ENDIF. READ TABLE
ext WITH KEY <viewkey>. IF sy-subrc EQ 0. <xmrk> = <mrk>. MODIFY ext
INDEX sy-tabix. IF <mrk> EQ markiert. ADD 1 TO <state>-mk_xt. ELSE.
SUBTRACT 1 FROM <state>-mk_xt. ENDIF. ENDIF. rc = 1. ENDCASE. ELSE.
CLEAR sy-subrc. IF action NE 'UPD'. rc = 8. ELSE. IF header-selection
NE space. IF header-bastab <> space AND header-texttbexst <> space.
ASSIGN <ent_txt> TO <ent_txt2>. ELSE. ASSIGN <ent_x> TO <ent_txt2>.
ENDIF. CALL FUNCTION 'TABLE_RANGE_CHECK' EXPORTING tabname =
header-maintview entry = entry entry_text = <ent_txt2> ddic = 'J' key =
'J' ignore_blank_subsetfields = 'N' TABLES x_namtab = namtab x_header =
header sellist = sellist EXCEPTIONS entry_not_fits = 8. ENDIF. IF
sy-subrc EQ 0. MOVE <ent_struc> TO <tot_struc>. <act> = neuer_eintrag.
<mrk> = nicht_markiert. IF header-bastab NE space AND header-texttbexst
NE space. <tot_txt> = <ent_txt>. IF <tot_txt_struc> NE <txt_init>.
<txt_act> = neuer_eintrag. ELSE. <txt_act> = original. ENDIF. ENDIF.
CASE tab_rc. WHEN 4. INSERT tot INDEX tab_ix. WHEN 8. APPEND tot.
ENDCASE. ELSE. rc = sy-subrc. ENDIF. ENDIF. ENDIF. IF rc EQ 0. MOVE 'X'
TO <state>-upd_flag. ENDIF. sy-subrc = ( rc DIV 8 ) * 8. ENDFORM. FORM
zurueckholen. DATA: number_of_ign_entr TYPE i, key_safe TYPE tabl1024,
z_ign_entr_ex(1) TYPE c, z_specmode_safe(1) TYPE c. IF status-action NE
aendern OR status-delete NE geloescht. MESSAGE i001(sv). EXIT. ENDIF.
CLEAR counter. z_specmode_safe = vim_special_mode. vim_special_mode =
vim_undelete. IF status-mode EQ detail_bild. MOVE <xmark> TO
deta_mark_safe. IF x_header-delmdtflag NE space. PERFORM
check_if_entry_is_to_display USING 'L' <vim_xextract_key> space
<vim_begdate>. number_of_ign_entr = sy-subrc. key_safe =
<vim_xextract_key>. ENDIF. IF x_header-delmdtflag EQ space OR
number_of_ign_entr LT 8. READ TABLE extract INDEX nextline. ELSE. READ
TABLE total WITH KEY key_safe BINARY SEARCH. extract = total. ENDIF.
ENDIF. IF x_header-frm_bf_udl NE space. PERFORM (x_header-frm_bf_udl)
IN PROGRAM (sy-repid). ENDIF. IF vim_called_by_cluster NE space.
PERFORM vim_store_state_info. CALL FUNCTION
'VIEWCLUSTER_UNDO_DEPENDENT' EXPORTING view_name = x_header-viewname
status_mode = status-mode workarea = extract no_dialog =
vim_external_mode IMPORTING ign_entries_exist = z_ign_entr_ex. IF
z_ign_entr_ex NE space. ignored_entries_exist = z_ign_entr_ex. ENDIF.
ENDIF. IF status-mode EQ list_bild. PERFORM liste_zurueckholen. ELSE.
IF <xmark> NE uebergehen. PERFORM detail_zurueckholen. ENDIF. ENDIF. IF
replace_mode NE space AND counter EQ 0. function = ok_code = 'IGN '.
ENDIF. IF x_header-frm_af_udl NE space. PERFORM (x_header-frm_af_udl)
IN PROGRAM (sy-repid). ELSE. IF ignored_entries_exist NE space. PERFORM
mark_ignored_entries CHANGING number_of_ign_entr. IF replace_mode EQ
space. IF number_of_ign_entr EQ 1. MESSAGE s113(sv). ELSEIF
number_of_ign_entr GT 1. MESSAGE s114(sv) WITH number_of_ign_entr.
ENDIF. ENDIF. ENDIF. ENDIF. vim_special_mode = z_specmode_safe.
ENDFORM. FORM LOESCHEN. DATA: NUMBER_OF_IGN_ENTR TYPE I, KEY_SAFE type
VIM_tabKEY, L_IGN_ENTR_EX(1) TYPE C. IF STATUS-ACTION NE AENDERN AND
STATUS-ACTION NE HINZUFUEGEN. MESSAGE I001(SV). EXIT. ENDIF. IF
STATUS-MODE EQ DETAIL_BILD. IF STATUS-ACTION EQ HINZUFUEGEN AND NEUER
EQ 'J'. MOVE <INITIAL> TO <TABLE1>. IF X_HEADER-BASTAB NE SPACE AND
X_HEADER-TEXTTBEXST NE SPACE. MOVE <TEXT_INITIAL> TO <TABLE1_TEXT>.
ENDIF. MESSAGE S013(SV). CLEAR <STATUS>-UPD_FLAG. EXIT. ENDIF. MOVE
<XMARK> TO DETA_MARK_SAFE. IF X_HEADER-DELMDTFLAG NE SPACE. PERFORM
CHECK_IF_ENTRY_IS_TO_DISPLAY USING 'L' <VIM_xEXTRACT_KEY> SPACE
<VIM_BEGDATE>. NUMBER_OF_IGN_ENTR = SY-SUBRC. KEY_SAFE =
<VIM_xEXTRACT_KEY>. ENDIF. IF X_HEADER-DELMDTFLAG EQ SPACE OR
NUMBER_OF_IGN_ENTR LT 8. READ TABLE EXTRACT INDEX NEXTLINE. ELSE. MOVE
KEY_SAFE TO <VIM_xEXTRACT_KEY>. READ TABLE TOTAL WITH KEY
<VIM_xEXTRACT_KEY> BINARY SEARCH. EXTRACT = TOTAL. ENDIF. ENDIF. IF
X_HEADER-FRM_BF_DEL NE SPACE. PERFORM (X_HEADER-FRM_BF_DEL) IN PROGRAM
(SY-REPID). ENDIF. IF VIM_CALLED_BY_CLUSTER NE SPACE. PERFORM
VIM_STORE_STATE_INFO. CALL FUNCTION 'VIEWCLUSTER_DELETE_DEPENDENT'
EXPORTING VIEW_NAME = X_HEADER-VIEWNAME STATUS_MODE = STATUS-MODE
WORKAREA = EXTRACT NO_DIALOG = VIM_EXTERNAL_MODE IMPORTING
IGN_ENTRIES_EXIST = L_IGN_ENTR_EX. IF L_IGN_ENTR_EX NE SPACE.
IGNORED_ENTRIES_EXIST = L_IGN_ENTR_EX. ENDIF. ENDIF. IF STATUS-MODE EQ
LIST_BILD. PERFORM LISTE_LOESCHE. ELSE. IF <XMARK> NE UEBERGEHEN.
PERFORM DELETE_CHECK_KEYRANGE. IF SY-SUBRC EQ 0. PERFORM
DETAIL_LOESCHE. ELSE. COUNTER = 0. ENDIF. ELSE. COUNTER = 0. ENDIF.
ENDIF. IF VIM_SPECIAL_MODE EQ VIM_UPGRADE AND COUNTER EQ 0. FUNCTION =
OK_CODE = 'IGN '. ENDIF. IF X_HEADER-FRM_AF_DEL NE SPACE. PERFORM
(X_HEADER-FRM_AF_DEL) IN PROGRAM (SY-REPID). ELSE. IF
IGNORED_ENTRIES_EXIST NE SPACE. PERFORM MARK_IGNORED_ENTRIES CHANGING
NUMBER_OF_IGN_ENTR. CHECK VIM_SPECIAL_MODE NE VIM_UPGRADE. IF
NUMBER_OF_IGN_ENTR EQ 1. MESSAGE S115(SV). ELSEIF NUMBER_OF_IGN_ENTR GT
1. MESSAGE S116(SV) WITH NUMBER_OF_IGN_ENTR. ENDIF. ENDIF. ENDIF.
ENDFORM. FORM DELETE_CHECK_KEYRANGE. LOCAL: EXTRACT, TOTAL, <TABLE1>.
DATA: DCK_SPECMODE_SAFE LIKE VIM_SPECIAL_MODE. CLEAR SY-SUBRC. CHECK
X_HEADER-CUSTOMAUTH CO SAP_CUST_CTRL_CLASSES OR VIM_ALE_KEYSPEC_CHECK
NE SPACE. DCK_SPECMODE_SAFE = VIM_SPECIAL_MODE. PERFORM
MOVE_EXTRACT_TO_VIEW_WA. IF STATUS-MODE EQ LIST_BILD. VIM_SPECIAL_MODE
= VIM_DELETE. ELSE. CLEAR VIM_SPECIAL_MODE. ENDIF. CLEAR
VIM_KEYRANGE_ALR_CHECKED. PERFORM CHECK_ALLOWED_KEYRANGES. IF SY-SUBRC
NE 0 AND vim_import_profile EQ SPACE. IF STATUS-MODE EQ LIST_BILD. CASE
STATUS-TYPE. WHEN EINSTUFIG. CALL SCREEN LISTE. IF OK_CODE EQ 'IGN '.
FUNCTION = OK_CODE. ENDIF. WHEN ZWEISTUFIG. PERFORM
PROCESS_DETAIL_SCREEN USING 'C'. STATUS-MODE = LIST_BILD. ENDCASE.
ENDIF. IF VIM_ALE_KEYSPEC_CHECK NE SPACE. FUNCTION = 'IGN '. ENDIF.
CLEAR: SY-SUBRC, OK_CODE. CASE FUNCTION. WHEN 'IGN '. SY-SUBRC = 4.
WHEN 'ABR '. SY-SUBRC = 8. ENDCASE. ENDIF. VIM_SPECIAL_MODE =
DCK_SPECMODE_SAFE. FUNCTION = 'DELE'. ENDFORM. FORM
mark_ignored_entries CHANGING mie_number. DATA: translation_mask(2)
TYPE c, h_ix LIKE sy-tabix. CHECK ignored_entries_exist NE space. MOVE:
uebergehen TO translation_mask, markiert TO translation_mask+1(1). IF
status-mode EQ list_bild. CLEAR mie_number. LOOP AT total. CHECK <mark>
EQ uebergehen. ADD 1 TO mie_number. READ TABLE extract WITH KEY
<vim_xtotal_key> BINARY SEARCH. IF sy-subrc EQ 0. TRANSLATE <xmark>
USING translation_mask. MODIFY extract INDEX sy-tabix. ENDIF. TRANSLATE
<mark> USING translation_mask. MODIFY total. ENDLOOP. ELSE. MOVE
deta_mark_safe TO translation_mask+1(1). READ TABLE extract INDEX
nextline. CHECK sy-subrc = 0. MOVE sy-tabix TO h_ix. READ TABLE total
WITH KEY <vim_xextract_key> BINARY SEARCH. TRANSLATE <mark> USING
translation_mask. MODIFY total INDEX sy-tabix. TRANSLATE <xmark> USING
translation_mask. MODIFY extract INDEX h_ix. mie_number = 1. ENDIF. IF
mie_number > 0. CLEAR ignored_entries_exist. ENDIF. ENDFORM. FORM
build_valtab_hfields. DATA: fieldname TYPE fnam_____4. FIELD-SYMBOLS:
<value> TYPE ANY, <valfld> TYPE ANY, <value_tab> TYPE x. CLEAR
value_tab. ASSIGN value_tab TO <value_tab> CASTING. LOOP AT
structure_table. IF x_header-bastab NE space AND x_header-texttbexst NE
space AND structure_table-tabname EQ x_header-texttab. ASSIGN COMPONENT
structure_table-fieldname OF STRUCTURE <vim_ext_txt_struc> TO <value>.
ELSE. LOOP AT x_namtab WHERE viewfield = structure_table-fieldname AND
( texttabfld = space OR keyflag = space ). ASSIGN COMPONENT
structure_table-fieldname OF STRUCTURE <vim_extract_struc> TO <value>.
EXIT. ENDLOOP. ENDIF. CHECK <value> IS ASSIGNED. CONCATENATE
structure_table-tabname structure_table-fieldname INTO fieldname
SEPARATED BY '-'. ASSIGN
<value_tab>+structure_table-offset(structure_table-intlen) TO <valfld>
CASTING TYPE (fieldname). MOVE <value> TO <valfld>. ENDLOOP. APPEND
value_tab. ENDFORM. FORM check_allowed_keyranges. DATA: roottab_key
LIKE e071k-tabkey, tablename LIKE vimdesc-viewname, allowed,
mess_type(1) TYPE c VALUE 'W', ale_msgty(1) TYPE c VALUE 'E', ale_msgno
LIKE sy-msgno, ale_msgid LIKE sy-msgid, ale_msgv1 LIKE sy-msgv1,
ale_msgv2 LIKE sy-msgv2, ale_msgv3 LIKE sy-msgv3, ale_msgv4 LIKE
sy-msgv4. FIELD-SYMBOLS: <key_x> TYPE x, <h_old_mkey2> TYPE x. CHECK
vim_keyrange_alr_checked EQ space. IF vim_ale_keyspec_check NE space.
ASSIGN roottab_key TO <key_x> CASTING. <key_x> = <f1_x>. allowed = 'X'.
LOOP AT vim_ale_keyspec_objtab. CALL FUNCTION 'ALE_EDIT_KEY_CHECK'
EXPORTING objecttype = vim_ale_keyspec_objtab-otype objectname =
vim_ale_keyspec_objtab-oname objectkey = roottab_key EXCEPTIONS
key_no_maintainance = 1. IF sy-subrc NE 0. allowed = 'A'. ale_msgno =
sy-msgno. ale_msgid = sy-msgid. ale_msgv1 = sy-msgv1. ale_msgv2 =
sy-msgv2. ale_msgv3 = sy-msgv3. ale_msgv4 = sy-msgv4. EXIT. ENDIF.
ENDLOOP. ENDIF. IF allowed <> 'A'. vim_keyrange_alr_checked = 'X'.
ENDIF. IF vim_ale_keyspec_check EQ space OR ( x_header-customauth CO
sap_cust_ctrl_classes AND allowed CO ' X' ). IF x_header-bastab EQ
space. MOVE x_header-roottab TO tablename. ELSE. MOVE x_header-viewname
TO tablename. ENDIF. ASSIGN roottab_key TO <key_x> CASTING. IF
x_header-generictrp <> space. MOVE <f1_x>(x_header-maxtrkeyln) TO
<key_x>. ELSE. MOVE <f1_x>(x_header-keylen) TO <key_x>. ENDIF. CALL
FUNCTION 'CHECK_CUSTOMER_NAMES' EXPORTING tablename = tablename
tablekey = roottab_key IMPORTING key_allowed = allowed. ENDIF. IF
allowed CO ' A'. EXPORT vimviewname FROM x_header-viewname TO MEMORY ID
sy-uname. IF x_header-delmdtflag NE space AND status-mode EQ
detail_bild. mess_type = 'S'. ELSEIF allowed EQ 'A'. mess_type =
ale_msgty. PERFORM set_pf_status USING 'ERROR'. ENDIF. IF neuer EQ 'J'.
IF x_header-delmdtflag <> space. ASSIGN
<vim_h_old_mkey>(x_header-keylen) TO <h_old_mkey2>. IF <h_old_mkey2> =
<f1_x>. CHECK check_all_keyr_scnd_time EQ space. ENDIF. ENDIF. CLEAR:
vim_keyrange_alr_checked, vim_key_alr_checked. IF allowed NE 'A'.
MESSAGE ID 'SV' TYPE mess_type NUMBER '019'. ELSE. MESSAGE ID ale_msgid
TYPE mess_type NUMBER ale_msgno WITH ale_msgv1 ale_msgv2 ale_msgv3
ale_msgv4. ENDIF. IF x_header-delmdtflag NE space. IF status-mode EQ
detail_bild. <h_old_mkey2> = <f1_x>. check_all_keyr_scnd_time =
allowed. TRANSLATE check_all_keyr_scnd_time USING ' XA '. TRANSLATE
neuer USING 'JX'. CLEAR: function, ok_code. LEAVE SCREEN. ENDIF.
<h_old_mkey2> = <f1_x>. check_all_keyr_scnd_time = 'X'. ENDIF. ELSE. IF
allowed NE 'A'. IF vim_special_mode EQ vim_delete. mess_type = 'S'.
ELSE. mess_type = 'W'. ENDIF. IF vim_system_type NE 'SAP'. MESSAGE ID
'SV' TYPE mess_type NUMBER '117'. ELSE. MESSAGE ID 'SV' TYPE mess_type
NUMBER '136'. ENDIF. ELSE. IF vim_special_mode EQ vim_delete. mess_type
= 'S'. ELSE. mess_type = ale_msgty. ENDIF. MESSAGE ID ale_msgid TYPE
mess_type NUMBER ale_msgno WITH ale_msgv1 ale_msgv2 ale_msgv3
ale_msgv4. ENDIF. ENDIF. sy-subrc = 8. ELSE. CLEAR sy-subrc. ENDIF.
ENDFORM. FORM RESET_ENTRIES USING VALUE(RE_MODE). DATA: TEXTTAB_MOD(1)
TYPE C. VIM_SPECIAL_MODE = VIM_RESET. CASE RE_MODE. WHEN LIST_BILD.
MOVE: 0 TO REFCNT, 0 TO NEWCNT, 0 TO ORGCNT. LOOP AT EXTRACT. CLEAR
TEXTTAB_MOD. CHECK <XMARK> EQ MARKIERT. MOVE SY-TABIX TO INDEX. ADD 1
TO NEWCNT. CHECK <XACT> NE NEUER_EINTRAG. ADD 1 TO ORGCNT. IF
X_HEADER-TEXTTBEXST <> SPACE. PERFORM VIM_TEXTTAB_MODIF_FOR_KEY
CHANGING TEXTTAB_MOD. ENDIF. IF X_HEADER-BASTAB NE SPACE AND
X_HEADER-TEXTTBEXST NE SPACE. CHECK <XACT> NE ORIGINAL OR <XACT_TEXT>
NE ORIGINAL OR TEXTTAB_MOD = 'X'. ELSE. CHECK <XACT> NE ORIGINAL OR
TEXTTAB_MOD = 'X'. ENDIF. PERFORM PROCESS_ENTRY_RESET USING INDEX.
ENDLOOP. NEWCNT = NEWCNT - ORGCNT. ORGCNT = ORGCNT - REFCNT. IF ORGCNT
EQ 0 AND NEWCNT EQ 0. MESSAGE S016(SV) WITH REFCNT. ELSE. IF ORGCNT NE
0 AND NEWCNT NE 0. MESSAGE S040(SV) WITH REFCNT ORGCNT NEWCNT. ELSE. IF
ORGCNT NE 0. MESSAGE S041(SV) WITH REFCNT ORGCNT. ELSE. MESSAGE
S042(SV) WITH REFCNT NEWCNT. ENDIF. ENDIF. ENDIF. PERFORM
PROCESS_AFTER_ENTRY_RESET. WHEN DETAIL_BILD. READ TABLE EXTRACT INDEX
NEXTLINE. PERFORM PROCESS_ENTRY_RESET USING NEXTLINE. MESSAGE S017(SV).
PERFORM PROCESS_AFTER_ENTRY_RESET. CLEAR VIM_OLD_VIEWKEY. TRANSLATE
VIM_NO_MAINKEY_EXISTS USING VIM_NO_MKEY_NOT_PROCSD_PATT. ENDCASE. CLEAR
VIM_SPECIAL_MODE. ENDFORM. FORM PROCESS_ENTRY_RESET USING
VALUE(PER_INDEX) TYPE I. DATA: PRT_FRKY_SAFE(255) TYPE C, PER_HF TYPE
I, REFCNT_SAFE TYPE I. REFCNT_SAFE = REFCNT. PERFORM
MOVE_EXTRACT_TO_VIEW_WA. IF <XACT> NE ORIGINAL OR ( X_HEADER-BASTAB NE
SPACE AND X_HEADER-TEXTTBEXST NE SPACE AND <XACT_TEXT> NE ORIGINAL ).
IF vim_prtfky_assigned NE ' '. IF X_HEADER-PTFRKYEXST NE SPACE. MOVE
<VIM_PRTFKY_WA> TO PRT_FRKY_SAFE. ENDIF. ENDIF. IF X_HEADER-FRM_RP_ORG
NE SPACE. PERFORM (X_HEADER-FRM_RP_ORG) IN PROGRAM (SY-REPID). ELSE. IF
X_HEADER-BASTAB NE SPACE. PERFORM (VIM_TB_READ_SINGLE_FORM) IN PROGRAM
(SY-REPID). ELSE. PER_HF = STRLEN( X_HEADER-MAINTVIEW ). IF PER_HF LE
10. MOVE X_HEADER-MAINTVIEW TO VIM_READ_SINGLE_FORM-VIEWNAME. PERFORM
(VIM_READ_SINGLE_FORM) IN PROGRAM. ELSE. MOVE X_HEADER-MAINTVIEW TO
VIM_READ_SINGLE_FORM_40-VIEWNAME. PERFORM (VIM_READ_SINGLE_FORM_40) IN
PROGRAM. ENDIF. ENDIF. ENDIF. IF SY-SUBRC NE 0. IF X_HEADER-FRM_RP_ORG
EQ SPACE. RAISE IMPOSSIBLE_ERROR. ENDIF. ELSE. IF vim_prtfky_assigned
NE ' '. IF X_HEADER-PTFRKYEXST NE SPACE AND <VIM_PRTFKY_WA> NE
PRT_FRKY_SAFE. PERFORM CONSISTENCY_PRT_FRKY_FIELDS USING 'X'. ENDIF.
ENDIF. IF X_HEADER-DELMDTFLAG NE SPACE. PERFORM TEMPORAL_DELIMITATION.
ENDIF. PERFORM MODIFY_TABLES USING PER_INDEX. IF PER_INDEX NE 0. ADD 1
TO REFCNT. ENDIF. ENDIF. ENDIF. IF X_HEADER-TEXTTBEXST <> SPACE. IF
X_HEADER-FRM_TL_ORG NE SPACE. PERFORM (X_HEADER-FRM_TL_ORG) IN PROGRAM
(SY-REPID). ELSE. PERFORM VIM_READ_TEXTTAB_ENTRY. ENDIF. IF REFCNT_SAFE
= REFCNT AND SY-SUBRC = 0. ADD 1 TO REFCNT. CLEAR <STATUS>-UPD_FLAG. IF
<XMARK> EQ MARKIERT. SUBTRACT: 1 FROM <STATUS>-MK_XT, 1 FROM
<STATUS>-MK_TO. <XMARK> = NICHT_MARKIERT. IF PER_INDEX <> 0. MODIFY
EXTRACT INDEX PER_INDEX. ENDIF. READ TABLE TOTAL WITH KEY
<VIM_xEXTRACT_KEY> BINARY SEARCH. <MARK> = NICHT_MARKIERT. MODIFY TOTAL
INDEX SY-TABIX. ENDIF. ENDIF. ENDIF. ENDFORM. FORM
PROCESS_AFTER_ENTRY_RESET. IF TEMPORAL_DELIMITATION_HAPPENED NE SPACE.
PERFORM AFTER_TEMPORAL_DELIMITATION. CLEAR
TEMPORAL_DELIMITATION_HAPPENED. ENDIF. PERFORM CHECK_UPD. IF
X_HEADER-FRM_AF_ORG NE SPACE. PERFORM (X_HEADER-FRM_AF_ORG) IN PROGRAM
(SY-REPID). ENDIF. ENDFORM. FORM upgrade USING value(u_mode) TYPE c.
DATA: u_kind, u_update_happened, trans_pattern(8) TYPE c, hf TYPE i,
u_client LIKE sy-mandt, u_tabind LIKE sy-tabix, u_it000 LIKE vim_t000
OCCURS 10, u_title(40) TYPE c, u_remote_sys LIKE rfcdes-rfcdest, u_t000
LIKE vim_t000, u_counter TYPE i, u_del_cnt TYPE i, u_rc TYPE i, hf1
TYPE i, u_funcsafe(4) TYPE c, u_txt_fu_beg TYPE i, u_txt_fu_lg TYPE i,
u_newversion(1) TYPE c VALUE 'X', u_mark_entries(1) TYPE c, u_action(1)
TYPE c, u_specmode_safe(1) TYPE c, u_called_from(1) TYPE c, u_oc_exst
LIKE ntab_cmp-flag, u_sellist TYPE vimsellist_type, sellines TYPE i.
CONSTANTS: u_text_frm(30) TYPE c VALUE 'FILL_TEXTTAB_KEY'.
FIELD-SYMBOLS: <u_f1> TYPE x, <u_sellist> TYPE vimsellist_type,
<w_sellist> TYPE vimsellist. DATA: cmp_container_ref TYPE REF TO data,
cmp_container_wa_ref TYPE REF TO data, extract_len TYPE i, subrc_buf
TYPE sy-subrc. FIELD-SYMBOLS: <cmp_cont> TYPE STANDARD TABLE,
<cmp_cont_wa> TYPE ANY, <x_dummy> TYPE x. READ TABLE excl_cua_funct
WITH KEY function = 'CMPR'. IF sy-subrc EQ 0. MESSAGE s001(sv). EXIT.
ENDIF. IF u_mode EQ space AND sy-mandt EQ '000' OR ( u_mode EQ space OR
u_mode EQ 'O' ) AND x_header-clidep EQ space. MESSAGE s001(sv). EXIT.
ENDIF. IF status-action EQ aendern AND ( x_header-adrnbrflag NE space
AND x_header-adrnbrflag <> 'N' ). PERFORM set_pf_status USING 'ERROR'.
MESSAGE i139(sv). PERFORM set_pf_status USING status. ENDIF. CLEAR:
u_client, u_remote_sys. IF u_mode EQ space. u_client = '000'. ELSEIF
u_mode EQ 'O'. IF vim_default_upgr_clnt-client NE space AND
vim_default_upgr_clnt-viewname EQ x_header-viewname. u_client =
vim_default_upgr_clnt-client. ENDIF. ELSE. IF
vim_default_rfc_dest-rfcdest NE space AND vim_default_rfc_dest-viewname
EQ x_header-viewname. u_remote_sys = vim_default_rfc_dest-rfcdest.
ENDIF. ENDIF. IF vim_special_mode EQ vim_direct_upgrade. function =
'ABR'. PERFORM fill_extract. CLEAR function. u_specmode_safe =
vim_special_mode. ASSIGN dba_sellist[] TO <u_sellist>. ELSE. ASSIGN
<vim_ck_sellist> TO <u_sellist>. ENDIF. vim_special_mode = vim_upgrade.
MOVE: geloescht TO trans_pattern, aendern TO trans_pattern+1(1),
neuer_geloescht TO trans_pattern+2(1), neuer_eintrag TO
trans_pattern+3(1), update_geloescht TO trans_pattern+4(1), aendern TO
trans_pattern+5(1), original TO trans_pattern+6(1), aendern TO
trans_pattern+7(1). IF x_header-bastab EQ space. u_kind = 'V'. ELSE. IF
x_header-texttbexst EQ space. u_kind = 'T'. ELSE. u_kind = 'X'. ENDIF.
ENDIF. IF x_header-delmdtflag NE space. DESCRIBE TABLE
vim_collapsed_mainkeys LINES hf. DESCRIBE TABLE vim_merged_entries. IF
sy-tfill GT 0 OR hf GT 0. vim_ignore_collapsed_mainkeys = 'X'. PERFORM
fill_extract. CLEAR vim_ignore_collapsed_mainkeys. ENDIF. ENDIF. IF (
vim_system_type NE 'SAP' AND sy-mandt EQ '000' ) OR x_header-importable
= vim_not_importable. u_action = anzeigen. ELSE. u_action =
status-action. ENDIF. TRANSLATE u_action USING 'SCUA'. IF
vim_adjust_middle_level_mode NE space. TRANSLATE u_action USING 'Aa'.
ENDIF. u_called_from = vim_special_adjust_mode. TRANSLATE u_called_from
USING ' VSFXF'. IF NOT vim_oc_inst IS INITIAL. IF ( u_action = 'C' AND
NOT vim_oc_inst->oc_selcrit_read_tab IS INITIAL ) OR ( 'Aa' CS u_action
AND NOT vim_oc_inst->oc_selcrit_maint_tab IS INITIAL ). u_oc_exst =
'X'. ENDIF. ENDIF. APPEND LINES OF <u_sellist> TO u_sellist. DELETE
u_sellist WHERE from_auth <> space AND ddic <> 'S' AND ddic <> 'B'. IF
sy-subrc = 0. DESCRIBE TABLE u_sellist LINES sellines. IF sellines GT
0. READ TABLE u_sellist INDEX sellines ASSIGNING <w_sellist>. CLEAR
<w_sellist>-and_or. ENDIF. ENDIF. DESCRIBE FIELD extract LENGTH
extract_len IN BYTE MODE. IF extract_len <= 64. CREATE DATA
cmp_container_ref TYPE TABLE OF tbl64. ASSIGN cmp_container_ref->* TO
<cmp_cont>. CREATE DATA cmp_container_wa_ref TYPE tbl64. ASSIGN
cmp_container_wa_ref->* TO <cmp_cont_wa>. ELSEIF extract_len <= 256.
CREATE DATA cmp_container_ref TYPE TABLE OF tbl256. ASSIGN
cmp_container_ref->* TO <cmp_cont>. CREATE DATA cmp_container_wa_ref
TYPE tbl256. ASSIGN cmp_container_wa_ref->* TO <cmp_cont_wa>. ELSEIF
extract_len <= 1024. CREATE DATA cmp_container_ref TYPE TABLE OF
tbl1024. ASSIGN cmp_container_ref->* TO <cmp_cont>. CREATE DATA
cmp_container_wa_ref TYPE tbl1024. ASSIGN cmp_container_wa_ref->* TO
<cmp_cont_wa>. ELSEIF extract_len <= 4096. CREATE DATA
cmp_container_ref TYPE TABLE OF tbl4096. ASSIGN cmp_container_ref->* TO
<cmp_cont>. CREATE DATA cmp_container_wa_ref TYPE tbl4096. ASSIGN
cmp_container_wa_ref->* TO <cmp_cont_wa>. ELSEif extract_len <= 8192.
CREATE DATA cmp_container_ref TYPE TABLE OF tbl8192. ASSIGN
cmp_container_ref->* TO <cmp_cont>. CREATE DATA cmp_container_wa_ref
TYPE tbl8192. ASSIGN cmp_container_wa_ref->* TO <cmp_cont_wa>. else.
CREATE DATA cmp_container_ref TYPE TABLE OF tbl32000. ASSIGN
cmp_container_ref->* TO <cmp_cont>. CREATE DATA cmp_container_wa_ref
TYPE tbl32000. ASSIGN cmp_container_wa_ref->* TO <cmp_cont_wa>. ENDIF.
ASSIGN <cmp_cont_wa> TO <x_dummy> CASTING. LOOP AT extract. CLEAR
<x_dummy>. <x_dummy> = <vim_xextract>. APPEND <cmp_cont_wa> TO
<cmp_cont>. ENDLOOP. CALL FUNCTION 'SCT1_VIEW_COMPARE_AND_ADJUST'
EXPORTING iv_view_name = x_header-maintview iv_kind = u_kind iv_mode =
u_action iv_rfc_destination = u_remote_sys iv_called_from =
u_called_from iv_data_access_restricted = u_oc_exst IMPORTING ev_update
= u_update_happened ev_mark_entries = u_mark_entries TABLES it_header =
x_header it_namtab = x_namtab it_sellist = u_sellist ct_box =
<cmp_cont> EXCEPTIONS canceled = 1 wrong_parameter = 2 compare_error =
3 OTHERS = 4. subrc_buf = sy-subrc. REFRESH extract. LOOP AT <cmp_cont>
ASSIGNING <cmp_cont_wa>. ASSIGN <cmp_cont_wa> TO <x_dummy> CASTING.
<vim_xextract> = <x_dummy>(extract_len). APPEND extract. ENDLOOP.
sy-subrc = subrc_buf. IF sy-subrc GT 01. MESSAGE ID sy-msgid TYPE 'I'
NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. MESSAGE
s135(sv). sy-subrc = 01. ENDIF. IF status-action EQ anzeigen AND
u_update_happened NE space. sy-subrc = 1. ENDIF. CASE sy-subrc. WHEN 0.
IF u_update_happened NE space. CLEAR: u_counter, u_del_cnt.
replace_mode = 'X'. DESCRIBE TABLE extract LINES maxlines. LOOP AT
extract. IF <xact> EQ original. DELETE extract. CONTINUE. ENDIF. CHECK
<xact> EQ geloescht OR <xact> EQ neuer_geloescht OR <xact> EQ
update_geloescht. hf = sy-tabix. READ TABLE total WITH KEY
<vim_xextract_key> BINARY SEARCH. IF sy-subrc NE 0 OR ( sy-subrc EQ 0
AND <action> EQ <xact> ). DELETE extract. CONTINUE. ENDIF. <mark> =
markiert. ADD 1 TO mark_total. MODIFY total INDEX sy-tabix. <xmark> =
markiert. ADD 1 TO mark_extract. MODIFY extract. IF
vim_special_adjust_mode EQ subset. PERFORM vim_restore_subset_conds.
ENDIF. PERFORM vim_process_view_entry USING hf 'DELE' u_rc. CHECK u_rc
NE 4. IF u_rc EQ 8. EXIT. ENDIF. ADD: counter TO u_del_cnt, 1 TO
u_counter. ENDLOOP. IF u_counter GT u_del_cnt. SUBTRACT u_del_cnt FROM
u_counter. MESSAGE i116(sv) WITH u_counter. ENDIF. CLEAR u_counter. IF
status-type EQ einstufig. CLEAR: ok_code, function. ELSE. function =
ok_code = 'COMP'. ENDIF. ASSIGN <vim_xtotal>(x_header-tablen) TO
<u_f1>. LOOP AT extract. IF <xact> NE aendern AND <xact> NE
neuer_eintrag. DELETE extract. CONTINUE. ENDIF. hf = sy-tabix. READ
TABLE total WITH KEY <vim_xextract_key> BINARY SEARCH. IF sy-subrc EQ
0. IF extract EQ total. DELETE extract. CONTINUE. ELSEIF <xact> EQ
neuer_eintrag AND <action> EQ geloescht OR <action> EQ neuer_geloescht
OR <action> EQ update_geloescht. status-delete = geloescht. <xact> =
<action>. MODIFY extract. u_funcsafe = function. IF
vim_special_adjust_mode EQ subset. PERFORM vim_restore_subset_conds.
ENDIF. PERFORM vim_mark_and_process USING hf 'UNDO' hf1 u_rc. CLEAR
status-delete. function = u_funcsafe. vim_special_mode = vim_upgrade.
CHECK u_rc NE 4. IF u_rc EQ 8. EXIT. ENDIF. READ TABLE extract INDEX
hf. READ TABLE total WITH KEY <vim_xextract_key> BINARY SEARCH. IF
<u_f1> EQ <table2_x>. DELETE extract. CONTINUE. ELSE. <xact> = aendern.
MODIFY extract. ENDIF. ELSEIF <u_f1> EQ <table2_x>. DELETE extract.
CONTINUE. ELSEIF <xact> EQ neuer_eintrag AND <action> EQ original.
<xact> = aendern. MODIFY extract. ENDIF. ENDIF. IF
vim_special_adjust_mode EQ subset. PERFORM vim_restore_subset_conds.
ENDIF. PERFORM vim_modify_view_entry USING hf u_rc. CHECK u_rc NE 4. IF
u_rc EQ 8. EXIT. ENDIF. IF u_mark_entries NE space. READ TABLE total
WITH KEY <vim_xtotal_key> BINARY SEARCH TRANSPORTING NO FIELDS. IF
<mark> EQ nicht_markiert. <mark> = markiert. ADD 1 TO mark_total.
MODIFY total INDEX sy-tabix. ADD 1 TO mark_extract. ENDIF. ENDIF.
extract = total. MODIFY extract. ADD 1 TO u_counter. ENDLOOP. IF
temporal_delimitation_happened NE space. REFRESH vim_delim_entries.
CLEAR temporal_delimitation_happened. ENDIF. status-data = title-data =
auswahldaten. nextline = l = 1. IF u_del_cnt NE 0 AND u_counter NE 0.
MESSAGE s140(sv) WITH u_del_cnt u_counter. ELSEIF u_del_cnt NE 0.
MESSAGE s011(sv) WITH u_del_cnt. ELSE. MESSAGE s012(sv) WITH u_counter.
ENDIF. CLEAR replace_mode. ELSE. IF x_header-delmdtflag NE space.
PERFORM fill_extract. ENDIF. ENDIF. DESCRIBE TABLE extract LINES
maxlines. nextline = 1. IF vim_special_adjust_mode NE space. CLEAR:
vim_special_mode, vim_special_adjust_mode, <status>-upd_flag, maxlines,
<status>-maxlines. vim_next_screen = 0. vim_leave_screen = 'X'. IF
vim_adjust_middle_level_mode NE space. function = 'SAVE'. ENDIF. ENDIF.
WHEN 1. IF vim_special_adjust_mode NE space. CLEAR: vim_special_mode,
vim_special_adjust_mode, <status>-upd_flag, maxlines,
<status>-maxlines. vim_next_screen = 0. vim_leave_screen = 'X'. IF
vim_adjust_middle_level_mode NE space. function = 'SAVE'. ENDIF. ENDIF.
PERFORM fill_extract. WHEN OTHERS. RAISE upgrade_view_failed. ENDCASE.
CLEAR vim_special_mode. ENDFORM. FORM vim_restore_subset_conds. DATA:
hi TYPE i. FIELD-SYMBOLS: <ifield> TYPE ANY. LOOP AT dpl_sellist WHERE
ddic CO vim_subset_marks. hi = sy-tabix. READ TABLE x_namtab INDEX
dpl_sellist-tabix. ASSIGN COMPONENT x_namtab-viewfield OF STRUCTURE
<vim_extract_struc> TO <ifield>. CALL FUNCTION 'VIEW_CONVERSION_OUTPUT'
EXPORTING value_intern = <ifield> tabname = x_header-maintview
fieldname = x_namtab-viewfield outputlen = x_namtab-outputlen intlen =
x_namtab-flength IMPORTING value_extern = dpl_sellist-value. CLEAR
dpl_sellist-converted. IF dpl_sellist-value IS INITIAL.
dpl_sellist-initial = 'X'. ENDIF. MODIFY dpl_sellist INDEX hi. ENDLOOP.
dba_sellist[] = dpl_sellist[]. ENDFORM. FORM VIM_PROCESS_VIEW_ENTRY
USING VALUE(VPVE_EXIX) TYPE I VALUE(VPVE_OKCODE) LIKE OK_CODE VPVE_RC
TYPE I. DATA: FUNCTION_SAFE LIKE FUNCTION. CLEAR VPVE_RC. NEXTLINE =
EXIND = VPVE_EXIX. FUNCTION_SAFE = FUNCTION. FUNCTION = OK_CODE =
VPVE_OKCODE. PERFORM MOVE_EXTRACT_TO_VIEW_WA. CASE STATUS-TYPE. WHEN
EINSTUFIG. PERFORM VIM_IMP_CALL_SCREEN USING LISTE. WHEN ZWEISTUFIG.
PERFORM PROCESS_DETAIL_SCREEN USING 'C'. ENDCASE. IF OK_CODE EQ 'IGN '.
VPVE_RC = 4. CLEAR OK_CODE. EXIT. ENDIF. IF FUNCTION EQ 'ABR '. VPVE_RC
= 8. CLEAR FUNCTION. EXIT. ENDIF. FUNCTION = FUNCTION_SAFE. ENDFORM.
FORM vim_modify_view_entry USING value(vmve_exix) TYPE i vmve_rc TYPE
i. DATA: h_ix TYPE i, h_act(1) TYPE c, hact2(1) TYPE c, fieldname TYPE
fnam_____4. FIELD-SYMBOLS: <guid> TYPE ANY, <old_guid> TYPE ANY,
<guid_wa> TYPE ANY, <extract_val> TYPE ANY, <total_val> TYPE ANY. CLEAR
vmve_rc. nextline = exind = vmve_exix. IF x_header-subsetflag NE space
OR x_header-rdonlyflag NE space OR x_header-adrnbrflag NE space. IF
<xact> NE neuer_eintrag. READ TABLE total WITH KEY <vim_xextract_key>
BINARY SEARCH. h_act = <action>. ELSE. h_act = <xact>. ENDIF. LOOP AT
x_namtab WHERE readonly EQ rdonly OR ( readonly EQ subset AND keyflag
EQ space ). ASSIGN COMPONENT x_namtab-viewfield OF STRUCTURE
<vim_extract_struc> TO <extract_val>. CHECK sy-subrc = 0. IF <xact> NE
neuer_eintrag. ASSIGN COMPONENT x_namtab-viewfield OF STRUCTURE
<vim_total_struc> TO <total_val>. IF sy-subrc = 0. <extract_val> =
<total_val>. ENDIF. ELSE. ASSIGN COMPONENT x_namtab-viewfield OF
STRUCTURE <initial> TO <total_val>. IF sy-subrc = 0. <extract_val> =
<total_val>. ENDIF. ENDIF. ENDLOOP. IF sy-subrc EQ 0. hact2 = <xact>.
<xact> = h_act. MODIFY extract INDEX vmve_exix. <xact> = hact2. ENDIF.
ENDIF. PERFORM move_extract_to_view_wa. CLEAR vim_upgr_address_number.
IF x_header-adrnbrflag NE space. IF x_header-adrnbrflag = 'N'.
vim_upgr_address_number = <address_number>. ENDIF. IF <xact> NE
neuer_eintrag. <address_number> = <vim_total_address_number>. ELSE.
CLEAR <address_number>. ENDIF. ENDIF. IF x_header-guidflag <> space AND
<xact> <> neuer_eintrag. LOOP AT x_namtab WHERE domname IN
vim_guid_domain. CONCATENATE x_header-maintview x_namtab-viewfield INTO
fieldname SEPARATED BY '-'. ASSIGN COMPONENT x_namtab-viewfield OF
STRUCTURE <vim_extract_struc> TO <guid>. ASSIGN COMPONENT
x_namtab-viewfield OF STRUCTURE <vim_total_struc> TO <old_guid>. IF
<guid> IS INITIAL AND <old_guid> IS INITIAL. PERFORM vim_make_guid
USING x_namtab-viewfield. ASSIGN (fieldname) TO <guid_wa> CASTING TYPE
(fieldname). <guid> = <guid_wa>. ELSEIF <guid> IS INITIAL. <guid> =
<old_guid>. IF x_header-frm_af_uid <> space. PERFORM
(x_header-frm_af_uid) IN PROGRAM (x_header-fpoolname) USING <old_guid>
CHANGING <guid> <vim_extract_struc>. ELSEIF x_header-frm_af_uid <>
space. PERFORM (x_header-frm_af_uid) IN PROGRAM (x_header-fpoolname)
USING <old_guid> CHANGING <guid> <vim_extract_struc>. ENDIF. ENDIF.
ENDLOOP. ENDIF. IF <xact> EQ neuer_eintrag. status-action =
hinzufuegen. <vim_extract_struc> = <initial>. IF x_header-bastab NE
space AND x_header-texttbexst NE space. <vim_xextract_text> =
<text_initial_x>. ENDIF. <xact> = leer. ELSE. status-action = aendern.
<xact> = h_act. ENDIF. MODIFY extract INDEX vmve_exix. CASE
status-type. WHEN einstufig. PERFORM vim_imp_call_screen USING liste.
WHEN zweistufig. IF <xact> EQ leer. neuer = 'J'. ENDIF. PERFORM
process_detail_screen USING 'C'. ENDCASE. status-action =
<status>-st_action = aendern. IF ok_code EQ 'IGN '. vmve_rc = 4. CLEAR
ok_code. EXIT. ENDIF. IF function EQ 'ABR '. vmve_rc = 8. CLEAR
function. EXIT. ENDIF. ENDFORM. FORM VIM_SET_IMPRES_HEADER. IF
VIM_CALLED_BY_CLUSTER EQ SPACE. IMP_RESULTS-OBJTAB-OBJECT-OBJECTNAME =
X_HEADER-VIEWNAME. IF X_HEADER-VIEWNAME <> X_HEADER-MAINTVIEW. CLEAR
IMP_RESULTS-OBJTAB-OBJECT-OBJECTTYPE. ELSE.
IMP_RESULTS-OBJTAB-OBJECT-OBJECTTYPE = X_HEADER-BASTAB. ENDIF.
TRANSLATE IMP_RESULTS-OBJTAB-OBJECT-OBJECTTYPE USING ' VXS'. ELSE.
IMP_RESULTS-OBJTAB-OBJECT-OBJECTNAME = VIM_CALLING_CLUSTER.
IMP_RESULTS-OBJTAB-OBJECT-OBJECTTYPE = 'C'. ENDIF. IF X_HEADER-BASTAB
NE SPACE. IMP_RESULTS-OBJTAB-TABNAME = X_HEADER-MAINTVIEW. IF
X_HEADER-VIEWNAME <> X_HEADER-MAINTVIEW. IMP_RESULTS-OBJTAB-VIEWNAME =
X_HEADER-VIEWNAME. ELSE. CLEAR IMP_RESULTS-OBJTAB-VIEWNAME. ENDIF.
ELSE. IMP_RESULTS-OBJTAB-TABNAME = X_HEADER-ROOTTAB.
IMP_RESULTS-OBJTAB-VIEWNAME = X_HEADER-VIEWNAME. ENDIF.
IMP_RESULTS-KEYLEN = X_HEADER-KEYLEN. IMP_RESULTS-GENKEYLEN =
X_HEADER-KEYLEN. ENDFORM. FORM vim_convert_tabkey USING
value(vct_key_int) TYPE x vct_key_ext TYPE vim_tabkey_c vct_xkeylen
TYPE i. FIELD-SYMBOLS: <h1>, <h2>. CLEAR vct_xkeylen. <f1_wax> =
vct_key_int. LOOP AT x_namtab WHERE keyflag NE space AND texttabfld EQ
space. CHECK x_namtab-position LT x_header-keylen. ASSIGN: COMPONENT
x_namtab-viewfield OF STRUCTURE <table1_wa> TO <h1>,
vct_key_ext+vct_xkeylen(x_namtab-outputlen) TO <h2>. IF (
x_namtab-inttype NE 'C' AND x_namtab-inttype NE 'N' ) OR
x_namtab-convexit NE space. CALL FUNCTION 'VIEW_CONVERSION_OUTPUT'
EXPORTING value_intern = <h1> tabname = x_header-maintview fieldname =
x_namtab-viewfield outputlen = x_namtab-outputlen intlen =
x_namtab-flength IMPORTING value_extern = <h2>. ELSE. <h2> = <h1>.
ENDIF. ADD x_namtab-outputlen TO vct_xkeylen. ENDLOOP. ENDFORM. FORM
vim_imp_call_screen USING vics_screen LIKE d020s-dnum. DATA: program
LIKE sy-repid, import_action LIKE sy-msgv4, key_safe1 LIKE sy-msgv1,
key_safe2 LIKE sy-msgv2, key_safe3 LIKE sy-msgv3, key_safe TYPE
vim_tabkey_c, vics_xkeylen TYPE i. LOCAL: imp_results. FIELD-SYMBOLS:
<res_tabkey> TYPE x, <errkey> TYPE x. ASSIGN: imp_results-tabkey TO
<res_tabkey> CASTING, vim_profile_errorkey TO <errkey> CASTING. CLEAR
vim_view_wax. IF vim_import_mode_active NE space. <table1_wax> =
<table1_x>. PERFORM vim_set_impres_header. PERFORM vim_convert_tabkey
USING <f1_x> key_safe vics_xkeylen. <res_tabkey> = <f1_x>. key_safe1 =
key_safe. IF vics_xkeylen GT 50. key_safe2 = key_safe+50. IF
vics_xkeylen GT 100. key_safe3 = key_safe+100. ENDIF. ENDIF. IF
vim_called_by_cluster = 'X'. CONCATENATE '(' view_name ')' INTO
key_safe3. ENDIF. IF status-action EQ hinzufuegen. import_action =
'INS'. ELSEIF function EQ 'DELE'. import_action = 'DEL'. ELSEIF
status-action EQ aendern. import_action = 'UPD'. ENDIF. CLEAR:
imp_results-import, vim_last_logged_message. IF vim_import_profile =
'X'. <errkey>(x_header-keylen) = <f1_x>. ELSE. vim_import_no_message =
'X'. PERFORM vim_process_message USING 'SV' 'S' 'S' '150' key_safe1
key_safe2 key_safe3 import_action. ENDIF. ENDIF. IF
vim_import_mode_active EQ space OR vim_no_dialog EQ space. CALL SCREEN
vics_screen. ELSE. program = sy-repid. CLEAR vim_import_no_message.
CALL FUNCTION 'VIEW_CALL_SCREEN' EXPORTING screen_number = vics_screen
program = program EXCEPTIONS error_message = 1. IF sy-subrc NE 0. CLEAR
vim_act_dynp_view. IF vim_last_logged_message-id NE sy-msgid OR
vim_last_logged_message-nbr NE sy-msgno. vim_import_no_message = 'X'.
PERFORM vim_process_message USING sy-msgid sy-msgty sy-msgty sy-msgno
sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. IF vim_import_forcemode EQ
space. ok_code = 'IGN '. neuer = 'N'. ELSE. <table1_x> = <table1_wax>.
CASE import_action. WHEN 'UPD'. <status>-upd_flag = 'X'. neuer = 'N'.
PERFORM update_tab. WHEN 'INS'. <status>-upd_flag = 'X'. neuer = 'J'.
PERFORM update_tab. WHEN 'DEL'. READ TABLE total WITH KEY <f1_x> BINARY
SEARCH TRANSPORTING NO FIELDS. IF sy-subrc EQ 0. PERFORM
logical_delete_from_total USING sy-tabix. ENDIF. ENDCASE. ENDIF. ENDIF.
IF vim_import_profile = 'X'. CLEAR vim_profile_errorkey. ELSE.
vim_import_no_message = 'X'. PERFORM vim_process_message USING 'SV' 'S'
'S' '151' key_safe1 key_safe2 key_safe3 import_action. ENDIF. CLEAR
vim_import_no_message. ENDIF. IF vim_import_mode_active NE space. IF
ok_code EQ 'IGN ' OR function EQ 'ABR '. imp_results-import-errors = 1.
ENDIF. IF ok_code NE 'IGN' AND function NE 'ABR' OR
vim_import_forcemode NE space. CASE import_action. WHEN 'UPD'.
imp_results-import-updated = 1. WHEN 'INS'. imp_results-import-inserted
= 1. WHEN 'DEL'. imp_results-import-deleted = 1. ENDCASE. ENDIF. APPEND
imp_results. ENDIF. ENDFORM. FORM move_extract_to_view_wa. MOVE
<vim_extract_struc> TO <table1>. IF x_header-bastab NE space AND
x_header-texttbexst NE space. MOVE <vim_xextract_text> TO
<table1_xtext>. ENDIF. ENDFORM. FORM prepare_saving. DATA: rc LIKE
sy-subrc, ps_addr_ref LIKE addr_ref, ps_transp_addrs(1) TYPE c,
ps_e071k_tab LIKE e071k OCCURS 0, ps_tot_ix TYPE i, ps_ko200 LIKE
ko200, ps_addrrc LIKE szad_field-returncode, ps_ko200_tab LIKE ko200
OCCURS 0, addr_e071 LIKE e071, addr_e071k LIKE e071k, dummy TYPE char1,
ps_addr_errtab LIKE addr_error OCCURS 0 WITH HEADER LINE,
new_addr_group TYPE ad_group, object_key TYPE ad_objkey. FIELD-SYMBOLS:
<object_key_x> TYPE x, <addr_key> TYPE x. IF
vim_adjust_middle_level_mode EQ subset. x_header[] = vim_adj_header.
READ TABLE x_header INDEX 1. x_namtab[] = vim_adj_namtab. ENDIF. CLEAR
vim_abort_saving. IF <status>-upd_checkd EQ space. PERFORM check_upd.
ENDIF. IF <status>-upd_flag NE space. IF maint_mode EQ aendern. CLEAR
sy-subrc. IF x_header-frm_bf_sav NE space. PERFORM
(x_header-frm_bf_sav) IN PROGRAM. IF sy-subrc <> 0 OR vim_abort_saving
NE space. vim_abort_saving = 'X'. sy-subrc = 8. EXIT. ENDIF. ENDIF. IF
x_header-texttbexst <> space. PERFORM vim_set_texttab_action_delete.
ENDIF. IF vim_client_state IS INITIAL OR ( vim_called_by_cluster <>
space AND vim_client_state = vim_noact ). CALL FUNCTION
'VIEW_GET_CLIENT_STATE' IMPORTING transp_state = vim_client_state.
ENDIF. ENDIF. PERFORM vim_bc_logs_maintain USING x_header
vim_import_profile CHANGING vim_bc_entry_list. IF ( vim_no_dialog EQ
space OR vim_import_mode_active NE space ) AND ( vim_client_state EQ
vim_log OR maint_mode EQ transportieren ). IF corr_nbr NE space AND
corr_nbr NE <status>-corr_nbr. <status>-corr_nbr = corr_nbr. ENDIF. IF
maint_mode EQ transportieren. IF <status>-corr_nbr EQ space. PERFORM
request_corr_number. IF x_header-flag NE vim_transport_denied AND
<status>-l_corr_nbr NE <status>-corr_nbr. PERFORM prepare_corr. ENDIF.
ENDIF. ELSE. PERFORM check_transp_objs_for_maint USING rc. IF rc NE 0.
RAISE missing_corr_number. ENDIF. IF x_header-flag NE
vim_transport_denied. PERFORM prepare_corr. PERFORM update_corr. ENDIF.
ENDIF. PERFORM corr_upd. ENDIF. IF vim_import_testmode NE space. CLEAR
<status>-upd_flag. vim_import_no_message = 'X'. PERFORM
vim_process_message USING 'SV' 'I' 'I' '154' space space space space.
CLEAR vim_import_no_message. ELSE. CALL FUNCTION
'VIEW_WRITE_CHANGELOG_HEADER' EXPORTING viewname = x_header-viewname
bastab = x_header-bastab begin = 'X' clidep = x_header-clidep. IF
x_header-adrnbrflag EQ 'N'. ASSIGN: object_key TO <object_key_x>
CASTING, ps_addr_ref-appl_key TO <addr_key> CASTING. IF ( maint_mode EQ
transportieren OR vim_client_state EQ vim_log ) AND x_header-flag NE
vim_transport_denied. IF x_header-flag EQ space. LOOP AT
vim_addr_e071_tab INTO addr_e071. addr_e071-trkorr = <status>-corr_nbr.
MODIFY vim_addr_e071_tab FROM addr_e071. ps_ko200 = addr_e071. APPEND
ps_ko200 TO ps_ko200_tab. ENDLOOP. ps_transp_addrs = 'X'. ENDIF. ENDIF.
LOOP AT vim_addresses_to_save WHERE viewname EQ x_header-viewname.
<f1_x> = <vim_addr_handle_x>. READ TABLE total WITH KEY <f1_x> BINARY
SEARCH. ps_tot_ix = sy-tabix. object_key =
vim_addresses_to_save-handle. IF <action> NE geloescht AND <action> NE
neuer_geloescht AND <action> NE update_geloescht. REFRESH ps_e071k_tab.
APPEND LINES OF vim_addr_e071k_tab TO ps_e071k_tab. IF
vim_addresses_to_save-addrnumber CP '@NEW*'. ps_addr_ref-appl_table =
vim_tsadrv-tablename. ps_addr_ref-appl_field = vim_tsadrv-fieldname.
ps_addr_ref-appl_key = object_key. ps_addr_ref-addr_group =
vim_addr_group. ps_addr_ref-owner = 'X'. CALL FUNCTION
'ADDR_NUMBER_GET' EXPORTING address_handle =
vim_addresses_to_save-handle address_reference = ps_addr_ref
generate_transport_entries = ps_transp_addrs table_name =
vim_addr_basetable field_name = vim_addr_bastab_field objkey =
object_key IMPORTING address_number = vim_addresses_to_save-addrnumber
TABLES e071k_tab = ps_e071k_tab EXCEPTIONS address_handle_not_exist = 1
internal_error = 2 parameter_error = 3. IF sy-subrc NE 0. MESSAGE ID
sy-msgid TYPE 'I' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3
sy-msgv4. RAISE saving_correction_failed. ENDIF. ELSE. IF
ps_transp_addrs NE space. CALL FUNCTION 'ADDR_TRANSPORT_ENTRIES'
EXPORTING addrnumber = vim_addresses_to_save-addrnumber table_name =
vim_addr_basetable field_name = vim_addr_bastab_field objkey =
object_key TABLES e071k_tab = ps_e071k_tab. ENDIF. ENDIF.
<vim_total_address_number> = vim_addresses_to_save-addrnumber.
TRANSLATE <action> USING ' U'. READ TABLE extract WITH KEY
<vim_xtotal_key> TRANSPORTING NO FIELDS. IF sy-subrc EQ 0. extract =
total. MODIFY extract INDEX sy-tabix. ENDIF. MODIFY total INDEX
ps_tot_ix. IF ps_transp_addrs NE space. CALL FUNCTION
'TR_OBJECTS_INSERT' EXPORTING wi_order = <status>-order_nbr TABLES
wt_ko200 = ps_ko200_tab wt_e071k = ps_e071k_tab EXCEPTIONS OTHERS = 8.
IF sy-subrc NE 0. MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno WITH
sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. RAISE saving_correction_failed.
ENDIF. ENDIF. CALL FUNCTION 'ADDR_SINGLE_SAVE' EXPORTING address_number
= <vim_total_address_number> EXCEPTIONS address_not_exist = 1
person_not_exist = 2 address_number_missing = 3 reference_missing = 4
internal_error = 5 database_error = 6 parameter_error = 7. IF sy-subrc
NE 0. MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno WITH sy-msgv1
sy-msgv2 sy-msgv3 sy-msgv4. RAISE saving_correction_failed. ENDIF. CALL
FUNCTION 'ADDR_DEQUEUE' EXPORTING address_number =
<vim_total_address_number> EXCEPTIONS address_not_exist = 1
internal_error = 2 OTHERS = 3. ELSEIF <action> EQ neuer_geloescht. CALL
FUNCTION 'ADDR_SINGLE_RESET' EXPORTING address_handle =
vim_addresses_to_save-handle EXCEPTIONS internal_error = 1 OTHERS = 0.
IF sy-subrc = 1. MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno WITH
sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. ENDIF. DELETE
vim_addresses_to_save. ENDLOOP. IF vim_addr_group = 'CA01'.
new_addr_group = 'CADE'. ELSEIF vim_addr_group = 'ZA01'. new_addr_group
= 'ZADE'. ENDIF. IF NOT new_addr_group IS INITIAL. LOOP AT total. CHECK
( <action> EQ geloescht OR <action> EQ update_geloescht ) AND
<vim_total_address_number> NP '@NEW*'. <object_key_x> = <f1_x>. IF
ps_transp_addrs NE space. REFRESH ps_e071k_tab. APPEND LINES OF
vim_addr_e071k_tab TO ps_e071k_tab. CALL FUNCTION
'ADDR_TRANSPORT_ENTRIES' EXPORTING addrnumber =
<vim_total_address_number> table_name = vim_addr_basetable field_name =
vim_addr_bastab_field objkey = object_key TABLES e071k_tab =
ps_e071k_tab. CALL FUNCTION 'TR_OBJECTS_INSERT' EXPORTING wi_order =
<status>-order_nbr TABLES wt_ko200 = ps_ko200_tab wt_e071k =
ps_e071k_tab EXCEPTIONS OTHERS = 8. IF sy-subrc NE 0. MESSAGE ID
sy-msgid TYPE 'I' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3
sy-msgv4. RAISE saving_correction_failed. ENDIF. ENDIF. IF NOT
<vim_total_address_number> IS INITIAL. CALL FUNCTION
'ADDR_GROUP_CHANGE' EXPORTING address_number =
<vim_total_address_number> new_address_group = new_addr_group
EXCEPTIONS address_not_exist = 1 parameter_error = 2 internal_error = 3
OTHERS = 4. IF sy-subrc = 1. ELSEIF sy-subrc = 2. MESSAGE i298(am) WITH
new_addr_group. RAISE saving_correction_failed. ELSEIF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2
sy-msgv3 sy-msgv4. RAISE saving_correction_failed. ENDIF. CALL FUNCTION
'ADDR_SINGLE_SAVE' EXPORTING address_number =
<vim_total_address_number> EXCEPTIONS address_not_exist = 1
person_not_exist = 2 address_number_missing = 3 reference_missing = 4
internal_error = 5 database_error = 6 parameter_error = 7. IF sy-subrc
NE 0 AND sy-subrc NE 1. MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. RAISE
saving_correction_failed. ENDIF. ENDIF. ENDLOOP. ENDIF. CLEAR sy-subrc.
ENDIF. ENDIF. ELSE. IF vim_adjust_middle_level_mode EQ space. MESSAGE
s043(sv). IF function = save AND vim_called_by_cluster = space. PERFORM
vim_add_img_notices_pai USING 'S' CHANGING dummy. ENDIF. ELSE.
vim_adjust_middle_level_mode = 'L'. ENDIF. ENDIF. ENDFORM. FORM
after_saving. DATA: dummy. DATA e071_loctab TYPE vim_ko200_tab_type. IF
x_header-texttbexst <> space AND vim_abort_saving EQ space. IF
x_header-frm_tl_upd NE space. PERFORM (x_header-frm_tl_upd) IN PROGRAM.
ELSE. PERFORM vim_texttab_db_update. ENDIF. ENDIF. IF vim_abort_saving
= space AND vim_called_by_cluster = space. PERFORM
vim_add_img_notices_pai USING 'S' CHANGING dummy. ENDIF. IF
x_header-frm_af_sav NE space. PERFORM (x_header-frm_af_sav) IN PROGRAM.
ENDIF. IF vim_abort_saving EQ space. REFRESH e071_loctab. APPEND e071
TO e071_loctab. PERFORM vim_synchronizer_call USING e071_loctab[]
corr_keytab[] 'X'. ENDIF. IF <status>-selected CO 'NUD'. CLEAR
<status>-selected. ENDIF. IF vim_abort_saving = space. PERFORM
vim_bc_logs_put CHANGING vim_bc_entry_list. ENDIF. CLEAR
vim_abort_saving. CALL FUNCTION 'VIEW_WRITE_CHANGELOG_HEADER' EXPORTING
viewname = x_header-viewname bastab = x_header-bastab begin = space
clidep = x_header-clidep. TRANSLATE vim_adjust_middle_level_mode USING
'XLSL'. ENDFORM. FORM BEFORE_LEAVING_EXT USING VALUE(VIEWNAME) LIKE
VIMDESC-VIEWNAME VALUE(MAINTVIEW) LIKE VIMDESC-MAINTVIEW
VALUE(EXIT_FORM) LIKE VIMDESC-FRM_BF_END. DATA: NAME(20) TYPE C VALUE
'STATUS_'. FIELD-SYMBOLS: <BLE_STATUS>. ASSIGN <STATUS> TO
<BLE_STATUS>. NAME+7 = MAINTVIEW. ASSIGN (NAME) TO <STATUS>. IF
VIM_CORR_OBJ_VIEWNAME NE VIEWNAME. CLEAR MAINT_MODE. ELSE. MAINT_MODE =
<STATUS>-ST_ACTION. ENDIF. PERFORM BEFORE_LEAVING_FRAME_FUNCTION USING
EXIT_FORM. ASSIGN <BLE_STATUS> TO <STATUS>. ENDFORM. FORM
before_leaving_frame_function USING value(exit_form) LIKE
vimdesc-frm_bf_end. DATA: prc TYPE sy-subrc, dummy TYPE c, dummi TYPE
i. IF <status>-corr_enqud NE space. CALL FUNCTION 'DEQUEUE_E_TRKORR'
EXPORTING trkorr = <status>-corr_nbr. CLEAR <status>-corr_enqud. ENDIF.
CLEAR <status>-corr_nbr. CLEAR <status>-initializd. CLEAR <initial>.
<vim_client_initial> = sy-mandt. IF ( maint_mode EQ anzeigen OR
maint_mode EQ transportieren ) AND vim_corr_obj_viewname NE space.
CLEAR vim_corr_obj_viewname. ENDIF. PERFORM vim_reset_texttab USING
view_name. CALL FUNCTION 'VIEW_RESET_LANGUAGES'. IF exit_form NE space.
PERFORM (exit_form) IN PROGRAM. ENDIF. CLEAR function. FREE
vim_bc_entry_list. CLEAR: <status>-bcfixnochg, vim_bc_chng_allowed,
<status>-bcfixdelinfosent. CLEAR vim_oc_inst. PERFORM check_range IN
PROGRAM saplsvix USING space 0 'E' space space space CHANGING dummy
prc. ENDFORM. FORM LISTE_EXIT_COMMAND. CASE OK_CODE. WHEN 'ABR '.
FUNCTION = OK_CODE. CLEAR OK_CODE. CASE VIM_SPECIAL_MODE. WHEN
VIM_REPLACE. CLEAR VIM_ACT_DYNP_VIEW. SET SCREEN 0. LEAVE SCREEN. WHEN
VIM_DELETE. SET SCREEN 0. LEAVE SCREEN. WHEN VIM_UPGRADE. CLEAR
VIM_ACT_DYNP_VIEW. NEUER = 'N'. SET SCREEN 0. LEAVE SCREEN. WHEN
OTHERS. PERFORM LISTE_ABBRECHEN. ENDCASE. WHEN 'IGN '. CASE
VIM_SPECIAL_MODE. WHEN VIM_REPLACE. CLEAR VIM_ACT_DYNP_VIEW. SET SCREEN
0. LEAVE SCREEN. WHEN VIM_DELETE. SET SCREEN 0. LEAVE SCREEN. WHEN
VIM_UPGRADE. CLEAR VIM_ACT_DYNP_VIEW. NEUER = 'N'. SET SCREEN 0. LEAVE
SCREEN. WHEN OTHERS. LOOP AT SCREEN. SCREEN-ACTIVE = 0. MODIFY SCREEN.
ENDLOOP. ENDCASE. NEUER = 'N'. CLEAR <STATUS>-UPD_FLAG. ENDCASE.
ENDFORM. FORM vim_get_global_table USING value(name_of_table_to_get)
TYPE c table_out TYPE ANY TABLE vggt_return LIKE sy-subrc.
FIELD-SYMBOLS: <table> TYPE ANY TABLE. ASSIGN (name_of_table_to_get) TO
<table>. IF sy-subrc EQ 0. table_out = <table>. ENDIF. vggt_return =
sy-subrc. ENDFORM. FORM vim_get_global_field_value USING
value(name_of_field_to_get) TYPE c value(type_of_field_to_get) TYPE c
field_value vggfv_return LIKE sy-subrc. FIELD-SYMBOLS: <field> TYPE
ANY. ASSIGN (name_of_field_to_get) TO <field> CASTING TYPE
(type_of_field_to_get). IF sy-subrc EQ 0. field_value = <field>. ENDIF.
vggfv_return = sy-subrc. ENDFORM. FORM VIM_SET_GLOBAL_FIELD_VALUE USING
VALUE(NAME_OF_FIELD_TO_SET) TYPE C VALUE(TYPE_OF_FIELD_TO_SET) TYPE C
VALUE(VALUE_TO_SET) VSGFV_RETURN LIKE SY-SUBRC. FIELD-SYMBOLS: <FIELD>.
ASSIGN (NAME_OF_FIELD_TO_SET) TO <FIELD> TYPE TYPE_OF_FIELD_TO_SET. IF
SY-SUBRC EQ 0. <FIELD> = VALUE_TO_SET. ENDIF. VSGFV_RETURN = SY-SUBRC.
ENDFORM. FORM VIM_APPEND_GLOBAL_TABLE USING VALUE(NAME_OF_TABLE) TYPE C
VALUE(BASE_TABLE) LIKE TVDIR-FLAG VALUE(TABLEN) LIKE VIMDESC-TABLEN
VALUE(ENTRY_TO_APPEND) VALUE(ACT_FLAG) LIKE TVDIR-FLAG VALUE(MRK_FLAG)
LIKE TVDIR-FLAG VALUE(TXTACT_FLAG) LIKE TVDIR-FLAG VAGT_RETURN LIKE
SY-SUBRC. DATA: WA(4096) TYPE C, DUM TYPE I. FIELD-SYMBOLS: <TABLE>
TYPE TABLE, <ENTRY>. ASSIGN (NAME_OF_TABLE) TO <TABLE>. IF SY-SUBRC EQ
0. WA = ENTRY_TO_APPEND. WA+TABLEN(1) = ACT_FLAG. DUM = TABLEN + 1.
WA+DUM(1) = MRK_FLAG. ADD 1 TO DUM. IF BASE_TABLE NE SPACE. WA+DUM(1) =
TXTACT_FLAG. ADD 1 TO DUM. ENDIF. ASSIGN WA(DUM) TO <ENTRY>. APPEND
<ENTRY> TO <TABLE>. ENDIF. VAGT_RETURN = SY-SUBRC. ENDFORM. FORM
VIM_RESTORE_LOCAL_MEMORY. DATA: H_NAME(31) TYPE C VALUE '*',
H_STATE(30) VALUE 'STATUS_'. VIEW_NAME = X_HEADER-VIEWNAME. IF
X_HEADER-BASTAB EQ SPACE. H_NAME+1 = X_HEADER-MAINTVIEW. H_STATE+7 =
X_HEADER-MAINTVIEW. ASSIGN: (X_HEADER-MAINTVIEW) TO <TABLE1>, (H_NAME)
TO <INITIAL>, (H_STATE) TO <STATUS>. ENDIF. VIM_RESTORE_MODE = 'X'.
PERFORM INITIALISIEREN. VIEW_ACTION = <STATUS>-ST_ACTION. TRANSLATE
VIEW_ACTION USING 'CUAU'. PERFORM JUSTIFY_ACTION_MODE. MOVE:
VIEW_ACTION TO MAINT_MODE, <STATUS>-CORR_NBR TO CORR_NBR,
<STATUS>-FCODE TO FUNCTION. PERFORM CALL_DYNPRO. ENDFORM. FORM
x_call_viewmaintenance USING value(xcv_use_lcl_tbl) LIKE tvdir-flag
value(xcv_import) LIKE tvdir-flag xcv_corrnbr LIKE e070-trkorr
value(xcv_fcode) TYPE vimty_tcode value(xcv_action) LIKE tvdir-flag
value(xcv_name) TYPE vimty_tablename value(xcv_tot_name) TYPE c
value(xcv_ext_name) TYPE c value(xcv_upgr_dest) LIKE rfcdes-rfcdest
value(xcv_upgr_clnt) LIKE sy-mandt xcv_upd_requ LIKE tvdir-flag
xcv_e071k TYPE table xcv_dba_sel TYPE table xcv_dpl_sel TYPE table
xcv_excufc TYPE table xcv_extract TYPE table xcv_total TYPE table
xcv_header TYPE table xcv_namtab TYPE table xcv_last_command TYPE
vimty_tcode xcv_last_act_entry LIKE sy-tabix xcv_results LIKE vimmodres
xcv_imp_results TYPE slctr_tables_keys value(xcv_imp_specmode) LIKE
tvdir-flag value(xcv_cmp_slcnds) LIKE tvdir-flag. DATA: xcv_return TYPE
i, xcv_i_fcode TYPE vimty_tcode, line_name(30) TYPE c, length TYPE i,
tabtype type ob_typ, header_wa_loc TYPE vimdesc, BEGIN OF tabline,
line(4096) TYPE c, END OF tabline. FIELD-SYMBOLS: <total> TYPE table,
<extract> TYPE table, <tabline> TYPE ANY, <tabline_x> TYPE x,
<tabline2> TYPE ANY, <tabline2_x> TYPE x, <header> TYPE vimdesc. LOCAL:
vim_import_mode_active, vim_no_dialog, vim_import_testmode,
vim_import_forcemode. vim_no_dialog = xcv_import. TRANSLATE
vim_no_dialog USING 'H DX'. IF xcv_imp_specmode = 'P'.
vim_import_profile = 'X'. ENDIF. vim_import_testmode =
xcv_imp_specmode. TRANSLATE vim_import_testmode USING 'TXBXF P '.
vim_import_forcemode = xcv_imp_specmode. TRANSLATE vim_import_forcemode
USING 'T BXFXP '. IF xcv_use_lcl_tbl ne space. ASSIGN: (xcv_tot_name)
TO <total>, (xcv_ext_name) TO <extract>. IF xcv_use_lcl_tbl ne 'L'.
READ TABLE xcv_header ASSIGNING <header> INDEX 1. IF <header>-bastab ne
space and <header>-texttbexst ne space. length = <header>-after_tabc +
<header>-aft_txttbc + 3 * cl_abap_char_utilities=>charsize. ELSE.
length = <header>-after_tabc + 2 * cl_abap_char_utilities=>charsize.
ENDIF. SEARCH xcv_tot_name FOR '[' IN CHARACTER MODE. MOVE
xcv_tot_name(sy-fdpos) TO line_name. ASSIGN: (line_name) TO <tabline2>,
<tabline2> TO <tabline2_x> CASTING. REFRESH: <total>, <extract>. LOOP
AT xcv_total ASSIGNING <tabline>. ASSIGN <tabline> TO <tabline_x>
CASTING. MOVE <tabline_x> TO <tabline2_x>(length). APPEND <tabline2> TO
<total>. ENDLOOP. LOOP AT xcv_extract ASSIGNING <tabline>. ASSIGN
<tabline> TO <tabline_x> CASTING. MOVE <tabline_x> TO
<tabline2_x>(length). APPEND <tabline2> TO <extract>. ENDLOOP. ENDIF.
ELSE. ASSIGN: xcv_total TO <total>, xcv_extract TO <extract>. ENDIF.
vim_import_mode_active = xcv_import. xcv_i_fcode = xcv_fcode. IF
xcv_import ne space and xcv_fcode ne 'SAVE'. ELSEIF xcv_import ne space
and xcv_fcode eq 'SAVE'. imp_results[] = xcv_imp_results[]. ELSEIF
xcv_fcode eq 'INS' or xcv_fcode eq 'DEL' or xcv_fcode eq 'UPD' or
xcv_fcode eq 'SHOW'. vim_single_entry_function = xcv_fcode. xcv_i_fcode
= 'EDIT'. ENDIF. IF xcv_import eq 'D' and xcv_fcode eq 'SAVE'.
vim_import_no_message = 'X'. ENDIF. CALL FUNCTION
'VIEW_MAINTENANCE_LOW_LEVEL' EXPORTING corr_number = xcv_corrnbr fcode
= xcv_i_fcode view_action = xcv_action view_name = xcv_name
rfc_destination_for_upgrade = xcv_upgr_dest client_for_upgrade =
xcv_upgr_clnt complex_selconds_used = xcv_cmp_slcnds IMPORTING
last_act_entry = xcv_last_act_entry ucomm = xcv_last_command
update_required = xcv_upd_requ corr_number = xcv_corrnbr TABLES
corr_keytab = xcv_e071k dba_sellist = xcv_dba_sel dpl_sellist =
xcv_dpl_sel excl_cua_funct = xcv_excufc extract = <extract> total =
<total> x_header = xcv_header x_namtab = xcv_namtab EXCEPTIONS
function_not_found = 1 missing_corr_number = 2
no_value_for_subset_ident = 3 saving_correction_failed = 4. IF (
xcv_import NE space OR vim_import_profile NE space ) AND ( sy-subrc ne
0 or xcv_fcode eq save and <status>-upd_flag ne space ). IF sy-msgid ne
space. vim_import_no_message = 'X'. IF vim_import_profile = 'X'. read
table xcv_header into header_wa_loc index 1. IF header_wa_loc-bastab EQ
space. tabtype = 'V'. ELSE. tabtype = 'S'. ENDIF. PERFORM
vim_bc_process_message USING sy-msgid 'I' 'E' sy-msgno sy-msgv1
sy-msgv2 sy-msgv3 sy-msgv4 tabtype. ELSE. PERFORM vim_process_message
USING sy-msgid 'I' 'E' sy-msgno sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. CLEAR vim_import_no_message. ENDIF. LOOP AT imp_results. IF
imp_results-import-inserted ne 0. imp_results-import-errors =
imp_results-import-inserted. CLEAR imp_results-import-inserted. ELSEIF
imp_results-import-updated ne 0. imp_results-import-errors =
imp_results-import-updated. CLEAR imp_results-import-updated. ELSEIF
imp_results-import-deleted ne 0. imp_results-import-errors =
imp_results-import-deleted. CLEAR imp_results-import-deleted. ENDIF.
MODIFY imp_results. ENDLOOP. ELSEIF xcv_import eq space and xcv_fcode
eq 'READ' and sy-subrc ne 0. IF sy-subrc eq 2. MESSAGE i053(sv) RAISING
no_authority. ELSE. MESSAGE i037(sv) WITH view_name RAISING
no_viewmaint_tool. ENDIF. ENDIF. IF xcv_fcode eq 'EXED' or xcv_fcode eq
'DEL'. xcv_results = vim_results_of_ext_mod. ELSEIF xcv_fcode eq read.
DESCRIBE TABLE <total> LINES xcv_results-nbr_of_upd. ELSEIF xcv_fcode
eq save and xcv_import eq 'D'. CLEAR vim_import_no_message. ENDIF. IF
xcv_use_lcl_tbl ne space and xcv_use_lcl_tbl ne 'L'. REFRESH:
xcv_total, xcv_extract. ASSIGN: tabline TO <tabline2_x> CASTING. LOOP
AT <total> ASSIGNING <tabline>. ASSIGN <tabline> TO <tabline_x>
CASTING. MOVE <tabline_x> TO <tabline2_x>(length). APPEND tabline TO
xcv_total. ENDLOOP. LOOP AT <extract> ASSIGNING <tabline>. ASSIGN
<tabline> TO <tabline_x> CASTING. MOVE <tabline_x> TO
<tabline2_x>(length). APPEND tabline TO xcv_extract. ENDLOOP. ENDIF.
CLEAR vim_single_entry_function. IF xcv_import ne space.
xcv_imp_results = imp_results[]. REFRESH imp_results. ENDIF. ENDFORM.
FORM X_CALL_SCREEN USING VALUE(XCS_SCREEN) LIKE D020S-DNUM. CALL SCREEN
XCS_SCREEN. ENDFORM. FORM after_temporal_delimitation. LOCAL: extract,
<table1>. DATA: index_safe TYPE i, rec TYPE i. LOOP AT
vim_delim_entries WHERE index3 NE space. DELETE extract INDEX
vim_delim_entries-index3. MOVE vim_delim_entries-index3 TO index_safe.
IF vim_special_mode EQ vim_reset. SUBTRACT 1 FROM <status>-maxlines. IF
<status>-st_mode EQ detail_bild AND <status>-cur_line GE
vim_delim_entries-index3. SUBTRACT 1 FROM <status>-cur_line. ENDIF.
ELSE. SUBTRACT 1 FROM maxlines. ENDIF. IF vim_delim_entries-index1 NE
0. CLEAR vim_delim_entries-index3. MODIFY vim_delim_entries. ENDIF.
LOOP AT vim_delim_entries WHERE index2 GT index_safe OR index3 GT
index_safe. IF vim_delim_entries-index2 GT index_safe. SUBTRACT 1 FROM
vim_delim_entries-index2. ENDIF. IF vim_delim_entries-index3 GT
index_safe. SUBTRACT 1 FROM vim_delim_entries-index3. ENDIF. MODIFY
vim_delim_entries. ENDLOOP. ENDLOOP. CLEAR extract. LOOP AT
vim_delim_entries WHERE index3 EQ space. READ TABLE total INDEX
vim_delim_entries-index1. MOVE total TO extract. IF x_header-delmdtflag
EQ 'E' AND <vim_begdate> LE sy-datum AND <vim_enddate> GE sy-datum OR
x_header-delmdtflag EQ 'B' AND <vim_begdate> GE sy-datum AND
<vim_enddate> LE sy-datum. rec = 8. LOOP AT vim_collapsed_mainkeys.
check <vim_collapsed_mkey_bfx> EQ <vim_tot_mkey_beforex>. IF
vim_mkey_after_exists NE space. CHECK <vim_collapsed_key_afx> EQ
<vim_tot_mkey_afterx>. ENDIF. READ TABLE extract WITH KEY
<vim_collapsed_keyx> TRANSPORTING NO FIELDS. IF sy-subrc EQ 0. MODIFY
extract INDEX sy-tabix. CLEAR rec. ENDIF. IF <vim_collapsed_keyx> NE
<vim_xtotal_key>. <vim_collapsed_keyx> = <vim_xtotal_key>.
<vim_collapsed_mkey_bfx> = <vim_tot_mkey_beforex>. MODIFY
vim_collapsed_mainkeys. ENDIF. EXIT. ENDLOOP. CHECK rec NE 0. ELSE.
PERFORM check_if_entry_is_to_display USING 'L' <vim_xtotal_key> space
<vim_begdate>. CHECK sy-subrc LT 8. ENDIF. INSERT extract INDEX
vim_delim_entries-index2. ADD 1 TO maxlines. MOVE
vim_delim_entries-index2 TO index_safe. LOOP AT vim_delim_entries WHERE
index2 GE index_safe. IF vim_delim_entries-index2 EQ index_safe. CHECK
vim_delim_entries-index_corr NE space. ENDIF. ADD 1 TO
vim_delim_entries-index2. MODIFY vim_delim_entries. ENDLOOP. ENDLOOP.
REFRESH vim_delim_entries. ENDFORM. FORM check_delim_new_entry USING
value(begdate) value(enddate). LOOP AT total. CHECK
<vim_tot_mkey_beforex> EQ <vim_f1_beforex> AND ( vim_mkey_after_exists
EQ space OR <vim_tot_mkey_afterx> EQ <vim_f1_afterx> ). CHECK
<vim_enddate> NE enddate. CHECK <action> NE geloescht AND <action> NE
neuer_geloescht AND <action> NE update_geloescht. IF
x_header-delmdtflag EQ 'E'. CHECK <vim_enddate> GE begdate AND
<vim_begdate> LE enddate. ELSE. CHECK <vim_enddate> LE begdate AND
<vim_begdate> GE enddate. ENDIF. IF vim_special_mode NE vim_reset.
MESSAGE w047(sv). ELSE. MESSAGE i047(sv). ENDIF. EXIT. ENDLOOP.
ENDFORM. FORM temp_delim_del_overld_entries USING value(begdate) TYPE d
value(enddate) TYPE d. LOCAL: extract, <table1>. DATA: first(1) TYPE c
VALUE 'X', overlayed(1) TYPE c, cur_ix TYPE i, date_increment TYPE i,
enddate_safe(8) TYPE c, new_ix TYPE i, trans_pattern(6) TYPE c,
act_safe, mark_safe, act_txt_safe, enddate_safe2(8) TYPE c, act,
act_txt, hf TYPE i, key_safe LIKE vim_merged_entries-new_key, date_safe
TYPE d, old_keyx type VRSDAT1000. IF vim_temp_delim_alr_checked NE
space. CLEAR first. ENDIF. LOOP AT total. CHECK <vim_tot_mkey_beforex>
EQ <vim_f1_beforex> AND ( vim_mkey_after_exists EQ space OR
<vim_tot_mkey_afterx> EQ <vim_f1_afterx> ). IF vim_special_mode NE
vim_upgrade AND vim_special_mode NE vim_reset AND vim_special_mode NE
vim_replace. CHECK <vim_enddate> NE enddate. ENDIF. CHECK <action> NE
geloescht AND <action> NE neuer_geloescht AND <action> NE
update_geloescht. CLEAR overlayed. IF x_header-delmdtflag EQ 'E'. CHECK
<vim_enddate> GE begdate AND <vim_begdate> LE enddate. IF <vim_begdate>
GE begdate AND <vim_enddate> LT enddate. MOVE 'F' TO overlayed. ELSEIF
<vim_begdate> LT begdate AND <vim_enddate> GT enddate. MOVE 'M' TO
overlayed. ELSEIF <vim_begdate> LE enddate AND <vim_enddate> GT
enddate. MOVE 'P' TO overlayed. ELSEIF <vim_begdate> EQ begdate AND
<vim_enddate> EQ enddate. temporal_delimitation_happened = 'N'. EXIT.
ELSEIF <vim_enddate> EQ enddate. MOVE 'E' TO overlayed. ENDIF. MOVE -1
TO date_increment. ELSE. CHECK <vim_enddate> LE begdate AND
<vim_begdate> GE enddate. IF <vim_begdate> LE begdate AND <vim_enddate>
GT enddate. MOVE 'F' TO overlayed. ELSEIF <vim_enddate> LT enddate AND
<vim_begdate> GT begdate. MOVE 'M' TO overlayed. ELSEIF <vim_enddate>
LE enddate AND <vim_begdate> GT enddate. MOVE 'P' TO overlayed. ELSEIF
<vim_begdate> EQ begdate AND <vim_enddate> EQ enddate.
temporal_delimitation_happened = 'N'. EXIT. ELSEIF <vim_enddate> EQ
enddate. MOVE 'E' TO overlayed. ENDIF. MOVE 1 TO date_increment. ENDIF.
IF first NE space. IF vim_special_mode NE vim_reset. MESSAGE w047(sv).
ELSE. MESSAGE i047(sv). ENDIF. CLEAR first. ENDIF. cur_ix = sy-tabix.
CLEAR vim_delim_entries. READ TABLE extract WITH KEY <vim_xtotal_key>.
IF sy-subrc EQ 0. MOVE sy-tabix TO vim_delim_entries-index3. IF
overlayed NE 'P' AND overlayed NE 'M' AND overlayed NE 'E'. APPEND
vim_delim_entries. ENDIF. ENDIF. IF overlayed EQ space OR overlayed EQ
'F'. MOVE: original TO trans_pattern, geloescht TO trans_pattern+1(1),
aendern TO trans_pattern+2(1), update_geloescht TO trans_pattern+3(1),
neuer_eintrag TO trans_pattern+4(1), neuer_geloescht TO
trans_pattern+5(1). TRANSLATE <action> USING trans_pattern. IF
x_header-bastab NE space AND x_header-texttbexst NE space AND
x_header-ptfrkyexst EQ space. TRANSLATE <action_text> USING
trans_pattern. ENDIF. IF <mark> EQ markiert. <mark> = nicht_markiert.
SUBTRACT 1 FROM mark_total. ENDIF. MODIFY total. ENDIF. IF overlayed EQ
space OR overlayed EQ 'M' OR overlayed EQ 'E'. IF overlayed EQ 'M'.
MOVE: <vim_enddate> TO enddate_safe, <action> TO act_safe, <mark> TO
mark_safe. IF x_header-bastab NE space AND x_header-texttbexst NE
space. MOVE <action_text> TO act_txt_safe. ENDIF. ENDIF. CLEAR hf.
old_keyx = <vim_xtotal_key>. <vim_enddate> = begdate + date_increment.
CHECK <vim_enddate> GE <vim_begdate>. <action> = neuer_eintrag. <mark>
= nicht_markiert. IF x_header-texttbexst NE space AND
x_header-ptfrkyexst EQ space. PERFORM vim_temp_delim_texttab USING
enddate old_keyx. IF x_header-bastab NE space. MOVE: <vim_enddate> TO
<vim_text_enddate>, neuer_eintrag TO <action_text>. ENDIF. ENDIF. IF
vim_special_mode NE space. PERFORM temp_delim_undelete USING
<vim_enddate_mask> <vim_begdate> act act_txt new_ix. IF new_ix NE 0.
MOVE act TO <action>. IF x_header-bastab NE space AND
x_header-texttbexst NE space. MOVE act_txt TO <action_text>. ENDIF.
MODIFY total INDEX new_ix. ENDIF. ENDIF. IF vim_special_mode EQ space
OR sy-subrc NE 0. IF x_header-delmdtflag EQ 'E'. new_ix = cur_ix.
INSERT total. ELSE. new_ix = cur_ix + 1. INSERT total INDEX new_ix.
ENDIF. ENDIF. IF vim_special_mode NE vim_undelete AND
vim_delim_entries-index3 NE 0. vim_delim_entries-index1 = new_ix.
vim_delim_entries-index2 = vim_delim_entries-index3. sy-fdpos =
vim_delim_entries-index3. CLEAR vim_delim_entries-index3. APPEND
vim_delim_entries. vim_delim_entries-index3 = sy-fdpos. ENDIF. ENDIF.
IF overlayed EQ 'P' OR overlayed EQ 'M'. IF overlayed EQ 'M'. MOVE:
enddate_safe TO <vim_enddate>, act_safe TO <action>, mark_safe TO
<mark>. IF x_header-bastab NE space AND x_header-texttbexst NE space.
MOVE act_txt_safe TO <action_text>. ENDIF. ENDIF. CLEAR hf.
<vim_begdate> = enddate - date_increment. MOVE: original TO
trans_pattern, aendern TO trans_pattern+1(1). TRANSLATE <action> USING
trans_pattern. IF <mark> EQ markiert. <mark> = nicht_markiert. SUBTRACT
1 FROM mark_total. ENDIF. MODIFY total. IF vim_delim_entries-index3 NE
0. vim_delim_entries-index1 = cur_ix. vim_delim_entries-index2 =
vim_delim_entries-index3. APPEND vim_delim_entries. ENDIF. ENDIF.
ENDLOOP. MOVE 'G' TO temporal_delimitation_happened. ENDFORM. FORM
temp_delim_undelete USING value(tdu_endda) value(tdu_begda) tdu_act
tdu_act_txt tdu_ix. LOCAL: total. DATA: trans_pattern(6) TYPE c, rec
TYPE i, ix TYPE i. CLEAR tdu_ix. READ TABLE total WITH KEY
<vim_xtotal_key> BINARY SEARCH. IF sy-subrc EQ 0.  IF <action> EQ
geloescht OR <action> EQ neuer_geloescht OR <action> EQ
update_geloescht. tdu_ix = sy-tabix. READ TABLE extract WITH KEY
<vim_xtotal_key>. rec = sy-subrc. ix = sy-tabix. IF sy-subrc EQ 0 AND
<xact> EQ markiert. SUBTRACT 1 FROM mark_extract. ELSE. MOVE tdu_endda
TO <vim_enddate_mask>. IF vim_special_mode EQ vim_reset. MESSAGE
i120(sv). ELSE. MESSAGE w120(sv). ENDIF. ENDIF. ADD 1 TO counter. IF
rec EQ 0. sy-fdpos = vim_delim_entries-index3. vim_delim_entries-index3
= ix. APPEND vim_delim_entries. vim_delim_entries-index3 = sy-fdpos.
ENDIF. MOVE: geloescht TO trans_pattern, original TO
trans_pattern+1(1), neuer_geloescht TO trans_pattern+2(1),
neuer_eintrag TO trans_pattern+3(1), update_geloescht TO
trans_pattern+4(1), aendern TO trans_pattern+5(1). TRANSLATE <action>
USING trans_pattern. MOVE <action> TO tdu_act. IF x_header-bastab NE
space AND x_header-texttbexst NE space. TRANSLATE <action_text> USING
trans_pattern. MOVE <action_text> TO tdu_act_txt. ENDIF. IF tdu_begda
NE <vim_begdate>. MOVE: original TO trans_pattern, aendern TO
trans_pattern+1. TRANSLATE: tdu_act USING trans_pattern, tdu_act_txt
USING trans_pattern. ENDIF. ENDIF. CLEAR sy-subrc. ENDIF. ENDFORM. FORM
temporal_delimitation. constants: highdate TYPE d VALUE '99991231'.
DATA: entries_exist(1) TYPE c, enddate_safe TYPE d, act(1) TYPE c,
act_txt(1) TYPE c, hf TYPE i, date_safe TYPE d, ok_code_safe LIKE
ok_code, function_safe LIKE function, delim_entr_safe TYPE STANDARD
TABLE OF vim_delim_entr_tl WITH DEFAULT KEY INITIAL SIZE 10,
collapsed_mkeys_safe TYPE STANDARD TABLE OF vim_collapsed_mkeys_tl WITH
DEFAULT KEY INITIAL SIZE 1, merged_entr_safe TYPE STANDARD TABLE OF
vim_merged_entr_tl WITH DEFAULT KEY INITIAL SIZE 1. CHECK
x_header-delmdtflag NE space. IF ( <vim_new_begdate> is initial OR
<vim_enddate_mask> EQ vim_init_date ) AND status-mode EQ list_bild.
MESSAGE e127(sv). ENDIF. IF x_header-clidep NE space. MOVE sy-mandt TO
<client>. ENDIF. IF <xact> NE leer AND neuer NE 'J' AND status-delete
NE geloescht AND ( status-action NE kopieren AND vim_special_mode EQ
space OR vim_special_mode EQ vim_delimit ). READ TABLE total WITH KEY
<vim_xextract_key> BINARY SEARCH. CHECK sy-subrc EQ 0. ELSE. IF
status-mode EQ list_bild. IF x_header-delmdtflag EQ 'E' AND
<vim_new_begdate> GT <vim_enddate_mask>. MESSAGE e045(sv). ELSEIF
x_header-delmdtflag EQ 'B' AND <vim_new_begdate> LT <vim_enddate_mask>.
MESSAGE e046(sv). ENDIF. ENDIF. LOOP AT total. CHECK
<vim_tot_mkey_beforex> EQ <vim_f1_beforex> AND ( vim_mkey_after_exists
EQ space OR <vim_tot_mkey_afterx> EQ <vim_f1_afterx> ). MOVE 'X' TO
entries_exist. EXIT. ENDLOOP. CHECK entries_exist NE space. MOVE:
<table2_x> TO <vim_xtotal>, <vim_enddate_mask> TO <vim_enddate>. IF
x_header-delmdtflag EQ 'E'. MOVE highdate TO <vim_begdate>. ELSE. CLEAR
<vim_begdate>. ENDIF. ENDIF. CHECK <vim_new_begdate> NE <vim_begdate>.
IF x_header-customauth CO sap_cust_ctrl_classes OR
vim_ale_keyspec_check NE space. PERFORM check_allowed_keyranges. ENDIF.
IF x_header-delmdtflag EQ 'E'. IF <vim_new_begdate> GT <vim_enddate>.
MESSAGE e045(sv). ELSEIF <vim_new_begdate> LT <vim_begdate>. PERFORM
temp_delim_del_overld_entries USING <vim_new_begdate> <vim_enddate>.
ELSE. <vim_enddate> = <vim_new_begdate> - 1. IF x_header-texttbexst NE
space AND x_header-ptfrkyexst EQ space. PERFORM vim_temp_delim_texttab
USING <vim_enddate_mask> <vim_xextract_key>. IF x_header-bastab NE
space. MOVE: <vim_enddate> TO <vim_text_enddate>, neuer_eintrag TO
<action_text>. ENDIF. ENDIF. READ TABLE total WITH KEY <vim_xtotal_key>
BINARY SEARCH TRANSPORTING NO FIELDS. IF sy-subrc NE 0. <action> =
neuer_eintrag. <mark> = nicht_markiert. INSERT total INDEX sy-tabix.
ELSE. MESSAGE w121(sv). PERFORM temp_delim_determine_action USING
sy-tabix act act_txt. <action> = act. IF x_header-bastab NE space AND
x_header-texttbexst NE space. <action_text> = act_txt. ENDIF. MODIFY
total INDEX sy-tabix. ENDIF. ENDIF. ELSE. IF <vim_new_begdate> LT
<vim_enddate>. MESSAGE e046(sv). ELSEIF <vim_new_begdate> GT
<vim_begdate>. PERFORM temp_delim_del_overld_entries USING
<vim_new_begdate> <vim_enddate>. ELSE. <vim_begdate> =
<vim_new_begdate>. IF x_header-bastab NE space AND x_header-texttbexst
NE space AND x_header-ptfrkyexst EQ space. IF <action_text> EQ
original. MOVE aendern TO <action_text>. ENDIF. ENDIF. IF <action> EQ
original. <action> = aendern. ENDIF. MODIFY total INDEX sy-tabix. total
= extract. <vim_enddate> = <vim_new_begdate> + 1. <action> = <xact> =
neuer_eintrag. IF x_header-bastab NE space AND x_header-texttbexst NE
space AND x_header-ptfrkyexst EQ space. MOVE: <vim_enddate> TO
<vim_text_enddate>, neuer_eintrag TO <action_text>, neuer_eintrag TO
<xact_text>. ENDIF. anz_pages = sy-tabix + 1. INSERT total INDEX
anz_pages. ENDIF. ENDIF. IF temporal_delimitation_happened EQ 'N'.
CLEAR temporal_delimitation_happened. EXIT. ENDIF. IF
temporal_delimitation_happened NE 'G'. MOVE sy-tabix TO anz_pages. LOOP
AT vim_delim_entries WHERE index1 GE anz_pages. ADD 1 TO
vim_delim_entries-index1. MODIFY vim_delim_entries. ENDLOOP. MOVE:
anz_pages TO vim_delim_entries-index1, nextline TO
vim_delim_entries-index2, space TO vim_delim_entries-index3. APPEND
vim_delim_entries. MOVE 'X' TO temporal_delimitation_happened. ENDIF.
IF <xact> NE leer AND neuer NE 'J' AND status-delete NE geloescht AND (
status-action NE kopieren AND vim_special_mode EQ space OR
vim_special_mode EQ vim_delimit ). IF x_header-adrnbrflag NE space.
CALL FUNCTION 'POPUP_TO_DECIDE' EXPORTING defaultoption = '1' titel =
svim_text_037 textline1 = svim_text_038 textline2 = svim_text_039
textline3 = svim_text_040 text_option1 = svim_text_041 text_option2 =
svim_text_042 IMPORTING answer = answer. CASE answer. WHEN 'A'. EXIT.
WHEN '2'. CLEAR <address_number>. WHEN OTHERS. ENDCASE. ENDIF. IF
x_header-guidflag <> space. PERFORM vim_make_guid USING space. ENDIF.
IF x_header-frm_h_flds NE space. PERFORM (x_header-frm_h_flds) IN
PROGRAM. ENDIF. IF x_header-frm_on_new NE space. PERFORM
(x_header-frm_on_new) IN PROGRAM. ENDIF. IF x_header-adrnbrflag NE
space AND answer EQ '2'. PERFORM address_maintain. ENDIF. IF
x_header-frm_af_dlm NE space. delim_entr_safe = vim_delim_entries[].
collapsed_mkeys_safe = vim_collapsed_mainkeys[]. merged_entr_safe =
vim_merged_entries[]. IF status-mode EQ detail_bild. ok_code_safe =
ok_code. function_safe = function. ENDIF. PERFORM (x_header-frm_af_dlm)
IN PROGRAM. MOVE delim_entr_safe TO vim_delim_entries[]. MOVE
collapsed_mkeys_safe TO vim_collapsed_mainkeys[]. MOVE merged_entr_safe
TO vim_merged_entries[]. IF status-mode EQ detail_bild. MOVE:
ok_code_safe TO ok_code, function_safe TO function. ENDIF. ENDIF.
ENDIF. ENDFORM. FORM TEMP_DELIM_DETERMINE_ACTION USING
VALUE(TDDA_INDEX) TDDA_ACT TDDA_ACT_TXT. LOCAL: TOTAL. READ TABLE TOTAL
INDEX TDDA_INDEX. IF <ACTION> EQ NEUER_GELOESCHT. TDDA_ACT =
NEUER_EINTRAG. ELSE. TDDA_ACT = AENDERN. ENDIF. IF X_HEADER-BASTAB NE
SPACE AND X_HEADER-TEXTTBEXST NE SPACE. IF <ACTION_TEXT> EQ
NEUER_GELOESCHT. TDDA_ACT_TXT = NEUER_EINTRAG. ELSE. TDDA_ACT_TXT =
AENDERN. ENDIF. ENDIF. ENDFORM. FORM consistency_prt_frky_fields USING
value(cpff_alert) LIKE tvdir-flag. DATA: prtfky_field_changed(1) TYPE
c, cur_mkey_found(1) TYPE c, count TYPE i, offs TYPE i, formname(19)
TYPE c VALUE 'FILL_TEXTTAB_KEY_UC'. FIELD-SYMBOLS: <dummy1>. LOCAL:
total, extract. CHECK status-action NE anzeigen. CHECK
<status>-upd_flag NE space. MOVE: <f1_x> TO <vim_xtotal_key>,
vim_date_mask TO <vim_enddate_mask>, <f1_x> TO <vim_h_mkey>,
<vim_xtotal_key> TO <f1_x>. IF x_header-selection EQ space. LOOP AT
total. CHECK <vim_xtotal_key> NE <f1_x> AND <vim_tot_mkey_beforex> EQ
<vim_mkey_beforex> AND ( vim_mkey_after_exists EQ space OR
<vim_tot_mkey_afterx> EQ <vim_mkey_afterx> ). MOVE 99 TO count. EXIT.
ENDLOOP. ELSE. MOVE 99 TO count. ENDIF. IF count EQ 99. IF
vim_prtfky_assigned CO ' Y'. CLEAR count. LOOP AT x_namtab WHERE
prtfrkyfld NE space. CHECK x_namtab-readonly EQ space. IF
vim_prtfky_assigned EQ space. IF x_header-bastab EQ space OR
x_header-texttbexst EQ space OR x_namtab-texttabfld EQ space. ASSIGN:
COMPONENT x_namtab-viewfield OF STRUCTURE <table1> TO <vim_prtfky_wa>.
ELSE. ASSIGN: COMPONENT x_namtab-viewfield OF STRUCTURE <table1_text>
TO <vim_prtfky_wa>. ENDIF. ENDIF. IF x_header-bastab EQ space OR
x_header-texttbexst EQ space OR x_namtab-texttabfld EQ space. ASSIGN:
COMPONENT x_namtab-viewfield OF STRUCTURE <vim_total_struc> TO
<vim_prtfky_total>, COMPONENT x_namtab-viewfield OF STRUCTURE
<vim_extract_struc> TO <vim_prtfky_extract>. ELSE. ASSIGN: COMPONENT
x_namtab-viewfield OF STRUCTURE <vim_tot_txt_struc> TO
<vim_prtfky_total>, COMPONENT x_namtab-viewfield OF STRUCTURE
<vim_ext_txt_struc> TO <vim_prtfky_extract>. ENDIF. CLEAR
prtfky_field_changed. IF status-action EQ hinzufuegen OR status-action
EQ kopieren OR vim_special_mode EQ vim_upgrade. CLEAR cur_mkey_found.
LOOP AT total. CHECK <vim_tot_mkey_beforex> EQ <vim_mkey_beforex> AND (
vim_mkey_after_exists EQ space OR <vim_tot_mkey_afterx> EQ
<vim_mkey_afterx> ). cur_mkey_found = 'X'. EXIT. ENDLOOP. IF
cur_mkey_found NE space. IF <vim_prtfky_wa> IS INITIAL. MOVE
<vim_prtfky_total> TO <vim_prtfky_wa>. TRANSLATE <status>-upd_flag
USING 'EY'. IF <status>-upd_flag EQ 'Y'. PERFORM (formname) IN PROGRAM
(sy-repid) USING <table1> <table1_text>. ENDIF. ELSEIF <vim_prtfky_wa>
NE <vim_prtfky_total>. MOVE 'X' TO prtfky_field_changed. ENDIF. ENDIF.
ELSEIF <vim_prtfky_wa> NE <vim_prtfky_extract>. MOVE 'X' TO
prtfky_field_changed. ENDIF. ADD 1 TO count. ENDLOOP. IF count EQ 1.
MOVE 'X' TO vim_prtfky_assigned. ENDIF. ELSE. IF status-action EQ
hinzufuegen OR status-action EQ kopieren OR vim_special_mode EQ
vim_upgrade. LOOP AT total. CHECK <vim_tot_mkey_beforex> EQ
<vim_mkey_beforex> AND ( vim_mkey_after_exists EQ space OR
<vim_tot_mkey_afterx> EQ <vim_mkey_afterx> ). cur_mkey_found = 'X'.
EXIT. ENDLOOP. IF cur_mkey_found NE space. IF <vim_prtfky_wa> IS
INITIAL. MOVE <vim_prtfky_total> TO <vim_prtfky_wa>. TRANSLATE
<status>-upd_flag USING 'EY'. IF <status>-upd_flag EQ 'Y'. PERFORM
(formname) IN PROGRAM (sy-repid) USING <table1> <table1_text>. ENDIF.
ELSEIF <vim_prtfky_wa> NE <vim_prtfky_total>. MOVE 'X' TO
prtfky_field_changed. ENDIF. ENDIF. ELSEIF <vim_prtfky_wa> NE
<vim_prtfky_extract>. MOVE 'X' TO prtfky_field_changed. ENDIF. ENDIF.
IF prtfky_field_changed NE space. IF cpff_alert NE space. sy-msgv1 =
svim_text_030. sy-msgv2 = <vim_mainkey_mask>. TRANSLATE sy-msgv2 USING
'+ '. IF x_header-clidep NE space. SHIFT sy-msgv2 BY client_length
PLACES. ENDIF. count = strlen( sy-msgv2 ). ASSIGN sy-msgv2(count) TO
<dummy1>. REPLACE '&' WITH <dummy1> INTO sy-msgv1. CALL FUNCTION
'POPUP_TO_CONFIRM_WITH_MESSAGE' EXPORTING diagnosetext1 = svim_text_031
diagnosetext2 = svim_text_032 diagnosetext3 = svim_text_033 textline1 =
svim_text_034 textline2 = svim_text_035 titel = sy-msgv1 cancel_display
= space IMPORTING answer = answer. ELSE. answer = 'J'. ENDIF. IF answer
EQ 'A'. answer = 'N'. ENDIF. CASE answer. WHEN 'J'. IF status-action EQ
hinzufuegen OR status-action EQ kopieren. PERFORM check_key. ELSEIF (
x_header-customauth CO sap_cust_ctrl_classes OR vim_ale_keyspec_check
NE space ). PERFORM check_allowed_keyranges. ENDIF. LOOP AT total.
CHECK <vim_xtotal_key> NE <f1_x> AND <vim_tot_mkey_beforex> EQ
<vim_mkey_beforex> AND ( vim_mkey_after_exists EQ space OR
<vim_tot_mkey_afterx> EQ <vim_mkey_afterx> ). IF vim_prtfky_assigned CO
' Y'. LOOP AT x_namtab WHERE prtfrkyfld NE space. IF
vim_prtfky_assigned EQ space. IF x_header-bastab EQ space OR
x_header-texttbexst EQ space OR x_namtab-texttabfld EQ space. ASSIGN:
COMPONENT x_namtab-viewfield OF STRUCTURE <table1> TO <vim_prtfky_wa>,
COMPONENT x_namtab-viewfield OF STRUCTURE <vim_total_struc> TO
<vim_prtfky_total>. ELSE. ASSIGN: COMPONENT x_namtab-viewfield OF
STRUCTURE <table1_text> TO <vim_prtfky_wa>, COMPONENT
x_namtab-viewfield OF STRUCTURE <vim_tot_txt_struc> TO
<vim_prtfky_total>. ENDIF. ENDIF. MOVE <vim_prtfky_wa> TO
<vim_prtfky_total>. ENDLOOP. ELSE. MOVE <vim_prtfky_wa> TO
<vim_prtfky_total>. ENDIF. MODIFY total. READ TABLE extract WITH KEY
<vim_xtotal_key>. IF sy-subrc EQ 0. MOVE total TO extract. MODIFY
extract INDEX sy-tabix. ENDIF. ENDLOOP. vim_prt_fky_flds_updated = 'X'.
WHEN 'N'. IF vim_prtfky_assigned CO ' Y'. LOOP AT x_namtab WHERE
prtfrkyfld NE space. IF vim_prtfky_assigned EQ space. IF
x_header-bastab EQ space OR x_header-texttbexst EQ space OR
x_namtab-texttabfld EQ space. ASSIGN: COMPONENT x_namtab-viewfield OF
STRUCTURE <table1> TO <vim_prtfky_wa>, COMPONENT x_namtab-viewfield OF
STRUCTURE <vim_total_struc> TO <vim_prtfky_total>, COMPONENT
x_namtab-viewfield OF STRUCTURE <vim_extract_struc> TO
<vim_prtfky_extract>. ELSE. ASSIGN: COMPONENT x_namtab-viewfield OF
STRUCTURE <table1_text> TO <vim_prtfky_wa>, COMPONENT
x_namtab-viewfield OF STRUCTURE <vim_tot_txt_struc> TO
<vim_prtfky_total>, COMPONENT x_namtab-viewfield OF STRUCTURE
<vim_ext_txt_struc> TO <vim_prtfky_extract>. ENDIF. ENDIF. IF
status-action EQ hinzufuegen OR status-action EQ kopieren OR
vim_special_mode EQ vim_upgrade. MOVE <vim_prtfky_total> TO
<vim_prtfky_wa>. ELSE. MOVE <vim_prtfky_extract> TO <vim_prtfky_wa>.
ENDIF. ENDLOOP. ELSE. IF status-action EQ hinzufuegen OR status-action
EQ kopieren OR vim_special_mode EQ vim_upgrade. MOVE <vim_prtfky_total>
TO <vim_prtfky_wa>. ELSE. MOVE <vim_prtfky_extract> TO <vim_prtfky_wa>.
ENDIF. ENDIF. IF ( x_header-bastab EQ space OR x_header-texttbexst EQ
space ) AND <table1_x> EQ <vim_xextract>. CLEAR <status>-upd_flag.
ELSEIF x_header-bastab NE space AND x_header-texttbexst NE space AND
<table1_xtext> EQ <vim_xextract_text>. TRANSLATE <status>-upd_flag
USING 'XET '. ENDIF. ENDCASE. ENDIF. ENDIF. ENDFORM. FORM DELIMITATION.
LOCAL: <TABLE1>, <TABLE1_TEXT>. DATA: D_RC(1) TYPE C. CALL FUNCTION
'POPUP_GET_VALUES' EXPORTING POPUP_TITLE = SVIM_TEXT_036 START_COLUMN =
'10' START_ROW = '10' IMPORTING RETURNCODE = D_RC TABLES FIELDS =
VIM_SVAL_TAB EXCEPTIONS ERROR_IN_FIELDS = 01. IF SY-SUBRC NE 0. RAISE
GET_VALUES_ERROR. ENDIF. CHECK D_RC NE 'A'. READ TABLE VIM_SVAL_TAB
INDEX 1. VIM_SPECIAL_MODE = VIM_DELIMIT. CLEAR: COUNTER,
VIM_OLD_VIEWKEY. TRANSLATE VIM_NO_MAINKEY_EXISTS USING
VIM_NO_MKEY_NOT_PROCSD_PATT. if x_header-frm_af_edd NE SPACE. PERFORM
(x_header-frm_af_edd) IN PROGRAM (x_header-fpoolname). endif. PERFORM
KOPIERE. IF TEMPORAL_DELIMITATION_HAPPENED NE SPACE. REFRESH
VIM_DELIM_ENTRIES. CLEAR TEMPORAL_DELIMITATION_HAPPENED. ENDIF. CLEAR:
VIM_SPECIAL_MODE. ENDFORM. FORM time_dependent_display_modif. DATA:
ex_ix TYPE i, modif_mode(1) TYPE c, first(1) TYPE c, ex_begin TYPE i,
ex_end TYPE i, key_safe TYPE vrsdat1000, to_ix TYPE i, rc like
sy-subrc. READ TABLE extract INDEX nextline. key_safe =
<vim_xextract_key>. CLEAR vim_mainkey. TRANSLATE vim_no_mainkey_exists
USING vim_no_mkey_not_procsd_patt. LOOP AT extract. ex_ix = sy-tabix.
IF vim_no_mainkey_exists EQ vim_no_mkey_not_procsd OR
<vim_ext_mkey_beforex> NE <vim_mkey_beforex> OR ( vim_mkey_after_exists
NE space AND <vim_ext_mkey_afterx> NE <vim_mkey_afterx> ). ex_end =
sy-tabix - 1. IF modif_mode EQ 'C'. PERFORM collapse USING ex_begin
ex_end. modif_mode = 'X'. ENDIF. ex_begin = ex_ix. <vim_h_mkey> =
<vim_xextract_key>. TRANSLATE vim_no_mainkey_exists USING
vim_no_mkey_procsd_patt. ENDIF. CHECK <xmark> EQ markiert. READ TABLE
total WITH KEY <vim_xextract_key> BINARY SEARCH. <mark> =
nicht_markiert. SUBTRACT 1 FROM mark_total. MODIFY total INDEX
sy-tabix. SUBTRACT 1 FROM mark_extract. IF modif_mode CO ' X'. rc = 4.
LOOP AT vim_collapsed_mainkeys. check <vim_collapsed_mkey_bfx> =
<vim_mkey_beforex>. IF vim_mkey_after_exists NE space. CHECK
<vim_collapsed_key_afx> EQ <vim_mkey_afterx>. ENDIF. DELETE
vim_collapsed_mainkeys. clear rc. EXIT. ENDLOOP. IF rc EQ 0. modif_mode
= 'E'. ELSE. modif_mode = 'C'. ENDIF. ENDIF. IF modif_mode = 'E'. CLEAR
vim_delim_entries. vim_delim_entries-index3 = ex_ix. APPEND
vim_delim_entries. CLEAR vim_delim_entries-index3.
vim_delim_entries-index_corr = 'X'. LOOP AT total. CHECK
<vim_tot_mkey_beforex> EQ <vim_mkey_beforex> AND (
vim_mkey_after_exists EQ space OR <vim_tot_mkey_afterx> EQ
<vim_mkey_afterx> ). to_ix = sy-tabix. PERFORM select USING
<status>-selected. CHECK sy-subrc EQ 0. vim_delim_entries-index1 =
to_ix. vim_delim_entries-index2 = ex_ix. APPEND vim_delim_entries.
ENDLOOP. modif_mode = 'X'. ENDIF. ENDLOOP. IF modif_mode EQ 'C'. CLEAR
vim_delim_entries. PERFORM collapse USING ex_begin maxlines. ENDIF.
PERFORM after_temporal_delimitation. <vim_xextract_key> = key_safe.
READ TABLE extract WITH KEY <vim_ext_mkey_beforex>. IF sy-subrc EQ 0.
nextline = sy-tabix. ELSE. nextline = 1. ENDIF. ENDFORM. FORM collapse
USING value(c_begin_ix) TYPE i value(c_end_ix) TYPE i. LOCAL: extract.
DATA: first(1) TYPE c VALUE 'X', hf_ind TYPE i, hf_ind2 TYPE i, act_ix
TYPE i. LOOP AT total. act_ix = sy-tabix. PERFORM select USING
<status>-selected. CHECK sy-subrc EQ 0. CHECK <vim_tot_mkey_beforeX> EQ
<vim_mkey_beforeX> AND ( vim_mkey_after_exists EQ space OR
<vim_tot_mkey_afterx> EQ <vim_mkey_afterx> ). IF first NE space.
<vim_collapsed_keyx> = <vim_xtotal_key>. if <vim_collapsed_mkey_bfx> ne
<vim_tot_mkey_beforex>. <vim_collapsed_mkey_bfx> =
<vim_tot_mkey_beforex>. endif. hf_ind = act_ix. CLEAR first. ENDIF. IF
x_header-delmdtflag EQ 'E'. CHECK <vim_begdate> LE sy-datum AND
<vim_enddate> GE sy-datum. ELSE. CHECK <vim_begdate> GE sy-datum AND
<vim_enddate> LE sy-datum. ENDIF. <vim_collapsed_keyx> =
<vim_xtotal_key>. if <vim_collapsed_mkey_bfx> ne
<vim_tot_mkey_beforex>. <vim_collapsed_mkey_bfx> =
<vim_tot_mkey_beforex>. endif. hf_ind = act_ix. EXIT. ENDLOOP. READ
TABLE vim_collapsed_mainkeys with key <vim_collapsed_keyx> BINARY
SEARCH TRANSPORTING NO FIELDS. INSERT vim_collapsed_mainkeys INDEX
sy-tabix. vim_delim_entries-index1 = hf_ind. vim_delim_entries-index2 =
c_begin_ix. vim_delim_entries-index3 = c_begin_ix.
vim_delim_entries-index_corr = 'X'. APPEND vim_delim_entries. hf_ind2 =
c_begin_ix + 1. CLEAR vim_delim_entries. LOOP AT extract FROM hf_ind2
TO c_end_ix. vim_delim_entries-index3 = sy-tabix. APPEND
vim_delim_entries. ENDLOOP. CLEAR vim_old_viewkey. TRANSLATE
vim_no_mainkey_exists USING vim_no_mkey_not_procsd_patt. ENDFORM. FORM
BUILD_MAINKEY_TAB. PERFORM BUILD_MAINKEY_TAB_0. LOOP AT TOTAL. PERFORM
BUILD_MAINKEY_TAB_1. ENDLOOP. PERFORM BUILD_MAINKEY_TAB_2. ENDFORM.
FORM BUILD_MAINKEY_TAB_0. CLEAR: VIM_MAINKEY, VIM_MERGED_ENTRIES,
VIM_COLLAPSED_MAINKEYS, <TABLE1>, VIM_MERGE_BEGIN, VIM_MERGE_END.
TRANSLATE VIM_NO_MAINKEY_EXISTS USING VIM_NO_MKEY_NOT_PROCSD_PATT.
REFRESH: VIM_COLLAPSED_MAINKEYS, VIM_MERGED_ENTRIES.
VIM_COLL_MKEYS_FIRST = 'X'. ENDFORM. FORM build_mainkey_tab_1. DATA:
date_safe TYPE d, date_safe_1 TYPE d, date_safe_2 TYPE d, date_safe_3
TYPE d. date_safe = <vim_begdate>. date_safe_1 = <vim_enddate>.
date_safe_2 = <vim_new_begdate>. date_safe_3 = <vim_enddate_mask>.
<vim_begdate> = <vim_enddate> = <vim_new_begdate> = <vim_enddate_mask>
= '99999999'. IF <vim_xtotal> NE <table1_x>. MOVE: date_safe TO
<vim_begdate>, date_safe_1 TO <vim_enddate>, date_safe_2 TO
<vim_new_begdate>, date_safe_3 TO <vim_enddate_mask>. IF
vim_no_mainkey_exists EQ vim_no_mkey_not_procsd OR
<vim_tot_mkey_beforex> NE <vim_f1_beforex>. IF vim_coll_mkeys_first EQ
space. APPEND vim_collapsed_mainkeys. CLEAR
vim_collapsed_mainkeys-log_key. ELSE. CLEAR vim_coll_mkeys_first.
ENDIF. <vim_collapsed_keyx> = <vim_xtotal_key>.
<vim_collapsed_mkey_bfx> = <vim_tot_mkey_beforex>. ELSEIF
vim_mkey_after_exists NE space AND <vim_tot_mkey_afterx> NE
<vim_f1_afterx>. IF vim_coll_mkeys_first EQ space. APPEND
vim_collapsed_mainkeys. CLEAR vim_collapsed_mainkeys-log_key. ELSE.
CLEAR vim_coll_mkeys_first. ENDIF. <vim_collapsed_keyx> =
<vim_xtotal_key>. ELSE. IF x_header-delmdtflag EQ 'E' AND <vim_begdate>
LE sy-datum AND <vim_enddate> GE sy-datum OR x_header-delmdtflag EQ 'B'
AND <vim_begdate> GE sy-datum AND <vim_enddate> LE sy-datum.
<vim_collapsed_keyx> = <vim_xtotal_key>. if <vim_collapsed_mkey_bfx> NE
<vim_tot_mkey_beforex>. <vim_collapsed_mkey_bfx> =
<vim_tot_mkey_beforex>. endif. ENDIF. ENDIF. <table1_x> = <vim_xtotal>.
TRANSLATE vim_no_mainkey_exists USING vim_no_mkey_procsd_patt. ELSE.
MOVE: date_safe TO <vim_begdate>, date_safe_1 TO <vim_enddate>,
date_safe_2 TO <vim_new_begdate>, date_safe_3 TO <vim_enddate_mask>. IF
x_header-delmdtflag EQ 'E' AND <vim_begdate> LE sy-datum AND
<vim_enddate> GE sy-datum OR x_header-delmdtflag EQ 'B' AND
<vim_begdate> GE sy-datum AND <vim_enddate> LE sy-datum.
<vim_collapsed_keyx> = <vim_xtotal_key>. if <vim_collapsed_mkey_bfx> NE
<vim_tot_mkey_beforex>. <vim_collapsed_mkey_bfx> =
<vim_tot_mkey_beforex>. endif. ENDIF. ENDIF. ENDFORM. FORM
BUILD_MAINKEY_TAB_2. APPEND VIM_COLLAPSED_MAINKEYS. MOVE:
X_HEADER-VIEWNAME TO VIM_MEMORY_ID_1-VIEWNAME, SY-UNAME TO
VIM_MEMORY_ID_1-USER. EXPORT VIM_COLLAPSED_MAINKEYS TO MEMORY ID
VIM_MEMORY_ID_1. ENDFORM. FORM delete_from_mainkey_tab. LOOP AT
vim_collapsed_mainkeys. CHECK <vim_h_coll_mkey>(x_header-keylen) =
<f1_x>. DELETE vim_collapsed_mainkeys. ENDLOOP. ENDFORM. FORM
X_REFRESH_TCTRL USING VALUE(XRT_NAME) LIKE VIMDESC-VIEWNAME
VALUE(XRT_SCREEN) LIKE VIMDESC-LISTE. DATA: XRT_CONTROL_NAME(16) TYPE C
VALUE 'TCTRL_'. XRT_CONTROL_NAME+6 = XRT_NAME. REFRESH CONTROL
XRT_CONTROL_NAME FROM SCREEN XRT_SCREEN. ENDFORM. FORM
VIM_PROCESS_MESSAGE USING VALUE(PM_ID) LIKE SY-MSGID
VALUE(PM_ONLINE_TYPE) LIKE SY-MSGTY VALUE(PM_BATCH_TYPE) LIKE SY-MSGTY
VALUE(PM_NBR) LIKE SY-MSGNO VALUE(PM_V1) LIKE SY-MSGV1 VALUE(PM_V2)
LIKE SY-MSGV2 VALUE(PM_V3) LIKE SY-MSGV3 VALUE(PM_V4) LIKE SY-MSGV4.
DATA: I_TYPE LIKE SPROT_U-SEVERITY, I_MSGTY LIKE SY-MSGTY, I_MSGNO LIKE
SY-MSGNO, objtype TYPE ob_typ. IF VIM_NO_DIALOG NE SPACE. I_TYPE =
I_MSGTY = PM_BATCH_TYPE. I_MSGNO = PM_NBR. IF VIM_IMPORT_PROFILE = 'X'.
IF x_header-bastab EQ space. objtype = 'V'. ELSE. objtype = 'S'. ENDIF.
CALL FUNCTION 'SCPR_PROT_DATA_WRITE' EXPORTING act_id =
VIM_ACTOPTS-ACT_ID bcset_id = VIM_BCSET_ID objectname = VIM_VIEW_NAME
tablekey = VIM_PROFILE_ERRORKEY MSGID = PM_ID MSGTY = I_TYPE MSGNO =
I_MSGNO var1 = PM_V1 var2 = PM_V2 var3 = PM_V3 var4 = PM_V4 objecttype
= objtype. ELSE. TRANSLATE I_TYPE USING 'I S '. CALL FUNCTION
'LCT_MESSAGE' EXPORTING IV_MSGID = PM_ID IV_MSGTY = I_TYPE IV_MSGNO =
I_MSGNO IV_MSGV1 = PM_V1 IV_MSGV2 = PM_V2 IV_MSGV3 = PM_V3 IV_MSGV4 =
PM_V4 IV_DIALOG = SPACE. ENDIF. VIM_LAST_LOGGED_MESSAGE-ID = PM_ID.
VIM_LAST_LOGGED_MESSAGE-TYPE = I_MSGTY. VIM_LAST_LOGGED_MESSAGE-NBR =
PM_NBR. VIM_LAST_LOGGED_MESSAGE-V1 = PM_V1. VIM_LAST_LOGGED_MESSAGE-V2
= PM_V2. VIM_LAST_LOGGED_MESSAGE-V3 = PM_V3. VIM_LAST_LOGGED_MESSAGE-V4
= PM_V4. IF VIM_IMPORT_NO_MESSAGE EQ SPACE. MESSAGE ID PM_ID TYPE
I_MSGTY NUMBER PM_NBR WITH PM_V1 PM_V2 PM_V3 PM_V4. ENDIF. ELSE.
I_MSGTY = PM_ONLINE_TYPE. MESSAGE ID PM_ID TYPE I_MSGTY NUMBER PM_NBR
WITH PM_V1 PM_V2 PM_V3 PM_V4. ENDIF. ENDFORM. FORM
vim_bc_process_message USING value(pm_id) LIKE sy-msgid
value(pm_online_type) LIKE sy-msgty value(pm_batch_type) LIKE sy-msgty
value(pm_nbr) LIKE sy-msgno value(pm_v1) LIKE sy-msgv1 value(pm_v2)
LIKE sy-msgv2 value(pm_v3) LIKE sy-msgv3 value(pm_v4) LIKE sy-msgv4
value(objtype) TYPE ob_typ. DATA: i_type LIKE sprot_u-severity, i_msgty
LIKE sy-msgty, i_msgno LIKE sy-msgno. i_type = i_msgty = pm_batch_type.
i_msgno = pm_nbr. CALL FUNCTION 'SCPR_PROT_DATA_WRITE' EXPORTING act_id
= vim_actopts-act_id bcset_id = vim_bcset_id objectname = vim_view_name
tablekey = vim_profile_errorkey msgid = pm_id msgty = i_type msgno =
i_msgno var1 = pm_v1 var2 = pm_v2 var3 = pm_v3 var4 = pm_v4 objecttype
= objtype. vim_last_logged_message-id = pm_id.
vim_last_logged_message-type = i_msgty. vim_last_logged_message-nbr =
pm_nbr. vim_last_logged_message-v1 = pm_v1. vim_last_logged_message-v2
= pm_v2. vim_last_logged_message-v3 = pm_v3. vim_last_logged_message-v4
= pm_v4. IF vim_import_no_message EQ space. MESSAGE ID pm_id TYPE
i_msgty NUMBER pm_nbr WITH pm_v1 pm_v2 pm_v3 pm_v4. ENDIF. ENDFORM.
FORM vim_set_imp_results USING value(vsir_key) value(vsir_action) LIKE
tvdir-flag. DATA: vsir_xkey TYPE vim_tabkey_c, vsir_xkeylen TYPE i,
vsir_rc TYPE i, vsir_ix TYPE i. PERFORM vim_set_impres_header. PERFORM
vim_convert_tabkey USING vsir_key vsir_xkey vsir_xkeylen.
imp_results-tabkey = vsir_xkey. READ TABLE imp_results WITH KEY objtab
= imp_results-objtab tabkey = imp_results-tabkey. vsir_rc = sy-subrc.
vsir_ix = sy-tabix. CLEAR imp_results-import. CASE vsir_action. WHEN
geloescht OR update_geloescht. imp_results-import-deleted = 1. WHEN
aendern. imp_results-import-updated = 1. WHEN neuer_eintrag.
imp_results-import-inserted = 1. WHEN original.
imp_results-import-unchanged = 1. WHEN OTHERS.
imp_results-import-errors = 1. ENDCASE. IF vsir_rc NE 0. APPEND
imp_results. ELSE. MODIFY imp_results INDEX vsir_ix. ENDIF. ENDFORM.
FORM vim_single_entry_fill_sellist. DATA: countx TYPE i, nam_ix TYPE i.
FIELD-SYMBOLS: <h1>. LOOP AT x_namtab WHERE keyflag NE space AND
texttabfld EQ space. CHECK x_header-clidep EQ space OR sy-tabix GT 1.
nam_ix = sy-tabix. assign component x_namtab-viewfield of structure
<table1> to <h1>. READ TABLE dpl_sellist WITH KEY viewfield =
x_namtab-viewfield operator = 'EQ' negation = space. IF sy-subrc NE 0.
CLEAR dpl_sellist. dpl_sellist-viewfield = x_namtab-viewfield.
dpl_sellist-operator = 'EQ'. dpl_sellist-and_or = 'AND'.
dpl_sellist-tabix = nam_ix. APPEND dpl_sellist. ENDIF. countx =
sy-tabix. CLEAR dpl_sellist-converted. dpl_sellist-ddic = 'S'. CLEAR
dpl_sellist-value. CALL FUNCTION 'VIEW_CONVERSION_OUTPUT' EXPORTING
value_intern = <h1> tabname = x_header-maintview fieldname =
x_namtab-viewfield outputlen = x_namtab-outputlen intlen =
x_namtab-flength IMPORTING value_extern = dpl_sellist-value. IF
dpl_sellist-value EQ space. dpl_sellist-initial = 'X'. ELSE. CLEAR
dpl_sellist-initial. ENDIF. MODIFY dpl_sellist INDEX countx.
x_namtab-readonly = 'S'. MODIFY x_namtab. ENDLOOP. ASSIGN dpl_sellist[]
TO <vim_ck_sellist>. x_header-subsetflag = x_header-selection = 'X'.
MODIFY x_header INDEX 1. PERFORM init_subset_keyfields. ENDFORM. FORM
UPDATE_STATUS. MOVE: STATUS-DATA TO <STATUS>-ST_DATA, STATUS-MODE TO
<STATUS>-ST_MODE, STATUS-DELETE TO <STATUS>-ST_DELETE, STATUS-ACTION TO
<STATUS>-ST_ACTION, TITLE TO <STATUS>-TITLE, FIRSTLINE TO
<STATUS>-FIRSTLINE, MAXLINES TO <STATUS>-MAXLINES, F TO
<STATUS>-CUR_FIELD, O TO <STATUS>-CUR_OFFSET, MARK_EXTRACT TO
<STATUS>-MK_XT, MARK_TOTAL TO <STATUS>-MK_TO, FUNCTION TO
<STATUS>-FCODE. IF L EQ 0. MOVE 1 TO <STATUS>-CUR_LINE. ELSE. MOVE L TO
<STATUS>-CUR_LINE. ENDIF. ENDFORM. FORM SHOW_FUNCTION_DOCU. CALL
FUNCTION 'IWB_HTML_HELP_OBJECT_SHOW' EXPORTING PROGRAM = VIM_DOCU_PROG
EXTENSION = VIM_DOCU_EXTENSION EXCEPTIONS OBJECT_NOT_FOUND = 1
RFC_ERROR = 2 NO_PROFIL_PARAMETER = 3 IMPORT_PARAMETER_IS_INVALID = 4
OTHERS = 5. IF SY-SUBRC NE 0. MESSAGE ID SY-MSGID TYPE 'I' NUMBER
SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF. ENDFORM. FORM
LOGS_ANALYSE. RANGES: SEL_OBJ FOR OBJH-OBJECTNAME, SEL_TYPE FOR
OBJH-OBJECTTYPE. SEL_OBJ-SIGN = SEL_TYPE-SIGN = 'I'. SEL_OBJ-OPTION =
SEL_TYPE-OPTION = 'EQ'. IF VIM_CALLED_BY_CLUSTER NE SPACE. SEL_TYPE-LOW
= VIM_CLST. SEL_OBJ-LOW = VIM_CALLING_CLUSTER. ELSE. SEL_OBJ-LOW =
X_HEADER-VIEWNAME. IF x_header-bastab NE space AND x_header-maintview =
x_header-viewname. sel_type-low = vim_tabl. ELSE. SEL_TYPE-LOW =
VIM_VIEW. ENDIF. ENDIF. APPEND SEL_OBJ. APPEND SEL_TYPE. SUBMIT
RSVTPROT VIA SELECTION-SCREEN USING SELECTION-SCREEN 1010 WITH CUSOBJ
IN SEL_OBJ WITH STYPE IN SEL_TYPE WITH ACC_ARCH = ' ' AND RETURN.
ENDFORM. FORM vim_address_adjust. DATA: addr_comp_tab TYPE
szadr_compare_addr1_tab, addr_comp_line TYPE szadr_compare_addr1_line,
handle TYPE ad_handle, create_address(1) TYPE c, retcode LIKE
szad_field-returncode, error_info LIKE addr_error OCCURS 0 WITH HEADER
LINE, einfo LIKE addr_error, i_msgv1 LIKE sy-msgv1, space_msgv LIKE
sy-msgv1 VALUE space, dum TYPE i, pos_char TYPE i. FIELD-SYMBOLS:
<handle_x> TYPE x, <field_loc> TYPE ANY. CHECK x_header-adrnbrflag =
'N' AND adrnbr_roflag = space. ASSIGN handle TO <handle_x> CASTING. IF
vim_import_mode_active = space. IF vim_upgr_address_number <>
'@ADJUSTED@'. EXIT. ENDIF. IF <address_number> = space. <handle_x> =
<f1_x>. create_address = 'X'. ELSE. READ TABLE vim_locked_addresses
FROM <address_number> TRANSPORTING NO FIELDS. IF sy-subrc <> 0. CALL
FUNCTION 'ADDR_ENQUEUE' EXPORTING address_number = <address_number>
EXCEPTIONS address_not_exist = 1 foreign_lock = 2 system_failure = 3
internal_error = 4. CASE sy-subrc. WHEN 0. INSERT <address_number> INTO
TABLE vim_locked_addresses. WHEN 1. <handle_x> = <f1_x>. create_address
= 'X'. CLEAR <address_number>. WHEN 2. PERFORM vim_process_message
USING 'SV' 'E' 'E' '049' sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. WHEN
OTHERS. LOOP AT x_namtab. ASSIGN COMPONENT x_namtab-viewfield OF
STRUCTURE <table1> TO <field_loc>. dum = ( x_namtab-position +
x_namtab-flength ) / cl_abap_char_utilities=>charsize. pos_char =
x_namtab-position / cl_abap_char_utilities=>charsize. IF dum <= 13.
WRITE <field_loc> TO i_msgv1+pos_char. ELSE. dum = 13 - pos_char. WRITE
<field_loc>(dum) TO i_msgv1+pos_char. EXIT. ENDIF. ENDLOOP. PERFORM
vim_process_message USING 'SV' 'E' 'E' '050' i_msgv1 sy-msgv2 sy-msgv3
sy-msgv4. ENDCASE. ENDIF. ENDIF. ELSE. IF vim_upgr_address_number =
space. LOOP AT x_namtab. ASSIGN COMPONENT x_namtab-viewfield OF
STRUCTURE <table1> TO <field_loc>. dum = ( x_namtab-position +
x_namtab-flength ) / cl_abap_char_utilities=>charsize. pos_char =
x_namtab-position / cl_abap_char_utilities=>charsize. IF dum <= 13.
WRITE <field_loc> TO i_msgv1+pos_char. ELSE. dum = 13 - pos_char. WRITE
<field_loc>(dum) TO i_msgv1+pos_char. EXIT. ENDIF. ENDLOOP. PERFORM
vim_process_message USING 'SV' 'I' 'I' '165' i_msgv1 space_msgv
space_msgv space_msgv. EXIT. ENDIF. addr_comp_line-addrnumber =
<address_number>. IF <address_number> = space. <handle_x> = <f1_x>.
addr_comp_line-addrhandle = handle. create_address = 'X'. ENDIF.
addr_comp_line-remote_addrnumber = vim_upgr_address_number. APPEND
addr_comp_line TO addr_comp_tab. CALL FUNCTION 'ADDR_COMPARE' EXPORTING
rfc_destination = vim_default_rfc_dest-rfcdest TABLES compare_tab =
addr_comp_tab EXCEPTIONS rfc_error = 1 OTHERS = 2. IF sy-subrc <> 0.
PERFORM vim_process_message USING sy-msgid 'E' 'E' sy-msgno sy-msgv1
sy-msgv2 sy-msgv3 sy-msgv4. EXIT. ENDIF. READ TABLE addr_comp_tab INDEX
1 INTO addr_comp_line. IF addr_comp_line-parameter_error = 'X' OR
addr_comp_line-internal_error = 'X'. einfo =
addr_comp_line-error_table. PERFORM vim_process_message USING
einfo-msg_id 'E' 'E' einfo-msg_number einfo-msg_var1 einfo-msg_var2
einfo-msg_var3 einfo-msg_var4. EXIT. ENDIF. IF
addr_comp_line-rem_address_not_exist = 'X'. LOOP AT x_namtab. ASSIGN
COMPONENT x_namtab-viewfield OF STRUCTURE <table1> TO <field_loc>. dum
= ( x_namtab-position + x_namtab-flength ) /
cl_abap_char_utilities=>charsize. pos_char = x_namtab-position /
cl_abap_char_utilities=>charsize. IF dum <= 13. WRITE <field_loc> TO
i_msgv1+pos_char. ELSE. dum = 13 - pos_char. WRITE <field_loc>(dum) TO
i_msgv1+pos_char. EXIT. ENDIF. ENDLOOP. PERFORM vim_process_message
USING 'SV' 'I' 'I' '165' i_msgv1 space_msgv space_msgv space_msgv.
EXIT. ELSEIF addr_comp_line-address_not_exist = 'X' AND create_address
= space. <handle_x> = <f1_x>. create_address = 'X'. CLEAR:
<address_number>, <vim_total_address_number>. REFRESH addr_comp_tab.
CLEAR addr_comp_line. addr_comp_line = handle.
addr_comp_line-remote_addrnumber = vim_upgr_address_number. APPEND
addr_comp_line TO addr_comp_tab. CALL FUNCTION 'ADDR_COMPARE' EXPORTING
rfc_destination = vim_default_rfc_dest-rfcdest TABLES compare_tab =
addr_comp_tab EXCEPTIONS rfc_error = 1 OTHERS = 2. IF sy-subrc <> 0.
PERFORM vim_process_message USING sy-msgid 'E' 'E' sy-msgno sy-msgv1
sy-msgv2 sy-msgv3 sy-msgv4. EXIT. ENDIF. READ TABLE addr_comp_tab INDEX
1 INTO addr_comp_line. IF addr_comp_line-parameter_error = 'X' OR
addr_comp_line-internal_error = 'X'. einfo =
addr_comp_line-error_table. PERFORM vim_process_message USING
einfo-msg_id 'E' 'E' einfo-msg_number einfo-msg_var1 einfo-msg_var2
einfo-msg_var3 einfo-msg_var4. EXIT. ENDIF. ELSEIF
addr_comp_line-address_is_equal = 'X'. EXIT. ELSEIF create_address =
space. READ TABLE vim_locked_addresses FROM <address_number>
TRANSPORTING NO FIELDS. IF sy-subrc <> 0. CALL FUNCTION 'ADDR_ENQUEUE'
EXPORTING address_number = <address_number> EXCEPTIONS
address_not_exist = 1 foreign_lock = 2 system_failure = 3
internal_error = 4. CASE sy-subrc. WHEN 0. INSERT <address_number> INTO
TABLE vim_locked_addresses. WHEN 1. PERFORM vim_process_message USING
'SV' 'E' 'E' '049' sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. WHEN 2. PERFORM
vim_process_message USING 'SV' 'E' 'E' '049' sy-msgv1 sy-msgv2 sy-msgv3
sy-msgv4. WHEN OTHERS. LOOP AT x_namtab. ASSIGN COMPONENT
x_namtab-viewfield OF STRUCTURE <table1> TO <field_loc>. dum = (
x_namtab-position + x_namtab-flength ) /
cl_abap_char_utilities=>charsize. pos_char = x_namtab-position /
cl_abap_char_utilities=>charsize. IF dum <= 13. WRITE <field_loc> TO
i_msgv1+pos_char. ELSE. dum = 13 - pos_char. WRITE <field_loc>(dum) TO
i_msgv1+pos_char. EXIT. ENDIF. ENDLOOP. PERFORM vim_process_message
USING 'SV' 'E' 'E' '050' i_msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDCASE.
ENDIF. ENDIF. ENDIF. CALL FUNCTION 'ADDR_ADJUST' EXPORTING addrnumber =
<address_number> addrhandle = handle address_group = 'CA01' IMPORTING
returncode = retcode TABLES error_table = error_info EXCEPTIONS
parameter_error = 1 address_not_exist = 2 handle_exist = 3
internal_error = 4 address_not_compared = 5 OTHERS = 6. IF sy-subrc <>
0. PERFORM vim_process_message USING sy-msgid 'E' 'E' sy-msgno sy-msgv1
sy-msgv2 sy-msgv3 sy-msgv4. ELSE. IF retcode = 'E'. READ TABLE
error_info INDEX 1. PERFORM vim_process_message USING error_info-msg_id
'E' 'E' error_info-msg_number error_info-msg_var1 error_info-msg_var2
error_info-msg_var3 error_info-msg_var4. ELSE. IF create_address = 'X'.
<address_number> = '@NEW'. <address_number>+4(6) = <status>-newadrcnt.
ADD 1 TO <status>-newadrcnt. <status>-upd_flag = 'X'. ENDIF.
<vim_total_address_number> = <address_number>. READ TABLE
vim_addresses_to_save WITH KEY viewname = x_header-viewname addrnumber
= <address_number> BINARY SEARCH TRANSPORTING NO FIELDS. IF sy-subrc NE
0. vim_addresses_to_save-viewname = x_header-viewname.
vim_addresses_to_save-addrnumber = <address_number>.
<vim_addr_handle_x> = <f1_x>. INSERT vim_addresses_to_save INDEX
sy-tabix. ENDIF. IF vim_client_state EQ vim_log AND x_header-flag NE
vim_transport_denied. <status>-upd_flag = 'X'. ENDIF. ENDIF. ENDIF.
ENDFORM. FORM VIM_VCLDOCKING_CONTROL. DATA: DISABLE_NAVI(1) TYPE C. IF
VIM_EXTERNAL_MODE = 'X' OR VIM_SPECIAL_MODE = VIM_DIRECT_UPGRADE OR
STATUS-ACTION = 'C'. DISABLE_NAVI = 'X'. ENDIF. CALL FUNCTION
'VIEWCLUSTER_NAVI_CONTROL' EXPORTING OWNER_REPID = X_HEADER-FPOOLNAME
OWNER_DYNNR = SY-DYNNR DISABLE_NAVIGATION = DISABLE_NAVI EXCEPTIONS
OTHERS = 1. IF SY-SUBRC = 0. MOVE 'ATAB' TO EXCL_CUA_FUNCT-FUNCTION.
COLLECT EXCL_CUA_FUNCT. ENDIF. ENDFORM. FORM vim_add_img_notices_pbo
USING value(p_dynpro) TYPE list_scr. DATA: progname LIKE sy-repid,
exit, dynpro TYPE sydynnr. CHECK vim_special_mode <> vim_upgrade AND
vim_import_profile = space. progname = sy-repid. dynpro = p_dynpro.
CALL FUNCTION 'SPROJECT_CONTROL_PBO' EXPORTING repid = progname dynnr =
dynpro. ENDFORM. FORM vim_add_img_notices_pai USING p_mode TYPE char1
CHANGING exit_ok TYPE char1. DATA: leave TYPE char1, save TYPE char1.
CHECK vim_special_mode <> vim_upgrade AND vim_import_profile = space.
CASE p_mode. WHEN 'S'. save = 'X'. WHEN 'E'. leave = 'X'. ENDCASE. CALL
FUNCTION 'SPROJECT_CONTROL_PAI' EXPORTING i_exit = leave save_note =
save IMPORTING e_exit = exit_ok. ENDFORM. FORM vim_bc_logs_put CHANGING
p_bc_entry_list LIKE vim_bc_entry_list. DATA: corr_keytab_save LIKE
TABLE OF e071k, first, dummy LIKE sy-subrc, transport_active LIKE
t000-cccoractiv, w_tabkey_value TYPE scpractr, tabkey_values_n TYPE
vim_bc_tab_logs, tabkey_values_u TYPE vim_bc_tab_logs, tabkey_values_d
TYPE vim_bc_tab_logs, w_bc_entry TYPE scpr_viewdata, bc_entries TYPE
scpr_viewdatas, w_bc_entry_list TYPE vimty_bc_entry_list_type,
bc_keytab TYPE bc_keytab_type, bc_keytab_wa LIKE LINE OF bc_keytab,
p_msgid, p_msgty, p_msgno, bc_key_needed(1) TYPE c, foreign_langu TYPE
sy-langu, rc LIKE sy-subrc, keys_identical TYPE xfeld, subrc TYPE
sy-subrc, tabix TYPE sy-tabix. STATICS: viewname_old TYPE
vimdesc-viewname, keylen_real TYPE i. CONSTANTS: bc_id_length TYPE i
VALUE 32, bc_recno_length TYPE i VALUE 10. FIELD-SYMBOLS:
<bc_entry_keyx> TYPE x, <key> TYPE x, <vim_bc_keyx> TYPE x,
<w_bc_entry_x> TYPE x, <xlangu> TYPE x, <namtab> type vimnamtab.
ASSIGN: w_bc_entry_list-keys(x_header-keylen) TO <bc_entry_keyx>.
ASSIGN: bc_keytab_wa-bc_tabkey TO <vim_bc_keyx> CASTING. ASSIGN:
w_bc_entry-data TO <w_bc_entry_x> CASTING. IF x_header-viewname NE
viewname_old. viewname_old = x_header-viewname. CLEAR keylen_real. LOOP
AT x_namtab ASSIGNING <namtab> WHERE keyflag = 'X' AND texttabfld IS
INITIAL. keylen_real = keylen_real + <namtab>-flength. ENDLOOP. ENDIF.
LOOP AT p_bc_entry_list INTO w_bc_entry_list WHERE viewname =
x_header-viewname AND action <> original. IF first = space. first =
'X'. INSERT LINES OF corr_keytab INTO TABLE corr_keytab_save. REFRESH
corr_keytab. CLEAR <table1>. transport_active = vim_client_state.
ENDIF. IF x_header-keylen = keylen_real. READ TABLE total WITH KEY
<bc_entry_keyx> BINARY SEARCH. ELSE. PERFORM vim_read_table_with_gap
TABLES total USING <bc_entry_keyx> x_namtab[] CHANGING subrc tabix. IF
subrc = 0. READ TABLE total INDEX tabix. ENDIF. ENDIF. IF
x_header-bastab EQ space. MOVE <bc_entry_keyx> TO <f1_x>. PERFORM
(corr_formname) IN PROGRAM (sy-repid) USING vim_writing_bc_imp_log
dummy. REFRESH bc_keytab. CLEAR bc_key_needed. IF x_header-keylen >
vim_max_trsp_keylength. bc_key_needed = 'X'. ENDIF. IF bc_key_needed NE
'X'. LOOP AT x_namtab WHERE keyflag = 'X'. IF 'CNDT' NS
x_namtab-inttype. bc_key_needed = 'X'. EXIT. ENDIF. ENDLOOP. ENDIF. IF
bc_key_needed NE 'X'. CLEAR keys_identical. PERFORM vim_comp_roottabkey
USING x_header x_namtab[] CHANGING keys_identical rc. IF keys_identical
EQ space. bc_key_needed = 'X'. ENDIF. ENDIF. IF bc_key_needed NE space.
LOOP AT corr_keytab. MOVE-CORRESPONDING corr_keytab TO bc_keytab_wa.
APPEND bc_keytab_wa TO bc_keytab. ENDLOOP. PERFORM vim_build_bc_tabkeys
USING w_bc_entry_list CHANGING bc_keytab. ELSE. LOOP AT corr_keytab.
MOVE-CORRESPONDING corr_keytab TO bc_keytab_wa. MOVE corr_keytab-tabkey
TO bc_keytab_wa-bc_tabkey. APPEND bc_keytab_wa TO bc_keytab. ENDLOOP.
IF x_header-texttbexst NE space. READ TABLE bc_keytab into bc_keytab_wa
with key objname = x_header-texttab. LOOP AT w_bc_entry_list-forlangu
INTO foreign_langu. ASSIGN foreign_langu TO <xlangu> casting. MOVE
<xlangu> TO
<vim_bc_keyx>+x_header-sprasfdpos(cl_abap_char_utilities=>charsize).
APPEND bc_keytab_wa TO bc_keytab. ENDLOOP. ENDIF. ENDIF. ELSE. MOVE
<vim_xtotal> TO <table1_x>. MOVE-CORRESPONDING e071k TO bc_keytab_wa.
MOVE e071k-tabkey TO bc_keytab_wa-bc_tabkey. bc_keytab_wa-objname =
x_header-maintview. MOVE <bc_entry_keyx> TO
<vim_bc_keyx>(x_header-keylen). APPEND bc_keytab_wa TO bc_keytab. IF
x_header-bastab <> space AND x_header-texttbexst NE space AND
<vim_xtotal_text> NE <text_initial_x>. MOVE-CORRESPONDING e071k TO
bc_keytab_wa. MOVE e071k-tabkey TO bc_keytab_wa-bc_tabkey.
bc_keytab_wa-objname = x_header-texttab. MOVE <vim_xtotal_text> TO
<vim_bc_keyx>(x_header-textkeylen). APPEND bc_keytab_wa TO bc_keytab.
READ TABLE x_namtab WITH KEY keyflag = 'X' primtabkey = '0000'. LOOP AT
w_bc_entry_list-forlangu INTO foreign_langu. ASSIGN foreign_langu TO
<xlangu> CASTING. MOVE <xlangu> TO
<vim_bc_keyx>+x_namtab-texttabpos(x_namtab-flength). APPEND
bc_keytab_wa TO bc_keytab. ENDLOOP. ENDIF. ENDIF. CASE
w_bc_entry_list-action. WHEN neuer_eintrag. PERFORM bc_entry_log_fill
USING x_header x_namtab[] bc_keytab[] w_bc_entry_list CHANGING
tabkey_values_n. CLEAR w_bc_entry_list-action. WHEN aendern. PERFORM
bc_entry_log_fill USING x_header x_namtab[] bc_keytab[] w_bc_entry_list
CHANGING tabkey_values_u. CLEAR w_bc_entry_list-action. MOVE:
w_bc_entry_list-id TO w_bc_entry-bcset_id, w_bc_entry_list-recnumber TO
w_bc_entry-recnumber, x_header-viewname TO w_bc_entry-viewname,
<vim_xtotal> TO <w_bc_entry_x>. APPEND w_bc_entry TO bc_entries. WHEN
geloescht. PERFORM bc_entry_log_fill USING x_header x_namtab[]
bc_keytab[] w_bc_entry_list CHANGING tabkey_values_d. DELETE
p_bc_entry_list. ENDCASE. REFRESH corr_keytab. REFRESH bc_keytab.
ENDLOOP. IF NOT tabkey_values_n IS INITIAL. DELETE ADJACENT DUPLICATES
FROM tabkey_values_n COMPARING ALL FIELDS. LOOP AT tabkey_values_n INTO
w_tabkey_value. CALL FUNCTION 'SCPR_EXT_SCPRACTR_FILL' EXPORTING
tablename = w_tabkey_value-tablename profid = w_tabkey_value-profid
recnumber = w_tabkey_value-recnumber viewname = x_header-maintview
viewvar = x_header-viewname del_record = ' ' new_record = 'X' key =
w_tabkey_value-tabkey EXCEPTIONS wrong_parameters = 1 internal_error =
2 key_not_supportet = 3 fielddescr_error = 4 OTHERS = 5. IF sy-subrc <>
0. p_msgid = 'SCPR'. CASE sy-subrc. WHEN 1. p_msgty = 'E'. p_msgno =
'273'. WHEN 3. p_msgty = 'W'. p_msgno = '408'. WHEN 4. p_msgty = 'E'.
p_msgno = '395'. WHEN OTHERS. p_msgty = 'E'. p_msgno = '320'. ENDCASE.
PERFORM vim_process_message USING sy-msgid sy-msgty sy-msgty sy-msgno
space space space space. ENDIF. ENDLOOP. ENDIF. IF NOT tabkey_values_u
IS INITIAL. DELETE ADJACENT DUPLICATES FROM tabkey_values_u COMPARING
ALL FIELDS. LOOP AT tabkey_values_u INTO w_tabkey_value. CALL FUNCTION
'SCPR_EXT_SCPRACTR_FILL' EXPORTING tablename = w_tabkey_value-tablename
profid = w_tabkey_value-profid recnumber = w_tabkey_value-recnumber
viewname = x_header-maintview viewvar = x_header-viewname del_record =
' ' new_record = ' ' key = w_tabkey_value-tabkey EXCEPTIONS
wrong_parameters = 1 internal_error = 2 key_not_supportet = 3
fielddescr_error = 4 OTHERS = 5. IF sy-subrc <> 0. p_msgid = 'SCPR'.
CASE sy-subrc. WHEN 1. p_msgty = 'E'. p_msgno = '273'. WHEN 3. p_msgty
= 'W'. p_msgno = '408'. WHEN 4. p_msgty = 'E'. p_msgno = '395'. WHEN
OTHERS. p_msgty = 'E'. p_msgno = '320'. ENDCASE. PERFORM
vim_process_message USING sy-msgid sy-msgty sy-msgty sy-msgno space
space space space. ENDIF. ENDLOOP. ENDIF. IF NOT tabkey_values_d IS
INITIAL. DELETE ADJACENT DUPLICATES FROM tabkey_values_d COMPARING ALL
FIELDS. LOOP AT tabkey_values_d INTO w_tabkey_value. CALL FUNCTION
'SCPR_EXT_SCPRACTR_FILL' EXPORTING tablename = w_tabkey_value-tablename
profid = w_tabkey_value-profid recnumber = w_tabkey_value-recnumber
viewname = x_header-maintview viewvar = x_header-viewname del_record =
'X' new_record = ' ' key = w_tabkey_value-tabkey EXCEPTIONS
wrong_parameters = 1 internal_error = 2 key_not_supportet = 3
fielddescr_error = 4 OTHERS = 5. IF sy-subrc <> 0. p_msgid = 'SCPR'.
CASE sy-subrc. WHEN 1. p_msgty = 'E'. p_msgno = '273'. WHEN 3. p_msgty
= 'W'. p_msgno = '408'. WHEN 4. p_msgty = 'E'. p_msgno = '395'. WHEN
OTHERS. p_msgty = 'E'. p_msgno = '320'. ENDCASE. PERFORM
vim_process_message USING sy-msgid sy-msgty sy-msgty sy-msgno space
space space space. ENDIF. ENDLOOP. ENDIF. IF NOT corr_keytab_save IS
INITIAL. INSERT LINES OF corr_keytab_save INTO TABLE corr_keytab.
ENDIF. ENDFORM. FORM bc_entry_log_fill USING p_header TYPE vimdesc
p_namtab LIKE x_namtab[] p_bc_keytab TYPE bc_keytab_type p_bc_entry
TYPE vimty_bc_entry_list_type CHANGING p_tabkey_values TYPE
vim_bc_tab_logs. STATICS: dd28j_tab TYPE TABLE OF dd28j. DATA: w_dd28j
TYPE dd28j, w_tabkey_value TYPE scpractr, w_fields TYPE
vimty_fields_type. FIELD-SYMBOLS: <namtab> TYPE vimnamtab, <dfies> TYPE
dfies, <keytab> TYPE bc_key_type. IF p_header-bastab = space. READ
TABLE dd28j_tab INTO w_dd28j INDEX 1. IF sy-subrc <> 0 OR
p_header-viewname <> w_dd28j-viewname. REFRESH dd28j_tab. CALL FUNCTION
'DDIF_VIEW_GET' EXPORTING name = p_header-viewname TABLES dd28j_tab =
dd28j_tab EXCEPTIONS illegal_input = 1 OTHERS = 2. IF sy-subrc <> 0.
ENDIF. ENDIF. ENDIF. w_tabkey_value-client = sy-mandt.
w_tabkey_value-profid = p_bc_entry-id. w_tabkey_value-recnumber =
p_bc_entry-recnumber. w_tabkey_value-viewname = p_header-maintview.
LOOP AT p_namtab ASSIGNING <namtab> WHERE keyflag = space OR texttabfld
= space. READ TABLE p_bc_entry-fields INTO w_fields WITH KEY fieldname
= <namtab>-viewfield. CHECK sy-subrc = 0. READ TABLE p_tabkey_values
WITH KEY client = sy-mandt tablename = <namtab>-bastabname profid =
p_bc_entry-id recnumber = p_bc_entry-recnumber viewname =
p_header-viewname TRANSPORTING NO FIELDS. IF sy-subrc <> 0. LOOP AT
p_bc_keytab ASSIGNING <keytab> WHERE pgmid = 'R3TR' AND object = 'TABU'
AND objname = <namtab>-bastabname. w_tabkey_value-tablename =
<namtab>-bastabname. w_tabkey_value-tabkey = <keytab>-bc_tabkey. APPEND
w_tabkey_value TO p_tabkey_values. ENDLOOP. CHECK sy-subrc = 0. ENDIF.
IF x_header-bastab = space. LOOP AT dd28j_tab INTO w_dd28j WHERE
viewname = p_header-viewname AND ltab = <namtab>-bastabname AND lfield
= <namtab>-viewfield. READ TABLE p_tabkey_values WITH KEY client =
sy-mandt tablename = w_dd28j-rtab profid = p_bc_entry-id recnumber =
p_bc_entry-recnumber viewname = p_header-viewname TRANSPORTING NO
FIELDS. IF sy-subrc <> 0. READ TABLE p_bc_keytab WITH KEY pgmid =
'R3TR' object = 'TABU' objname = w_dd28j-rtab ASSIGNING <keytab>. CHECK
sy-subrc = 0. w_tabkey_value-tablename = w_dd28j-rtab.
w_tabkey_value-tabkey = <keytab>-bc_tabkey. APPEND w_tabkey_value TO
p_tabkey_values. ENDIF. ENDLOOP. LOOP AT dd28j_tab INTO w_dd28j WHERE
viewname = p_header-viewname AND rtab = <namtab>-bastabname AND rfield
= <namtab>-viewfield. READ TABLE p_tabkey_values WITH KEY client =
sy-mandt tablename = w_dd28j-ltab profid = p_bc_entry-id recnumber =
p_bc_entry-recnumber viewname = p_header-viewname TRANSPORTING NO
FIELDS. IF sy-subrc <> 0. LOOP AT p_bc_keytab ASSIGNING <keytab> WHERE
pgmid = 'R3TR' AND object = 'TABU' AND objname = w_dd28j-ltab.
w_tabkey_value-tablename = w_dd28j-ltab. w_tabkey_value-tabkey =
<keytab>-bc_tabkey. APPEND w_tabkey_value TO p_tabkey_values. ENDLOOP.
CHECK sy-subrc = 0. ENDIF. ENDLOOP. ENDIF. ENDLOOP. ENDFORM. FORM
vim_bc_logs_get USING p_view_name TYPE tabname p_header TYPE vimdesc
p_namtab LIKE x_namtab[] CHANGING p_bc_entry_list TYPE
vimty_bc_entry_list_ttype. STATICS: tablist TYPE TABLE OF scprxtabl,
viewname TYPE tabname. DATA: tabkeys TYPE TABLE OF scpractr, w_tablist
TYPE scprxtabl, bc_entry_list_wa TYPE vimty_bc_entry_list_type,
failed(1), rc LIKE sy-subrc, keys_identical TYPE xfeld, x030l_root TYPE
x030l, x030l_bastab TYPE x030l, root_entry TYPE REF TO data,
bastab_entry TYPE REF TO data, tabflags TYPE scpr_actfs, tabflags_wa
TYPE scpr_actf, tabflags_quick TYPE SORTED TABLE OF scpr_actf WITH
NON-UNIQUE KEY tablename fieldname bcset_id recnumber tabkey INITIAL
SIZE 100, fields_wa TYPE vimty_fields_type, bc_entry_list TYPE STANDARD
TABLE OF vimty_bc_entry_list_type WITH KEY viewname keys, tabkey_wa
TYPE scpractr-tabkey, tabkeys_wa TYPE scpractr, roottab TYPE tabname,
tabix TYPE sy-tabix, tabkey_struc(1024) TYPE c. FIELD-SYMBOLS: <namtab>
TYPE vimnamtab, <tabkeys> TYPE scpractr, <tabkeys_main> TYPE scpractr,
<bastab> TYPE ANY, <bastab_x> TYPE x, <roottab> TYPE ANY, <roottab_x>
TYPE x, <rootfld> TYPE ANY, <tabkey> TYPE x, <viewfld> TYPE ANY, <clnt>
TYPE ANY, <tabkey_c> TYPE c. DELETE p_bc_entry_list WHERE viewname =
p_header-maintview. CHECK vim_import_profile = space. IF viewname <>
p_header-viewname. viewname = p_header-viewname. REFRESH tablist.
w_tablist-sign = 'I'. w_tablist-option = 'EQ'. IF p_header-bastab EQ
'X'. w_tablist-low = viewname. roottab = viewname. COLLECT w_tablist
INTO tablist. ELSE. w_tablist-low = p_header-roottab. roottab =
p_header-roottab. COLLECT w_tablist INTO tablist. ENDIF. ENDIF. CALL
FUNCTION 'SCPR_BCSET_PROT_GET_TABKEYS' EXPORTING viewname = viewname
IMPORTING actkeys = tabkeys tabflags = tabflags TABLES tabnames =
tablist EXCEPTIONS no_data = 1 OTHERS = 2. CHECK sy-subrc = 0 AND NOT
tabkeys IS INITIAL. IF p_header-bastab EQ 'X'. roottab = viewname.
ELSE. roottab = p_header-roottab. ENDIF. LOOP AT tabkeys INTO
tabkeys_wa. tabkey_wa = tabkeys_wa-tabkey. tabix = sy-tabix. CALL
FUNCTION 'SCPR_EXT_ACTKEY_TO_KEY' EXPORTING tablename = roottab
tablekey = tabkey_wa IMPORTING key = tabkey_struc EXCEPTIONS
WRONG_PARAMETERS = 1 KEY_TOO_LARGE = 2 FIELDDESCR_ERROR = 3
INTERNAL_ERROR = 4 OTHERS = 5. IF sy-subrc NE 0. MESSAGE ID sy-msgid
TYPE 'I' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. ASSIGN tabkey_struc TO <tabkey_c> CASTING. tabkeys_wa-tabkey =
<tabkey_c>. MODIFY tabkeys FROM tabkeys_wa INDEX tabix. ENDLOOP.
bc_entry_list_wa-viewname = p_header-maintview. IF p_header-clidep <>
space. READ TABLE p_namtab ASSIGNING <namtab> WITH KEY datatype =
'CLNT'. ASSIGN COMPONENT <namtab>-viewfield OF STRUCTURE <table1_wa> TO
<clnt>. ENDIF. IF p_header-bastab = space. PERFORM vim_comp_roottabkey
USING p_header p_namtab CHANGING keys_identical rc. CHECK rc = 0. IF
keys_identical = space. PERFORM vim_get_x030l USING p_header-roottab
CHANGING x030l_root rc. CHECK rc = 0. CREATE DATA root_entry TYPE
(p_header-roottab). ASSIGN: root_entry->* TO <roottab>, <roottab> TO
<roottab_x> CASTING. ENDIF. INSERT LINES OF tabflags INTO TABLE
tabflags_quick. LOOP AT tabkeys ASSIGNING <tabkeys_main> WHERE
tablename = p_header-roottab. CLEAR: failed, <table1_wa>.
bc_entry_list_wa-id = <tabkeys_main>-profid. bc_entry_list_wa-recnumber
= <tabkeys_main>-recnumber. ASSIGN <tabkeys_main>-tabkey TO <tabkey>
CASTING. IF keys_identical <> space. MOVE <tabkey>(p_header-keylen) TO
<f1_wax>. ELSE. CLEAR: <roottab>. MOVE <tabkey>(x030l_root-keylen) TO
<roottab_x>(x030l_root-keylen). LOOP AT p_namtab ASSIGNING <namtab>
WHERE keyflag <> space AND texttabfld = space. CHECK <namtab>-datatype
<> 'CLNT' OR p_header-clidep = space. ASSIGN COMPONENT
<namtab>-viewfield OF STRUCTURE <table1_wa> TO <viewfld>. IF
<namtab>-bastabname = p_header-roottab. ASSIGN COMPONENT
<namtab>-bastabfld OF STRUCTURE <roottab> TO <rootfld>. MOVE <rootfld>
TO <viewfld>. ELSE. failed = 'X'. IF NOT <tabkeys> IS ASSIGNED OR
<tabkeys>-tablename <> <namtab>-bastabname. READ TABLE tabkeys
ASSIGNING <tabkeys> WITH KEY tablename = <namtab>-bastabname recnumber
= <tabkeys_main>-recnumber profid = <tabkeys_main>-profid. IF sy-subrc
<> 0. UNASSIGN <tabkeys>. EXIT. ENDIF. PERFORM vim_get_x030l USING
<namtab>-bastabname CHANGING x030l_bastab rc. CHECK rc = 0. CREATE DATA
bastab_entry TYPE (<namtab>-bastabname). ASSIGN: bastab_entry->* TO
<bastab>, <bastab> TO <bastab_x> CASTING. ENDIF. MOVE
<tabkey>(x030l_bastab-keylen) TO <bastab_x>(x030l_bastab-keylen).
ASSIGN COMPONENT <namtab>-bastabfld OF STRUCTURE <bastab> TO <rootfld>.
MOVE <rootfld> TO <viewfld>. CLEAR failed. ENDIF. ENDLOOP. CHECK failed
IS INITIAL. ENDIF. IF p_header-clidep <> space. MOVE sy-mandt TO
<clnt>. ENDIF. MOVE <f1_wax> TO bc_entry_list_wa-keys. REFRESH
bc_entry_list_wa-fields. LOOP AT p_namtab ASSIGNING <namtab>. CHECK
<namtab>-datatype <> 'CLNT' OR p_header-clidep = space. READ TABLE
tabflags_quick INTO tabflags_wa WITH KEY tablename = p_header-viewname
fieldname = <namtab>-viewfield bcset_id = bc_entry_list_wa-id recnumber
= bc_entry_list_wa-recnumber. CHECK sy-subrc = 0. fields_wa-fieldname =
<namtab>-viewfield. fields_wa-flag = tabflags_wa-flag. APPEND fields_wa
TO bc_entry_list_wa-fields. ENDLOOP. INSERT bc_entry_list_wa INTO TABLE
bc_entry_list. ENDLOOP. ELSE. LOOP AT tabkeys ASSIGNING <tabkeys_main>
WHERE tablename = p_header-viewname. bc_entry_list_wa-id =
<tabkeys_main>-profid. bc_entry_list_wa-recnumber =
<tabkeys_main>-recnumber. ASSIGN <tabkeys_main>-tabkey TO <tabkey>
CASTING. MOVE <tabkey>(p_header-keylen) TO
<table1_wax>(p_header-keylen). IF p_header-clidep <> space. MOVE
sy-mandt TO <clnt>. ENDIF. MOVE <f1_wax> TO bc_entry_list_wa-keys. LOOP
AT tabflags INTO tabflags_wa WHERE ( tablename = p_header-viewname OR
tablename = p_header-texttab ) AND bcset_id = bc_entry_list_wa-id AND
recnumber = bc_entry_list_wa-recnumber. fields_wa-fieldname =
tabflags_wa-fieldname. fields_wa-flag = tabflags_wa-flag. APPEND
fields_wa TO bc_entry_list_wa-fields. ENDLOOP. INSERT bc_entry_list_wa
INTO TABLE bc_entry_list. ENDLOOP. ENDIF. SORT bc_entry_list. DELETE
ADJACENT DUPLICATES FROM bc_entry_list. DESCRIBE TABLE bc_entry_list.
CLEAR <status>-bcfixnochg. IF sy-tfill > 0. INSERT LINES OF
bc_entry_list INTO TABLE p_bc_entry_list. CALL FUNCTION
'SCPR_AUTHORITY_CHECK' EXPORTING task = 'CHGFIXVAL' EXCEPTIONS
wrong_parameters = 1 no_authority = 2 OTHERS = 3. IF sy-subrc <> 0.
<status>-bcfixnochg = 'N'. ELSE. <status>-bcfixnochg = 'Y'. ENDIF.
ENDIF. ENDFORM. FORM vim_bc_logs_maintain USING p_header TYPE vimdesc
p_background TYPE xfeld CHANGING p_bc_entry_list LIKE
vim_bc_entry_list. DATA: fields_wa TYPE vimty_fields_type, subrc TYPE
sy-subrc, tabix TYPE sy-tabix. STATICS: viewname_old TYPE
vimdesc-viewname, keylen_real TYPE i. FIELD-SYMBOLS: <bc_entry> TYPE
vimty_bc_entry_list_type, <key> TYPE x, <namtab> type vimnamtab. IF
p_background = space. LOOP AT total. CHECK ' N' NS <action>. READ TABLE
p_bc_entry_list ASSIGNING <bc_entry> WITH KEY viewname =
p_header-viewname keys = <vim_xtotal_key>. CHECK sy-subrc = 0. CASE
<action>. WHEN aendern. WHEN geloescht. CASE <bc_entry>-action. WHEN
neuer_eintrag. <bc_entry>-action = neuer_geloescht. WHEN OTHERS.
<bc_entry>-action = geloescht. ENDCASE. ENDCASE. ENDLOOP. ELSE. DELETE
vim_bc_entry_list WHERE viewname = p_header-viewname. PERFORM
vim_get_global_table IN PROGRAM saplsvim USING 'VIM_BC_ENTRY_LIST'
vim_bc_entry_list sy-subrc. IF sy-subrc <> 0. EXIT. ENDIF. IF
p_header-viewname NE viewname_old. viewname_old = p_header-viewname.
CLEAR keylen_real. LOOP AT x_namtab ASSIGNING <namtab> WHERE keyflag =
'X' AND texttabfld IS INITIAL. keylen_real = keylen_real +
<namtab>-flength. ENDLOOP. ENDIF. LOOP AT vim_bc_entry_list ASSIGNING
<bc_entry> WHERE viewname = p_header-viewname. ASSIGN
<bc_entry>-keys(x_header-keylen) TO <key>. IF p_header-keylen =
keylen_real. READ TABLE total WITH KEY <key> BINARY SEARCH. subrc =
sy-subrc. ELSE. PERFORM vim_read_table_with_gap TABLES total USING
<key> x_namtab[] CHANGING subrc tabix. IF subrc = 0. READ TABLE total
INDEX tabix. ENDIF. ENDIF. IF subrc <> 0 OR 'NU' NS <action>. DELETE
vim_bc_entry_list. ENDIF. ENDLOOP. ENDIF. ENDFORM. FORM vim_bc_logs_use
USING p_field TYPE fieldname p_vim_bc_entry TYPE
vimty_bc_entry_list_type CHANGING p_screen LIKE screen p_modify_screen
TYPE xfeld. DATA w_field TYPE vimty_fields_type. READ TABLE
p_vim_bc_entry-fields INTO w_field WITH TABLE KEY fieldname = p_field.
CHECK sy-subrc = 0. IF w_field-flag = vim_profile_fix. p_screen-input =
0. p_modify_screen = 'X'. ENDIF. ENDFORM. FORM vim_chng_fix_flds. IF
<status>-bcfixnochg = 'Y'. vim_bc_chng_allowed = 'X'. ELSE. MESSAGE
e202(sv). ENDIF. ENDFORM. FORM vim_get_x030l USING p_tabname TYPE
tabname CHANGING p_x030l TYPE x030l p_rc LIKE sy-subrc. CALL FUNCTION
'DDIF_NAMETAB_GET' EXPORTING tabname = p_tabname IMPORTING x030l_wa =
p_x030l EXCEPTIONS OTHERS = 1. p_rc = sy-subrc. ENDFORM. FORM
vim_bc_show_fix_flds. DATA: p_tabtype TYPE objh-objecttype, p_tabname
TYPE scpr_tabl. p_tabname = x_header-maintview. if x_header-bastab =
space. p_tabtype = 'V'. ELSE. p_tabtype = 'S'. ENDIF. LOOP AT extract.
IF <xmark> NE markiert. CONTINUE. ELSE. MOVE <vim_extract_struc> TO
<table1>. CALL FUNCTION 'SCPR_ACTIVATION_INFOS_SHOW' EXPORTING
tablename = p_tabname tabletype = p_tabtype record = <table1>
EXCEPTIONS FIELDDEFINITION_ERROR = 1 NO_TVDIR_ENTRY = 2 TABLE_NOT_FOUND
= 3 TABLE_TO_LARGE = 4 DDIF_INTERNAL_ERROR = 5 WRONG_PARAMETERS = 6
INTERNAL_ERROR = 7 NO_ACTLINKS = 8 KEY_TOO_LARGE = 9 OTHERS = 10. case
sy-subrc. when 0. when 1. message e395(SCPR) raising
FIELDDEFINITION_ERROR. when 2. message e028(SCPR) with p_tabname
raising NO_TVDIR_ENTRY. when 3. message e120(SCPR) with p_tabname
raising TABLE_NOT_FOUND. when 4. message e026(SCPR) with p_tabname
raising TABLE_TO_LARGE. when 5. message e035(SCPR) raising
DDIF_INTERNAL_ERROR. when 6. message e273(SCPR) raising
WRONG_PARAMETERS. when 8. message s399(SCPR) raising NO_ACTLINKS. when
9. message e408(SCPR) raising KEY_TOO_LARGE. when others. message
e320(SCPR) raising INTERNAL_ERROR. endcase. ENDIF. ENDLOOP. ENDFORM.
FORM vim_build_bc_tabkeys USING bc_entry_list_wa TYPE
vimty_bc_entry_list_type CHANGING p_bc_keytab TYPE bc_keytab_type.
TYPES: BEGIN OF tablist_type, tabname TYPE objs-tabname, END OF
tablist_type. STATICS: cg_dd28j_tab LIKE dd28j OCCURS 30, old_viewname
LIKE vimdesc-viewname, all_dfiestab LIKE dfies OCCURS 40. DATA:
objstablist TYPE TABLE OF tablist_type, namtab_wa TYPE vimnamtab,
tabname_wa TYPE objs-tabname, dd28j_wa LIKE LINE OF cg_dd28j_tab,
primtab_entry TYPE REF TO data, sektab_entry TYPE REF TO data,
p_bc_keytab_wa LIKE LINE OF p_bc_keytab, keytab_index TYPE sy-tabix,
bc_keylen TYPE i, flag(1) TYPE c, cg_langu(1) TYPE c, cg_dfiestab LIKE
dfies OCCURS 10, dfies_wa LIKE LINE OF cg_dfiestab, piecelist TYPE
TABLE OF objs-tabname, foreign_langu LIKE sy-langu, langu_fieldname
TYPE dfies-fieldname, p_bc_keytab_langu TYPE bc_keytab_type,
w_bc_entry_list TYPE vimty_bc_entry_list_type. FIELD-SYMBOLS: <primtab>
TYPE ANY, <sektab> TYPE ANY, <viewfld> TYPE ANY, <primtabfld> TYPE ANY,
<sektabfld> TYPE ANY, <bc_tabkey> TYPE bc_key_type-bc_tabkey,
<tabkey_x> TYPE x, <tabkey_struc_x> TYPE x. IF x_header-viewname NE
old_viewname. old_viewname = x_header-viewname. CALL FUNCTION
'DDIF_VIEW_GET' EXPORTING name = x_header-viewname state = 'A' langu =
sy-langu IMPORTING gotstate = flag TABLES dd28j_tab = cg_dd28j_tab
EXCEPTIONS illegal_input = 1 OTHERS = 2. IF sy-subrc <> 0. MESSAGE
e164(sv) WITH tabname_wa RAISING view_not_found. ENDIF. IF flag =
space. MESSAGE e306(sv) WITH tabname_wa RAISING view_not_found. ENDIF.
SELECT tabname FROM objs INTO tabname_wa WHERE objectname =
x_header-viewname AND objecttype = 'V'. APPEND tabname_wa TO piecelist.
ENDSELECT. REFRESH all_dfiestab. LOOP AT piecelist INTO tabname_wa.
REFRESH cg_dfiestab. CALL FUNCTION 'DDIF_NAMETAB_GET' EXPORTING tabname
= tabname_wa TABLES dfies_tab = cg_dfiestab[] EXCEPTIONS not_found = 1
OTHERS = 2. IF sy-subrc NE 0. MESSAGE e028(sv) WITH tabname_wa RAISING
view_not_found. ENDIF. LOOP AT cg_dfiestab INTO dfies_wa. APPEND
dfies_wa TO all_dfiestab. ENDLOOP. ENDLOOP. ENDIF. LOOP AT p_bc_keytab
INTO p_bc_keytab_wa. keytab_index = sy-tabix. IF p_bc_keytab_wa-objname
= x_header-roottab. CREATE DATA primtab_entry TYPE (x_header-roottab).
ASSIGN primtab_entry->* TO <primtab>. LOOP AT x_namtab WHERE keyflag =
'X' AND bastabname = x_header-roottab. ASSIGN COMPONENT
x_namtab-viewfield OF STRUCTURE <vim_total_struc> TO <viewfld>. ASSIGN
COMPONENT x_namtab-bastabfld OF STRUCTURE <primtab> TO <primtabfld>.
MOVE <viewfld> TO <primtabfld>. ENDLOOP. PERFORM vim_get_bc_keylen
USING x_header-roottab CHANGING bc_keylen. ASSIGN <primtab> TO
<tabkey_struc_x> CASTING. ASSIGN p_bc_keytab_wa-bc_tabkey TO <tabkey_x>
CASTING. MOVE <tabkey_struc_x>(bc_keylen) TO <tabkey_x>(bc_keylen).
MODIFY p_bc_keytab INDEX keytab_index FROM p_bc_keytab_wa. ELSEIF
p_bc_keytab_wa-objname EQ x_header-texttab. REFRESH p_bc_keytab_langu.
tabname_wa = p_bc_keytab_wa-objname. CREATE DATA sektab_entry TYPE
(tabname_wa). ASSIGN sektab_entry->* TO <sektab>. PERFORM
vim_get_bc_keylen USING tabname_wa CHANGING bc_keylen. LOOP AT
all_dfiestab INTO dfies_wa WHERE tabname = tabname_wa AND keyflag =
'X'. CLEAR cg_langu. READ TABLE cg_dd28j_tab WITH KEY rtab = tabname_wa
rfield = dfies_wa-fieldname INTO dd28j_wa. IF sy-subrc EQ 0. READ TABLE
x_namtab WITH KEY bastabname = dd28j_wa-ltab bastabfld =
dd28j_wa-lfield. ELSE. READ TABLE x_namtab WITH KEY bastabname =
tabname_wa bastabfld = dfies_wa-fieldname. IF sy-subrc NE 0. cg_langu =
'X'. ENDIF. ENDIF. IF cg_langu EQ space. ASSIGN COMPONENT
x_namtab-viewfield OF STRUCTURE <vim_total_struc> TO <viewfld>. ASSIGN
COMPONENT dfies_wa-fieldname OF STRUCTURE <sektab> TO <sektabfld>. MOVE
<viewfld> TO <sektabfld>. ELSE. langu_fieldname = dfies_wa-fieldname.
ASSIGN COMPONENT dfies_wa-fieldname OF STRUCTURE <sektab> TO
<sektabfld>. MOVE sy-langu TO <sektabfld>. ENDIF. ASSIGN <sektab> TO
<tabkey_struc_x> CASTING. ASSIGN p_bc_keytab_wa-bc_tabkey TO <tabkey_x>
CASTING. MOVE <tabkey_struc_x>(bc_keylen) TO <tabkey_x>(bc_keylen).
ENDLOOP. MODIFY p_bc_keytab INDEX keytab_index FROM p_bc_keytab_wa.
ASSIGN COMPONENT langu_fieldname OF STRUCTURE <sektab> TO <sektabfld>.
LOOP AT bc_entry_list_wa-forlangu INTO foreign_langu. MOVE
foreign_langu TO <sektabfld>. MOVE <tabkey_struc_x>(bc_keylen) TO
<tabkey_x>(bc_keylen). APPEND p_bc_keytab_wa TO p_bc_keytab_langu.
ENDLOOP. ELSE. tabname_wa = p_bc_keytab_wa-objname. CREATE DATA
sektab_entry TYPE (tabname_wa). ASSIGN sektab_entry->* TO <sektab>.
PERFORM vim_get_bc_keylen USING tabname_wa CHANGING bc_keylen. LOOP AT
all_dfiestab INTO dfies_wa WHERE tabname = tabname_wa AND keyflag =
'X'. CLEAR cg_langu. READ TABLE cg_dd28j_tab WITH KEY rtab = tabname_wa
rfield = dfies_wa-fieldname INTO dd28j_wa. IF sy-subrc EQ 0. READ TABLE
x_namtab WITH KEY bastabname = dd28j_wa-ltab bastabfld =
dd28j_wa-lfield. ELSE. READ TABLE x_namtab WITH KEY bastabname =
tabname_wa bastabfld = dfies_wa-fieldname. IF sy-subrc NE 0. ENDIF.
ENDIF. ASSIGN COMPONENT x_namtab-viewfield OF STRUCTURE
<vim_total_struc> TO <viewfld>. ASSIGN COMPONENT dfies_wa-fieldname OF
STRUCTURE <sektab> TO <sektabfld>. MOVE <viewfld> TO <sektabfld>.
ASSIGN <sektab> TO <tabkey_struc_x> CASTING. ASSIGN
p_bc_keytab_wa-bc_tabkey TO <tabkey_x> CASTING. MOVE
<tabkey_struc_x>(bc_keylen) TO <tabkey_x>(bc_keylen). ENDLOOP. MODIFY
p_bc_keytab INDEX keytab_index FROM p_bc_keytab_wa. ENDIF. ENDLOOP.
APPEND LINES OF p_bc_keytab_langu TO p_bc_keytab. ENDFORM. FORM
vim_read_table_with_gap TABLES gap_table USING key TYPE x namtab LIKE
x_namtab[] CHANGING subrc TYPE sy-subrc tabix TYPE sy-tabix. TYPES:
scpr_x8192(8192) TYPE x. DATA: result TYPE scpr_txt20, tab_i TYPE
sy-tabix, tab_j TYPE sy-tabix, tab_k TYPE sy-tabix, tab_len TYPE
sy-tabix. DATA: align TYPE f, wa_8192 TYPE scpr_x8192, it_fldnames TYPE
STANDARD TABLE OF scpr_flddescr, fldnames_wa LIKE LINE OF it_fldnames,
gap_table_wa(2048) TYPE c. FIELD-SYMBOLS: <wa_it_data> TYPE x, <namtab>
TYPE vimnamtab. LOOP AT namtab ASSIGNING <namtab> WHERE keyflag = 'X'
AND texttabfld = space. fldnames_wa-fieldname = <namtab>-viewfield.
fldnames_wa-position = <namtab>-position. fldnames_wa-intlen =
<namtab>-flength. fldnames_wa-keyflag = 'X'. fldnames_wa-flag = 'FKY'.
APPEND fldnames_wa TO it_fldnames. ENDLOOP. DESCRIBE TABLE gap_table
LINES tab_len. tab_i = 1. tab_j = tab_len. subrc = 8. tabix = tab_len +
1. ASSIGN wa_8192 TO <wa_it_data>. ASSIGN gap_table_wa TO <wa_it_data>
CASTING. DO. IF tab_i > tab_j. subrc = 4. tabix = tab_k + 1. EXIT.
ENDIF. tab_k = ( tab_i + tab_j ) / 2. READ TABLE gap_table INTO
gap_table_wa INDEX tab_k. CALL FUNCTION 'SCPR_CTRL_CT_COMP_TWO_RECORDS'
EXPORTING cu_lines = <wa_it_data> bc_lines = key compare_key = 'X'
IMPORTING RESULT = RESULT tables it_fldnames = it_fldnames. IF result =
'LT'. tab_j = tab_k - 1. ELSEIF result = 'GT'. tab_i = tab_k + 1. ELSE.
subrc = 0. tabix = tab_k. EXIT. ENDIF. ENDDO. ENDFORM. FORM
check_list_before_alv CHANGING rc LIKE sy-subrc. DATA: counter TYPE i,
index type i, variant LIKE disvariant, fcat_var TYPE
slis_t_fieldcat_alv. FIELD-SYMBOLS: <fcat> TYPE slis_fieldcat_alv.
CONSTANTS: alv_maxcols TYPE i VALUE 99. CLEAR: counter, rc. LOOP AT
vim_alv_fcat TRANSPORTING NO FIELDS WHERE no_out <> 'X'. ADD 1 TO
counter. ENDLOOP. CHECK counter > alv_maxcols. CONCATENATE
x_header-viewname sy-repid INTO variant-report. CALL FUNCTION
'REUSE_ALV_VARIANT_SELECT' EXPORTING i_dialog = space i_user_specific =
'X' i_default = 'X' it_default_fieldcat = vim_alv_fcat i_layout =
vim_alv_layout IMPORTING et_fieldcat = fcat_var es_layout =
vim_alv_layout CHANGING cs_variant = variant EXCEPTIONS wrong_input = 1
fc_not_complete = 2 not_found = 3 program_error = 4 OTHERS = 5. IF
sy-subrc = 0 AND NOT variant-variant IS INITIAL. CLEAR: counter. LOOP
AT fcat_var TRANSPORTING NO FIELDS WHERE no_out <> 'X'. ADD 1 TO
counter. ENDLOOP. CHECK counter > alv_maxcols. ENDIF. MESSAGE i808(sv)
with COUNTER. index = alv_maxcols + 1. LOOP AT vim_alv_fcat ASSIGNING
<fcat> FROM index. <fcat>-no_out = 'X'. ENDLOOP. ENDFORM. FORM
vim_set_oc USING value(p_obj) TYPE REF TO cl_viewfields_org_crit. clear
vim_oc_inst. check not p_obj is initial. vim_oc_inst = p_obj. ENDFORM.
FORM vim_maint_selflag USING value(p_mode) TYPE sychar01 CHANGING
p_selflag TYPE xfeld. STATICS: init_val TYPE xfeld. CASE p_mode. WHEN
'I'. init_val = p_selflag. WHEN 'S'. x_header-selection = 'X'. WHEN
'R'. p_selflag = x_header-selection. x_header-selection = init_val.
ENDCASE. ENDFORM. FORM vim_make_guid USING p_viewfield TYPE viewfield.
DATA: fieldname TYPE fnam_____4, old_guid TYPE REF TO data.
FIELD-SYMBOLS: <x_namtab> TYPE vimnamtab, <guid> TYPE ANY, <old_guid>
TYPE ANY, <work_area> TYPE ANY. IF p_viewfield = space. LOOP AT
x_namtab ASSIGNING <x_namtab> WHERE keyflag = space AND bastabname <>
x_header-texttab AND domname IN vim_guid_domain. CONCATENATE
x_header-maintview <x_namtab>-viewfield INTO fieldname SEPARATED BY
'-'. ASSIGN (fieldname) TO <guid> CASTING TYPE (fieldname). IF
<status>-prof_found = vim_pr_into_view OR vim_import_profile <> space
OR vim_special_mode = vim_upgrade. CHECK <guid> IS INITIAL. ENDIF.
CREATE DATA old_guid TYPE (fieldname). ASSIGN old_guid->* TO
<old_guid>. CASE <x_namtab>-domname. WHEN 'SYSUUID'. ASSIGN (fieldname)
TO <guid> CASTING TYPE guid_16. MOVE <guid> TO <old_guid>. CALL
FUNCTION 'GUID_CREATE' IMPORTING ev_guid_16 = <guid>. WHEN 'SYSUUID_C'.
ASSIGN (fieldname) TO <guid> CASTING TYPE guid_32. MOVE <guid> TO
<old_guid>. CALL FUNCTION 'GUID_CREATE' IMPORTING ev_guid_32 = <guid>.
WHEN 'SYSUUID_22'. ASSIGN (fieldname) TO <guid> CASTING TYPE guid_22.
MOVE <guid> TO <old_guid>. CALL FUNCTION 'GUID_CREATE' IMPORTING
ev_guid_22 = <guid>. WHEN 'SYSUUID_25'. ASSIGN (fieldname) TO <guid>
CASTING TYPE rssguid25. MOVE <guid> TO <old_guid>. CALL FUNCTION
'RSS_SYSTEM_GET_UNIQUE_ID' IMPORTING e_uni_idc25 = <guid>. ENDCASE. IF
x_header-frm_af_uid <> space. ASSIGN (x_header-maintview) TO
<work_area> CASTING TYPE (x_header-maintview). PERFORM
(x_header-frm_af_uid) IN PROGRAM (x_header-fpoolname) USING <old_guid>
CHANGING <guid> <work_area>. ENDIF. ENDLOOP. ELSE. READ TABLE x_namtab
ASSIGNING <x_namtab> WITH KEY viewfield = p_viewfield. CHECK sy-subrc =
0 AND <x_namtab>-domname IN vim_guid_domain. CONCATENATE
x_header-maintview <x_namtab>-viewfield INTO fieldname SEPARATED BY
'-'. ASSIGN (fieldname) TO <guid> CASTING TYPE (fieldname). IF
<status>-prof_found = vim_pr_into_view OR vim_import_profile <> space
OR vim_special_mode = vim_upgrade. CHECK <guid> IS INITIAL. ENDIF.
CREATE DATA old_guid TYPE (fieldname). ASSIGN old_guid->* TO
<old_guid>. CASE <x_namtab>-domname. WHEN 'SYSUUID'. ASSIGN (fieldname)
TO <guid> CASTING TYPE guid_16. MOVE <guid> TO <old_guid>. CALL
FUNCTION 'GUID_CREATE' IMPORTING ev_guid_16 = <guid>. WHEN 'SYSUUID_C'.
ASSIGN (fieldname) TO <guid> CASTING TYPE guid_32. MOVE <guid> TO
<old_guid>. CALL FUNCTION 'GUID_CREATE' IMPORTING ev_guid_32 = <guid>.
WHEN 'SYSUUID_22'. ASSIGN (fieldname) TO <guid> CASTING TYPE guid_22.
MOVE <guid> TO <old_guid>. CALL FUNCTION 'GUID_CREATE' IMPORTING
ev_guid_22 = <guid>. WHEN 'SYSUUID_25'. ASSIGN (fieldname) TO <guid>
CASTING TYPE rssguid25. MOVE <guid> TO <old_guid>. CALL FUNCTION
'RSS_SYSTEM_GET_UNIQUE_ID' IMPORTING e_uni_idc25 = <guid>. ENDCASE. IF
x_header-frm_af_uid <> space. ASSIGN (x_header-maintview) TO
<work_area> CASTING TYPE (x_header-maintview). PERFORM
(x_header-frm_af_uid) IN PROGRAM (x_header-fpoolname) USING <old_guid>
CHANGING <guid> <work_area>. ENDIF. ENDIF. ENDFORM. FORM
vim_maintain_single_set. Data: msgno like sy-msgno. IF
vim_single_entry_function EQ space AND ( function NE 'DELE' AND
function NE 'SAVE' ). IF vim_oc_inst IS INITIAL. msgno = '005'. ELSE.
READ TABLE dpl_sellist WITH KEY from_auth = space TRANSPORTING NO
FIELDS. IF sy-subrc = 0. msgno = '005'. ELSE. msgno = '766'. ENDIF.
ENDIF. PERFORM vim_send_sv005_or_sv766 USING msgno 'SENDIT'. ENDIF. IF
status-type EQ zweistufig AND function NE 'ABR ' AND function NE 'KOPF'
AND function NE 'IGN '. <status>-firstline = <status>-cur_line =
nextline. function = 'DETA'. IF x_header-delmdtflag NE space. TRANSLATE
vim_no_mainkey_exists USING vim_no_mkey_not_procsd_patt. ENDIF. PERFORM
process_detail_screen USING 'S'. ENDIF. ENDFORM. FORM
vim_send_sv005_or_sv766 USING p_msgno like sy-msgno p_mode TYPE char6.
STATICS: sent_already TYPE xfeld, viewname TYPE viewname. IF viewname
<> x_header-viewname. viewname = x_header-viewname. CLEAR sent_already.
ENDIF. CASE p_mode. WHEN 'SENDIT'. CHECK sent_already = space.
sent_already = 'X'. MESSAGE ID 'SV' TYPE 'S' NUMBER p_msgno. WHEN
'RESET'. CLEAR sent_already. ENDCASE. ENDFORM. FORM
map_texttabkey_to_viewkey TABLES namtab STRUCTURE vimnamtab USING
header TYPE vimdesc texttabkey TYPE x texttab_keylen TYPE syfleng
is_generic_key TYPE xfeld CHANGING viewkey TYPE x map_error. DATA: o1
TYPE i, o2 TYPE i, t_keylen TYPE i, l TYPE i, h_viewkey TYPE tabl8000.
FIELD-SYMBOLS: <namtab> TYPE vimnamtab, <texttab_struc> TYPE ANY,
<texttab_fld> TYPE ANY, <txt_struc> TYPE ANY, <viewfld> TYPE ANY.
CLEAR: map_error, viewkey. ASSIGN: texttabkey TO <texttab_struc>
CASTING TYPE (header-texttab), h_viewkey TO <txt_struc> CASTING TYPE
(header-maintview). MOVE viewkey TO h_viewkey. IF is_generic_key =
space. LOOP AT namtab ASSIGNING <namtab> WHERE keyflag <> space AND
txttabfldn <> space. ASSIGN: COMPONENT <namtab>-viewfield OF STRUCTURE
<txt_struc> TO <viewfld>, COMPONENT <namtab>-txttabfldn OF STRUCTURE
<texttab_struc> TO <texttab_fld>. <viewfld> = <texttab_fld>. ENDLOOP.
ELSE. IF header-sprasfdpos < texttab_keylen. t_keylen = texttab_keylen
- vim_spras_length. ELSE. t_keylen = texttab_keylen. ENDIF. LOOP AT
namtab ASSIGNING <namtab> WHERE keyflag <> space AND txttabfldn <>
space. o1 = <namtab>-position + <namtab>-flength. o2 =
<namtab>-texttabpos + <namtab>-flength. ASSIGN: COMPONENT
<namtab>-viewfield OF STRUCTURE <txt_struc> TO <viewfld>, COMPONENT
<namtab>-txttabfldn OF STRUCTURE <texttab_struc> TO <texttab_fld>. IF
o1 <= t_keylen AND o2 <= texttab_keylen. <viewfld> = <texttab_fld>.
ELSEIF o1 > t_keylen AND o2 > texttab_keylen. IF <namtab>-position <
t_keylen AND <namtab>-texttabpos < texttab_keylen AND 'CNDT' CS
<namtab>-inttype. l = ( texttab_keylen - <namtab>-texttabpos ) DIV
cl_abap_char_utilities=>charsize. <viewfld>(l) = <texttab_fld>(l).
ENDIF. ELSE. map_error = 'X'. EXIT. ENDIF. ENDLOOP. ENDIF. MOVE
h_viewkey TO viewkey. ENDFORM. FORM map_viewkey_to_texttabkey TABLES
namtab STRUCTURE vimnamtab USING header TYPE vimdesc spras LIKE
t002-spras view_wa TYPE x CHANGING text_wa TYPE x. DATA: align type f,
h_view_wa type tabl8000, h_texttab_wa TYPE tabl8000. FIELD-SYMBOLS:
<namtab> TYPE vimnamtab, <texttab_struc> TYPE ANY, <texttab_fld> TYPE
ANY, <view_struc> TYPE ANY, <viewfld> TYPE ANY. ASSIGN h_texttab_wa TO
<texttab_struc> CASTING TYPE (header-texttab). MOVE: text_wa TO
h_texttab_wa, view_wa to h_view_wa. ASSIGN COMPONENT header-sprasfield
OF STRUCTURE <texttab_struc> TO <texttab_fld>. <texttab_fld> = spras.
ASSIGN: h_view_wa(header-tablen) TO <view_struc> CASTING TYPE
(header-maintview). LOOP AT namtab ASSIGNING <namtab> WHERE txttabfldn
<> space AND keyflag <> space. ASSIGN: COMPONENT <namtab>-viewfield OF
STRUCTURE <view_struc> TO <viewfld>, COMPONENT <namtab>-txttabfldn OF
STRUCTURE <texttab_struc> TO <texttab_fld>. <texttab_fld> = <viewfld>.
ENDLOOP. MOVE h_texttab_wa TO text_wa. ENDFORM. FORM vim_get_trspkeylen
USING p_tabname TYPE tabname CHANGING p_keylength TYPE syfleng. TYPES:
BEGIN OF tabkeylen_type, tabname TYPE tabname, keylen TYPE syfleng, END
OF tabkeylen_type. STATICS: tabkeylen_tab TYPE HASHED TABLE OF
tabkeylen_type WITH UNIQUE KEY tabname. DATA: w_tabkeylen TYPE
tabkeylen_type, x030l_wa TYPE x030l. READ TABLE tabkeylen_tab INTO
w_tabkeylen WITH TABLE KEY tabname = p_tabname. IF sy-subrc <> 0. CALL
FUNCTION 'DDIF_NAMETAB_GET' EXPORTING tabname = p_tabname IMPORTING
x030l_wa = x030l_wa. w_tabkeylen-tabname = p_tabname.
w_tabkeylen-keylen = x030l_wa-keylen. IF p_tabname = x_header-texttab
AND x_header-genertxtrp <> space. w_tabkeylen-keylen =
x_header-maxtrtxkln. ELSEIF x_header-generictrp <> space.
w_tabkeylen-keylen = x_header-maxtrkeyln. ENDIF. INSERT w_tabkeylen
INTO TABLE tabkeylen_tab. ENDIF. p_keylength = w_tabkeylen-keylen.
ENDFORM. FORM vim_get_bc_keylen USING p_tabname TYPE tabname CHANGING
p_keylength TYPE syfleng. CONSTANTS max_bc_keylen TYPE i VALUE 255.
TYPES: BEGIN OF tabkeylen_type, tabname TYPE tabname, keylen TYPE
syfleng, END OF tabkeylen_type. STATICS: tabkeylen_tab TYPE HASHED
TABLE OF tabkeylen_type WITH UNIQUE KEY tabname. DATA: w_tabkeylen TYPE
tabkeylen_type, x030l_wa TYPE x030l, max_keylen_byte TYPE i. READ TABLE
tabkeylen_tab INTO w_tabkeylen WITH TABLE KEY tabname = p_tabname. IF
sy-subrc <> 0. CALL FUNCTION 'DDIF_NAMETAB_GET' EXPORTING tabname =
p_tabname IMPORTING x030l_wa = x030l_wa. w_tabkeylen-tabname =
p_tabname. w_tabkeylen-keylen = x030l_wa-keylen. max_keylen_byte =
max_bc_keylen * cl_abap_char_utilities=>charsize. IF w_tabkeylen-keylen
> max_keylen_byte. w_tabkeylen-keylen = max_keylen_byte. ENDIF. INSERT
w_tabkeylen INTO TABLE tabkeylen_tab. ENDIF. p_keylength =
w_tabkeylen-keylen. ENDFORM. FORM vim_comp_roottabkey USING p_header
TYPE vimdesc p_namtab TYPE vimnamtab_type CHANGING p_keys_identical
TYPE xfeld p_rc TYPE sy-subrc. TYPES: BEGIN OF flagstruc_type, viewname
TYPE viewname, keys_ident, END OF flagstruc_type. STATICS: flagtab TYPE
HASHED TABLE OF flagstruc_type WITH UNIQUE KEY viewname. DATA:
w_flagtab TYPE flagstruc_type, x031l_tab TYPE TABLE OF x031l.
FIELD-SYMBOLS: <namtab> TYPE vimnamtab, <x031l> TYPE x031l. CLEAR p_rc.
READ TABLE flagtab WITH TABLE KEY viewname = p_header-viewname INTO
w_flagtab. IF sy-subrc <> 0. w_flagtab-viewname = p_header-viewname.
w_flagtab-keys_ident = 'X'. CALL FUNCTION 'DDIF_NAMETAB_GET' EXPORTING
tabname = p_header-roottab TABLES x031l_tab = x031l_tab EXCEPTIONS
OTHERS = 2. IF sy-subrc <> 0. p_rc = sy-subrc. ENDIF. LOOP AT p_namtab
ASSIGNING <namtab> WHERE keyflag = 'X'. IF <namtab>-bastabname <>
p_header-roottab. sy-subrc = 4. ELSE. READ TABLE x031l_tab INDEX
sy-tabix ASSIGNING <x031l>. ENDIF. IF sy-subrc <> 0 OR
<x031l>-fieldname <> <namtab>-bastabfld. clear w_flagtab-keys_ident.
exit. ENDIF. ENDLOOP. INSERT w_flagtab INTO TABLE flagtab. ENDIF.
p_keys_identical = w_flagtab-keys_ident. ENDFORM. FORM
vim_synchronizer_call USING p_cu_ko200_tab TYPE vim_ko200_tab_type
p_corr_keytab TYPE tr_keys p_synchronizer_flag TYPE xfeld. STATICS:
e071k_loc TYPE TABLE OF e071k, e071_loc TYPE TABLE OF e071. DATA:
e071k_loc_wa TYPE e071k, e071_loc_wa TYPE e071. IF p_synchronizer_flag
= space. CLEAR: e071k_loc, e071_loc. REFRESH: e071k_loc, e071_loc. LOOP
AT p_corr_keytab INTO e071k_loc_wa. APPEND e071k_loc_wa TO e071k_loc.
ENDLOOP. LOOP AT p_cu_ko200_tab INTO e071_loc_wa. APPEND e071_loc_wa TO
e071_loc. ENDLOOP. ELSE. READ TABLE e071k_loc INDEX 1 INTO
e071k_loc_wa. READ TABLE p_corr_keytab INDEX 1 INTO e071k_loc_wa. CALL
FUNCTION 'SCDC_DISTRIBUTE_TABLE_KEYS' EXPORTING trkorr =
e071k_loc_wa-trkorr TABLES e071_tab = e071_loc e071k_tab = e071k_loc
EXCEPTIONS no_project = 1 OTHERS = 2 . IF sy-subrc <> 0. ENDIF. ENDIF.
ENDFORM. FORM check_nonkey. FIELD-SYMBOLS: <table1_txt_loc> type any.
if x_header-bastab <> space and x_header-texttbexst <> space. assign
<table1_text> to <table1_txt_loc>. else. assign <table1> to
<table1_txt_loc>. endif. CALL FUNCTION 'TABLE_RANGE_CHECK' EXPORTING
tabname = x_header-maintview entry = <table1> entry_text =
<table1_txt_loc> ddic = 'J' key = 'F' ignore_blank_subsetfields = 'N'
TABLES x_namtab = x_namtab x_header = x_header sellist =
<vim_ck_sellist> EXCEPTIONS entry_not_fits = 1. IF sy-subrc EQ 1.
PERFORM set_pf_status USING 'ERROR'. MESSAGE e174(sv). ENDIF. endform.
MODULE detail_init OUTPUT. IF vim_called_by_cluster <> space. PERFORM
vim_vcldocking_control. ENDIF. PERFORM vim_add_img_notices_pbo USING
x_header-detail. PERFORM detail_init. IF ( replace_mode NE space AND
neuer NE 'X' ) OR vim_pr_activating <> space. SUPPRESS DIALOG. ENDIF.
PERFORM vim_modify_detail_screen. ENDMODULE. MODULE vim_modif_detail
OUTPUT. PERFORM vim_modify_detail_screen. ENDMODULE. MODULE
liste_show_liste OUTPUT. IF vim_tabctrl_active NE space. IF
<vim_tctrl>-current_line GT maxlines AND <xact> NE leer. EXIT FROM
STEP-LOOP. ENDIF. ENDIF. looplines = sy-loopc. IF l GT looplines.
counter = ( l - firstline ) div looplines + 1. DO counter TIMES.
firstline = firstline + looplines - 1. ENDDO. MOVE firstline TO
<status>-firstline. <status>-cur_line = l = l - firstline + 1. SET
CURSOR FIELD f LINE l OFFSET o. ENDIF. IF vim_special_mode NE
vim_upgrade AND status-action EQ hinzufuegen AND maxlines EQ 0 AND
sy-stepl EQ 1. DESCRIBE TABLE extract. IF sy-tfill GT looplines.
sy-tfill = looplines + 1. LOOP AT extract FROM sy-tfill. DELETE
extract. ENDLOOP. nbr_of_added_dummy_entries = looplines. ENDIF. ENDIF.
CLEAR vim_set_from_bc_pbo. IF replace_mode = space AND status-action =
aendern AND vim_bc_chng_allowed = space. READ TABLE vim_bc_entry_list
INTO vim_bc_entry_list_wa WITH TABLE KEY viewname = x_header-viewname
keys = <vim_xextract_key>. IF sy-subrc = 0. vim_set_from_bc_pbo = 'X'.
ENDIF. ENDIF. IF replace_mode NE space OR vim_special_mode EQ
vim_delete. IF sy-stepl GT 1. EXIT FROM STEP-LOOP. ELSE. MOVE
<vim_xtotal> TO <table2_x>. ENDIF. ENDIF. index = exind = nextline. IF
status-action EQ kopieren AND status-type EQ einstufig. READ TABLE
vim_copied_indices WITH KEY level = vim_copy_call_level ex_ix =
nextline. IF sy-subrc EQ 0. READ TABLE total INDEX
vim_copied_indices-ix. extract = total. neuer = 'N'. ELSE. neuer = 'J'.
ENDIF. ENDIF. PERFORM move_extract_to_view_wa. IF vim_special_mode EQ
vim_delimit. MOVE vim_sval_tab-value TO <vim_new_begdate>. ENDIF. IF
status-action EQ hinzufuegen AND status-type EQ einstufig AND neuer NE
'J' AND <xact> EQ leer. neuer = 'J'. ENDIF. IF <xmark> EQ markiert.
MOVE 'X' TO vim_marked. ENDIF. LOOP AT SCREEN. CLEAR vim_modify_screen.
SPLIT screen-name AT '-' INTO vim_object vim_objfield. IF (
status-action EQ anzeigen OR status-action EQ transportieren OR
status-delete EQ geloescht ) AND screen-name NE 'VIM_MARKED'.
screen-input = '0'. vim_modify_screen = 'X'. ELSE. IF screen-group1 EQ
'KEY'. IF vim_tabctrl_active NE space AND screen-input EQ '0'. READ
TABLE <vim_tctrl>-cols INTO vim_tc_cols WITH KEY screen-name =
screen-name TRANSPORTING screen-required. IF sy-subrc EQ 0 AND
screen-required NE vim_tc_cols-screen-required. screen-required =
vim_tc_cols-screen-required. vim_modify_screen = 'X'. ENDIF. ENDIF. IF
screen-required NE 0 AND screen-input NE '0'. screen-input = '0'.
vim_modify_screen = 'X'. ENDIF. IF vim_single_entry_function EQ 'INS'.
screen-request = 1. vim_modify_screen = 'X'. ENDIF. IF status-action =
kopieren. screen-request = 1. vim_modify_screen = 'X'. ENDIF. ENDIF. IF
neuer EQ 'J'. IF vim_special_mode NE vim_delimit AND screen-group1 EQ
'KEY' AND ( vim_single_entry_function NE 'INS' OR
vim_single_entry_ins_key_input NE space ) AND ( x_header-existency NE
'M' OR screen-name EQ vim_enddate_name ). ADD 1 TO pos. IF pos EQ 1.
SET CURSOR FIELD screen-name LINE sy-stepl. ENDIF. screen-input = '1'.
vim_modify_screen = 'X'. ENDIF. IF screen-name EQ 'VIM_MARKED'.
screen-input = '0'. vim_modify_screen = 'X'. ELSE. IF <xact> =
profil_hinzufuegen. READ TABLE vim_pr_fields_wa-fields WITH TABLE KEY
fieldname = vim_objfield TRANSPORTING NO FIELDS. IF sy-subrc = 0.
screen-request = 1. vim_modify_screen = 'X'. ENDIF. ENDIF. IF
vim_special_mode EQ vim_upgrade AND function NE 'DELE'. IF
<status>-prof_found = vim_pr_into_view AND status-action = hinzufuegen
AND screen-group1 = 'KEY'. PERFORM set_profile_key_attributes USING
vim_objfield CHANGING screen-input vim_modify_screen. ENDIF.
screen-request = 1. vim_modify_screen = 'X'. ENDIF. ENDIF. ELSE. IF
x_header-delmdtflag NE space AND x_header-existency EQ 'U' AND
screen-name EQ vim_begdate_name. screen-input = '0'. vim_modify_screen
= 'X'. ENDIF. IF f EQ space AND screen-name NE 'VIM_MARKED' AND
screen-input EQ '1'. SET CURSOR FIELD screen-name LINE l. f =
screen-name. ENDIF. IF replace_mode NE space. CASE vim_special_mode.
WHEN vim_replace. IF screen-name EQ sel_field_for_replace_l.
screen-request = 1. vim_modify_screen = 'X'. ENDIF. WHEN vim_upgrade.
IF NOT function IN exted_functions AND screen-name NE 'VIM_MARKED'.
screen-request = 1. vim_modify_screen = 'X'. ENDIF. screen-input = '1'.
vim_modify_screen = 'X'. ENDCASE. ELSE. IF vim_special_mode EQ
vim_delete. screen-input = '0'. vim_modify_screen = 'X'. ENDIF. IF
vim_set_from_bc_pbo <> space AND screen-group1 <> 'KEY'. PERFORM
vim_bc_logs_use USING vim_objfield vim_bc_entry_list_wa CHANGING screen
vim_modify_screen. ENDIF. ENDIF. ENDIF. ENDIF. IF <xmark> EQ markiert
AND screen-name NE 'VIM_MARKED'. screen-intensified = 1.
vim_modify_screen = 'X'. ENDIF. IF vim_special_mode EQ vim_delimit AND
screen-name EQ vim_begdate_name. screen-request = 1. vim_modify_screen
= 'X'. ENDIF. IF vim_objfield <> space AND vim_object =
x_header-maintview. LOOP AT x_namtab WHERE viewfield = vim_objfield AND
( texttabfld = space OR keyflag = space ). IF x_namtab-readonly =
vim_hidden. screen-active = '0'. vim_modify_screen = 'X'. ELSEIF
x_namtab-readonly = rdonly. screen-input = '0'. vim_modify_screen =
'X'. ENDIF. EXIT. ENDLOOP. ENDIF. IF vim_modify_screen = 'X'. MODIFY
SCREEN. ENDIF. ENDLOOP. IF status-action EQ kopieren. neuer = 'N'.
ENDIF. ENDMODULE. MODULE liste_initialisieren OUTPUT. IF
vim_called_by_cluster <> space. PERFORM vim_vcldocking_control. ENDIF.
status-mode = list_bild. title-mode = list_bild. firstline = nextline.
aktuell = firstline. vim_act_dynp_view = x_header-viewname. PERFORM
vim_add_img_notices_pbo USING x_header-liste. IF vim_special_mode EQ
vim_direct_upgrade. SUPPRESS DIALOG. ok_code = function = 'CMPR'. EXIT.
ENDIF. CLEAR <status>-mark_only. IF replace_mode NE space OR
vim_special_mode EQ vim_delete. PERFORM set_title USING title <name>.
IF vim_special_mode NE vim_delete. SUPPRESS DIALOG. ENDIF. PERFORM
set_pf_status USING 'REPLACE'. MOVE <table1> TO <vim_total_struc>. IF
x_header-bastab NE space AND x_header-texttbexst NE space. MOVE
<table1_text> TO <vim_tot_txt_struc>. ENDIF. IF vim_tabctrl_active NE
space. IF status-action EQ hinzufuegen. <vim_tctrl>-lines = maxlines +
nbr_of_added_dummy_entries. ELSE. <vim_tctrl>-lines = maxlines. ENDIF.
<vim_tctrl>-top_line = firstline. LOOP AT <vim_tctrl>-cols INTO
vim_tc_cols WHERE screen-active EQ 0. vim_tc_cols-vislength = 0. MODIFY
<vim_tctrl>-cols FROM vim_tc_cols. ENDLOOP. ENDIF. EXIT. ENDIF. IF
mark_extract GT 0. status-mark = markiert. ELSE. status-mark =
nicht_markiert. ENDIF. IF maxlines EQ 0. IF status-action NE
hinzufuegen OR status-type NE einstufig. PERFORM fill_extract. ELSE.
title-data = auswahldaten. ENDIF. status-delete = nicht_geloescht.
PERFORM vim_send_sv005_or_sv766 USING '766' 'RESET'. ELSEIF maxlines =
1 AND function <> 'UEBE'. PERFORM vim_maintain_single_set. ELSE.
PERFORM vim_send_sv005_or_sv766 USING '766' 'RESET'. IF status-action
EQ hinzufuegen. pos = 1. LOOP AT extract. CHECK <xact> NE leer. IF
sy-tabix NE pos. DELETE extract. INSERT extract INDEX pos. ENDIF. ADD 1
TO pos. ENDLOOP. ENDIF. ENDIF. maximal = maxlines. IF
vim_tabctrl_active NE space. IF status-action EQ hinzufuegen.
<vim_tctrl>-lines = maxlines + nbr_of_added_dummy_entries. ELSE.
<vim_tctrl>-lines = maxlines. ENDIF. <vim_tctrl>-top_line = firstline.
LOOP AT <vim_tctrl>-cols INTO vim_tc_cols WHERE screen-active EQ 0.
vim_tc_cols-vislength = 0. MODIFY <vim_tctrl>-cols FROM vim_tc_cols.
ENDLOOP. ELSE. LOOP AT SCREEN. SPLIT screen-name AT '-' INTO vim_object
vim_objfield. IF vim_objfield <> space AND vim_object =
x_header-maintview. LOOP AT x_namtab WHERE viewfield = vim_objfield AND
( texttabfld = space OR keyflag = space ). IF x_namtab-readonly =
vim_hidden. screen-active = '0'. MODIFY SCREEN. ELSEIF
x_namtab-readonly = rdonly. screen-input = '0'. MODIFY SCREEN. ENDIF.
EXIT. ENDLOOP. ENDIF. ENDLOOP. ENDIF. PERFORM set_position_info USING
firstline maxlines. pos = maxlines - firstline + 1. IF l GT pos. l = 1.
ENDIF. pos = 0. SET CURSOR FIELD f LINE l OFFSET o. PERFORM
set_pf_status USING status. PERFORM set_title USING title <name>. IF
maxlines EQ 0. LOOP AT SCREEN. CHECK screen-name EQ 'VIM_POSI_PUSH'.
screen-input = 0. MODIFY SCREEN. EXIT. ENDLOOP. ENDIF. IF status-action
EQ kopieren OR vim_single_entry_function NE space. LOOP AT SCREEN.
CHECK screen-name EQ 'VIM_POSI_PUSH'. screen-active = 0. MODIFY SCREEN.
EXIT. ENDLOOP. ENDIF. ENDMODULE. MODULE fill_substflds OUTPUT. CHECK
x_header-subsetflag NE space. PERFORM fill_subsetfields. ENDMODULE.
MODULE liste_deactivate OUTPUT. CHECK <xact> NE leer AND status-action
NE kopieren. LOOP AT SCREEN. CHECK screen-group2 EQ 'EZN' . IF
x_header-ptfrkyexst EQ space. MOVE screen-name TO f. SHIFT f UP TO '-'.
SHIFT f. LOOP AT x_namtab WHERE keyflag EQ space AND viewfield EQ f.
MOVE 'X' TO x_namtab-prtfrkyfld. MOVE 'X' TO x_header-ptfrkyexst.
MODIFY x_namtab. ENDLOOP. ENDIF. CHECK sy-stepl NE 1 AND
<vim_f1_beforex> EQ <vim_mkey_beforex> AND ( vim_mkey_after_exists EQ
space OR <vim_f1_afterx> EQ <vim_mkey_afterx> ). screen-active = 0.
MODIFY SCREEN. ENDLOOP. MODIFY x_header INDEX 1. IF
vim_no_mainkey_exists EQ vim_no_mkey_not_procsd OR <vim_f1_beforex> NE
<vim_mkey_beforex> OR ( vim_mkey_after_exists NE space AND
<vim_f1_afterx> NE <vim_mkey_afterx> ). <vim_h_mkey>(x_header-keylen) =
<f1_x>. TRANSLATE vim_no_mainkey_exists USING vim_no_mkey_procsd_patt.
ENDIF. ENDMODULE. MODULE vim_suppress_liste OUTPUT. CHECK
vim_special_mode <> vim_direct_upgrade AND function NE space AND
function NE 'ANZG' AND function NE 'AEND' AND NOT (
vim_called_by_cluster NE space AND ( function CP 'DET*' OR function CP
'%_*' ) ). SUPPRESS DIALOG. ok_code = back. ENDMODULE. MODULE
set_update_flag. CHECK status-action NE anzeigen AND status-action NE
transportieren. IF x_header-delmdtflag NE space AND status-type EQ
einstufig AND status-mode EQ list_bild. IF ( <vim_new_begdate> EQ
vim_init_date OR <vim_enddate_mask> EQ vim_init_date ). MESSAGE
e127(sv). ENDIF. CLEAR sy-subrc. IF status-action EQ kopieren AND
vim_special_mode NE vim_delimit. READ TABLE vim_copied_indices WITH KEY
level = vim_copy_call_level ex_ix = nextline. ENDIF. IF sy-subrc NE 0
OR ( status-action EQ hinzufuegen AND <xact> EQ leer ). neuer = 'J'. IF
x_header-guidflag <> space. PERFORM vim_make_guid using space. ENDIF.
IF x_header-frm_on_new NE space. PERFORM (x_header-frm_on_new) IN
PROGRAM. ENDIF. PERFORM check_key. neuer = 'N'. ENDIF. ENDIF. IF
x_header-bastab NE space AND x_header-texttbexst NE space. TRANSLATE
<status>-upd_flag USING ' ETX'. ELSE. <status>-upd_flag = 'X'. ENDIF.
PERFORM check_nonkey. ENDMODULE. MODULE detail_exit_command. PERFORM
detail_exit_command. ENDMODULE. MODULE liste_exit_command. PERFORM
liste_exit_command. ENDMODULE. MODULE liste_after_loop. IF
vim_tabctrl_active NE space. IF nextline NE <vim_tctrl>-top_line.
nextline = <vim_tctrl>-top_line. ENDIF. ENDIF. IF destpage NE 0.
nextline = destpage. CLEAR destpage. ENDIF. IF vim_special_mode NE
vim_upgrade AND vim_special_mode NE vim_delimit AND
temporal_delimitation_happened NE space. PERFORM
after_temporal_delimitation. CLEAR: temporal_delimitation_happened,
vim_old_viewkey. TRANSLATE vim_no_mainkey_exists USING
vim_no_mkey_not_procsd_patt. ENDIF. IF function IN mark_functions AND
mark_extract EQ 0. MESSAGE s026(sv). LEAVE SCREEN. ENDIF. PERFORM
update_status. IF vim_single_entry_function EQ 'INS' AND
vim_single_entry_ins_key_input NE space AND status-action EQ
hinzufuegen. PERFORM vim_single_entry_fill_sellist. ENDIF. CLEAR:
vim_next_screen, vim_leave_screen. CASE function. WHEN 'ADDR'. PERFORM
liste_address_maintain. WHEN 'AEND'. PERFORM anzg_to_aend. WHEN 'ALCO'.
PERFORM selektiere USING transportieren. WHEN 'ALMK'. PERFORM
selektiere USING markiert. WHEN 'ALNC'. PERFORM selektiere USING space.
WHEN 'ALOE'. PERFORM selektiere USING geloescht. WHEN 'ALNW'. PERFORM
selektiere USING neuer_eintrag. WHEN 'ANZG'. PERFORM aend_to_anzg.
vim_next_screen = 0. vim_leave_screen = 'X'. WHEN 'ATAB'.
vim_next_screen = 0. vim_leave_screen = 'X'. WHEN 'BACK'. IF
status-mode EQ list_bild AND status-data EQ gesamtdaten OR
vim_single_entry_function NE space. vim_next_screen = 0.
vim_leave_screen = 'X'. ELSE. PERFORM liste_back. ENDIF. WHEN 'BCCH'.
PERFORM vim_chng_fix_flds. WHEN 'BCSH'. PERFORM vim_bc_show_fix_flds.
WHEN 'BCON'. PERFORM selektiere USING bcset_only. WHEN 'CMPO'. PERFORM
upgrade USING 'O'. WHEN 'CMPR'. PERFORM upgrade USING 'R'. WHEN 'COMP'.
PERFORM upgrade USING space. WHEN 'DELE'. PERFORM loeschen. IF
replace_mode NE space. <status>-mk_to = mark_total. <status>-mk_xt =
mark_extract. vim_next_screen = 0. vim_leave_screen = 'X'. ENDIF. WHEN
'DELM'. PERFORM delimitation. WHEN 'DETM'. PERFORM detail_markierte.
WHEN 'DETA'. PERFORM detailbild. WHEN 'ENDE'. vim_next_screen = 0.
vim_leave_screen = 'X'. WHEN 'EXPA'. IF x_header-delmdtflag EQ space.
MESSAGE s001(sv). EXIT. ENDIF. PERFORM (vim_time_dep_dpl_modif_form) IN
PROGRAM. WHEN 'FDOC'. PERFORM show_function_docu. WHEN 'KOPE'. counter
= 0. PERFORM kopiere. WHEN 'KOPF'. SET SCREEN 0. LEAVE SCREEN. WHEN
'LANG'. PERFORM vim_set_languages. WHEN 'MKAL'. PERFORM markiere_alle
USING markiert. WHEN 'MKBL'. PERFORM markiere_block. WHEN 'MKEZ'.
PERFORM liste_markiere. WHEN 'MKLO'. PERFORM markiere_alle USING
nicht_markiert. WHEN 'NEWL'. PERFORM hinzufuegen. WHEN 'NEXT'. PERFORM
naechster. WHEN 'ORDR'. PERFORM order_administration. WHEN 'ORGI'.
PERFORM original_holen. WHEN 'POSI'. PERFORM popup_positionieren. WHEN
'PREV'. PERFORM voriger. WHEN 'PRMO'. PERFORM list_alv. WHEN 'PROT'.
PERFORM logs_analyse. WHEN 'PRST'. PERFORM list_alv. WHEN 'P+  '.
PERFORM blaettern. WHEN 'P-  '. PERFORM blaettern. WHEN 'P++ '. PERFORM
blaettern. WHEN 'P-- '. PERFORM blaettern. WHEN 'REPL'. PERFORM
replace. WHEN 'SAVE'. IF status-action EQ hinzufuegen.
<status>-firstline = firstline = <status>-cur_line = l = 1. ENDIF.
vim_next_screen = 0. vim_leave_screen = 'X'. WHEN 'SCRF'. PERFORM
vim_sapscript_form_maint. WHEN 'SEAR'. PERFORM suchen. WHEN 'SELU'.
PERFORM selektiere USING aendern. WHEN 'TEXT'. PERFORM
vim_multi_langu_text_maint. WHEN 'TREX'. MOVE geloescht TO corr_action.
PERFORM update_corr. IF replace_mode NE space. <status>-mk_to =
mark_total. <status>-mk_xt = mark_extract. vim_next_screen = 0.
vim_leave_screen = 'X'. ENDIF. WHEN 'TRIN'. MOVE hinzufuegen TO
corr_action. PERFORM update_corr. IF replace_mode NE space.
<status>-mk_to = mark_total. <status>-mk_xt = mark_extract.
vim_next_screen = 0. vim_leave_screen = 'X'. ENDIF. WHEN 'TRSP'. IF
x_header-cursetting NE space AND x_header-flag EQ vim_transport_denied.
x_header-flag = x_header-cursetting. TRANSLATE x_header-flag USING
'X YX'. MODIFY x_header INDEX 1. ENDIF. vim_next_screen = 0.
vim_leave_screen = 'X'. WHEN 'UNDO'. PERFORM zurueckholen. IF
replace_mode NE space. <status>-mk_to = mark_total. <status>-mk_xt =
mark_extract. vim_next_screen = 0. vim_leave_screen = 'X'. ENDIF. WHEN
'UPRF'. message s175(SV). WHEN '    '. IF vim_single_entry_function EQ
'INS' AND status-action EQ hinzufuegen. PERFORM liste_back. ENDIF. IF
replace_mode NE space. vim_next_screen = 0. vim_leave_screen = 'X'.
ENDIF. WHEN OTHERS. IF vim_called_by_cluster NE space. CALL FUNCTION
'VIEWCLUSTER_NEXT_ACTION' IMPORTING leave_screen = vim_leave_screen
CHANGING fcode = function. IF vim_leave_screen NE space.
vim_next_screen = 0. ENDIF. ENDIF. ENDCASE. IF vim_leave_screen NE
space. CLEAR: vim_leave_screen, vim_act_dynp_view. SET SCREEN
vim_next_screen. LEAVE SCREEN. ENDIF. ENDMODULE. MODULE
liste_before_loop. GET CURSOR FIELD f LINE l OFFSET o. function =
ok_code. CLEAR: ok_code, <status>-upd_flag. IF vim_special_mode EQ
vim_delete. SET SCREEN 0. LEAVE SCREEN. ENDIF. IF replace_mode EQ
space. PERFORM set_pf_status USING 'ERRORLIS'. neuer = 'N'. IF
vim_called_by_cluster NE space. CALL FUNCTION 'VIEWCLUSTER_SET_OKCODE'
EXPORTING ok_code = function. ENDIF. ENDIF. ENDMODULE. MODULE
detail_pai. CLEAR: vim_next_screen, vim_leave_screen. function =
ok_code. PERFORM detail_pai. IF vim_leave_screen NE space. CLEAR:
vim_leave_screen, vim_act_dynp_view. SET SCREEN vim_next_screen. LEAVE
SCREEN. ENDIF. ENDMODULE. MODULE detail_set_pfstatus. IF replace_mode
EQ space. PERFORM set_pf_status USING 'ERROR'. ENDIF. IF
x_header-delmdtflag NE space. EXPORT ok_code TO MEMORY ID
vim_memory_id_2. ENDIF. ENDMODULE. MODULE liste_mark_checkbox. CHECK
<xact> NE leer. CLEAR answer. IF vim_marked NE space AND <xmark> NE
markiert. MOVE: markiert TO <xmark>, markiert TO answer. ADD: 1 TO
mark_total, 1 TO mark_extract. ELSEIF vim_marked EQ space AND <xmark>
NE nicht_markiert. MOVE: nicht_markiert TO <xmark>, markiert TO answer.
SUBTRACT: 1 FROM mark_total, 1 FROM mark_extract. ENDIF. IF
<status>-upd_flag EQ space AND answer NE space. MOVE nextline TO index.
READ TABLE total WITH KEY <vim_xextract_key> BINARY SEARCH. PERFORM
vorhanden. ENDIF. CLEAR answer. ENDMODULE. MODULE liste_init_workarea.
IF replace_mode NE space. IF vim_special_mode EQ vim_upgrade.
<table2_x> = <vim_xtotal>. ELSEIF vim_special_mode EQ vim_replace.
CLEAR <replace_field>. ENDIF. ENDIF. PERFORM move_extract_to_view_wa.
MOVE nextline TO exind. CLEAR vim_pr_activating. IF <xact> =
profil_hinzufuegen. <table2_x> = <initial_x>. <xact> = leer.
vim_pr_activating = 'X'. MODIFY extract INDEX sy-stepl. IF
x_header-bastab NE space AND x_header-texttbexst NE space.
<status>-upd_flag = 'E'. ELSE. <status>-upd_flag = 'X'. ENDIF. ENDIF.
CLEAR: vim_key_alr_checked, vim_keyrange_alr_checked. ENDMODULE. MODULE
liste_update_liste. CHECK status-action NE anzeigen. CHECK
status-action NE transportieren. CHECK status-delete NE geloescht. IF
ok_code NE 'IGN '. IF x_header-ptfrkyexst NE space. PERFORM
consistency_prt_frky_fields USING vim_show_consistency_alert. ENDIF.
CASE status-action. WHEN kopieren. READ TABLE vim_copied_indices WITH
KEY level = vim_copy_call_level ex_ix = nextline. IF sy-subrc EQ 0.
<xact> = neuer_eintrag. PERFORM update_tab. ELSE. PERFORM
kopiere_eintrag USING <orig_key>. ENDIF. WHEN OTHERS. PERFORM
update_tab. ENDCASE. ELSE. PERFORM set_pf_status USING 'ERRORLIS'.
ENDIF. IF replace_mode EQ space. CLEAR ok_code. ENDIF. ENDMODULE.
MODULE temp_delimitation. DATA: td_addr_safe LIKE adrc-addrnumber.
CHECK x_header-delmdtflag NE space. CHECK status-action NE anzeigen AND
status-action NE transportieren. IF x_header-bastab NE space AND
x_header-texttbexst NE space. <status>-upd_flag = 'E'. ELSE.
<status>-upd_flag = 'X'. ENDIF. vim_begdate_entered = 'X'. PERFORM
temporal_delimitation. IF temporal_delimitation_happened EQ 'X' AND
x_header-delmdtflag EQ 'B'. IF x_header-adrnbrflag = space. MOVE:
<vim_xtotal_key> TO <f1_x>, <vim_begdate> TO <vim_new_begdate>. ELSE.
MOVE: <address_number> TO td_addr_safe, <vim_xtotal_key> TO <f1_x>,
td_addr_safe TO <address_number>, <vim_begdate> TO <vim_new_begdate>.
ENDIF. ENDIF. ENDMODULE. MODULE consistency. EXIT. ENDMODULE. MODULE
vcl_help_values INPUT. DATA: vcl_event(3) . CLEAR: f, vim_object,
vim_objfield. CALL 'DY_GET_DYNPRO_EVENT' ID 'EVENT' FIELD vcl_event. IF
sy-subrc = 0 AND vcl_event = 'OUT'. MESSAGE i538(sv) WITH
vim_calling_cluster view_name. EXIT. ENDIF. IF status-mode = 'L'. GET
CURSOR FIELD f LINE l. ELSE. GET CURSOR FIELD f. ENDIF. SPLIT f AT '-'
INTO vim_object vim_objfield. IF vim_objfield IS INITIAL. MESSAGE
s084(sv). ELSE. CALL FUNCTION 'VIEWCLUSTER_HELP_VALUES_NEW' EXPORTING
object = vim_object fieldname = vim_objfield EXCEPTIONS OTHERS = 1. IF
sy-subrc <> 0. MESSAGE s084(sv). ENDIF. ENDIF. ENDMODULE.
