on 06-26-2008 1:01 AM
I am creating my own check template in SAPscript instead of a smartform simply because I did not want/find a driver program for a smartform. I am a little confused on how to perform ABAP function calls in SAPscript and need some help. I figure this ABAP code will do the job:
DATA: wa_amt TYPE SPELL.
*--
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = 100
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = it_amt
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3.
*
o
+
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE 'A' NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*--
write wa_amt-WORD.
*--
But I think this code is meant for a smartform->program lines. I want to convert the variable "REGUD-SNETT" from a number to a string of words.
On a side note, how to do I set a break-point in my SAPscript so it enters debug mode after I post the check document in transaction code f-58?
------------------ Amount in words -------------------------------------
/ &'*** 'SPELL-WORD& ®UD-WAERS&&' and 'SPELL-DECIMAL(2)'/100 '&***
/* Example for amount and decimal places in words
/* &'*** 'SPELL-WORD& ®UD-WAERS&&' and 'SPELL-DECWORD' Cents'& ***
/* Example for numbers in words
/* &SPELL-DIG06(6)&&SPELL-DIG05(6)&&SPELL-DIG04(6)&&SPELL-DIG03(6)&&SPELL-D
If you want to see the details Open F110_PRENUM_CHCK Script and check the window code for Amount in words (Description of window)
If it is useful, please reward me with points.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In program ,put a break -point at required location, or goto se71-> Utilities menu-> Activate Debugger.
Go execute tcode f-58 automatically, debugger will activate for the script.
press F5-> Character by character it will print ( exceutue)
F6-> Line by line
F8-> text element by text element
Reward if useful.
Bye
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mark,
You just have to create a subroutine in your script and pass the value REGUD-SNETT to the subroutine.Il give u a sample code, u modify it as desired. Write this in your script
/: Perform ZABC in program 'ZPPP'
/: USING ®UD-SNETT &
/: Changing &TEXT1&
/: Endperform
In the subroutine you first read this value using the read statement and use Speel_Amount to convert the amt in words and send it back to ur script.
Let me know how it goes.
Nayan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hI,
DATA: hlp_filler TYPE c VALUE '*', "filler in spell_amount
spell type spell.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
language = 'E'
currency = reguh-waers
amount = regud-swnes
filler = hlp_filler
IMPORTING
in_words = spell
EXCEPTIONS
OTHERS = 1.
In your code:
DATA: wa_amt TYPE SPELL.
*--
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = 100
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = wa_amt
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3.
Regards,
Subramanian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Subramanian,
I used the code you supplied me but nothing is being printed to the screen. I'm not sure if I'm doing it correctly, but I have basically inserted verbatum line-by-line of what you have in a window with "/:" for the tag category. Not sure if this line is wrong and missing a double quote though:
DATA: hlp_filler TYPE c VALUE '*', "filler in spell_amount
spell type spell.
Can you elaborate more if this excerpt is suppose to go in the ABAP driver vs. the SAPscript window? I am trying to print the variable by calling "&in_words-words&", is this right/wrong?
Nayan,
I have also tried your solution but I am not very familiar with the read and write statements in ABAP. I am assuming that I have to define "TEXT1" first before I can use it? Also, where can I look at the source code for program ZPPP? It's not in se37 or se38.
debugging the scrpit
before u run the transaction
pl execute se38 program name RSTXDBUG and then execute ur transaction
Regards
Devanand
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.