forked from kkayacan/abap-reference
-
Notifications
You must be signed in to change notification settings - Fork 2
/
POPUP_GET_VALUES.abap
48 lines (39 loc) · 1.09 KB
/
POPUP_GET_VALUES.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
FORM ask_for_values CHANGING ep_doc_date
ep_ref_doc_no.
DATA:
lt_fields TYPE TABLE OF sval,
ls_fields LIKE LINE OF lt_fields,
lv_rc TYPE c LENGTH 1.
CLEAR: ep_doc_date, ep_ref_doc_no.
ls_fields-tabname = 'BKPF'.
ls_fields-fieldname = 'BUDAT'.
ls_fields-fieldtext = TEXT-t08.
ls_fields-value = sy-datum.
APPEND ls_fields TO lt_fields. CLEAR ls_fields.
ls_fields-tabname = 'BKPF'.
ls_fields-fieldname = 'XBLNR'.
ls_fields-fieldtext = TEXT-t09.
ls_fields-novaluehlp = 'X'.
APPEND ls_fields TO lt_fields. CLEAR ls_fields.
CALL FUNCTION 'POPUP_GET_VALUES'
EXPORTING
popup_title = TEXT-t07
IMPORTING
returncode = lv_rc
TABLES
fields = lt_fields
EXCEPTIONS
error_in_fields = 1
OTHERS = 2.
IF lv_rc = 'A'.
RETURN.
ENDIF.
READ TABLE lt_fields INTO ls_fields INDEX 1.
IF sy-subrc = 0.
ep_doc_date = ls_fields-value.
ENDIF.
READ TABLE lt_fields INTO ls_fields INDEX 2.
IF sy-subrc = 0.
ep_ref_doc_no = ls_fields-value.
ENDIF.
ENDFORM.