cancel
Showing results for 
Search instead for 
Did you mean: 

How to Post Outgoing Payments with Business Object Interface

Neil_Lee_057
Explorer
0 Kudos

Dear Experts,

(Environment: S/4HANA CLOUD Public 2308)

I have done "Posting" with standard App - Post Outgoing Payments at Fiori Launchpad

But In my business logic, I have to get the same result with my program.

So I tried this Business Object Interface

https://api.sap.com/bointerface/I_JOURNALENTRYTP

The scenario: Account Type/Account ID column is Supplier

May I inquire whether the i_journalentrytp interface is capable of handling scenarios involving posting payments to suppliers?

Do you have any example programs available?

The following is my test program, but it dumps before MODIFY ENTITIES during execution.

  METHOD if_oo_adt_classrun~main.
DATA: lt_je_deep TYPE TABLE FOR ACTION IMPORT i_journalentrytp~post,
lv_cid TYPE abp_behv_cid.
TRY.
lv_cid = to_upper( cl_uuid_factory=>create_system_uuid( )->create_uuid_x16( ) ).
CATCH cx_uuid_error.
ASSERT 1 = 0.
ENDTRY.
APPEND INITIAL LINE TO lt_je_deep ASSIGNING FIELD-SYMBOL(<je_deep>).
<je_deep>-%cid = lv_cid.
<je_deep>-%param = VALUE #(
companycode = '6310' " Success
documentreferenceid = 'BKPFF'
createdbyuser = 'CB9980000038'
businesstransactiontype = 'RFBU'
accountingdocumenttype = 'KZ'
documentdate = sy-datlo
postingdate = sy-datlo
accountingdocumentheadertext = 'TEST rules'
_glitems = VALUE #(
( glaccountlineitem = |001|
glaccount = '0011008000'
HouseBank = 'TWDP1'
HouseBankAccount = 'TWDPA'
ValueDate = sy-datlo
_currencyamount = VALUE #( ( currencyrole = '00'
journalentryitemamount = '-26,250'
currency = 'TWD' ) ) ) )
_apitems = VALUE #(
( glaccountlineitem = |002|
Supplier = '0063100088'
GLAccount = '5100000024'
_currencyamount = VALUE #( ( currencyrole = '00'
journalentryitemamount = '26,250'
currency = 'TWD'
) ) ) ) ).
MODIFY ENTITIES OF i_journalentrytp
ENTITY journalentry
EXECUTE post FROM lt_je_deep
FAILED DATA(ls_failed_deep)
REPORTED DATA(ls_reported_deep)
MAPPED DATA(ls_mapped_deep).
IF ls_failed_deep IS NOT INITIAL.
ELSE.
COMMIT ENTITIES BEGIN
RESPONSE OF i_journalentrytp
FAILED DATA(lt_commit_failed)
REPORTED DATA(lt_commit_reported).
COMMIT ENTITIES END.
ENDIF.
ENDMETHOD.

ENDMETHOD.

How can I do to fixed this issue.

Thank you in advance for your help.

Eric_Yu
Advisor
Advisor
0 Kudos

change the tag to SAP S/4HANA Cloud for Finance

Accepted Solutions (0)

Answers (1)

Answers (1)

OwenLiu
Product and Topic Expert
Product and Topic Expert
0 Kudos

There is not an API for outgoing payment.

For functionality not part of the standard design.

Best Regards,
Owen