FUNCTION YBS_FIIL_RECORD.
*"----------------------------------------------------------------------
*"*"Локальный интерфейс:
*" CHANGING
*" REFERENCE(RESULT_PACKAGE) TYPE ANY TABLE
*"----------------------------------------------------------------------
data: lf_idx type i.
FIELD-SYMBOLS: <ls_line> type any,
<fs> type any.
loop at result_package ASSIGNING <ls_line>.
lf_idx = lf_idx + 1.
ASSIGN COMPONENT 'RECORD' of STRUCTURE <ls_line> to <fs>.
if sy-subrc = 0.
<fs> = lf_idx.
endif.
endloop.
ENDFUNCTION.
________________
Или немного проще:
*"----------------------------------------------------------------------
*"*"Локальный интерфейс:
*" CHANGING
*" REFERENCE(RESULT_PACKAGE) TYPE ANY TABLE
*"----------------------------------------------------------------------
data: lf_idx type i.
FIELD-SYMBOLS: <ls_line> type any,
<fs> type any.
loop at result_package ASSIGNING <ls_line>.
lf_idx = lf_idx + 1.
ASSIGN COMPONENT 'RECORD' of STRUCTURE <ls_line> to <fs>.
if sy-subrc = 0.
<fs> = lf_idx.
endif.
endloop.
ENDFUNCTION.
________________
Или немного проще:
LOOP at RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>.
<RESULT_FIELDS>-RECORD = sy-tabix.
ENDLOOP.
Комментариев нет:
Отправить комментарий