Вы находитесь на странице: 1из 421

BC400

ABAP
SAP NetWeaver


: 2- 2005 .
: 5 .
: 50072594

SAP- !


2006 . SAP AG All rights reserved. .

SAP AG . ,

, SAP AG. ,
, .
, SAP
AG , ,
.

Microsoft, WINDOWS, NT, EXCEL, Word, PowerPoint SQL Server


Microsoft.

IBM, DB2, OS/2, DB2/6000, Parallel Sysplex, MVS/ESA, RS/6000, AIX,


S/390, AS/400, OS/390 OS/400
IBM.

ORACLE ORACLE.

INFORMIX-OnLine for SAP INFORMIX Dynamic ServerTM


Informix Software Incorporated.

UNIX, X/Open, OSF/1 Motif


Open Group.

Citrix, Citrix logo, ICA, Program Neighborhood, MetaFrame, WinFrame,


VideoFrame, MultiWin Citrix,
, Citrix Systems, Inc.

HTML, DHTML, XML, XHTML


W3C, World Wide Web Consortium, Massachusetts Institute of
Technology.

JAVA Sun Microsystems, Inc.

JAVASCRIPT Sun Microsystems, Inc.,


, Netscape.

SAP, SAP Logo, R/2, RIVA, R/3, SAP ArchiveLink, SAP Business Workflow, WebFlow,
SAP EarlyWatch, BAPI, SAPPHIRE, Management Cockpit, mySAP.com Logo mySAP.com
SAP AG
. ,
,
.

SAP AG " ",


SAP ,
,
,
, , , ,
, .
SAP
, , , ,
,
,

.


. .

,
. ,
, ,
, .

, (
), (
,
, SAPNet).

06-04-2006


, ,
.

. ,
,
, ,
,
,
SELECT INCLUDE.

2006 . SAP AG All rights reserved.


.

iii

iv

BC400

. ,
, ,
,
,
.

. - ,


.

<
>

.
,

.

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

06-04-2006

2006 . SAP AG All rights reserved.


.

vi

2006 . SAP AG All rights reserved.


.

BC400

06-04-2006


................................................................ ix
............................................................. ix
............................................................ x

1: ABAP- .......................... 1
ABAP-
....................................................2

2: ABAP-
................................................................................ 15
.......................... 16
............. 27

3: ABAP- .............................. 57

ABAP- .................................................... 58

4: ABAP ............... 79
.................. 80
............................................107
...............................120

5: ................................................ 145
...............................146
.............................................174

6:
................................................................. 189
.......................190

7: ABAP .................................. 201


......................................................202

8: ABAP ............................. 221


ABAP-.......................................................222

9: ................................... 231
................................................................233

06-04-2006

2006 . SAP AG All rights reserved.


.

vii

BC400

........................................................255
..................................................................275
.........................................322

10: ............. 345


.........................346
.................................................364
BAPI .......................................................384

11: SAP
()..................................................................... 391
SAP
().............................................................392

.............................................. 405

viii

2006 . SAP AG All rights reserved.


.

06-04-2006


SAP- ABAP,
ABAP- .
.
,
.

,
. , ,
-
ABAP- .
,

.

ABAP-
.

;
ABAP.

06-04-2006


SAPTEC (SAP NetWeaver )

2006 . SAP AG All rights reserved.


.

ix

BC400

ABAP-;
;
;
,
ABAP- ;
.

ABAP-
;

;

.


SAP

SAP:

2006 . SAP AG All rights reserved.


.

06-04-2006

1
ABAP-

. .

SAP Web Application Server



ABAP


: ABAP-
...................................................................2

06-04-2006

2006 . SAP AG All rights reserved.


.

1: ABAP-

BC400

ABAP-



SAP Web Application Server.

SAP Web Application Server



ABAP


SAP Web Application Server,
ABAP-.

ABAP-

1: "-" SAP Web Application Server

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

: ABAP-

SAP Web Application Server ,


- "-".
SAP Web Application Server ,

. .
.

(RDBMS). ,
, , SAP-
.
ABAP- ,
, SAP, ,
. ABAP-
, , , .
.
,
, .

. ""

,
. ""

. "" ,
, .

06-04-2006

2006 . SAP AG All rights reserved.


.

1: ABAP-

BC400

2: ABAP-

, ,
.
ABAP-.
,
, ,
ABAP-.
,
. , ,
ABAP-.
ABAP- .

.

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

: ABAP-

3:

,
-
.
. ,
,
ABAP- .
SAP- " ".
, , :
, .
.
,
.
.

06-04-2006

2006 . SAP AG All rights reserved.


.

1: ABAP-

BC400

4:

- , ,
Enter, ,

.

ABAP-.
ABAP-
,
.

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

: ABAP-

5:


. ABAP-
.

6:

06-04-2006

2006 . SAP AG All rights reserved.


.

1: ABAP-

BC400


.
,
ABAP.
,
.
-
, ;
ABAP. ,
, .

ABAP.

7:

, ABAP
.

.
,
.

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

: ABAP-

8:


.

,
ABAP.

ABAP. ABAP
ABAP.
,
.
.

06-04-2006

2006 . SAP AG All rights reserved.


.

1: ABAP-

BC400

9:

ABAP -
.
,
.

10:

10

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

: ABAP-

,

.

,
.

11:

.

.


-
, .
,
.
1
ABAP-
2
ABAP-
3
ABAP-

06-04-2006

2006 . SAP AG All rights reserved.


.

11

1: ABAP-

BC400

4
ABAP
5

6

7
ABAP
8
ABAP
9
(, , ,
)
10

11
SAP ()

12

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

: ABAP-

SAP Web Application Server


ABAP

06-04-2006

2006 . SAP AG All rights reserved.


.

13

BC400

SAP Web Application Server


ABAP


... .
-.

14

2006 . SAP AG All rights reserved.


.

06-04-2006

2
ABAP

. .


: .............................. 16
: ................. 27
: ........................................... 30
: ABAP- .............................. 38
: ...................................... 42
: ........ 43
1: .............................. 47
2: ABAP- .......................... 49
3: .................................. 53

06-04-2006

2006 . SAP AG All rights reserved.


.

15

2: ABAP-

BC400




ABAP- .

.

16

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

12:

: ,
, .
, SAP,
, .
, ..
.
,
,
, . . .

06-04-2006

2006 . SAP AG All rights reserved.


.

17

2: ABAP-

BC400

13:

.
(, MM)
,
.
.
,
.



(.. ) ,

, .

18

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

14:


SAP Easy Access
ABAP- .

, .

15: SAP

06-04-2006

2006 . SAP AG All rights reserved.


.

19

2: ABAP-

BC400


.
.
SAP SAP Easy Access
ABAP-
SAP.
, .


.

.
.

16: ABAP-

20

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

ABAP- ,
.

.
:

ABAP- ;
ABAP- ,
. .;
( ,
);
(
, , ,
);
;
.


, .

.
.

.
,
.

06-04-2006

2006 . SAP AG All rights reserved.


.

21

2: ABAP-

BC400

17:


;


.

,
( ./.).

, (
, ).
,
.

22

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

18:

. ,
,
, .

.
,

( ).
.

06-04-2006

2006 . SAP AG All rights reserved.


.

23

2: ABAP-

BC400

19:


.
,
(
).
, .

.

24

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

20:


. .

:



.

, ,

.


. ,

.

06-04-2006

2006 . SAP AG All rights reserved.


.

25

2: ABAP-

BC400

26

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400


,
, . ,
SAP
ABAP- .


ABAP-
.

06-04-2006

2006 . SAP AG All rights reserved.


.

27

2: ABAP-

BC400

21:

.
, ,
( / )
.
, ,
.
ABAP- .

, .

.
. , ,
,
.

28

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

22:


;

, ; ,
,
(..
);
,
, (=
)
.
( )
, .

,
,
. ,
, ,
( ) .

06-04-2006

2006 . SAP AG All rights reserved.


.

29

2: ABAP-

BC400


1.

.
:
a)
. (
.) Enter.
, .
b)
.
. (F5).
: R/3 4.6
.
.
4.6a/b:
,
1b).

2.

23: ()

(
(F1)):

30

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400




.


HOME.


,
.
,
, .

:

(
);
( );
( ).

24:

06-04-2006

2006 . SAP AG All rights reserved.


.

31

2: ABAP-

3.

BC400

.

, .
.

25:

:
.
:

.

BC400.
.

32

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

ABAP:
ABAP ...

;
;
SQL-;
- ;
;
" ";

-,
.

.

.
Open SQL, ABAP,
.
ABAP- -
ABAP-.
ABAP- . ,


.
, ABAP,
( ).

06-04-2006

2006 . SAP AG All rights reserved.


.

33

2: ABAP-

BC400

26: ABAP- I

ABAP- .
ABAP- .
.
.
.
.
.
ABAP
, .

, .

(
).

ABAP- .

34

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

27: ABAP- II

*.
,
.

, ".

.

06-04-2006

,
.

( ).
,
(, , ).
,
, ,
ABAP -
.

2006 . SAP AG All rights reserved.


.

35

2: ABAP-

BC400

28: ABAP-

ABAP-, SY-SUBRC
ABAP

. ,
. ,
, .
.

36

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

29: ABAP-


ABAP-:

,
, F1.
i ...
, ABAP-.

ABAP-

ABAP- .
.

06-04-2006

2006 . SAP AG All rights reserved.


.

37

2: ABAP-

BC400

ABAP-
1.

.
:
a)
. (
.)
Enter. ,
.
b) , .

.
c)
.
. (F5).

2.


TOP-INCLUDE. (
.)

3.

.

. .
F1.

30: ABAP-

38

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

31:



.
, .

.
.
, , ,
,
.
( ),

.

.
,
.

06-04-2006

2006 . SAP AG All rights reserved.


.

39

2: ABAP-

BC400

;
;
(
);
(
).

32:


( LOAD),
. ,
() .
, ,
:

40


,
. ,
LOAD, .
,
F8,
.

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400


.

.


, ,
.
, ,
.
.

06-04-2006

2006 . SAP AG All rights reserved.


.

41

2: ABAP-

BC400


1.

2.

3.

. (
!)

( ).

4.


.
GUI SAP GUI
Windows.

33:

42

5.

6.

,
.

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400


1.

( SAP Easy Access).

2.

3.

34:

"".
.

06-04-2006

2006 . SAP AG All rights reserved.


.

43

2: ABAP-

BC400

35:

,
,
, .
,
.


. .

44

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

36:
( )

,
.

,
.

.

06-04-2006

2006 . SAP AG All rights reserved.


.

45

2: ABAP-

46

2006 . SAP AG All rights reserved.


.

BC400

06-04-2006

BC400

1:

,



.

.

1:

1.

,
,
.

2.

2:

1.

ZBC400_##.
, .

2.


.
:
.

.
.

06-04-2006

2006 . SAP AG All rights reserved.


.

47

2: ABAP-

BC400

1:
1:

1.

,
,
.
a)

2.

.
a)

2:

1.

ZBC400_##.
, .
a)

2.


.
:
.

.
.
a)

48

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

2:
ABAP-

,

, , ABAP-

ABAP-

ABAP-


ABAP-,
.
SFLIGHT.

1:

1.

ZBC400_##_GS_LIST
TOP-INCLUDE.

2:

1.


( : wa_flight):
DATA wa_flight TYPE sflight.

2.


SFLIGHT:
SELECT * FROM sflight INTO wa_flight.
...
ENDSELECT.

3.

carrid, connid,
fldate, seatsocc seatsmax :
NEW-LINE.
WRITE wa_flight-carrid.
WRITE ...

4.

06-04-2006

.
.

2006 . SAP AG All rights reserved.


.

49

2: ABAP-

BC400

2: ABAP-
1:

1.

ZBC400_##_GS_LIST
TOP-INCLUDE.
a)

2:

1.


( : wa_flight):
DATA wa_flight TYPE sflight.
a)

2.

. .


SFLIGHT:
SELECT * FROM sflight INTO wa_flight.
...
ENDSELECT.
a)

3.

. .

carrid, connid,
fldate, seatsocc seatsmax :
NEW-LINE.
WRITE wa_flight-carrid.
WRITE ...
a)

. .

50

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

4.

.
.
a)

: SAPBC400WBS_GS_LIST

REPORT

sapbc400wbs_gs_list.

DATA wa_flight TYPE sflight.

SELECT * FROM sflight INTO wa_flight.

NEW-LINE.
WRITE:
wa_flight-carrid,
wa_flight-connid,
wa_flight-fldate,
wa_flight-seatsocc,
wa_flight-seatsmax.

ENDSELECT.

06-04-2006

2006 . SAP AG All rights reserved.


.

51

2: ABAP-

52

2006 . SAP AG All rights reserved.


.

BC400

06-04-2006

BC400

3:

,


ABAP-
.

1:

1.

ZBC400_##_GS
ZBC400_##_GS_LIST.
:
( )
.

2.

2:

06-04-2006

1.

ZBC400_##_GS .

2.

2006 . SAP AG All rights reserved.


.

53

2: ABAP-

BC400

3:
1:

1.

ZBC400_##_GS
ZBC400_##_GS_LIST.
:
( )
.
a)

2.


.
a)

2:

1.

ZBC400_##_GS .
a)

2.


.
a)

54

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

06-04-2006

2006 . SAP AG All rights reserved.


.

55

BC400


... . - .

56

2006 . SAP AG All rights reserved.


.

06-04-2006

3
ABAP-

. .



SAP



ABAP-


:
ABAP- .................................................................. 58
4:
......................................................... 69

06-04-2006

2006 . SAP AG All rights reserved.


.

57

3: ABAP-

BC400


ABAP-

,
. ,
ABAP-, ,
(
) ABAP-.



SAP



ABAP-


ABAP-
, ABAP-.

58

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

: ABAP-

37:

-
.
, -.
, .
(Entity
Relationship Model ERM).

( ),
ABAP-.

.
.

06-04-2006

2006 . SAP AG All rights reserved.


