Help in doing sum fields from tables

HALLOW
i have a table and i wont to add the tables line to one line , to do sum
if date appear more then one time like in example.
i give example
date----
hours
01.01.2002 6.5
01.01.2002 2.5
02.01.2002 5
03.01.2002 3
03.01.2002 3
04.01.2002 4
06.01.2002 5
i wont to move it to table like this
date----
hours
01.01.2002 9 ->sum houres of date 01.01.2002
02.01.2002
03.01.2002 6 ->sum houres of date 03.01.2002
04.01.2002 4
06.01.2002 5
Regards
i reward

You can get same functionality if you use Internal table events .
See the simple example :
*& Report  ZTEST_IEVENTS
REPORT  ZTEST_IEVENTS no standard page heading
                      line-count 40(2).
tables : vbap.
data : begin of i_vbap occurs 0,
       vbeln like vbap-vbeln,
       posnr like vbap-posnr,
       matnr like vbap-matnr,
       kwmeng like vbap-kwmeng,
       netpr like vbap-netpr,
       end of i_vbap.
data wa_vbap like line of  i_vbap.
data v_flag type c.
select-options s_vbeln for vbap-vbeln obligatory.
start-of-selection.
select vbeln
       posnr
       matnr
       kwmeng
       netpr from vbap
       into table i_vbap
       where vbeln in s_vbeln.
sort i_vbap by vbeln posnr.
end-of-selection.
loop at i_vbap.
move i_vbap to wa_vbap.
at first.
write:/2 'Order #',15 'Item #',28 'Material #',50 'Qty', 70 'Net value'.
skip 1.
endat.
at new vbeln.
write:/2 wa_vbap-vbeln,15 wa_vbap-posnr,28 wa_vbap-matnr,
        47 wa_vbap-kwmeng,65 wa_vbap-netpr.
v_flag = 'X'.
endat.
if v_flag ne 'X'.
write:/15 wa_vbap-posnr,28 wa_vbap-matnr,
        47 wa_vbap-kwmeng,65 wa_vbap-netpr.
endif.
at end of vbeln.
sum.
skip 1.
write:/5 'Sub totals', 47 i_vbap-kwmeng,65 i_vbap-netpr.
skip 1.
endat.
at last .
skip 1.
sum.
write:/5 'Grand Totals',47 i_vbap-kwmeng,65 i_vbap-netpr.
skip 1.
write:/ 'end of page', 'Footer'.
endat.
clear v_flag.
endloop.
Good luck
Thanks
Seshu

