on 01-07-2010 7:37 AM
Dear Friends
i have using script and taking calculated value from sub routing
FORM ZPM_GET_VALUES TABLES IN_P1 STRUCTURE ITCSY OUT_P2 STRUCTURE ITCSY.
DATA : V_VALUE2 TYPE MBEW-VERPR.
DATA : LV_MATNR TYPE MBEW-MATNR.
DATA : LV_WERKS TYPE MBEW-BWKEY.
DATA : LV_VALUE TYPE P DECIMALS 2.
DATA : LV_VERPR TYPE MBEW-VERPR.
DATA : V_VALUE TYPE STRING.
*
READ TABLE IN_P1 WITH KEY 'RESBD-MATNR'.
LV_MATNR = IN_P1-VALUE.
*
READ TABLE IN_P1 WITH KEY 'CAUFVD-VAWRK'.
LV_WERKS = IN_P1-VALUE.
*
READ TABLE IN_P1 WITH KEY 'RESBD-MENGE'.
LV_VALUE = IN_P1-VALUE.
*
SELECT SINGLE VERPR
INTO LV_VERPR
FROM MBEW
WHERE MATNR EQ LV_MATNR
AND BWKEY EQ LV_WERKS.
*
* BREAK ITNR.
V_VALUE2 = LV_VERPR * LV_VALUE.
V_VALUE = V_VALUE2.
CONDENSE V_VALUE.
*
LOOP AT OUT_P2 WHERE NAME EQ 'V_VALUE'.
OUT_P2-VALUE = V_VALUE.
MODIFY OUT_P2.
ENDLOOP.
* BREAK ITNR.
ENDFORM. " ZPM_GET_VALUES
in SCRIPT
* ------------------------------------------------------------------------
/E MATERIAL
/: DEFINE &V_VALUE&=''
/: DEFINE &V_SUM&=&V_VALUE&
/: PERFORM ZPM_GET_VALUES IN PROGRAM ZIW3D_INFO
/: USING &RESBD-MATNR(C)&
/: USING &RESBD-MENGE(C)&
/: USING &CAUFVD-VAWRK&
/: CHANGING &V_VALUE&
/: ENDPERFORM
* &RESBD-MATNR(C)&,, &RESBD-MATXT&,,,,&RESBD-MENGE(C)& &RESBD-EINHEIT&
= ,,,,&V_VALUE&
/* SUMMING &V_VALUE& INTO &V_SUM&
/: V_SUM = V_SUM + &V_VALUE&
but any values didn't take to V_SUM
please help me to solve this issue
Thanks in Advance
Hi
Try using
/: SUMMING &V_VALUE& INTO &V_SUM&
Ref: http://it.toolbox.com/wiki/index.php/Sap_script#6.21.1.09Summing_and_Carrying_Forward_is_Incorrect
Hope this solves your issue..
Nag
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Friend
please let me know how can i pass thousand separated value through ITCSY structure, i tried but only happen string values
when we pass as string thousand separator going out like 123456.50 but i want to pass like 123,456.50
please give some clue to sole this issue.
Thanks in Advance
Hi Nelson,
<li>Try the below way.
Thanks
Venkat.O
REPORT ztest_notepad.
DATA: value1(15) TYPE i VALUE '123214.223'.
DATA: value2(15) TYPE n.
DATA: value3(15) TYPE c.
"The below statment gives you the desired output.
WRITE value1 TO value2.
"Pass Value2 to ITCSY structure.
value3 = value2.
WRITE value3.
/: V_SUM = V_SUM + &V_VALUE&
You cannot write direct calculative statements in scrips.
You might have to use Subroutines just like you have used above.and pass the sum values through OUTPAR.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.