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

HI SAPCRIPT

Former Member
0 Likes
579

HI

I AM USING PERFORM IN SAPSCRIPT FOR CALCULATIONS.

IN THE CALLING PROGARM, I AM SENDING QUANTITY FIELD AND ON THAT VALUE I NEED TO CALCULATE, BUT IT IS GIVING ERROR IN THE CALLING PROGRAM

ERROR MESSAGE IS : CANNOT CONSIDER THE VALUE AS NUMBER .

IN THE PRINT PROG THAT FIELD IS A QUANTITY FIELD, BUT IN CALLING PROG IT CHANGES AUTOMATICALLY TO CHAR, WHY???

PL PROVIDE SOL AS EARLY AS POSSIBLE.

THANX

ROCKY

5 REPLIES 5
Read only

Former Member
0 Likes
555

Hi rocky,

the interface parameters are like this:

FORM ZMEDRUCK01_01 TABLES IN_TAB STRUCTURE ITCSY

OUT_TAB STRUCTURE ITCSY.

look at the structure of ITCSY, the value-field is an character.

You have to convert it into an quantity field.

hope it helps.

regards, Dieter

in script we use:

PERFORM ZMEDRUCK01_01 IN PROGRAM Z_FORMULAR_ROUTINEN

USING &EKPO-EMATN&

CHANGING &ZEINR&

CHANGING &ZEIVR&

ENDPERFORM

regards, Dieter

Message was edited by:

Dieter Gröhn

Read only

Former Member
0 Likes
555

hi friend,

just check the quantity field in the calling program u must have defined the quantity field as character and that is the reason u my get type mismatch(char is not equal to quantity) u only told that in the print program the quantity field is defined as quantity hence rectify this difference the problem will be solved.

if u r clear then let me know.

Read only

Former Member
0 Likes
555

Hi,

Always you have to pass the CHAR type fields to the perform and do the data manipulation in the program.

Generally we don't pass the qty to the perform.

What Script is it? PO or SO, Invoice or delivery? pass the Key field like PO no, SO no, Del No or Inv No and get the data in the Program and do the calculations/Manipulations and resend the same to the script in the char format only.

Regards,

anji

Read only

Former Member
0 Likes
555

Hi rocky,

the structure of the interface parameters is ITCSY

which contains NAME ,VALUE as fields

and both r char type ,

so u need to move the vakue of ITCSY_VALUE to an integer variable in Print program and make the calculations , and finaay move again the result to

ITCSY-VALUE.

I hope this will definitely work......

Read only

Former Member
0 Likes
555

hi buddy..

You've done everything correct but with a silly mistake of data type conversion, you're receiving this mismatch error. The default data type is Char and if anything is non-convertable will be converted to char type and also the structure ITCSY has two fields..they are name and value..both of them are of char type and you're using the Quantity fiield is not of char type..so this conversion will automatically lead to error if Quantity field is not char type since the priority goes to the structure ITCSY in this case. Keep this field as char type..and see how u r getting the exact output.

this solves the issue.

regards,

shamim