Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

HOW TO SPLIT the amount text into two lines?

Former Member
0 Likes
3,641

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

11 REPLIES 11
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
2,721

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

Read only

0 Likes
2,721

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

Read only

Former Member
0 Likes
2,721

Hi,

Try with this function module..

'RKD_WORD_WRAP'

Read only

0 Likes
2,721

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

Read only

0 Likes
2,721

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....!

Read only

0 Likes
2,721

hi,

how can I pass text1 tex2

spell-word = text1

spell-word = text2

and in script?

&text1&?


Read only

0 Likes
2,721

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

Read only

0 Likes
2,721

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.

Read only

0 Likes
2,721

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.,....

Read only

P1389307362
Explorer
0 Likes
2,721

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

Read only

Former Member
0 Likes
2,721

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.