-
Notifications
You must be signed in to change notification settings - Fork 0
/
ZSK_EMPTY_FOR_ALL_ENTRIES.ABAP
49 lines (40 loc) · 1.17 KB
/
ZSK_EMPTY_FOR_ALL_ENTRIES.ABAP
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
*&---------------------------------------------------------------------*
*& Report ZSK_DEMO
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZSK_EMPTY_FOR_ALL_ENTRIES.
TABLES: MARA, MAKT.
TYPES: BEGIN OF TY_MARA,
MATNR TYPE MARA-MATNR,
MTART TYPE MARA-MTART,
MBRSH TYPE MARA-MBRSH,
MATKL TYPE MARA-MATKL,
END OF TY_MARA,
BEGIN OF TY_MAKT,
MATNR TYPE MAKT-MATNR,
SPRAS TYPE MAKT-SPRAS,
MAKTX TYPE MAKT-MAKTX,
END OF TY_MAKT.
DATA: IT_MARA TYPE TABLE OF TY_MARA,
WA_MARA TYPE TY_MARA,
IT_MAKT TYPE TABLE OF TY_MAKT,
WA_MAKT TYPE TY_MAKT.
START-OF-SELECTION.
SELECT MATNR
MTART
MBRSH
MATKL
FROM MARA INTO TABLE IT_MARA WHERE MATNR = 'Something_that_doesn't_exist'.
SELECT MATNR
SPRAS
MAKTX
FROM MAKT INTO TABLE IT_MAKT FOR ALL ENTRIES IN IT_MARA WHERE MATNR = IT_MARA-MATNR.
IF IT_MARA IS INITIAL.
WRITE: 'MARA IS EMPTY'.
ENDIF.
IF IT_MAKT IS NOT INITIAL.
WRITE: 'BUT MAKT HAS DATA.'.
ENDIF.