Content
The Billing Due List report shows the order-related billing due list (SAP transaction VF04) for the selected customers.
|
Data Collection
In the SAP system, the billing due list is displayed in transaction VF04 as "ALV Grid":

One way to read the values of the grid is to use the "GridToTable" function of the SAP GUI Scripting interface in CIS mobile. This is analogous to step 4.01 in the description Add-on
Fertigungsauftrag.
We use a different method here. which is somewhat faster. Via System->Status in transaction VF04 we see that the ALV Grid is built by the SAP report "SDBILLDL":

We start this report from VB.NET and get back the data of the ALV Grid as a text table in which the individual columns are separated by "|":

Vb.net
Report Billing
Public Function CreateReportBilling_
(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 SDBILLDL
' to display billing data (ALV Grid VF04)
Clear input/output
Rfc_input.clear()
Rfc_output.clear()
Build up input
For Each Cnr As String In Customernumbers
Add_report_selection(rfc_input, "P_KUNNR", knr, knr)
Next
Dim Sorg As String = Getitem(keys, "vkorg")
Dim Vtweg As String = Getitem(keys, "vtwku")
Dim Saves As String = Getitem(keys, "spart")
Add_report_selection(rfc_input, "P_FKDAT", "")
Add_report_selection(rfc_input, "P_FKDAB", "")
Add_report_selection(rfc_input, "P_VKORG", vkorg)
Add_report_selection(rfc_input, "S_VTWEG", vtweg, vtweg)
Add_report_selection(rfc_input, "S_SPART", saves, saves)
Add_report_selection(rfc_input, "P_ALLEL", "X")
Add_report_selection(rfc_input, "P_ALLEA", "X")
Request report via rfc
Ic.rfcrequest("SDBILLDL", "R", rfc_input, rfc_output)
|
The text for the billing type, for example "Invoice (F2)", is not included as a column in the ALV Grid. Therefore, we still read the text for the display from table TVFKT via the RFC database interface. Since there are many individual accesses for this, it is important to buffer the TVFKT table in the S10 repository using the parameter dbcache="yes" (see next section).
' read billing type text via SAP Select
Vtext = ""
Saptvfkt.fkart = Fkart
If Saptvfkt.ic.RfcDatabaseRead() Then
Vtext = Saptvfkt.Vtext
End If
|
Performance
In the S10 repository, Runtime->Trace provides an often useful
often useful trace function. It shows
the selection parameters and the time spent on report calls:

Also all database accesses of the RFC Select interface. We measured them in the CIS mobile test system in various constellations:
-
No 1 with dbcache="yes" for table addontvfkt
- No 2 without the cache, with CIS mobile and SAP application server on the same computer
- No 3 without the cache, on remote computers (Internet connection)<
-
No 4 without the cache, bundled accesses on remote computers (Internet connection), see below for details
If you want to read data that cannot be kept in the cache and many individual accesses are to be expected, you can first collect all keys and then bundle the accesses.
The VB.NET coding is a bit more sophisticated for this case, here are the parts relevant for it:

Vb.net
' ....
VB.NET dictionary object for billing types and texts
Dim Ftexts As New Dictionary(From String, addontvfkt)
' flag to skip column header line of ALV grid
Dim Columnheader As Boolean = True
' collect all billing types
For Each Line As Addonsimplestring In Rfc_output
Dim Fields() As String = Line.content.split("|")
If Fields.length > 8 Then
If Columnheader Then
Columnheader = False
Else
Dim Loc_fkart As String = Fields(5).Trim
If Not Ftexts.ContainsKey(loc_fkart) Then
Dim Tvfkt As New Addontvfkt
Tvfkt.fkart = Loc_fkart
Tvfkt.ic.RfcDatabaseRead(deferred:=True)
' add to dictionary
Ftexts.Add(loc_fkart, tvfkt)
End If
End If
End If
Next
' read texts for all billing types
Ic.rfcexecutedeferredcalls(rfcmessages)
' ....
For Each Line As Addonsimplestring In Rfc_output
' ....
Read billing type text from dictionary object
vtext = Ftexts.Item(fkart).vtext
' ....
Next
In our example, only two accesses are bundled (see trace 4 above), since only "F2" and "BV" are billing types.
|
Layout
We build the output table in vb.net as html string, using css to specify fonts, dimensions, colors etc.
The coding is analogous to the
Example Sales.
|
Additional Parameters
No Additional Parameters. |