cancel
Showing results for 
Search instead for 
Did you mean: 

calling function modules in Scripts???

Former Member
0 Kudos

Hello Gurus,

I am actually printing the value &vbdpa-kwmeng& --- quantity in sales order in Scripts. The requirement is if the quantity is 1...it should be converted into words as ONE.i am new to Scripts...can anyone pls tell me how to do it..?

Thanks in Advance,

Anky

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

In your script use a perform statement and define the form in SE38 program. Use command like in layout

/: PERFORM (V_NAME) IN PROGRAM (V_PROGNAME)

/: USING 'VAR1'.

/: USING 'VAR2'

/: CHANGING 'VAR3'

/: ENDPERFORM.

Goto SE38 transaction and create program V_PROGNAME.

Use the FM SPELL_AMOUNT. this FM is used to give the amount in words

FORM (V_nAME) USING ITCSY STRUCTURE.

*........data declaration

*..............

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

AMOUNT = PAMOUNT

  • CURRENCY =

  • FILLER = SPACE

LANGUAGE = 'E'

IMPORTING

IN_WORDS = T_SPELL

EXCEPTIONS

NOT_FOUND = 1

TOO_LARGE = 2

OTHERS = 3.

ENDFORM.

ENDFORM.

Hope this helps.

Regards,

Richa

Former Member
0 Kudos

Thank you gurus....I got the problem solved with your valuable inputs..

Answers (3)

Answers (3)

Former Member
0 Kudos

hi anky,

we have a FM named as HR_** but it will start with HR only boss.

i think this will sove ur problem.

reward me if sound useful

dev_parbutteea
Active Contributor
0 Kudos

HI,

here is an example

/: PERFORM GETTOTAL IN PROGRAM ZINNERDOCTEST3

/: USING &BSEG-WRBTR&

/: CHANGING &SUM&

/: ENDPERFORM

Code in SAP scripts

DATA:GLOBAL TYPE n .

FORM GETTOTAL TABLES IN_TAB STRUCTURE ITCSY OUT_TAB STRUCTURE ITCSY.

READ TABLE IN_TAB INDEX 1. <b>or read with key 'BSEG-WRBTR'</b>

DATA:SUM1 TYPE n .

SUM1 = IN_TAB-VALUE.

READ TABLE IN_TAB INDEX 1.

GLOBAL =IN_TAB-VALUE.

<b>call FM here and do processing</b>

READ TABLE OUT_TAB INDEX 1.<b>results returned in out_tab</b>

LOOP AT OUT_TAB.

OUT_TAB-VALUE = GLOBAL.

MODIFY OUT_TAB INDEX sy-tabix.

ENDLOOP.

ENDFORM.

Former Member
0 Kudos

You can not call Function module in Layout (SE71),

so use perform routine..

use command like in layout

/: PERFORM (NAME) IN PROGRAM (PROG NAME)

/: USING 'VARIABLE'.

/: USING 'VARAIBLE'

/: CHANGING 'VARIABLE'

/: ENDPERFORM.

GOTO SE38 TRANSACTION CREATE PROGRAM..

NOW USE YOUR LOGICE.

FORM (NAME) USING ITCSY STRUCTURE.

HERE YOU NEED WRITE lOGIC

ENDFORM.

Reward Points if it is helpful

Thanks

Seshu