2007 Jul 13 7:36 AM
Hi,
i am working on script
i need to subtract two values (MSEG-ERFMG - MSEG-LSMNG)
i am passing these variables in the perform
PERFORM GET_MAT_DESCREPANCY IN PROGRAM ZMM_SUB_GRN_REJPRINT
USING &MSEG-ERFMG&
USING &MSEG-LSMNG&
CHANGING &P_DIS&
ENDPERFORM
and in the form i am using
FORM GET_MAT_DESCREPANCY TABLES T_IN STRUCTURE ITCSY T_OUT STRUCTURE ITCSY.
READ TABLE T_IN WITH KEY NAME = 'MSEG-ERFMG'.
MOVE T_IN-VALUE TO P_ERFMG.
but i am getting error as T_IN has charaacter values and the 'MSEG-ERFMG' is of type qty
i want to subract MSEG-ERFMG - MSEG-LSMNG values
can u pls help this out
2007 Jul 13 7:44 AM
Hi Divya,
I assume you are getting errors because of using "," as a decimal sign. You may try
translate t_in-value using ',.. '.
condense t_in-value no-gaps.
move t_in-value to p_erfmg.
I hope this helps. Best regards,
Alvaro
2007 Jul 13 7:56 AM
Hi,
thanks for ur ans.
but i am getting the error while reading READ TABLE T_IN WITH KEY NAME = 'MSEG-ERFMG'.
coz t_in can hold only char data type and i am passing that to qty data type
is there any way to subtrat two qty. fields in sap script and pass the result to sap script