Content


 

The report "Credit overview" shows for the selected customers the total exposure, the deposited credit limit and the utilization of the credit in percent.

Data acquisition and layout

For the credit overview there is the ABAP report "RFDKLI40" in the SAP standard, which we want to use for data retrieval. We then design the layout ourselves in VB.NET with HTML and CSS.

It would also be possible to display the output of the ABAP report in SAP format without changing the layout. You can find an example of this in the report Changes.

In the SAP system, the output looks like this:

The field "Currency" or "Whrg" is the currency of the customer's last payment, which can be different from the which can be different from the currency of the credit limit and commitment. This is misleading; for example, for customer 1200 the credit limit is 500.000,- EUR and not DEM. However, we have adopted it in the example because it is about the principle of mapping an SAP report in CIS mobile. Otherwise, it would be better to either display the currency to which the credit limit and commitment refer, or change the heading to "Currency last payment".

We call the report RFDKLI40 in VB.NET, pass our customer numbers and organization data and have the output returned in ASCII form. There we extract the data by splitting the table rows into the individual columns using the Split("|") statement. In addition, we show the customer name in each case.

Vb.net
 ' Report Credit
    Public Function CreateReportCredit _
              (Byval Keys As Dictionary(From String, String), _                                       
                Byval Id As String, Byval Customernumbers() As String, _
               Byval Customernames() As String) As String

        We use ABAP report RFDKLI40 to display basic credit data

        Clear input/output
        Rfc_input.clear()
        Rfc_output.clear()


        Build up input
        Add_report_selection(rfc_input, "KKBER", _ 
                  Getitem(keys, "KKBER"), GetItem(keys, "KKBER"))

        For Each Cnr As String In Customernumbers
            Add_report_selection(rfc_input, "KONTO", knr, knr)
        Next


        ' Request report via RFC
        Ic.rfcrequest("RFDKLI40", "R", rfc_input, rfc_output)


        ' Buld up HTML output table
        Dim Sb As New Stringbuilder


        'Title
        Sb.append("<div style='width:700px; font-size:12pt;
       font-weight:bold; margin: 10px 0px 10px 5px; color:)
        Appendstring(sb, ic.messagetext("REPORT_CREDIT_TITLE"))
        Sb.append("</div>")

        ' column headings
        Sb.append("<div class='colhead01' style='width:740px; 
                             font-size:12px; margin-bottom:4px;'>")

        ' customer number
        Sb.append("<div class='colhead' 
             style='float:left; text-align:left; width:80px;'>")
        Sb.append("Nr")
        Sb.append("</div>")

        ' customer
        Sb.append("<div class='colhead' 
               style='float:left; text-align:left; 
                            width:190px; margin-right:4px;'>")
        Appendstring(sb, ic.messagetext("REPORT_CREDIT_COL2"))
        Sb.append("</div>")


        ' Obligo
        Sb.append("<div class='colhead' 
                style='float:left; text-align:right; width:150px;'>")
        Appendstring(sb, ic.messagetext("REPORT_CREDIT_COL3"))
        Sb.append("</div>")

        ' WAERS
        Sb.append("<div class='colhead' 
                 style='float:left; text-align:left; 
                        margin-left:10px;width:60px;'>")
        Appendstring(sb, ic.messagetext("REPORT_CREDIT_COL4"))
        Sb.append("</div>")

        ' Limit
        Sb.append("<div class='colhead' 
              style='float:left; text-align:right; width:150px;'>")
        Appendstring(sb, ic.messagetext("REPORT_CREDIT_COL5"))
        Sb.append("</div>")

        ' PERCENTAGE
        Sb.append("<div class='colhead' 
              style='float:left; text-align:right; width:80px;'>")
        Appendstring(sb, ic.messagetext("REPORT_CREDIT_COL6"))
        Sb.append("</div>")


        Sb.append("</div>")



        Dim Account As String = ""
        Dim Limit As String = ""
        Dim Waers As String = ""
        Dim Obligatory As String = ""
        Dim Percentage As String = ""

        Dim Header As Boolean = True

        For Each Line As Addonsimplestring In Rfc_output
            Dim Fields() As String = Line.content.Split("|")

            If Fields.length > 7 Then
                If Header Then
                    Header = False
                Else
                    Account = Fields(1).Trim.PadLeft(10, "0")
                    Waers = Fields(5).trim
                    Limit = Fields(6).trim
                    Obligatory = Fields(7).trim
                    Percentage = Fields(8).trim


                    Sb.append("<div style='width:740px; 
                      font-size:13px; margin-left:8px; clear:both;'>")

                    ' customer nr
                    Sb.append("<div class='outputcelldiv'  
                        style='text-align:left; width:80px;'>")
                    Appendstring(sb, kunnr.trimstart("0"))
                    Sb.append("</div>")


                    ' customer
                    Sb.append("<div class='outputcelldiv'  
                         style='text-align:left; width:190px; 
                    margin-right:4px; text-overflow: ellipsis;'>")
                    AppendString(sb, customername(kunnr, 
                                customernumbers, customernames))
                    Sb.append("</div>")


                    ' total obligo
                    Sb.append("<div class='outputcelldiv'  
                            style='text-align:right; width:150px;'>")
                    AppendString(sb, oblig)
                    Sb.append("</div>")

                    ' waers
                    Sb.append("<div class='outputcelldiv'  
                              style='text-align:left; 
                                margin-left:10px; width:60px;'>")
                    AppendString(sb, waers)
                    Sb.append("</div>")


                    ' limit
                    Sb.append("<div class='outputcelldiv'  
                           style='text-align:right; width:150px;'>")
                    AppendString(sb, limit)
                    Sb.append("</div>")


                    ' percentage
                    Sb.append("<div class='outputcelldiv'  
                         style='text-align:right; width:80px;'>")
                    AppendString(sb, percentage & "%")
                    Sb.append("</div>")


                    Sb.append("</div>")


                End If


            End If

        Next

        Sb.append("<div style='clear:both;'></div>")

        ' Clear input/output
        Rfc_input.clear()
        Rfc_output.clear()




        ' return report output in HTML format
        Return Sb.ToString

    End Function


 

Additional Parameters

No Additional Parameters.