How to get sum amount (wrbtr) from table BSIS group by gjahr hkont monat

Hello! I am new to this forum, and to ABAP. Hope my question is not obvious.
I want to get sum amount from table BSIS, group by year, period an account. Normally I will try a SQL select like this:
SELECT gjahr monat hkont sum( wrbtr ) as wrbtr INTO CORRESPONDING FIELDS OF TABLE itab FROM BSIS WHERE (itabcond) GROUP BY gjahr monat hkont .
The problem is that the amount in field wrbtr is all positive. The result gets wrong. The debet/credit indicator shkzg determines what is positive/negative. How to solve this in the most efficient way? Should I read all accounting documents into an internal table, and loop through them, changing the sign, and then make some new select, or is there a better way?
Regards Dag-Egil
Message was edited by:
        Dag-Egil Bull Sletholt

Here are the objects in the trace list:
SKB1
USR05
TRDIR
SKA1
SKAT
SKB1
BSIS
PRPS
BSAS
V_LTDX
USR02
RFBLG
V_LTDX
LTDX
RTXTH
RTXTF
RTXTT
TRDIR
The most of this call to this tables returns 1-2 records, apart from BSIS, where it returns 10 records. This is the same as accounting documents in the transaction FBL3N. When i try this again with more records returned I still have no call to table GLT0.

