Properties SourceCde
txt
1
*---------------------------------------------------------------------*
2
*       FORM VIM_SAPSCRIPT_FORM_MAINT.                                *
3
*---------------------------------------------------------------------*
4
*       ........                                                      *
5
*---------------------------------------------------------------------*
6
FORM VIM_SAPSCRIPT_FORM_MAINT.
7
  LOCAL: STATUS-MODE.
8
  DATA: VSFM_TABLE LIKE VIMDESC-VIEWNAME, VSFM_FLAG(1) TYPE C,
9
        VSFM_FIELD LIKE VIMNAMTAB-VIEWFIELD, VSFM_HF TYPE I.
10
 
11
  IF X_HEADER-SCRFRMFLAG EQ SPACE.
12
    MESSAGE E001(SV).
13
    EXIT.
14
  ENDIF.
15
  IF VIM_NBR_OF_SCRFRM_POINTERS GT 1.
16
    IF STATUS-MODE EQ DETAIL_BILD. GET CURSOR FIELD F. ENDIF.
17
    SPLIT F AT '-' INTO VSFM_TABLE VSFM_FIELD.
18
    IF X_HEADER-BASTAB NE SPACE AND X_HEADER-TEXTTBEXST NE SPACE AND
19
       VSFM_TABLE EQ X_HEADER-TEXTTAB.
20
      VSFM_FLAG = 'X'.
21
    ENDIF.
22
    READ TABLE X_NAMTAB WITH KEY VIEWFIELD = VSFM_FIELD
23
                                 TEXTTABFLD = VSFM_FLAG.
24
    IF X_NAMTAB-DOMNAME NE VIM_SCRFORM_DOMAIN.
25
      MESSAGE S161(SV). " Bitte stellen Sie den Cursor auf einen Formula
26
      CLEAR FUNCTION.
27
      EXIT.
28
    ENDIF.
29
*    ASSIGN <TABLE1>+X_NAMTAB-POSITION(X_NAMTAB-FLENGTH)
30
*                                       TO <VIM_SCRFORM_NAME>.
31
    ASSIGN component x_namtab-viewfield of structure <TABLE1>
32
     TO <VIM_SCRFORM_NAME>.
33
    IF STATUS-MODE EQ LIST_BILD.
34
      VSFM_HF = FIRSTLINE + L - 1.
35
      STATUS-MODE = DETAIL_BILD.
36
    ELSE.
37
      VSFM_HF = NEXTLINE.
38
    ENDIF.
39
    READ TABLE EXTRACT INDEX VSFM_HF.
40
    PERFORM MOVE_EXTRACT_TO_VIEW_WA.
41
  ENDIF.
42
  IF STATUS-MODE EQ LIST_BILD.
43
    LOOP AT EXTRACT.
44
      CHECK <XMARK> EQ MARKIERT.
45
      PERFORM MOVE_EXTRACT_TO_VIEW_WA.
46
      CALL FUNCTION 'EDIT_FORM'
47
           EXPORTING
48
                FORM              = <VIM_SCRFORM_NAME>
49
*           LANGUAGE          = SY-LANGU
50
                DISPLAY           = 'X'
51
*           COMPONENT         = 'HEADER'
52
           EXCEPTIONS
53
                UNKNOWN_ACTIVITY  = 1
54
                UNKNOWN_COMPONENT = 2.
55
      IF SY-SUBRC NE 0.
56
        MESSAGE ID SY-MSGID TYPE 'I' NUMBER SY-MSGNO WITH
57
                SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
58
        CONTINUE.
59
      ENDIF.
60
      <XMARK> = NICHT_MARKIERT.
61
      MODIFY EXTRACT.
62
      READ TABLE TOTAL WITH KEY <VIM_xEXTRACT_KEY> BINARY SEARCH.
63
      <MARK> = NICHT_MARKIERT.
64
      MODIFY TOTAL INDEX SY-TABIX.
65
      SUBTRACT: 1 FROM MARK_EXTRACT,
66
                1 FROM MARK_TOTAL.
67
    ENDLOOP.
68
  ELSE.                                "detail bild
69
    CALL FUNCTION 'EDIT_FORM'
70
         EXPORTING
71
              FORM              = <VIM_SCRFORM_NAME>
72
*             LANGUAGE          = SY-LANGU
73
              DISPLAY           = 'X'
74
*             COMPONENT         = 'HEADER'
75
         EXCEPTIONS
76
              UNKNOWN_ACTIVITY  = 1
77
              UNKNOWN_COMPONENT = 2.
78
    IF SY-SUBRC NE 0.
79
      MESSAGE ID SY-MSGID TYPE 'I' NUMBER SY-MSGNO WITH
80
              SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
81
      CLEAR FUNCTION. EXIT.
82
    ENDIF.
83
    IF <XMARK> EQ MARKIERT.
84
      <XMARK> = NICHT_MARKIERT.
85
      MODIFY EXTRACT INDEX NEXTLINE.
86
      READ TABLE TOTAL WITH KEY <VIM_xEXTRACT_KEY> BINARY SEARCH.
87
      <MARK> = NICHT_MARKIERT.
88
      MODIFY TOTAL INDEX SY-TABIX.
89
      SUBTRACT: 1 FROM MARK_EXTRACT,
90
                1 FROM MARK_TOTAL.
91
    ENDIF.
92
  ENDIF.                               "status-mode eq list_bild
93
  CLEAR FUNCTION.
94
ENDFORM.                               "vim_sapscript_form_maint