METHOD if_ex_faa_doclines_customer~change_document.
DATA: ls_accit TYPE accit,
lv_ktopl TYPE ktopl,
lv_konto TYPE saknr,
ls_t001 TYPE t001.
SELECT SINGLE * FROM t001
INTO @DATA(s_t001)
WHERE bukrs EQ @is_posting_data-bukrs.
IF sy-subrc IS INITIAL.
IF is_posting_data-kostl IS NOT INITIAL.
SELECT * FROM fiaatrc_realloc
INTO TABLE @DATA(t_realloc)
FOR ALL ENTRIES IN @ct_accit
WHERE ktopl EQ @s_t001-ktopl
AND kokrs EQ @ct_accit-kokrs
AND kostl1 EQ @is_posting_data-kostl
AND kostl2 EQ @is_posting_data-kostl
AND vbrkon EQ @ct_accit-hkont
AND konto NE @space.
IF sy-subrc IS INITIAL.
TYPES ty_shkzg TYPE RANGE OF shkzg.
DATA(r_shkzg) = VALUE ty_shkzg( sign = 'I' option = 'EQ'
( low = 'S' )
( low = 'H' )
).
LOOP AT ct_accit ASSIGNING FIELD-SYMBOL(<accit>)
WHERE shkzg IN r_shkzg.
READ TABLE t_realloc ASSIGNING FIELD-SYMBOL(<realloc>)
WITH KEY kokrs = <accit>-kokrs
vbrkon = <accit>-hkont.
IF sy-subrc IS INITIAL.
<accit>-hkont = <realloc>-konto.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDIF.
ENDMETHOD.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.