Similar Messages

  • How to hide a field from table maintenance view?

    Hi,
    How to hide a field from table maintenance view? 
    The field is used for data created date. I need to hide it from display.
    Thanks

    Chk this link.
    http://help.sap.com/saphelp_nw04/helpdata/en/66/33f52010dd11d6999300508b5d5211/frameset.htm
    Maintenance Attributes
    You can assign a maintenance attribute P to individual fields in the maintenance view definition in the Dictionary (SE11). It can be  H (hidden)
    H (hidden)
    A field flagged H is not displayed on the screen. This field must also be filled in the background by a routine at an event.
    The system writes R and H fields to the database like all other fields when a new data record is saved.

  • Update PRODH field from table T179T

    hi,
    i want to update PRODH field from table T179T into table VBRP. for this we
    need to take selection option also.
    selection option will be :
    ·             Sales Organization (field VBRK-VKORG)
    ·       Billing Date Range (VBRK-FKDAT)
    ·       Distribution Channel (Vbrk-vtweg
    while i have done this for one field by using hard code but like:
    TABLES: VBRP.
    CLEAR VBRP.
    UPDATE VBRP SET PRODH = 'PLC01' WHERE VBELN = '0008300051'.
    SELECT SINGLE * FROM VBRP WHERE VBELN = '0008300051'.
    WRITE: VBRP-VBELN,VBRP-PRODH.
    but this is not the right way. please guide me how to solve this.

    TABLES: VBRP.
    CLEAR VBRP.
    UPDATE VBRP SET PRODH = 'PLC01' WHERE VBELN = '0008300051'.
    <b>commit work.</b>
    SELECT SINGLE * FROM VBRP WHERE VBELN = '0008300051'.
    WRITE: VBRP-VBELN,VBRP-PRODH.
    use commit work after update statement.
    But this code would make vbrp-vbeln as plc01 only.
    If you want to get the prodh value from t179t, then write a sleect on t179t and then update.
    TABLES: VBRP.
    CLEAR VBRP.
    select single prodh
      from t179t
    where......
    UPDATE VBRP SET PRODH = t179-prodh WHERE VBELN = '0008300051'.
    commit work.
    SELECT SINGLE * FROM VBRP WHERE VBELN = '0008300051'.
    WRITE: VBRP-VBELN,VBRP-PRODH.

  • Add Fields from table ADRC (Fields Name 1 to 4) for Open Item Processing

    Hi SAP Expert:
    Our client requires vendor/customer name to be displayed in the open item processing line layout for transaction code f-58, so they can double check if the vendor name is complete as intended. 
    We intend to add fields from table ADRC instead of REGUH since the characters in maintaining vendor/customer name is 40 characters and REGUH - ZNME1s are only 35 characters. 
    We have managed to add fields from ADRC and change the SAPDF05X program and were able to display the names in open item layout, except that the program seems to "automatically" create a generic table which only carries 30 characters of the vendor/customer name.  The source table should be RFOPS_DK but the program automatically looks up from table RFOPS_GEN for the particular fields - Name 1 to 4.  Is there a way to "instruct" the program to use RFOPS_DK instead of RFOPS_GEN?
    Hope this will merit somebody's attention... Thanks !!!

    Thanks,  i have assigned the layout via o7v3,  it is the program that i have a problem with,  actually another program that we change is the program MF05BFPO where it generates data to be displayed in the FBZ4 screen,  though we add a field with 40 characters (ADRC Name 1 to 4)  what the program dispalys is a 30 character Name1 to 4 from structure RFOPS_GEN. 
    My question is can i extend/change the structure RFOP_GEN to 40 characters,  is there any SAP standard program that will aftected if i do so?  thank very much...
    Lorena

  • Remove fields from table key

    I define a customize table (maintenance only by cust., not SAP import).
    5 of the fields are the table keys.
    When I remove 2 fields from the key and adjust the table I get the following errors
    “Primary key change not permitted for value table ZT7IL60”
    “Activation of Table ZT7IL60 not possible (please check)”
    Any clue why and how to remove some fields from the key?

    hi there,
    the reason for  this error can be any....
    may be you are using that field in the foreign key reference of another table. thats y it is not allowing the change option as it will affect other table's values.
    another thing can be the one suggested in the above post.
    do reply if any of the methods mentioned helps.
    Do reward if helpful./

  • How to add a search help on a screen field from screen painter

    Hi,
    I would like to add an existing Search Help on a screen field in Screen painter.
    Of course it's possible to just click on th screen field and in the property box, I just have to set the name of teh search help.
    The problem is that I need the screen field to be grey and user musn't be able to change the field value if he doens't use the search help.
    I'm not allowed to modify the existing search help or to built it on my own from source code, I must use the existing one.
    Do you have an idea on how to do so?
    Regards,
    Morgan

    Dropdown Box:
    In the screen painter for that field goto properties -> Dropdown ->select listbox.
    Option 1:
    Instead let that field be in change mode and if user enters any wrong entry which is not there in the table give a error messgae.
      CHAIN.
        FIELD addr1_data-country.
        MODULE modify_screenfields1.
      ENDCHAIN.
    MODULE modify_screenfields1 INPUT.
      CASE sy-ucomm.
        WHEN 'ENTER' OR 'EXECUTE'.
          IF NOT addr1_data-country IS INITIAL.
            SELECT SINGLE landx FROM t005t INTO lws_landx WHERE
                                          land1 = addr1_data-country
                                      AND spras = 'EN'.
            IF sy-subrc <> 0.
              MESSAGE e000(zo_spa) WITH text-022.  " Invalid Country code
            ELSE.
              t005t-landx = lws_landx.
            ENDIF.
          ELSE.
            CLEAR: t005t-landx.
          ENDIF.
       ENDCASE.
    ENDMODULE.                 " modify_screenfields1  INPUT
    Option 2: Other than if u want the way u like, let that field be greyed out. don't attach the search help.
    In the PROCESS ON VALUE-REQUEST.
      FIELD addr1_data-region MODULE region_pov.
    MODULE region_pov INPUT.
    Using the F4IF_INT_TABLE_VALUE_REQUEST table value request show the search help.
    also make that field input enabled.
    ENDMODULE.                 " region_pov  INPUT
    I think this will solve ur problem.
    Regards,
    Prakash.
    Message was edited by: Prakash Ramu

  • Select fields from Table PA0001 where condition in PA0000 EQ X.

    I'm quite new here at SDN an to ABAP as my code below will show.  =)
    I have two tables PA0001 and PA0000 and I want to show the PERNR from Table PA0001 WHERE PA0000-stat2 EQ '3'.
    SELECT PERNR STAT2 FROM pa0000 INTO CORRESPONDING FIELDS OF TABLE it_act WHERE stat2 EQ '3'.    "this works fine
    SELECT * FROM pa0001 INTO TABLE it_pos.
    LOOP AT it_pos INTO wa_pos WHERE It_pos-pernr EQ it_act-pernr.                
    WRITE......
    ENDLOOP.
    Isn't it possible to put the conditions in the LOOP statement? Should i somehow do i join in the select instead?
    If you dont understand what I mean just ask and I will try to explain.
    Best Regards Claes.

    Hi Claes Widestadh ,
    I have total Code for you, to solve your Problem, I have written the code for you & tested it, and it was Working Very Fine.
    Please find the Below Code.
    TABLES : PA0000, PA0001.
    DATA : IT_PA0000 LIKE PA0000 OCCURS 0 WITH HEADER LINE,
           IT_PA0001 LIKE PA0001 OCCURS 0 WITH HEADER LINE.
    DATA : BEGIN OF IT_FINAL OCCURS 0,
           PERNR LIKE PA0001-PERNR,
           END OF IT_FINAL.
    SELECT PERNR STAT2 INTO CORRESPONDING FIELDS OF TABLE IT_PA0000 FROM
    PA0000 WHERE STAT2 = '3'.
    SELECT * FROM PA0001 INTO TABLE IT_PA0001.
    SORT IT_PA0001.
    LOOP AT IT_PA0000.
      READ TABLE IT_PA0001 WITH KEY PERNR = IT_PA0000-PERNR.
      IF SY-SUBRC = 0.
        IT_FINAL-PERNR = IT_PA0001-PERNR.
        APPEND IT_FINAL.
        CLEAR IT_FINAL.
      ENDIF.
    ENDLOOP.
    LOOP AT IT_FINAL.
      WRITE :/ IT_FINAL.
    ENDLOOP.
    Note: If you find this Answer is very Helpful Please allot me the Points.
    Please do let me know any isssues at your end.
    Thanks,
    Satya Krishna.M

  • Problem in selecting object currency fields from table COSP and COSS

    Dear All,
    We are facing a issue while creating a virtual DataSource   for CCA plan from tables COSS and COSP.
    The issue is that we are able to activate the view by including the fields value in object currency ( WOG001 - WOG012 ) but not able  to create a DataSource   on the view.
    We are able to include the transaction currency value but as our application requires us to include the object currency fields.
    Error displayed:Invalid extract structure template .This operation failed, because the template structure quantity fields or currency fields, for example, field WOG001 refer to a different table.
    Any tips to resolve this issue would be valuable.
    Thanks in advance
    Rashmi Nair.

    HI,
    Can you see this thread.
    Re: How to display BAPI decimal values into webdynpro!
    Thanks
    nageswar

  • Exclude GUID field from tables in tdms transfer.

    Hi,
    We have been asked chek whether it is possible to exclude GUID fileds from tables in TDMS ERP data transfer.
    We ran data replication from ECC to CRM in out pre-prod system, replication populated the CRM GUIDs in ECC. We are going to use pre-prod as sender system for TDMS transfer. GUID field is part of the corresponding object table so the receiver system tables also populated with GUID. What we don't know is how replication behaves when the GUIDs are already populated.
    As I know there is a way to set the GUID filed to NULL value in tdms transfer using scrambling rule. The only concern I am having is how this could affect the ISU data in other tables.
    Please share your opinions on this.
    Thanks
    Praveen.

    The "GUID fields" are used to normalize the data and is the key fields for all CRM applications. If you don't transfer those the system will be "empty" because data relations cannot be found.
    Markus

  • HELP TO MOVING FIELDS FROM TABLES

    HI EXPERTS,
    i have two tables and i wont to move fields of  price to table ZEMPKOSTLPRICE_REC where dates are match.
    <b>I REWARD KINDLY</b>
    i give example
    table
    <b>INTAB_A132[]</b>
    resrc                         datbi                            datab                       price
    0000010599               <b>20081231      20080401</b>     15000.00
    0130130130     <b>20081031      20080301</b>     84000.00
    0130130130     <b>20081231      20081101</b>     0.01
    table
    <b>ZEMPKOSTLPRICE_REC</b>
    i wont like that
    reserc                       period         price        date
    0000010599     042008     15000.00     20080401
    0000010599     052008     15000.00     20080501
    0000010599     062008     15000.00     20080601
    0000010599     072008     15000.00     20080701
    0000010599     082008     15000.00     20080801
    0000010599     092008     15000.00     20080901
    0000010599     102008     15000.00     20081001
    0000010599     112008     15000.00     20081101
    0000010599     122008     15000.00     20081201
    0130130130     032008     84000.00     20080301
    0130130130     042008     84000.00     20080401
    0130130130     052008     84000.00     20080501
    0130130130     062008     84000.00     20080601
    0130130130     072008     84000.00     20080701
    0130130130     082008     84000.00     20080801
    0130130130     092008     84000.00     20080901
    0130130130     102008     84000.00     20081001
    0130130130     112008     0.01     20081101
    0130130130     122008     0.01     20081201
    this is my code
    DESCRIBE TABLE intab_a132 LINES a_index.
            IF a_index GE 1.
              DO a_index TIMES.
                LOOP AT  zempkostlprice_rec INTO wa_zem.
                  READ TABLE intab_a132 INTO wa_intab_a132 INDEX a_index  .
                  IF wa_intab_a132-datab GE wa_zem-date.
                    IF  wa_zem-kbetr IS INITIAL AND wa_zem-konwa IS INITIAL
                    AND wa_zem-kostl IS INITIAL .
                      MOVE: wa_intab_a132-kostl TO wa_zem-kostl,
                            wa_intab_a132-kbetr TO wa_zem-kbetr,
                            wa_intab_a132-konwa TO wa_zem-konwa.
    MODIFY zempkostlprice_rec FROM wa_zem TRANSPORTING kbetr konwa kostl
                WHERE resrc = wa_intab_a132-resrc AND date GE wa_intab_a132-datab.
                      CLEAR:wa_zem,wa_intab_a132.
                    ENDIF.
                  ENDIF.
                ENDLOOP.
                a_index = a_index - 1.
              ENDDO.
            ENDIF.
    i try with this code but i get 84.0000 insred 0.01 in month 11 and 12 in 2008
    0000010599     042008     15000.00     20080401
    0000010599     052008     15000.00     20080501
    0000010599     062008     15000.00     20080601
    0000010599     072008     15000.00     20080701
    0000010599     082008     15000.00     20080801
    0000010599     092008     15000.00     20080901
    0000010599     102008     15000.00     20081001
    0000010599     112008     15000.00     20081101
    0000010599     122008     15000.00     20081201
    0130130130     032008     84000.00     20080301
    0130130130     042008     84000.00     20080401
    0130130130     052008     84000.00     20080501
    0130130130     062008     84000.00     20080601
    0130130130     072008     84000.00     20080701
    0130130130     082008     84000.00     20080801
    0130130130     092008     84000.00     20080901
    0130130130     102008     84000.00     20081001
    <b>0130130130     112008     84000.00     20081101<---- insted  0.01
    0130130130     122008     84000.00     20081201</b>
    REGARDS

    hi varma
    thankes for your answer
    i try your code exactly and what i get is that
    0000010599     042008     15000.00     20080401
    0000010599     052008     0.00     20080501
    0000010599     062008     0.00     20080601
    0000010599     072008     0.00     20080701
    0000010599     082008     0.00     20080801
    0000010599     092008     0.00     20080901
    0000010599     102008     0.00     20081001
    0000010599     112008     0.00     20081101
    0000010599     122008     0.00     20081201
    0130130130     032008     84000.00     20080301
    0130130130     042008     0.00     20080401
    0130130130     052008     0.00     20080501
    0130130130     062008     0.00     20080601
    0130130130     072008     0.00     20080701
    0130130130     082008     0.00     20080801
    0130130130     092008     0.00     20080901
    0130130130     102008     0.00     20081001
    0130130130     112008     0.00     20081101
    0130130130     122008     0.00     20081201
    regards

  • How to prvide f4 help  for the particular field in table control

    hi all,
    my requirement is iam having one i/p field in screen 100.name of the field is sales order number. i just want to keep f4 help for this field only.when i click F4 on this field it has to show all the sales order numbers from vbak table.
    anybody can send me the code please.
    thanks,
    maheedhar.t

    Hi,
       In POV Modlue u write
       Filed (ur field name ) module get_values.
    In that get_values module u declare an itab according to ur requirement and get the values into internal table using select query .After u get the values in select query u call a function popup_with_table_display in which u pass the itab along with the starting and postion , width and height of the popup window .Hope this will help u
    Regards,
    Shafi

  • Onblur get values for form field from table.

    Hello,
    I created one from with report for TableA.TableA has 5 column. Now after i enter first field ,on blur, i want 2 other fields should get populated.They should get the 2 values from TableB.Table A and Table B are connected through primary key foreigh key constraint.First field is primary key of TableA.
    How can i do this.I am writing a javascript function which i am calling from first form field.
    But in the function how to take values from the table for the other 2 fields.
    Can i just Select statements inside javascript function?
    Thanks
    Swapna.T

    Swapna,
    You can do this using AJAX. See link.
    Hope it helps
    Cheers,
    Hari

  • How to select max (field) and one more field from table?

    Hi experts!
    I need to select maximum value of ENDDA from PA0023 and BRANC of max ENDDA.
    How can I do that ?
    When I trying this code:
    This is the  code:
    SELECT MAX( endda ) branc
      FROM pa0023
      INTO (pa0023-endda, pa0023-branc).
    I get error message:
    The field "PA0023~BRANC" from the SELECT list is missing
    in the GROUP BY clause. Addition INTO wa or INTO (g1,...,gn)  is required.
    So what is the problem?
    Thanks forehead.

    Hi
    Though am not totally sure of your requirement, check below code samples without any syntax errors:
    1. As per you current coding:
    TABLES: pa0023.
    SELECT MAX( endda ) branc
           FROM pa0023
           INTO (pa0023-endda, pa0023-branc)
           GROUP BY branc.
    ENDSELECT.
    2. Above code results only on one record where as the criteria can be more than one. Eg: for a specific data more than one record can exist. Below code helps you handle the same:
    TABLES: pa0023.
    TYPES: BEGIN OF t_pa0023,
             endda TYPE endda,
             branc TYPE brsch,
           END OF t_pa0023.
    DATA: i_pa0023 TYPE TABLE OF t_pa0023,
          wa_pa0023 TYPE t_pa0023.
    SELECT MAX( endda ) branc
           FROM pa0023
           INTO TABLE i_pa0023
           GROUP BY branc.
    LOOP AT i_pa0023 INTO wa_pa0023.
    ENDLOOP.
    3. If the requirement is to get the Industry Key for the record with highest End Date. We can acheive it by using subquery something like:
    TABLES: pa0023.
    SELECT SINGLE endda branc
           FROM pa0023
           INTO (pa0023-endda, pa0023-branc)
           WHERE endda = ( SELECT MAX( endda ) FROM pa0023 ).
    Kind Regards
    Eswar

  • Not able to use fields from tables

    Hello,
    I have recently got Crystal Reports 2008, created an ODBC connection with our Progress database. I can see all tables, but when selecting, only a few would actually be usable - in the sense that even if I see the fields, I cannot use them in report design. When selecting a table in database Expert, it shows an icon only without the table name.
    I have tested the ODBC by successfully opening all tables in Excel. there are no restrictions on the tables
    I believe it might be some setting in Crystal. Can you help?
    Thank you.

    Hi,
    Sorry for the delay...
    I am using version 2008, database is an ODBC connection with a Progress database (called ASI).
    I am not sure about the driver.
    Ovi

  • Selecting text field from table ignoring capitalization

    Hi,
    i'm doing a read on a table using select.....where text in s_text . if i want to ignore the capitalization; how to perform the read.
    for eg : if the text is saved as 'Name' and in my select criteria if i specify the selection text as 'name' it should pick up even if 'N' is not in CAPS in DB.
    Thanks,
    GV.

    Hi,
    The Function Module, STRING_UPPER_LOWER_CASE will convert your string to lower case except the first letter
    So if user input as name, after passing it to FM you will get the value as 'Name' and then you can able to check your condition
    May this will help you
    Rani

Maybe you are looking for

  • Reteiving Accounting Document number  by passing the reference key

    Hi All, I have the reference key (bkpf-awkey), fiscal year(gjahr) and bukrs and I need to retreive the Accounting doc number(Belnr). Right now, I am writing a select statement to retreive belnr from bkpf  and passing bukrs, gjahr and awkey in the whe

  • ALV Report in background

    Hi All,          I have developed a zreport using reuse_alv_list_display. But due to performance reasons as it is fetching data from BSEG table, is very slow. So it is decided that this report will be executed in back ground. But after executing in b

  • ISight only working with a few people.

    ok. this problem is a little hard to explain....my iSight video chat occationally works with some people...and then sometimes it doesnt work. then there is this one person where video chat ALWAYS works. Then there are people that NEVER work on my isi

  • After I enter passcode, Iphone opens inside an App?

    I recently had to return my iphone because the battery was expanded inside and causing the LCD display to become distorted. With my new Refurbished iphone I enter the passcode to enter my iphone and often times the screen that greets me is an actual

  • Where to get JSDK Latest Version

    I'm a beginner in Servlet, can you please tell me where to get this JSKD in order to start the webserver.