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: 

conversion frm qty fields to character fields

Former Member
0 Kudos
103

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

2 REPLIES 2

Former Member
0 Kudos
61

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

0 Kudos
61

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