Vous êtes sur la page 1sur 11

11/7/2017 A complete Document for Dunning Procedure with Smartform | SAP Blogs

Products
Products Industries
Industries Support
Support Training
Training Community
Community Developer
Developer Partner
Partner

About
About


Home / Community / Blogs + Actions

A complete Document for Dunning


Procedure with Smartform
December 21, 2015 | 703 Views |

Madhurima Jaggi
more by this author

ABAP Development

configuration in dunning with smartforms | dunning | fields for sending


send email | mutiple emails in dunning | smartforms dunning

share
0 share
0 tweet share
0

Follow

Normally, when we search about Dunning procedures we do get


our solution in bits and pieces.

https://blogs.sap.com/2015/12/21/a-complete-document-for-dunning-procedure-with-smartform/ 1/11
11/7/2017 A complete Document for Dunning Procedure with Smartform | SAP Blogs

This document would provide a full solution if you want to code as


well as configure your dunning procedure with smartforms.

What is Dunning?

Dunning is the process of methodically communicating with


customers to ensure the collection of accounts receivable.
Communications progress from gentle reminders to threatening
letters and phone calls and more or less intimidating location visits
as accounts become more overdue.

To automate the procedure for dunning we would need to find our


BTE.

What is BTE?

For this the documents are readily available on SCN. Below is the
link for the same: http://wiki.scn.sap.com/wiki/display/ABAP/BTE+-
+Business+Transaction+Event

The most important step for us is to check if all the configurations


are in place or not.

Step 1: Configuration of the process and the BTE.

T-code: BF44

Here we would provide our process which is indeed needed for


our coding.

The product assignment should also be done here.

Step 2: Activating the customer product

Next is T-code: BF24 where our product would have a text


assigned and it should be activated (Activate Customer Product
indicator).

https://blogs.sap.com/2015/12/21/a-complete-document-for-dunning-procedure-with-smartform/ 2/11
11/7/2017 A complete Document for Dunning Procedure with Smartform | SAP Blogs

Step 3: Configure the FM

T-code: FIBF

The FM here would be the one from which the standard code for
smartform would be triggered.

In case of smartform you should put FM as :


FI_PRINT_DUNNING_NOTICE_SMARTF

And in case you would want that to be a script the FM would be:
FI_PRINT_DUNNING_NOTICE.

Under the SAP application you would be able to give the name of
your BTE.

Step 4: Configure the Smartform created

This can be done using the below path in SPRO:

https://blogs.sap.com/2015/12/21/a-complete-document-for-dunning-procedure-with-smartform/ 3/11
11/7/2017 A complete Document for Dunning Procedure with Smartform | SAP Blogs

Financial Accounting -> Accounts Receivable and Accounts


Payable -> Business Transactions -> Dunning -> Assign Dunning
Forms.

Select your respective procedure. This would prompt you to


provide for the company code, enter as required.

Below section is the one in which you would provide your


smartform name:

Now your configuration is complete.


https://blogs.sap.com/2015/12/21/a-complete-document-for-dunning-procedure-with-smartform/ 4/11
11/7/2017 A complete Document for Dunning Procedure with Smartform | SAP Blogs

Technical side for the Dunning procedure.

Scenario: The case would be that at each Dunning level a mail


format has to be send to the customer with an attachment. This
should be automated for each dunning level.

Coding in BTE.

The first step for this would be to make a copy of the sample BTE
already present.

1040 is the BTE in which the coding for mailing the customer
should be done.

The event for sending


send mail and attachment is done from the event
1720, for which Sap has already provided the coding under FM
PRINT_DUNNING_NOTICE_SF.

The below structures are readily available in the FM


SAMPLE_PROCESS_00001040. And so they would be in your
FM copied from the sample BTE.

Explanations for each structure in order to code.

I_MHNK: This would have all the data for dunning. The most
important ones would be the dunning date(LAUFD), ID(LAUFI),
Account type(KOART), Company code and customer.

I_T047E: This would be the structure from which the form name
would be passed to the standard FM for customizing the Dunning.

https://blogs.sap.com/2015/12/21/a-complete-document-for-dunning-procedure-with-smartform/ 5/11
11/7/2017 A complete Document for Dunning Procedure with Smartform | SAP Blogs

