Problem A:
If a customer billing document is transferred to Accounting, the exchange rate for Accounting (field VBRK-KURRF) is always determined with type "M" even though a different exchange rate type is maintained in the customer master record.
Problem B:
If a billing document for intercompany billing is transferred to Accounting, the exchange rate for Accounting (VBRK-KURRF) as well as the pricing exchange rate (VBRP-KURSK) are determined with the exchange rate type from the customer master record. However, exchange rate type "M" should be used.
Variant B1)
With this variant, both exchange rates (VBRK-KURRF and VBRP-KURSK) shall be determined with exchange rate type 'M'.
Variant B2)
With this variant, the exchange rate for Accounting (VBRK-KURRF) only shall be determined with exchange rate type 'M'.
Problem C:
As of Release 3.0, there is a "pricing exchange rate" indicator in the copying control for billing documents. If this indicator is set, the pricing exchange rate will always be determined with exchange rate type "M", even if a different exchange rate type is entered in the customer master.
VF01, VF02, VF04
VBRK, KURRF, CPKUR
Exchange rate for RF postings
This is the standard system behaviour.
The exchange rate type in the customer master has two functions:
- 1. Converting conditions from local currency into the document currency
- 2. Determining the exchange rate for Accounting in the case of intercompany billing
Problem A:
**********
If you add the following data transfer routine, the exchange rate type in the customer master record is also used for customer billing documents in order to determine the exchange rate for Accounting.
However, you should consider the following restrictions:
This modification is not possible in case the alternative exchange rate type and exchange rate type "M" have different relations. The AC interface does not provide the option of passing an alternative exchange rate type.
A subsequent change of the billing date by means of the "Change billing document" function (VF02) does not cause a redetermination of the exchange rate for Accounting (field VBRK-KURRF) since the "ID: Exchange rate setting" (field VBRK-CPKUR) is set by the following routine. Otherwise, a redetermination of the exchange rate would be performed with exchange rate type "M" again. Therefore, you can influence the exchange rate subsequently only by cancelling the billing document and then bill again with suitable default data.
You can assign the data transfer routine in SD Customizing by choosing 'Sales and Distribution -> Billing -> Billing documents - Maintain copying control for billing documents'.
If a standard transfer routine is entered (no. < 600) in the "Data transfer" field, you have to create a new data transfer routine which contains the source code of the existing routine and the source code given below.
Otherwise, the existing routine can be extended. You have to check whether the existing data routine is used several times. You should create a new routine here as well, if necessary.
The data transfer routine for the billing document is maintained with Transaction VOFM in client 000 by choosing "Data transfer -> Billing documents".
Refer to the notes in the IMG, section "System Modifications".
Extend the data transfer routine as follows:
TABLES: T001. <<<<<<<<<<<< if not defined yet
FORM DATEN_KOPIEREN_6nn.
.
.
IF T001-BUKRS NE VBRK-BUKRS.
SELECT SINGLE * FROM T001 WHERE BUKRS = VBRK-BUKRS.
ENDIF.
* get new exchange rate from table TCUR
IF VBRK-WAERK NE T001-WAERS AND VBRK-KURST NE SPACE.
CALL FUNCTION 'READ_EXCHANGE_RATE'
EXPORTING DATE = VBRK-FKDAT
FOREIGN_CURRENCY = VBRK-WAERK
LOCAL_CURRENCY = T001-WAERS
TYPE_OF_RATE = VBRK-KURST
IMPORTING EXCHANGE_RATE = VBRK-KURRF
EXCEPTIONS NO_RATE_FOUND = 1.
IF SY-SUBRC NE 0.
VBRK-KURRF = 0.
else.
vbrk-cpkur = 'X'.
ENDIF.
ENDIF.
Problem B1:
***********
Proceed as described for (A). The data transfer routine to be created looks as follows:
TABLES: T001. <<<<<<<<<<<< if not yet defined
FORM DATEN_KOPIEREN_6nn.
.
.
IF T001-BUKRS NE VBRK-BUKRS.
SELECT SINGLE * FROM T001 WHERE BUKRS = VBRK-BUKRS.
ENDIF.
* get new exchange rate from table TCUR
IF VBRK-WAERK NE T001-WAERS AND VBRK-KURST NE SPACE.
VBRK-KURRF_DAT = VBRK-FKDAT.
CALL FUNCTION 'READ_EXCHANGE_RATE'
EXPORTING DATE = VBRK-FKDAT
FOREIGN_CURRENCY = VBRK-WAERK
LOCAL_CURRENCY = T001-WAERS
IMPORTING EXCHANGE_RATE = VBRK-KURRF
EXCEPTIONS NO_RATE_FOUND = 1.
IF SY-SUBRC NE 0.
VBRK-KURRF = 0.
ENDIF.
ENDIF.
Assign this data transport routine to the document flow for intercompany billing.
Problem B2):
************
Please proceed as described for A). The transport routine to be generated reads as follows:
TABLES: T001. <<<<<<<<<<<< if not yet defined
FORM DATEN_KOPIEREN_6nn.
.
.
IF T001-BUKRS NE VBRK-BUKRS.
SELECT SINGLE * FROM T001 WHERE BUKRS = VBRK-BUKRS.
ENDIF.
* get new exchange rate from table TCUR for VBRK-KURRF with KURST=M
IF VBRK-WAERK NE T001-WAERS AND VBRK-KURST NE SPACE.
VBRK-KURRF_DAT = VBRK-FKDAT.
CALL FUNCTION 'READ_EXCHANGE_RATE'
EXPORTING DATE = VBRK-FKDAT
FOREIGN_CURRENCY = VBRK-WAERK
LOCAL_CURRENCY = T001-WAERS
IMPORTING EXCHANGE_RATE = VBRK-KURRF
EXCEPTIONS NO_RATE_FOUND = 1.
IF SY-SUBRC NE 0.
VBRK-KURRF = 0.
ENDIF.
* get new exchange rate from table TCUR for VBRP-KURSK
DATA: KURSTYP LIKE VBRK-KURST.
KURSTYP = VBRK-KURST.
IF KURSTYP IS INITIAL.
KURSTYP = 'M'.
ENDIF.
VBRP-KURSK_DAT = VBRK-FKDAT.
CALL FUNCTION 'READ_EXCHANGE_RATE'
EXPORTING
DATE = VBRK-FKDAT
FOREIGN_CURRENCY = VBRK-WAERK
LOCAL_CURRENCY = T001-WAERS
TYPE_OF_RATE = KURSTYP
IMPORTING EXCHANGE_RATE = VBRP-KURSK
EXCEPTIONS NO_RATE_FOUND = 1.
IF SY-SUBRC NE 0.
VBRP-KURSK = 0.
ENDIF.
ENDIF.
Assign this data transport routine to the document flow for intercompany billing.
Addition to A and B:
********************
If you also want to apply the default data functions (for the billing date) to the situations in billing described above, you have to enhance your copying requirement (at the item level) as well.
You can also assign the copying requirement in SD Customizing by choosing 'Sales and Distribution -> Billing -> Billing documents - Maintain copying control for billing documents'.
If a standard copying requirement is entered (no. < 600) in the "Copying requirement" field, you have to create a new copying requirement that contains the source code of the existing routine and the source code given below.
Otherwise, the existing routine can be extended. You have to check whether the existing data routine is used several times. You should create a new routine here as well, if necessary.
The copy requirements for the billing document are maintained with Transaction VOFM in client 000 by choosing "Copying requirements -> Billing documents".
Refer to the notes in the IMG, section "System Modifications".
Extend the copying requirement as follows:
FORM BEDINGUNG_PRUEFEN_6nn
.
.
* Vorgabedaten auf jeden Fall übernehmen <<< insert
IF KOM-FKDAT NE 0. <<< insert
VBRK-FKDAT = KOM-FKDAT. <<< insert
ENDIF. <<< insert
ENDFORM.
*eject
Problem C:
**********
Correction in program LV60AF0V. The correction is in the standard system as of Release 3.1.
FORM VBRK_VBRP_DATENTRANSPORT USING TS_SUBRC.
...
* Preisfindungskurs der Position ermitteln
IF VBRP-KURSK = 0.
VBRP-KURSK = VBRK-KURRF.
ENDIF.
IF TVCPF-PFKUR NE SPACE AND TVCPF-KNPRS CA 'ABCG'. <<<<<<< delete
IF TVCPF-PFKUR NE SPACE. <<<<<<< insert
DATA: KFTYP_DAT LIKE SY-DATUM.
...
IF NOT KFTYP_DAT IS INITIAL.
CALL FUNCTION 'READ_EXCHANGE_RATE'
EXPORTING
DATE = KFTYP_DAT
FOREIGN_CURRENCY = VBRK-WAERK
LOCAL_CURRENCY = T001-WAERS
TYPE_OF_RATE = VBRK-KURST <<<<<<<<<< insert
IMPORTING
EXCHANGE_RATE = VBRP-KURSK
EXCEPTIONS
NO_RATE_FOUND = 1.
No comments:
Post a Comment