Homelab, Linux, JS & ABAP (~˘▾˘)~
 

[ABAP] Ermittle Sachkonto zu symbolischen Konto aus FI System

DATA(service_manager) = NEW cl_hrpp_ws_service_manager( ).

SELECT * INTO TABLE @DATA(lt_t52el) FROM t52el  WHERE molga = '01' AND symko <> @space AND endda >= @pn-begps. " Verknüpfung Lohnart zu symbolischen Konto
SELECT * INTO TABLE @DATA(lt_t52ek) FROM t52ek.                                                                " Symbolische Konten
SELECT * INTO TABLE @DATA(lt_t52ep) FROM t52ep.                                                                " Kontierungsarten

 LOOP AT lt_t52el INTO DATA(ls_t52el). " Ermittle je Lohnart die symbolischen Konten (1:n)

      TRY.
          DATA(ls_t52ek) = lt_t52ek[ symko = ls_t52el-symko ].   " Ermittele Kontierungsart
          DATA(ls_t52ep) = lt_t52ep[ koart = ls_t52ek-koart ].   " Ermittele Typ des symbolischen Kontos
          DATA(process)  = CONV ktosl( 'HR' && ls_t52ep-kttyp ).
        CATCH cx_sy_itab_line_not_found.
          CONTINUE.
      ENDTRY.

      service_manager->hrpp_fi_acct_det_hr( EXPORTING companycode        = pernr-bukrs
                                                      process            = process              " Vorgangsschlüssel
                                                      symb_acct          = ls_t52el-symko
                                                      eg_acct_det        = CONV #( '1' )        " Überleitung FI/CO: Mitarbeitergruppierung Kontenfindung: alle Mitarbeiter
                                            IMPORTING gl_account_debit   = DATA(account_debit)
                                                      gl_account_credit  = DATA(account_credit)
                                                      return_tab         = DATA(return_tab) ).
      IF line_exists( return_tab[ type = 'E' ] ).
        CONTINUE.
      ENDIF.

      " Lese Sachkonto Text
      service_manager->hrpp_gl_acc_getdetail( EXPORTING companycode    = pernr-bukrs
                                                        glacct         = account_debit
                                                        language       = sy-langu
                                                        text_only      = abap_true
                                              IMPORTING account_detail = DATA(account_detail) ).

 ENDLOOP.

Leave a Reply

Your email address will not be published. Required fields are marked *