.

59

3: ABAP-

BC400

38: ABAP

ABAP, -
ABAP
.
SAPBC_DATAMODEL.

.
,
:


?
?

; . . ,

?

.
, ,

.
, .

, .

60

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

: ABAP-

39:


-, :

;
;
;
;
;
. . .

,
.

.
.


.
,
.

06-04-2006

2006 . SAP AG All rights reserved.


.

61

3: ABAP-

BC400

40:

, ,
ABAP-.
,
.
.
()
.
,

. ( )
. .

. ,
.

ABAP-

: .

62

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

: ABAP-

41:

.
.

. .
, , (
),
,
.

.

06-04-2006

2006 . SAP AG All rights reserved.


.

63

3: ABAP-

BC400

42:

ABAP-
,
.

43: ABAP-

64

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

: ABAP-

.

.
.

44: ABAP-

, ABAP-
,
.
ABAP-
( ),

ABAP-. (
.)

.
,
, .
,
, , ,
,
.
. ,
.

06-04-2006

2006 . SAP AG All rights reserved.


.

65

3: ABAP-

BC400

45:

DATA mycarrid TYPE s_carr_id.


() ,
s_carr_id.

DATA myconnid TYPE sbc400focc-connid.


() ,
sbc400focc-connid.

PARAMETERS pa_carr TYPE spfli-carrid.


, ,
spfli-carrid.

DATA wa_focc TYPE sbc400focc.


,
sbc400focc.

DATA wa_spfli TYPE spfli.


,
spfli.

66

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

: ABAP-

46: PARAMETERS:

,

( PARAMETERS), ,

. F1
F4,
. ABAP-
( ).

06-04-2006

2006 . SAP AG All rights reserved.


.

67

3: ABAP-

68

2006 . SAP AG All rights reserved.


.

BC400

06-04-2006

BC400

: ABAP-

4:



,

(= )
(= ),

ABAP-


ABAP- ,
(= ,
), , .
:
.

. TABLES
MOVE-CORRESPONDING.
.

1:

1.

BC400
.
SAPBC400WBT_GETTING_STARTED
.
.

2.

06-04-2006

2006 . SAP AG All rights reserved.


.

69

3: ABAP-

BC400

2:

1.


? ( F1.)

2.

? ( F4.)

3.

( )?
,

F1.
?

3:

1.

? (
.)

70

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

: ABAP-

2.

? (
F1.)

3.

?
,
ABAP-? (. F1;
.)

4:
(
)
1.

()
(. )?
?

2.

? (
ABAP-.)

06-04-2006

2006 . SAP AG All rights reserved.


.

71

3: ABAP-

3.

72

BC400

?
?

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

: ABAP-

4:

1:

1.

BC400
.
SAPBC400WBT_GETTING_STARTED
.
.
a)

2.

.
a)

2:

1.


? ( F1.)
: .

2.

? ( F4.)
: F4
: AA, LH ..

3.

( )?
,

F1.
?
: PA_CAR
.

06-04-2006

2006 . SAP AG All rights reserved.


.

73

3: ABAP-

BC400

3:

1.

? (
.)
: 100

2.

? (
F1.)
: ,
.

3.

?
,
ABAP-? (. F1;
.)
: SBC400_CARRIER-CARRID SBC400_CARRIER-CURRCODE.
, SBC400_CARRIER,
.
.

4:
(
)
1.

()
(. )?
?
:

.

2.

? (
ABAP-.)
:

, ABAP-

.
.
.

74

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

: ABAP-

3.

?
?
: PA_CAR
.

06-04-2006

2006 . SAP AG All rights reserved.


.

75

3: ABAP-

BC400

SAP

ABAP-

76

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

SAP

ABAP-


... . - ABAP-.

06-04-2006

2006 . SAP AG All rights reserved.


.

77

78

BC400

2006 . SAP AG All rights reserved.


.

06-04-2006

4

ABAP

. .

( )
ABAP-


(
)
ABAP-



ABAP-


: ..................... 80
5: ABAP- ...........................101
: ................................................107
6: ................................ 113
: ..................................120
7: ..................139

06-04-2006

2006 . SAP AG All rights reserved.


.

79

4: ABAP

BC400




( ),
. ,
ABAP-.
ABAP- .

( )
ABAP-



.
,
ABAP-.


.
, .
.

80

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

47:

(, ,
) .
,
.
/ ,
, ,
.

.
ABAP, SAP
( ). : .
ABAP
. ,
, .
ABAP
D
(Date), , 8 ().
T
(Time), , 6 ().

06-04-2006

2006 . SAP AG All rights reserved.


.

81

4: ABAP

BC400

I
(Integer), 4 ().
F
(Floating), 8 ().
STRING
.
XSTRING
(HeXadecimal
string).
(
).
.
ABAP
C
(Character),
.
N
(Numerical character),
.
X
(HeXadecimal string),

P
(Packed number),
.
(
.)

ABAP .
TYPES DATA.

82

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400


.
, ,
. TYPES.

48:

, ABAP-, ,
(..
SAP-).

06-04-2006

2006 . SAP AG All rights reserved.


.

83

4: ABAP

BC400

49:


.
.
: , .
( ).

84

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

50:

DATA.
,
ABAP.

( LIKE).

06-04-2006

2006 . SAP AG All rights reserved.


.

85

4: ABAP

BC400

51:


VALUE.
,
, C.
,
().
, "DATA myvar."
1,
C .
,
,
TYPES DATA.

86

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

52: ( )

,

.
.

. (
) ( ).
.
CONSTANTS.
.
VALUE .
.

. .
.

06-04-2006

2006 . SAP AG All rights reserved.


.

87

4: ABAP

BC400

53:

,
. , ,
. ,
:


,
.
ABAP-
.
, .
,
,
- .

(, ).


, , ,

.

88

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

ABAP-

54:


,
, .

,
VALUE.
MOVE
.
:

MOVE var1 TO var2..


var2 = var1..

var1 var2 ,
.
.

.
MOVE.

06-04-2006

2006 . SAP AG All rights reserved.


.

89

4: ABAP

BC400

CLEAR
.
.
CLEAR.

55:

ABAP
. :

+
*
/
**
DIV
MOD

:
ABAP
.

ABAP. ,
.
length = STRLEN( cityfrom ) .

90

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

.

.
,
:
, , / , , /.

. COMPUTE.

56:

06-04-2006

2006 . SAP AG All rights reserved.


.

91

4: ABAP

BC400

ABAP
, :

IF
. ,
.
, ELSEIF (
), ..
, ELSE, .
ELSEIF ELSE .
.
IF.
CASE
. , CASE,
, WHEN,
. ,
. ,
OTHERS, .
,
WHEN.


.
ENDIF ENDCASE.
:

CASE, IF,
.

92

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

57:

ABAP . DO WHILE
SY-INDEX .
,
. SY-INDEX
, .
/
DO ENDDO
, EXIT.

; .

WHILE ENDWHILE
,
.
.

SELECT
.
( )
LOOP.

06-04-2006

2006 . SAP AG All rights reserved.


.

93

4: ABAP

BC400

58:

MESSAGE
.
.

.
.
DEMO_MESSAGES,
SAP.
-,
WITH.
-
.

MESSAGE . .

94

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

ABAP-

59:


:
a)
.
b) ,
. /
. F8

. (
.)

06-04-2006

2006 . SAP AG All rights reserved.


.

95

4: ABAP

BC400

60:


,
(, ).
:
a) ABAP ( ).
b) /h
Enter.

96

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

61: :


.
.

.

06-04-2006

2006 . SAP AG All rights reserved.


.

97

4: ABAP

BC400

62: :


.
ABAP-:
.
.

.
SAP-.

98

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

63: :

,
.
/

.


.
10
( ).

06-04-2006

2006 . SAP AG All rights reserved.


.

99

4: ABAP

100

2006 . SAP AG All rights reserved.


.

BC400

06-04-2006

BC400

5: ABAP

,


ABAP-
.
. .

1:

1.

ZBC400_##_COMPUTE
TOP-INCLUDE.

2:
( ).
1.

(
: pa_int1, pa_int2) (
: pa_op).

3:
.
1.

,
; :
( : result).

2.


.
CASE.

3.

06-04-2006

2006 . SAP AG All rights reserved.


.

101

4: ABAP

BC400

4:
.
1.


, .
IF.

2.


.
:

.

102

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

5: ABAP-
1:

1.

ZBC400_##_COMPUTE
TOP-INCLUDE.
a)

2:
( ).
1.

(
: pa_int1, pa_int2) (
: pa_op).
a)

. .

3:
.
1.

,
; :
( : result).
a)

2.

. .


.
CASE.
a)

3.

. .

.
a)

. .

4:
.
1.


, .
IF.
a)

. .

06-04-2006

2006 . SAP AG All rights reserved.


.

103

4: ABAP

2.

BC400


.
:

.
a)

. .

: SAPBC400TSS_COMPUTE

REPORT sapbc400tss_compute.

PARAMETERS:
pa_int1

TYPE i,

pa_op(1) TYPE c,
pa_int2

TYPE i.

DATA result TYPE p DECIMALS 2.

IF NOT ( pa_op = + OR
pa_op = - OR
pa_op = * OR
pa_op = / ).

WRITE: Invalid operator!(iop).

ELSEIF pa_op = / AND pa_int2 = 0.

WRITE: No division by zero!(dbz).

ELSE.

CASE pa_op.
WHEN +.
result = pa_int1 + pa_int2.
WHEN -.
result = pa_int1 - pa_int2.
WHEN *.
result = pa_int1 * pa_int2.

104

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

WHEN /.
result = pa_int1 / pa_int2.
ENDCASE.

WRITE: Result:(res), result.

ENDIF.

: WRITE,
, .
.

06-04-2006

2006 . SAP AG All rights reserved.


.

105

4: ABAP

BC400

( )

ABAP-

106

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400




( ) ABAP-.
,
ABAP- .

(
)
ABAP-



ABAP-.

06-04-2006

2006 . SAP AG All rights reserved.


.

107

4: ABAP

BC400

64:

ABAP (
).
, .
. ,
.

DATA .
:

;
(
);
, .

.

.

108

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

65:


TYPES. :
BEGIN OF structure_type_name,
... ,
END OF structure_type_name.
.
TYPE. .
TYPES.
.

.
TYPES DATA.
DATA: BEGIN OF structure_name,
... ,
END OF structure_name.

06-04-2006

2006 . SAP AG All rights reserved.


.

109

4: ABAP

BC400

66:

:
structure_name-component_name.
.

67:

110

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

MOVE-CORRESPONDING

. ,
.
.

MOVE.

68:



.
.

06-04-2006

2006 . SAP AG All rights reserved.


.

111

4: ABAP

112

2006 . SAP AG All rights reserved.


.

BC400

06-04-2006

BC400

6:

,

ABAP-

ABAP- MOVE-CORRESPONDING


ABAP-

.

1:

1.

SAPBC400WBS_GETTING_STARTED.
LH .
/h, Enter.
F8. .

2.

, .
, ,
.
.
: TABLES
sbc400_carrier ,

SBC400_CARRIER.


.

. .

.

3.

06-04-2006

2006 . SAP AG All rights reserved.


.

113

4: ABAP

BC400

2:

1.

WA_SCARR
SELECT? SY-SUBRC
?

2.

WA_SCARR
SBC400_CARRIER. ?

3.

ABAP- CALL SCREEN 100


100. ?

4.

,

Enter.
?
?

114

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

3:

1.


WRITE.
: WRITE
.
.

, . . .

4:

1.

.
WRITE.
WA_SCARR.

.

2.

.
CALL SCREEN
, .

UNAME SBC400_CARRIER.
:
.
CALL SCREEN.
?

06-04-2006

2006 . SAP AG All rights reserved.


.

115

4: ABAP

BC400

6:
1:

1.

SAPBC400WBS_GETTING_STARTED.
LH .
/h, Enter.
F8. .
a)

2.

, .
, ,
.
.
: TABLES
sbc400_carrier ,

SBC400_CARRIER.


.

. .

.
a)

3.


.
a)

2:

1.

WA_SCARR
SELECT? SY-SUBRC
?
: , "0"

116

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

2.

WA_SCARR
SBC400_CARRIER. ?
: : MANDT, CARRID,
CARRNAME CURRCODE.

3.

ABAP- CALL SCREEN 100


100. ?
:
SBC400_CARRIER-CARRID
SBC400_CARRIER-CARRNAME
SBC400_CARRIER-CURRCODE
SBC400_CARRIER-UNAME
SBC400_CARRIER-UZEIT
SBC400_CARRIER-DATUM

4.

,

Enter.
?
?
:
SBC400_CARRIER.
.

3:

1.


WRITE.
: WRITE
.
.

, . . .
a)

06-04-2006

2006 . SAP AG All rights reserved.


.

117

4: ABAP

BC400

4:

1.

.
WRITE.
WA_SCARR.

.

2.

a)

,
,
.... WRITE.

b)

WA_SCARR
.

c)

.
CALL SCREEN
, .

UNAME SBC400_CARRIER.
:
.
CALL SCREEN.
?

118

a)

b)

,
.
.
.

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

(
)

ABAP-

06-04-2006

2006 . SAP AG All rights reserved.


.

119

4: ABAP

BC400




ABAP-.
ABAP- .


ABAP-




ABAP-.

69: :

120

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

,

( ).
.
ABAP
. ,
- .

.

.
,
, .
,
.
:


;
(,
);

(, ,
).

70:

06-04-2006

2006 . SAP AG All rights reserved.


.

121

4: ABAP

BC400


. ,
, .
.


. ,
, .
,
. ,
, ,
.

:
, - .
,
.
.

71:


,
.
,
.

122

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

,
:

()
. ,
.
,
, , .


.
.
, .
,
, , ,
.

-
.
. -
.
,
,
.

, (
)
.

06-04-2006

2006 . SAP AG All rights reserved.


.

123

4: ABAP

BC400

72:

