cancel
Showing results for 
Search instead for 
Did you mean: 

FM for simulating document in FB60 and MIRO

marcin_cholewczuk
Active Contributor
0 Kudos
2,519

Hi all,

I would like to add functionality to my program which would give user possibility to simulate documents like it's happening in FB60 and MIRO (I would like to support both FI and MM documents). So in my report there would be a button, user press it and I'm calling something that would present results of simulation.

I've checked how it's done in MIRO and FB60 but it would take way too much time to mimic this solution. FB60 is using FM ACC_SIMULATED_DOC_DISPLAY but this is only for showing results. No simulation is done inside.

I could try with batch input, but after showing results user would have to go back, so it's not nice and beside he could post or park document which I don't want to allow him to do.

Any ideas are welcome

Best regards

Marcin Cholewczuk

Accepted Solutions (0)

Answers (1)

Answers (1)

coleti
Active Contributor
0 Kudos

Dear Marcin,

I think you could use FM BAPI_ACC_DOCUMENT_CHECK to check if the posting is OK and if ok, just shows the simulation reading the tables used in the BAPI and display to the user.

I hope it´s helps you.

Best regards,

Gabriel Coleti

marcin_cholewczuk
Active Contributor
0 Kudos

Hello Gabriel,

I've seen this FM, but I don't think that it's returning results that I need. I'm only populating data and in return I'm getting if they are fine or not, but I won't get information how document will look like after posting, what amount will be posted to which G/L account and so on.

Best regards

Marcin Cholewczik

coleti
Active Contributor
0 Kudos

Hello Marcin,

I see, you want to simulate the automatic accounting determination. could you please specify which kind of posting is that ?

You gave us FB60 and MIRO examples, but technically they are a little bit different.

FB60 basically, the main accounting is defined by the user, Vendor and offsetting accounts. The automatic account here, is the WHT in vendor if exists and some small difference balance if tolerances have been setup.

For MIRO posting, you have the same rules in FB60 but some offsetting automatically defined by Account Group Key RMK - Table T030 such as GR/IR accounts, small diff accounts and so on.

I believe that your simulation will depends in which kind of posting you are performing SAP has different rules for each transaction code, and I think that it will be impossible to consolidate it in just one rule or function module.

I suggested BAPI_ACC_DOCUMENT_CHECK to check with the account postings has some error or not, this function is used in MIRO and FB60 simulation. But the determination of automatic accounting will depends on which postings your programs intend to do.

Best regards,

Gabriel Coleti

marcin_cholewczuk
Active Contributor
0 Kudos

Hello Gabriel,

Im not limiting user in any way. He is able to type in data like it's done in FB60 and MIRO. All other behaviour is up to SAP standard.

Best regards

Marcin Cholewczuk

coleti
Active Contributor
0 Kudos

Hello Marcin,

So you can use FM ACC_SIMULATED_DOC_DISPLAY to show the user the FI document that will be posted. This is the FM used by FB60.

For MIRO, I think you can use MRM_INVOICE_POST and set parameter I_SIMULATION and then run  MRM_XACCITCR_EXPORT to get the accounting information.

Best regards,

Gabriel Coleti