Similar Messages

  • In badi ME_PROCESS_PO_CUST how to get preivious row value from table ctrl?

    hi Friends,
    I am Using ME_PROCESS_PO_CUST badi for validation in Purchase oreder (ME21N),
    For that I implementaed PROCESS_ITEM method which fires during each row now i want to add another validation in same implimentation for that i need privious row's value so how to get that value ?
    following is my current validation code. 
    method IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM.
      DATA:ls_poitem TYPE mepoitem.
      DATA:ls_poheader TYPE MEPOHEADER.
      DATA:lm_poheader TYPE ref to IF_PURCHASE_ORDER_MM.
      DATA:w_mara TYPE mara.
      DATA:IT_ZMMTBL039 TYPE STANDARD TABLE OF ZMMTBL039 ,
           WA_ZMMTBL039 TYPE ZMMTBL039 .
      DATA:ls_poitem1 TYPE mepoitem.
      DATA:V_KUNNR1 TYPE KNA1-KUNNR.
      DATA:V_KUNNR2 TYPE KNA1-KUNNR.
      ls_poitem = im_item->get_data( ).
      lm_poheader = im_item->GET_HEADER( ).
      ls_poheader = lm_poheader->GET_DATA( ).
      CLEAR: WA_ZMMTBL039,w_mara.
      REFRESH:IT_ZMMTBL039[] .
      SELECT *
        INTO  TABLE  IT_ZMMTBL039
        FROM ZMMTBL039
       WHERE bsart EQ ls_poheader-bsart.
      IF sy-subrc EQ 0.
        CLEAR: WA_ZMMTBL039,w_mara.
        SELECT SINGLE *
          INTO w_mara
          FROM mara
         WHERE matnr EQ ls_poitem-MATNR.
        IF SY-SUBRC EQ 0.
          READ TABLE IT_ZMMTBL039 INTO WA_ZMMTBL039 WITH KEY  bsart = ls_poheader-bsart
                                                              mtart = w_mara-mtart
                                                              spart = w_mara-spart.

    Hello
    If you had searched the SDN forums you would have found plenty of answers to your question.
    Following is some sample coding:
    method IF_EX_ME_PROCESS_PO_CUST~POST.
    DATA:
        ls_header TYPE mepoheader,
      lt_items   TYPE purchase_order_items,
      ls_item   TYPE purchase_order_item,
      ls_item TYPE mepoitem.
      ls_header = im_header->get_data( ).
      lt_items = im_header->get_items( ).
      LOOP AT items INTO ls_item.
        ls_item = line_item-item->getdata( ).
        " process item data...
      ENDLOOP.
    ENDMETHOD.
    Regards,
      Uwe
    PS: Do not use such kind of pseudonyms instead of your real name. Because my impression is that a nobody (in term of ABAP development competence) tries to claim to be a somebody who fills his knowledge gaps via SDN. Using pseudonyms significantly decreases your changes to get any answers at the SDN forums.

  • How to get selected/focused cell from table, and action on clicked

    Hello Web Dynpro Community!
    i have a view with a table, (id "Table_0");
    table is 3x3 size, as celleditors i used inputfields; (standard binding to context with string atributes)
    below table i have textarea.
    when i select any cell in table i want to add that cell coords to textarea (col and row)
    i know that i should use onLeadSelect action, but i dont know exacly how. or to be precise.. how to access to ID and row variables in that action.
    the other problem is.. that onLeadSelect seems to work only when i change lead not the cell in same row.. so prabobly there is better way to do that..
    any ideas?
    Looking to hear from You.
    EDIT:
    Now i have following problem:
    i have a table 3x3 with one column as dropdownbykey box and 2 as TableSingleMarkableCell (and inputFields As editors).
    it works as i wanted:
    so when i click on one of those input cells, insert vale AND click enter then the action onEnter( for inputfield) is fired... i can get the coords of that cell..
    problem is.. that i want to get the coords before i click enter.. just when i click in cell.
    i tried to use onAction event for column.. but it doesnt work for TableSingleMArkableCells (but it works for ddk column correctly).
    so there is any way to do that?
    ie:
    below table i have inputfield (called  value).
    when i click on cell (and DO NOT press enter) i want to see the cell value in inputfield value.
    future (and target need) is that i need to show some additional text for specific Cell. (i have an Object with 2 strings attributes, one i want to show in cell, and one in inputfield when cell is clicked).
    M.
    Edited by: Michal Rowinski on Jan 16, 2008 9:51 AM

    You can use cell variant  for your requirement . Go through the below link
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c0310fd2-f40d-2a10-b288-bcbe0810a961
    Regards,
    Nethaji

  • How to get current row value from table when press the submit button

    Hi,
    I want to get the current row value of SuccessionPlanId which is one of the column in a advanced table.
    I created one button (created using personalization, action fired thru CO)in the table as column, so each row having one button, if i press the first row's button means then i want to fetch the first row's SuccessionPlanId and if it is 3rd means then i want to get the value of third row's value.
    How to do it in controller extension?
    Please reply soon, its urgent.
    Thanks in advance,
    SAN

    Pratap,
    Yes, I tried with 'delete' button which is seeded one.
    For this, our code using row reference is working too fine. it throws exact SuccessionPlanId value of corresponding row.
    I created MessageStyledText, but here i need to give text value right, then only it 'll appear in the page.
    Instead i created one image and fired explicitly from the controller processRequest method.
    But the same problem remains..
    here my code:
    public void processRequest(OAPageContext pageContext, OAWebBean webBean){
    super.processRequest(pageContext, webBean);
    OAButtonBean oabb = (OAButtonBean)webBean.findChildRecursive("XXSubmit");
    FireAction action = new FireAction("XXSubmit");
    oabb.setAttributeValue(UIConstants.PRIMARY_CLIENT_ACTION_ATTR, action);
    OAImageBean oaib=(OAImageBean)webBean.findChildRecursive("XXSubmitImage");
    oaib.setFireActionForSubmit("XXSubmitImage", null, null, true);
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean){
    if("XXSubmitImage".equals(pageContext.getParameter("event"))){
    String succIdI="";
    String rowRefI = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
    if(rowRefI != null && !("".equalsIgnoreCase(rowRefI ))){
    PerSuccPlanSearchVORowImpl rowI = (PerSuccPlanSearchVORowImpl)oaam.findRowByRef(rowRefI);
    if(rowI != null)
    succIdI=rowI.getAttribute("SuccessionPlanId").toString();
    }else{
    throw new OAException("Row is null");
    throw new OAException(succIdI, OAException.INFORMATION);
    }else{
    super.processFormRequest(pageContext, webBean);
    If i run the page using this controller, it throws exception without any value, because for 'succIdI' i initialized without any string.
    Can you please suggest me how to solve?

  • How to get values against checkbox from table

    hi all,
    how can i get column values from database against multiple check boxes,
    is there array in oracle to store multiple values?
    i stored value of check boxes in column named checkid, in table named information.
    now i want to get value of infoid against these chekid column where checkid=1 from this table and want to store infoid against it in another table named handing,
    i want to do like this
    -----Table handing-------
    HID value1 value2
    1 abc xyz
    1 abc xyz
    1 abc xyz
    2 ccc ddd
    3 bbb aaa
    3 bbb aaa
    i wrote code
         DECLARE
         var_id number;
    CURSOR my_cur is
    select infoid from information
    where CHECKID = 1;
         BEGIN
         open my_cur;
         fetch my_cur into var_id;
         CLOSE my_CUR;
         insert into handing
              (hID,
              value1,
              value2)
         values
              (var_id,
              :handing.value1,
              :handing.value2);
    COMMIT;
         SAVED_ALERT;
    end;
    but i know that var_id data type is number it must be array, this codd does not works what should i do? should i use loop but how??? please help me.
    regars

    Hello Wreesha,
    you can enhance your chance to get an answer in several ways.
    - Use {noformat}{noformat} Tags around your code examples to make them more readable and to preserve white space
    - Provide CREATE and INSERTS for sample data (We still don't know how your information table looks like and what date it has)
    - The expected result (also formatted)
    - Don't use words like "immediate" or "asap". We don't get paid for answering questions.
    Regards
    Marcus                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to get Cube Request Reportability From Tables?

    Hello,
    What table contains the reportability status on a request in a cube?  I want to know this so I can programitically figure out what cubes are reportable and which are not, thanks!

    Hope RSODSACTREQ will give you the loaded request and reporting availability information.
    Thanks,
    Arun

  • How to get second maximum salary from employee table(sql query)

    how to get second maximum salary from employee table(sql query)

    dude there is no matter of structure .........that user already said its from employee table ...............its basic table in sql and there is no need to specify the table structure
    .........i think u got my point I think you are the one who didn't understand Sarma's point.
    Give a man a fish and you feed him once. Teach a man how to fish and you feed him a life long.
    >
    and the query is
    select max(sal) from emp where sal<(select max(sal)
    from emp);
    this will give the 2nd max salary from the emp tableBtw: You solution is bad, because it needs to scan and sort the table emp twice. And a better solution has been given already.
    Message was edited by:
    Sven W. - reordered statements

  • How to get  Unapplied Amount with SQL or API in AR/ORACLE RECEIVABLES

    Hi ,
    how to get Unapplied Amount with SQL or API in AR/ORACLE RECEIVABLES.
    who can help me ? Thank you very much !

    i get it from private API.
    SELECT SUM(decode(ra.status, 'UNAPP', nvl(ra.amount_applied, 0), 0)) unapplied_amount
    FROM ar_receivable_applications ra
    WHERE ra.cash_receipt_id = 1820
    AND ra.status IN ('UNAPP', 'ACTIVITY')

  • How to get sum for each currency's in ALV Report

    Hi,
    A column has amounts with various currency's.
    May I know how to get sum quantity for each currency in ALV Report?
    Thanks in advance.

    Hi,
    Currency value column should have reference to currency code column.
    Regards,
    Wojciech

  • How to get payment document number from paid column in monthly invoice

    Dear experts
    I use SBO japan version and i need to know how to get payment document number from paid column in monthly invoice ?
    in table MIN1, only contain invoice and credit note document number, there is no payment document number
    thank you for your help
    Best Regards
    JeiMing

    Dear Gordon
    Yeah, you are right, i can use field MIentry in RCT2
    thank you
    Best regards
    jeiming

  • How to get 2 maximum salary from salary field?

    how to get 2 maximum salary from salary field data?
    like 1000
           5000
            8600
              2000
              3000
    u want 8600 in ist place and 5000 in second place ?
    cud u plz suggest me any query?

    Hi,
    If already data is in internal table then
    DATA : v_cnt TYPE i.
    SORT ITAB BY salary DESCENDING.
    LOOP AT ITAB.
       v_cnt = v_cnt + 1.
      IF v_cnt > 2.  
          EXIT.
      ENDIF.
    MOVE : itab-salary  to ITAB1.
    ENDLOOP.
    if you want extract data from database table then slect the data inot internal table and do like above.
    Pls. reward if useful...

  • How to get Accounting document number from billing document number

    Hi,
    How to get Accounting document number from billing document number i.e. from VBAK- VBELN.
    Cheta Pant

    Hi,
    VBAK is the Sale Order header table, Billing document table is VBRK.
    Sales tables (VBAK,VBAP,VBRP,VBRK) do not store accounting document numbers.
    You do other way around. Just go to SE16 and enter the Billing document number in field Billing document VBELN in BSEG or BSID or BSAD table and execute, you will find the accounting document number.
    If you just want collect this information once then you can use table BSEG, but if you think to develope a report then use table BSID and BSAD.
    Regards,
    Chintan Joshi

  • How to find max(time) from table using group by

    how to find max(time) from table using group by
    select var max(time)
              from table
              into (var1, time1)
               where .....
                 group by var.
    it is fetching record which is top in table.
    if u can help?
    regards.

    No this will fetch the maximum time from teh table.
    select var max(time)
    from table xxxx
    into (var1, time1)
    where .....
    group by var.
    Refer this code
    TABLES SBOOK.
    DATA:  COUNT TYPE I, SUM TYPE P DECIMALS 2, AVG TYPE F.
    DATA:  CONNID LIKE SBOOK-CONNID.
    SELECT CONNID COUNT( * ) SUM( LUGGWEIGHT ) AVG( LUGGWEIGHT )
           INTO (CONNID, COUNT, SUM, AVG)
           FROM SBOOK
           WHERE
             CARRID   = 'LH '      AND
             FLDATE   = '19950228'
           GROUP BY CONNID.
      WRITE: / CONNID, COUNT, SUM, AVG.
    ENDSELECT.

  • How to get all the values from the dropdown menu

    How to get all the values from the dropdown menu
    I need to be able to extract all values from the dropdown menu; I know how to get all those values as a string, but I need to be able to access each item; (the value in a dropdown menu will change dynamically)
    How do I get number of item is selection dropdown?
    How do I extract a ?name? for each value, one by one?
    How do I change a selection by referring to particular index of the item in a dropdown menu?
    Here is the Path to dropdown menu that I'm trying to access (form contains number of similar dropdowns)
    RSWApp.om.GetElementByPath "window(index=0).form(id=""aspnetForm"" | action=""advancedsearch.aspx"" | index=0).formelement[SELECT](name=""ctl00$MainContent$hardwareBrand"" | id=""ctl00_MainContent_hardwareBrand"" | index=16)", element
    Message was edited by: testtest

    The findElement method allows various attributes to be used to search. Take the following two examples for the element below:
    <Select Name=ProdType ID=testProd>
    </Select>
    I can find the element based on its name or any other attribute, I just need to specify what I am looking for. To find it by name I would do the following:
    Set x = RSWApp.om.FindElement("ProdType","SELECT","Name")
    If I want to search by id I could do the following:
    Set x = RSWApp.om.FindElement("testProd","SELECT","ID")
    Usually you will use whatever is available. Since the select element has no name or ID on the Empirix home page, I used the onChange attribute. You can use any attribute as long as you specify which one you are using (last argument in these examples)
    You can use the FindElement to grab links, text boxes, etc.
    The next example grabs from a link on a page
    Home
    Set x = RSWApp.om.FindElement("Home","A","innerText")
    I hope this helps clear it up.

  • How to get the return values from a web page

    Hi all :
       how to get the return values from a web page ?  I mean how pass values betwen webflow and web page ?
    thank you very much
    Edited by: jingying Sony on Apr 15, 2010 6:15 AM
    Edited by: jingying Sony on Apr 15, 2010 6:18 AM

    Hi,
    What kind of web page do you have? Do you have possibility to for example make RFCs? Then you could trigger events (with parameters that could "return" the values) and the workflow could react to those events. For example your task can have terminating events.
    Regards,
    Karri

Maybe you are looking for

  • [solved] Wrong display of fonts (all square boxes now)

    Hi! I tried Infinality  (https://wiki.archlinux.org/index.php/Fo - Infinality) for font-hinting a few days / weeks ago. Everything worked fine until I recently did - like every day - a pacman -Syu since that update my Fonts are all Squares now. Only

  • Issues while migrating data from a disk based table to a memory optimized table

    Hi All, I have a Disk based table with 400000000 rows in it, We are trying to convert it into a memory optimized table. We have  already created a memory optimized table with similar structure and trying to import data into this mem optimized table u

  • Solution to fix error message when accessing 'Maintenance Tasks' (Toolbox) or ink levels.

    If you come across the similar error message after you upgrade the firmware for following printers, please follow the resolution below to fix it. HP Officejet Pro 8600 e-All-in-One series HP Officejet Pro 8100 ePrinter HP Officejet 6700 Premium e-All

  • Uniflow deployment returns 0x800704ec

    We're trying to deploy a uniflow printqueue (It's configured with a NUL; port), but doing so with a GPO (shared printer) returns: Group Policy object did not apply because it failed with error code 0x800704ec. This program is blocked by group policy.

  • Move Skype Message To Right Side Of Call

    Ever since the update where the message box was on the right side of the call, I got used to it, and now that it's suddenly moved back to the bottom it looks horrendous and honestly wastes space... Is there any way to move it back to the right side o