Properties SourceCde
txt
1
*---------------------------------------------------------------------*
2
*       FORM UPDATE_TAB                                               *
3
*---------------------------------------------------------------------*
4
*       ........                                                      *
5
*---------------------------------------------------------------------*
6
FORM update_tab.
7
  DATA: rc_safe LIKE sy-subrc, tabix LIKE sy-tabix, h_ix TYPE i,
8
        begdate_safe TYPE d, enddate_safe TYPE d.
9
  CHECK status-action NE anzeigen.
10
  CHECK status-action NE transportieren.
11
  CHECK status-delete NE geloescht.
12
  IF <status>-upd_flag EQ space.
13
    neuer = 'N'.
14
    EXIT.
15
  ENDIF.
16
  IF status-type EQ einstufig AND status-action EQ hinzufuegen.
17
    IF ( ( x_header-bastab EQ space OR x_header-texttbexst EQ space )
18
           AND <table2_x> EQ <initial_x>
19
         OR x_header-bastab NE space AND x_header-texttbexst NE space
20
           AND <vim_xextract_enti> EQ <initial_x>
21
         OR ( vim_special_mode EQ vim_upgrade OR
22
           vim_single_entry_function NE space ) )
23
        AND <xact> EQ leer.            "int943578/2000
24
      neuer = 'J'.
25
    ELSE.
26
      neuer = 'N'.
27
    ENDIF.
28
  ENDIF.
29
  IF x_header-frm_h_flds NE space.
30
    PERFORM (x_header-frm_h_flds) IN PROGRAM.               "Zp 21
31
  ENDIF.
32
  IF neuer EQ 'J'.
33
    IF x_header-guidflag <> space.
34
      PERFORM vim_make_guid USING space.
35
    ENDIF.
36
    IF x_header-frm_on_new NE space.
37
      PERFORM (x_header-frm_on_new) IN PROGRAM.             "Zp 05
38
    ENDIF.
39
    PERFORM check_key.
40
    MOVE: sy-subrc TO rc_safe, sy-tabix TO tabix.
41
    IF x_header-adrnbrflag NE space.
42
      IF vim_special_mode NE vim_upgrade.
43
        PERFORM address_maintain.
44
      ELSE.
45
        PERFORM vim_address_adjust.
46
      ENDIF.
47
    ENDIF.
48
    IF vim_called_by_cluster NE space AND vim_extcopy_mode NE space.
49
      h_ix = nextline + 1.
50
      READ TABLE extract INDEX h_ix.
51
      DELETE extract INDEX h_ix.
52
      IF x_header-texttbexst <> space. "SW Textcopy
53
        PERFORM vim_copy_texttab_entry USING <f1_x> <vim_xextract_key>.
54
      ENDIF.
55
      PERFORM vim_store_state_info.
56
      CALL FUNCTION 'VIEWCLUSTER_COPY_DEPENDENT'
57
           EXPORTING
58
                view_name   = x_header-viewname
59
                maintview   = x_header-maintview
60
                status_mode = status-mode
61
                workarea    = extract
62
                new_entry   = <table1>
63
                no_dialog   = vim_external_mode.
64
    ENDIF.
65
    PERFORM nicht_vorhanden USING rc_safe tabix.
66
  ELSE.
67
    IF vim_special_mode EQ vim_upgrade.
68
      PERFORM vim_address_adjust.
69
    ENDIF.
70
    IF vim_called_by_cluster NE space.
71
      CALL FUNCTION 'VIEWCLUSTER_CHECK_MASTER_ENTRY'
72
           EXPORTING
73
                check_entry   = <table1>
74
                view_name     = x_header-viewname
75
           EXCEPTIONS
76
                invalid_key   = 1
77
                invalid_value = 2.
78
      IF sy-subrc NE 0.
79
        IF status-mode EQ list_bild.
80
          SET CURSOR FIELD sy-msgv1 LINE l.
81
        ELSE.
82
          SET CURSOR FIELD sy-msgv1.
83
        ENDIF.
84
        MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno
85
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
86
      ENDIF.
87
    ENDIF.
88
    MOVE exind TO index.
89
    READ TABLE total WITH KEY <f1_x> BINARY SEARCH.
90
    IF vim_special_mode NE vim_upgrade.
91
      PERFORM vorhanden.               "update both tables
92
    ELSE.
93
      PERFORM update_entry USING 'X'.
94
    ENDIF.
95
  ENDIF.
96
  MOVE space TO <status>-upd_flag.
97
ENDFORM.