Add calculated field (Query - SQ01)

Hi to all,
I would know how can i add a calculated field to a Query (SQ01) ?
Can you give me an example of abap code to insert in CODING section ?
thks

Hi,
My understanding about your question is you want to display the total for two standard fields in a table,
1) Personalize the table and make true for the property Total.
2) If you want to calculate both the column total,
Add a MessageStyledText via personalziation to the page, and extend the controller
and in the ProcessRequest
Get the handle of the AM and then ur attributes VO Attributes and traverse through the VO rows and get the total of both the columns
and set the value to the newly created MessageStyledText.
Let me you want any sample code for the second step.
Thanks.
With Regards,
Kali.
OSSi.

Similar Messages

  • How to insert calculated field in SQ01

    I would like to add a calculated field in a query but can´t find any documentation.
    the specific problem is that I would like to add a basic mark up on some costs.
    can anyone help
    Keel

    Unless you need some very complex calculations, this may be done in SQ01. The process is not very intuitive though.
    1) In SQ01, open the query in the change mode. Go to the Field Selection screen (the 3rd one).
    2) If you need to use an existing field in calculation, give that field a "short name" (if you don't see the Short Name column, go to the menu Edit -> Short Names -> Switch On).
    3) Now create a new field. Go to the menu Edit -> Local Field -> Create. Give the field some name and descrption. Choose the properties that you need and enter the Calculation Formula using the short name from step 2 (e.g. COST * 1.10 to add 10% to the COST field).
    You can also add conditions and use more than one existing field. I always use those local fields to display the invoice value, because NETWR is always a positive number, but it should be displayed as negative for cancellations and credits.

  • How do I add calculating properties to the fields?

    Used a template on Forms Central and made some changes. Trying to add calculating fields to three of the text fields and one drop down box but can't find how to do this?  Have double clicked on the text or drop down box but the properties does not have a calculation tab??  using Adobe Pro XI.  thanks in advance for your help.

    So is this a PDF form or a FormsCentral form? The two are quite different.
    On Fri, Dec 5, 2014 at 9:12 AM, Vikrantt Singh <[email protected]>

  • How to add a "Maximum no. of hits" - field in SQ01 query?

    Hi all,
    Is it generally possible to add the field "maximum no. of hits" to a query / quickview in transaction SQ01? And if yes, how?
    I have created a test query but I cannot find any solution. I don't mean the popup asking for database accesses which occurs when trying to test this query. I really want to have it as selection criteria.
    My system is a R/3 Enterprise 4.7 Ext. Set 2.00.
    Thanks in advance!
    Michael

    Well,
    You're talking about COLLECTIVE search help. You won't definie Max No of hit at this level.
    Define an elementary search help and assign to this one a dialog mode (retriction or set of values).
    Regards,
    Bertrand
    PS : Don't forget reward points

  • Add field in sq01, infoset query.

    i am trying to create a virtual field in sq01. i am creating a infoset query where i want to add two fields and need to displayed in the report. how can i do that without enhancing the infotype? i just need to add two fields and need to be displyed in third field. i want to add some logic of addition to those two fields and the result need to be stored and displayed.
    Message was edited by:
            shahid mohammed syed

    Hi ,
    I have got a query in AD-HOC query.
    After creating the Adhoc query using the join table functionality the resulting adhoc query does not results any out put.
    What I have done is :
    1.Created a user group through SQ03
    2.Attched user to My user group
    3.Created an infoset using join table functionality(SQ02).
    4.Saved and generated the infoset
    5.Added the user group to the infoset and than run the ADHOC query.
    The table I have used to join is all PA table (For test pupose)
    Though the purpose of the custom infoset is to join PA,OM and E rec infotypes, for testing purpose I have joined only PA infotypes.
    Result:The adhoc query does not gives any out put instead it says no data could be read.
    Could you please tell what else I need to do so that the custom infosets gives an out put.
    Will greatly appreciate your help.
    Thanks and best regards
    Rajeev

  • Inner Query relating to calculated field in main query

    I have a query that has calculating fields in it.
    What I am trying to do is Create another inner SELECT query similar to the one above but using the FP_Qty_Required calculated field in the main query?
    Is this even possible?
    Thanks in advance
    Aaron

    Sorry.  I did that because it looked a mess when I pasted it in.
    SELECT        P.ItemNumber, P.DeliveryWeek, D.StartDate AS WC_Date, S.SumOfSchedule_Qty, P.Planned_Production_Qty, P.Actual_Production_Qty, D.StartDate,
                             CASE WHEN S.SumofPartPallet < 0 THEN 'PART PALLET' ELSE '' END AS PartPallet, S.FirstOfIntouchRef, S.Pallet_Qty,
    S.FirstOfTool_Number,
                             CAST(CASE WHEN S.SumOfSchedule_Qty > 0 THEN (S.SumOfSchedule_Qty - 1.0) / S.Pallet_Qty ELSE 0.00 END AS DECIMAL(18,
    2)) AS DecNoOfPallets,
                             CEILING(CAST(CASE WHEN S.SumOfSchedule_Qty > 0 THEN (S.SumOfSchedule_Qty - 1.0) / S.Pallet_Qty ELSE 0.00 END
    AS DECIMAL(18, 2))) AS QtyOfFullPallets,
                             CASE WHEN s.sumofpartpallet < 0 THEN s.sumofschedule_qty ELSE CEILING(CAST(CASE WHEN S.SumOfSchedule_Qty >
    0 THEN (S.SumOfSchedule_Qty - 1.0)
                             / S.Pallet_Qty ELSE 0.00 END AS DECIMAL(18, 2))) * s.pallet_qty END AS FP_Qty_Required,
                                 (SELECT        SUM(SumOfSchedule_Qty) AS Expr1
                                   FROM            dbo.SumOfSchedDelivery
    AS s2
                                   WHERE        (ItemNumber = S.ItemNumber)
    AND (DeliveryWeek <= S.DeliveryWeek)) AS Running_Sum,
    FROM            dbo.Production AS P INNER JOIN
                             dbo.SumOfSchedDelivery AS S ON P.ItemNumber = S.ItemNumber AND P.DeliveryWeek = S.DeliveryWeek INNER JOIN
                             barcoding.dbo.DeliveryWeeks AS D ON P.DeliveryWeek = D.DeliveryWeek INNER JOIN
                             dbo.TotalRequiredByItem AS T ON S.ItemNumber = T.ItemNumber
    The above works.  What I want to do next is after the Running_Sum to add another sub query similar to this:
    (SELECT        SUM(FP_Qty_Required) AS Expr2
                                   FROM            ???
                                   WHERE        (PD.ItemNumber = ItemNumber)
    AND (PD.DeliveryWeek >= DeliveryWeek)) AS Running_FullPallet
    FP_Qty_Required is a calculated field in the main query.

  • Hi guru I want add extrea field in query

    Hi Guru,
    My requirment is like that . I created a Quey in accourding but guru now
    I want add one zfield in my query for that i have to do some calculation.
    Please tell  me where we can add extra field for  out put and where we can
    add code in Query please tell me process where we can write code.
    Please give me reply as soon as possible.
    Thanks
    Durgeh

    Hi,
    select the zfield from the table .
    for coding go to sq02 on the application tool bar click on selections and selct the code tab and u do the required coding there.
    Sail

  • Calculating Date Fields in SQ01

    Hi Friends,
    I'm new to SAP so I apologize if my question sounds rudimentary.  I've created a query in SQ01.  I would like to be able to report on data from the current year regardless of the year.  My ultimate goal is to schedule the query to run as a batch job so I never have to touch it again.  Within my query I created a custom calculation field from which I can enter a formula for the date, however, it seems that I cant get the syntax correct. 
    Any direction would be appreciated.
    Thanks,
    Olyn

    Thanks Pratik for your response. There are two things which I would like to clarify with you before proceeding with this development.
    1> Is there a standard way by which we can control this requirement (mean without development) ?
    2> We are using EP 6 (Netweaver 2004s). If we do the custom development as suggested by you in CRM GUI, does this change reflect directly in PCUI? or do we need to do something in EP to reflect this change?
    Appreciate your inputs.
    Thanks
    Kumar

  • How to add Column field in the custom Query Link search page as a header

    Hi,
    I have created a Query page link in web layout editor. Now, I want to customise the view of the result. I see an option to change the "Text1" and "text2", but how do I add other fields as a colum in the search result ?
    The only column I see by default Id, Title, release date and author. I want to see some of the custom metadata in the search result. I don't wan't to apply user specific custom search page.
    Overall, I want a common search view across all the user such that each user doesn't have to create a custom search view.
    Please help.
    Thanks

    hi
    By adding context node, you will not be able to fetch value. To fetch value in BTSubject, you need to have following nodes in your context node.
    Node          Relation                  Higher level node
    BTAdminH
    BTBOSSet  BTHeaderBOSSet   BTAdminH
    BTSubjectSet BTSubjectSet_A BTBOSSet
    BTSubject BTSubjectAll  BTSubjectSet_A
    Right now you dont have BTBOSSet and BTSubjectSet in your view. That is why component is unable to pull data in BTSubject.
    My suggestion would be to create cuco with above nodes
    Bind BTAdminH with BTAdminH of Component controller
    and bind BTSubject of details view with BTSubject of your Cuco.
    If you want code code gp catalog as it comes in complaint then there is seperate procedure for that.
    Best regards
    Pankaj Kumar

  • How to add a calculated field in a list definition (schema.xml)?

    Hello,
    I'm currently trying to add a calculated field to a list definition (schema.xml).
    I have put the following code at the end of the schema.xml for the list I want to create. But when I deploy and activate the feature for the list, it doesn't appear in the list field.
    <Field ID="{EE20EC4B-4216-4259-A84F-C478CE42B70F}" Name="EC_EventsMgmt_CalculatedTime" StaticName="EC_EventsMgmt_CalculatedTime" Group="EC_EventsMgmt" Type="Calculated" DisplayName="Calculated Time" Required="TRUE" Hidden="FALSE" ReadOnly="FALSE" Format="DateTime"> <Formula>=DATE(2009,1,1)+TIME(EC_EventsMgmt_ScheduleHour,EC_EventsMgmt_ScheduleMinute,0)</Formula> <FieldRefs> <FieldRef Name="EC_EventsMgmt_ScheduleHour"/> <FieldRef Name="EC_EventsMgmt_ScheduleMinute"/> </FieldRefs> </Field>
    Could you please give me some help and explain me why it is not working?
    Thanks a lot.

    Hi there.
    If I understand correctly, you create this list within the same feature?
    If so, the list isn't available during the propagation, and therefore the calculated field can't be added.
    If this is the case, then you could work around this by adding a feature activated event handler to your feature and add the calculated field programmatically in that event.
    Hope this helps.
    Regards,
    Magnus
    My blog: InsomniacGeek.com

  • Query: How to add new fields in ABAP query?

    Hi All,
    Can any one tell me how to add new fields in the ABAP query output?
    We have to add the new fields using query design or we have
    to add those in the background program(automatically generated behind query) by selecting new fields in the code?

    What kind of report? Usually, you have to add the field in the table declaration and then also in the SQL query. After that, include the field in what kind of report you are using.

  • How to add new fields in SAP-Query

    Hi,
    Can any body tell how to add new fields to the existing query.
    Thanks a lot,
    Bhaskar.

    hi,
    when we create internal tables like. in final table you can include the extra fields.
    data : begin of itab_mara,
             matnr like mara-matnr,
             erdat like mara-erdat,
             end of itab_mara.
    data : begin of itab_marc,
             matnr like marc-matnr,
             werks like marc-werks,
             end of itab_marc.
    data : begin of itab_final,
             matnr like mara-matnr,
             erdat like mara-erdat,
             werks like marc-werks,
             date like sy-datum,
             status(10) type c,  * new fields
             end of itab_final.
    <select statement>.
    Append all the fields to itab.
    loop at itab_final.
    write :/ itab_final.
    endloop.
    Reward with points if helpful.
    Message was edited by:
            Vinutha YV

  • Problem with the query of Sharepoint Calculated Fields

    Hello,
    I am developing an application in sharepoint 2013 foundation. but i have problems with a list, when executing a caml query on a calculated field. I try the solution of this blog
    http://sptalks.wordpress.com/2013/03/25/query-on-calculated-field-problem
    but i got no result
    attentive to any comments
    thanks

    Hello,
    This is my CAML Query
    <View>
    <ViewFields>
    <FieldRef Name="ID" />
    <FieldRef Name="PermMask" />
    <FieldRef Name="FSObjType" />
    <FieldRef Name="Nombre" AutoHyperLink="TRUE" />
    <FieldRef Name="Apellidos" AutoHyperLink="TRUE" />
    <FieldRef Name="Cargo" /><FieldRef Name="Edad" />
    <FieldRef Name="Compa_x00f1_ia" />
    <FieldRef Name="Created" />
    </ViewFields>
    <Query>
    <GroupBy Collapse="TRUE" GroupLimit="30">
    <FieldRef Name="Compa_x00f1_ia" />
    <FieldRef Name="Edad" />
    </GroupBy>
    <OrderBy>
    <FieldRef Name="ID" />
    </OrderBy>
    <Where>
    <Contains>
    <FieldRef Name="Ano" LookupId="FALSE" />
    <Value Type="Text">2014</Value>
    </Contains>
    </Where>
    </Query>
    </View>

  • Calculated field in a query

    Hi,
    To begin with I am just learning EJB and JAVA so please bear with me. I want to create a calculated field in a query from two fields in the table being queried, using SQL I would write the query like this:
    SELECT ledgerdate, description, quantity, unitprice, [quantity*unitprice] FROM ledger
    I have created a class called ViewLedger to contain my results, it has the following elements:
    DATE ledgerdate,
    STRING description,
    INTEGER quantity,
    BIGDECIMAL unitprice,
    BIGDECIMAL amount
    The query that I have been attempting that fails is:
    SELECT NEW ViewLedger(l.ledgerdate, l.description, l.quantity, l.unitprice, l.quantity*l.unitprice) FROM Ledger l
    The error says that there is an unexpected * in the query
    The following do not work either:
    SELECT NEW ViewLedger(l.ledgerdate, l.description, l.quantity, l.unitprice, (l.quantity*l.unitprice)) FROM Ledger l
    The error says there is an unexpected ( in the query.
    SELECT NEW ViewLedger(l.ledgerdate, l.description, l.quantity, l.unitprice, [l.quantity*l.unitprice]) FROM Ledger l
    The error says there is an unexpected [ in the query.
    Any help would be greatly appreciated.
    Thanks.

    I don't think JPQL allows functions (*) in the SELECT clause.
    You can use a native SQL query as a workaround. If you are using EclipseLink or TopLink Essentials, you can also use a ReportQuery.
    You may also want to vote for the bug,
    [https://bugs.eclipse.org/bugs/show_bug.cgi?id=219814|https://bugs.eclipse.org/bugs/show_bug.cgi?id=219814]
    James : [http://www.eclipselink.org|http://www.eclipselink.org]

  • Field add in abap-query

    Hai all,
    Kindly advise me how to add the new fields in report which has already created via ABAP-Query programming.
    Regards,
    Renuga.A

    What kind of report? Usually, you have to add the field in the table declaration and then also in the SQL query. After that, include the field in what kind of report you are using.

Maybe you are looking for