How To Split Posting

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

SAP Integration with Concur Solutions

How to split posting of an expense report

Solution Proposal
TABLE OF CONTENTS
ABOUT THIS DOCUMENT ............................................................................................................................... 3
GENERAL INFORMATION ............................................................................................................................... 3
IMPLICATIONS FOR THE EXPENSE REPORT POSTINGS .......................................................................... 4
IMPLEMENTATION .......................................................................................................................................... 5
Concur enhancements .................................................................................................................................... 5
Prerequisites .................................................................................................................................................... 6
Required BAdIs ................................................................................................................................................ 6
BAdI implementation examples ..................................................................................................................... 7
Example for BADI_CTE_FIN_POST_DATA_CHANGE .................................................................................. 7
Example for BADI_CTE_FIN_POST_DOC_CHANGES ................................................................................. 7
Example for BADI_CTE_FIN_POST_ADJUST_DOC ..................................................................................... 8

Learn more at concur.com

© 2017 SAP SE or an SAP affiliate company. All rights reserved.


No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an SAP affiliate company.

The information contained herein may be changed without prior notice. Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors.
National product specifications may vary.

These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SA P or its affiliated companies shall not be liable
for errors or omissions with respect to the materials. The only warranties for S AP or SAP affiliate company products and services are those that are set forth in the express warranty statements
accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.

In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any relate d presentation, or to develop or release any functionality
mentioned therein. This document, or any related presentation, and SAP S E’s or its affiliated companies’ strategy and possible future developments, products, and/or platform directions and function ality are
all subject to change and may be changed by SAP SE or its affiliated companies at any time for any reason without notice. The information in this document is not a commitment, promise, or legal obligation
to deliver any material, code, or functionality. All forward -looking statements are subject to various risks and uncertainties that could cause actual results to differ mat erially from expectations. Readers are
cautioned not to place undue reliance on these forward -looking statements, and they should not be relied upon in making purchasing decisions.

SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trade marks of SAP SE (or an SAP affiliate company) in Germany and other
countries. All other product and service names mentioned are the trademarks of their respective companies. See http://www.sap.com/corporate-en/legal/copyright/index.epx for additional trademark
information and notices.
ABOUT THIS DOCUMENT

This document is designed to show a potential option how the required information can be handled
in expense reports coming from Concur using SAP Integration with Concur solution.
This is no final solution and the coding shown in this document is just an example and may require
customer specific adjustments.
SAP is not responsible for any errors and will not deliver any support or corrections.

GENERAL INFORMATION

There are different reasons to split an expense report.

• based on the payment scenario e.g. an own document for cash or cach expenses and another one for
company billed company paid (CBCP)
• based on technical reasons e.g. if more than 999 posting lines need to be created for an expense
report (p-card scenarios)
• based on legal reasons, based on Spanish/Italien VAT Handling

Here we use the example of Spanish VAT Handling. You can find some information in this document, but be
aware that this is not the official up-to-date document.

folleto_informativo_SII
_en_gb.pdf

Based on legal requirements, it might be necessary to report additional information for every incoming
invoice. The following information may be required for every single document:

• Invoice number and, where indicated, series

• Type of invoice (simplified or invoice)

• For Imports only:


DUA number and accounting date

• Issue date

• Transaction date, if different from issue date

• Name and surname, or company name


and Tax ID (NIF/CIF) of issuer

• Taxable amount

• VAT Rate

• Deductible VAT amount

• Description of the transaction

• VAT settlement period

3
IMPLICATIONS FOR THE EXPENSE REPORT POSTINGS

Expense reports are normally a collection of multiple invoices and documents, e.g. hotel and flight invoices,
taxi receipts…
The reporting of the above-mentioned information must be done on document level and because some of
the information are derived from the vendor posting it is required to split the document per expense report
entry and to add vendor line items for the corresponding suppliers.
Example: An expense report includes a hotel invoice (120 EUR incl. 20 EUR VAT) and a taxi receipt
(20 EUR incl. 4 EUR VAT).

