SAP Script(calling FM to spell the amount in words)
Hi Friends,
I am getting error in calling a function module(HR_IN_CHG_INR_WRDS : To spell the amount in words) to a script form.It is giving a dump message : "Conversion type error".
Could you guide me with small example ?
I will reward for usefull responses.
Pls. treat it as urgent.
Thx in Adv.
Bobby
Hi
execute this code .
REPORT ZCOVERTION.
TABLES SPELL.
DATA : T_SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.
DATA : PAMOUNT LIKE SPELL-NUMBER VALUE '23.45'.
SY-TITLE = 'SPELLING NUMBER'.
PERFORM SPELL_AMOUNT USING PAMOUNT 'USD'.
WRITE: 'NUMBERS', T_SPELL-WORD ,'and', T_SPELL-DECWORD.
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
Hope this will solve ur problem
Thanks
sreelakshmi
Similar Messages
-
Converting the amount into words in different languages
Hi All,
Is there any FM to convert the amount into words in a specific language.
SPELL_AMOUNT FM is not working for some of the languages like portuguese, etc..
Any idea on this.
Thanks in Advance.Hi,
Use the FM:
CALL FUNCTION <b>'Y_AMOUNT_IN_WORDS'</b>
Hope it helps.
Reward if helpful.
Regards,
Sipra -
I just updated pages, I can't count the amount of words with space anymore. Can anybody help me?
Yes me too, tried re setting and enabling changes but no agree button anywhere?
-
Converting the amount in words
Hi ,
Issues is like if the amount is $137,510.82 for US currency it should give as ONE HUNDRED THIRTY-SEVEN THOUSAND FIVE HUNDRED TEN USD and 82/100.
But when the document currency is german in the check it should give as ONE HUNDRED THIRTY THOPUSAND AND 51082/100.
THE LOGIC SHOULD BE CURRENCY DEPENDENT.
HOW DO I DI THIS...following is a customized report to convert amount to words...
*& Report ZCFM_REPT_RUPEE_CONVERSION *
*This report is a copy of report 'ZRUPECO1' in Tengl server *
Date : 25-Oct-2006 *
Author : Amiya Shrivastava *
Title : Report to convert amount into words as per*
Indian spelling conventions *
Original Request number : DEVK917286 *
report zcfm_rept_rupee_conversion .
include zcfm_incl_rupee_conv_data.
*& Form COVERSION1
text
-->NUMBER text
-->ANS text
form coversion1 using number changing ans.
clear: gtab,
giritab,
giriline,
girijtab,
line ,
ans,
init, initnam, initno , init1,
cnam1, cnam2, cnam3,cnam4, point,jpoint,
kpoint,lpoint1, lpoint2,lpoint,fpoint,
cnt1 , cnt2, cnt3 ,
flhun, flth, flla, flcr1,flcr2, flchu1, flchu2, flpt, res.
refresh :
itab ,
ktab ,
jtab .
init = number.
init1 = init.
cnt1 = strlen( init ).
cnt2 = cnt1 - 1.
do cnt1 times.
initnam = init+0(1).
shift init by 1 places left.
if initnam = '.'.
cnam1 = init1+0(initno).
endif.
initno = initno + 1.
enddo.
do cnt1 times.
cnam2 = init1+0(1).
shift init1 by 1 places left.
if cnam2 = '.'.
point = init1+0(2).
exit.
endif.
enddo.
do 2 times.
jpoint = point+0(1).
shift point by 1 places left.
if sy-index = 1.
kpoint = point.
endif.
perform points.
enddo.
cnt1 = strlen( cnam1 ).
do cnt1 times.
cnam2 = cnam1+0(1).
perform calcu .
shift cnam1 by 1 places left.
enddo.
sort itab descending by index.
loop at itab.
if sy-tabix = 1.
jtab-result = itab-result.
jtab-index = itab-index.
append jtab.
else.
if itab-result = 'One ' and ( sy-tabix = 2 or sy-tabix = 5 or
sy-tabix = 7 or sy-tabix = 9 ).
perform teens.
move space to line-result.
modify jtab from line index cnt3 transporting result .
else.
if itab-result <> space.
perform ties.
else.
jtab-result = itab-result.
jtab-index = itab-index.
append jtab.
endif.
endif.
endif.
cnt3 = sy-tabix.
res = itab-result.
endloop.
skip.
loop at jtab.
case sy-tabix.
when 10.
if jtab-result <> space.
if flcr1 = 'X' and flcr2 = 'X'.
concatenate jtab-result 'Hundred Crores' into line-result
separated by ' '.
modify jtab from line index sy-tabix transporting result.
else.
concatenate jtab-result 'Hundred AND' into line-result
separated by ' '.
modify jtab from line index sy-tabix transporting result.
endif.
endif.
when 9.
if flcr1 = 'X'.
if jtab-result <> space.
concatenate jtab-result 'Crores' into line-result
separated by ' '.
modify jtab from line index sy-tabix transporting result.
else.
flcr2 = 'X'.
endif.
endif.
when 8.
if jtab-result <> space.
concatenate jtab-result 'Crores' into line-result
separated by ' '.
modify jtab from line index sy-tabix transporting result.
else.
flcr1 = 'X'.
endif.
when 7.
if flla = 'X'.
if jtab-result <> space.
concatenate jtab-result 'Lacs' into line-result
separated by ' '.
modify jtab from line index sy-tabix transporting result.
endif.
endif.
when 6.
if jtab-result <> space.
concatenate jtab-result 'Lacs' into line-result
separated by ' '.
modify jtab from line index sy-tabix transporting result.
else.
flla = 'X'.
endif.
when 5.
if jtab-result <> space.
if flth = 'X'.
concatenate jtab-result 'Thousand' into line-result
separated by ' '.
modify jtab from line index sy-tabix transporting result.
endif.
endif.
when 4.
if jtab-result <> space.
concatenate jtab-result 'Thousand' into line-result
separated by ' '.
modify jtab from line index sy-tabix transporting result.
else.
flth = 'X'.
endif.
when 3.
if jtab-result <> space.
if flchu1 = 'X' and flchu2 = 'X'.
concatenate jtab-result 'Hundred' into line-result
separated by ' '.
else.
concatenate jtab-result 'Hundred AND' into line-result
separated by ' '.
endif.
modify jtab from line index sy-tabix transporting result.
else.
flhun = 'X'.
endif.
when 2.
if jtab-result = space.
flchu2 = 'X'.
endif.
when 1.
if jtab-result = space.
flchu1 = 'X'.
endif.
endcase.
endloop.
*SORT JTAB ASCENDING BY INDEX.
loop at jtab.
if sy-tabix = 1.
cnam4 = jtab-result.
else.
concatenate jtab-result cnam4 into cnam4 separated by space.
endif.
endloop.
if lpoint2 = space and lpoint1 = space.
lpoint = 'only'.
else.
concatenate 'Paise' lpoint2 lpoint1 'only' into lpoint separated by
space.
endif.
if cnam4 <> space.
shift cnam4 left deleting leading space.
concatenate 'Rupees' cnam4 lpoint into ans separated by space.
*WRITE : / 'RUPEES', CNAM4.
*WRITE : / ANS.
endif.
endform. "COVERSION1
*WRITE : / LPOINT NO-GAP.
form ties.
jtab-index = itab-index.
if sy-tabix = 2 or sy-tabix = 5 or sy-tabix = 7 or sy-tabix = 9.
case itab-result.
when 'Two '.
jtab-result = 'Twenty'.
when 'Three'.
jtab-result = 'Thirty'.
when 'Four '.
jtab-result = 'Fourty'.
when 'Five '.
jtab-result = 'Fifty'.
when 'Six '.
jtab-result = 'Sixty'.
when 'Seven'.
jtab-result = 'Seventy'.
when 'Eight'.
jtab-result = 'Eighty'.
when 'Nine '.
jtab-result = 'Ninety'.
when space.
jtab-result = space.
endcase.
else.
jtab-result = itab-result.
endif.
append jtab.
endform. "TIES
*& Form TEENS
text
form teens.
jtab-index = itab-index.
case res.
when 'One '.
jtab-result = 'Eleven'.
when 'Two '.
jtab-result = 'Twelve'.
when 'Three'.
jtab-result = 'Thirteen'.
when 'Four '.
jtab-result = 'Fourteen'.
when 'Five '.
jtab-result = 'Fifteen'.
when 'Six '.
jtab-result = 'Sixteen'.
when 'Seven'.
jtab-result = 'Seventeen'.
when 'Eight'.
jtab-result = 'Eighteen'.
when 'Nine '.
jtab-result = 'Nineteen'.
when space.
jtab-result = 'Ten'.
endcase.
append jtab.
endform. "TEENS
*& Form CALCU
text
form calcu .
itab-index = sy-index.
case cnam2.
when '1'.
itab-result = 'One'.
when '2'.
itab-result = 'Two'.
when '3'.
itab-result = 'Three'.
when '4'.
itab-result = 'Four'.
when '5'.
itab-result = 'Five'.
when '6'.
itab-result = 'Six'.
when '7'.
itab-result = 'Seven'.
when '8'.
itab-result = 'Eight'.
when '9'.
itab-result = 'Nine'.
when '0'.
itab-result = space.
endcase.
append itab.
endform. "CALCU
*& Form POINTS
text
form points.
if sy-index = 2.
if fpoint = space.
case jpoint.
when '1'.
lpoint1 = 'One'.
when '2'.
lpoint1 = 'Two'.
when '3'.
lpoint1 = 'Three'.
when '4'.
lpoint1 = 'Four'.
when '5'.
lpoint1 = 'Five'.
when '6'.
lpoint1 = 'Six'.
when '7'.
lpoint1 = 'Seven'.
when '8'.
lpoint1 = 'Eight'.
when '9'.
lpoint1 = 'Nine'.
when '0'.
lpoint1 = space.
endcase.
endif.
endif.
if sy-index = 1.
case jpoint.
when '1'.
perform lpointy.
when '2'.
lpoint2 = 'Twenty'.
when '3'.
lpoint2 = 'Thirty'.
when '4'.
lpoint2 = 'Forty'.
when '5'.
lpoint2 = 'Fifty'.
when '6'.
lpoint2 = 'Sixty'.
when '7'.
lpoint2 = 'Seventy'.
when '8'.
lpoint2 = 'Eighty'.
when '9'.
lpoint2 = 'Ninety'.
when '0'.
lpoint2 = space.
endcase.
endif.
endform. "POINTS
*& Form LPOINTY
text
form lpointy.
case kpoint.
when '1'.
lpoint2 = 'Eleven'.
when '2'.
lpoint2 = 'Twelve'.
when '3'.
lpoint2 = 'Thirteen'.
when '4'.
lpoint2 = 'Fourteen'.
when '5'.
lpoint2 = 'Fifteen'.
when '6'.
lpoint2 = 'Sixteen'.
when '7'.
lpoint2 = 'Seventeen'.
when '8'.
lpoint2 = 'Eighteen'.
when '9'.
lpoint2 = 'Nineteen'.
when '0'.
lpoint2 = 'Ten'.
endcase.
lpoint1 = space.
fpoint = 'X'.
endform. "LPOINTY -
SAP Script - calling SAP layout set from ABAP/4
Hi,
Help me in calling SAP layout set from ABAP/4
ThanksAshish,
create a driver program
create a script
A script is called using the function modules open_form,write_form,close_form.
Check this dummy program.
REPORT ZF3 .
tables makt.
data:begin of imakt occurs 0,
matnr like makt-matnr,
spras like makt-spras,
maktx like makt-maktx,
end of imakt.
DATA : ITEXT LIKE TLINE OCCURS 0 WITH HEADER LINE.
DATA : TEXTNAME LIKE STXH-TDNAME.
select matnr spras maktx from makt into table imakt up to 100 rows where
spras = sy-langu.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
APPLICATION = 'TX'
ARCHIVE_INDEX =
ARCHIVE_PARAMS =
DEVICE = 'PRINTER'
DIALOG = 'X'
FORM = 'ZF3'
LANGUAGE = SY-LANGU
OPTIONS =
MAIL_SENDER =
MAIL_RECIPIENT =
MAIL_APPL_OBJECT =
RAW_DATA_INTERFACE = '*'
SPONUMIV =
IMPORTING
LANGUAGE =
NEW_ARCHIVE_PARAMS =
RESULT =
EXCEPTIONS
CANCELED = 1
DEVICE = 2
FORM = 3
OPTIONS = 4
UNCLOSED = 5
MAIL_OPTIONS = 6
ARCHIVE_ERROR = 7
INVALID_FAX_NUMBER = 8
MORE_PARAMS_NEEDED_IN_BATCH = 9
SPOOL_ERROR = 10
CODEPAGE = 11
OTHERS = 12
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT IMAKT.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'MAIN'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
IMPORTING
PENDING_LINES =
EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
TYPE = 3
UNOPENED = 4
UNSTARTED = 5
WINDOW = 6
BAD_PAGEFORMAT_FOR_PRINT = 7
SPOOL_ERROR = 8
CODEPAGE = 9
OTHERS = 10
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDLOOP.
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT =
RDI_RESULT =
TABLES
OTFDATA =
EXCEPTIONS
UNOPENED = 1
BAD_PAGEFORMAT_FOR_PRINT = 2
SEND_ERROR = 3
SPOOL_ERROR = 4
CODEPAGE = 5
OTHERS = 6
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
K.Kiran. -
Adress bar search uses a different engine depending on the amount of words entered
I've been trying to figure this one out for a bit... If I enter one word into the adress bar - gamespot for instance - it takes me to a bing.com search. As opposed to the gamespot.com site as it has always done up until a few hours ago. Now, at first I figured this was just a matter of firefox changing the default, so looked for a solution to this. The given solution in most cases is to change to change keyword.url - which I have done. It is set to the google url that according to most of the sites I checked is supposed to work. However, typing 'gamespot' still gives me a bing search (not a google search or the site in question).
But here's the kicker; if I type 'game spot' it takes me to the gamespot.com website. So I tried something else. 'facebook' vs. 'face book' - same thing. 'fastcars' - bing search, 'fast cars' - google search. 'firefox' - bing.com search, 'fire fox' - mozilla homepage... I take it you see what I mean by now...
I have no idea what is going on here. Seems a bit of an odd effect for any kind of malware - allthough I'm running a full scan as I type, just in case...
== This happened ==
Every time Firefox opened
== no idea what triggered it. Just happened all of a sudden this evening. After using the comp all day without it acting like this - and no new installs that I know of.Hi,
>>A CHAR datatype and VARCHAR2 datatype are stored identically (eg: the word 'WORD' stored in a CHAR(4) and a varchar2(4) consume exactly the same amount of space on disk, both have leading byte counts).
Ok, but on the other hands:
SGMS@ORACLE10> create table x (name char(10), name2 varchar2(10));
Table created.
SGMS@ORACLE10> insert into x values ('hello','hello');
1 row created.
SGMS@ORACLE10> commit;
Commit complete.
SGMS@ORACLE10> select vsize(name),vsize(name2) from x;
VSIZE(NAME) VSIZE(NAME2)
10 5
SGMS@ORACLE10> select dump(name),dump(name2) from x;
DUMP(NAME) DUMP(NAME2)
Typ=96 Len=10: 104,101,108,108,111,32,32,32,32,32 Typ=1 Len=5: 104,101,108,108,111Cheers -
How do I Hide the text printed from a standard Text Element in SAP Script?
Hi,
I have created one SAP Script which gets printed from IW33 using a standard print program.
In config the standrad SAP script is replaced by the zsap script.
Since the Zscript is printed from a Standard print program, I had to keep all the text elements used by the original(standard) SAP script.
I only kept the text elemets and commented out the printing part.
But still some values are printing. How do I hide these text element values?
I want to delete whatever its printing from these text element. Icant delete the standard text elemetns , otherwise the standard print program will give error.Hi,
I am not printing any text under these text element in my zscript.
I had to include these standard text elemets as they are called from the standard print program using which my zscript is getting printed.
for example:
/E OPERATION
Under operation i didnot print anything. Still some values which are passed in text element Operation by the print program is being printed in the form. i want to hide/delete these values.
how do I do that? -
How to pass tables data from SAP script to the routine.
Hi,
I have standard program RPCTEAL0_01 which calls a SAP script form(Custom) to print the form.
Now I have to add some additional functionality to change the values in the form. Since it is custom form I can add ROUTINE and then pass the values to the custom program to modify the variables.
My concern here, I would like to pass the tables like RT,CRT to the custom program via form.
Is this possible? RT and CRT filled by standard progam.
Regarsd
Eswar
<MOVED BY MODERATOR TO THE CORRECT FORUM>
Edited by: Alvaro Tejada Galindo on Jan 20, 2009 9:06 AMHi, The suggested option is not working.
Actually I am using the below code in SCRIPT
/: PERFORM CAL_2008 IN PROGRAM ZHR_TEST1
/: USING &PER_NO&
/: CHANGING &W12&
/: ENDPERFORM
and calling form in ZHR_TEST1. But this will pass only variables. Now my requirement is to pass tables also. -
SAP Script ~ Put Amount in words & amounts
HI guys: Please help me... I have a requirement where the client wants to put the amount in words on a check sap script as follows:
If the amount is 27,150.95 USD
they want "27,150 DOLLARS AND 95 CENTS"
this is a combination of amounts and words in the "amounts in words" window of the sap script
please help
thanks
BrianHi,
In the window where the amount is displayed in words,
add the following code:
Script:
Say you have the amt in &amt&
/: DEFINE &DOLLARS& = SPACE
/: DEFINE &CENTS& = SPACE
/: PERFORM split_amount USING &AMT(T)&
/: CHANGING &DOLLARS&
/: CHANGING &CENTS&
P &DOLLARS& Dollars &CENTS& Cents Only
( P can be any paragraph format you want to use.
(T) in the AMT while passing will get your amount rid of thousand seperators)
Code should be put as follows in the Routine program:
DATA: amt(10) TYPE C, (Length specified should correspond to the total length of the amount field including the decimal)
p_dollar(7) TYPE c,
p_cents(2) TYPE c.
FORM split_amount USING in_tab STRUCTURE itcsy
CHANGING out_tab1 STRUCTURE itcsy
CHANGING out_tab2 STRUCTURE itcsy.
READ TABLE in_tab INDEX 1.
MOVE in_tab-value TO amt.
CHECK sy-subrc EQ 0.
SPLIT amt AT '.' INTO p_dollar p_cents.
IF sy-subrc NE 0.
SPLIT amt AT ',' INTO p_dollar p_cents.
ENDIF. (We have two SPLIT cos we may either have dot OR comma for decimal notation. This will cover both the cases)
READ TABLE out_tab1 INDEX 1.
CHECK sy-subrc EQ 0.
MOVE p_dollars INTO out_tab1-value.
MODIFY out_tab INDEX sy-tabix.
READ TABLE out_tab2 INDEX 1.
CHECK sy-subrc EQ 0.
MOVE p_cents INTO out_tab1-value.
MODIFY out_tab INDEX sy-tabix.
Plz let me know if you have questions.
Thanks
Geetha -
Problem in using the sap script from 1 client to another
Hi,
I am working on a sap script which is developed in the 555 cliet(Quality) but now the error comes change to repository or cross client is not allowed.
In order to change the script which i am working on i tried to copy that script in 333 client and created with the orignal script. I tried to copy the modified script (developed in 555) but it is copying that script.
Plzz proivde me guideliness how to solve this problem.>
ricx .s wrote:
> Hi,
>
> I am working on a sap script which is developed in the 555 cliet(Quality) but now the error comes change to repository or cross client is not allowed.
>
> In order to change the script which i am working on i tried to copy that script in 333 client and created with the orignal script. I tried to copy the modified script (developed in 555) but it is copying that script.
>
> Plzz proivde me guideliness how to solve this problem.
Hi there,
Are clients 555 and 333 both on DEV Server? If so you may use transaction SCC1 to copy the form from one client to another. Just run SCC1 on the client where the sapscript form will be copied, indicate the source client, and search for the transport request number that contains your form.
Also, where did you develop your form?
Let me know.
Regards. -
ABAP Subroutines in SAP Script forms
Hi Friends,
Can any give an example on using ABAP Subroutines in SAP Scripts
how to call ABAP subroutine IN FORM and how to define form statement in abap program
thanks in advance
Points for sure
Regards
VijayaHi,
you have to write
perform formname in program zprogram
using &var1&
using &var2&
changing &var3&
endperform
in se38 create program zprogram of subroutine pool ttype
and
write the
form
endform there
egcode for a subroutne for changing the amount into indian words
PROGRAM ZFII_SR_PAYMNT_CHCK.
declaring the variables which are necessary
DATA:
G_AMOUNT TYPE PC207-BETRG, " having amount value
G_SPELL_AMOUNT(60) TYPE C, " LIKE SPELL-WORD, " amount in words
G_SPELL_AMOUNT1(60) TYPE C, " spell structure
G_WHTAX TYPE BSAK-QBSHB, "
G_QBSHB TYPE BSAK-QBSHB, " FOR COLLECTING THE WITH HOLDING TAX
G_ZUMSK TYPE BSAK-ZUMSK.
*DECLARING THE INTERNAL TABLES FOR THE OUTPUT TO BE DISPLAYED.
TYPES : BEGIN OF T_INPUT_TABLE.
INCLUDE STRUCTURE ITCSY.
TYPES : END OF T_INPUT_TABLE.
TYPES : BEGIN OF T_OUTPUT_TABLE.
INCLUDE STRUCTURE ITCSY.
TYPES: END OF T_OUTPUT_TABLE.
DATA: GWA_INPUT_TABLE TYPE T_INPUT_TABLE.
DATA: GWA_OUTPUT_TABLE TYPE T_OUTPUT_TABLE.
DATA: GIT_INPUT_TABLE TYPE STANDARD TABLE OF T_INPUT_TABLE.
DATA: GIT_OUTPUT_TABLE TYPE STANDARD TABLE OF T_OUTPUT_TABLE.
TYPES : BEGIN OF T_ITEM,
BUKRS TYPE BUKRS,
BELNR TYPE BELNR_D,
GJAHR TYPE GJAHR,
WT_WITHCD TYPE WT_WITHCD,
WT_QBSHB TYPE WT_WT1,
END OF T_ITEM,
IT_T_ITEM TYPE STANDARD TABLE OF T_ITEM.
DATA : GIT_ITEM TYPE IT_T_ITEM,
GWA_ITEM TYPE T_ITEM.
GET_SPELL_AMOUNT
FORM GET_SPELL_AMOUNT TABLES INPUT STRUCTURE ITCSY
OUTPUT STRUCTURE ITCSY. "#EC CALLED
CLEARING OFF THE VARIABLE USED IN PROGRAM.
CLEAR: G_AMOUNT,
G_SPELL_AMOUNT.
*clearing the internal tables which we have used.
CLEAR:
GIT_INPUT_TABLE,
GIT_OUTPUT_TABLE.
*REFRESHING THE INTERNAL TABLES.
REFRESH:
GIT_INPUT_TABLE,
GIT_OUTPUT_TABLE.
*initially assigning the memory vaules to our internal tables.
GIT_INPUT_TABLE[] = INPUT[].
GIT_OUTPUT_TABLE[] = OUTPUT[].
*reading the table input to get the amount value.
READ TABLE GIT_INPUT_TABLE INTO GWA_INPUT_TABLE INDEX 1.
IF GWA_INPUT_TABLE-VALUE CA 'X'.
REPLACE ALL OCCURRENCES OF 'X' IN GWA_INPUT_TABLE-VALUE WITH '0'.
ENDIF.
*THIS IS IMPORTANT PART AS IT IS CONVERTING THE
*CHARACTER FIELD INTO CURRENCY FIELD.
SHIFT GWA_INPUT_TABLE-VALUE LEFT DELETING LEADING SPACE.
TRANSLATE GWA_INPUT_TABLE-VALUE USING ', '.
CONDENSE GWA_INPUT_TABLE-VALUE NO-GAPS.
G_AMOUNT = GWA_INPUT_TABLE-VALUE.
*calling the function moudle which will
*covert amount into words (indian format ).
*i.e in crores, lakhs, thousands
DATA: L_SPELLAMOUNT(255) TYPE C,
L_ONLY(255) TYPE C.
CLEAR: L_SPELLAMOUNT, L_ONLY.
*here the amount should not be more than
99,99,99,999.99 . if it is greater than
*this amount this function module will not work
*so give the amount which is lessthan or equal to
*above said amount.
IF G_AMOUNT LT '1000000000'.
CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
AMT_IN_NUM = G_AMOUNT
IMPORTING
AMT_IN_WORDS = L_SPELLAMOUNT
EXCEPTIONS
DATA_TYPE_MISMATCH = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
CONDENSE L_SPELLAMOUNT.
TRANSLATE L_SPELLAMOUNT TO UPPER CASE.
CONCATENATE L_SPELLAMOUNT 'ONLY' INTO L_ONLY SEPARATED BY SPACE.
*moivng the field name into table field.
GWA_OUTPUT_TABLE-NAME = 'G_SPELL_AMOUNT'.
*assigning the amount in words to the variable.
*the reason behind splitting the word into two parts
*is--- in the scripts the whole string is not getting
*printed. So we are splitting it into two parts so that
*it will print the whole string.
G_SPELL_AMOUNT = L_ONLY+0(60).
G_SPELL_AMOUNT1 = L_ONLY+60(60).
G_SPELL_AMOUNT = L_SPELLAMOUNT.
*MOVING THE AMOUNT IN WORDS TO FINAL WORK AREA.
MOVE G_SPELL_AMOUNT TO GWA_OUTPUT_TABLE-VALUE.
*MODIFYING THE INTERNAL TABLE FORM THE WORK AREA.
MODIFY GIT_OUTPUT_TABLE FROM GWA_OUTPUT_TABLE INDEX 1.
*FOR THE SECOND RECORD I.E FOR THE NEXT 60characters
GWA_OUTPUT_TABLE-NAME = 'G_SPELL_AMOUNT1'.
MOVE G_SPELL_AMOUNT1 TO GWA_OUTPUT_TABLE-VALUE.
MODIFY GIT_OUTPUT_TABLE FROM GWA_OUTPUT_TABLE INDEX 2.
*assigning the total output table to the memory .
OUTPUT[] = GIT_OUTPUT_TABLE[].
ENDFORM. "GET_COMPADDR
thanks & regards,
Venkatesh -
Using Function Module in SAP Script
Dear Friends,
how can i use function modules in sap scripts?. i want to use call function SPELL_AMOUNT in sap script?
in text element using perform statement hw can i use?
Regarding i search related articles but, i am not getting any solution.
Plz help Me.
Regards,
K.S.KannanDear Kanan,
You can do it in two ways:
Way1
your Amount will be in some variable say VAR_AMT1 and want in words in field say VAR_SPELL.
In your report program you can use the function module SPELL_AMOUNT and pass the VAR_AMT1 to it and you will get the words in VAR_SPELL.
So now in your sap script you can use the variable VAR_SPELL to print the amount in words.
we normally use this above method.
WAY2
You are inside Sap script and you can write the following code in the sap Script window.
/: PERFORM AMT_TEXT IN PROGRAM ZF_REPORT USING &VAR_AMT1& CHANGING &VAR_SPELL&
/: ENDPERFORM
In the Tag Column when you press F4 you can see various symbols like
/: = ( / /= /( /: /* /E
. Select
In the program ZF_REPORT (any report) you should have the perform AMT_TEXT where you should use the function module SPELL_AMOUNT to convert the amount into words.
Hope its Clear. -
In SAP Scripts MAIN procesed first?
Hi Experts,
I hv a small doubts in SAP Scripts, they r,
1- In SAP Scripts the MAIN window is procesed very first all over the SAP Script?
2- To debug the script, after activating the debugger in Script, Shall I go & debug the Print prog step by step or just run the Transaction, e.g.
say ME23?
ThanQ.Hi Srinivas,
The order in which the windows are triggered is determined by the print program.
The print program will call the WRITE_FORM function modules which will trigger the windiw that is passed to it.
You can see the example print program:
RSTXEXP1
The fm WRITE_FORM is called multiple times, and different windows get triggered as and when the control comes to the Function module.
And regarding your second question, in general you cannot run the print programs as stand alone(most cases) as the would not have and executable code outside the form-endform .So, to test the script, you must run the transaction after your activate the script debugging.
Regards,
Ravi -
Regarding Adding multiple SAP Scripts in one Transaction
Hi All,
I have a requirement where i will have to develop one custom transaction which will have multiple SAP Script Forms to it.
The scenario is as below:
First i will have to create a Program with Selection-Screen with 10 Radio buttons in one Block - Here Each Radio Button indicated Diffrent FORM[SAP SCRIPT].
Down to it i will create another Block with some selection-screen fields. Like Order Type, Order No, Customer PO number, SOLD TO, BILL TO, SHIP TO etc.
And based on Radio button selected allowed order types will vary!
So after selecting one Form[Radio button] and enetring other selection fields once i press execute button.
i need to display list of Orders in ALV List output with check boxes for each record in the List Output.
Here all the radio button Forms are related to <b>Sales Order document and Delivery document</b>
So do we need to create new ALV List Report (or) We can use submit <b>VF31</b> transaction's program <b>[sd70av3a]</b>.
After we are displayed with orders in the output.
Then we should provide a functionality as such if user selects mutiple Orders/Check boxes he should be able to view multiple Orders one after other, and simultaneously generate PDF Files for Each Order Selected and attach them in Mail send them to Block of users.
Can anybody give there sujjestions.
Without generating spool request no's is it possible to generate PDF files for SAP SCript output!
Is it possible to Generate & attach one/multiple PDF files to mail ID and send them to list of users!
Can anybody give inputs.
Thanks in advance.
Thanks & Regards,
Prasad.hi prasad,
There is one concept called Print Work Bench(PWB) to print the multiple scripts or smartforms which r assigned to a same transaction.
If u need the info related to PWB shoot me a test mail to [email protected]
i will send u the same
fot the same u can check the below link also
http://help.sap.com/saphelp_nw04/helpdata/en/64/bf2f12ed1711d4b655006094192fe3/content.htm
<b>Prasad i didn't get the mail from you plz check it once again</b>
If u find it useful plz mark the points
Regards,
Naveen
Message was edited by: NAVEENKUMAR GUDURI -
How to calculate a value in sap script?
Hi friends i have to do addition and then display the added value in grandtotal like
total amount + late fee = grand total
i have to do this in sap script can anyone tell me the procedure where to declare wheather in abap aditor if yes how?Hi ...
Its easy to add up two values...
u can do it in a subpool program...
Refer the following code:
Code the following in the Script...
/: PERFORM TOTAL_SUM IN PROGRAM 'ZTEST_ADDITION'
/: USING &VAL1&
/: USING &VAL2&
/: CHANGING &TOTAL&
In the EDitor..create a program ' ZTEST_ADDITION'..
FORM TOTAL_SUM TABLES in_tab STRUCTURE itcsy
out_tab STRUCTURE itcsy.
Read in_tab index 1.
Here u will get the val1...
Read in_tab index 2.
here u will get val2.
l_v_total = val1 + val2.
read out_tab index 1.
out_tab-value = l_v_total.
modify out_tab index 1.
Write the changing paramets in the form
to Output the values...
Thanx,
navin..!
Maybe you are looking for
-
when I click on a link on a web page, and it is a pdf, I get taken to a list of my own hard drive, and am asked to select an application. I have to use safari to download anything! == This happened == Every time Firefox opened == a month a go
-
Assigning value to the dynamic item
Hi All, I am trying to achieve the following 1. Create a program unit that passes the block name and item name 2. Build :<BlockName>.<ItemName> and assign the value say 'Yes' / 'No' based on the condition. 3. I do not want to hard code the block name
-
How to view an app, while on a call?
Forgive me if this is already posted somewhere, but I could not find it. If you want to view an application, while on a call, how do you do it? Thanks...
-
Hi, I have a small database which I want to break into groups and sum characterestics of each group. But whatever I do, I get either 'Not a Group By Expression' or 'Invalid Parameter' error. Any way out ? If it is possible that my 10xe has been corru
-
Windows Installer Error after downloading Adobe Elments 9
I downloaded your Adobe Photoshop Elements 9 about ten days ago and immediately after downloading I received two Pop UP problems that I have been unable to resolve. One of the problems Is 1) I get a "Windows Installer" popup each time I start my