1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
REPORT zstkeos_table_control.
TYPES:
BEGIN OF gty_mara,
matnr TYPE mara-matnr,
ersda TYPE mara-ersda,
ernam TYPE mara-ernam,
laeda TYPE mara-laeda,
aenam TYPE mara-aenam,
vpsta TYPE mara-vpsta,
pstat TYPE mara-pstat,
lvorm TYPE mara-lvorm,
END OF gty_mara.
TABLES:
mara.
DATA:
gv_ucomm TYPE syucomm,
gv_initialization TYPE char1,
gv_field TYPE char128,
gv_line TYPE systepl.
DATA:
gs_mara TYPE gty_mara,
gt_mara TYPE TABLE OF gty_mara.
CONTROLS:
tc_mara TYPE TABLEVIEW USING SCREEN 0100.
CALL SCREEN 100.
*&---------------------------------------------------------------------*
*& Module TEST_INIT OUTPUT
*&---------------------------------------------------------------------*
MODULE tc_init OUTPUT.
IF gv_initialization IS INITIAL.
SELECT matnr ersda ernam laeda aenam vpsta pstat lvorm
FROM mara INTO TABLE gt_mara
UP TO 100 ROWS.
gv_initialization = 'X'.
REFRESH CONTROL 'tc_mara' FROM SCREEN '0100'.
ENDIF.
IF gv_line IS NOT INITIAL.
SET CURSOR FIELD gv_field LINE gv_line.
ENDIF.
ENDMODULE.
*&---------------------------------------------------------------------*
*& Module TEST_MOVE OUTPUT
*&---------------------------------------------------------------------*
MODULE test_move OUTPUT.
MOVE-CORRESPONDING gs_mara TO mara.
ENDMODULE.
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
SET PF-STATUS '0100'.
SET TITLEBAR '0100'.
ENDMODULE.
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
DATA:
lv_itab_line TYPE i,
lv_matnr TYPE matnr.
gv_ucomm = sy-ucomm.
CLEAR: sy-ucomm.
CASE gv_ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANC'.
LEAVE PROGRAM.
WHEN 'MARA'.
GET CURSOR FIELD gv_field LINE gv_line.
CASE gv_field.
WHEN 'MARA-MATNR'.
lv_itab_line = tc_mara-top_line + gv_line - 1.
READ TABLE gt_mara INTO gs_mara INDEX lv_itab_line.
IF sy-subrc EQ 0.
lv_matnr = gs_mara-matnr.
SET PARAMETER ID 'MAT' FIELD lv_matnr.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDCASE.
ENDMODULE.
|