SAP Query for difference of 2 currency fields

Hello Experts,
I have created a SAP query in which I need to fetch data from only 1 custom table through "direct read of table" method.
I have also added an additionl field in the query output and the field name is "Difference" (difference between 2 currency fields).
Please help me out in writing the code for this additional field which gives the difference of 2.
Ex: there are 5 fields A, B, C, D and E to be displayed in output of SAP query. I have added additional field X. So please help me out to write the code which gives difference of A and B fields.
Thanks,
Tousif

Hi,
By using t-code SQ02. Use option direct read from table. Then move forward. you have a code option, click on it.
Here you declare your data as same as your report.
On coding section, you get a option of events. use event and move you code forward as per your requirement.

Similar Messages

  • Need to find SAP query for corresponding ABAP program.

    Hello SAP Experts,
    I have an ABAP program "AQDESYSTQV000001ORDERDETAILS==" in ECC 4.7. We had a client copy recently from ECC 4.7 to ECC 6.0. Now in ECC 6.0 I am unable to find this program in SE38.
    Can you please tell me how to create this program in ECC 6.0 ? Also, by the name of this program it is clearly seen that this program is automatically created by using SAP query.
    I tried to generate the program using SQ01, but system asks me for the SAP query.
    Can you please tell me how to find the SAP Query for the corresponding abap program ? Also, the steps as in how to generate the program in ECC 6.0.
    Thanks.

    Hi Danish,
    In the program name, the query name is always attached.
    For example : The program name is , AQ10SD==========Z10SD_INVPRODL=
                           Here the query name is Z10SD_INVPRODL and if you go to transaction SQ01 and enter the query name
    then you can find the infoset.
    And also you can gernate the program with the help of query name.
    Please try the same and let me know if any details are required.
    Regards,
    Darshana

  • SAP Query for AR Aging Report

    Hello Gurus-
    I am trying to build a query for Aging report, and would like to include something like this:
    Customer-Reference-Payment terms-Due date-Current-31-60days-61-90days-91-120days-over120days-toatal amount.
    I have an infoset which includes BSID, KNA1, KNB1. I have maintained local fields:
    Due Date  =     Baseline date + cash discount days
    Statement Date = My input date.
    Current    = Condition (DUEDTE >= STATDTE - 30) formula (Amount)
    31 - 60 Days = Condition (DUEDTE >= STATDTE - 60 AND DUEDTE < STATDTE - 30) formula (Amount)
    61 - 90 Days = similar to above
    91 - 120 Days = similar to above
    Amount  = - 1 * (If Debit credit indicator = "H" then "Amount in local currency") otherwise "Amt in Loc.Cur"
    Over 120 Days = similar to above
    When I enter a statement date of today it works hunky dory...it all looks good...my current column looks good and do the rest. When i want to run this query as of couple of months ago (if today is 12/19/08 and i wanted to run my aging report for 10/31/08) it should give me aging as of my statement date 10/31/08 but it does not. It calculates the total amount as of today. I know because of local field "Amount" where i gave amount in local currency, but how would I tell that it should pick up amount in local currency till the statement date?
    Any input in this regards is highly helpful.
    Thanks,
    RNarayan

    Hi Ram,
    On your aging report you want to see invoices which are still not paid (or still open) as of a certain date. This date is "key date". You need to define a variable for key date (which is normally system date if you run today) but it could be a past date.
    So key date is let us say Oct 31st (X) and the system date is Dec 19th. When you run the report as of Oct 31st all invoices that are posted prior to Oct 31st (posting date less than X) and are still in BSID will show on your report. There is no issue here.
    Let us say an invoice was created on Oct 25th (Y) and was paid on Nov 15th (Z). The clearing date is Z. That means if you run the aging report today this invoice will not show.
    But you want to run the report on Oct 31st. This means X is greater than Y but is less than Z.
    Clearing date and posting date are part of BSAD. Report run date is the user input and is a variable.
    With the above concept and with the help of an ABAP programmer you should be able to solve the problem.
    Regards
    Sharabh

  • Error in the SAP query for Assets?

    Hi,
    I am trying to make 2 queries related to the assets but it is not selecting the data may I know why and where I am doing wrong.
    I have joined the tables ANLA, ANLC, ANLP and ANLB.
    Fields that have been selected are as follows:
    Asset Subnumber ANLA-ANLN2
    Asset Class ANLA-ANLKL
    Asset description ANLA-TXT50
    Company Code ANLA-BUKRS
    Serial number ANLA-SERNR
    Main Asset Number ANLA-ANLN1
    Asset Subnumber ANLA-ANLN2
    Asset Class ANLA-ANLKL
    Asset description ANLA-TXT50
    Company Code ANLA-BUKRS
    Serial number ANLA-SERNR
    Main Asset Number ANLA-ANLN1
    Fiscal Year ANLC-GJAHR
    Ordinary depreciation posted in the current year ANLC-NAFAG
    Planned ordinary depreciation for the year ANLC-NAFAP
    Accumulated ordinary depreciation ANLC-KNAFA
    Cumulative acquisition and production costs ANLC-KANSW
    Asset Subnumber ANLA-ANLN2
    Asset Class ANLA-ANLKL
    Asset description ANLA-TXT50
    Company Code ANLA-BUKRS
    Serial number ANLA-SERNR
    Main Asset Number ANLA-ANLN1
    Fiscal Year ANLC-GJAHR
    Ordinary depreciation posted in the current year ANLC-NAFAG
    Planned ordinary depreciation for the year ANLC-NAFAP
    Accumulated ordinary depreciation ANLC-KNAFA
    Cumulative acquisition and production costs ANLC-KANSW
    Transactions for the year affecting asset values ANLP-ANSWL
    Planned ordinary depreciation for the year ANLP-NAFAP
    Ordinary depreciation posted in the current year ANLP-NAFAG
    Ordinary depreciation to be posted ANLP-NAFAZ
    Asset acquisition year (currently not used) ANLP-ZUJHR
    Depreciation calculation period ANLP-PERAF
    Original useful life in years ANLB-NDURJ
    Depreciation key ANLB-AFASL
    Please tell me where SAP query is no working and what shall I do to make it work.
    Thanks and regards
    Nitin

    Thanks !!!!

  • Transaction code thro' SAP Query for customer spefific report

    hi experts,
    how to create transaction code (using SE43-) for the sap query created on own??
    I have created the following required for a customer specific report
    1.Infoset thro sq02
    2.user group thro sq03 and assigned it to infoset
    3.query thro sq01 and saved it with text
    earlier i have used logical database PNPCE ( relevant for PA and payroll modules reports)
    using sq01 , go to basic list , selected required infotypes and fields and
    then selected, SAP List viewer for viewing and i get the report.
    Now my question is how to create a separate transaction code for this sap query which i created
    should i use SE43( area menu maintenance and area class???_)
    should i create a variant and go to SE43??
    advice solicited
    snr

    Hello
    when you excecute the query in right han side corner  you can get the program name
    go to se80 select program & type this name and then you can create a tcode for that prog in SE80
    reward points if helpful.
    the prog name will be something like : AQZZ/SAPQUERY/* " ur query name
    you can search for the name also in this manner

  • SAP Query-for  Reporting   how to create and use it

    Hi SAP Gurus,
    i need your help. in my project, client is asking to create queries to generate reports, i am not familiar with queries, so would appreciate it if any one can guide me and tell me the procedure for writing and creating queries soon.
    also if you have any study material on steps on How to write and create queries for PP module
    thank you very much

    Hi
    Please refer below document
    http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Introduction.asp
    Also refer below
    How to Create Infoset Query (SAP Query)
    Steps on how to proceed to create a Query:
    ADHOC QUERY
    A query can be created to extract information from master records  i.e  Infotypes.  For example, by creating a query , the data relating to an employee contained in various Infotypes can be extracted.
    Proceedure :  
    Decide on  the various Infotypes we  want to make the query.  Decide on the area where we  want to query  i.e  Global area or Standard area.  Standard area is client specific and globel area will include all clients.
    Menu : HR – PM – Admn -  Information System -  Adhoc Query
    Select area standard and select the  user group already created
    Creation of new query  :  
    TC SQ03  -  Select Environment – Select Standard Area -  Enter  --  If new user group is to be created, enter name of the user group, click on create and enter necessary information and  exit after saving
    TC SQ02  -  Enter name of the Infoset – Create – enter name of Infoset -  Data source -- >  Table join by basis table – give name of table e.g  pa0000 -  Enter -  Click on insert table if we  want to include more tables – give name of table one by one and after finishing,  place cursor on the joining lines and right click to delete unwanted relationships  - check  - and go back  - field groups  -  include all table fields  - click on generate button   -  go out
    TC SQ03  -  Select user group  -   eg.  Payroll
    Infoset  - Enter name of newly created Infoset 
    Assign users and Infosets  -  Assign infosets  -  put tick on payroll  - save and go back
    TC  PAAH  -  Expand the nodes and put tick on relevant fields depending upon necessity
    Save the query  by giving the same name as infoset for easyness..
    For executing a query which is already created
    1. Go to SQ01 transaction
    2. Go to Environment menu->query areas->std areas
    3. Then choose the user group where the query is created
    4. It will display all the queries created for the group.choose the query you want to executeand click execute.
    5. will take to the initial screen
    6. Enter the required parameters and execute
    Regards
    Ranga
    Message was edited by:
            Ranganathan Srinivasamurthy

  • How to Create Specific SAP Query for Sales BOM

    Dear All Salute !!
    How I can create a SAP Query which provide information from the Sales Order-Line Item, this specific material is having any BOM or not?
    Suppose, user want Input,
    Sales Order No., Product Category, Duration of Sales Order Release.
    want Output,
    Sales Order No., Customer No., Customer Description, Sales Order Line Item, Material No., Material Description, Delivery Date, Quantity, Sales Order release Date
    Users requirement is, List of All Line Items for which BOM is yet to be Uploaded in the System.
    Please provide complete detail with Table & field by using SAP Query.
    Rgds
    Srivastav
    +91-9973504950

    If I am correct, in table KDST, you can see the details of Sales BOM with sale order.  Since right now, I dont have access to SAP, I am unable to confirm this.  You have to consider this table and develop on your own logic with the help of ABAPer.
    thanks
    G. Lakshmipathi

  • SAP Query for Appriasal Report

    Hello Experts,
    Can we use SAP Query (SQ03, SQ02, SQ01) based on Appriasal tables ( HRHAP*) to fetch records similar to tcode phap_search_pa?
    I tried building an infoset making a direct read of table HRHAP and then joining tables like - HRHAP_T, HRHAP_APPEE, HRHAP_APPER, HRHAP_OTHERS and HRHAP_ACT_LOG.
    Finally, created a query based on this infoset, however, it does not retreive any results. Seems, it requires more details as app templates...
    Can anyone give inputs on this?
    Regards,
    Sarvesh Hasija

    Hi Sarvesh
    SAP Query may not work here. Because more than often, the data available in PHAP tables need to be first brought into temporary tables using a match condition and then shown on screen. There are a lot of sub queries required between PHAP and HRPnnnn tables to see some meaningful results. Imagine how many Table joins the End User needs to do.
    SAP Query are ideal if we are pooling data from one or two tables using a match condition. I am not dening that InfoSet is not possible. Getting desired output from such InfoSet will be challenging.
    You mentioned you supplied Doc ID/Number to PHAP_Search_PA, which is incorrect. It is a report which works on Template not Document. I hope you know the difference between Template and Document in PMS/OSA. I cannot stress enough on how much important is PHAP_Search_PA. What this standard report can do, custom designed report will take huge time to get close to it.
    I am sorry, I am also going to recommend Z Reports in case desired output is not possible in PHAP_Search_PA. In one of my recent assignments we had "Trainer's Feedback Report for any training programme/programmes between any two dates" requirement, and we opted for a Z Report.
    Regards
    Yash

  • SSRS expression for difference between two currency values

    Hi All;
    I need to get the difference between two currency values
    Below is my report
    I need to get differene between Actual Income and Profile Income and this value should be in "£" In this example it should be £0.00
    Any help much appreciated
    Thanks
    Pradnya07

    =sum(Fields!ProfileIncome.Value - Fields!ActualIncome.Value)
    This could have either field first, but depends on which field is expected to be larger. You would then format the textbox to show in pounds.
    HTH

  • SAP query for Material pricing group changes in material.

    Dear all,
    I'm trying to generate a query for Material Pricing group changes in material. For that I've to retrieve data from follwing three tables MVKE, CDHDR & CDPOS.
    Firstly while generating infoset -
    I tried it by joining tables MVKE & CDHDR, but system is not allowing it, also table CDPOS can't bejoined.
    Then I tried by reading dirctly from table MVKE and then adding additional fields in it. query created using this infoset is giving the output, however it's giving only 1 entry per material entered in input.
    for multiple entries in output for MPG changes in same material I tried creating addtional structure for table CDHDR & CDPOS but again I'm getting only 1 entry per material.
    please suggest how I can get MPG changes done in specified time period for a material.
    Thanks.

    Hi
    Check the report RSSCD100 and run it for object MAT_FULL for table MVKE. Use this report as a template for your own development.
    I hope this helps you
    Regards
    Eduardo
    PD: sorry, the table is DMVKE
    Edited by: E_Hinojosa on Sep 2, 2011 9:37 AM

  • SAP query for SPRO table

    HI experts, Im about to create a Sap query using SQVI tcode. I want to have listing of certain master data created in customizing(SPRO) like the catalogs and list of code groups and task codes in Service Notification. What is the best data source or the table should I use to capture this data? Or is this possible? If not, can you give me some ways how to have listing report for those information.

    Hi,
    Have you checked with t-code QS42 ?
    Tables - QPGR, TQ15.
    Regards,
    Vivek

  • SAP Query for RE contracts

    Hi,
    Our requirement is to show all the changes made in all RE contracts for one business entity. We are trying to achieve this by creating SAP Query. Is this possible? And yes, what are the tables i should select or i should join to be able to create the correct report.
    Thank you so much.
    Rachelle

    Hi Rachel,
    Please be more specific on what changes you require.
    Have a look at the tables. These contain basic details of the contract
    VICNCN                         Real Estate Contract
    VICDCOND     Condition
    VICDCONDCALC     Conditions - Calculation Factors and Condition Amounts
    Regards

  • SAP QUERY for Customer Master

    I need to create a SAP Query to generate a report for customers and i need to use KNA1,KNB1,KNVV,KNVP and KNB5 tables.I have no idea how to create Query's using SQ01,02 and 03.Can some help me reagarding this in terms of documentation or any usefull material.I am using ECC 6.0 any documentation based on this version is helpful.
    Regards,
    Sri.

    Review following link;
    http://www.thespot4sap.com/articles/sap_abap_queries_create_the_query.asp
    Thanks.

  • Assign Report Category to a SAP Query for PNP LDB

    Hello Folks,
    How to Assign a Report Category to a SAP Query which is using LDB PNP.
    Regards,
    Nishanth Kumar

    Hi,
    SE38 -> Report name -> attributes ->  HR Report category
    Regards,
    Dilek

  • SAP Query (for Insurance) !!

    Hi,
    I had created few queries using SAP Query. It works perfectly alright in Dev but when transported to Quality one of them fails to work.
    My questions are:
    1. I did consistency check. Displays no inconsistencies but still one of the queries does not work.  It points out to the error listed below. Could you suggest what  rtmode-acc_check is and how could I rectify this error.? I do not have much idea about ABAP.
         Error line ->   if ( ( %rtmode-acc_check = 'X' and sy-dbcnt > %rtmode-acc_number )       
    2. In quality system, the report generation is taking ages. Any suggestions to speed it up. I have No Optimization Access unchecked.
    Thanks and best wishes in advance,
    SM

    Review following link;
    http://www.thespot4sap.com/articles/sap_abap_queries_create_the_query.asp
    Thanks.

Maybe you are looking for

  • To display the columns in a adf table dynamically

    hi, i want to display 999 no of columns in a adf table. since it is not a better way to show all the columns in the adf table at a time, we want to show 10 columns at first and by using the next and previous links the user can see the according colum

  • Want to create new Status types in the CBIH82 T.code EHS module

    Dear Expert, Client wants that status type like YES and NO in the filed Status in the t.code "CBIH82 -Edit Work area" I have try to create in the spro path under the status management  but unable see that status. Path is SPRO --->Environment ,Health

  • Messaging Server on Windows

    Hi folks. I'm trying to install Messaging Server 5.2 on a Win machine and I get the following error: "A serious problem ocurred while installing the iPlanet Messaging Server domain component tree (msg.ugldap.dctree.inf) It reported the following prob

  • Zen NX Firmware probl

    I updated my firmware on my Zen NX Several months ago with the newest firmware, and since then all of my music sounds really weird. I would like to make it work again. I have already gone and bought a Zen Xtra. but I would like to use this as an back

  • Installing Discoverer 4.1, Oracle_Home problem

    Hi all I am getting error on installation, it says it cannot install on disc_home. If I try to install it to default, i.e oracle_home, it says something like, you cannot have two product at one home. Similarly for Designer Please help me out Regards