Skip to Content

Normally, when we search about Dunning procedures we do get our solution in bits and pieces.

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.

Img_1.png

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).

/wp-content/uploads/2015/12/img_2_856606.png

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.

/wp-content/uploads/2015/12/img_3_855609.png

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


/wp-content/uploads/2015/12/img_4_855610.png

Step 4: Configure the Smartform created


This can be done using the below path in SPRO:

/wp-content/uploads/2015/12/img_5_855614.png

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:


/wp-content/uploads/2015/12/img_6_855615.png

Now your configuration is complete.

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.

/wp-content/uploads/2015/12/img_7_855616.png

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

The event for sending 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.

/wp-content/uploads/2015/12/img_8_855617.png

Structures for sending 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_finaa
intad   = 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_finaa
intad = lw_email1.
ENDIF.
ENDIF.
ENDIF.

* 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_finaa
namep = 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:


/wp-content/uploads/2015/12/img_9_855618.png

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


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

/wp-content/uploads/2015/12/img_10_855619.png

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:


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.


/wp-content/uploads/2015/12/img_11_855620.png

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”.


/wp-content/uploads/2015/12/img_12_855621.png


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.


/wp-content/uploads/2015/12/img_13_855622.png

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

To report this post you need to login first.

Be the first to leave a comment

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

Leave a Reply