Application Development 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: 

HI ALL - SCRIPT ISSUE

Former Member
0 Kudos

HI ALL

I HAVE WRITTEN FOLLOWING CODE IN SCRIPT SE71 FORM

PERFORM SPEL_AMT IN PROGRAM ZABC USING &AMOUNT& CHANGING &AMTWD&

AND THE FOLLOWING CODE IN FORM (IN SE38 PROGRAM)

data: var1 like bseg-dmbtr,

w_word(50) TYPE c.

form spel_amt tables intab structure itcsy

outtab structure itcsy.

LOOP AT OUTTAB.

read table intab index 1.

move intab-value to var1.

CALL FUNCTION 'HR_IN_CHG_INR_WRDS'

EXPORTING

amt_in_num = VAR1 " '1005.70'

IMPORTING

amt_in_words = w_word

EXCEPTIONS

data_type_mismatch = 1.

*WRITE: w_word.

READ TABLE OUTTAB INDEX 1.

IF OUTTAB-NAME = 'AMTWD'.

MOVE W_WORD TO OUTTAB-VALUE.

MODIFY OUTTAB.

ENDIF.

ENDLOOP.

endform.

BUT I AM NOT GETTING OUTPUT IN VARIABLE AMTWD.

WHAT IS WRONG IN THE ABOVE CODING.

I AMTRYING TO GET AMOUNT IN WORD IN AMTWD.

THANX IN ADV.

ROCKY

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi!

Try to write it into your SAPScript like this:

/: PERFORM SPEL_AMT IN PROGRAM ZABC

/: USING &AMOUNT&

/: CHANGING &AMTWD&

/: ENDPERFORM.

Put a break-point into the ABAP code to see, how it is working.

Regards

Tamá

5 REPLIES 5

Former Member
0 Kudos

Hi,

please use ENDPEFORM statement after perform statement...

it will solve your problem.

Regards,

venkat

Former Member
0 Kudos

Hi!

Try to write it into your SAPScript like this:

/: PERFORM SPEL_AMT IN PROGRAM ZABC

/: USING &AMOUNT&

/: CHANGING &AMTWD&

/: ENDPERFORM.

Put a break-point into the ABAP code to see, how it is working.

Regards

Tamá

Former Member
0 Kudos

Hi Rocky,

First you need to pass the AMOUNT to the INTAB-value and now the Amount will be available in the ITCSY structure then

you can use in the FM. And again pass it to the outtab value.

Regards,

Sharath

Former Member
0 Kudos

Why dont u debug this subroutine. You would get to know what the problem is...

Nayan

Former Member
0 Kudos

What's the point of the LOOP AT OUTTAB? I don't see any use for it. Is this form called by other sapscripts with different values?

Try

FORM spel_amt tables intab structure itcsy

outtab structure itcsy.

DATA: w_num LIKE pc207-betrg,

w_wrd(130) TYPE c.

READ TABLE intab INDEX 1.

MOVE intab-value TO w_num.

CALL FUNCTION 'HR_IN_CHG_INR_WRDS'

EXPORTING

amt_in_num = w_num

IMPORTING

amt_in_words = w_wrd

EXCEPTIONS

data_type_mismatch = 1.

outtab-value = w_wrd(50).

MODIFY outtab INDEX 1.

ENDFORM.

amt_in_num is 15 characters, 2 decimal places

var1 is only 13 characters, 2 decimal places

amt_in_words can be upto 130 characters, I'm assuming there's a reason you're limiting yourself to 50.