Calculated field in classic report

I am trying to editable columnin classic report and based on the values that users fill in that filed calculate value in another column. I have seen something similar on the forum but nothing really worked for me.
My report is based on sql query.
select column1,
column2,
column3 from table
I want column2 to be updatable, and that column3=column2+column1

Sorry, in this thread you can see better what I meant in the post above.
ROW-------Country-------LOB-------YTD_PURCHASES-------YTD_INCOME-------Manual -------Total                              
1-----------USA-----------Utilities-----------1000000-----------50000----------------0-----------50000                              
2-----------USA-----------Electric-----------1000000-----------70000-----------------0-----------70000                              
3-----------USA-----------Security-----------1000000-----------90000------------------0-----------90000                              
4-----------CAN-----------Utilities-----------1000000-----------110000---------------30000-----------140000                              
5-----------CAN-----------Magic-----------1000000-----------130000--------------25000-----------155000                              
6-----------CAN-----------Plumbing-------1000000-----------150000-----------------0-----------150000                              
Thanks,
Gagi

Similar Messages

  • Calculated field in a Report Template

    Hi,
    I am trying to create a calculated field based on other calculations made in placeholder fields on a report template.
    If I have the following 2 fields:
    e.g. A = (1+2), B = (2*3)
    what is the best way to get C = A div B rather than having to list out all the calculations (i.e. (1+2) / (2*3)
    How can you set these first 2 fields as variables into the calculation?
    Thanks
    Steve

    For variables read this:
    http://download.oracle.com/docs/cd/E12844_01/doc/bip.1013/e12187/T421739T481157.htm#4535390
    Set x:=5
    <?xdoxslt:set_variable($_XDOCTX, 'x', 5)?>
    Get value of 'x'
    <?xdoxslt:get_variable($_XDOCTX, 'x')?>
    Perform calculation on x, like x:=x+8
    <?xdoxslt:set_variable($_XDOCTX, 'x', xdoxslt:get_variable($_XDOCTX, 'x' + 8)?>
    cheers
    Jorge

  • To Freeze a field in Classical Report layout

    Is there a way by which i can Freeze a field on the output list of a classical report layout, so that when i scroll towards right that field would not be moved.

    hi
    good
    go through the  following links
    http://www.r3.duke.edu/stepbystep/AdvReporting/AdvReporting.pdf
    this will give you the brief idea about the freezing of the columns.
    thanks
    mrutyun

  • Sign for Quantity field in classical Report

    Dear All,
    As we know, in SAP, by default negative sign ('-') gets displayed after value. I want to display the negative sign before the value.
    i.e. I want to display '1000-' as '-1000'.
    I want this for classical report unsing WRITE statement.
    Please suggest the syntax or formating option available or the way-out.
    Thanks a lot in advance.
    Best Regards,
    Prasad

    Hi,
    here is the format option:
    report ztest.
    Data: number type p decimals 2.
    number = -12.
    Write number using edit mask 'V__.__'.
    Impüortant is the "V" at the beginning.
    hope it helps.
    Regards,
    SDCrack
    Edited by: SD-Crack on Dec 29, 2009 2:45 PM

  • How to change the column value which is coming from DO by a calculated field?

    Hi all,
    I want to change a column value based on my calculated field value. I have a column which is coming from DO which is based on External Data Source. I have a calculated field in my report. When there is any change in the calculated field then the column which is coming from DO needs to be changed. It means the DO needs to get updated when there is a change in the calculated field. Or like if the calculated field meets some condition then I need to change/update the same in the DO. This has to be done on the fly. the report should not submitted for this. when there is a change in the calculated column the DO column needs to get updated.
    Thanks,
    Venky.

    Ok, I've been a customer for very many years, I'm on a fixed retirement
    income.  I need to reduce my bills, my contract ends in  Dec. I will be
    pursuing other options unless I can get some concessions from Verizon.  My
    future son-in-law was given this loyalty plan, so I know this is a
    reasonable request.  My phone number is (removed)  acct number
    (removed)
    >> Personal information removed to comply with the Verizon Wireless Terms of Service <<
    Edited by:  Verizon Moderator

  • Again: Number Format, Decimals in calculated fields

    My customer wants to know how he can have calculated fields in his reports.
    I've found out that e.g. this works for the calculation:
    <?format-number:((SALARY) div (../../DEPTSAL));'#,##0.00'?>
    But there is no way that I can get a precision of two decimals. All given formats are ignored.
    Maybe this is an issue with the european decimal sign , (Comma).
    How is this to be fixed?
    The use of the translate function was recommended somewhere. I have no idea how to bring it together with my calculation formula.
    Thanks in advance,
    Kai
    Message was edited by:
    kai

    Hi kai,
    First you need to remove comma from your amount field then you can get your result.
    If you have any comma in your amount field then xml number format does not work.
    Look this forum:
    Re: How to indicate number percission in a template?
    Thanks
    Ravi
    Message was edited by:
    Ravi Tripathi

  • Totals in classical report

    Hi,
    Please tell how to get totals of a field in classical report.
    please help with sample code.
    thanks in advance.

    HI,
    refer the code:
    reward fi help ful
    Umakanth
    *& Report  ZSD_SALES_INTER_REPORT1
    REPORT  ZSD_SALES_INTER_REPORT1  NO STANDARD PAGE HEADING MESSAGE-ID ZMSG44
                                        LINE-SIZE 230 LINE-COUNT 65(3).
                                Tables
    TABLES : VBKD,VEPVG.  "Sales document business data
                          "Delivery Index
                             Internal table
    DATA : BEGIN OF I_SALES OCCURS 0,
              CH TYPE CHECKBOX,
              VBELN LIKE VBAK-VBELN,                                                               "Sales document no
              NETWR LIKE VBAK-NETWR,                                                        "Net value of the sales order in Document currency
              WAERK LIKE VBAK-WAERK,                                                               "SD Document currency
              MATNR LIKE VBAP-MATNR,                                                               "Material no
              AUDAT LIKE VAPMA-AUDAT,                                                              "DOCUMENT DATE
           END OF I_SALES .
    data : NEWSALES LIKE I_SALES OCCURS 0 WITH HEADER LINE.
    DATA : AMOUNT LIKE VBAK-NETWR.
    DATA : V_LIN TYPE I .                                                                    "Screens vertical cursor position at PAI
    DATA : CHECKBOX TYPE C.
    DATA : DATE LIKE VAPMA-AUDAT.
    DATA : V_SEL LIKE SY-LISEL.
                             SELECTION-SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
        PARAMETERS : P_VKORG LIKE VEPVG-VKORG. "value check .                                        "Sales organization
        PARAMETERS : P_VTWEG LIKE VEPVG-VTWEG ."value check.                                         "Distribution channel
        PARAMETERS : P_SPART LIKE VEPVG-SPART ."Value check.                                         "Division
       SELECT-OPTIONS : S_DATE FOR VBKD-BSTDK DEFAULT SY-DATUM TO SY-DATUM  OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
      SELECTION-SCREEN BEGIN OF LINE.
        PARAMETERS : CHK AS CHECKBOX .
        selection-screen comment 5(20) text-003 for field chk.
      SELECTION-SCREEN END OF LINE.
      PARAMETERS : P_KUNNR LIKE VBPA-KUNNR MODIF ID S2.                                               "Customer
    SELECTION-SCREEN END OF BLOCK B2.
    START-OF-SELECTION.
    set pf-status 'UKG9'.
      IF CHK <>  'X'.
         IF P_VKORG  <> ''.
           PERFORM ORGANIZATION.
         ELSE.
           PERFORM ORGANIZATION_ELSE.
         ENDIF.
      ELSE.
        IF P_VKORG  <> ''.
           PERFORM CUST_ORGA.
         ELSE.
           PERFORM CUST_ORGA_ELSE.
         ENDIF.
    ENDIF.
    Displaying the contents with some alterations
    sort i_sales by AUDAT.
    LOOP AT I_SALES.
        WRITE : / I_SALES-CH,I_SALES-VBELN,I_SALES-NETWR,I_SALES-WAERK,I_SALES-MATNR,I_SALES-AUDAT.
    ENDLOOP.
    WRITE : / '******************************************************************************************'.
    LOOP AT I_SALES.
       ON CHANGE OF I_SALES-AUDAT.
          IF SY-TABIX = 1.
             WRITE :  / SY-VLINE,I_SALES-CH AS CHECKBOX,I_SALES-AUDAT.
             CLEAR AMOUNT.
          ELSE.
             WRITE : SY-VLINE,AMOUNT,60 sy-vline,/ SY-VLINE,I_SALES-CH AS CHECKBOX,I_SALES-AUDAT.
             CLEAR AMOUNT.
          ENDIF.
       ENDON.
       AMOUNT = AMOUNT + I_SALES-NETWR.
       AT LAST.
          WRITE : SY-VLINE,AMOUNT,60 sy-vline.
          uline at /2(60).
         ULINE.
          SUM.
          FORMAT COLOR  = 3.
          WRITE : /'TOTAL AMOUNT: ' ,I_SALES-NETWR UNDER AMOUNT .
       ENDAT.
    ENDLOOP.
         top-of-page
    top-of-page.
       uline at /2(60).
        write : / sy-vline,3 'Document date' ,16 sy-vline ,17 'Amount(net value of the sales document )' ,60 sy-vline .
       uline at /2(60).
    at user-command.
    if sy-ucomm = 'DISP'.
      LOOP AT I_SALES.
      REFRESH NEWSALES.
      V_LIN = SY-TABIX + 3.
      READ LINE V_LIN FIELD VALUE I_SALES-CH INTO CHECKBOX.
      IF CHECKBOX = 'X'.
        newsales-ch = 'X'.
        NEWSALES-VBELN = I_SALES-VBELN.
        NEWSALES-NETWR = I_SALES-NETWR.
        NEWSALES-WAERK = I_SALES-WAERK.
        NEWSALES-MATNR = I_SALES-MATNR.
        NEWSALES-AUDAT = I_SALES-AUDAT.
        APPEND NEWSALES.
        CLEAR NEWSALES.
        LOOP AT NEWSALES where audat = i_sales-audat .
         WRITE : / NEWSALES-CH as checkbox,NEWSALES-VBELN,NEWSALES-NETWR,NEWSALES-WAERK,NEWSALES-MATNR,NEWSALES-AUDAT.
        ENDLOOP.
       perform selection.
      ENDIF.
    ENDLOOP.
    ENDIF.
    *&      Form  ORGANIZATION
          text
    -->  p1        text
    <--  p2        text
    FORM ORGANIZATION .
      SELECT F~VBELN
             C~NETWR
             C~WAERK
             P~MATNR
             P~AUDAT
        INTO CORRESPONDING FIELDS OF TABLE I_SALES
        FROM ( VAKPA AS F INNER JOIN VBAK AS C ON FVBELN = CVBELN )
                 INNER JOIN VAPMA AS P ON FVBELN = PVBELN
        WHERE P~AUDAT IN S_DATE
         AND P~VKORG = P_VKORG.
    ENDFORM.                    " ORGANIZATION
    *&      Form  ORGANIZATION_ELSE
          text
    -->  p1        text
    <--  p2        text
    FORM ORGANIZATION_ELSE .
      SELECT F~VBELN
             C~NETWR
             C~WAERK
             P~MATNR
             P~AUDAT
        INTO CORRESPONDING FIELDS OF TABLE I_SALES
        FROM ( VAKPA AS F INNER JOIN VBAK AS C ON FVBELN = CVBELN )
                 INNER JOIN VAPMA AS P ON FVBELN = PVBELN
        WHERE P~AUDAT IN S_DATE.
    ENDFORM.                    " ORGANIZATION_ELSE
    *&      Form  CUST_ORGA
          text
    -->  p1        text
    <--  p2        text
    FORM CUST_ORGA .
    SELECT   F~VBELN
             C~NETWR
             C~WAERK
             P~MATNR
             P~AUDAT
        INTO CORRESPONDING FIELDS OF TABLE I_SALES
        FROM ( VAKPA AS F INNER JOIN VBAK AS C ON FVBELN = CVBELN )
                 INNER JOIN VAPMA AS P ON FVBELN = PVBELN
        WHERE P~AUDAT IN S_DATE
         AND P~VKORG = P_VKORG
         and P~KUNNR = P_KUNNR.
    ENDFORM.                    " CUST_ORGA
    *&      Form  CUST_ORGA_ELSE
          text
    -->  p1        text
    <--  p2        text
    FORM CUST_ORGA_ELSE .
    SELECT   F~VBELN
             C~NETWR
             C~WAERK
             P~MATNR
             P~AUDAT
        INTO CORRESPONDING FIELDS OF TABLE I_SALES
        FROM ( VAKPA AS F INNER JOIN VBAK AS C ON FVBELN = CVBELN )
                 INNER JOIN VAPMA AS P ON FVBELN = PVBELN
        WHERE P~AUDAT IN S_DATE
         AND P~KUNNR = P_KUNNR .
    ENDFORM.                    " CUST_ORGA_ELSE
    *&      Form  selection
          text
    -->  p1        text
    <--  p2        text
    FORM selection .
      LOOP AT NEWSALES.
         ON CHANGE OF NEWSALES-AUDAT.
           IF SY-TABIX <> 1.
              WRITE : / SY-VLINE,NEWSALES-AUDAT,SY-VLINE,27 SY-VLINE,48 SY-VLINE.
           ELSE.
             WRITE : / SY-VLINE,NEWSALES-AUDAT,SY-VLINE,27 SY-VLINE,48 SY-VLINE.
           ENDIF.
         ENDON.
         WRITE : / SY-VLINE,2 NEWSALES-VBELN,13 SY-VLINE,14 NEWSALES-NETWR,30 SY-VLINE,31 NEWSALES-WAERK,37 SY-VLINE ,38 NEWSALES-MATNR,57 SY-VLINE,58 NEWSALES-AUDAT.
         at last.
          sum .
          uline.
          format color = 3.
          write : /  sy-vline, 15 'Total amount:', newsales-netwr under newsales-netwr.
          format color off.
          uline.
         endat.
    ENDLOOP.
       v_lin = 1.
       free newsales.
    ENDFORM.                    " SELECTION

  • 2 Classic Reports with edit fields on the same page

    Hi All, need your help.
    I am trying to have 2 classic reports on one page with edit fields like date, list values, text
    I have noticed that the element indexes are the same f01_0001 have both first elements from both reports.
    This is making my code go crazy.
    Also i have a problem with Date Picker, if i select it as a column type for a first element in second report the icon shows up in the first report.
    I think this is because of indexing, but... Classic Date Picker put the icon on second report but when i select the date, the values is populated to first column in first report
    Does anyone have a solution for this problem! (for example change the indexing for second report)
    DB is 11.2g
    Apex is 4.2.0.00.27
    Thank you,
    Andrei
    Edited by: aracila on Feb 20, 2013 9:03 AM

    Are these tabular forms, ie updteable.
    If so, you can only have one per page
    Gus

  • Drop down box for the selection screen field of the classical report

    Hi all.
    i want to have the drop down list to choose from, for the region(table:zbwcntry-field:zregion1) on the selection screen.
    what is to be added to the code for this requirement.Also,please note that this is the classical report.
    thanks for this answered.

    hi,
    data  : gv_name  TYPE vrm_id,        " used for vrm id
               gv_repid TYPE sy-repid,      " used to hold program name
    work area to provide drop down list
    DATA :  gs_value TYPE vrm_value,
    Internal table to provide drop down list
    DATA :  gt_values TYPE vrm_values,
    PARAMETER : p_run(12) TYPE c AS LISTBOX VISIBLE LENGTH 12
                                     DEFAULT 'DEFAULT' OBLIGATORY,
    CONSTANTS : gc_run(5) TYPE c VALUE 'P_RUN',    "constant for run mode
    gv_name = gc_run.
      gs_value-key = gc_v1.
      gs_value-text = text-010.
      APPEND gs_value TO gt_values.
      gs_value-key = gc_v2.
      gs_value-text = text-011.
      APPEND gs_value TO gt_values.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id              = gv_name
          values          = gt_values
        EXCEPTIONS
          id_illegal_name = 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.
    Hope this is helpful.
    Rgds.,
    subash

  • Sum calculated field in report

    Hi, I have a report that groups by employee then by machine. In this report I sum several fields, but need to sum a calculated field and can't figure it out. This is the calculation:
    <?( QTY_MOVED) div ( TIME +.001 ) div ( INVERSE + .001)?>
    This is a total field using a field that works fine.
    <?sum(current-group()/QTY_REJ)?>
    How do I incorporate the calculation in the <?sum(current-group()/.............I get errors if I just put in the calculation above.
    thanks!

    Thank you for your help. After taking your advice and getting it to work by messing around with the brackets, management has changed their mind on the calc. Now they want me to use this calculation:
    SELECT EMPLOYEE, SUM(QTY_MOVED), SUM(QTY_REJ), SUM(TIME), (nvl([b]sum(QTY_MOVED),0)/nvl(sum(TIME),0))/nvl(sum(INVERSE),0) eff ,'DIRECT'
    FROM VW_TIMETRACK
    WHERE START_DATE >= :BEGIN
    AND START_DATE <= :END
    AND WORK_ORDER <> ' '
    GROUP BY EMPLOYEE
    to get the average. Now the weird thing is, I can get the value in toad, and I can get it to output in raw xml data, but when I try to add the eff field right next to the sum(time) field in the word form, nothing shows up. Absolutely no data. But it is in the xml. I'm using <?sum(current-group()/EFF)?> , just like I am for <?sum(current-group()/TIME)?> . I've made it text, numeric, decimal. Nothing is coming out.

  • How to set the field non-editable in the classical report..

    Hi..
              How to set the field non-editable in the classical report..

    Hi experts,
    For the component 'ICCMP_EMP_SRCH' there is a view 'BUPAEMPSEARCH' , which has 2 context nodes 'CUSTOMER' AND 'SEARCHEMPLOYEE' , i need to add the field 'NICKNAME' which is part of the 'CUSTOMER' context node on the search screen. Currrently all the fields on the screen screen are from the 'SEARCHEMPLOYEE' context node. when i did the configuration , the 'NICKNAME' field is greyed out . I have already generated the Getter ,Setter , GET_I, GET_M methods for the 'NICKNAME' field and the context node and controller class and context class are all active .
    on debugging the GET_I method, i see that rv_disabled = 'TRUE' and the current = collection_wrapper->get_current( ) is returning empty value .
    for this rv_disabled to be set false , the code below is not triggered since there is no value in current.
    IF current->is_property_readonly(
    'NICKNAME' ) = abap_false. "#EC NOTEXT
    rv_disabled = 'FALSE'.
    ENDIF.
    when i check for other search fields of context node 'SEARCHEMPLOYEE' , all the fields are set to rv_disabled = 'FALSE'.
    can anyone suggest how to approch this. iam i missing any binding between context nodes or any activations ?
    The field properties are set as Input field and the display checkbox is not checked.

  • Data missing in Crosstab report with calculated field via case when

    I use the Oracle 10g discoverer. When I create a crosstab report with a calculate field via function case when and put it as datapoint, some of the data is not showing. I tried to not use the case when function for the calculate field, then all the data show.
    I really do not the reason. Could anybody help me out with many thanks?

    Let me explain more.
    I have the original data below.
    Work order, Team, Hours_worked, date
    800001, S1, 5, 2012/01/01
    800001, S1, 15, 2012/01/10
    800001, S2, 4, 2012/01/04
    800002, S1, 3, 2012/01/15
    There are multipul records for the same work order, team on the same day or different.
    Finally I want to set the start date and end date as the parameter to create a crosstab report format like
    start date>=2012/01/01 and close date<=2012/01/05
    Team
    Total hours total hours within the range
    Work order S1 S2 ... S1 S2 ...
    800001 20 4 5 4
    800002 3 0 0 0
    in order to do it, I create two parameters independently start date and close date. Then I create a calculate field hours_worked_withinrange via
    Case when date>=:start date and date<=:end date then Hours_worked else 0 end
    This calculated field is correct in the tabular format report in discoverer desktop. But when I duplicate the list as crosstab. Some data is missing in crosstab data point.
    I checked once I change the calculate field defination not use case when. (For example, C1=hours_worked*2). Then everything runs correct.

  • Use calculated field(s) in other report

    Hi everyone,
    Is there a way to use a calculated field by itself in another report? I don't want to insert a sub report because it takes up too much space.
    I just need to use few fields in other calculations in the new report.
    Thank you

    The only way I can think of doing this without subreports is to save the values in a database somewhere.  In order to do this, the values would have to be calculated in the report's SQL Command data source.  (I'm guessin' that's probably not what you're looking for, but using subreports is the only other way I can think of...)
    HTH,
    Carl

  • Classical report field edit

    Hi All,
      I have written a classical report where my requirement is to provide edit for a particular field. For that i have declared as
    WRITE: <FIELD-NAME> INPUT.
    now i am able to edit this field but my requirement is to hold this field value at runtime untill i save it.
    So,please let me know how to hold the value. Is it possible.
    Your help will be appreciated.
    Regards,
    Venki.

    Hi,
    Here is the example of editable classical report
    [http://sapprograms.blogspot.com/2008/12/save-and-edit-in-classical-report.html]

  • How to fix the first field or column in classical report while scrolling

    i want to know, how to fix the first field or column in classical report while scrolling
    horizontally. the first  should be constant when i scroll the report horizontally .
    please help me.
    it's urgent.

    Hi,
    Suppose your first field is itab-matnr.
    WRITE :/ itab-matnr.
    SET LEFT SCROLL-BOUNDARY.
    WRITE :/......."Remianing fields

Maybe you are looking for

  • How to connect Iphone 5c to audi

    Hi im getting a new iphone and wondered how to connect the iphone 5c to my audi? 

  • How to fill datasource/table from archive?

    Dear Colleagues! How can I fill a datasource with archived data? I have created the Infostructure and the generic datasource (SD_VBRK_ARKIV). The datasource is available in BW after replication. But when I try to load it with an infopackage it finds

  • Set variant in infopackage to get backward data 1 month automatically

    Dear all, Could anyone tell me how could I set variant in infopackag => tab Data selection  to get backward data 1 month from schedule day (every Monday) automatically?  Many thanks & Regards, Bigtree K.

  • Error when starting install prog

    I get this error after the "InstallAnywhere" program loads java.lang.NullPointerException      at ZeroGgi.<init>(DashoA8113)      at ZeroGgb.a(DashoA8113)      at ZeroGgb.<init>(DashoA8113)      at ZeroGfr.a(DashoA8113)      at com.zerog.ia.installer

  • Blue screen - after booting into Darwin/BSD

    Hi, after I had the problem of my iMac G5 only booting into Darwin/BSD (which I posted here: http://discussions.apple.com/thread.jspa?threadID=1093517&tstart=0), I followed the instructions for recreating the user accounts, as described here: http://