Ansicht
Dokumentation

EXIT_SAPLNFR1_004 - IS-H: Invoice Printout SG - Output Conditions

EXIT_SAPLNFR1_004 - IS-H: Invoice Printout SG - Output Conditions

General Material Data   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.
SAP E-Book

Short text

SG: Function exit to determine conditions for individual invoice items or for a complete invoice.

Description

By means of this function exit you can determine conditions for the output on the invoice form for the country version Singapore. You can determine conditions for individual invoice items or for a complete invoice. You can use the function exit both for summary and detailed invoices.

In the country version Singapore, the combined invoice items from the invoices of a 'case invoice' rather than the invoice items of a single invoice are output on the invoice form. The combination criterion here is the identical service (from a technical viewpoint, the sequential number of the service). In other words, if a proportion of a service charge is covered by different insurance providers, the system combines the invoice items for this service in a logical case invoice item when form print is executed. The conditions associated with the invoice items are likewise combined. The items in a single invoice can be identified uniquely using the item numbers. In contrast to a single invoice, the billing document number and item number are required to uniquely identify a combined case invoice item in a case invoice (see example below). On the basis of the combination criterion, different billing document numbers can occur in such a case invoice if, for example, the case invoice contains invoices for different insurance providers.

Example of a case invoice:
A case has three insurance relationships which each cover services for this case. A proportion of the costs of the following services are covered by these insurance providers:

Service Total amount Ins.prov.1 Ins.prov.2 Ins.prov.3
DENTAL 100.0 70.0 20.0 10.0
BLOOD 50.0 0.0 20.0 30.0

Although only the proportional amount for the services DENTAL and BLOOD is invoiced for each insurance relationship, an invoice item with the total amount for the service DENTAL or BLOOD is output on each of the three invoice forms. For this purpose, the invoice items of the three invoices are combined in the case invoice:

Invoice Bill.doc.no. Item Service Amount
BDoc 1 9000 4 DENTAL 70.00
BDoc 2 9001 4 BLOOD 20.00
BDoc 2 9001 6 DENTAL 20.00
BDoc 3 9002 4 BLOOD 30.00
BDoc 3 9002 8 DENTAL 10.00

Case inv. 9000 4 DENTAL 100.00
Case inv. 9001 4 BLOOD 50.00

In the above example, all of the invoice items for the service DENTAL are combined under the billing document 9000 and item 4 in the case invoice. Since there is not an item for the service BLOOD in the billing document 9000, all of the invoice items for the service BLOOD are combined under the billing document 9001 and item 4 in the case invoice.

The following types of invoice are distinguished:

  • Detailed invoice:
All of the invoice items of the case invoice are combined according to identical service (from the technical viewpoint, the 'sequential number of the service' see above example).
  • Summary invoice:
In the case of a summary invoice, the invoice items are also combined according to the summary code of the service. For example, this allows you to combine all laboratory services.

The following input parameters are provided for you to specify whether the conditions are to be determined in the function exit for the summary or detailed invoice items or for the complete invoice:

  • I_POSITION: If this indicator has the value 'X' when the function exit is called, you have to provide for the fact that the conditions are to be determined for the invoice item. The invoice item and associated condition are identified using the input parameters I_VBELN and I_POSNR. If this indicator has the value ' ', the conditions are to be determined for the complete invoice.
  • I_SUMMARY: If this indicator has the value 'X', you have to provide for the fact in the function exit that the invoice is a summary invoice. If this indicator has the value ' ', the invoice is a detailed invoice.

The function exit is initially called once for each invoice item when an invoice form for a summary or detailed invoice is being formatted. The function exit is then called for the complete invoice. The various options of the function call are now implemented in conjunction with the corresponding values of the input parameters I_POSITION and I_SUMMARY:

I_POSITION I_SUMMARY Number of calls
'X' 'X' 1 x for each item of the summary invoice
' ' 'X' 1 x for the complete summary invoice
'X' ' ' 1 x for each item of the detailed invoice
' ' ' ' 1 x for the complete detailed invoice

The following input tables are available in the function exit:

  • I_RNF25C: Active conditions per case invoice
    The conditions for the invoice items are 'summed up' if a summary invoice is to be output and 'detailed' if a detailed invoice is to be output.
  • I_VBRK: Invoice headers of the case invoice
  • I_RNFPC: Combined invoice items of the case invoice
  • I_RNFPCS: Summary invoice items of the case invoice (only available if I_SUMMARY = 'X')
  • I_KONVC: Conditions (combined using 'sequential number of service') of the case invoice. The conditions are never combined using the summary code, even when I_SUMMARY = 'X'.

