Currency value in BAPI_ACC_DOCUMENT_POST
Hi All;
in order to post payments i use BAPI_ACC_DOCUMENT_POST. There are many payment lines (posting key 40) and one vendor line (posting key 31). i have filled in tables header, account_gl, accounts_payable and currency-amount accordingly. When i run the function it issues an error stating 'use another currency other than ..'. I have tried with different currencies but the error keeps coming. I pass the currency value in account payable and currency amount tables. how can i sole this problem, is it smt. with FI customising?
Thx
ali
Hi,
here is my code:
clear header.
header-comp_code = '1100'.
header-username = sy-uname.
header-bus_act = 'RFBU'.
header-pstng_date = budat."kyt_tarih.
header-doc_date = bldat."g_tarih.
header-doc_type = 'SA'.
append header.
clear vendor.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = lifnr
IMPORTING
output = lifnr.
vendor-vendor_no = lifnr.
vendor-comp_code = '1100'.
vendor-itemno_acc = sayac.
vendor-tax_code = mwskz.
vendor-pymt_amt = 0 - toplam.
vendor-pymt_cur = waers."'TRY'.
vendor-pymt_cur_iso = waers.
append vendor.
clear tax.
tax-itemno_acc = sayac.
tax-gl_account = zco_benzin_match-hkont.
tax-tax_code = mwskz.
append tax.
clear amount.
amount-itemno_acc = sayac.
amount-currency = waers. "'TRY'.
amount-currency_iso = waers.
amount-curr_type = '00'.
amount-amt_doccur = 0 - toplam.
amount-amt_base = 0 - toplam.
append amount.
loop at itab.
sayac = sy-tabix.
clear accountgl.
clear tax.
clear amount.
clear zco_benzin_match.
if itab-kostl co numbers.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = itab-kostl
IMPORTING
output = itab-kostl.
endif.
select single * from zco_benzin_match where kostl = itab-kostl.
accountgl-itemno_acc = sayac.
accountgl-comp_code = '1100'.
accountgl-pstng_date = budat."kyt_tarih.
accountgl-doc_type = 'SA'.
accountgl-gl_account = zco_benzin_match-hkont.
accountgl-vendor_no = lifnr.
accountgl-tax_code = mwskz.
accountgl-orderid = itab-plaka.
accountgl-item_text = itab-tip.
append accountgl.
tax-itemno_acc = sayac.
tax-gl_account = zco_benzin_match-hkont.
tax-tax_code = mwskz.
append tax.
it_accounttax-acct_key = 'VST'.
clear amount.
amount-itemno_acc = sayac.
amount-currency = waers. "'TRY'.
amount-currency_iso = waers.
amount-curr_type = '00'.
amount-amt_doccur = itab-wrbtr.
amount-amt_base = itab-wrbtr.
append amount.
if not zco_benzin_match-hkont is initial.
move itab-wrbtr to tutar.
translate tutar using '.,'.
endif.
endloop.
if not test is initial.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_CHECK'
EXPORTING
DOCUMENTHEADER = header
CUSTOMERCPD =
CONTRACTHEADER =
TABLES
ACCOUNTGL = accountgl
ACCOUNTRECEIVABLE =
ACCOUNTPAYABLE = vendor
ACCOUNTTAX = tax
CURRENCYAMOUNT = amount
CRITERIA =
VALUEFIELD =
EXTENSION1 =
RETURN = messages
PAYMENTCARD =
CONTRACTITEM =
EXTENSION2 =
REALESTATE =
ACCOUNTWT =
else.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
DOCUMENTHEADER = header
CUSTOMERCPD =
CONTRACTHEADER =
TABLES
ACCOUNTGL = accountgl
ACCOUNTRECEIVABLE =
ACCOUNTPAYABLE = vendor
ACCOUNTTAX = tax
CURRENCYAMOUNT = amount
CRITERIA =
VALUEFIELD =
EXTENSION1 =
RETURN = messages
PAYMENTCARD =
CONTRACTITEM =
EXTENSION2 =
REALESTATE =
ACCOUNTWT =
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
IMPORTING
return = messages.
endif.
Thx .
Ali.
Similar Messages
-
Hi All,
We are facing error FI/CO interface: Balance in transaction currency from BAPI BAPI_ACC_DOCUMENT_POST.
This error we are getting only in case of passing tax data.
Can anyone help me on this.
Below is the code :
*fill header
gd_documentheader-username = sy-uname.
gd_documentheader-header_txt = 'Test'.
gd_documentheader-comp_code = p_ccode. "SQ
gd_documentheader-doc_date = sy-datum.
gd_documentheader-pstng_date = sy-datum.
gd_documentheader-doc_type = 'KR'.
gd_documentheader-ref_doc_no = p_xblnr. "SQ
*gd_documentheader-bus_act = 'RMWE'.
city = p_city.
state = p_state.
zipcode = p_zip.
*get tax juridisction code
IF NOT ( city IS INITIAL ) AND
NOT ( state IS INITIAL ) AND
NOT ( zipcode IS INITIAL ).
SELECT SINGLE rfcdest INTO ttxd-rfcdest FROM ttxd
WHERE kalsm = 'TAXUSX'.
CLEAR x_com_jur.
REFRESH t_com_jur.
x_com_jur-city = city.
x_com_jur-state = state.
IF zipcode+5(4) EQ space.
zipcode+5(4) = '0000'.
ENDIF.
CONCATENATE zipcode+0(5) '-' zipcode+5(4)
INTO x_com_jur-zipcode.
x_com_jur-country = 'US'.
CALL FUNCTION 'RFC_DETERMINE_JURISDICTION'
DESTINATION ttxd-rfcdest
EXPORTING
location_data = x_com_jur
IMPORTING
location_err = x_com_err
TABLES
location_results = t_com_jur.
IF sy-subrc = 0.
READ TABLE t_com_jur INTO x_com_jur INDEX 1.
it_accountgl-taxjurcode = x_com_jur-txjcd.
ENDIF.
ENDIF.
*fill AP (line 1) - vendor related data
SELECT SINGLE zterm FROM lfb1 INTO p_zterm WHERE lifnr = p_lifnr.
it_accountpayable-itemno_acc = 1.
it_accountpayable-tax_code = p_txcd.
it_accountpayable-pmnttrms = p_zterm. "SQ
it_accountpayable-vendor_no = p_lifnr. "SQ
*it_accountpayable-item_text = 'S2P Testing in UDR1'. - SQ
it_accountpayable-pymt_meth = p_pmet. "- SQ
APPEND it_accountpayable.
*fill GL (line 2)
it_accountgl-itemno_acc = 2.
*item_text - sq
IF p_asset IS NOT INITIAL.
TABLES : anlz,
anla.
SELECT SINGLE * FROM anlz WHERE anln1 = p_asset.
SELECT SINGLE * FROM anla WHERE anln1 = p_asset.
*concatenate '00' anla-KTOGR into it_accountgl-gl_account .
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = anla-ktogr
IMPORTING
output = it_accountgl-gl_account.
it_accountgl-asset_no = p_asset.
it_accountgl-sub_number = '0000'.
it_accountgl-cs_trans_t = '105'.
it_accountgl-acct_type = 'A'.
ELSE.
it_accountgl-gl_account = p_gl.
it_accountgl-costcenter = p_cc.
it_accountgl-wbs_element = p_posid.
ENDIF.
it_accountgl-comp_code = p_ccode.
it_accountgl-tax_code = p_txcd. "SQ
it_accountgl-pstng_date = sy-datum.
it_accountgl-fisc_year = sy-datum(4).
APPEND it_accountgl.
CLEAR it_currencyamount.
*fill currency ammounts for lines 1 & 2
it_currencyamount-currency = p_waers. "SQ
it_currencyamount-itemno_acc = 1.
*it_currencyamount-amt_base = -1.
it_currencyamount-amt_doccur = - 116. "p_totamt.
it_currencyamount-CURRENCY_ISO = 'USD'.
it_currencyamount-tax_amt = - 16.
APPEND it_currencyamount.
CLEAR it_currencyamount.
it_currencyamount-itemno_acc = 2.
it_currencyamount-currency = p_waers. "SQ
it_currencyamount-amt_doccur = 100.
it_currencyamount-CURRENCY_ISO = 'USD'.
*it_currencyamount-amt_base = 100.
*it_currencyamount-TAX_AMT = -10.
APPEND it_currencyamount.
*tax data
it_accounttax-itemno_acc = 3.
it_accounttax-tax_code = p_txcd.
it_accounttax-gl_account = '0023110000'.
*it_accounttax-gl_account = p_gl.
it_accounttax-TAXJURCODE = x_com_jur-txjcd.
it_accounttax-acct_key = 'NVV'.
it_accounttax-cond_key = 'XP2I'.
**it_accounttax-direct_tax = 'X'.
APPEND it_accounttax.
CLEAR it_currencyamount.
it_currencyamount-itemno_acc = 3.
it_currencyamount-currency = p_waers. "SQ
it_currencyamount-amt_doccur = 16.
it_currencyamount-CURRENCY_ISO = 'USD'.
it_currencyamount-amt_base = 100.
it_currencyamount-TAX_AMT = - 16 .
APPEND it_currencyamount.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
documentheader = gd_documentheader
IMPORTING
obj_key = wa_obj_key
TABLES
accountgl = it_accountgl
* ACCOUNTRECEIVABLE =
accountpayable = it_accountpayable
accounttax = it_accounttax
currencyamount = it_currencyamount
* CRITERIA =
* VALUEFIELD =
* EXTENSION1 =
return = it_return
COMMIT WORK.
Regards,
PriyaranjanHi,
Reason 1:
An revenue-recognition-relevant item has several active conditions whose values cancel themselves so that a net item value of 0 results. The conditions have both the same revenue account (SAKN1) and the same clearing account (SAKN2).
For these conditions, the system writes a line with value 0 into the temporary FI/CO interface (internal tables: CACCIT, CACCCR). If table VBREVK does not contain control lines for this line, no further processing occurs and the line remains in the temporary FI/CO interface. Then the system reads this line for the creation of the next billing item which conatins a net value and generates a posting line with value 0. As a result, there is a balance in the FI/CO interface, and the billing document cannot be transferred.
Reason 2:
The billing document contains at least one item with an item category for which there is a setting stipulating that the values of this item should not be transferred to the header total of the document.
That is, in the maintenance of the item categories, this item category has the characteristic 'X' or 'Y' in 'Statistical value' field.
Reason 3:
Case: Billing document contains items without pricing conditions.
Then, on release to accounting, error RW022 occurs.
regards,
Saju.S -
How can i get currency values from flatfile to function module
Dear All,
I have to take currency values from flat file and i have to assign those flat file value to function module .
Eg: "Convert_to_local_currency". I need technical code how to calculate those amount in work area and how to assign those amount value function module.
I need sample program for currency conversion from flat file to function module. My requirement is based on flat file amount i have to calculate in work area and assign those work area to function module.
With Regards,
BaskaranHi Satish or Baskaran,
First conform in which format the flat file is present, as abhi mentioned if it is there in notepad
try to use F.M GUI_UPLOAD as shown below...
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'C:\Desktop\rpf1.TXT'
TABLES
DATA_TAB = ITAB.
Now loop at ITAB Into Work_area and press the respect currency fields which you want and in the same way
if the file is in EXCEL format use F.M ALSM_EXCEL_TO_INTERNAL_TABLE
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = P_FNAME
i_begin_col = 1
i_begin_row = 1
TABLES
intern = ITAB
LOOP AT ITAB INTO WA.
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
EXPORTING
foreign_currency = wa-waers
local_currency = wa-waers
IMPORTING
local_amount = tvals-gross.
ENDIF.
endloop.
And as mentioned loop the records into work area and process the currenct field which is present in the
ITAB according to its field name. And make sure within the loop you call your function module.
Regards
VEnk@
Edited by: Venkat Reddy on Dec 9, 2009 5:51 PM -
Right Align the Currency values in ALV report
Hi Friends,
I have developed a report and displayed the output using the ALV. I have columns for currency values in the output table.
The fields for currency values are character fields. The values in the table for display, is properly right aligned (default for currency values). But in the output, the currency values are left aligned.
Since I need blank lines in the output table after each entry, I have used the character fields in the output table so that I can clear them and append it to get the blank line.
Please suggest me to get the currency values right aligned.
Thanks in advance.try with this field in field catalog.
just(1) type c, " (R)ight (L)eft (C)ent.
for the currency field add this field too in field catalog. it will work. -
SSRS expression for difference between two currency values
Hi All;
I need to get the difference between two currency values
Below is my report
I need to get differene between Actual Income and Profile Income and this value should be in "£" In this example it should be £0.00
Any help much appreciated
Thanks
Pradnya07=sum(Fields!ProfileIncome.Value - Fields!ActualIncome.Value)
This could have either field first, but depends on which field is expected to be larger. You would then format the textbox to show in pounds.
HTH -
Display Currency Value of User POV for Entity & Value in Text Box (Header)
I am looking for a function in Financial Reporting Studio that operates the same as the HsCurrency function in Smart View. This would allow batch reports displaying the currency value of the User POV for Entity based on the User POV for Value. Right now I have to have Member Lists for separate reports and different currencies as I am only able to display the Value dimension in the heading of a given report. Users will not be certain of the currency if the Value dimension is <Entity Curr Total>.
I tried the HFMCurrency text function, however the entity is not defined in a Row / Column / Page reference as the entity is determined by the User's Point of View.
Is there a way to display the currency value of a User's Point of View for Entity based on the User's Point of View for Value?
Reference from Oracle Hyperion Smart View for Office, Fusion Edition, User's Guide:
HsCurrency
Data sources: Financial Management, Hyperion Enterprise
HsCurrency retrieves the currency value of the specified dimension member. Entity and Value are the only valid members for the HsCurrency function.
Syntax
HsCurrency (“Connection,Entity;Value”)
Example
In this example, HsCurrency retrieves the entity currency where the currency for the East Sales entity is USD, and the currency for the UKSales entity is GBR. The EastSales entity displays USD, and UKSales displays GBR.
HsCurrency(“Comma”,”Entity#EastRegion.EastSales;Value#<Entity Currency>.”)
HsCurrency(“Comma”,”Entity#EastRegion.UKSales;Value#<Entity Currency>.”)Question answered in My Oracle Support Community - Hyperion Reporting Products:
communities.oracle.com -
Exported currency values are not seen as numbers
Hee Guys,
I've asked this question a couple of weeks before but I didn't really get an answer. I am astounded that I'm the only one that has this problem but our application mostly works whith currency values. And our reports revolve around these numbers. But whenever I download these reports to excel the currency fields are seen as text and I cannot use any formula on this data. Even after I remove the currency sign and change the number into a number field. I just don't get it!
We need to process the data from our reports and use calculations to compare the data with data which is not in CRM On demand. How do I do this when I can't use the reportingdata?
Anyone any thoughts? The only workaround I found is by downloading as .CSV and then placing 'text to collumns' but this is very time consuming
Thanks in advance!Hi,
is it possible to show the report currency (=user currency) in the column header? I tried to use VALUEOF(NQ_SESSION.USER_DEFAULT_CURCY) in some way, but failed.
We do not want the currency symbol in the column (because of excel export), but somewhere the currency should be written...
Kind regards
Michael -
Display parallel currency values with KSB1.
Hello,
My local and CO currencies are both set to USD. I have a hard currency of MXN. With KSB1, if the document is entered in local currency (USD), is there a way to display the corresponding hard currency value?
If the document is posted in hard currency, I have no trouble displaying it in USD (local currency) by bringing in the field Val. in Rep. Curr.
Thank youExactly is what i said.
Your example
USD is Cotrolling aea currency
MXN is Transaction currency
As the MXN is Transaction currency here, you can bale to see the values.
but normally, the MXN is Hard currency which is 3rd currency.
So, the report KOB1 shows you only
CO Area currency
Transaction currnncy and
Object currency, which could be your local corrnecy
Check the below reports
S_ALR_87013010 - Orders: Breakdown by Period
S_ALR_87012993 - Orders: Actual/Plan/Variance
S_ALR_87012997 - List: Cost Elements by Order
S_ALR_87013002 - Orders: Quarterly Comparison - Actual
S_ALR_87013015 - List: Actual Debit/Credit
Thanks -
How to convert a string to a currency value ? getting a dump with exception
Hi,
I am getting a exception not caught in CX_SY_CONVERSION_NO_NUMBER.
I am trying to convert a string value with ',' to a currency value.
I tried using Replace and Condense. But the error still persists.
Is there a FM or a casting that I can use?
Cheers
KiranHi,
Sorry I got my question wrong. I have a problem - that when I'm trying to pass a value from a string to a currency field.
But, the currency field is a field symbol.
so, I have
data abc type string.
abc = "5345"
<curr_val> = abc.
now <curr_val> = 0.000
Please suggest. -
How to display currency values in indian format
hi all,
When I am displaying Currency values as output , those are displaying in U.S. format (ie.1,234,000.00) , But I need to display those in Indian Rupee format (i.e 12,34,000.00).
Plz any one can help me that how to display this
thank you,
regards
HanumaHi Hanuma kumar, please try this code.
REPORT ZAMOUNT_CONVERSION.
DATA : RESULT1(20).
PARAMETERS : NUM TYPE P DECIMALS 2.
DATA : num2 type STRING.
DATA : col_amt(20) type n,"15
col_b type i,
num_1(20) type C,"15
Length type i.
num_1 = num.
write : 'default format :',num.
uline.
skip.
IF ( num >= 999999999 ).
write num_1 using edit mask 'RR__,__,__,__,______' to col_amt.
CONDENSE col_amt.
length = STRLEN( col_amt ).
if length = 16.
REPLACE first OCCURRENCE OF ',' in col_amt with space.
write :/'amount indian format:',col_amt.
else.
write :/'amount indian format:',col_amt.
endif.
ELSEIF NUM < 999999999 AND NUM >= 9999999.
write num_1 using edit mask 'RR__,__,__,______' to col_amt.
condense col_amt .
length = STRLEN( COL_AMT ).
if length = 13.
REPLACE first OCCURRENCE OF ',' in col_amt with space.
write :/'amount indian format:',col_amt.
else.
write :/'amount indian format:',col_amt.
endif.
ELSEIF NUM < 9999999 AND NUM >= 99999.
write num_1 using edit mask 'RR__,__,______' to col_amt.
condense col_amt .
length = STRLEN( COL_AMT ).
write :/'amount indian format:',col_amt.
ELSEIF NUM < 99999.
data : dumy(10) type c.
dumy = num .
CONDENSE dumy.
length = STRLEN( dumy ).
if length <= 6.
write :/'amount indian format:',num.
else.
write num_1 using edit mask 'RR__,______' to col_amt.
write :/'amount indian format:',col_amt.
endif.
ENDIF.
uline. -
Set currency value of pricing element in condition tab - VA21
Hi GURU,
Would you please help to identify the way to set the following currency values for pricing element in condition tab when creating system quote by va21:
Rate unit (RV61A-KOEIN)
SD document currency (KOMK - WAERK)
Thanks in advanced,
Regards,
ThangSolved
-
Dear all,
Is it possible to extract the exchange rate from a user-defined field in the row details of an invoice document to compute for the system currency value of the invoice journal entries, instead of using the rate maintained in the Exchange Rates and Indexes table? Please refer to the desired journal entries below.
To Illustrate:
Exchange Rate Maintained in SAP B1 Table = 44.20
Basic Initialization Settings:
Local Currency = PHP
System Currency = USD
Exchange Rate Maintained in User-defined Field (INV1) = 44.00
Invoice Details:
Transaction Currency = Local Currency (PHP)
BP Currency = Multicurrency
Doc Total = PHP 30,000
Journal Entries Posted from AR Invoice:
Debit Debit (System Currency)
BP Control Account PHP 30000 678.73 (PHP 30000/ 44.20)
_Desired Journal Entries to be Posted from AR Invoice:_
Debit Debit (System Currency)
BP Control Account PHP 30000 681.82 (PHP 30000 /44 )
Your feedback shall be very much appreciated.
Thank you,
DonaIt may be possible to achieve this using a crystal report to recalculate the vaues. My question though is why is this necessary?
-
Update header document with selected currency value in JSP
Hi all,
I have custom dropdown box for currency in checkout JSP page.
If I change currency selection in dropdown, how can I capture this value and update currency in header.
VenkatHello Venkat
I am not sure if I got your actual query here.
Where exactly have you placed your custom Drop-down field as of now?
I guess, if you have a custom Drop-down field, you will also have its action-handlers. Why cant you use the action handler for value selection or value change, and then pass the new currency value selected and trigger another update on the Order?
Hope this helps.
Regards, Vishal -
COMMA IN CURRENCY VALUE FOR INR
value is coming like this 970,167,543.21
i need the indian currency value in this format 97,01,67,543.21 .
i have used write statement with currency addition ...and am checking for any fm ot put the comma for indian currency .
definitely this function module CONVERT_TO_LOCAL_CURRENCY will wont work....
so any help on this ....Hi,
Please find the code Below
Define the variable W_amount as character:
data: W_amount TYPE p LENGTH 8 DECIMALS 2 VALUE '10000.00'.
data: w_amount(10).
Then write the below statement
write: w_amount to w_amount no-grouping.
This statement will move the value of w_amount to w_amount without separator.
Hope this helps.
Thanks
Kalyan B -
Hi
I would like to know, how the daily changing currency values are stored in SAP(US Dollar) and in which table its store and how its get updated.Can any one explain briefly.
Regards
Arunkumarhi arun,,,,
its simple and cant be brief anymore.
1,)SPRO > SAP Netweaver> General Settings --> Currencies....it is the way to go the table
2.)TCURR is the table for storing .
3.) Updates in the table TCURR
thanxs and regards
sachin sharma
njoy!!
Maybe you are looking for
-
X11 not starting on 10.6.8
X11 does not start (icon just bounces in the dock when directly clicked and then disappears). It sems that I have an old X11 version (1.0 according to the info panel). Error messages found in Konsole: 28.09.13 21:23:59 [0x0-0x30030].org.x.X11[410] la
-
iphoto does not open, i click and it just "jumps" one time at the dock version:iphoto`09 8.1.2(424)
-
Hi - I tried setting a button <mx:Button> width via CSS but the "width" tag does not effect the button. Rich
-
Table to get the number of files flowing in XI one day
Hi Friends, Is there any table in XI to see the files received/send(flow of files) for each day? My requirement is, I need to find the files and filenames with hashcodes if possible . For a day, I would like to see the number of files flown etc(other
-
Trying to save preferences to a network drive (no local drives available).
I'm on a virtual desktop with no local drives. Captivate 8 is telling me that I can't save Preferences, Projects, or Cache items to a network drive. I have no choice in the matter. Any ideas how I can get around this? Thanks.