Content


 

The Expiring Quotes report shows the open quotes for the selected customers, sorted by expiration date.

Data Collection

We read the open quotations with the SAP standard function module "SD_SELECT_SALES_DOCUMENTS" . Since the module is not RFC-capable, we use the CIS Abap interface and then use the
Call Function 'SD_SELECT_SALES_DOCUMENTS'. We also perform the sorting in descending order by date in the ABAP routine.
 
Vb.net
 Report Time (Open offers by expiring date)
    Public Function CreateReportTime_
       (Byval Keys As Dictionary(From String, String), _
        Byval Id As String, _
        Byval Customernumbers() As String, _
        Byval Customernames() As String) As String


        We use CIS addon ABAP function to read expiring offers

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


        Build up input
        Dim s As Addonsimplestring = _
                 Directcast(rfc_input.addnew(), addonsimplestring)
        S.content = Getitem(keys, "VKORG")

        s = Directcast(rfc_input.addnew(), addonsimplestring)
        S.content = Getitem(keys, "VTWEG")

        s = Directcast(rfc_input.addnew(), addonsimplestring)
        S.content = Getitem(keys, "spart")

        ' following parameters: customer numbers
        For Each Cn As String In Customernumbers
            s = Directcast(rfc_input.addnew(), addonsimplestring)
            S.content = Cn
        Next

        Request data
        Ic.rfcrequest("CISADDON.OPEN_OFFERS", "S", rfc_input, rfc_output)



In the ABAP routine OPEN_OFFERS we get the organization keys VKORG, VTWEG, SPART and then all selected customer numbers. From this we build the parameters for the function block:
 

Abap
form OPEN_OFFERS tables reqparm resparm 
                         changing   rc type c   msg type c.


  data: wa(8000).
  data: datbi1 type D,
        datbi2 type D.


  data: CUSTOMERRANGE like BAPI_RANGESKUNNR occurs 1 with header line.
  data: VKORGRANGE    like BAPI_RANGESVKORG occurs 1 with header line.
  data: VTWEGRANGE    like BAPI_RANGESVTWEG occurs 1 with header line.
  data: SPARTRANGE    like BAPI_RANGESSPART occurs 1 with header line.

  data: POSITIONS like SVBMTV_TRVOG occurs 1.


  Read Table reqparm index 1 into vkorgrange-low.
  vkorgrange-sign = 'I'.
  vkorgrange-option = 'EQ'.
  Append vkorgrange.

  Read Table reqparm index 2 into vtwegrange-low.
  vtwegrange-sign = 'I'.
  vtwegrange-option = 'EQ'.
  Append vtwegrange.

  Read Table reqparm index 3 into spartrange-low.
  spartrange-sign = 'I'.
  spartrange-option = 'EQ'.
  Append spartrange.

* customer numbers
  CUSTOMERRANGE-SIGN = 'I'.
  CUSTOMERRANGE-Option = 'Eq'.

  Data: k type i value 4.
  Read Table reqparm index k into CUSTOMERRANGE-LOW.
  While sy-subrc EQ 0.
    Append CUSTOMERRANGE.

    k = k + 1.
    Read Table reqparm index k into CUSTOMERRANGE-LOW.
  Endwhile.

* no customers?
  if   CUSTOMERRANGE[] is initial.
    exit.
  endif.



  Call function 'SD_SELECT_SALES_DOCUMENTS'
    Exporting
      IV_TRVOG      = '2'
      IV_VBOFF      = 'X'
      IV_VBALL      = ' '
    Tables
      I_KUNNR1_RT   = CUSTOMERRANGE
      I_VKORG_RT    = VKORGRANGE
      I_VTWEG_RT    = VTWEGRANGE
      I_SPART_RT    = SPARTRANGE
      T_VBMTV       = POSITIONS
    Exceptions
      Error_message = 1
      OTHERS        = 2.

  Field-Symbols: <pos> like line of POSITIONS.

  Sort POSITIONS By DATBI ascending.

For further details, please refer directly to the ABAP function module /GUIXT/CISADDON_INTERFACE delivered with CIS mobile.
 

Layout

We build the output table in vb.net as html string, using css to specify fonts, dimensions, colors etc. be set. The coding is analogous to the Example sales.
Additional Parameters

No Additional Parameters.