" Definition part of the class
class zcl_ua_fieb_change_bs_data definition
public
final
create public .
public section.
types:
tt_febcl type standard table of febcl with default key .
class-methods process_line
importing
!iv_note_to_payee type string
changing
!cs_febko type febko
!cs_febep type febep
!ct_febcl type standard table .
protected section.
private section.
types:
begin of ty_default_rules,
inc_down_payment type febep-vgint,
default_in type febep-vgint,
default_out type febep-vgint,
end of ty_default_rules.
class-data: ms_default_posting_rules type ty_default_rules.
constants:
begin of c_operation_sign,
plus type t028g-vozpm value '+' ##NO_TEXT,
minus type t028g-vozpm value '-' ##NO_TEXT,
end of c_operation_sign.
class-methods cache_default_posting_rules
importing
is_febko type febko.
endclass.
class zcl_ua_fieb_change_bs_data implementation.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Static Private Method ZCL_UA_FIEB_CHANGE_BS_DATA=>CACHE_DEFAULT_POSTING_RULES
* +-------------------------------------------------------------------------------------------------+
* | [--->] IS_FEBKO TYPE FEBKO
* +--------------------------------------------------------------------------------------</SIGNATURE>
method cache_default_posting_rules.
constants:
begin of lc_btc_keys,
inc_down_payment type febep-vgext value 'INCDP' ##NO_TEXT,
default_key type febep-vgext value 'UNALLOCATED' ##NO_TEXT,
end of lc_btc_keys.
if ms_default_posting_rules is not initial.
return.
endif.
" Select all assignments of BTC-codes to posting rules
data lt_rules type standard table of t028g with default key.
select *
from t028g
into table lt_rules
where vgtyp = is_febko-vgtyp.
if sy-subrc <> 0.
return.
endif.
data ls_rule like line of lt_rules.
" Get posting rule for incoming down-payments
read table lt_rules
into ls_rule
with key vgext = lc_btc_keys-inc_down_payment vozpm = c_operation_sign-plus.
if sy-subrc = 0 and ls_rule-vgint <> ''.
ms_default_posting_rules-inc_down_payment = ls_rule-vgint.
endif.
clear: ls_rule.
" Get default posting rule for miscellaneous incoming payments
read table lt_rules
into ls_rule
with key vgext = lc_btc_keys-default_key vozpm = c_operation_sign-plus.
if sy-subrc = 0 and ls_rule-vgint <> ''.
ms_default_posting_rules-default_in = ls_rule-vgint.
endif.
clear: ls_rule.
" Get default posting rule for miscellaneous outgoing payments
read table lt_rules
into ls_rule
with key vgext = lc_btc_keys-default_key vozpm = c_operation_sign-minus.
if sy-subrc = 0 and ls_rule-vgint <> ''.
ms_default_posting_rules-default_out = ls_rule-vgint.
endif.
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Static Public Method ZCL_UA_FIEB_CHANGE_BS_DATA=>PROCESS_LINE
* +-------------------------------------------------------------------------------------------------+
* | [--->] IV_NOTE_TO_PAYEE TYPE STRING
* | [<-->] CS_FEBKO TYPE FEBKO
* | [<-->] CS_FEBEP TYPE FEBEP
* | [<-->] CT_FEBCL TYPE STANDARD TABLE
* +--------------------------------------------------------------------------------------</SIGNATURE>
method process_line.
cache_default_posting_rules( cs_febko ).
" Assign a posting rule for customer down-payment
cs_febep-vgint = ms_default_posting_rules-inc_down_payment.
endmethod.
endclass.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
4 | |
4 | |
2 | |
2 | |
1 | |
1 |