Please note that you may read but not modify these input tables.

To output conditions on the invoice form, place the conditions determined in the function exit in the field KWERT of the output table O_RNF21. In addition, you can specify a free text for each condition comprising up to 50 characters in the field USRTXT in this table.

If you require the determined conditions to be output set the value of the output parameter O_OUTPUT to 'X' in the function exit. If you do not want the conditions to be output, set the value of this parameter to ' '.

The determined conditions are then output on the invoice form via the following elements in the MAIN window:

  • CONDITION_LINE_POSITION
Output of conditions for an item.
  • CONDITION_LINE_TOTAL
Output of conditions for the complete invoice.

Example

Include LXNP1F04 (FORM routines in LXNP1F00) provides an example of how you can output government grants per class on the form.

The implementation of the include should be clarified by means of the following example:

  • The invoice items from 2 billing documents (billing document numbers 9000 and 9001) for a case are combined in a case invoice. This results in the following summary invoice items (only the essential fields of the table I_RNFPCS are mentioned):
vbeln posnr takat
9000 100 18 ==> 1st item of the case invoice
9001 100 12 ==> 2nd item of the case invoice
vbeln: SD billing document
posnr: Item number
takat: Summary code

  • On the basis of the same summary code, the system determines 2 items in the detailed invoice for each item of the summary invoice (table I_RNFPC):
vbeln posnr class takat
9000 100 B 18
9000 200 C 18
9001 100 B 12
9001 200 B 12

  • The system determines the active conditions for the condition type 'government grant' for an invoice item (identified by I_VBELN and I_POSNR) from the table I_KONVC. Contents of the most important field of the table with the example of condition type ZSUB (government grant):
knumv kposn kschl kinak kwert
9000 100 ZSUB ' ' 30.00
9000 200 ZSUB ' ' 40.00
9001 100 ZSUB ' ' 50.00
9001 200 ZSUB ' ' 60.00
knumv: document condition number, is the billing document (vbeln) in the function exit
kposn: condition item number, is the invoice item (posnr) in the function exit
kschl: condition type
kinak: indicator for inactive condition
kwert: condition value

You can maintain the usage of condition types in Customizing for IS-H (IS-H Implementation Guide) by choosing Patient Accounting -> Billing -> Pricing (Using Conditions) -> Define usage of Condition Types. Here you should assign the usage '70' to all of the government grant condition types.

Each time the function exit is called, the table O_RNF21 is filled with the government grants (field KWERT) and the corresponding text 'Government grants class ...' (field USRTXT). A data record is created in the table for each class for which a government grant was granted.

I_SUMMARY and I_POSITION govern how the government grants are to be determined each time the user exit is called. Four different options exist for the function exit call:

  1. Summary invoice
    1. Government grants for an invoice item (I_POSITION = 'X', I_SUMMARY = 'X')
      The government grants for ONE item are determined each time the function exit is called:
BDoc. Item Class Government grant
9000 100 B 30.00 ==> 1st call
9000 100 C 40.00 ==> 1st call
9001 100 B 110.00 ==> 2nd call

  1. Government grants for he complete invoice (I_POSITION = ' ', I_SUMMARY = 'X')
    The government grants for the complete invoice are determined with one call of the function exit:
Class Government grant
B 140.00
C 40.00

  1. Detailed invoice
    1. Government grants for an invoice item (I_POSITION = 'X', I_SUMMARY = ' ')
      The government grants for ONE item are determined each time the function exit is called:
BDoc. Item Class Government grant
9000 100 B 30.00 ==> 1st call
9000 200 C 40.00 ==> 2nd call
9001 100 B 50.00 ==> 3rd call
9001 200 B 60.00 ==> 4th call

  1. Government grants for the complete invoice (I_POSITION = ' ', I_SUMMARY = ' ')
    The government grants for the complete invoice are determined with one call of the function exit:




Parameters

I_KONVC
I_LOMID
I_POSITION
I_POSNR
I_RNF25C
I_RNFPC
I_RNFPCS
I_SUMMARY
I_TDFORM
I_TOMID
I_VBELN
I_VBRK
I_VBRKC
O_OUTPUT
O_RNF21

Exceptions

NO_CONDITIONS

Function Group

XNP1

SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up   General Data in Customer Master  
This documentation is copyright by SAP AG.

Length: 18013 Date: 20240523 Time: 052910     sap01-206 ( 196 ms )
Class Government grant
B 140.00
C 40.00