.
ABAP- .
,
ABAP-,
.

ABAP- . -,
"i"
.

124

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

73:

,
,
.
,
, , ,
.

. TYPES.
, .
DATA TYPES.

(SBC400_T_SBC400FOCC), ,
, (SBC400FOCC).
.

06-04-2006

2006 . SAP AG All rights reserved.


.

125

4: ABAP

BC400

74:


.

.

75:


:
: ( );

126

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

: (
);
: (
).
: , ,
,
,
.
:
:
DATA itab TYPE TABLE OF <_> .
,
( )!

76: :

06-04-2006

2006 . SAP AG All rights reserved.


.

127

4: ABAP

BC400

77: ()

, ,
,
.

.
APPEND
.

.
INSERT
.

,
, -
-.
READ
.
MODIFY

.

128

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

DELETE
.
COLLECT
,
.
. ,
,
.

ABAP- .
.

78: ()

LOOP . . . ENDLOOP
LOOP
, INTO. LOOP

.
DELETE
,
<>.

06-04-2006

2006 . SAP AG All rights reserved.


.

129

4: ABAP

BC400

INSERT

.
APPEND

.

ABAP- .
.

79: :




INSERT.
- .
.

130

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

80: :


LOOP.
sy-tabix
.

WRITE .

,
, MODIFY
.
:
MODIFY itab FROM wa.

06-04-2006

2006 . SAP AG All rights reserved.


.

131

4: ABAP

BC400

81: :


FROM-TO.

.
READ
TABLE. , ,
INDEX.
,
, (. .
).

132

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

82: :


WHERE.
, CARRID LH.
: ,
,
, CARRID
.
READ TABLE,
,
.
WITH TABLE KEY
.
, sy-subrc
"0".
: ,
,
-.

06-04-2006

2006 . SAP AG All rights reserved.


.

133

4: ABAP

BC400

, WITH
TABLE KEY .
WITH
KEY.

83: :

SORT
-
. (ASCENDING DESCENDING)
, .
,
.

AS TEXT . -
, b, z,
.
STABLE, ,
,
, .
.
SORT.

:

134

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

REFRESH
.

.
CLEAR
( ,
) CLEAR ,
REFRESH.
(. )

.
FREE

,
. FREE ,

. ,

.

84:

06-04-2006

2006 . SAP AG All rights reserved.


.

135

4: ABAP

BC400



.

.
Enter.

85:

WITH HEADER LINE


.
( )
,
. ,
,

136

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

, , .
,
.

,
, .

:

( ,
);
ABAP- (-
ABAP).

.

, ,
.
:
itab

itab- .
itab[] .
.
DATA itab1 TYPE TABLE OF scarr WITH HEADER LINE.
DATA itab2 LIKE itab1.
itab1 = itab2 .

itab1[] = itab2[] .


,
.
DATA: BEGIN OF itab OCCURS n,
field1 TYPE ... ,
field2 TYPE ... ,
... ,
END OF itab.

06-04-2006

2006 . SAP AG All rights reserved.


.

137

4: ABAP

138

2006 . SAP AG All rights reserved.


.

BC400

06-04-2006

BC400

7:

ABAP-


,
SPFLI,
.

1:

1.

ZBC400_##_ITAB_LOOP
TOP-INCLUDE.

2.


SPFLI.
,
SPFLI.
ABAP- ,
.
:
SPFLI ABAP-.
SPFLI
. (
.)

3.

( : it_spfli)
.

4.


( : wa_spfli).

06-04-2006

2006 . SAP AG All rights reserved.


.

139

4: ABAP

BC400

2:

1.


SPFLI :
SELECT * FROM spfli INTO TABLE it_spfli.

2.

140


LOOP.

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

7:

1:

1.

ZBC400_##_ITAB_LOOP
TOP-INCLUDE.
a)

2.


SPFLI.
,
SPFLI.
ABAP- ,
.
:
SPFLI ABAP-.
SPFLI
. (
.)
a)

3.

( : it_spfli)
.
a)

4.

. .


( : wa_spfli).
a)

. .

2:

1.


SPFLI :
SELECT * FROM spfli INTO TABLE it_spfli.
a)

. .

06-04-2006

2006 . SAP AG All rights reserved.


.

141

4: ABAP

2.

BC400


LOOP.
a)

. .

: SAPBC400TSS_ITAB_LOOP

REPORT sapbc400tss_itab_loop.
DATA
DATA

it_spfli TYPE sbc400_t_spfli.


wa_spfli LIKE LINE OF it_spfli.

SELECT * FROM spfli INTO TABLE it_spfli.


* at least one dataset selected
IF sy-subrc = 0.

LOOP AT it_spfli INTO wa_spfli.


WRITE: / wa_spfli-carrid,
wa_spfli-connid,
wa_spfli-cityfrom,
wa_spfli-cityto,
wa_spfli-deptime,
wa_spfli-arrtime.
ENDLOOP.
ENDIF.

142

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

ABAP-

06-04-2006

2006 . SAP AG All rights reserved.


.

143

BC400

( )

ABAP-

(
)

ABAP-

ABAP-


... . - ABAP-.

144

2006 . SAP AG All rights reserved.


.

06-04-2006

5


. .





SAP


: ...................................146
8: SELECT .163
9:
......................................................................169
: .................................................174
10: ...............................181

06-04-2006

2006 . SAP AG All rights reserved.


.

145

5:

BC400




. ,
,
.

,
.

146

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

86: ()

SQL (Structured Query Language) ,


,
.

SQL, .. Native SQL, .
, ABAP- Native SQL
SAP- (-
SAP-).
Open SQL SAP SQL ABAP,
. Open
SQL Native
SQL , ,
. ABAP
,
.

06-04-2006

2006 . SAP AG All rights reserved.


.

147

5:

BC400

87:


.

.

88: ()

148

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

Open SQL SELECT


. SELECT ,
:

SELECT, ,
, .
FROM (
), .
INTO ,
.
WHERE ,
.

.
SELECT.

89:

SELECT SINGLE
.
, WHERE .
: ,
. ( ,
SELECT CLIENT
SPECIFIED. .)

06-04-2006

2006 . SAP AG All rights reserved.


.

149

5:

BC400

*
.
, * .
.
INTO ,
.

.

SY-SUBRC 0.

90:



SELECT (. ). INTO
,
( , ), ..
, .
.
.

INTO.
INTO (field_1, ... , field_n)

150

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

91: ,


, ,
, ( ,
), CORRESPONDING
FIELDS OF.
. ,
, (
MOVE) () ,
(
).
:

06-04-2006


, .
,

,
(, , ).

2006 . SAP AG All rights reserved.


.

151

5:

BC400

92:

SELECT

.
WHERE ,

, .
WHERE AND OR.

.
.

.

SELECT(.. ENDSELECT).
, SY-SUBRC 0.
SY-DBCNT .

152

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

93:

,

INTO TABLE. .


, .
,
ENDSELECT .
SELECT, ,
,
, .
, INTO TABLE
INTO CORRESPONDING FIELDS
OF TABLE . , ,
, .
, ,
,
.
,
, . ,
, APPENDING TABLE .

06-04-2006

2006 . SAP AG All rights reserved.


.

153

5:

BC400


, SY-SUBRC .
SY-DBCNT .

94: ,

,
( CLNT) ,
, .

,
.
, .

WHERE.
, CLIENT
SPECIFIED FROM.

,
.

154

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

95: :


,
.

ABAP- .
.

(.. ).
,
.

.

,
.
SELECT .

06-04-2006

2006 . SAP AG All rights reserved.


.

155

5:

BC400


.
, ,
, .
: , ,
,
.

,
(Outlook)

.
, ,
.
, SAP,
.

96:

156

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

,
:


(= ,
, )


(= , SAP-,
,
)

BAPI
(= -, , )


- ABAP-
,
ABAP, BC405.
.

.

.
SPFLI.

, SCARR.
,

SELECT.

06-04-2006

2006 . SAP AG All rights reserved.


.

157

5:

BC400

97:

98:

158

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400


,
?

99:

06-04-2006

2006 . SAP AG All rights reserved.


.

159

5:

BC400

ABAP- ,
, .
-
ABAP- ABAP-.


(ABAP-).

.
.
FROM SELECT.
:
-
.

.
.

100:

160

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

SELECT, Open SQL


UPDATE, INSERT, DELETE MODIFY.
, ,
SAP;
.
SAP BC414.

06-04-2006

2006 . SAP AG All rights reserved.


.

161

5:

162

2006 . SAP AG All rights reserved.


.

BC400

06-04-2006

BC400

8:
SELECT

,


ABAP- ,
,
.

.

1:

1.

ZBC400_##_GS_LIST (

) SAPBC400WBS_GS_LIST

ZBC400_##_SELECT_SFLIGHT.

2.

( : wa_flight).
SBC400FOCC
. .

3.

4.

SFLIGHT
.
,
.

5.

SFLIGHT?
SELECT WHERE?
( )?

06-04-2006

2006 . SAP AG All rights reserved.


.

163

5:

BC400

2:

164

1.


.
PERCENTAGE .

2.

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

8:
SELECT
1:

1.

ZBC400_##_GS_LIST (

) SAPBC400WBS_GS_LIST

ZBC400_##_SELECT_SFLIGHT.
a)

2.

( : wa_flight).
SBC400FOCC
. .
a)

. .
SBC400FOCC
:
- CARRID S_CARR_ID;
- CONNID S_CONN_ID;
- FLDATE S_DATE;
- SEATSMAX S_SEATSMAX;
- SEATSOCC S_SEATSOCC
- PERCENTAGE S_FLGHTOCC.
,
,
SFLIGHT. SFLIGHT
PERCENTAGE,
.

3.

.
a)

. .

06-04-2006

2006 . SAP AG All rights reserved.


.

165

5:

4.

SFLIGHT
.
,
.
a)

5.

BC400

. .

SFLIGHT?
SELECT WHERE?
( )?
a)

SFLIGHT
MANDT.
WHERE, ( )

. ,
MANDT, CARRID. ,

(,
).
:
:

,
, ,

,
.
WHERE
mandt = sy-mandt. (
sy-mandt.)

2:

1.


.
PERCENTAGE .
a)

. .

166

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

2.


.
a)

. .

: SAPBC400DDS_SELECT_SFLIGHT
REPORT sapbc400dds_select_sflight.
DATA

wa_flight TYPE sbc400focc.

PARAMETERS pa_car TYPE s_carr_id.

* Select all flights belonging to carrier PA_CAR :


SELECT carrid connid fldate seatsmax seatsocc
FROM sflight
INTO CORRESPONDING FIELDS OF wa_flight
WHERE carrid = pa_car.

* Calculate occupation of each flight:


wa_flight-percentage =
100 * wa_flight-seatsocc / wa_flight-seatsmax.

* Create list:
WRITE: / wa_flight-carrid,
wa_flight-connid,
wa_flight-fldate,
wa_flight-seatsmax,
wa_flight-seatsocc,
wa_flight-percentage, %.
ENDSELECT.
IF sy-subrc NE 0.
WRITE: No , pa_car, flights found !.
ENDIF.

06-04-2006

2006 . SAP AG All rights reserved.


.

167

5:

168

2006 . SAP AG All rights reserved.


.

BC400

06-04-2006

BC400

9:


,


ABAP- ,
.

1:

1.

ZBC400_##_SELECT_SFLIGHT
( )
SAPBC400DDS_SELECT_SFLIGHT
ZBC400_##_SELECT_SFLIGHT_ITAB.

2.

( : it_flight)
,
SBC400FOCC.
: SBC400FOCC

(, ).

3.

SFLIGHT
, (
INSERT).

2:

06-04-2006

1.


( ).

2.

LOOP
.

2006 . SAP AG All rights reserved.


.

169

5:

BC400

9:

1:

1.

ZBC400_##_SELECT_SFLIGHT
( )
SAPBC400DDS_SELECT_SFLIGHT
ZBC400_##_SELECT_SFLIGHT_ITAB.
a)

2.

( : it_flight)
,
SBC400FOCC.
: SBC400FOCC

(, ).
a)

3.

SFLIGHT
, (
INSERT).
a)

. .

2:

1.


( ).
a)

2.

. .

LOOP
.
a)

. .

: SAPBC400DDS_SELECT_SFLIGHT_TAB

170

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

REPORT sapbc400dds_select_sflight_tab.

DATA: it_flight TYPE sbc400_t_sbc400focc,


wa_flight LIKE LINE OF it_flight.

PARAMETERS pa_car TYPE s_carr_id.


* Select all flights belonging to PA_CAR :
SELECT carrid connid fldate seatsmax seatsocc
FROM sflight
INTO CORRESPONDING FIELDS OF wa_flight
WHERE carrid = pa_car.

* Calculate occupation of flight


wa_flight-percentage =
100 * wa_flight-seatsocc / wa_flight-seatsmax.
* Insert flight into internal table
INSERT wa_flight INTO TABLE it_flight.

* If you are using standard tables, "APPEND wa_flight TO it_flight."


* would be the same as the above INSERT-statement.
ENDSELECT.

IF sy-subrc = 0.

* Sort internal table


SORT it_flight BY percentage.

* Create list
LOOP AT it_flight INTO wa_flight.
WRITE: / wa_flight-carrid,
wa_flight-connid,
wa_flight-fldate,
wa_flight-seatsocc,
wa_flight-seatsmax,
wa_flight-percentage, %.
ENDLOOP.

ELSE.

WRITE: No , pa_car, flights found !.

06-04-2006

2006 . SAP AG All rights reserved.


.

171

5:

BC400

ENDIF.

172

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

06-04-2006

2006 . SAP AG All rights reserved.


.

173

5:

BC400

SAP


SAP-
.

,
. SAP
.

174

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

101: SAP

102: ()

06-04-2006

2006 . SAP AG All rights reserved.


.

175

5:

BC400

.

( ).
.
.

( ).

103: ( )



AUTHORITY-CHECK .

(sy-subrc):
sy-subrc = 0: ->
(, SELECT);
Else: ->
.
: ,
.

