Properties SourceCde
txt
1
*---------------------------------------------------------------------*
2
*       FORM POPUP_POSITIONIEREN                                      *
3
*---------------------------------------------------------------------*
4
*       ........                                                      *
5
*---------------------------------------------------------------------*
6
FORM popup_positionieren.
7
  DATA: pp_program LIKE sy-repid, hf1 TYPE i, hf2 TYPE i,
8
        dummy type xfeld.
9
 
10
  IF status-action NE anzeigen AND status-action NE transportieren
11
  AND status-mode NE list_bild.
12
    PERFORM update_tab.
13
  ENDIF.
14
  pp_program = sy-repid.
15
  <table1> = <initial>.
16
  CALL FUNCTION 'TABLE_GET_KEY_TO_SET_CUR_ROW'
17
       EXPORTING
18
            table             = x_header-maintview          "Subviews
19
            f4_programname    = pp_program
20
            f4_formname       = 'F4_POSITIONIEREN'
21
       IMPORTING
22
            table_key         = dummy
23
       TABLES
24
            sellist           = <vim_ck_sellist>
25
            exclude_fields    = excl_pos_tab
26
       CHANGING
27
            table_key_new     = <f1_x>
28
       EXCEPTIONS
29
            cancelled_by_user = 01
30
            table_not_found   = 02.
31
  CHECK sy-subrc EQ 0000.
32
  IF x_header-frm_h_flds NE space.
33
    PERFORM (x_header-frm_h_flds) IN PROGRAM.
34
  ENDIF.
35
  IF x_header-frm_rp_pos NE space.
36
    PERFORM (x_header-frm_rp_pos) IN PROGRAM.
37
  ELSEIF status-action EQ hinzufuegen AND status-mode EQ list_bild.
38
    nextline = 0.
39
    LOOP AT extract.
40
      IF <xact> EQ leer. EXIT. ENDIF.
41
*      CHECK <vim_extract_key> LE <f1>.
42
      CHECK <vim_xextract_key> LE <f1_x>.
43
      hf1 = sy-tabix.
44
      CHECK <vim_xextract_key> EQ <f1_x>.
45
      nextline = sy-tabix. EXIT.
46
    ENDLOOP.
47
    IF nextline EQ 0.
48
      IF hf1 EQ maxlines.
49
        nextline = hf1.
50
      ELSE.
51
        nextline = hf1 + 1.
52
      ENDIF.
53
    ENDIF.
54
  ELSE.
55
*    READ TABLE extract WITH KEY <f1> BINARY SEARCH
56
*                                     TRANSPORTING NO FIELDS.
57
    READ TABLE extract WITH KEY <f1_x> BINARY SEARCH
58
                                       TRANSPORTING NO FIELDS.
59
    nextline = sy-tabix.
60
    IF sy-subrc = 8 AND nextline GT 1.
61
      nextline = nextline - 1.                              "last entry
62
    ENDIF.
63
  ENDIF.
64
  IF status-mode EQ detail_bild.
65
    READ TABLE extract INDEX nextline.                      "ufdetailb
66
    IF <xmark> <> markiert.
67
      CLEAR <status>-mark_only.
68
    ENDIF.                                                  "ufdetaile
69
    hf2 = firstline + looplines - 1.
70
    IF looplines EQ 0.
71
      l = 1. MOVE: l TO <status>-cur_line,
72
                   nextline TO <status>-firstline.
73
      hf1 = 0.
74
    ELSEIF nextline GE firstline AND nextline LE hf2.
75
* nothing to scroll.
76
    ELSEIF nextline LT firstline.                  "xb2002 int405493/99
77
*if the nextline less than firstline, move the nextline to firstline.
78
      firstline = nextline.
79
    ELSE.                                           "xb2002 int405493/99
80
* if the nextline larger than firstline, move the nextline to firstline.
81
       firstline = nextline.
82
    ENDIF.
83
    l = nextline - firstline + 1.
84
    MOVE: firstline TO <status>-firstline,
85
          l         TO <status>-cur_line.
86
  ELSE.
87
    MOVE 1 TO l.
88
  ENDIF.
89
ENDFORM.