Code: Alles auswählen.
CALL METHOD /xxx/cl_ano_service_map_date=>get_date
EXPORTING
iv_date = is_source
RECEIVING
rv_date_new = ev_result.
IF ev_result IS INITIAL.
CALL METHOD /xxx/cl_ano_service=>anonymize_date_new
EXPORTING
iv_date = is_source
iv_min = 30
iv_max = 60
RECEIVING
rv_anonymized_date = ev_result.
CALL METHOD /xxx/cl_ano_service_map_date=>set_date
EXPORTING
iv_date_old = is_source
iv_date_new = ev_result.
Code: Alles auswählen.
METHOD get_date.
DATA lt_maptable TYPE /xxx/ano_dat_map_type.
SELECT date_old date_new
FROM /xxx/ano_dat_map
INTO TABLE lt_maptable.
rv_date_new = VALUE #( lt_maptable[ date_old = iv_date ]-date_new OPTIONAL ).
ENDMETHOD.
Code: Alles auswählen.
METHOD set_date.
DATA: ls_line TYPE /xxx/ano_dat_map.
ls_line-date_old = iv_date_old.
ls_line-date_new = iv_date_new.
INSERT INTO /xxx/ano_dat_map VALUES ls_line.
COMMIT WORK.
ENDMETHOD.
Code: Alles auswählen.
ev_result = /xxx/cl_ano_service_map_date=>get_date( is_source ).
if ev_result is initial.
ev_result = /xxx/cl_ano_service=>anonymize_date_new(
iv_date = is_source
iv_min = 30
iv_max = 60 ).
/xxx/cl_ano_service_map_date=>set_date( iv_date_old = is_source
iv_date_new = ev_result ).
...
endif.
Code: Alles auswählen.
METHOD set_date.
DATA(ls_line) = VALUE /xxx/ano_dat_map( date_old = iv_date_old
date_new = iv_date_new ).
INSERT INTO /xxx/ano_dat_map VALUES ls_line.
COMMIT WORK.
ENDMETHOD.