, .

176

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

,
,
,
, ,
.
,
.

104:

,
()
. ACTVT ()
,
(, , ..).

.
SU20.
ACTVT .
SU21

. ACTVT,

. ,
.

06-04-2006

2006 . SAP AG All rights reserved.


.

177

5:

BC400

, .
.

105: ( )

,
.
, ,
. .
.
,
S_CARRID,
CARRID () ,
, ACTVT () "03"
().
.
, TACTZ ,
.

178

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

AUTHORITY-CHECK
sy-subrc
.
: -
, AUTHORITY-CHECK,
DUMMY .
"DUMMY"
, .
:

.
,
.
:
AUTHORITY-CHECK OBJECT S_CARRID
ID CARRID DUMMY
ID ACTVT

FIELD 02.

106:

06-04-2006

2006 . SAP AG All rights reserved.


.

179

5:

BC400


AUTHORITY-CHECK,
.
sy-subrc.

180

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

10:

,


ABAP- ,
,
,
.

1:

1.

ZBC400_##_SELECT_SFLIGHT
(
) SAPBC400DDS_SELECT_SFLIGHT
ZBC400_##_AUTHORITY_CHECK.

2.



.
S_CARRID.
:
ABAP-.
ACTVT.

3.

(
: actvt_display;
ACTIV_AUTH). .

4.


.

.

5.

AA UA.

06-04-2006

2006 . SAP AG All rights reserved.


.

181

5:

BC400

2:

182

1.


ZBC400_##_SELECT_SFLIGHT_ITAB (
)
SAPBC400DDS_SELECT_SFLIGHT_ITAB
ZBC400_##_AUTHORITY_CHECK_2.

2.

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

10:
1:

1.

ZBC400_##_SELECT_SFLIGHT
(
) SAPBC400DDS_SELECT_SFLIGHT
ZBC400_##_AUTHORITY_CHECK.
a)

2.



.
S_CARRID.
:
ABAP-.
ACTVT.
a)

3.

(
: actvt_display;
ACTIV_AUTH). .
a)

4.

. .


.

.
a)

5.

. .

. .

AA UA.
a)

06-04-2006

2006 . SAP AG All rights reserved.


.

183

5:

BC400

2:

1.


ZBC400_##_SELECT_SFLIGHT_ITAB (
)
SAPBC400DDS_SELECT_SFLIGHT_ITAB
ZBC400_##_AUTHORITY_CHECK_2.
a)

2.

.
a)

. .

: SAPBC400DDS_AUTHORITY_CHECK

REPORT sapbc400dds_authority_check.
CONSTANTS actvt_display TYPE activ_auth VALUE 03.

DATA wa_flight TYPE sbc400focc.


PARAMETERS pa_car TYPE s_carr_id.

* Authority Check: User authorized to read data of the specified carrier?


AUTHORITY-CHECK OBJECT S_CARRID
ID CARRID FIELD pa_car
ID ACTVT

FIELD actvt_display.

CASE sy-subrc.

WHEN 0.

" user is authorized

SELECT carrid connid fldate seatsmax seatsocc


FROM sflight
INTO CORRESPONDING FIELDS OF wa_flight
WHERE carrid = pa_car.
wa_flight-percentage =
100 * wa_flight-seatsocc / wa_flight-seatsmax.
WRITE: / wa_flight-carrid COLOR COL_KEY,
wa_flight-connid COLOR COL_KEY,
wa_flight-fldate COLOR COL_KEY,

184

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

wa_flight-seatsocc,
wa_flight-seatsmax,
wa_flight-percentage, %.
ENDSELECT.

WHEN OTHERS.

" user is not authorized

WRITE: / Authority-Check Error(001).


ENDCASE.

2 . :
SAPBC400DDS_AUTHORITY_CHECK_2

06-04-2006

2006 . SAP AG All rights reserved.


.

185

5:

BC400

SAP

186

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

SAP


... . - ABAP-.

06-04-2006

2006 . SAP AG All rights reserved.


.

187

188

BC400

2006 . SAP AG All rights reserved.


.

06-04-2006

6



. .


: ...........................190

06-04-2006

2006 . SAP AG All rights reserved.


.

189

6:

BC400




,
.
.
.


,

.



.

.
,
,
.
,
.

190

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

107:

108:

06-04-2006

2006 . SAP AG All rights reserved.


.

191

6:

BC400


( ).
.

.
,
.
.
,
, .
DEFAULT,
SAP.
.
.
.

109:


.
:
ABAP
ABAP-, .

192

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

, ( ),
.
.
,
.
,
,
.

ABAP-
.
:

,
,
.



, .

:

?
SELECT ?

,
?
WHERE
SELECT?

06-04-2006

2006 . SAP AG All rights reserved.


.

193

6:

BC400


sy-subrc
AUTHORITY-CHECK?
CLIENT SPECIFIED?
( E)
?

:

110:

194

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

111:


. "i"

.
.

06-04-2006

2006 . SAP AG All rights reserved.


.

195

6:

BC400

112:


SCI (. ). SCI :

, ,
;
,
(, );
,
.
: ,
.
,
. ,

,
.


. .
:

196

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

113:

06-04-2006

2006 . SAP AG All rights reserved.


.

197

6:

BC400

198

-
ABAP- .

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400


... . - ABAP- .

06-04-2006

2006 . SAP AG All rights reserved.


.

199

200

BC400

2006 . SAP AG All rights reserved.


.

06-04-2006

7
ABAP

. .


: ..........................................................202
11: ........................................215

06-04-2006

2006 . SAP AG All rights reserved.


.

201

7: ABAP

BC400



ABAP-. ,

.

114: ()

202

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400


,
.


(. ).


,
.
,
(
). ,

.
.

115: ( 1)

06-04-2006

2006 . SAP AG All rights reserved.


.

203

7: ABAP

BC400

116: ( 2)

() , ,
.

, -,
.
-
,
.

(
),
.
.

204

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

117:

,
,
.
:

.
.
,
,
.

( )
( ).
, ,
, .

06-04-2006

2006 . SAP AG All rights reserved.


.

205

7: ABAP

BC400


,
.
, ,
.
STOP
.


.
,
,
.


. ,
.

.

.

206

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

118:

FORM.
FORM .
.
ENDFORM.


( : f1, f2, f3) , ,
.
:

,
(: f1),
VALUE USING . (.
.)

,
( :
f1), VALUE CHANGING . (.
.)

06-04-2006

2006 . SAP AG All rights reserved.


.

207

7: ABAP

BC400


,
( : f3),
VALUE CHANGING . (.
.)
: VALUE,
USING , .

,
, (
USING),
.
,
VALUE, USING CHANGING.
.
, , a
f1, b f2, c f3.

119:

,
TYPE ANY .
.

208

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

(
).
,
( ).
,

( ).

TYPE.
,
.

. ,
.
, N, C X
.
(.. )
.

120:


.
(
),

06-04-2006

2006 . SAP AG All rights reserved.


.

209

7: ABAP

BC400

.

.
:

.

121:

, ,
. (.. )
.
, , ,
,
.

.

. ,

,
,

210

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

. .

, .

, , :
f_...
l_... .

122: :

it_flightinfo
carrid , ,
.
.

.
f_itab. - ,
f_itab .

06-04-2006

2006 . SAP AG All rights reserved.


.

211

7: ABAP

BC400

123:

PERFORM ,
.
, .
.
.

.
( ,
ABAP-.)

.

212

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

124:

,
.
.

.
,

.
.

06-04-2006

2006 . SAP AG All rights reserved.


.

213

7: ABAP

214

2006 . SAP AG All rights reserved.


.

BC400

06-04-2006

BC400

11:

,


, ,
,
.

1:

1.

ZBC400_##_SELECT_SFLIGHT_ITAB

SAPBC400DDS_AUTHORITY_CHECK_2
ZBC400_##_SUBROUTINE.

2.

.
( :
WRITE_LIST)
,
.

3.

LOOP.

( : wa).

2:

06-04-2006

1.

2.

2006 . SAP AG All rights reserved.


.

215

7: ABAP

BC400

11:
1:

1.

ZBC400_##_SELECT_SFLIGHT_ITAB

SAPBC400DDS_AUTHORITY_CHECK_2
ZBC400_##_SUBROUTINE.
a)

2.

.
( :
WRITE_LIST)
,
.
a)

3.

. .

LOOP.

( : wa).
a)

. .

2:

1.


.
a)

2.

. .

.
a)

: SAPBC400PBS_SUBROUTINE
REPORT

sapbc400pbs_subroutine.

CONTSTANTS actvt_display TYPE activ_auth VALUE 03.


DATA: it_flight TYPE sbc400_t_sbc400focc,
wa_flight LIKE LINE OF it_flight.

216

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

PARAMETERS pa_car TYPE s_carr_id.

* Authority Check:
AUTHORITY-CHECK OBJECT S_CARRID
ID CARRID FIELD pa_car
ID ACTVT

FIELD actvt_display.

CASE sy-subrc.

WHEN 0.

" User is authorized

SELECT carrid connid fldate seatsmax seatsocc FROM sflight


INTO CORRESPONDING FIELDS OF wa_flight
WHERE carrid = pa_car.

wa_flight-percentage =
100 * wa_flight-seatsocc / wa_flight-seatsmax.

APPEND wa_flight TO it_flight.


ENDSELECT.
IF sy-subrc = 0.
SORT it_flight BY percentage.
PERFORM write_list USING it_flight.
ELSE.
WRITE: No , pa_car, flights found !.
ENDIF.
WHEN OTHERS.

" User is not authorized

WRITE: / Authority-Check Error(001).


ENDCASE.

*&--------------------------------------------------------------*
*&

Form

WRITE_LIST

*&--------------------------------------------------------------*
*

--> P_IT_FLIGHT

*---------------------------------------------------------------*
FORM write_list USING p_it_flight TYPE sbc400_t_sbc400focc.
DATA wa LIKE LINE OF p_it_flight.
LOOP AT p_it_flight INTO wa.

06-04-2006

2006 . SAP AG All rights reserved.


.

217

7: ABAP

BC400

WRITE: / wa-carrid COLOR COL_KEY,


wa-connid COLOR COL_KEY,
wa-fldate COLOR COL_KEY,
wa-seatsocc,
wa-seatsmax,
wa-percentage, %.
ENDLOOP.
ENDFORM.

218

" WRITE_LIST

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

06-04-2006

2006 . SAP AG All rights reserved.


.

219

BC400


... . - ABAP-.

220

2006 . SAP AG All rights reserved.


.

06-04-2006

8
ABAP

. .


ABAP-


: ABAP- ..........................................................222

06-04-2006

2006 . SAP AG All rights reserved.


.

221

8: ABAP

BC400

ABAP-

ABAP-
. ,
.


ABAP-


(. . )
.

222

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

: ABAP-

ABAP-

125: ABAP-

ABAP-
( ).
.

, .
, ,
,
. ABAP-
,
.
, WRITE,

START-OF-SELECTION.

06-04-2006

2006 . SAP AG All rights reserved.


.

223

8: ABAP

BC400

126: ABAP-

INITIALIZATION PARAMETERS
,
() . DEFAULT

PARAMETERS.
INITIALIZATION
(
) (. . ).
.
F8
,
PARAMETERS,
AT SELECTION-SCREEN . ,
.
"E" (,
)
(
). ,
.

224

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

: ABAP-

AT SELECTION-SCREEN
, START-OF-SELECTION
.
.

127:

.

(DEFAULT sy-datum). (IF)
,
(pa_date = pa_date + 7.).

.
- , .

06-04-2006

2006 . SAP AG All rights reserved.


.

225

8: ABAP

BC400

128:

,
ABAP-.
, -
, .

ABAP.
.
,
START-OF-SELECTION .
,
.
,
,
. , AT LINE-SELECTION,
.
, ,
. ,
.
. ABAP.

ABAP-.

226

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

: ABAP-

129: ()

,
. , ( FORM ...
ENDFORM. ) ,
, PERFORM.
,
. ,
.. .
(),
(,
, )
, .
(PBO)
(PAI). .
ABAP-,
,
( MODULE ... ENDMODULE. ).
.

06-04-2006

2006 . SAP AG All rights reserved.


.

227

8: ABAP

BC400


ABAP-

228

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400


ABAP-


... . -
ABAP-.

06-04-2006

2006 . SAP AG All rights reserved.


.

229

230

BC400

2006 . SAP AG All rights reserved.


.

06-04-2006

9


. .

ABAP-







GUI-
GUI- ( ,
)


: ....................................................................233
12: ..................................................247
: ...........................................................255
13: .........................................269
: .....................................................................275

06-04-2006

2006 . SAP AG All rights reserved.


.

231

9:

BC400

14: ...........................303
15: : ...........................309
16: :
.......................................................................315
: .............................................322
17: ...............................335

232

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400



ABAP-. ,

, ,
( ).

ABAP-



,

.

06-04-2006

2006 . SAP AG All rights reserved.


.

233

9:

BC400

130:


.
-:

:
,
.
.

234

: .

/:
HTML.
: SAP-,
(,
).

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

131:

GUI :

.
,
.

06-04-2006

2006 . SAP AG All rights reserved.


.

235

9:

BC400

132:


.
,
( ).

.
.

.
.
(
) .
, ,
, ,
.

236

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

133:

, ,
.

, (
).
ABAP-
.


.
- xxx .
, .

.

06-04-2006

ABAP-
,

, ,
( ).

2006 . SAP AG All rights reserved.


.

237

9:

BC400


TEXT-xxx . (.
)
.

TEXT-xxx : ...(xxx)
. ... ,
.
: ,
.

134:

,
.
WRITE, SKIP
ULINE. .
ABAP.

238

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

135:


F2 ABAP- AT
LINE-SELECTION . ,
( ) ,
,
.

WRITE.
, ,
.
F3
.
: AT
LINE-SELECTION,
.
,
.

06-04-2006

2006 . SAP AG All rights reserved.


