on 11-13-2008 2:18 PM
Hi All,
I am working on a sap script, in that particular sap script it's pulling the value in a variable $ &EXTPREM(C), and it's looping through twice and each time it's pulling two diff values...lets say first time it will pull $50 and second time it will pull $90...and now I want to diaplay the total of both these values..I might need to declare a variable and then pass the value into it and then add it...but I am not good with SAP Script...so can you please tell me how can I declare a variable in it and thn how can I do the total...
Thanks,
Rajeev
Hi all,
I have defined the this variable in my SAP SCRIPT
/:DEFINE &TOTAL&
when I reach to the following step:
/:&TOTAL& = &MTHPREM(C)&
/:&TOTAL& = &TOTAL& + &TOTAL&
it gives me this message:
Text command &TOTAL& is not defined
Can you please tell me where I am wrong...
Thanks,.
Rajeev
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In Script write like this.
/: PERFORM TOTAL IN PROGRAM Z_MM_R_MMPO
/: Using &TOTAL&
/: Changing &final&
P1 &final&-----it will displays the sum of(50 + 90) total value.
Here Z_MM_R_MMPO is u r subroutine program. Create this in SE38.
after write below code in SE38 program
FORM TOTAL TABLES IN_TAB STRUCTURE ITCSY "#EC *
OUT_TAB STRUCTURE ITCSY. "#EC CALLED
Data : v_final type i,
v_final1 type c.
READ TABLE IN_TAB WITH KEY NAME = 'TOTAL'.
if sy-subrc is initial.
v_final = v_final + IN_TAB-VALUE.
endif.
v_final1 = v_final.
READ TABLE OUT_TAB WITH KEY NAME = 'FINAL'.
if sy-subrc is initial.
OUT_TAB-VALUE = v_final1.
MODIFY OUT_TAB INDEX SY-TABIX.
endif.
ENDFORM.
User | Count |
---|---|
86 | |
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.