How to get total of any field in sapscript?

Hello ,
i m making sapscript...
How to get total of any field in sapscript?

Hi
Yes, you can define a variabe in your print program and pass it to the SAPScript.
LIKE:
Define L_SUM in the Global data.
DATA: L_SUM TYPE BSEG-DMBTR.
LOOP AT ITAB.
L_SUM = L_SUM + ITAB-AMOUNT.
ENDLOOP.
CALL FUNCTION 'WRITE_FORM'
WINDOW = 'MAIN'
ELEMENT = 'TOTAL'.
Now, in your SAPScript, create a text element in MAIN window
/E TOTAL
Total,, &L_SUM&.
Go through below link
http://sap-img.com/sapscripts/sapscript-how-to-calculate-totals-and-subtotals.htm
Regards,
Chandru

Similar Messages

  • How to get total in ALV report in same Internal table?

    Data : Begin of it_data,
            kunnr type kunnr,
            name1 type name1,
            amt1  type btrt01, " CURR 15,2
           end of it_data.
    loop at it_data into wa_data
    endloop.      
    Hello friends,
    I am developing one ALV report with 20 rows.
    I have filled one internal table with some fileds like amount.
    I want to get total of all amount1 in AMT1 field.
    So, How to get total of amount in same internal table in ALV report ?
    It is ok if i get duplicate rows in internal table.
    Points 'll be awarded soon.
    Regards,
    NVM

    Hi Ronny,
    the alv output will display the sum at the last row.
    for this functionality u have do this logic.
    data: lw_fcat type slis_fieldcat_alv.
    data: lt_fcat type slis_t_fieldcat_alv/
    wa_fcat-fieldname = 'AMT1'.
    wa_fcat-tabname = 'ITAB'.
    wa_fcat-do_sum = 'X'.
    append wa_fcat to lt_fcat.
    and then pass it to reuse_alv_grid_display function,
    regards,
    Santosh Thorat

  • How to get total available RAM

    Hi
    How to get total available RAM of the system. I used Runtime.getInstance().totalMemory(), it is not giving total memory of the system. I appreciate any help on this pl.
    Thx
    PK

    If there would be any operating system command
    displaying the desired result,
    we could execute it as runtime command and parse the
    output.
    But I don't know if such a command exists.
    I tried "mem", but it does not show the value I
    expected.For windows XP the following command (either in the cmd window or executed by Runtime.exec) will provide the physical memory size.
    systeminfo | find "Total Physical Memory"I don't know if it works in other Windows versions.

  • How to get total number of days

    Hi All,
    how to get total number of days , for example if month eq 05 then need to get total number of days until MAY 31.
    and how to get total number of days in a month.
    Thank You,,
    Sriii..

    Hi Sridhar,
    Pls Try to search before posting general questions.
    Try this,
    CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
        EXPORTING
          i_datum_bis                   = p_lv_date1
          i_datum_von                   = p_lv_date2
       IMPORTING
         e_tage                        = p_e_date_difference
       EXCEPTIONS
         days_method_not_defined       = 1
         OTHERS                        = 2
      IF sy-subrc  0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    Regards,
    Sunil kairam.

  • How to get the object class field value in CDHDR table for vendor

    hi
    how to get the object class field value in CDHDR table for vendor

    Try KRED/KRED_N as object class in CDHDR for Vendor.

  • How to get refund of any purchase?, How to get refund of any purchase?, How to get refund of any purchase?

    How to get refund of any purchase?, How to get refund of any purchase?, How to get refund of any purchase?

    Go here:
    https://expresslane.apple.com/Issues.action
    Plead your case.
    Bear in mind: iTunes terms state that all sales are final, there are no refunds.
    Good luck.

  • I had the Siri app before it was added to all iphones and when Apple added it mine quit working. I deleted mine from my phone but do not see how to get it back. any suggestions?

    I had the Siri app before it was added to all iphones and when Apple added it mine quit working. I deleted mine from my phone but do not see how to get it back. any suggestions?

    bjorth wrote:
    apparently I have just an iphone 4 not 4s, so thank you.
    It does seem rather odd that an app that was acquired thru itunes would quit working once it was incorporated into the device for all users. oh well it was probably free or $.99 when I downloaded it.
    I would think that they were just testing it to see how many people would use it.  But you might want to write a polite letter to Apple requesting a credit for the purchase price of the no longer supported app.  That seems to be the least they could for one of their 'alpha testers'.

  • How to get total at each hierarchy

    Hello Gurus,
    Does anybody know how to get total at each  level.
    I mean, if I have the following structure...
    Level 1
    Level 2
    Level 3
    Level 4
    Level 5
    At level 5 we have the following calculation
    Volume      Price    Amount(From Formula Volume * price)
    5                 2           10,00
    6                 3           12,00
    7                 4            28,00
    My question is how to get  a sum of (10,00 + 12,00 +28,00 = 50,00) at level 4?
    Thanks in advance.
    With regards,
    Anand

    Does anybody know how to get total at each level.
    I mean, if I have the following structure...
    Level 1
    Level 2
    Level 3
    Level 4
    Level 5
    At level 5 we have the following calculation
    Volume       Price       Amount(From Formula Volume * price)
    5                     2                 10,00
    6                     3                 12,00
    7                     4                  28,00
    I am getting following results : It is adding volume and price then multiplying volume * price and giving results.
    18                  9                18 * 9 = 162,00
    But I have to get sum of  ( 10,00 + 12,00 +28,00 = 50,00) at level 4.
    My question is how to get a sum of (10,00 + 12,00 +28,00 = 50,00) at level 4?
    Thanks.
    With regards,
    Anand

  • How to get event when any library object added to indesign doc?

    I want to do some operation when any library object is added to doc. So please tell me how to get event when any library object is added to the doc. better provide some code snippet.

    Daves61,
    I need to clarify what kind of event you're interested in.
    1. When you click once on page/spead widget in the Pages panel and only widget becomes selected. The layout window remains unchanged. OR
    2. When you doubleclick on page/spread widget the selected master spread appears in the layout window.
    In the first case you work with Pages panel.
    Have a look to file PageTransitionsPanelObserver.cpp from SDK. 
    PageTransitionsPanelObserver::LazyUpdate()
    In the second case you work with Layout window.

  • How to get POF object's field value from query result

    hi,all:
    I want to get field value from the query result, my code is below
    Set setResults = cache.entrySet(createFilter("homeAddress.state = 'MA'"));
    for (Iterator iter = setResults.iterator(); iter.hasNext(); )
    Contact c=(Contact)iter.next();
    System.out.println ("firstame####=" + c.getFirstName());
    * but I get error*
    Exception in thread "main" java.lang.ClassCastException: com.tangosol.util.ConverterCollec
    tions$ConverterEntrySet$ConverterEntry cannot be cast to com.oracle.handson.Contact
    at com.oracle.handson.QueryExample.printResults(QueryExample.java:159)
    at com.oracle.handson.QueryExample.query(QueryExample.java:86)
    at com.oracle.handson.QueryExample.main(QueryExample.java:43)
    who can tell me how to get POF object's field value from query result

    Hi,
    If you look at the Java Doc for the entrySet method here http://download.oracle.com/docs/cd/E15357_01/coh.360/e15725/com/tangosol/util/QueryMap.html#entrySet_com_tangosol_util_Filter_ you will see that it returns a Set of Map.Entry instances so you need to do this...
    Set setResults = cache.entrySet(createFilter("homeAddress.state = 'MA'"));
    for (Iterator iter = setResults.iterator(); iter.hasNext(); )
        Map.Entry entry = iter.next();
        Contact c=(Contact)entry.getValue();
        System.out.println ("firstame####=" + c.getFirstName());
    }JK

  • How to get total numbers and total price in query reports

    Hi,
    how to get total numbers and total price in query reports.for example:
    particular item is issued 3 times a week...I need total quantity of item issued
    my query...
    SELECT T0.[DocNum], T1.[ItemCode], T1.[Quantity], T1.[Price] FROM OIGE T0  INNER JOIN IGE1 T1 ON T0.DocEntry = T1.DocEntry WHERE T1.[ItemCode]  Like '%%[%1]%%'  and  T1.[U_WOType]='[%0]'

    Hi,
    Try this:
    SELECT T1.[ItemCode], SUM (T1.[Quantity]) as [Total Quantity], SUM (T1.[Quantity] * T1.[Price]) as [Total Price] FROM OIGE T0  INNER JOIN IGE1 T1 ON T0.DocEntry = T1.DocEntry WHERE T1.[ItemCode]  Like '%%[%1]%%'  and  T1.[U_WOType]='[%0]'
    Group By T1.[ItemCode]
    Beni.

  • How the get an overview of all existing sapscripts ?

    How the get an overview of all existing sapscripts ?
    does someone know ?
    thanks again : )

    Hi David,
    Go to SE71, and press F4 in the Form name tab.There you can view the various Modules, from where in you can get an overview of the all forms related to the corresponding modules.
    SE71 is the transaction for creating customized forms, viewing and making changes to the standard forms by copying them to Z-forms.
       Hope this is helpful to you. If you need further information, revert back.
    Reward all the helpful answers.
    Regards
    Nagaraj T

  • How to get count and other field in one select

    Hi,
    I am try to get total rows and some fields in two separate select:
    1. select count(id) into totalRows from mytable m where m.cat = 'CSV'
    2. select m.id, m.cat, m.updateTime from mytable m where m.cat = 'CSV'
    (all rows in mytable are distinct base on id field)
    How can I combine them into one query to make it faster so that no need to compare the m.cat field twice?
    Thanks.
    David

    Here's one solution :
    SQL> desc test;
    Name Null? Type
    ID NUMBER
    CAT VARCHAR2(10)
    UPDATE_TIME TIMESTAMP(6)
    SQL> select * from test;
    ID CAT UPDATE_TIME
    1 XYZ 09-JAN-04 09.04.17.000000 AM
    2 CSV 09-JAN-04 09.04.31.000000 AM
    4 ABCD 09-JAN-04 09.04.41.000000 AM
    5 CSV 09-JAN-04 09.04.53.000000 AM
    6 ABC 09-JAN-04 09.05.00.000000 AM
    7 CSV 09-JAN-04 09.05.06.000000 AM
    8 GGG 09-JAN-04 09.05.17.000000 AM
    7 rows selected.
    SQL> select id, cat, update_time
    2 ,Count(*) Over (Order By cat) As TotCnt
    3 from test
    4 Where cat = 'CSV'
    5 /
    ID CAT UPDATE_TIME TOTCNT
    2 CSV 09-JAN-04 09.04.31.000000 AM 3
    5 CSV 09-JAN-04 09.04.53.000000 AM 3
    7 CSV 09-JAN-04 09.05.06.000000 AM 3
    SQL>
    -- Shailender Mehta -

  • How to get change log for fields if change document flag is not maintained?

    Hi experts,
    My requirement is display the change log details for the transaction FAGLGA32.
    In this transaction we have the Field Groups block.if any change is happened for field group we need to capture the change.
    the field for the field group is RKAL1-FGFLG1 and the data element is FGFLG.
    In the data element FGFLG, the flag CHANGE DOCUMENT is not maintained.
    How to get the change log details for the fields for which the change document flag is not maintained at data element level?
    Regards,
    Ramesh

    do a modification for the data element or try Audit Trail (depends on your release)
        Audit Trail (electronic records) / Tx AUT10, AUT01, XX-PROJ-ELR, OSS 564743,517613,564645
            Note 1058984 - FAQ: Audit Trail (Transactions AUT01-AUT10)
            http://help.sap.com/erp2005_ehp_03/helpdata/DE/fc/89683c1b5fb712e10000000a114084/frameset.htm
    cheers
    carsten

  • How to get content of custom fields that were created via the EEWB for CIC?

    Hi
    Can anyone tell me how to get the content of custom fields that were created via the EEWB for CIC? This is required at a time when the data has not been written to the database.
    I would like to know how to read this data in the CRM_APPOINTMENT_MERGE method of CRM_APPOINTMENT_BADI.
    Thanks

    Hi Michael,
    I have a requirement to replicate custom setype data created for CRM sales order to R/3 sales order.These fields have been created at item level.
    Do you know the set of steps to achieve the same.
    Any help would be appreciated.
    Thanks,
    Chamu