.

239

9:

BC400

136:

AT LINE-SELECTION
. ,
. ,

,
. sy-lsind .
: 0
, 1 . .
sy-lsind ,
: sy-lsind
;
sy-lsind .
20 .
sy-lsind AT
LINE-SELECTION (, CASE).
WRITE .
AT LINE-SELECTION
, sy-lsind
. ,
.

240

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

137:

- :

06-04-2006


sy-lsind, .

1- sy-lsind,
.

, 2-
sy-lsind, .
sy-lsind
3, .
sy-lsind
, .

2006 . SAP AG All rights reserved.


.

241

9:

BC400

138:

,
:


.
SPFLI.

.
SFLIGHT.

(
) , ,
AT
LINE-SELECTION. .

242

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

139:


.
, ,
.


HIDE (: HIDE: wa_spfli-carrid,
wa_spfli-connid.),
.

(: wa_spfli-carrid wa_spfli-connid),
AT LINE-SELECTION. .
: HIDE
WRITE . ,
HIDE
, ,
. HIDE
.

06-04-2006

2006 . SAP AG All rights reserved.


.

243

9:

BC400

140:

: ,
,
. ,

WRITE.
AT LINE-SELECTION
-. (: )
,
.

244

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

141: ( )

: -
SAPBC400UDD_DETAIL_LIST
BC400.

06-04-2006

2006 . SAP AG All rights reserved.


.

245

9:

246

2006 . SAP AG All rights reserved.


.

BC400

06-04-2006

BC400

12:

,

1:

1.

ZBC400_##_SELECT_SFLIGHT
SAPBC400DDS_AUTHORITY_CHECK
ZBC400_##_DETAIL_LIST.

2.

,

( ).

3.

2:

1.


.
.

2.

SBOOK

.
:
BOOKID, CUSTOMID, CUSTTYPE, CLASS, ORDER_DATE,
SMOKER, CANCELLED.

06-04-2006

2006 . SAP AG All rights reserved.


.

247

9:

3.

BC400

: LOCCURAM
LOCCURKEY:
CURRENCY WRITE, ,
LOCCURAM LOCCURKEY.
:
WRITE: wa_sbook-loccuram
CURRENCY wa_sbook-loccurkey,
wa_sbook-loccurkey.

4.

248

: BOOKID
COL_KEY.

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

12:
1:

1.

ZBC400_##_SELECT_SFLIGHT
SAPBC400DDS_AUTHORITY_CHECK
ZBC400_##_DETAIL_LIST.
a)

2.

,

( ).
a)

3.

. .


.
a)

. .

2:

1.


.
.
a)

2.

. .

SBOOK

.
:
BOOKID, CUSTOMID, CUSTTYPE, CLASS, ORDER_DATE,
SMOKER, CANCELLED.
a)

. .

06-04-2006

2006 . SAP AG All rights reserved.


.

249

9:

3.

BC400

: LOCCURAM
LOCCURKEY:
CURRENCY WRITE, ,
LOCCURAM LOCCURKEY.
:
WRITE: wa_sbook-loccuram
CURRENCY wa_sbook-loccurkey,
wa_sbook-loccurkey.
a)

4.

. .

: BOOKID
COL_KEY.
a)

. .

( ):
SAPBC400UDS_DETAIL_LIST

REPORT

sapbc400uds_detail_list.

CONSTANTS actvt_display TYPE activ_auth VALUE 03.


DATA: wa_flight TYPE sbc400focc,
wa_sbook

TYPE sbook.

PARAMETERS pa_car TYPE s_carr_id.

START-OF-SELECTION.
AUTHORITY-CHECK OBJECT S_CARRID
ID CARRID FIELD pa_car
ID ACTVT

FIELD actvt_display.

CASE sy-subrc.
WHEN 0.
SELECT carrid connid fldate seatsmax seatsocc FROM sflight
INTO CORRESPONDING FIELDS OF wa_flight
WHERE carrid = pa_car.

250

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

wa_flight-percentage =
100 * wa_flight-seatsocc / wa_flight-seatsmax.
WRITE: / wa_flight-carrid,
wa_flight-connid,
wa_flight-fldate,
wa_flight-seatsocc,
wa_flight-seatsmax,
wa_flight-percentage,%.
*

Hide key values of the current line


HIDE: wa_flight-carrid, wa_flight-connid, wa_flight-fldate.
ENDSELECT.
IF sy-subrc NE 0.
WRITE: No , pa_car, flights found !.
ENDIF.
WHEN OTHERS.
WRITE: / Authority-Check Error(001).
ENDCASE.
CLEAR wa_flight.

AT LINE-SELECTION.
IF sy-lsind = 1.

WRITE: / wa_flight-carrid,
wa_flight-connid,
wa_flight-fldate.
ULINE.
SKIP.
*

Reading bookings of the selected flight


SELECT bookid customid custtype class order_date
smoker cancelled
FROM sbook INTO CORRESPONDING FIELDS OF wa_sbook
WHERE carrid = wa_flight-carrid

AND

connid = wa_flight-connid

AND

fldate = wa_flight-fldate.

Creating detail list


WRITE: / wa_sbook-bookid,
wa_sbook-customid,
wa_sbook-custtype,
wa_sbook-class,
wa_sbook-order_date,
wa_sbook-smoker,
wa_sbook-cancelled.
ENDSELECT.

06-04-2006

2006 . SAP AG All rights reserved.


.

251

9:

BC400

ENDIF.
CLEAR wa_flight.

( ):
SAPBC400UDS_DETAIL_LIST1
REPORT

sapbc400uds_detail_list1.

CONSTANTS actvt_display TYPE activ_auth VALUE 03.


DATA: wa_flight TYPE sbc400focc,
wa_sbook

TYPE sbook.

PARAMETERS pa_car TYPE s_carr_id.

START-OF-SELECTION.

AUTHORITY-CHECK OBJECT S_CARRID


ID CARRID FIELD pa_car
ID ACTVT

FIELD actvt_display.

CASE sy-subrc.
WHEN 0.
SELECT carrid connid fldate seatsmax seatsocc FROM sflight
INTO CORRESPONDING FIELDS OF wa_flight
WHERE carrid = pa_car.
wa_flight-percentage =
100 * wa_flight-seatsocc / wa_flight-seatsmax.
WRITE: / wa_flight-carrid,
wa_flight-connid,
wa_flight-fldate,
wa_flight-seatsocc,
wa_flight-seatsmax,
wa_flight-percentage,%.
*

Hide key values of the current line


HIDE: wa_flight-carrid, wa_flight-connid, wa_flight-fldate.
ENDSELECT.
IF sy-subrc NE 0.
WRITE: No , pa_car, flights found !.
ENDIF.
WHEN OTHERS.
WRITE: / Authority-Check Error(001).

252

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

ENDCASE.
CLEAR wa_flight.

AT LINE-SELECTION.
IF sy-lsind = 1.
WRITE: / wa_flight-carrid,
wa_flight-connid,
wa_flight-fldate.
ULINE.
SKIP.
*

Reading bookings of the selected flight


SELECT bookid customid custtype class order_date
smoker cancelled loccuram loccurkey
FROM sbook INTO CORRESPONDING FIELDS OF wa_sbook
WHERE carrid = wa_flight-carrid

AND

connid = wa_flight-connid

AND

fldate = wa_flight-fldate.

Creating detail list


WRITE: / wa_sbook-bookid COLOR col_key,
wa_sbook-customid,
wa_sbook-custtype,
wa_sbook-class,
wa_sbook-order_date,
wa_sbook-smoker,
wa_sbook-cancelled,
wa_sbook-loccuram CURRENCY wa_sbook-loccurkey,
wa_sbook-loccurkey.
ENDSELECT.
ENDIF.
CLEAR wa_flight.

06-04-2006

2006 . SAP AG All rights reserved.


.

253

9:

BC400

ABAP-

254

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400




. PARAMETERS,
SELECT-OPTIONS,
.
, ABAP- AT
SELECTION-SCREEN

.



,
, PARAMETERS.

,
.

06-04-2006

2006 . SAP AG All rights reserved.


.

255

9:

BC400

142:


. ,

, ,
.
, .

256

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

143:

( )
.

( ).
:
, ,
SAP GUI .
(PARAMETERS),

(SELECT-OPTIONS).
, .
(..
),
F1 ( )
( ).
F4 ( )
,
.

06-04-2006

2006 . SAP AG All rights reserved.


.

257

9:

BC400

144:

,
.
(
). .

SELECT-OPTIONS .

258

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

145:

,
:

( )
(.
).

( F1).
,
( F4).
( ,

(, ),
.)

, , ,
,

. ,
.
-
ABAP-.

06-04-2006

2006 . SAP AG All rights reserved.


.

259

9:

BC400

146:


.
,
.
(
).
,
.
ABAP-
.
.
,
,
( ).
.

260

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

147:

.


. ABAP-,
,
, ,
.

, (
).
.
,
... .
.

(
).
.
"CUS&" .

.
. ABAP-
,

.

. .

.
.

06-04-2006

2006 . SAP AG All rights reserved.


.

261

9:

BC400

148: ( PARAMETERS)


, PARAMETERS.

.
,
. , DATA
PARAMETERS.
:

8 .
F,
STRING XSTRING.

VALUE, DEFAULT.

, DEFAULT,
, (INITIALIZATION),
,
.

, ,
.

262

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

149: ( SELECT-OPTIONS)


SELECT-OPTIONS name FOR data_object.
name , data_object
.
(
so_car)
(
wa_spfli-carrid).

.
: sign , option , low high .
,
:

06-04-2006

"LH", "I"
(), "EQ" (), "LH" "".
"AA"-"DL",
"I" (), "BT" (), "AA" "DL".
"BA" ,
, "E" (), "EQ"
(), "BA" "".

2006 . SAP AG All rights reserved.


.

263

9:

BC400

, ,
,
. :
I_1, ... , I_n E_1, ... , E_m
/ ,
:
( I_1 OR ... OR I_n ) AND ( NOT E_1 )
AND ...
AND ( NOT E_m )
,
WHERE .
: IN
:
IF wa_spfli-carrid IN so_car.
,
PARAMETERS (. ).

DEFAULT APPEND
(INITIALIZATION),
, .
.
SELECT-OPTIONS.

264

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

150: AT SELECTION-SCREEN

AT SELECTION-SCREEN
Enter,
(F8).
START-OF-SELECTION , ,
. Enter
.

06-04-2006

2006 . SAP AG All rights reserved.


.

265

9:

BC400

151: AT SELECTIONSCREEN

AT SELECTION-SCREEN
.
,
.
,
. .

START-OF-SELECTION.

.

266

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

152: :

.
AT SELECTION-SCREEN.

06-04-2006

2006 . SAP AG All rights reserved.


.

267

9:

268

2006 . SAP AG All rights reserved.


.

BC400

06-04-2006

BC400

13:

,

ABAP- SELECT-OPTIONS



,
.
,

.

1:

1.

ZBC400_##_DETAIL_LIST
SAPBC400UDS_DETAIL_LIST
ZBC400_##_SEL_SCREEN.

2.


(CONNID).
:

.
- .

3.

, ,
SFLIGHT.

06-04-2006

2006 . SAP AG All rights reserved.


.

269

9:

BC400

2:


1.

,

,
.
: BC400
, .

270

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

13:
1:

1.

ZBC400_##_DETAIL_LIST
SAPBC400UDS_DETAIL_LIST
ZBC400_##_SEL_SCREEN.
a)

2.


(CONNID).
:

.
- .
a)

3.

. .

, ,
SFLIGHT.
a)

. .

2:


1.

,

,
.
: BC400
, .
a)

. .

: SAPBC400UDS_SEL_SCREEN
REPORT

sapbc400uds_sel_screen.

06-04-2006

2006 . SAP AG All rights reserved.


.

271

9:

BC400

CONSTANTS actvt_display TYPE activ_auth VALUE 03.


DATA: wa_flight TYPE sbc400focc,
wa_sbook

TYPE sbook.

PARAMETERS pa_car LIKE wa_flight-carrid.

SELECT-OPTIONS so_con FOR wa_flight-connid.

* First event processed after leaving the selection screen


AT SELECTION-SCREEN.
AUTHORITY-CHECK OBJECT S_CARRID
ID CARRID FIELD pa_car
ID ACTVT

FIELD actvt_display.

IF sy-subrc NE 0.
*

Return to selection screen and display message in status bar


MESSAGE e045(bc400) WITH pa_car.
ENDIF.

START-OF-SELECTION.
SELECT carrid connid fldate seatsmax seatsocc FROM sflight
INTO CORRESPONDING FIELDS OF wa_flight
WHERE carrid = pa_car
AND

connid IN so_con.

wa_flight-percentage =
100 * wa_flight-seatsocc / wa_flight-seatsmax.
WRITE: / wa_flight-carrid,
wa_flight-connid,
wa_flight-fldate,
wa_flight-seatsocc,
wa_flight-seatsmax,
wa_flight-percentage, %.
HIDE: wa_flight-carrid, wa_flight-connid, wa_flight-fldate.
ENDSELECT.
IF sy-subrc NE 0.
WRITE Requested data not found !.
ENDIF.
CLEAR wa_flight.

AT LINE-SELECTION.
IF sy-lsind = 1.

272

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

WRITE: / wa_flight-carrid, wa_flight-connid, wa_flight-fldate.


ULINE.
SKIP.
SELECT bookid customid custtype class order_date
smoker cancelled loccuram loccurkey
FROM sbook INTO CORRESPONDING FIELDS OF wa_sbook
WHERE carrid = wa_flight-carrid
AND

connid = wa_flight-connid

AND

fldate = wa_flight-fldate.

WRITE: / wa_sbook-bookid color col_key,


wa_sbook-customid,
wa_sbook-custtype,
wa_sbook-class,
wa_sbook-order_date,
wa_sbook-smoker,
wa_sbook-cancelled,
wa_sbook-loccuram CURRENCY wa_sbook-loccurkey,
wa_sbook-loccurkey.
ENDSELECT.
ENDIF.
CLEAR wa_flight.

