cancel
Showing results for 
Search instead for 
Did you mean: 

Sap Script - numbers to words without function module

Former Member
0 Kudos

Moderator message - please use a meaningful subject in future. I've changed it for you this time. Also, moved to the correct forum

Hi Friends,

In SAP Script how to convert numbers into words with out using the function module in the driver program.

examplae 21 kg as twenty one kg.

Please help me to solve this problem.

Thanks in advance.

Gayathri S

Edited by: Matt on Nov 5, 2008 9:15 AM

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Your requirement is not to modify the driver program, can you modify the sap script. Then call external program using the key word (PERFORM) from the layout to do your job.

Prabhu Rajesh

Former Member
0 Kudos

Yes i can modify the sap script

Former Member
0 Kudos

Hi,

In the SAP Script, you can call the perform like below:

Syntax in a form window:

/: PERFORM <form> IN PROGRAM <prog>

/: USING &INVAR1&

/: USING &INVAR2&

......

/: CHANGING &OUTVAR1&

/: CHANGING &OUTVAR2&

......

/: ENDPERFORM

You can create a separate include or use an existing include related to your script and create the above <form> in that <prog>.

The syntax for creating the form in the include is as below:

FORM <form> TABLES IN_TAB STRUCTURE ITCSY

OUT_TAB STRUCTURE ITCSY.

...

ENDFORM.

Example:

In your script,

/: PERFORM GET_BARCODE IN PROGRAM ABCDE

/: USING &PAGE&

/: USING &NEXTPAGE&

/: CHANGING &BARCODE&

/: ENDPERFORM

And in the report ABCDE, create the form like this:

REPORT ABCDE.

FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY

OUT_PAR STRUCTURE ITCSY.

DATA: PAGNUM LIKE SY-TABIX, "page number

NEXTPAGE LIKE SY-TABIX. "number of next page

READ TABLE IN_PAR WITH KEY 'PAGE'.

CHECK SY-SUBRC = 0.

PAGNUM = IN_PAR-VALUE.

READ TABLE IN_PAR WITH KEY 'NEXTPAGE'.

CHECK SY-SUBRC = 0.

NEXTPAGE = IN_PAR-VALUE.

READ TABLE OUT_PAR WITH KEY 'BARCODE'.

CHECK SY-SUBRC = 0.

IF PAGNUM = 1.

OUT_PAR-VALUE = '|'. "First page

ELSE.

OUT_PAR-VALUE = '||'. "Next page

ENDIF.

MODIFY OUT_PAR INDEX SY-TABIX.

ENDFORM.

Hope this helps.

Regards,

Suganya

former_member598013
Active Contributor
0 Kudos

Hi Gayathri,

You need to use the FORM ENDFORM and inside the subroutine call the fm to convert the number into words and then return the word to the sap script in CHANGING parameter.

Thanks,

Chidanand

Former Member
0 Kudos

hi

if u dont want to call Fm in the driver program

u can call it in..

perform

..

end perform

script command..

Deepak

Former Member
0 Kudos

hi

will u guide with code.

Former Member
0 Kudos

Hi Gayatri,

With out Changing the print program its not possible, if you donot want to change the Driver Program then write a subroutine in the script and call the function module in that subroutine.

Regards

Kumar M

Edited by: mukesh kumar on Nov 5, 2008 6:01 AM