Code: Alles auswählen.
SORT RESULT_PACKAGE STABLE BY /bic/prz_be ASCENDING
/bic/prz_eg ASCENDING.
LOOP AT RESULT_PACKAGE ASSIGNING <result_fields>.
IF lv_old ne <result_fields>-/BIC/PRZ_TN.
lv_index = lv_index + 1.
lv_old = <result_fields>-/BIC/PRZ_TN.
ENDIF.
<Result_Fields>-/BIC/PRZ_IN = lv_index.
ENDLOOP.
Code: Alles auswählen.
IF lv_old ne <result_fields>-/BIC/PRZ_TN.
CLEAR lv_index.
lv_old = <result_fields>-/BIC/PRZ_TN.
ENDIF.
lv_index = lv_index + 1.
Code: Alles auswählen.
Code: Alles auswählen.
TYPES: BEGIN OF fieldtype,
chain_id TYPE rspc_chain,
txtlg TYPE rstxtlg,
END OF fieldtype.
DATA: it_tab TYPE STANDARD TABLE OF fieldtype,
wa_tab TYPE fieldtype,
lt_chaint TYPE rspc_t_chaint,
wa_chaint TYPE rspcchaint,
lv_old TYPE /bic/oiprz_tn,
lv_index TYPE i.
LOOP AT RESULT_PACKAGE ASSIGNING <result_fields>.
wa_chaint-chain_id = <result_fields>-/bic/prz_tn.
APPEND wa_chaint TO lt_chaint.
ENDLOOP.
IF RESULT_PACKAGE IS NOT INITIAL.
SELECT chain_id
txtlg
FROM rspcchaint INTO CORRESPONDING FIELDS OF TABLE
it_tab
FOR ALL ENTRIES IN lt_chaint WHERE
chain_id = lt_chaint-chain_id.
IF sy-subrc = 0.
SORT it_tab BY chain_id.
ENDIF.
ENDIF.
LOOP AT RESULT_PACKAGE ASSIGNING <result_fields>.
READ TABLE it_tab INTO wa_tab WITH KEY
chain_id = <result_fields>-/bic/prz_tn BINARY SEARCH.
IF sy-subrc = 0.
<result_fields>-/bic/prz_be = wa_tab-txtlg.
ENDIF.
ENDLOOP.
SORT RESULT_PACKAGE STABLE BY /bic/prz_TN ASCENDING
/bic/prz_eg ASCENDING.
LOOP AT RESULT_PACKAGE ASSIGNING <result_fields>.
lv_old = <result_fields>-/bic/prz_tn.
lv_index = 1.
IF lv_old NE <result_fields>-/bic/prz_tn.
CLEAR lv_index.
lv_old = <result_fields>-/bic/prz_tn.
ENDIF.
lv_index = lv_index + 1.
<result_fields>-/bic/prz_IN = lv_index.
ENDLOOP.
break initdev4.
Code: Alles auswählen.
lv_old = <result_fields>-/bic/prz_tn.
lv_index = 1.
Code: Alles auswählen.
LOOP AT RESULT_PACKAGE ASSIGNING <result_fields>.
IF lv_old = <result_fields>-/bic/prz_tn.
lv_index = lv_index + 1.
<result_fields>-/bic/prz_IN = lv_index.
ELSE.
Clear lv_index.
lv_old = <result_fields>-/bic/prz_tn.
<result_fields>-/bic/prz_IN = lv_index.
ENDIF.
ENDLOOP.
Code: Alles auswählen.
CLEAR lv_index.