06-04-2006

2006 . SAP AG All rights reserved.


.

273

9:

BC400

274

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400



/ .


,
. ,
.

06-04-2006

2006 . SAP AG All rights reserved.


.

275

9:

BC400

153:

/,
, ( ,
).
ABAP-
.
, .
ABAP-.
,
.

.
, ,
, ,
,
.
,
:
;
::;

276

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

, (, ...)
,
.

154:


.

. "0"
.

155:

06-04-2006

2006 . SAP AG All rights reserved.


.

277

9:

BC400

()
, , ,
, , (,
),
.

/, ,
. .

, , ,
, . .

PBO (Process Before
Output, ) PAI (Process After Input,
). PBO (PBO-),
(,
) . PAI
(PAI-),
(, ).

156:


. ,
,
:

278

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400



.


,
.


.

157:


.
.
.

(
).

.

06-04-2006

2006 . SAP AG All rights reserved.


.

279

9:

BC400


,
.
,
.

158: 1:

,
. , ,
.
.

,
.

280

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

159:

:
ABAP-

ABAP- (. ).
, .

()

.
.
,
.
0,
,
.
: ,
.
, ,
. , CALL SCREEN...
AT LINE-SELECTION.

06-04-2006

2006 . SAP AG All rights reserved.


.

281

9:

BC400

160: / (
)

:
:

.
,
.
ABAP-.
:

.
(
). .

, , ,
. .
,
.

.

, , .

282

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

161:

.
.
(
.)

. ,
.
,
.
.

06-04-2006

2006 . SAP AG All rights reserved.


.

283

9:

BC400

162: 2:


.
.
.

284

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

163: TABLES

TABLES
,
(, ).
.
TABLES
,
: PBO
TABLES PAI .
, , .
.
,

TABLES. , ,
,
. Flugdatenmodell,
, (SDYN_CONN)
SCARR, SPFLI SFLIGHT, (SDYN_BOOK)
SBOOK SCUSTOM.

06-04-2006

2006 . SAP AG All rights reserved.


.

285

9:

BC400

164:

PBO
TABLES

. ,
TABLES
, , PBO.

286

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

165:


TABLES
PAI.
,
PAI , ,
.

06-04-2006

2006 . SAP AG All rights reserved.


.

287

9:

BC400

166: -


:

, ,
, .


.
, ,
TABLES .
PBO
. SDYN_CONN,
SDYN_CONN TABLES
SDYN_CONN.


TABLES SDYN_CONN .
PAI.

288

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

167: -:

168: -

06-04-2006

2006 . SAP AG All rights reserved.


.

289

9:

BC400


.
:


,
.
. AT LINE-SELECTION

TABLES.
:
, .

,
.

,
SELECT SINGLE
.
:
.
: . ,
.
: ,


.
. BC414.

TABLES

( MOVE-CORRESPONDING).

290

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

169: 3:

,

:


.
:
.


. (
.
.)

Enter.

06-04-2006

PBO PAI;
PBO PAI ;
.

2006 . SAP AG All rights reserved.


.

291

9:

BC400

170:


( "OK").
, , ok_code.

.
PAI,

.

, "OK",

.

292

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

171:


.
. .

172:

06-04-2006

2006 . SAP AG All rights reserved.


.

293

9:

BC400

,
,
.
.
OK_CODE.


sy-ucomm (. ).

173:

CALL SCREEN
. (
):
PBO

PBO-,
PBO.

PBO TABLES
.


(SAPGUI) .

294

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400



TABLES.
PAI

,
PAI.
.
ABAP MODULE ENDMODULE.
PBO PAI .
: (PBO/PAI)
,
ABAP. ABAP
.

174: PAI

.
, OK_CODE,
PAI.

06-04-2006

2006 . SAP AG All rights reserved.


.

295

9:

BC400

, PAI
USER_COMMAND_nnnn, nnnn .
:
. ,
, .

175:

:


(. ).

.
.
,
.

( ).

296

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

, MODULE ... OUTPUT PBO-


PBO . ,
PAI-, MODULE ... INPUT ,
PAI.

176: 0 ()

=0
, c
.

177: : ()

06-04-2006

2006 . SAP AG All rights reserved.


.

297

9:

BC400

,
.

178:

ABAP- SET SCREEN ( , PAI-)



, (. ).
SAP: Enter
;
.
(
) (
SET SCREEN) PAI .
( Enter
). ,
().
: PBO-
. TABLES
PBO- , ,
,
.

298

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

179: :

06-04-2006

( BACK)
"0",
.
, AT LINE-SELECTION
.
057, "S".
( SAVE )
, ,
.

.

2006 . SAP AG All rights reserved.


.

299

9:

BC400

180:


.

.
,
.
, Enter
,
.
?
"SAVE"
ok_code .
( )
PBO. ok_code "SAVE",
. Enter (
,
,
PAI) "SAVE",
, ok_code
PAI:

300

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

181:



. :

06-04-2006

ok_code PBO-
;
PAI,
ok_code
ok_code.

2006 . SAP AG All rights reserved.


.

301

9:

302

2006 . SAP AG All rights reserved.


.

BC400

06-04-2006

BC400

14:


SAPBC400UDT_DYNPRO
.
:
,
.

.

1:

1.

SAPBC400UDT_DYNPRO
ZBC400_##_DYNPRO_1.

2.

.
1##, ##
.

3.

,
( F2)
. ( 100)
.

4.

0

100.

2:

1.

/ .
SDYN_BOOK
ABAP-. :

06-04-2006

2006 . SAP AG All rights reserved.


.

303

9:

BC400

CARRID, CONNID, FLDATE


BOOKID .
CUSTOMID ( ) LOCCURAM
().
LOCCURKEY ( )
. .
2.

:
CARRID, CONNID, FLDATE, BOOKID CUSTOMID
( ).
LOCCURAM
( + ).
LOCCURKEY
(
).

304

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

14:
1:

1.

SAPBC400UDT_DYNPRO
ZBC400_##_DYNPRO_1.
a)

2.

.
1##, ##
.
a)

3.

4.

,
( F2)
. ( 100)
.
a)

. .

b)

:
100 CALL SCREEN 100..

0

100.
a)

2:

1.

/ .
SDYN_BOOK
ABAP-. :
CARRID, CONNID, FLDATE
BOOKID .
CUSTOMID ( ) LOCCURAM
().

06-04-2006

2006 . SAP AG All rights reserved.


.

305

9:

BC400

LOCCURKEY ( )
. .

2.

a)

b)

/.

c)

SDYN_BOOK.

d)

e)

f)

LOCCURKEY .

g)

Enter .

:
CARRID, CONNID, FLDATE, BOOKID CUSTOMID
( ).
LOCCURAM
( + ).

306

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

LOCCURKEY
(
).
a)

: SAPBC400UDS_DYNPRO_1
REPORT

sapbc400uds_dynpro_1.

CONSTANTS actvt_display TYPE activ_auth VALUE 03.


PARAMETERS pa_anum TYPE sbook-agencynum.

* workarea for SELECT


DATA wa_sbook TYPE sbook.

START-OF-SELECTION.

SELECT carrid connid fldate bookid


FROM sbook
INTO CORRESPONDING FIELDS OF wa_sbook
WHERE agencynum = pa_anum.
AUTHORITY-CHECK OBJECT S_CARRID
ID CARRID FIELD wa_sbook-carrid
ID ACTVT

FIELD actvt_display.

IF sy-subrc = 0.
WRITE: / wa_sbook-carrid COLOR col_key,
wa_sbook-connid COLOR col_key,
wa_sbook-fldate COLOR col_key,
wa_sbook-bookid COLOR col_key,
ENDIF.
ENDSELECT.

AT LINE-SELECTION.
CALL SCREEN 100.

06-04-2006

2006 . SAP AG All rights reserved.


.

307

9:

308

2006 . SAP AG All rights reserved.


.

BC400

06-04-2006

BC400

15: :


ZBC400_##_DYNPRO
.

.

1:

1.

ZBC400_##_DYNPRO_1
SAPBC400UDS_DYNPRO_1
ZBC400_##_DYNPRO_2 .

2.


TABLES.
. , ,
.

3.



(HIDE).

2:

1.


. ,

.
,
047 BC400. "S".

( )
SBOOK wa_sbook.

06-04-2006

2006 . SAP AG All rights reserved.


.

309

9:

BC400


,
.
2.

310


wa_sbook TABLES
.

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

15: :
1:

1.

ZBC400_##_DYNPRO_1
SAPBC400UDS_DYNPRO_1
ZBC400_##_DYNPRO_2 .
a)

2.


TABLES.
. , ,
.
a)

3.



(HIDE).
a)

. .

2:

1.


. ,

.
,
047 BC400. "S".

( )
SBOOK wa_sbook.

,
.
a)

2.

. .


wa_sbook TABLES
.
a)

. .

06-04-2006

2006 . SAP AG All rights reserved.


.

311

9:

BC400

: SAPBC400UDS_DYNPRO_2
REPORT

sapbc400uds_dynpro_2.

CONSTANTS: actvt_display TYPE activ_auth VALUE 03,


actvt_change TYPE activ_auth VALUE 02.

PARAMETERS pa_anum TYPE sbook-agencynum.


* workarea for SELECT
DATA wa_sbook TYPE sbook.
* workarea for data communication with screen
TABLES sdyn_book.

START-OF-SELECTION.
SELECT carrid connid fldate bookid
FROM sbook
INTO CORRESPONDING FIELDS OF wa_sbook
WHERE agencynum = pa_anum.
AUTHORITY-CHECK OBJECT S_CARRID
ID CARRID FIELD wa_sbook-carrid
ID ACTVT

FIELD actvt_display.

IF sy-subrc = 0.
WRITE: / wa_sbook-carrid COLOR col_key,
wa_sbook-connid COLOR col_key,
wa_sbook-fldate COLOR col_key,
wa_sbook-bookid COLOR col_key.
HIDE: wa_sbook-carrid,
wa_sbook-connid,
wa_sbook-fldate,
wa_sbook-bookid.
ENDIF.
ENDSELECT.

CLEAR wa_sbook.

AT LINE-SELECTION.

312

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

AUTHORITY-CHECK OBJECT S_CARRID


ID CARRID FIELD wa_sbook-carrid
ID ACTVT

FIELD actvt_change.

IF sy-subrc = 0.

SELECT SINGLE * FROM sbook INTO wa_sbook


WHERE carrid = wa_sbook-carrid
AND

connid = wa_sbook-connid

AND

fldate = wa_sbook-fldate

AND

bookid = wa_sbook-bookid.

IF sy-subrc = 0.
MOVE-CORRESPONDING wa_sbook TO sdyn_book.
CALL SCREEN 100.
ELSE.
MESSAGE s176(bc400).
ENDIF.

ELSE .
MESSAGE s047(bc400) WITH wa_sbook-carrid.
ENDIF.

CLEAR wa_sbook.

06-04-2006

2006 . SAP AG All rights reserved.


.

313

9:

314

2006 . SAP AG All rights reserved.


.

BC400

06-04-2006

BC400

16: :


,

,
,


ZBC400_ _DYNPRO_1 ##
.

1:

1.

ZBC400_##_DYNPRO_1
SAPBC400UDS_DYNPRO_2
ZBC400_##_DYNPRO_3 .

2.


()
().

PUSH_BACK

BACK

PUSH_SAVE

ICON_SYSTEM_SAVE)

SAVE

2:

1.

"OK"
( ) .
OK_CODE.

06-04-2006

2006 . SAP AG All rights reserved.


.

315

9:

2.

BC400

. PAI-
.
:

BACK

SAVE

060
BC400

100

3.

316

, Enter 100,
. PBO
ok-.

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

16: :

1:

1.

ZBC400_##_DYNPRO_1
SAPBC400UDS_DYNPRO_2
ZBC400_##_DYNPRO_3 .
a)

2.


()
().

PUSH_BACK

BACK

PUSH_SAVE

ICON_SYSTEM_SAVE)

SAVE

a)

2:

1.

2.

"OK"
( ) .
OK_CODE.
a)

b)

. .

. PAI-
.
:

06-04-2006

2006 . SAP AG All rights reserved.


.

317

9:

BC400

BACK

SAVE

060
BC400

100

a)
3.

. .

, Enter 100,
. PBO
ok-.
a)

. .

: SAPBC400UDS_DYNPRO_3
REPORT

sapbc400uds_dynpro_3.

CONSTANTS: actvt_display TYPE activ_auth VALUE 03,


actvt_change TYPE activ_auth VALUE 02.
PARAMETERS pa_anum TYPE sbook-agencynum.

* workarea for SELECT


DATA wa_sbook TYPE sbook.

* workarea for data communication with screen


TABLES sdyn_book.

* variable for function code of user action


DATA ok_code LIKE sy-ucomm.

START-OF-SELECTION.

SELECT carrid connid fldate bookid


FROM sbook
INTO CORRESPONDING FIELDS OF wa_sbook
WHERE agencynum = pa_anum.
AUTHORITY-CHECK OBJECT S_CARRID

318

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

ID CARRID FIELD wa_sbook-carrid


ID ACTVT

FIELD actvt_display.

IF sy-subrc = 0.
WRITE: / wa_sbook-carrid COLOR col_key,
wa_sbook-connid COLOR col_key,
wa_sbook-fldate COLOR col_key,
wa_sbook-bookid COLOR col_key.
HIDE: wa_sbook-carrid,
wa_sbook-connid,
wa_sbook-fldate,
wa_sbook-bookid.
ENDIF.

ENDSELECT.
CLEAR wa_sbook.

AT LINE-SELECTION.
AUTHORITY-CHECK OBJECT S_CARRID
ID CARRID FIELD wa_sbook-carrid
ID ACTVT

FIELD actvt_change.

IF sy-subrc = 0.
SELECT SINGLE * FROM sbook INTO wa_sbook
WHERE carrid = wa_sbook-carrid
AND

