ABAP-Printing values in words in Scripts
Dear all,
If i have made a Zscript Can i include functionalities like converting the amount into words etc.
For Ex If the total amount is 1200 Rs and 85 Paise (1200.85) If i want to print it in words with appropriate currency, what i need to do?
I really appreciate a detailed answer on this.
Thanks and Regards
Shrinivas
<MOVED BY MODERATOR TO THE CORRECT FORUM>
Edited by: Alvaro Tejada Galindo on Dec 23, 2008 10:11 AM
Hi,
Do the necessary coding in the driver program, and store the values in a variable, and in script give that variable. If it is a standard driver program, use a subroutine for that script, using PERFORM statement.
Use this FM for conversion to words
SPELL_AMOUNT
Regards
Bala Krishna
Similar Messages
-
When I print a document with Arabic script in In Design the characters appear in an inverted form, in the opposite direction, while the printer doesn't do this with other software such as Word
(The small field at the top of questions is to type just a title; the large field is to type your full question in, along with anything else that may help us help you.)
When you say "print", do you mean the text is correct in your InDesign file? If you export the document to a PDF, is it still correct? Final test: if you print the PDF to your printer (making sure you use the same driver and setting), is it wrong? Then it's your printer driver, trying to be smart when it should not. Locate a Settings dialog where you can switch off options such as this one. Were I a betting person, I'd tell you to look for something called "Auto-correct mirrored documents". -
Numeric value in words (for Cheque printing)
Hi All,
To convert numeric value in words (for Cheque printing), I created two functions in Forms and reports 6i.
1) FUNCTION Spell (val number) RETURN CHAR IS
sp varchar2(100);
BEGIN
if val > 0 then
return(initcap(to_char(to_date(val, 'SSSSS'), 'SSSSSSP')));
else
return('');
end if;
END;
2) function SPELLED_AMOUNTFormula return Char is
cents number;
c_str varchar2(80);
val number;
begin
val := :p_instr_amt;
cents := (val mod 1) * 100;
if cents > 0 then --creates string for cents
c_str := ' and ' || spell(TO_CHAR(cents)) || ' fils Only';
else
c_str := ' Only';
end if;
if val < 1000 and val > 1 then
return (initcap(spell(floor(val))) || c_str);
elsif val > 1000 then
return(initcap(spell(floor(val/1000))) || ' Thousand ' ||
spell(floor(val mod 1000)) || c_str);
else
return('Zero'||c_str);
end if;
end;
This convert value up to thousands. How to convert the value more than 1 lac. please configure this code.
Thanks in advanceHi,
To spell integers as high as 5,373,484, use 'Jsp' instead of 'ssssssp'.
TO_CHAR ( TO_DATE ( n -- n = integer to be spelled
, 'J'
, 'Jsp' -- Case-sensitive
)5373484 is the Julian date of December 31, 9999, the latest DATE value in Oracle. In Oracle 10.2, you can actually spell numbers a little bit higher using the expression above, but I'm not sure why, and I wouldn't count on being able to do so in future versions.
There's no need for INITCAP here. If the 2nd argument to TO_CHAR is initcapped (as above), then the output will be, too.
To spell even larger numbers, see this page by Tom Kyte, which also includes languages other than English, and lakh-crore-arab-kharab wording.
Edited by: Frank Kulash on Oct 13, 2012 7:21 AM -
How to print a Pdf from Java script
Hi,
I need to print a pdf from java script. In java script i have url of pdf. Is there any way to print pdf from java script?
I am able to print word doc by ActiveX. is there any activeX or something else which do the same thing for pdf?
Any help heartily esteemed to me.
Thanks
Kamlesh Sharmayou are cross postin .. your thread has been answered in the jsp jstl forums
-
How to display employee photo in pdf through WebDynpro OR ABAP print Progr?
hi,
I have uploaded employee photos using TCODE OAOH. Now all the employee photos are stored in Archive link.
Now my requirement is i have get the employee photo and display it in PDF using PDF forms and webdynpro OR using ABAP print program.
I am able to get the employee photo from SAP archive link using ABAP code. After this i have to upload this to MIME reository. From MIME repository i have to display it in PDF forms from WEbDynpro.
I tried with ABAP print program, directly calling the PDF form in program and display the employee data with Employee Photo. With my program i am able to see only employee data. But it's not displaying employee Photo.
Plz any helps to display employee photo in PDF forms using either webdynpro OR ABAP printprogram.
If ur reply is related to WebDynpro, pla tel me how to upload photo to MIME repository From Archive Link.
Since all the employee photos are uploaded into Archive link using Tcode OAOH. From this i have to get the employee photo and upload it to MIME repository and i have to display it in PDF forms.
Any help are appreciated.......
Regards,
Shankar.Hi Sankar,
1)You can use the program BSP_UPDATE_MIMEREPOS to upload the photos in the mime repository.
2)Use the following code to get the content from your mime and set the content to your interactive UI element as Xstring format.
data:
mime_repository type ref to if_mr_api,
content type xstring,
url type string value '/SAP/BC/BSP/SAP/myBSPapplication/rajkumar.jpg' .
mime_repository = cl_mime_repository_api=>get_api( ).
call method mime_repository->get
exporting
i_url = url
importing
e_content = content.
wd_context->set_attribute( name = 'DATAS' value = content ).
Thanks,
Rajkumar.S -
To find the abap print program
hi,
I have an sap script form, and i need to find the the abap print program for that? How can i do that?
Thanks
VinuHi Vinu,
It depends on how the Scripts program is called.
There are two ways...
1) You can use NACE transaction->
Select the application, and Click Output Types->
Choose the Output type and Click on Processing Routines
Here you can find the Driver program and Script.
2) Go to Script program -> Use Where used list to know where the Script program has been called.
Please close the post if your issues has been solved.
Thanks,
Sreekanth -
Can somebody please give me the piece of code to translate value into words, i.e., from (value) 27,500 to (words) twenty seven thousand and five hundred only.
Thanks in advance.Following is the sort of code but in language other than Java. I dont even know which language it is. Can somebody please translate it in a Java method like
public String toWords(double value){
return.............
************ Code Start **********
'This code was originally written by Joe Foster.
'It is not to be altered or distributed,
'except as part of an application.
'You are free to use it in any application,
'provided the copyright notice is left unchanged.
'Code Courtesy of
'Joe Foster
' Convert a currency value into an (American) English string
Function English (ByVal N As Currency) As String
Const Thousand = 1000@
Const Million = Thousand * Thousand
Const Billion = Thousand * Million
Const Trillion = Thousand * Billion
If (N = 0@) Then English = "zero": Exit Function
Dim Buf As String: If (N < 0@) Then Buf = "negative " Else Buf = ""
Dim Frac As Currency: Frac = Abs(N - Fix(N))
If (N < 0@ Or Frac <> 0@) Then N = Abs(Fix(N))
Dim AtLeastOne As Integer: AtLeastOne = N >= 1
If (N >= Trillion) Then
Debug.Print N
Buf = Buf & EnglishDigitGroup(Int(N / Trillion)) & " trillion"
N = N - Int(N / Trillion) * Trillion ' Mod overflows
If (N >= 1@) Then Buf = Buf & " "
End If
If (N >= Billion) Then
Debug.Print N
Buf = Buf & EnglishDigitGroup(Int(N / Billion)) & " billion"
N = N - Int(N / Billion) * Billion ' Mod still overflows
If (N >= 1@) Then Buf = Buf & " "
End If
If (N >= Million) Then
Debug.Print N
Buf = Buf & EnglishDigitGroup(N \ Million) & " million"
N = N Mod Million
If (N >= 1@) Then Buf = Buf & " "
End If
If (N >= Thousand) Then
Debug.Print N
Buf = Buf & EnglishDigitGroup(N \ Thousand) & " thousand"
N = N Mod Thousand
If (N >= 1@) Then Buf = Buf & " "
End If
If (N >= 1@) Then
Debug.Print N
Buf = Buf & EnglishDigitGroup(N)
End If
If (Frac = 0@) Then
Buf = Buf & " exactly"
ElseIf (Int(Frac * 100@) = Frac * 100@) Then
If AtLeastOne Then Buf = Buf & " and "
Buf = Buf & Format$(Frac * 100@, "00") & "/100"
Else
If AtLeastOne Then Buf = Buf & " and "
Buf = Buf & Format$(Frac * 10000@, "0000") & "/10000"
End If
English = Buf
End Function
' Support function to be used only by English()
Private Function EnglishDigitGroup (ByVal N As Integer) As String
Const Hundred = " hundred"
Const One = "one"
Const Two = "two"
Const Three = "three"
Const Four = "four"
Const Five = "five"
Const Six = "six"
Const Seven = "seven"
Const Eight = "eight"
Const Nine = "nine"
Dim Buf As String: Buf = ""
Dim Flag As Integer: Flag = False
'Do hundreds
Select Case (N \ 100)
Case 0: Buf = "": Flag = False
Case 1: Buf = One & Hundred: Flag = True
Case 2: Buf = Two & Hundred: Flag = True
Case 3: Buf = Three & Hundred: Flag = True
Case 4: Buf = Four & Hundred: Flag = True
Case 5: Buf = Five & Hundred: Flag = True
Case 6: Buf = Six & Hundred: Flag = True
Case 7: Buf = Seven & Hundred: Flag = True
Case 8: Buf = Eight & Hundred: Flag = True
Case 9: Buf = Nine & Hundred: Flag = True
End Select
If (Flag <> False) Then N = N Mod 100
If (N > 0) Then
If (Flag <> False) Then Buf = Buf & " "
Else
EnglishDigitGroup = Buf
Exit Function
End If
'Do tens (except teens)
Select Case (N \ 10)
Case 0, 1: Flag = False
Case 2: Buf = Buf & "twenty": Flag = True
Case 3: Buf = Buf & "thirty": Flag = True
Case 4: Buf = Buf & "forty": Flag = True
Case 5: Buf = Buf & "fifty": Flag = True
Case 6: Buf = Buf & "sixty": Flag = True
Case 7: Buf = Buf & "seventy": Flag = True
Case 8: Buf = Buf & "eighty": Flag = True
Case 9: Buf = Buf & "ninety": Flag = True
End Select
If (Flag <> False) Then N = N Mod 10
If (N > 0) Then
If (Flag <> False) Then Buf = Buf & "-"
Else
EnglishDigitGroup = Buf
Exit Function
End If
'Do ones and teens
Select Case (N)
Case 0: ' do nothing
Case 1: Buf = Buf & One
Case 2: Buf = Buf & Two
Case 3: Buf = Buf & Three
Case 4: Buf = Buf & Four
Case 5: Buf = Buf & Five
Case 6: Buf = Buf & Six
Case 7: Buf = Buf & Seven
Case 8: Buf = Buf & Eight
Case 9: Buf = Buf & Nine
Case 10: Buf = Buf & "ten"
Case 11: Buf = Buf & "eleven"
Case 12: Buf = Buf & "twelve"
Case 13: Buf = Buf & "thirteen"
Case 14: Buf = Buf & "fourteen"
Case 15: Buf = Buf & "fifteen"
Case 16: Buf = Buf & "sixteen"
Case 17: Buf = Buf & "seventeen"
Case 18: Buf = Buf & "eighteen"
Case 19: Buf = Buf & "nineteen"
End Select
EnglishDigitGroup = Buf
End Function
'************ Code End ********** -
How to print last page in sap script in ladscape format?
Hi all,
can any 1 tell me How to print last page in sap script in ladscape format?
Thanks In advance.
PravinHi Pravin Sherkar,
we can do this in SAP Scripts.
we need to create two pages, one of landscape and another of potrait.
now after filling the data at last we need to call the page which is of format landscape using START_FORM function module.
You can use condition &PAGE& = &FORMPAGES&.
Please check this link
Printing Portrait/Landscape in sapscript
Re: Landscape and potrait in same layout?
http://www.sap-img.com/ts013.htm
Best regards,
raam -
How to print Special Characters in Sap-Scripts
How to print Special Characters in Sap-Scripts
Thanks,
RaviHi
if u want print special characters we can use hot codes i.e ' ' (single inverted commas). in between these hot codes insert u r special characters.
write ' !@#$%^&*( ) '.
for the above write statement output is
output is !@#$%^&*( ) -
Unable to print from MS Word: "The Directory Service is currently unavailable"
Hi! I hope you can help me. Please note that I have a Windows XP computer (Home Edition, Version 2002, Service Pack 3, 32-bit). When I initially installed a Brother printer (model# MFC-J475DW) in Dec 2013, I had no problems printing documents. My problems
started about 2 days ago. I got an error message after I opened a MS Word document (.doc) and clicked the Print button to print a document. The Printer "Name" field was empty. I clicked the dropdown box in that window and saw 3 options:
1 - Brother MFC-J475DW Printer
2 - Brother PC-FAX v.3.2
3 - PaperPort Image Printer
When I selected "Brother MFC-J475DW Printer," a Microsoft Word dialog box appeared, saying the following:
"The printer has not yet responded, but the Microsoft Office program may be able to proceed without printer information. Do you want to continue to wait for the printer?"
I can either click on a Yes button or a No button. Either way, I'm brought back to the Print page. When I click on the OK button to start printing, another error message appears:
"Windows cannot print due to a problem with the current printer setup. Try one or more of the following:
*Check the printer by printing a test page from Windows.
*Make sure the printer is turned on and online.
*Reinstall the printer driver."
I have a choice to click either OK or Web Help. I click the OK button to close the box, then return to the Print page. When I click on the "Find Printer..." button, the Find Printers window appears for a moment, then is replaced by this error message:
"The Directory Service is currently unavailable"
On Friday (Mar 21), when the error first occurred, I was able to print a letter in MS Word after un- and re-installing the Brother printer and its drivers. The problem reappeared the next day (Saturday). I don't want to do that every time to print a single
page, so would you please recommend a solution?
By the way, I am able to print a test page from the printer in Control Panel, and I can print from a Notepad document. Also, when I go to the Control Panel, select "Printers and Faxes," then right-click on the printer (Brother MFC-J475DW Printer),
then select the Ports page, there's a check mark next to USB001 (not LPT1 or COM1). When I click on the "Configure Port..." button, I get this error message:
"An error occurred during port configuration. This operation is not supported."
Earlier today, I got a reply from brother.com's tech support (thanks to the 1 year warranty). They said the problem is on my PC, not their printer. However, they provided links to completely uninstall the printer, then reinstall it. I did just that, but
the problem persists. I'll download OpenOffice.org's Office Suite to see if I can print documents with their software instead of MS Word. Until then, I await any suggestions.
I hope this info is helpful. Thanks in advance for your help.I downloaded OpenOffice and am able to print documents (in particular, the same document I created in MS Word). I guess MS Word is to blame. I believe the issue is concluded, but I'd welcome any comments about the Active Directory, as I might have a problem
with OpenOffice in the future regarding that. -
Hello friends,
How can we print numbers in words like
800 as Eight Hundred.
TIA
shekar.See here for some more solutions in english, french and spanish
Converting a number into world In spanish Language -
While generating reports in Oracle BI Publisher in pdf format, the generated pdf reports have hindi इ matra displaced by one character. For example, रिपोर्ट is printed as रपेिोरट. Word file generated of the same report have correct hindi इ matra position and also pdf generated from this word file also contains the same.
-
How to print Vertical barcode in SAP script
I want to print barcode related items in SAP script . can you plz tell me any one
1.How to print vertical barcode in SAP script ?
2.How to print vertical text in SAP script ?1.
Create the character format in se71, in that select standard barcode. like
Char.format: C1 Description: Barcode
Barcode: BC_CD39 save the character format.
you can select from the list.
in the form coding, can you use barcode like
<C1> program variablr <>.
<C1> &itab-matnr <>. "--->like this
Then it shows the barcode in output.
check this.
2. for vertical text ..
if this is a window text then its possible but
like
S
H
I
P
T
O
This is possible in giving the window name but in the layout i never tried this.
If u can tell the scenario(with data reference) then may be i can try but not sure that this will give me hit.
regards,
vijay. -
HP Officejet Pro 8500 - won't print bold italicized words
Why won't my printer print out the words that are in bold italics on a pdf? It prints the non-italicized words in bold.
Hi,
Can you confirm that you have an Officejet 8500a or Officejet 8500? On the 8500a model, you can set the networks proxy address and port setting from the front panel of the printer (setup>Webservices setup>proxy). If you are unsure what your proxy settings are you'll need to contact your network admin. If your network uses a proxy users name and password for all devices, you need to enter this information along with the proxy address and port in the printers embedded web server. Type the products IP address into an internet brownser window (printer must be connected to the same network as PC). Select the network tab, and than look for the proxy settings option. Enter in the information and click apply. Once the networks proxy information has been correctly inputed into the embedded web server, try printing again. If unsuccessfully, you might try reinstalling the printer software after uninstalling it. Hope this helps!
I was an HP employee
Reminder: Please select the "Accept as Solution" button on the post that best answers your question. Also, you may select the "Kudos" button on any helpful post to give that person a quick thanks. -
Printing Numbers In Words In Purchase Order
Dear Friends,
I want to display the total Purchase Order value in words eg- 300.00 as Three Hundred Only, Plz tell me how to do this. Also please tell me from where I will get the Terms & conditions field for PO, I have searched EKKO & EKPO but there is only Terms Key not the Terms & conditions.
Bye,
NishantYou can use the function module
report zrich_0002 .
tables spell.
data : t_spell like spell occurs 0 with header line.
data : pamount like spell-number value '1234510'.
sy-title = 'SPELLING NUMBER'.
perform spell_amount using pamount 'USD'.
write: 'NUMBERS', t_spell-word, 'DECIMALS ', t_spell-decword.
* FORM SPELL_AMOUNT *
form spell_amount using pwrbtr pwaers.
call function 'SPELL_AMOUNT'
exporting
amount = pamount
currency = pwaers
filler = space
language = 'E'
importing
in_words = t_spell
exceptions
not_found = 1
too_large = 2
others = 3.
endform. " SPELL_AMOUNT
please reward points for helpful answers and mark post as solved if your problem is solved. Thanks
Regards,
RIch Heilman
Maybe you are looking for
-
Will leopard work with the current 2.16ghz mac book with 2gb ram?
hey just a quick question new to the whole mac thing and was just wanting to know will i be able to upgrade to leopard on my white mac book 2.16ghz with 2gb of ram and 120 gb harddrive? will it run smoothly? thanks simon
-
Can part of a Result be configured as a hypertext link? For example, could a click on a column of a table go to cnn.com? As far as I can tell, the closest general support for this navigates from a Result to a Dashboard, which contains a hypertext lin
-
Spell Checking not automatic when typing!
Running my new IMAC - Snow Leopard ---using Pages 9 to create a new document--*spell checking while typing* in English does not work at all (i.e. does not catch obvious errors). Inspector more option set to English for the document. So what gives? He
-
Making changes to content in appraisal header
Hello all, I have a 360 appraisal document which I need to make some cosmetic changes to.I'd like to disable some of the fields in 'hap_document/document_header_part_appraiser_advanced.htm'. Is there a badi I could use or would I have to copy the ent
-
Won't automatically sleep with energy saver
Brand-new iMac will not automatically sleep, but will sleep on demand. Display sleeps, but hard drive stays on. I'm not completely computer-savvy, but I've searched through other threads regarding this issue and tried the following: - deleted com.app