99.40 "Ninety nine and fourty cent Dollar"
1,200.00 "one thousand two hundred and zero cent"
10,999.50 "ten thousand nine hundred and ninety nine and fifty cent"
pls. help me how to write this code
Thank you
HI
create or replace function to_word (
m_amount_in in number,
m_first_para in varchar2 := 'Dhirhams',
m_second_para in varchar2 := 'Fills'
return varchar2
-- correct
as
m_amount number := m_amount_in;
word_string varchar2(1000);
lower_number number;
lower_str varchar2(50);
loop_var number := 1;
function to_string ( m_val_in number)
return char
--correct
is
begin
if m_val_in > 0
then
return ( initcap (to_char (to_date (m_val_in, 'SSSSS'),'SSSSSSP')));
else
return ('');
end if;
end;
--correct
begin
lower_number := (m_amount MOD 1) * 100;
if length(lower_number) < 3
then
if m_amount >= 1 and lower_number > 0
then lower_str := '' || m_first_para || 'AND' ||
LOWER (to_string (lower_number)) || '' || m_second_para;
elsif m_amount < 1 and lower_number > 0
then lower_str := LOWER(to_string(lower_number)) || ''|| m_second_para;
elsif m_amount >= 1 and lower_number = 0
then lower_str := '' || m_first_para;
end if;
ELSE
word_string := 'invalid lower denomination !!';
return (word_string);
end if;
--correct
while loop_var = 1
loop
if m_amount > 0
and m_amount <= 1000
then
word_string := 'AED'||' '||
word_string ||
( initcap (to_string (floor (m_amount))) || lower_str);
loop_var := 0;
elsif m_amount > 1000
and m_amount < 1000000
then
word_string := 'AED'||' '||
word_string ||
(initcap (to_string (floor (m_amount / 1000))) ||
'Thousand' ||
to_string ( floor ( m_amount MOD 1000)) ||
lower_str
loop_var := 0;
elsif m_amount >= 1000000
and m_amount < 10000000000
then
word_string := 'AED'||' '||
word_string ||
initcap ( to_string ( floor ( m_amount / 1000000))) || 'Million';
m_amount := floor ( m_amount MOD 100000);
if m_amount = 0
then
loop_var := 0;
word_string := word_string || lower_str;
end if;
elsif m_amount >= 1000000000
and m_amount <= 99999999999.99
then
word_string :=
initcap (
to_string ( floor ( m_amount / 1000000000))) || 'billion';
m_amount := floor ( m_amount MOD 1000000000);
if m_amount = 0
then
loop_var := 0;
word_string := word_string || lower_str;
end if;
elsif m_amount = 0
then
word_string := ('zero' || lower_str);
loop_var := 0;
else
word_string := 'this is beyond my scope !!';
loop_var := 0;
end if;
end loop;
return ( word_string);
end;
coding from :Mr. Tom kyte
regards
Mohammadi.
Similar Messages
-
Vendor Ageing Report Business Area and Profit Center wise
Dear Experts,
I have a requirement where user wants a Report for Vendor Ageing Business Area and Profit Center wise.I checked Standard T Codes but the same were Business Area wise but i could'nt find Profit Center wise Report.If their is any standard functionality then please advice.
We are using SAP ECC 6.0 Classic GL with Spl Purpose Ledger active.Can someone please advice can i derive such a report through Report Painter.If possible please advice in details.
Your Valuable inputs shall be appreciated....
Regards
RahulHi Durga,
Can you please elaborate further on the same how you are determining the Report in FBL1N.What are the prerequisited to be taken care of and some further details on the same.
My Bus Area is not as same as Profit Center eg
BA PC
FXRT RT0001 / 2 / 3
TMMG TM0001/ 2 / 3
LTOB LO0001/ 2 / 3
I checked in my system but we do not have the Program for the following T Codes
S_PCO_36000218 - Segment Receivables
S_PCO_36000219 - Segment Payables
S_AC0_52000887 - Profit Center Receivables
S_AC0_52000888 - Profit Center Payables
Regards
Rahul -
Report painter, Internal orders and profit center accounting
hi,
I want to do a report using data from internals orders (AUFNR) and profit center accounting (PRCTR).
I can make individual reports for internals orders (6O1, CCSS) and for profit center accounting (8a2, GPLCA) but I can't combinate data from internals orders and profit center accounting.
Is it possible make a report using report painter that show data of internals orders and profit center accounting.
All my internals orders have a profit center accounting.
Thanks in avanced[url] http://help.sap.com/saphelp_45b/helpdata/en/cc/36428394f311d2b47a006094b9b0a5/frameset.htm
this may be helpful
regards.
santhosh reddy -
PO reporting that can capture PO number, PO value and cost center
Dear SAP expert and gurus,
Would like to seek for your professional advise and consult on which report in MM that can capture the PO number, PO value and cost center.
Kindly advise.
Thank you
Regards
Leonard TanME80FN is a good report that captured the PO number and amount. However, the cost center is not being captured here. is there any suggestion?
ME2K is not an ideal report to user cause, user requires the data to be shown in one line instead of 2 to 3 line.
Is there any report like ME80FN can be captured PO number, PO value and Cost Center.
Thank you
Regards
Leonard Tan -
Std report to dispaly Sales Order and Profit center data
Hi,
I want to display list of Sales Order and profit center in one report for that Sales organisation
Is there any T-code where i can view Sales Order and its Profit center.
**Plz if anyone knows abt this reply soon.
Thanks
AKASH
Edited by: AKASH TAMBI on May 20, 2008 1:28 PMDear Akash
There is no standard report to see both the sale order reference and profit center. However, if you go to SE16 and use table VBAP, you can see the required details
thanks
G. Lakshmipathi -
Report Needed to show WBS and Profit Center on Invoices
I need a report of open and cleared invoices that show the WBS and Profit Center.
I have tried the FBL5N and it doesn't populate it. Any other reports out there???You dont have to join them. Keep both profit center and cost centre in the cube. While defining the update rules, derive profit center from cot centre.
In the report , keep profit center and cost centre as free char.
The users can dynamically drill down and view the report for cost centre or profit centre or both.
Another idea is to keep profit centre as a nav attribute in the cube and in that case, you dont have to derive profit centre from cost centre in the update rules.
Ravi Thotahdri -
WBS, Business Area and Profit Center not flowing in GR/IR Account
Hello Experts,
I have come across a very strange situation. I have two MIGO documents which are showing different posting characteristics:
1) FI Document 5000000553
In this document, the Business area and profit center is flowing in GR/IR Clearing Account (15660000) but WBS element is not flowing to this line item.
Screen shot is as follows:-
As you can see from the above screen shot that, for GR/IR Account 15660000. Only Business Area and Profit Center are flowing and WBS Element is not coming.
2. FI Document 5000015602
In this document, the WBS element is going in GR/IR Clearing Account (15660000) but Business area and profit center is not flowing to this line item
Screen Shot is as follows:-
From the above screen shot, Business Area and Profit Center are not flowing but WBS Element is coming.
Could you please let me know what could be the possible reason for this behavior of both the documents.?
Regards,
AmitHi Saurabh,
Its great to see your reply. Yes, I know that currencies and posting dates are different. But that's the way it is. One document is for fiscal year 2014 and other is for 2013. There is nothing related to currency and posting date which was causing the strange behavior of the system.
However, our team analyzed the issue and found that only for service material having a special valuation type related to services is causing the problem and still we are diagnosing the other possible root cause as well.
Thanks for your co-operation and suggestion.
Regards,
Amit -
Not updating G/L account and cost center with BAPI BAPI_PO_CREATE1
Hello Friends,
The two fields G/L ACCOUNT and Cost Center is not updated using BAPI BAPI_PO_CREATE1. I am unable to understand why? This is what i am passing to account assignment structure( POACCOUNT). Filled POACCOUNTX structre as well. I have passed company code at the header level.
PO_ITEM = 00010
SERIAL_NO = 01
CREAT_DATE = sy-datum
GL_ACCOUNT = 621000
COSTCENTER = 1000
CO_AREA = 4000
Please let me know why it is not updating anything i missed while passing?
2>I need to update GR quantity but this field is not available in the BAPI ..Please let me know how to update this field.
Any help is highly appreciated.
Regards,
RajHi, I have a problem I use the bapi BAPI_PO_CREATE1, I pass the table pt_poaccount in the parameter poaccount but the bapi when register my purchase order doesn't register correctly the values KOSTL, AUFNR, PS_PSP_PNR, NPLNR of the tablepoaccount and register the default values of the contract. Please i need help with this.
CLEAR s_poaccount.
s_poaccount-po_item = <fs_datos>-ebelp.
s_poaccount-serial_no = w_serial.
s_poaccount-costcenter = <fs_datos>-kostl.
s_poaccount-orderid = <fs_datos>-aufnr.
s_poaccount-wbs_element = <fs_datos>-ps_psp_pnr.
s_poaccount-network = <fs_datos>-nplnr.
s_poaccount-activity = <fs_datos>-vornr.
s_poaccount-quantity = <fs_datos>-menge.
s_poaccount-net_value = <fs_datos>-brtwr.
s_poaccount-creat_date = sy-datum.
s_poaccount-itm_number = <fs_datos>-ebelp.
s_poaccount-co_area = '1001'.
APPEND s_poaccount TO pt_poaccount.
CLEAR s_poaccountx.
s_poaccountx-po_item = <fs_datos>-ebelp.
s_poaccountx-serial_no = w_serial.
s_poaccountx-po_itemx = 'X'.
s_poaccountx-serial_nox = 'X'.
s_poaccountx-creat_date = 'X'.
s_poaccountx-itm_number = 'X'.
s_poaccountx-co_area = 'X'.
s_poaccountx-costcenter = 'X'.
s_poaccountx-orderid = 'X'.
s_poaccountx-wbs_element = 'X'.
s_poaccountx-network = 'X'.
s_poaccountx-activity = 'X'.
s_poaccountx-quantity = 'X'.
s_poaccountx-net_value = 'X'.
APPEND s_poaccountx TO pt_poaccountx.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = pe_poheader
poheaderx = pe_poheaderx
IMPORTING
exppurchaseorder = pi_exppurchaseorder
TABLES
return = pt_return
poitem = pt_poitem
poitemx = pt_poitemx
poschedule = pt_poschedule
poschedulex = pt_poschedulex
poaccount = pt_poaccount
poaccountx = pt_poaccountx
poservices = pt_poservices
posrvaccessvalues = pt_posrvaccessvalues.
The BAPI is register with these values as default however i pass other values in table
pt_poaccount -
Authorization object for company code and profit center together
Hi all,
Please help me with the following requirement..
Company Code = ABCD
Profit Center = *
The user is authorized to run the report for company code ABCD only but any profit center within this company code.
2 Company Code = *
Profit Center = WXYZ
The user is authorized to run the report for Profit Center WXYZ only but any company code.
3 Company Code = *
Profit Center = *
The user is authorized to run the report for any company code and profit center.
The same user could have 1 and 2. So, in this case he should be able to run a report for the total inventory of company code ABCD, and a report for total inventory of profit center WXYZ only regardless company code.
He should not have visibility to other company codes inventory other then profit center WXYZ.
Regards,
RajHi ,
Anyone please help me..
Regards,
Raj -
Link between G/L Account and profit center
Hello dear all,
I have an issue in Intra-company process.
I made 2 customer payment for 2 different company code:
1/ Company 1000: i have 2 line items posted (in G/L View)
2/ Company 2000: For the same Cash account and the same customer account used in my first case (with company 1000) i have 4 line item posted in the G/L view and with different " PARTNER PROFIT CENTER"
I do not know wher can i find in customizing the link between G/L Account and Profit center ?
Thank you in advanceThe document splitting is active in your company, at the same time, the "zero balance" for profit center is activated in your doc split characteristics. In order to balance the profit center in General View, it creates another line item for balancing it which is the zero balancing account or split the cash account according to profit center assignment. For some cases, they are split equally that is why it is best that you assign the profit center in the cash account upfront and create line item for each payment with different profit center assignment.
For instance, there are two customer line items with different profit center assignment
Customer Line Item 1 = Assigned to Profit Center 2000 amount 500
Customer Line Item 2 = Assigned to Profit Center 3000 amount 500
When I post a payment of 1000, the Entry View is
Cash 1000
Customer 1000
GL View
Cash PC 2000 500
Customer PC 2000 500
Cash PC 3000 500
Customer PC 3000 500 -
Business Area and Profit Center In Document Splitting
Hi,
We are using Business area and Profit Center characteristics for document splitting.
In one transaction, the Business area and profit centers are defaulted through the cost center.
The document is successfully split in respect of the business area, but the profit center is not filled, thereby giving error while posting.
Please suggest.Hi,
Actually, we have all three scenarios, profit center, segment and business area..
As suggested, we have checked all field status relevant.. profit center is optional in all cases..
Now, Pls consider the scenario without business area in document splitting characteristics..
If I post an expense, profit center is picked thru cost center and segment thru profit ctr. The vendor or bank line item inherits the characteristic values from the previous line item.
Now, in addition we have business areas in doc splitting characteristics.
Business area, again is populated thru cost centers, along with profit ctr and segment.
The business area gets correctly populated in the vendor line item.. but the profit center doesnt.
Please let us know the reason..
Edited by: Swapvik on Mar 23, 2009 4:07 PM -
Combination of G.L account number and Profit center
Hi All,
i want to know some tables where i can see the linkage b/w the G/L account number and Profit center.
Like all the Profit centers coming under a particular G/L account.
Thanks in advance,
Shyam.i want some base table like thing ...not transaction details...
FAGLEFLEXA - table is not present in our system,is it a 3rd party soln.
Edited by: Shyam Das on Jan 30, 2008 2:13 PM -
Access sequence for Partner determination -Sales and Interaction Center CRM
Dear experts,
We use som transaction types both in our sales (t/c crmd_order) and in Interaction center (t/c CIC0).
We though want the partner determination to act differently when creating this transaction in sales compared
to when creating it in the interaction center. For example in the sales process we want the contact persons to be searched from the relationsship of the sold-to party but in customer service we do not want an automatic determination.
There are some BADIs available that can be used in the access sequences as a source but can they be used to
switch off some automatic determination when creating the transaction in t/c CIC0 whereas the automatic determination should work when creating the transaction in the sales process ie. t/c crmd_order?
Looking forward to have any input on this, thanks!
best regards,
ChristinaHi,
What we did is to remove the automatic determination on the transaction type that is used both in the sales process and Interaction center/customer service. The partner in question is only determined from the previous document in case you
create a follow-up document.
rgds,
Christina -
AP invoice with different tax rate and cost center?
Dear all,
We are just upgrade from 11i to R12.1.3. Before in 11i, we can change distribution account in AP invoice distribution line if the type is "Tax". However, after updated to R12, we define tax code (e.g. P1 for particular account combination), so once user selects tax code "P1" and invoice will automatic creates tax line for such invoice but the user cannot change distribution account anymore. Because in 11i, user will change the distribution account (cost center segment) but now in R12 user cannot change it.
The only work around is defining different tax code for different cost center.
For example: P1-0001 => 01.0000.999999.00001
P2-0001 => 01.0000.999999.00002
We have hundred of tax code and cost center combination.
Any other work around for this? or anyone encounter the same problem?
Please advice.
Thanks.Let me explain more in details:
1) The cost centre will will more. 2 cost centres just a simple example.
For now, we have 5 cost centres for each of the tax rate. For the work around now, I need to define 5 tax codes for the same tax rate for different distribution combinations:
Quote
Tax Code ==>Tax Rate ==> AP Distribution Combination
A1-3500 ==> 10% ==>001.9999999.3500.00
A1-3600 ==> 10%==> 001.9999999.3600.00
A1-3700 ==> 10%==> 001.9999999.3700.00
A1-3800 ==> 10%==> 001.9999999.3800.00
A1-3900 ==> 10%==> 001.9999999.3900.00
2) The driving factor would be 100% percent.
Please kindly advice.
Many thanks.
driving factor for the cost centre -
No functional area derived from GL account and cost center ccombination sel
Hi,
When doing a goods issue for a delivery, am getting this error. Hope somebody could advice.
"No functional area derived from GL account and cost center combination selected."Hi,
Go to FS00 and specify the functional area for the gl account. Go cost center change mode specify the functional area. Define the f area in Tcode OKBD, FSP2,KA02,KS12,
Hope this is clear, if yes assign points
Regards,
Sankar
Maybe you are looking for
-
Status of transfer (shipment costs header data)
Kindly explain it to me in general language, Status of transfer (shipment costs header data) This status describes the stage of forwarding for a shipment cost document. Use The status is determined by the system and cannot be changed manually. To det
-
I am have problems upgrading my old itunes system to the 10.7 version. I have downloaded w10.7 to my desk top. However, when I try to install it, it seems to be installing for a while, then I get a message box that says: "The system administrator h
-
PC, Mac, and wireless
I'm sorry if this is a repeat in anyway. I've tried searching the forums and I still can't get my internet working properly. Ok, I have my IMac G5, my roommate has a PC. We have a cable modem and then a Linksys Wireless-B Model No. BEFW11S4 router. T
-
I just finnished downloading a song from the iTunes store. However, when I tried to play it only the first minute played. Will I have to download it again or is there something else I need to do to get the whole song to play?
-
Wired 802.1X with ISE | Some computers cannot be authenticated
Hi, We have a customer which is using ISE with 802.1X in order to authenticate computers. All the computers have their own certificate and most of them can be authenticated fine! The issue is that some computers cannot be authenticated. The port conf