2009 Jan 05 9:24 AM
Hi,
While returning the value from a subroutine to out_parameter-value (ITCSY), the numeric value does not get stored in out_parameter-value.
What should I do?
Thanks.
Hi,
While returning the value from a subroutine to out_parameter-value (ITCSY), the numeric value does not get stored in out_parameter-value.
What should I do?
Thanks.
2009 Jan 05 10:41 AM
Hello,
The table ITCSY will treat all fields as char. type.
to pass the numeric value, use MOVE instead of direct assignment.
eg:
<ITCSY-value = <numeric field>.
MOVE <Numeric Field> to ITCSY-value.
Edited by: Sachinkumar Mehta on Jan 5, 2009 11:42 AM
2009 Jan 05 10:49 AM
Hi,
You can use
WRITE g_num to itcsy-value.
or move gn_num to itcsy-value .
to move the data from routine to output parameter value.
Regards,
Venkatesh
2009 Jan 05 1:31 PM
Hi,
Below is the code that I have written.
data : v_kwmeng TYPE vbap-kwmeng,
v_netwr type vbap-netwr,
v_netwr_rt type vbap-netwr.
READ table in_par with KEY 'IT_VBAP-KWMENG'.
check sy-subrc = 0.
REPLACE all OCCURRENCES of ',' in in_par-value WITH ''.
condense in_par-value .
v_kwmeng = in_par-value.
READ table in_par with KEY 'IT_VBAP-NETWR'.
check sy-subrc = 0.
REPLACE all OCCURRENCES of ',' in in_par-value WITH ''.
condense in_par-value .
v_netwr = in_par-value.
if v_kwmeng > 0.
v_netwr_rt = v_netwr / v_kwmeng.
endif.
read table out_par with key 'RATE'.
check sy-subrc = 0.
move v_netwr_rt to out_par-value.
modify out_par index sy-tabix.
The value in v_netwr_rt is not assigned to out_par-value. I have tried
MOVE v_netwr_rt to out_par-value and WRITE v_netwr_rt to out_par-value also but with no success.
Any idea as to what should be done here. When I store tha value of v_netwr_rt var in a string var, then that is passed. But a numeric field can be stored in a string var. So this should have worked.
In case of string, the data is not passed with thousand seperator. Eg : 1234567.00 should actually be 1,234,567.00. Can you guide me on this?
2009 Jan 14 3:14 PM