Maybe you are looking for

  • Not assigned values in 0ic_c03

    Hello experts. We have the 0ic_c03 cube for movements and values. We've been ckecking the results and so far so good, until we start to use in the drilldown of the reports some characteristics such as "0strge_type" where we get too many results as "n

  • Regarding Creation of Product group

    Hi SAP Guru, I am being Unable to create a product group at new , although I have done it and run at other client.Also Please let me know the Views to select. As per My knowledge I have selected only 05 views , basic, MRP-1,2,3,4.... Need not to sele

  • Unable to install OS X

    After downloading OS Moutain Lion and rebooting. I recieved the following error: OS X Moutain Lion couldn't be installed, because the disk Macintosh HD is damaged and can't be repaired. Unable to restore from external hard drive as a destination disk

  • HT4993 IOS7.0.2, lost all my stuff

    i just updated my iphone4 to IOS7.0.2 and it forced me to reset it to factory defualts and it restored it to a unrecent backup of which had some of my apps and pics, but when the restore was finished all my apps where gone and all my pictures. how ca

  • Sequence settings for mixed 24f,30f

    I shot a friend's wedding on a HVX in 24p on tape (not cards) and a 2nd camera 30fps on a consumer DV camera. I want to edit these together; I do not know what the Sequence settings should be or what challenges are involved. My final output is a DVD.