‎2006 Oct 19 12:55 PM
Hi
I want to hardcode value as "2" and i want to add those 2 and display in total .
in output its taking as 20.00 and its not adding ..
DATA: BEGIN OF I_FINAL OCCURS 0,
JES LIKE PC207-BETRG, "Employee share
JER TYPE I VALUE this value ..i want as 2..
WRITE: '2'.
v_jer = v_jer + wa_final-jer.
condense v_jer.
‎2006 Oct 19 12:59 PM
Hi
Depends how you are defining v_jer. Have a variable of same type and default it to 2. Then do the addition.
Regards,
Raj
‎2006 Oct 19 1:06 PM
Hi,
Declare the JER as type N instead of I.
TRY like below and chk.
DATA: BEGIN OF I_FINAL OCCURS 0,
JES LIKE PC207-BETRG, "Employee share
JER TYPE N VALUE this value ..i want as 2..
WRITE: '2'.
v_jer = v_jer + wa_final-jer.
condense v_jer.
regards,
nagaraj
‎2006 Oct 19 1:22 PM
Hi still not working
Find my code
DATA: BEGIN OF I_FINAL OCCURS 0,
PERNR LIKE PA0001-PERNR, "Personnel number
ENAME LIKE T500P-NAME1, "Name of employee
GESCH LIKE PA0002-GESCH, "Gender
JES LIKE PC207-BETRG, "Employee share
JER TYPE N value '2',
END OF I_FINAL
DATA: V_JER type N.
LOOP AT i_final INTO wa_final.
WRITE /80 '2' .
ENDLOOP.
v_jer = v_jer + wa_final-jer.
condense v_jer.
AT LAST.
WRITE:/80 v_jer.
ENDAT.
‎2006 Oct 19 1:28 PM
Try the below code
Please note the change you need to get the last piece of code before ENDLOOP.
DATA: BEGIN OF I_FINAL OCCURS 0,
PERNR LIKE PA0001-PERNR, "Personnel number
ENAME LIKE T500P-NAME1, "Name of employee
GESCH LIKE PA0002-GESCH, "Gender
JES LIKE PC207-BETRG, "Employee share
JER TYPE N value '2',
END OF I_FINAL
DATA: V_JER type N.
LOOP AT i_final INTO wa_final.
WRITE /80 '2' .
v_jer = v_jer + wa_final-jer.
condense v_jer.
AT LAST.
WRITE:/80 v_jer.
ENDAT.
ENDLOOP.
<b>From your code it does not seem to be the case...try the above and check the result.</b>
Message was edited by: Anurag Bankley
‎2006 Oct 19 1:29 PM
Hi RK,
Why are u adding outside the loop.do it inside the loop and chk it.
loop at it_final into wa_final.
v_jer = v_jer + wa_final-jer.
condense v_jer.
endloop.
do one thing remove the JER field from the internal table it_final.
delare a constant.
constants : c_jer type n value '2'.
Now loop ..
loop at it_final into wa_final.
v_jer = v_jer + c_jer.
endloop.
try like this...
regards,
Nagaraj
Message was edited by: nagaraj kumar nishtala
‎2006 Oct 19 1:41 PM
Hi
Nagaraj,
Iam adding inside the loop only..
Iam displaying outside the loop.