SHARE
TWEET

Untitled

a guest Nov 19th, 2019 172 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. FUNCTION ZLAB4TASK2_FLIGHTS_DATA.
  2. *"----------------------------------------------------------------------
  3. *"*"Локальный интерфейс:
  4. *"  TABLES
  5. *"      SHLP_TAB TYPE  SHLP_DESCT
  6. *"      RECORD_TAB STRUCTURE  SEAHLPRES
  7. *"  CHANGING
  8. *"     REFERENCE(SHLP) TYPE  SHLP_DESCR
  9. *"     REFERENCE(CALLCONTROL) LIKE  DDSHF4CTRL STRUCTURE  DDSHF4CTRL
  10. *"----------------------------------------------------------------------
  11.  
  12.   " Заполняем структуру аналогично как в полях средства поиска
  13.  TYPES:
  14.  BEGIN OF ts_source,
  15.     CARRID TYPE S_CARR_ID,
  16.     CONNID TYPE S_CONN_ID,
  17.     PRICE TYPE S_PRICE,
  18.   END   OF ts_source,
  19.   tt_source TYPE TABLE OF ts_source.
  20.  
  21. *   Записываем структуру и таблицу
  22.   DATA:
  23.           lt_source TYPE tt_source
  24.         , ls_source TYPE ts_source
  25.         .
  26.  
  27.   IF callcontrol-step <> 'SELECT'.
  28.     callcontrol-no_maxdisp = abap_true.
  29.     EXIT.
  30.   ENDIF.
  31.  
  32.   " Здесь заполняем таблицу lt_source
  33.   SELECT carrid, connid, price FROM sflight INTO TABLE @lt_source.
  34.  
  35.   " Заполняем таблицу record_tab с помощью фм F4UT_RESULTS_MAP
  36.   CALL FUNCTION 'F4UT_RESULTS_MAP'
  37.     EXPORTING
  38.      apply_restrictions = abap_true
  39.    TABLES
  40.         shlp_tab           = shlp_tab
  41.         record_tab         = record_tab
  42.         source_tab         = lt_source
  43.       CHANGING
  44.         shlp               = shlp
  45.         callcontrol        = callcontrol
  46.       EXCEPTIONS
  47.         illegal_structure  = 1
  48.         OTHERS             = 2.
  49.  
  50.   IF sy-subrc <> 0.
  51.     callcontrol-step = 'EXIT'.
  52.   ELSE.
  53.     callcontrol-step = 'DISP'.
  54.   ENDIF.
  55.  
  56. ENDFUNCTION.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top