Hello Kiran,
Because you use D365FO, I moved this question to the d365 forum.
About your accrual issue:
Please test the following in a test/demo environment first:
Go to AP/invoice journal and create a new vendor invoice journal.
Enter invoice details and then select functions-ledger accruals

In the form that opens, select the accrual scheme, which allocates the amount entered over the specified time period.

Note: If you scroll down to the bottom of the second screen you can see a transactions button that gives you a preview of the transactions that will be recorded.
Confirm the accrual selection with OK and post the invoice.
Once this is done, check the vouchers; not directly from the journal but in GL from the voucher transactions form.
Note: The accrual function will work only if your future periods are open for postings.
For additional information, have a look at the MS docs website.
Best regards,
Ludwig