Structures for sending


send mail and attachment parameter are below:

C_FINNA: Data for Transmission Medium for Correspondence.

All the parameter required to send a mail are passed in here.

Important fields of this structure:

1.Intad: This is the field in which you would be able to pass the
email address.

In most of the cases we would require multiple email ids to be


sent. This can be done using the below code:

IF lw_email IS NOT INITIAL. customer


c_finaaintad = lw_email.
ENDIF.

* sales representative
IF lsw_proceed2 = abap_true.
IF lw_email1 IS NOT INITIAL.
IF c_finaaintad IS NOT INITIAL.
CONCATENATE c_finaaintad lw_email1 INTO c_finaaintad
SEPARATED BY space.
ELSEIF c_finaaintad IS INITIAL.
c_finaaintad = lw_email1.
ENDIF.
ENDIF.
ENDIF.

https://blogs.sap.com/2015/12/21/a-complete-document-for-dunning-procedure-with-smartform/ 6/11
11/7/2017 A complete Document for Dunning Procedure with Smartform | SAP Blogs

* send to admin also


IF lsw_proceed1 = abap_true.
IF ls1_dunn_1040email IS NOT INITIAL.
CONCATENATE c_finaaintad ls1_dunn_1040email INTO
c_finaaintad
SEPARATED BY space.
ENDIF.
ENDIF.

2. Namep: This field would be used to pass a text name( SO10


Text), which would be used to pass the mail body of the email.

In our BTE we should pass the name and the READ_TEXT


would be automatically done by the code in SAP.

IF NOT lw_namep IS INITIAL.


c_finaanamep = lw_namep .

c_finaa-mail_body_text = ls_dunn_text-namep.
ENDIF.

Also the field mail_body_text can be used for same purpose.

SAP standard would take this value in the changing parameter


and do the below:

https://blogs.sap.com/2015/12/21/a-complete-document-for-dunning-procedure-with-smartform/ 7/11
11/7/2017 A complete Document for Dunning Procedure with Smartform | SAP Blogs

Always remember to create a SO10 text with FIKO as ID.

3. Mail_send_addr:
send This field is used to specify the send
sender of
the mail.

4. Nacha: This field would be passed for Transmission Medium


for Correspondence.

Values:

1 Printout

2 Fax

I mail

C_ITCPO: SAPscript output interface

Fields:

https://blogs.sap.com/2015/12/21/a-complete-document-for-dunning-procedure-with-smartform/ 8/11
11/7/2017 A complete Document for Dunning Procedure with Smartform | SAP Blogs

1. TDTITLE: This field would be used for the subject of the


email and the attached document name.

If we try to change the Document name and subject we would not


be able to do that for below code.

2. All the spool/archive parameters can be set with this


structure TDCOPIES, TDDEST, TDPREVIEW, TDARMOD.

Coding in smartforms.

Although we can create a new smartform according to our


requirement but in this case we must always remember to pass a
parameter in the Import Tab: IS_SFPARAM. Else there would also
be an error for Parameter missing.

https://blogs.sap.com/2015/12/21/a-complete-document-for-dunning-procedure-with-smartform/ 9/11
11/7/2017 A complete Document for Dunning Procedure with Smartform | SAP Blogs

So even assigning a new smartform created by us in possible.

In case of dunning scenario we would want many dynamic data to


be placed in our smartform.

For this we would have to fetch the data in our smartform itself.

This would be possible with the parameter IS_SFPARAM. The


dunning date and id could be captured with help of the SFPARAM-
CONTENT field, where we would need to get the data by using
offsets.

This smartform would now be sent as the PDF attachment in the


mail.

https://blogs.sap.com/2015/12/21/a-complete-document-for-dunning-procedure-with-smartform/ 10/11
11/7/2017 A complete Document for Dunning Procedure with Smartform | SAP Blogs

Alert Moderator

Be the first to leave a comment


You must be Logged on to comment or reply to a post.

Share & Follow


Privacy Terms of Use Legal Disclosure Copyright Trademark Sitemap Newsletter

https://blogs.sap.com/2015/12/21/a-complete-document-for-dunning-procedure-with-smartform/ 11/11

Vous aimerez peut-être aussi