on 05-21-2007 9:11 AM
hi.. i want to carry out the totals for quantity and amount in sales order details.
hw can i do that in my driver program..
i have all ny details data in an iinternal table..i ve looped at it and printing it using script.
tried using sum command but not working..
Hi rashmi,
see this example.
loop at itab.
at end of itab-quantity.
read itab index sy-tabix.
sum.
* now total is in the field itab-quantity.
endloop.
reward points if helpful.
Thanks,
Suma.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rashmi,
plz call the function after <b>Sum</b> statement. There in the script use table-quantity field.
use
<b>at end of SONUMBER
endat.</b>
instead of
<b>at end of kwmeng.
endat.</b>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi rashmi,
u can do one thing...define a variable of type UNIT and go on passing the quantity data in that variable....
code..
clear var1.
loop at ITAB.
.....
....
var1 = var1 + quantity field.
endloop.
thats all...
display var1 in script...
hope this will work...pls reward pts incase usefull...
Regards,
Prashant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use endat before endloop
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
this is what i ve done..
loop at it_details into wa_details.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'SO_DETAILS'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
IMPORTING
PENDING_LINES =
EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
TYPE = 3
UNOPENED = 4
UNSTARTED = 5
WINDOW = 6
BAD_PAGEFORMAT_FOR_PRINT = 7
SPOOL_ERROR = 8
CODEPAGE = 9
OTHERS = 10
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*&--sum of the order quantities:
AT end of kwmeng.
read table it_details into wa_details index sy-tabix.
SUM.
write:/ wa_details-kwmeng.
endat.
endloop.
Hi Rashmi,
try this. But if we use at end of means it will print total quantity once only
loop at itab.
at end of quantity.
read table itab index sy-tabix.
sum.
write:/ itab-quantity.
endloop.
Thanks,
Suma.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.