Skip to Content
1
Former Member
Aug 01, 2007 at 08:14 AM

I want to sum up the work involved in the activity?

42 Views

FRIENDS PROBLEM IS THAT I WANT TO CALCULATE THE WORK INVOLVED IN THE ACTIVITY I.E AFVGD-ARBEI…. WHICH IS AS FOLLOWS

1.0,

6.0,

3.0,

I WANT TO SUM THEM UP SO THAT I GET 1.0 + 6.0 + 3.0 = 10.0

I HAVE WRITTEN THE SUBROUTINE N CALLED IT FROM THE SAPSCRIPT MAIN…..

BUT O/P I AM GETTING IS 3.0 .I.E ITS ONLY TAKING THE LAST VALUE WHERE AS I NEED THE TOTAL SUM..

PLEASE CORRECT THE BELOW GIVEN CODE.

URGENT

/: PERFORM YE_PM_COMMON_WORK IN PROGRAM ZPMINCLUDE

/: USING &AFVGD-ARBEI&

/: CHANGING &CONV_WORK&

/: ENDPERFORM

SUBROUTINE

FORM YE_PM_COMMON_WORK

TABLES in_tab STRUCTURE itcsy

out_tab STRUCTURE itcsy.

DATA: v_vaL TYPE AFVGD-ARBEI, “WORK INVOLVED IN THE ACTIVITY

v_val1 TYPE AFVGD-ARBEI,

v_val_char(15) TYPE c.

READ TABLE in_tab INDEX 1.

v_val1 = in_tab-value.

V_VAL = V_VAL + V_VAL1.

v_val_char = v_val.

READ TABLE out_tab INDEX 1.

MOVE V_VAL_CHAR TO out_tab-value.

MODIFY out_tab INDEX 1.

CLEAR out_tab.

ENDFORM.