‎2007 Mar 01 8:43 AM
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
‎2007 Mar 01 8:52 AM
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
‎2007 Mar 01 8:53 AM
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.
‎2007 Mar 01 8:53 AM
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
‎2007 Mar 01 8:56 AM
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......
‎2007 Mar 01 9:11 AM
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