2022 May 18 12:24 PM
Hello,
I want dunning mails to be sent to the clients and am using BTE to make it happen. It's not working and I am utterly lost - all I know is when I set a break-point in my custom FM, it doesn't even get triggered, so the process does not even reach my FM. There's also a pop-up at the end of the process (the last screen-shot), but I fail to understand its meaning.
----------
EDIT: when I have the dunning procedure set for a customer it does generate and print a dunning notice as it should, but still doesn't attempt to send a mail, so I must be doing something wrong with BTE/FM.
----------
Below are things I did:
1. In FIBF In Environment --> Infosystem(Processes), I selected 00001040 process ('DUNNING: Determine output device').
2. I copied the sample FM and created my own out of it. The function group assigned is the one I created myself - it's activated.
3. The code of the FM is from this tutorial:
https://wiki.scn.sap.com/wiki/display/ABAP/Dunning-+Mail+Subject+and+Content
But, even if something is wrong there, I don't know any of it, because there's a break-point set within that doesn't even get triggered, which makes me think the FM is not even reached and I am doing something wrong with the BTE's configuration.
4. Back in FIBF, in Settings --> Products --> ... of a customer, I create my product.
5. Then, still in FIBF, I create the process - Settings --> Process Modules --> ... of a customer.
Now, the tutorial I linked in point 3 advises that I add 'TR-LO' in 'Appl.' column, but it doesn't change anything. I also tried 'FI-FI' and now with it being empty. Nothing makes any difference.
6. My custom FM contains the code to fetch the mails of the recipients with a PERFORM being in the FM itself and the FORM was initially defined within an INCLUDE of the FM - but, while trying to activate it, it kept telling me that the INCLUDE does not exist... while it acknowledges its existence within the Attributes tab.
Fun fact - it still was activating all the same despite giving me the information. But, just to be safe - I moved the FORM definition from the INCLUDE to the FM itself and now it activates without any "warnings".
7. Now, I specify the mail's text within SO10.
8. At this stage, all should be set and done - so I go to F150 to get them dunnings flying.
I select the 'Indiv.dunn.notice', because I am just trying to test the solution. The customer is a legit one, but it's a DEV system and I added my own mail to the customer.
This is where I added my own mail in XD02 for the customer.
And nothing happens.
SOST doesn't see any mails being sent out and the break-point placed within the FM's code doesn't trigger the moment I am trying to send the dunning.
Upon hitting the 'Prinout' button in F150, I see the below pop-up.
Any ideas where's the part I am failing?
I am already grateful for the time you took to read it.
Kind Regards,
Bartek
2022 May 21 4:40 PM
I found a solution.
The problem was actually with the code of my custom FM, albeit I can't say what was wrong exactly... The code I used BEFORE was suggested in this post:
https://wiki.scn.sap.com/wiki/display/ABAP/Dunning-+Mail+Subject+and+Content
And it didn't work for me without throwing any errors. Mails just weren't being sent and all I managed to track is that the control seemed to not even be passed to the section where 'c_finaa' structure is being supplied with values. It was leaving my FM after fetching the mails.
I tried the code for the custom FM to be used by BTE suggested within this post instead:
https://blogs.sap.com/2015/03/16/dunning-notice-in-sap-best-practice-from-abaper-prospective/
And it works like a charm for me. On the development and testing systems the mails appear right within SOST upon the generation of the dunning note and, when I approve them, they go straight to the mail inbox.
Kind Regards,
2022 May 18 12:50 PM
It seem to me you are on the right track with your development, this error is business process related.
You receive this message because the customer you are testing with does not have a dunning procedure set in the its master data: https://answers.sap.com/questions/2604235/dunning-error.html
2022 May 18 1:03 PM
Thank you for looking into it.
I am currently in the process of exploring this dunning procedure for the customer part, but the dunning procedure IS set for my test customer and the pop-up is the same.
2022 May 18 1:10 PM
Check whether you have a dunning procedure defined in your customer master data as well as in Customizing
(or ask functionals)
Hint: Browse table KNB5 to select a customer for your tests.
2022 May 18 2:44 PM
According to your suggestions, I asked a functional for help and I browsed KNB5 indeed for a valid customer with invoices for which dunnings could be generated. I also made sure to add my mail address for that particular client and set the proper dunning procedure for the customer as well.
It now, technically, generates dunnings without telling me it can't, but still no mails are being sent (nothing in SOST) and nothing happenes, as if I do have some issue with how I configured the BTE.
2022 May 19 1:19 PM
Can you
2022 May 19 5:18 PM
Hey Raymond,
I set a break-point in OPEN_FI_PERFORM_00001040_P and checked I_MHNK-APPLK upon the execution of F150. Indeed, it showed 'FI-FI', so I changed that part of the Process Module.
Lo and behold, now, if I set a break-point in my custom FM, it DOES get triggered (!!!), so there is a slight progress, but still no mails are being sent even though the generation of the dunning notes is carried out successfully.
The code of my FM looks like this:
I tried replacing 'tdcovtitle' with 'tdtitle', but saw no difference. Not sure what this variable is for, but the 'mail_body_text' is specified within SO10.
The 'get_email_id' FORM is copied from the tutorial I linked before (https://wiki.scn.sap.com/wiki/display/ABAP/Dunning-+Mail+Subject+and+Content).
Can you see any problem with the code above?
2022 May 21 4:40 PM
I found a solution.
The problem was actually with the code of my custom FM, albeit I can't say what was wrong exactly... The code I used BEFORE was suggested in this post:
https://wiki.scn.sap.com/wiki/display/ABAP/Dunning-+Mail+Subject+and+Content
And it didn't work for me without throwing any errors. Mails just weren't being sent and all I managed to track is that the control seemed to not even be passed to the section where 'c_finaa' structure is being supplied with values. It was leaving my FM after fetching the mails.
I tried the code for the custom FM to be used by BTE suggested within this post instead:
https://blogs.sap.com/2015/03/16/dunning-notice-in-sap-best-practice-from-abaper-prospective/
And it works like a charm for me. On the development and testing systems the mails appear right within SOST upon the generation of the dunning note and, when I approve them, they go straight to the mail inbox.
Kind Regards,
2022 May 21 6:51 PM
Thanks for the feedback. I don't see any difference in the code of the two documents, except the logic for the email address. Didn't you try to hardcode the email address just to see whether it works? (and this way, you know that the issue is coming from the logic to determine the email address)
NB: if the breakpoint doesn't work, it's probably that the code runs in the update task, so you should start the update debugging before the "printout" or "print preview", and when you're inside the update task, you can add the breakpoint on your function module.