This would be the default posting created by the Concur integration:


One combined posting for all expense entries:

DEBIT CREDIT

Hotel costs 100 EUR Employee vendor 140 EUR


VAT 20 EUR
Taxi costs 16 EUR
VAT 4 EUR

Now the following postings are required:

Posting for the hotel item:

DEBIT CREDIT

Hotel costs 100 EUR Hotel vendor 120 EUR


VAT 20 EUR

Posting for the taxi item:

DEBIT CREDIT

Taxi costs 16 EUR Taxi vendor 20 EUR


VAT 4 EUR

Additional posting to ensure that the employee is paid and not the hotel and taxi vendor:

DEBIT CREDIT

Hotel vendor 120 EUR Employee vendor 140 EUR


Taxi vendor 20 EUR

Only with such a split it is possible to read some information from the offsetting vendor item. Because it is
not possible to create vendor accounts in SAP for all potential vendors which could be used in an expense
report (all hotels, all taxi companies, all restaurants…) the usage of one-time vendor accounts (CPDs) is
recommended.
And to ensure that the postings to the vendor accounts are not paid by accident a payment block should be
set.

4
IMPLEMENTATION

Concur and SAP are very flexible. This means customers can configure flexible how the required information
are captured in Concur by using different custom fields. Additionally, on SAP ERP side the tax reporting can
be configured differently as well. For that reason, it is not possible to deliver a final version which fits out of
the box for all customers.

Concur enhancements

In Concur it is necessary to add additional fields for the required information. Currently it is only possible to
add them on expense entry level.

In this example, we added these fields:


- Vendor Name (Text field)
- Vendor City (Text field)
- Vendor Country (should be a drop-down with the country table)
- Tax ID (Text field)
- VAT Registration Number (Text field)
- Vendor Invoice Reference (Text field)
- Invoice Data (Date field)
- Invoice Type (in this example a drop-down with the values Invoice (INV) and Simplified Invoice (SIM)

Depending on your implementation other fields may be necessary, too.

5
Prerequisites

To modify the postings as shown above it is required to implement the most actual support package for the
native integration:
- Minimum for SAP ECC customers: SP05
- Minimum for S/4HANA customers: SP02

The corresponding Add-ons and support packages can be found here:


https://launchpad.support.sap.com/#/softwarecenter/search/concur

Required BAdIs

Additionally, it is required to implement BAdIs to split the posting into several documents as shown above. All
required BAdIs can be accessed from the transaction CTE_SETUP  Financial Posting  BAdI
Implementations.
The following BAdIs need an implementation:

1. BADI_CTE_FIN_POST_DATA_CHANGE (Enhance incoming posting data from Concur)


This BAdI implementation is required to transfer the additional information which are available in
custom fields. Only with this implementation the information can be used in other BAdIs.
Normally the additional vendor information must be provided on expense entry level. For that reason,
the method IF_BADI_CTE_FIN_POST_DT_CHANGE~MAP_ENTRY_ADDITIONAL_DATA should
be implemented.

2. BADI_CTE_FIN_POST_DOC_CHANGES (Minor field changes)


Normally all expense items paid by the employee will be condensed into one employee vendor line
item. For this process, it is necessary to create vendor lines per expense entry. By setting different
texts into the employee vendor line items, we avoid the condensation. The creation of additional
vendor line items is now much easier.
In the method IF_BADI_CTE_FIN_POST_DOC_CHANG~CHANGE_SGTXT an implementation is
required to avoid the condensing of employee vendor line items.

3. BADI_CTE_FIN_POST_ADJUST_DOC (Posting data changes)


The actual splitting of the expense report posting will be done in this BADI.
IF_BADI_CTE_FIN_POST_ADJ_DOC~SPLIT_POSTING_DOCUMENT. This method allows to split
postings and to update all posting relevant information.

6
BAdI implementation examples

As already mentioned the following coding examples are just to give an idea how such an
implementation can look like. It is in the customer’s responsibility to enhance and adjust the code to
the individual needs.

Example for BADI_CTE_FIN_POST_DATA_CHANGE

In this example, several additional custom fields are used to transfer the vendor information from Concur to
SAP. Please adjust this coding to the fields used in your landscape!
In case of the field Custom8 we transferred the document date. For that reason the data has to be formatted
into the SAP specific data format.

METHOD if_badi_cte_fin_post_dt_change~map_entry_additional_data.

DATA: ls_add_data TYPE cte_s_additional_data.

ls_add_data-name = 'ENTRY_CUSTOM1_CODE'.
ls_add_data-value = is_entry_data-entry_custom1_code.
APPEND ls_add_data TO et_entry_additional_data.

ls_add_data-name = 'ENTRY_CUSTOM2_CODE'.
ls_add_data-value = is_entry_data-entry_custom2_code.
APPEND ls_add_data TO et_entry_additional_data.

ls_add_data-name = 'ENTRY_CUSTOM3_CODE'.
ls_add_data-value = is_entry_data-entry_custom3_code.
APPEND ls_add_data TO et_entry_additional_data.

ls_add_data-name = 'ENTRY_CUSTOM4_CODE'.
ls_add_data-value = is_entry_data-entry_custom4_code.
APPEND ls_add_data TO et_entry_additional_data.

ls_add_data-name = 'ENTRY_CUSTOM5_CODE'.
ls_add_data-value = is_entry_data-entry_custom5_code.
APPEND ls_add_data TO et_entry_additional_data.

ls_add_data-name = 'ENTRY_CUSTOM8_CODE'.
IF NOT is_entry_data-entry_custom8_code IS INITIAL.
CONCATENATE is_entry_data-entry_custom8_code(4)
is_entry_data-entry_custom8_code+5(2)
is_entry_data-entry_custom8_code+8(2)
INTO ls_add_data-value.
ENDIF.
APPEND ls_add_data TO et_entry_additional_data.

ls_add_data-name = 'ENTRY_CUSTOM9_CODE'.
ls_add_data-value = is_entry_data-entry_custom9_code.
APPEND ls_add_data TO et_entry_additional_data.

ls_add_data-name = 'ENTRY_CUSTOM16_CODE'.
ls_add_data-value = is_entry_data-entry_custom16_code.
APPEND ls_add_data TO et_entry_additional_data.

ENDMETHOD.

Example for BADI_CTE_FIN_POST_DOC_CHANGES

7
To ensure that the employee vendor items are not condensed before the last BAdI is called it is necessary to
set a unique text for every item. Check the item type to ensure that the text is only updated for Vendor line
items. In this example the report key and the report entry ID is used.

METHOD if_badi_cte_fin_post_doc_chang~change_sgtxt.

IF iv_item_type = 'EVD'.
CONCATENATE is_document_data-report_key
is_entry_data-entry_id
INTO cv_sgtxt
SEPARATED BY '-'.
ENDIF.

ENDMETHOD.

Example for BADI_CTE_FIN_POST_ADJUST_DOC

In this example the major implementation is done in the method


if_badi_cte_fin_post_adj_doc~split_posting_document, but two additional methods are created and
need to be copied as well: condense_employee_vendor and get_entry_data.

Method if_badi_cte_fin_post_adj_doc~split_posting_document
All coding section highlighted in yellow must be adjusted to your requirements. Please ensure that you
activated the comment option in Word to get more details.
• At the beginning of this implementation a check for the company code or country should be added to
ensure that this split is not executed for non-Spanish company codes.
• Whenever in this coding a custom field (e.g. 'ENTRY_CUSTOM9_CODE') is read, this coding must be
adjusted to ensure that the correct field is taken.
• In addition, some values are hardcoded and need to be adjusted. This includes for example clearing
accounts and the account number for the CPD vendor account.

METHOD if_badi_cte_fin_post_adj_doc~split_posting_document.

FIELD-SYMBOLS: <ls_split_doc> TYPE cte_s_fin_post_acc_splits,


<ls_accit_old> TYPE accit,
<ls_new_split> TYPE cte_s_fin_post_acc_splits,
<ls_clearing> TYPE cte_s_fin_post_acc_splits,
<ls_cpd_data> TYPE accfi,
<ls_header> TYPE acchd.

DATA: ls_split_add TYPE cte_s_fin_post_acc_splits,


lt_new_split TYPE cte_t_fin_post_acc_splits.
DATA: ls_accit TYPE accit.
DATA: ls_acccr TYPE acccr.
DATA: ls_cpd_new TYPE accfi.
DATA: ls_header TYPE acchd.

DATA: ls_acctx TYPE accbset.


DATA: lv_entry_old TYPE cte_concur_node_id.

DATA: lt_entry_rel TYPE cte_t_fin_post_entry_item_rel,


ls_entry_rel TYPE cte_s_fin_post_entry_item_rel.

DATA: lv_sgtxt_old TYPE sgtxt.


DATA: ls_entry TYPE cte_s_fin_post_doc_entry.
DATA: ls_add TYPE cte_s_additional_data.
DATA: lv_bktxt TYPE bktxt.
DATA: lv_inv_type TYPE char3.
DATA: lv_inv_date TYPE datum.

8
******************************************************************
** Implement a check to ensure that this coding is only processed
** for Spanish expense reports
****************************************************************** Commented [ZH1]: Please add a check to ensure that only
Spanish expense reports are processed with the following coding.

LOOP AT ct_acc_documents ASSIGNING <ls_split_doc>.


** Create single documents per expense entry
lt_entry_rel = <ls_split_doc>-ACC_ITEM_ENTRY_REL.
SORT lt_entry_rel BY entry_id posnr ASCENDING.

SORT <ls_split_doc>-acd_item BY posnr.

LOOP AT lt_entry_rel INTO ls_entry_rel WHERE journal_id IS NOT INITIAL.


** Get invoice reference number and invoice type
READ TABLE is_document_data-
entry INTO ls_entry WITH KEY entry_id = ls_entry_rel-entry_id.
IF sy-subrc = 0.
READ TABLE ls_entry-
additional_data INTO ls_add WITH KEY name = 'ENTRY_CUSTOM5_CODE'. Commented [ZH2]: Replace these custom fields by the one
IF sy-subrc = 0. which are used in your implementation
lv_bktxt = ls_add-value.
ENDIF.
READ TABLE ls_entry-
additional_data INTO ls_add WITH KEY name = 'ENTRY_CUSTOM9_CODE'. Commented [ZH3]: Replace these custom fields by the one
IF sy-subrc = 0. which are used in your implementation
lv_inv_type = ls_add-value.
ENDIF.
READ TABLE ls_entry-
additional_data INTO ls_add WITH KEY name = 'ENTRY_CUSTOM8_CODE'. Commented [ZH4]: Replace these custom fields by the one
IF sy-subrc = 0. which are used in your implementation
lv_inv_date = ls_add-value.
ENDIF.
ENDIF.

READ TABLE <ls_split_doc>-


acd_item ASSIGNING <ls_accit_old> WITH KEY posnr = ls_entry_rel-posnr.

IF ls_entry_rel-entry_id <> lv_entry_old.


lv_entry_old = ls_entry_rel-entry_id.
* A new posting has to be created
APPEND INITIAL LINE TO lt_new_split ASSIGNING <ls_new_split>.

READ TABLE <ls_split_doc>-acd_header INTO ls_header INDEX 1.


APPEND ls_header TO <ls_new_split>-acd_header ASSIGNING <ls_header>.
<ls_header>-bktxt = lv_bktxt.

ENDIF.

* For vendor/clearing account lines create an additional clearing posting

READ TABLE <ls_split_doc>-


acd_curr INTO ls_acccr WITH KEY awtyp = <ls_accit_old>-awtyp
awref = <ls_acci
t_old>-awref
aworg = <ls_acci
t_old>-aworg
posnr = <ls_acci
t_old>-posnr.
ASSERT sy-subrc = 0.
APPEND ls_acccr TO <ls_new_split>-acd_curr.

IF <ls_accit_old>-lifnr IS NOT INITIAL

9
OR <ls_accit_old>-hkont = '0000176880'. Commented [ZH5]: Here we move the items which are relevant
IF <ls_clearing> IS NOT ASSIGNED. for the clearing posting. This includes in addition to the original
APPEND INITIAL LINE TO lt_new_split ASSIGNING <ls_clearing>. employee vendor clearing accounts e.g. for company paid expenses.
APPEND ls_header TO <ls_clearing>-acd_header. Enhance this coding to check for your clearing accounts.
ENDIF.

ls_accit = <ls_accit_old>.
ls_accit-posnr = lines( <ls_clearing>-acd_item ) + 1.
* Reset the SGTXT to the report name
CONCATENATE '*'
is_document_data-report_name
INTO ls_accit-sgtxt.

APPEND ls_accit TO <ls_clearing>-


acd_item. "first take over old vendor line item.
ls_acccr-posnr = ls_accit-posnr.
APPEND ls_acccr TO <ls_clearing>-acd_curr.
* now create CPD line item
<ls_accit_old>-lifnr = '0000001950'. Commented [ZH6]: In this example, we hardcoded the CPD
account. Please add your CPD account code here or enhance the
CLEAR <ls_accit_old>-hkont. coding in case you want to check if the vendor is already created in
IF <ls_accit_old>-bschl = '40'. your system.
<ls_accit_old>-bschl = '21'.
ELSEIF <ls_accit_old>-bschl = '50'.
<ls_accit_old>-bschl = '31'.
ENDIF.

ls_accit = <ls_accit_old>.
ls_accit-posnr = lines( <ls_clearing>-acd_item ) + 1.
*Now create a posting to the same CPD account in the new posting with negative a
mounts
IF ls_accit-bschl = '31'.
ls_accit-bschl = '21'.
ls_accit-shkzg = 'S'.
ELSEIF ls_accit-bschl = '21'.
ls_accit-bschl = '31'.
ls_accit-shkzg = 'H'.
ENDIF.

ls_acccr-wrbtr = ls_acccr-wrbtr * -1.


ls_acccr-posnr = ls_accit-posnr.
APPEND ls_acccr TO <ls_clearing>-acd_curr.

APPEND INITIAL LINE TO <ls_new_split>-acd_fi ASSIGNING <ls_cpd_data>.


<ls_cpd_data>-mandt = sy-mandt.
<ls_cpd_data>-awtyp = <ls_accit_old>-awtyp.
<ls_cpd_data>-awref = <ls_accit_old>-awref.
<ls_cpd_data>-aworg = <ls_accit_old>-aworg.
<ls_cpd_data>-posnr = <ls_accit_old>-posnr.

me->get_entry_data(
EXPORTING
iv_entry_id = ls_entry_rel-entry_id
is_document_data = is_document_data
IMPORTING
ev_name1 = <ls_cpd_data>-name1
ev_ort01 = <ls_cpd_data>-ort01
ev_land1 = <ls_cpd_data>-land1
ev_stcd1 = <ls_cpd_data>-stcd1
ev_stceg = ls_accit-stceg ).

ls_cpd_new = <ls_cpd_data>.
ls_cpd_new-posnr = ls_accit-posnr.

10
APPEND ls_accit TO <ls_clearing>-acd_item.
APPEND ls_cpd_new TO <ls_clearing>-acd_fi.

ENDIF.

* Set document type depending on the invoice type


CASE lv_inv_type.
WHEN 'INV'.
<ls_accit_old>-blart = 'KN'.
WHEN 'SIM'.
<ls_accit_old>-blart = 'RN'.
WHEN OTHERS.
"Should not happen, but then the document type is not changed
ENDCASE. Commented [ZH7]: In case depending on the document type
(Invoice or simplified invoice) it may be relevant to set different
<ls_accit_old>-bldat = lv_inv_date. posting document types. If this is this case please adjust this coding
<ls_accit_old>-stceg = ls_accit-stceg. here
APPEND <ls_accit_old> TO <ls_new_split>-acd_item.

READ TABLE <ls_split_doc>-


acd_tax INTO ls_acctx WITH KEY buzei = <ls_accit_old>-buzei.
IF sy-subrc = 0.
APPEND ls_acctx TO <ls_new_split>-acd_tax.
ENDIF.

ENDLOOP.

** Extra handling for Cash advances


LOOP AT lt_entry_rel INTO ls_entry_rel WHERE journal_id IS INITIAL.
READ TABLE <ls_split_doc>-
acd_item INTO ls_accit WITH KEY posnr = ls_entry_rel-posnr.

READ TABLE <ls_split_doc>-


acd_curr INTO ls_acccr WITH KEY awtyp = ls_accit-awtyp
awref = ls_accit
-awref
aworg = ls_accit
-aworg
posnr = ls_accit
-posnr.
ASSERT sy-subrc = 0.
ls_acccr-posnr = lines( <ls_clearing>-acd_item ) + 1.
APPEND ls_acccr TO <ls_clearing>-acd_curr.

READ TABLE <ls_split_doc>-acd_tax INTO ls_acctx WITH KEY buzei = ls_accit-


buzei.
IF sy-subrc = 0.
APPEND ls_acctx TO <ls_clearing>-acd_tax.
ENDIF.

READ TABLE <ls_split_doc>-


acd_fi INTO ls_cpd_new WITH KEY awtyp = ls_accit-awtyp
awref = ls_accit
-awref
aworg = ls_accit
-aworg
posnr = ls_accit
-posnr.
IF sy-subrc = 0.
ls_cpd_new-posnr = lines( <ls_clearing>-acd_item ) + 1.
APPEND ls_cpd_new TO <ls_clearing>-acd_fi.
ENDIF.

11
ls_accit-posnr = lines( <ls_clearing>-acd_item ) + 1.
APPEND ls_accit TO <ls_clearing>-acd_item.
ENDLOOP. Commented [ZH8]: In case cash advances are not relevant for
ENDLOOP. your implementation then this part can be removed. Otherwise the
cash advance items will be added to the clearing posting
** Now condense the employee vendor lines in the clearing posting
me->condense_employee_vendor(
CHANGING
cs_clearing_posting = <ls_clearing> ).

REFRESH ct_acc_documents.
APPEND LINES OF lt_new_split TO ct_acc_documents.

ENDMETHOD.

Method condense_employee_vendor
This method is called at the end of the method if_badi_cte_fin_post_adj_doc~split_posting_document. This
method should condense the employee vendor postings again into one line.

METHOD condense_employee_vendor.

FIELD-SYMBOLS: <vendor_item> TYPE accit,


<vendor_curr> TYPE acccr.
DATA: ls_vendor_it TYPE accit,
ls_vendor_crr TYPE acccr.
DATA: lv_index TYPE sytabix.

** This condensing does NOT support multiple vendor account e.g. for IBCP credit
cards

LOOP AT cs_clearing_posting-acd_item INTO ls_vendor_it


WHERE lifnr IS NOT INITIAL
AND lifnr <> '0000001950'. "Only the Commented [ZH9]: Please replace this number by your one-
employee vendor lines should be condensed time vendor account ID. In case you implemented a determination if
lv_index = sy-tabix. the vendor is created in SAP then you have to enhance this coding.
IF <vendor_item> IS NOT ASSIGNED. "Remember
the first line and update it
READ TABLE cs_clearing_posting-acd_item ASSIGNING <vendor_item> INDEX sy-
tabix.
READ TABLE cs_clearing_posting-
acd_curr ASSIGNING <vendor_curr> WITH KEY awtyp = <vendor_item>-awtyp
a
wref = <vendor_item>-awref
a
worg = <vendor_item>-aworg
p
osnr = <vendor_item>-posnr.
ELSE.
READ TABLE cs_clearing_posting-
acd_curr INTO ls_vendor_crr WITH KEY awtyp = ls_vendor_it-awtyp
awref
= ls_vendor_it-awref
aworg
= ls_vendor_it-aworg
posnr
= ls_vendor_it-posnr.
IF sy-subrc = 0.
<vendor_curr>-wrbtr = <vendor_curr>-wrbtr + ls_vendor_crr-wrbtr.

12
DELETE cs_clearing_posting-acd_curr INDEX sy-tabix.
DELETE cs_clearing_posting-acd_item INDEX lv_index.
DELETE cs_clearing_posting-acd_fi WHERE awtyp = ls_vendor_it-awtyp
AND awref = ls_vendor_it-awref
AND aworg = ls_vendor_it-aworg
AND posnr = ls_vendor_it-posnr.
ENDIF.
ENDIF.

ENDLOOP.

* Now update the posting key and the SHKZG if needed


IF <vendor_curr>-wrbtr < 0.
<vendor_item>-shkzg = 'H'.
<vendor_item>-bschl = '31'.
ELSE.
<vendor_item>-shkzg = 'S'.
<vendor_item>-bschl = '21'.
ENDIF.

ENDMETHOD.

Method get_entry_data
This method should fill the required one time vendor information, like the name, address and tax IDs. It is
called in the method if_badi_cte_fin_post_adj_doc~split_posting_document.

METHOD get_entry_data.

DATA: ls_entry TYPE cte_s_fin_post_doc_entry.


DATA: ls_add TYPE cte_s_additional_data.

READ TABLE is_document_data-


entry INTO ls_entry WITH KEY entry_id = iv_entry_id.
IF sy-subrc = 0.
READ TABLE ls_entry-
additional_data INTO ls_add WITH KEY name = 'ENTRY_CUSTOM1_CODE'. Commented [ZH10]: Replace these custom fields by the one
which are used in your implementation
IF sy-subrc = 0.
ev_name1 = ls_add-value.
ENDIF.
READ TABLE ls_entry-
additional_data INTO ls_add WITH KEY name = 'ENTRY_CUSTOM2_CODE'. Commented [ZH11]: Replace these custom fields by the one
which are used in your implementation
IF sy-subrc = 0.
ev_ort01 = ls_add-value.
ENDIF.
READ TABLE ls_entry-
additional_data INTO ls_add WITH KEY name = 'ENTRY_CUSTOM3_CODE'. Commented [ZH12]: Replace these custom fields by the one
which are used in your implementation
IF sy-subrc = 0.
ev_land1 = ls_add-value.
ENDIF.
READ TABLE ls_entry-
Commented [ZH13]: Replace these custom fields by the one
additional_data INTO ls_add WITH KEY name = 'ENTRY_CUSTOM4_CODE'. which are used in your implementation

13
IF sy-subrc = 0.
ev_stcd1 = ls_add-value.
ENDIF.
READ TABLE ls_entry-
additional_data INTO ls_add WITH KEY name = 'ENTRY_CUSTOM16_CODE'. Commented [ZH14]: Replace these custom fields by the one
which are used in your implementation
IF sy-subrc = 0.
ev_stceg = ls_add-value.
ENDIF.
ENDIF.

ENDMETHOD

14

You might also like