connid = wa_sbook-connid

AND

fldate = wa_sbook-fldate

AND

bookid = wa_sbook-bookid.

IF sy-subrc = 0.
MOVE-CORRESPONDING wa_sbook TO sdyn_book.
CALL SCREEN 100.
ELSE.
MESSAGE s176(bc400).
ENDIF.
ELSE .
MESSAGE s047(bc400) WITH wa_sbook-carrid.
ENDIF.
CLEAR wa_sbook.

06-04-2006

2006 . SAP AG All rights reserved.


.

319

9:

BC400

*&--------------------------------------------------------------*
*&

Module

CLEAR_OK_CODE

OUTPUT

*&--------------------------------------------------------------*
*&

text

*&--------------------------------------------------------------*
MODULE clear_ok_code OUTPUT.
CLEAR ok_code.
" CLEAR_OK_CODE

ENDMODULE.

OUTPUT

*&--------------------------------------------------------------*
*&

Module

USER_COMMAND_0100

INPUT

*&--------------------------------------------------------------*
*&

text

*&--------------------------------------------------------------*
MODULE user_command_0100 INPUT.

CASE ok_code.
WHEN BACK.
SET SCREEN 0.
WHEN SAVE.
MOVE-CORRESPONDING sdyn_book TO wa_sbook.
MESSAGE i060(bc400).
SET SCREEN 0.
ENDCASE.

ENDMODULE.

" USER_COMMAND_0100

INPUT

100:

PROCESS BEFORE OUTPUT.


MODULE clear_ok_code.

PROCESS AFTER INPUT.


MODULE user_command_100.

320

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

06-04-2006

2006 . SAP AG All rights reserved.


.

321

9:

BC400



.
, (
), ,
.

GUI-
GUI- ( ,
)


( )
.

182: GUI- GUI- ()

322

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400


(GUI-).
/
( ),
.

SAP- .
.

SAP-
, ,
.
, ,
.

.

, .

.
, ,
GUI-.
GUI- GUI-
- .
ABAP- SET TITLEBAR SET
PF-STATUS.

06-04-2006

2006 . SAP AG All rights reserved.


.

323

9:

BC400

183: GUI-

GUI- :

GUI-
, ,
SET
TITLEBAR.
GUI-
SET TITLEBAR
(. ).

20 .
GUI-, ,
.
, .

324

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

184: - ()

-
:

.
,
( ) . ,
,
( ).

, ,
. (
).

06-04-2006

2006 . SAP AG All rights reserved.


.

325

9:

BC400

185:

GUI- -
.
,
. :

186:

326

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

187:


, ,
.
.

,
().

188: GUI-

06-04-2006

2006 . SAP AG All rights reserved.


.

327

9:

BC400

,
GUI-:


GUI-,
SET PF-STATUS;
GUI-
SET PF-STATUS .

,
.
20 .
.
: STATUS_nnnn,
PBO-,
PBO-
, :
SET PF-STATUS SET TITLEBAR
, .
(),
,
.

328

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

189:

(
, )

.
.

06-04-2006

2006 . SAP AG All rights reserved.


.

329

9:

BC400

190:


, .
:
,
.

330

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

191:

:


(
). ,
Ctrl+S. ,
,
,

( ).

, , ,
.
, ,
.
.

(
),
.

06-04-2006

2006 . SAP AG All rights reserved.


.

331

9:

BC400


. ,
.
,
.
, ,
,
.
,
PAI. ,
, ,
ABAP- AT USER-COMMAND,

sy-ucomm. .
AT USER-COMMAND BC405 ( ).

192:

( ,
), ,
, (
F4). .
,
.
( ).
,
.
:

332

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

193:

,
.

.
SAVE
, ,
,
. ,
,
.
.

06-04-2006

2006 . SAP AG All rights reserved.


.

333

9:

334

2006 . SAP AG All rights reserved.


.

BC400

06-04-2006

BC400

17:

,

GUI- GUI-


( )
ZBC400_##_DYNPRO_1.

1:
GUI- ( )
1.

ZBC400_##_DYNPRO_1
SAPBC400UDS_DYNPRO_3
ZBC400_##_DYNPRO_4 .

2.

(: ) :

.
.

. .
.

3.

SAVE.

.
. , ,
.
.

4.

: GUI-

.

2:
GUI- ( )
1.

(: )
:

06-04-2006

2006 . SAP AG All rights reserved.


.

335

9:

BC400


.
.
2.

.
BACK SAVE .

3.

: GUI-

.

336

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

17:
1:
GUI- ( )
1.

ZBC400_##_DYNPRO_1
SAPBC400UDS_DYNPRO_3
ZBC400_##_DYNPRO_4 .
a)

2.

(: ) :

.
.

. .
.
a)

SET
PF-STATUS LIST. START-OF-SELECTION.
:
.

b)

SET PF-STATUS
LIST..

c)

GUI-
. ?
.

3.

d)

e)

f)

g)

SAVE.

.
. , ,
.

06-04-2006

2006 . SAP AG All rights reserved.


.

337

9:

BC400

4.

a)

SAVE
Enter.

b)

,
SAVE .

c)

<->
SAVE .

d)

: GUI-

.
a)

START-OF-SELECTION
SET TITLEBAR LIST..

b)

c)

2:
GUI- ( )
1.

(: )
:

338

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400


.
.
a)

100. PBO

MODULE STATUS_0100.
.

b)

:
;
.

( ):
SET PF-STATUS DYNPRO.

c)

. (
DYNPRO.)
.

.

2.

3.

.
BACK SAVE .
a)

( F4)
.
.

b)

( F4)
.

.

c)

SAVE BACK,

<-> .

d)

, .

: GUI-

.

06-04-2006

a)

STATUS_0100 SET TITLEBAR


DYNPRO.

b)

2006 . SAP AG All rights reserved.


.

339

9:

c)

BC400

SAPBC400UDS_DYNPRO_4:
REPORT

sapbc400uds_dynpro_4.

...
START-OF-SELECTION.
SET PF-STATUS LIST.

SET TITLEBAR LIST.

"optional

SELECT carrid connid fldate bookid


FROM sbook
INTO CORRESPONDING FIELDS OF wa_sbook
WHERE agencynum = pa_anum.
...
AT LINE-SELECTION.
...

*&--------------------------------------------------------------*
*&

Module

STATUS_0100

OUTPUT

*&--------------------------------------------------------------*
*

text

*---------------------------------------------------------------*
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS DYNPRO.
"optional

SET TITLEBAR DYNPRO.


ENDMODULE.

" STATUS_0100

OUTPUT

*&--------------------------------------------------------------*
*&

Module

CLEAR_OK_CODE

OUTPUT

*&--------------------------------------------------------------*
*&

text

*---------------------------------------------------------------*
MODULE clear_ok_code OUTPUT.
CLEAR ok_code.
ENDMODULE.

" CLEAR_OK_CODE

OUTPUT

*&--------------------------------------------------------------*

340

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

*&

Module

USER_COMMAND_0100

INPUT

*&--------------------------------------------------------------*
*&

text

*&--------------------------------------------------------------*
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN BACK.
SET SCREEN 0.
WHEN SAVE.
MOVE-CORRESPONDING sdyn_book TO wa_sbook.
MESSAGE i060(bc400).
SET SCREEN 0.
ENDCASE.
ENDMODULE.

" USER_COMMAND_0100

INPUT

100:
PROCESS BEFORE OUTPUT.
MODULE status_0100.
MODULE clear_ok_code.

PROCESS AFTER INPUT.


MODULE user_command_0100.

06-04-2006

2006 . SAP AG All rights reserved.


.

341

9:

BC400

GUI-

GUI- ( ,
)

342

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

ABAP-

GUI-

GUI- ( ,
)


... . -
ABAP-.

06-04-2006

2006 . SAP AG All rights reserved.


.

343

344

BC400

2006 . SAP AG All rights reserved.


.

06-04-2006

10


. .





-
ABAP ( )
,
SAP-
SAP Grid
Control (ALV List Viewer)
BAPI
BAPI


: ............................346
18: ......357
: .....................................................364
: ALV Grid Control
.......................................................................375
19: .............................379
: BAPI ...........................................................384

06-04-2006

2006 . SAP AG All rights reserved.


.

345

10:

BC400




.

.


. ,
, ,
,
.

194:

346

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400


,
SAP-.
.
.
,
.
.
,
/
.
,
. :

, ..

.

195:

06-04-2006

2006 . SAP AG All rights reserved.


.

347

10:

BC400

, ,
, .
,
.
.

:

:

.
.
:

.
.
: ,
,
.
:


.
.


ABAP-.

348

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

196:


,
.
.
, ,

.
, ,
- ,

,
.
,

, .

.

06-04-2006

2006 . SAP AG All rights reserved.


.

349

10:

BC400

197:


,
/ .

,
.
,
,
.

,
( ),
" "
.
,
.

.
.

350

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

198:
(I)

ABAP-
.
, (.
). .

199:
(II)

,
.

06-04-2006

2006 . SAP AG All rights reserved.


.

351

10:

BC400



.
,
, .
ANSWER ,
.

200:


, .
, ,
.
,
, .
.

352

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

201:

.

.
.
.

,
( ).
, .
, .
.
,
.

06-04-2006

2006 . SAP AG All rights reserved.


.

353

10:

BC400

202:

ABAP-
CALL FUNCTION.
.
EXPORTING
.
IMPORTING
,
.


,
.

( ),

( ).

354

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

203:



. ,

.
. ,
, .
.
, ,
.

06-04-2006

2006 . SAP AG All rights reserved.


.

355

10:

BC400

204:


(, ),

. ,
.
EXCEPTIONS ,
sy-subrc
. ,
, , ,
.
, sy-subrc
.
,

.
OTHERS () .

.
,
.

356

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

18:


,



. ,
.

.

1:

1.

ZBC400_##_DYNPRO_1
SAPBC400UDS_DYNPRO_4
ZBC400_##_DYNPRO_5.

2.


POPUP_TO_CONFIRM.
,
.

3.

GUI- (
"RW").

4.

USER_COMMAND_0100
.
POPUP_TO_CONFIRM
.
, :
- ,
"0";
- 100.

06-04-2006

2006 . SAP AG All rights reserved.


.

357

10:

BC400

2:
,

1.

SAVE
BC400_UPDATE_BOOK
.

2.


,
.

3.

,
148 BC400
( : "S").
149
BC400 ( : "E").

358

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

18:

1:

1.

ZBC400_##_DYNPRO_1
SAPBC400UDS_DYNPRO_4
ZBC400_##_DYNPRO_5.
a)

2.


POPUP_TO_CONFIRM.
,
.
a)


.
:
TEXT_QUESTION (. 80 ):
.
:
TITLEBAR (. 40 ): .
DIAGNOSE_OBJECT(SE61, DT):
,
.
TEXT_BUTTON_1 (. 8 ): .
ICON_BUTTON_1 (. 30 ):
( ICON).
TEXT_BUTTON_2 (. 8 ): .
ICON_BUTTON_2 (. 30 ):
( ICON).
DEFAULT_BUTTON ("1", "2" "A"):
.
DISPLAY_CANCEL_BUTTON ("X". " ):
.
USERDEFINED_F1_HELP (SE61, DT):
,
.

06-04-2006

2006 . SAP AG All rights reserved.


.

359

10:

BC400

START_COLUMN ( SY-CUCOL):
.
START_ROW ( SY-CUROW):
.
POPUP_TYPE ( ICON-NAME): ,
.
IV_QUICKINFO_BUTTON_1 (. 132 ):
.
IV_QUICKINFO_BUTTON_2 (. 132 ):
.
( ):
ANSWER (: "1", "2", "A"): ,
.
:
PARAMETER ( SPAR):
.
:
TEXT_NOT_FOUND: .
3.

GUI- (
"RW").
a)

4.

USER_COMMAND_0100
.
POPUP_TO_CONFIRM
.
, :
- ,
"0";
- 100.
a)

. .

360

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

2:
,

1.

SAVE
BC400_UPDATE_BOOK
.
a)

2.


,
.
a)

3.

. .

. .

,
148 BC400
( : "S").
149
BC400 ( : "E").
a)

. .

SAPBC400UDS_DYNPRO_5:
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN BACK.
SET SCREEN 0.
WHEN RW.
CALL FUNCTION POPUP_TO_CONFIRM
EXPORTING
titlebar

= text-002

text_question

= text-001

display_cancel_button = space
IMPORTING
answer

= answer.

CASE answer.
WHEN 1.
SET SCREEN 0.
WHEN 2.
SET SCREEN 100.
ENDCASE.
WHEN SAVE.
MOVE-CORRESPONDING sdyn_book TO wa_sbook.

06-04-2006

2006 . SAP AG All rights reserved.


.

361

10:

BC400

CALL FUNCTION BC400_UPDATE_BOOK


EXPORTING
iv_book = wa_sbook
EXCEPTIONS
book_not_found

= 1

update_sbook_rejected

= 2

book_locked

= 3

currency_conversion_error = 4
OTHERS

= 5.

IF sy-subrc = 0.
MESSAGE s148(bc400).
SET SCREEN 0.
ELSE.
MESSAGE e149(bc400).
ENDIF.
ENDCASE.
ENDMODULE.

362

" USER_COMMAND_0100

INPUT

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

06-04-2006

2006 . SAP AG All rights reserved.


.

363

10:

BC400



SAP-
. -
ABAP-,
ALV List Viewer. ALV List Viewer
.
ALV List
Viewer
.

-
ABAP ( )
,
SAP-
SAP Grid
Control (ALV List Viewer)


,
.

364

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

205:

().
,
.

.
.

, ,
, , . .
, , .

, .

.

06-04-2006

2006 . SAP AG All rights reserved.


.

365

10:

BC400

SAP-
,
. ,
.
: ABAP SAP
-
(ABAP-) 4.6 .

. ,
,
SAP.
- . BC401.

206:

,

. ,
. ,
.
:

