TBB1: using vendor subledger for postings in TRM.
I still don’t understand why TRM using only customer subledger for posings.
And even it written in “SAP Treasury and Risk Management” book by SAP-press
It is not very usefull for the processes in treasury to separate the two subledger
some Customers who implement TRM demand posting to Vendors subledger when they need!
Ok, it’s not a problem.
All you need:
- Connect Vendor and customer master datas to Business partner (Business Partner creation from Vendor master data for Transaction Manager)
- Posting Specification for Customer (usually it is: Dt Gl account, Cr Customer; + Payment flag set)
- ABAP skills and badi TPM_ACCIF_TRAC
Within badi TPM_ACCIF_TRAC there is method ACCIT_EXIT “Changes the Entire Structure”, and within the method there are structures CH_ACCIT_D (debit position) and CH_ACCIT_C (credit position).
According to posting specification Gl account is situated in CH_ACCIT_D, customer – CH_ACCIT_C.
We need to make posting: Dt Gl account, Cr Vendor.
For that inside the method we do the changes to the following fields in structures:
CH_ACCIT_C-BLART = KZ /*you can use other doc type*/
BSCHL = 31
KOART = K
LIFNR = Vendor /*you can read vendor id from Business partner*/
KUNNR = ‘ ‘ /*make empty*/
NOMINAL_AMT = add minus sign to amount
HKONT = reconciliaton account of the vendor /*you can read reconc. account id number from vendor master data*/
CH_ACCIT_D-BLART = KZ
DATA: kont TYPE akont, " Reconciliation account.
vend TYPE lifnr, " Vendor.
kontrh TYPE tb_kunnr_new. "BP from transaction.
" To read some data which is not available in
" im_data structure.
FIELD-SYMBOLS <fs_vtbfha> TYPE vtbfha.
ASSIGN ('(RFTBBB00)VTBFHA') TO <fs_vtbfha>.
" Check if we need to do postings to vendor
" You can use CHARACTERISTICS field on Administ. tab.
" or checkbox on custom tab, or ...
IF <fs_vtbfha>-merkm = 'VENDOR'.
" Here we search GUID from BUT000, then Vendor from CVI_VEND_LINK with GUID.
kontrh = <fs_vtbfha>-kontrh.
SELECT SINGLE p~vendor
INTO vend
FROM but000 AS c
INNER JOIN cvi_vend_link AS p ON c~partner_guid = p~partner_guid
WHERE c~partner = kontrh.
" Here we look for reconciliation account.
SELECT SINGLE akont
FROM lfb1
INTO kont
WHERE lifnr = vend.
" Fields to change
" CH_ACCIT_C structure
ch_accit_c-nominal_amt = ( -1 ) * ch_accit_c-nominal_amt. " Add minus sign to nominal amount.
ch_accit_c-blart = 'KZ'. "you can use other doc type*/
ch_accit_c-bschl = '31'.
ch_accit_c-koart = 'K'.
ch_accit_c-lifnr = vend. " Vendor /*you can read vendor id from Business partner*/
ch_accit_c-kunnr = ' '. "/*make empty*/
ch_accit_c-hkont = kont ."reconciliaton account of the vendor /*you can read reconc. account id number from vendor master data*/
" CH_ACCIT_D structure
ch_accit_d-blart = 'KZ'.
ENDIF.
ENDIF
Scenario
We have the following conditions (only screenshot)
We need to have parameter to triger posting to vendor subledger.
I usually use Characteristics field. You can add search help to enter VENDOR parameter. You can even rename the field.
Or you can use checkbox on custome tab.
Everything is up to you.
In order to use F110 transaction – automatic payment program – and make payment to vendor, you have to enter proper payment details
For incoming payment you have to enter only House bank and Account ID.
For outgoing payemnt parameter are different
The whole posting scheme is:
Incoming payment
Transaction | Postings (credit) | Comments | Postings (debit) | Comments |
---|---|---|---|---|
TBB1 | Cr 66 | Account symbol 1 | Dt 51.9 | Сlearing account |
Bank statement | Cr 51.9 | Сlearing account | Dt 51 | Money |
Nominal interest
Transaction | Postings (credit) | Comments | Postings (debit) | Comments |
---|---|---|---|---|
TBB1 | Cr Vendor | Usually alternative reconc. account | Dt 91 | Expenses |
F110 | Cr 51.9 | Сlearing account | Dt Vendor | |
Bank statement | Cr 51 | Money | Dt 51.9 | Сlearing account |
Final repayment
Transaction | Postings (credit) | Comments | Postings (debit) | Comments |
---|---|---|---|---|
TBB1 | Ct Vendor | Standard reconc. account | Dt 66 | Account symbol 1 |
F110 | Ct 51.9 | Сlearing account | Dt Vendor | |
Bank statement | Ct 51 | Money | Dt 51.9 | Сlearing account |
Configuration.
We need to adjust postings scheme to the postings above.
Final repayment:
As we use Vendor subledger don’t forget to set check mark to payment
Pay attention to Debit and Credit entries and adjust posting keys respectively
Nominal interest
Postings scheme for incoming payment is quite easy. You can do it yourself.
Postings
Hint: don’t pay attention to Vendor reconciliation account in posting log – everything will be allright with posting.
I don’t know why it appers, i will try to check it and correct the article.
As you can see payment to vendor is done!
Good information,
Thanks bro.
You are welcome!
Hi Grigoriy, is me again can you please explain in detail how in LIFNR can I read the vendor from BP?
How can I add the minus sign to the amount?
How I can read the reconciliation account from the vendor??
Many THANKS in advance!!
Santiago
Hello, Sangiago,
DATA: kont TYPE akont, " Reconciliation account.
vend TYPE lifnr, " Vendor.
kontrh TYPE tb_kunnr_new. "BP from transaction.
FIELD-SYMBOLS <fs_vtbfha> TYPE vtbfha.
" You can use IM_DATA-TAB_BP, but there you'll find nested structure
ASSIGN ('(RFTBBB00)VTBFHA') TO <fs_vtbfha>.
kontrh = <fs_vtbfha>-kontrh. "BP from transaction.
" Add minus sign to nominal amount.
ch_accit_c-nominal_amt = ( -1 ) * ch_accit_c-nominal_amt.
" Here we seacht GUID from BUT000, then Vendor from CVI_VEND_LINK with GUID.
SELECT SINGLE p~vendor
INTO vend
FROM but000 AS c
INNER JOIN cvi_vend_link AS p ON c~partner_guid = p~partner_guid
WHERE c~partner = kontrh.
" Here we look for reconciliation account.
SELECT SINGLE akont
FROM lfb1
INTO kont
WHERE lifnr = vend.
Thanks a lot Grigoriy! thats in the ABAP-BADI side, but in configuration and functional part how would it work? Know I can configure with a 01 - 31 (Vendor)? or it would appear a new field (user exit) on TBB1?
Thanks A LOT!
The fact here with my customer is that the have intercompany loans so they have created the subsidiaries as Clients and Vendors so they are requesting to post in both subledgers accordingly.
Best Regards
Santiago
1. I use field "Characteristics" on Administr. tab to triger postings to customers or to vendors.
You can attach search help to this field in order to enter data, or you can enter data manually.
Or you can create checkbox on custom tab. It's up to you.
We need this to triger our code in BADI - to change postings or not.
2. We need to think about postings schemes. Where Vendors must appear in postings - use Account Symbol "2" and proper posting key.
Generally that's all.
There is no any new fields on TBB1 selection screen.
If i have a spare time - i will update my article with more screenshots and descriptions about configuration and examples.
Hi Grigori, sorry for being such a pain... but really Im trying but isn´t working for me. I linked the BP to the Vendor through FLBPC2 and the BP role FLVN01. We activated the BADI through the field Characteristics in additional fields. The configuration is as follows:
Crt 21 with Acct Symbol 2
Dbt 50 with Acct Symbol 3.2
And what ir really posting is:
Crt 21 to Customer 1700005 (BP)
Dbt 31 to a Recon Account
With Error No account Especified in Item 000000002
PLEASE HELP!!
Thanks again!!
Hello, Santiago, i have updated my article - check it.
MEGA LIKE THANKS!!!!!! 😀
Hope it helped you.
Hi,Grigoriy Babitskiy
In TRM security model,When i first buy stock(01A) 100 UNIT,later ,l Sell Stock 150 Unit,i have only 100 unit on my hand, how to achieve that? Thank you !
Best Wish!
Bernard
Hi Grigoriy Babitskiy
Thank you to share your knowledge with us.
Excellent job.
Best Regards.
Jandoval Nascimento
You are welcom. It's a pleasure for me.
Useful information.
Regards,
Jyoti
Very nice article Grigoriy Babitskiy !!! Keep it up.
Cheer !
Adi...
Hi Grigoriy Babitskiy! Very good article!
Quick question though: I think it would be easier, processwise, to have a 3rd radio button added to the control data in the outgoing payment parameter, right? That way it is explicit for the end user that he/she will post to a vendor account, not a customer account.
I don't have very good ABAP skills, so I ask: the changes in the code you did there, do they replace the posting from the customer subledger to the vendor subledger? Or you could do anyway postings to the customer subledger the standard way, provided the account determination is set up accordingly?
Thanks!
Hello Joao Ferreira. Thank you for your feedback!
You are absolutely right! But this is quite diffficult as there is no any user exit which allow us to define any radio button.
But we can use one possibility to redefine the existing field - "Pmt Meth.Suppl."
Check tr. SM30 -> V_T042. If checkmark is not set, then we can use this field.
1. tr. SM30 -> V_T042F
2. FTR_CREATE / FTR_EDIT -> "Payment details" tab: field "Pmt Meth. Suppl." - Customer.
Then you have to analyze tables VTBFHAPO or VTBZV and correct the code in article.
But once again - think thoroughly about field "Payment method supplement" - if it is resonable to redefine it.
The system by default prepare TRM to make posting to customer subledger. In user exit, i do replacement customer account with vendor account depending on condition (field Characteristic. If field is emtpy - no replacement, posting to customer. If field is filed with "VENDOR" - do replacement and post to vendor) and some other posting paramters in order to make payment to vendor subledger.
In my case the posting specification is set up to do posting to customer. But for my case it is okey just to replace customer account with vendor and some other posting parameters. Your case might be different. You have to analyze it and adjust my code for your requirement.
Very Useful Info
Thanks
Regards,
Swaroop Gujarathi
You are welcom!
thanks
Hi Grigoriy,
I'm just checked your article, I have same like similar requirement.please help me.
Requirement:Project Loan(55A)
1. Vendor A/C Dr xxxxx (100% directly released by Bank on submission documents by client)
To Loan A/C Cr xxxxx (100% from loan account to be released by Bank)
Accounting (tbb1)should generate as below instead of bank a/c, Vendor ac should be debited.
Hi Grigoriy,
Please respond to the above query.
Please can any one help me regards to the above post.
Hi Grigoriy,
As you mentioned in the blog below BADI has mentioned changes for posting
Dr GL Acct and Cr Vendor Acct.
Please suggest what are the changes required for posting Dr Vendor Acct and Cr GL Acct.
Please request to need your help in this matter.
Hi Grigoriy,
As you mentioned in the blog below BADI has mentioned changes for posting
Dr GL Acct and Cr Vendor Acct.
Please suggest what are the changes required for posting Dr Vendor Acct and Cr GL Acct.
Please request to need your help in this matter.
Now even we have similar requirement like while postingTBB1 but (Dr Vendor Acct and Cr GL acct). ABAPER is trying by referencing your article but we are facing issues in fetching below tables and fields.Please can you suggest and share the steps in detailed.
As per the below please maintain data for CVI_VEND_LINK.
BUKRS : 1110
RFHA : 31
Pass ‘KONTRH’ value of table ‘VTBFHA’ in ‘PARTNER’ field of table ‘BUT000 ‘.
From ‘BUT000’ table get the ‘PARTNER_GUID’.
For this PARTNER_GUID you need to maintain data in ‘CVI_VEND_LINK ’ table.
Thanks,
Prasad
Hi Griogoriy, Please can you respond to above concerns.
Hello,
You need:
1. Posting specification: Dt Customer, Cr Gl account
2. Changing parameters in code:
CH_ACCIT_D-BLART = KZ /*you can use other doc type*/
BSCHL = 31
KOART = K
LIFNR = Vendor /*you can read vendor id from Business partner*/
KUNNR = ' ' /*make empty*/
NOMINAL_AMT = add minus sign to amount
HKONT = reconciliaton account of the vendor /*you can read reconc. account id number from vendor master data*/
CH_ACCIT_C-BLART = KZ
I don't understand what is the trouble?
I wrote you what you need to chagne. The other parameters do not change.
Thank you so much for your reply Grigoriy 🙂
We Will follow the coding as you suggested and confirm you the status.
For Functional side changes as you mentioned in the article remains the same for posting specification and in payment details tab or using payment request with/without do we need to do additional config please suggest. Your advice is so much valuable.
Thanks,
Prasad
Hi Grigoriy,
After changing the coding. we tried to run tbb1 below postings are reflecting and could see posting key 31 but error message as below. please advice the changes.
Hi Grigoriy,
As per the article i have made the changes in accounting and while posting TBB1 error msg as debit/credit indicator is inconsistent. please request you to check the below settings and advice the necessary changes.
Hi Grigoriy please respond to the above posted concerns in TBB1 Vendor postings article.
change this piece of code: BSCHL = 21.
Thanks Griogoriy. Please can you also share the sample screen shots of acct symbols,Posting specs and update types to posting spec config as per my requirement.I will fallow the same.
In your case posting spec will look like this:
Update types i used listed in this article. I don't know your needs.
Hi Grigoriy,
As you suggested we have posted TBB1 postings to vendor doc are generated.
Posting key 21 is credit memo can we change it to any other vendor related key and further status and concerns i will update you please help me to fulfill the requirement.
Dear Grigoriy,
As suggested in the article maintained posting specifications (if its wrong please correct me) may be thats why entries not coming correctly.
After try to post in TBB1 below entries are generated and vendor got debited.
Above entry is fine. But while paying interest and repayment system considering the same posting key(21) and involving vendor acct.but in our case shouldn't happen like this.
should be as below entries.
Interest payment
Interest a/c Dr
Bank A/C Cr
Loan repayment
Loan a/c Dr
Bank a/c Cr
Please help me to achieve above entries.
Dear Grigoriy,
Please respond to the above concerns.I tried all the options not getting any solutions.
your response is so valuable as we want to convey to the client that we can able to achieve the above entries or not.
Dear Grigoriy,
İs it also possible to use special g/l indicator for vendor accounts on TRM postings?
Please advice.
Regards.