05-03-2005 9:52 AM
I am in search for FM or BAPI which will help me in solving my program.
I am using "BAPI_GL_GETGLACCBALANCE" to get the amount in Local currency, by using CURRENCYTYPE value '10'.
If I use the same BAPI to get document currency, by using
CURRENCYTYPE value '00', i get error message "Account does not exit". Is there any way to get the document currency for the given account using FM / BAPI.
Prabhu Rajesh.
05-03-2005 11:42 AM
Hi Prabhu ,
look at function group F009.
fm's :
FOR_ALL_SKC1C
READ_SKC1C
or own select of GLT0 as in your BAPI:
SELECT * FROM GLT0
WHERE RLDNR = '00'
AND RRCTY = '0'
AND RVERS = '001'
AND BUKRS = ACCOUNT_BALANCE-COMP_CODE
AND RYEAR = ACCOUNT_BALANCE-FISC_YEAR
AND RACCT = ACCOUNT_BALANCE-GL_ACCOUNT
AND RPMAX = '016'.
SUMME = SUMME + GLT0-TSLVT.
DO 16 TIMES VARYING GLT0VARY FROM GLT0-TSL01 NEXT GLT0-TSL02.
SUMME = SUMME + GLT0VARY.
ENDDO.
ENDSELECT.
regards Andreas
05-03-2005 9:57 AM
Sorry I would like to edit my error message to
"Balance Cannot be displayed in Currency type 00
(transaction currency)".
Regards,
Prabhu Rajesh.
05-04-2005 12:47 AM
Here is what the FM documentation has to say.
<b><i>This method provides the ending balance of a G/L account for the fiscal year selected.
The user decides whether the balance is provided in the transaction or company code currency. Exceptions are G/L accounts kept in various transaction currencies. In such cases, only the company code currency is allowed.</i></b>
Just an addition to Andreas's post (which is probably your solution), you need to consider field GLT0-RTCUR (Currency) as well, since these accounts could have records in GLT0 with multiple currency codes.
Rishi
05-03-2005 11:42 AM
Hi Prabhu ,
look at function group F009.
fm's :
FOR_ALL_SKC1C
READ_SKC1C
or own select of GLT0 as in your BAPI:
SELECT * FROM GLT0
WHERE RLDNR = '00'
AND RRCTY = '0'
AND RVERS = '001'
AND BUKRS = ACCOUNT_BALANCE-COMP_CODE
AND RYEAR = ACCOUNT_BALANCE-FISC_YEAR
AND RACCT = ACCOUNT_BALANCE-GL_ACCOUNT
AND RPMAX = '016'.
SUMME = SUMME + GLT0-TSLVT.
DO 16 TIMES VARYING GLT0VARY FROM GLT0-TSL01 NEXT GLT0-TSL02.
SUMME = SUMME + GLT0VARY.
ENDDO.
ENDSELECT.
regards Andreas