366

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

DATA reference_name TYPE REF TO class_name.


( .. - ). ,
,
.

CREATE OBJECT reference_name.
,
.
.
CREATE OBJECT
CONSTRUCTOR
.
.

.

CALL METHOD reference_name->method_name.
,
.
,
.

06-04-2006

2006 . SAP AG All rights reserved.


.

367

10:

BC400

207: :
EnjoySAP

SAP 4.6
EnjoySAP,
.
:


, ,
, ..

.
HTML Viewer
HTML- -.

.


, SAP-.
CL_GUI_ALV_GRID

ALV Grid
Control.

368

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400


EnjoySAP . BC412.

208: : ALV Grid Control

ALV Grid Control, SAP List Viewer (ALV),


.
.
;
,
.
.
, ,
:
,
.

.

.

.
.

06-04-2006

2006 . SAP AG All rights reserved.


.

369

10:

BC400


,
.
,
.


.

209: SAP-

EnjoySAP
SAP- ( ).

. (. .)
GUI,

.
GUI. SAP-
,
.

370

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

210:


( CONSTRUCTOR ).

. ,
(CREATE OBJECT)
.

06-04-2006

2006 . SAP AG All rights reserved.


.

371

10:

BC400

211: CONSTRUCTOR

-
.

.
. ( ,

ABAP-).
.
CONSTRUCTOR
CL_GUI_CUSTOM_CONTAINER ( )
CONTAINER_NAME . ,

, .

372

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

212:

CL_GUI_ALV_GRID ,

.
ALV Grid Control
:
CONSTRUCTOR
.
i_parent ,
( )
.
SET_TABLE_FOR_FIRST_DISPLAY


.
IT_OUTTAB.
(. ).
,
.
.

I_STRUCTURE_NAME . ( ,
IT_FIELDCATALOG .)

06-04-2006

2006 . SAP AG All rights reserved.


.

373

10:

BC400

REFRESH_TABLE_DISPLAY
,


.

374

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

ALV Grid Control

213: "
"

1.


.
.
,
:
,
,
.
,
.
.
(
CONTAINER_1).
,
,

06-04-2006

2006 . SAP AG All rights reserved.


.

375

10:

BC400

.

. . .

214:

2.

ABAP-
:

,
(: CONTAINER_R);
,
(:
GRID_R).

376

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

215:

3.

CREATE
OBJECT.
.


.

xxxxxxxx .
.
,
CREATE OBJECT,
.

.
PBO-.

. ,
.
:
IF container_r IS INITIAL.

06-04-2006

2006 . SAP AG All rights reserved.


.

377

10:

BC400

216:

4.


SAP Grid Control SET_TABLE_FOR_FIRST_DISPLAY
. ,
.
xxxxxxxx

:


IT_OUTTAB .

SPFLI .
I_STRUCTURE_NAME
.
.


,
REFRESH_TABLE_DISPLAY
.

378

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

19:

,

ALV Grid Control



ALV Grid Control.

1:

1.

SAPBC400RUT_ALV_GRID
ZBC400_##_ALV_GRID.

2.

.
,
SPFLI , 100.

3.


SPFLI .

4.

100
( : CONTAINER_1).

2:
,

06-04-2006

1.


CL_GUI_CUSTOM_CONTAINER CL_GUI_ALV_GRID.

2.


PROCESS BEFORE OUTPUT 100.
.

3.

PROCESS BEFORE OUTPUT


SET_TABLE_FOR_FIRST_DISPLAY
. I_STRUCTURE_NAME
( )
, IT_OUTTAB
.

4.

,
.

2006 . SAP AG All rights reserved.


.

379

10:

BC400

19:
1:

1.

SAPBC400RUT_ALV_GRID
ZBC400_##_ALV_GRID.
a)

2.

.
,
SPFLI , 100.
a)

3.


SPFLI .
a)

4.

. .

100
( : CONTAINER_1).
a)

2:
,

1.


CL_GUI_CUSTOM_CONTAINER CL_GUI_ALV_GRID.
a)

2.


PROCESS BEFORE OUTPUT 100.
.
a)

3.

. .

. .

PROCESS BEFORE OUTPUT


SET_TABLE_FOR_FIRST_DISPLAY
. I_STRUCTURE_NAME
( )
, IT_OUTTAB
.
a)

. .

380

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

4.

,
.
a)

. .

SAPBC400RUS_ALV_GRID

REPORT

sapbc400rus_alv_grid .

...
DATA:
container_r TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
grid_r

TYPE REF TO CL_GUI_ALV_GRID.

START-OF-SELECTION.

* fill internal table


SELECT * FROM spfli INTO TABLE gdt_spfli.

CALL SCREEN 100.

100:
PROCESS BEFORE OUTPUT.
MODULE status_0100.
MODULE clear_ok_code.
MODULE create_control.
*
PROCESS AFTER INPUT.
MODULE user_command_0100.

: CREATE_CONTROL

MODULE create_control OUTPUT.


IF container_r IS INITIAL.
CREATE OBJECT container_r
EXPORTING

container_name = CONTAINER_1.

06-04-2006

2006 . SAP AG All rights reserved.


.

381

10:

BC400

CREATE OBJECT grid_r


EXPORTING
CALL METHOD

i_parent = container_r.

grid_r->set_table_for_first_display

EXPORTING

i_structure_name = SPFLI

CHANGING

it_outtab

= gdt_spfli.

ENDIF.
ENDMODULE.

382

" CREATE_CONTROL OUTPUT

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

-
ABAP ( )
,
SAP-

SAP Grid
Control (ALV List Viewer)

06-04-2006

2006 . SAP AG All rights reserved.


.

383

10:

BC400

BAPI

BAPI,
BAPI.

BAPI
BAPI


,
BAPI.

BAPI

217: - BAPI

- () SAP-
-. -
SAP .

384

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

: BAPI

- BAPI (Business Application Programming Interfaces


-),
. BAPI
. , BAPI
SAP-.
BAPI -,
:

;
;
;
.

BAPI ,
. BAPI
ABAP- SAP-, .

218: BAPI

BAPI.
, BAPI
.
BAPI.
BAPI

06-04-2006

2006 . SAP AG All rights reserved.


.

385

10:

BC400

GetList
,
.
GetDetail
() (
).
Create, Change, Delete, Cancel
, .
AddItem, RemoveItem
(, ).

219: BAPI Explorer

BAPI Explorer -
BAPI . BAPI
Explorer SAP Easy Access
- BAPI Explorer BAPI.
- BAPI
BAPI .

.

386

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

: BAPI

220: BAPI

BAPI
:

06-04-2006

: BAPI_<_>_<_>;
;
;

ABAP-,
BAPI ( : BAPI_);

4.6;
- :

RETURN.

2006 . SAP AG All rights reserved.


.

387

10:

BC400

221: BAPI ABAP-

BAPI SAP-,
.
.
: BAPI
, .. ,
SAP-.
4 9 .

,
.


BACV ( SBF_BAPI).

388

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

: BAPI

BAPI

BAPI

06-04-2006

2006 . SAP AG All rights reserved.


.

389

BC400

-
ABAP ( )
,
SAP-

SAP Grid
Control (ALV List Viewer)

BAPI

BAPI


... . - .

390

2006 . SAP AG All rights reserved.


.

06-04-2006

11

SAP ()

. .

, , , ,
,

SAP

SAP-


: SAP () ...392

06-04-2006

2006 . SAP AG All rights reserved.


.

391

11: SAP ()

BC400


SAP ()


SAP .

, , , ,
,

SAP

SAP-


SAP,
- .

392

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

: SAP ()


SAP

222:

, ,
. ,
, .
( ) .
, .

.
. ,
,
- .
.

06-04-2006

2006 . SAP AG All rights reserved.


.

393

11: SAP ()

BC400

223:

.
/.
.
.
(,
)

.
SAP-
.

394

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

: SAP ()

224:

SAP-
, SAP.

.

SAP .
.
SAP-.

SAP. , ,
.
.

,
( ).
.

06-04-2006

2006 . SAP AG All rights reserved.


.

395

11: SAP ()

BC400

225: SAP

396

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

: SAP ()


SAP :


()
.

SAP.



.
SAP
.
SAP-.

SAP
.
- .
.

,
,

- .
R/3 4.6b,

.
. -
ABAP- ( SAP).

06-04-2006

2006 . SAP AG All rights reserved.


.

397

11: SAP ()

BC400

226:

SAP ,
.
SAP.
,
SAP.
.
SAP
: (User Exit),
(Customer Exit), - (Business Transaction Event)
Business Add-In (BAdI).
,
, SAP.
. BC425.

398

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

: SAP ()

227:

,
:

SAP SAP ,

( ) .

SAP,
.

,
SAP,
- .
SAP .
,
SAP ABAP-:

SAP,
F1, .

06-04-2006

2006 . SAP AG All rights reserved.


.

399

11: SAP ()

BC400


, SAP,
.
,
:
-

- .

SAP .
, SAP
SAP
. SAP,

.
.

BC425.

228: SAP

400

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

: SAP ()


.
SSCR.

SAP-.
( )
SAP, .
SSCR.
,
, SAP- .

06-04-2006

2006 . SAP AG All rights reserved.


.

401

11: SAP ()

BC400

, , , ,
,


SAP


SAP-

402

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

, , , ,
,


SAP


SAP-


... . SAP
-.

06-04-2006

2006 . SAP AG All rights reserved.


.

403

BC400

ABAP-
;

;

.


... . - ,
.

404

2006 . SAP AG All rights reserved.


.

06-04-2006

, 39
, 39

, 397
, 365

, 59
, 223
-, 384
, 223
, 223

, 40
, 204
, 347

, 39
, 39

, 92

, 130
, 132
, 133
, 122
,
125
, 131
, 121
, 134
, 136
, 122
, 122
, 121
,
135
, 155

06-04-2006

, 239
, 205

, 205
, 205

, 90
, 90

, 94
, 190
, 40

, 37
ABAP, 37

, 37
ABAP, 37
, 62
, 122

, 136, 323
, 236
, 236
, 28
, 108
, 28

, 323

2006 . SAP AG All rights reserved.


.

405

, 20
, 365
, 239

,
348
, 348
, 348
, 348
, 204
,
323

, 18
, 223
, 394

, 22
, 39

, 365
, 176
, 62
, 292
, 35
, 87
, 367
, 22
, 89
, 397
, 393
, 394

, 87
, 227
, 157

, 3
, 365
, 59
, 60

, 59
, 394, 397
, 395
, 295

406

BC400

, 294
, 157
, 365
, 80
, 210
, 210
, 108
, 87
, 176

, 25
, 366
, 28
, 393
, 238
, 356
,
123

, 18, 29
, 156
, 62
, 80
, 366

, 156
, 203
, 176

, 397
, 372
, 89
, 210
, 89
, 18
, 223
, 193
, 174

, 39
, 40

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

, 62
, 176

, 128
, 39

,
399
, 399
, 400
, 399
,
398
-,
400
, 399
, 401
, 95, 111
, 17
, 384


, 237

, 3

SY-DBCNT, 152, 154
SY-INDEX, 93
sy-lsind, 240
SY-SUBRC, 36
, 243
, 223
, 94

, 323
, 123
, 323
, 323
, 323

,
65
, 108

06-04-2006

, 65
, 34
, 65,
110
, 59

, 121
, 64
, 62
, 237
, 204
, 80
, 83
, 83
, 124
, 99
, 95, 98


EnjoySAP, 368

, 370
, 3
, 31

, 3

, 3
, 240

, 204
, 208
,
157
,
347348

, 90
STRLEN, 90

-, 123

2006 . SAP AG All rights reserved.


.

407

, 35
, 93

, 227
, 277
, 277
, 295
, 284
, 292
OK-, 292
, 281
, 282
, 291
TABLES, 285
, 276
, 67, 256
, 261
, 62

A
ABAP-, 33
APPEND, 128
AT LINE-SELECTION, 239
AT SELECTION-SCREEN,
265
AUTHORITY-CHECK, 176

B
BAPI, 157, 384
BAPI, 385
BAPI Explorer, 386

BEGIN-OF,
109
LIKE, 85
VALUE, 86
TYPE REF TO, 366
DELETE, 129
DO, 93

E
ERM, 59

F
FORM, 207

CHANGING, 207
USING, 207
FREE, 135

G
GUI-, 323
, 324
GUI-, 323

H
HIDE, 243

I
IF, 92
INSERT, 128, 130

L
LOOP, 129, 131
INTO, 129
INDEX, 132
WHERE,
133

CALL FUNCTION, 354


CALL METHOD, 367
CASE, 92
CLEAR, 90, 135
COLLECT, 129
COMPUTE, 90
CONSTANTS, 87
VALUE, 87
CONSTRUCTOR, 367
CREATE OBJECT, 367

MESSAGE, 94
WITH, 94
MODIFY, 128, 131
MOVE, 89
MOVE-CORRESPONDING,
111

DATA, 85, 109, 125

408

BC400

N
Native SQL, 147
Open SQL, 147

2006 . SAP AG All rights reserved.


.

06-04-2006

BC400

RDBMS, 3
READ, 128
READ TABLE
INDEX, 132
WITH, 133
REFRESH, 135

SET_TABLE_FOR_FIRST_DISPLAY, 373
SORT, 134
AS TEXT,
134
STABLE,
134
SQL, 147
SSCR
, 401
sy-tabix, 131

PAI-, 278
PARAMETERS, 262
PBO-, 278

SAP-
, 395
SAP-
, 369
SELECT, 149
SELECT-OPTIONS, 263
SET PF-STATUS, 328
SET TITLEBAR, 328

06-04-2006

TABLES, 285
TYPES, 83, 109
BEGIN-OF,
109

W
WHILE, 93

2006 . SAP AG All rights reserved.


.

409

410

2006 . SAP AG All rights reserved.


.

BC400

06-04-2006


SAP AG ,
.
, .

06-04-2006

2006 . SAP AG All rights reserved.


.

411