2014 Feb 06 11:30 AM
hi,
HOW TO SPLIT the amount text into two lines in ZF110_PRENUM_CHC
payel
hi,
HOW TO SPLIT the amount text into two lines in ZF110_PRENUM_CHC
payel
2014 Feb 06 11:32 AM
Hi Payel
Since you have the custom sap script check you decide at what level you want to split the amount text into two variables and then print it.. What is the issue you are facing here. May be few screen shots may help us in better understanding your issue
Nabheet
2014 Feb 06 11:39 AM
hi nabheet,
yes I use custom sap script copy of standard scrip for check print...
I want that amount in words come in next line also....see attachment.
I want four thousand start from 2nd line
2014 Feb 06 11:32 AM
2014 Feb 06 11:41 AM
hi,
I alrady use 'RKD_WORD_WRAP' in zrffous_c copy of standard program RFFOUS_C
but in script I have to use spell-word ?
then how can I display TEXT1 ,TEXT2 from 'RKD_WORD_WRAP' in only spell-word?
payel
2014 Feb 06 12:03 PM
Well....u can always refer to custom text instead of SPELL-WORD
IF I am correct.....u r having &SPELL-WORD& in your window
Instead of this.....pass the text from RKD_WORD_WRAP
&TEXT1&
&TEXT2&
This should also...do the same thing....!
2014 Feb 06 12:08 PM
hi,
how can I pass text1 tex2
spell-word = text1
spell-word = text2
and in script?
&text1&?
2014 Feb 06 12:19 PM
Payel
Are you having a separate window for showing this text..? If yes then you will have to first adjust your position of window and then you will have to split text based on the length which first the line. You may have to play with line spacing of paragraph format so that it can print on the line.
Nabheet
2014 Feb 06 12:48 PM
Based on the size of Window and the number of characters that it can accomodate.....
Call FM RKD_WORD_WRAP passing the length.....and SPELL-WORD as input
Now, you will have an internal table which contains all the lines which contain amount in words which are to be printed.
Display contents of this new internal table.....instead of SPELL-WORD in the Window....
Hope this clarifies.
2014 Feb 06 12:57 PM
Coding should something as follows:
CALL FUNCTION 'RKD_WORD_WRAP'
EXPORTING
TEXTLINE = spell-word
OUTPUTLEN = 40 "Num of characters that can accomodate in window
IMPORTING
OUT_LINE1 = texto
OUT_LINE2 = texto1
OUT_LINE3 = texto2
TABLES
OUT_LINES = lt_tline.
LOOP AT lt_tline INTO ls_tline.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
window = 'CHECKSPL'
element = '545'
EXCEPTIONS
window = 1
element = 2.
ENDLOOP.
In the Sapscript...the window should contain:
&LS_TLINE-TEXT&
OR...if you are sure that no more than 3 lines would be displayed......then
1. Remove the Loop statement.....we can use the same variable TEXTo, TEXT01 and TEXT02.
Simply....in the Sapscript mention:
&TEXT0&
&TEXT01&
&TEXT02&
As Nabheet said.....u will have to adjust your paragraph spacing for any of these to work.,....
2014 Feb 06 12:06 PM
hi,
1. use function SPELL_AMOUNT
2. concatenate WORD and DECWORD into a variable
3. use RKD_WORD_WRAP into three words.
4. use those in the script
Regards,
Prasad
2014 Feb 07 6:36 AM
HI ,
I WRITE CODE in ZRFFOUS_C under include ZRFFORI99
and in program I can see TEXT1 AND TEXT2 split the amount but when i disply text1 and text 2 in sap script nothing is display in sap script.
i copy the standard sap script to ZF110_PRENUM_CHC
DATA: AMOUNT_NUM LIKE PC207-BETRG,
AMOUNT_WORDS(200) TYPE C.
DATA : TEXT01(255),
TEXT02(255),
TEXT03(255),
TEXT04(255).
DATA: LV_WORD TYPE IN_WORDS,
TEXT1 TYPE CHAR200,
TEXT2 TYPE CHAR200.
MOVE reguh-rwbtr TO AMOUNT_NUM.
CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
AMT_IN_NUM = AMOUNT_NUM
IMPORTING
AMT_IN_WORDS = AMOUNT_WORDS
* EXCEPTIONS
* DATA_TYPE_MISMATCH = 1
* OTHERS = 2
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
CLEAR : TEXT01,TEXT02,TEXT03,TEXT04.
SPLIT AMOUNT_WORDS AT 'Rupees' INTO : TEXT01 TEXT02.
SPLIT TEXT02 AT 'Paise' INTO : TEXT03 TEXT04.
CONDENSE : TEXT01,TEXT02,TEXT03,TEXT04.
IF TEXT03 IS INITIAL.
CONCATENATE TEXT01 'AND ZERO PAISE ONLY' INTO AMOUNT_WORDS SEPARATED BY SPACE.
ELSE.
CONCATENATE TEXT01 'AND' TEXT03 'PAISE ONLY' INTO AMOUNT_WORDS SEPARATED BY SPACE.
ENDIF.
*CONDENSE AMOUNT_WORDS .
spell-word = amount_words.
CONCATENATE SPELL-WORD SPELL-DECWORD INTO LV_WORD.
CALL FUNCTION 'RKD_WORD_WRAP'
EXPORTING
TEXTLINE = LV_WORD
* DELIMITER = ' '
OUTPUTLEN = 60
IMPORTING
OUT_LINE1 = TEXT1
OUT_LINE2 = TEXT2
* OUT_LINE3 =
* TABLES
* OUT_LINES =
EXCEPTIONS
OUTPUTLEN_TOO_LARGE = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
* REPLACE 'RUPEES' WITH '' INTO AMOUNT_WORDS.
* REPLACE 'ONLY' WITH '' INTO AMOUNT_WORDS.
* REPLACE 'AND' WITH '' INTO AMOUNT_WORDS.
* spell-word = amount_words.
* spell-word = TEXT2.
CONDENSE spell-word.
WRITE SPELL-WORD LEFT-JUSTIFIED TO SPELL-WORD.