Split dates in SAP Query

Dear experts,
While using  a query over a specific period in which a person has multiple periods they are displayed as mulitple lines. In the output I want to include the validity period of this line.
SAP uses during runtime the fields:
SYHR_splits_wa-begda
SYHR_splits_wa-enda
These contain the exact dates I want to have in the output.
While creating infosets a number of  (extra) fields calculated during runtime can be used as a selection & output option (the all start with SYHR_)
a. Is there a way to add SYHR_splits_wa-begda?
What we tried to do was create a new field in the infoset with:
Newfieldname = SYHR_splits_wa-begda.
This way we were not able to genereate.
Declaring the field SYHR_splits_wa-begda leads to the fact that it remains empty during run time (and the query goes into an endless loop)
Any suggestions on how to include the start date of the split in the output is very welcome!
regards,
Sebastiaan van de Weerdt

What can be done is, you can add an additional field to the infoset and in the field code part,
call either of the function modules:
CONVERSION_EXIT_IDATE_OUTPUT External date OUTPUT conversion exit (e.g. 01JAN1994)
CONVERSION_EXIT_LDATE_OUTPUT Internal date OUTPUT conversion exit (e.g. YYYYMMDD)
CONVERSION_EXIT_SDATE_OUTPUT Internal date OUTPUT conversion exit (e.g. YYYYMMDD)
The function modules allow to get a part of the passed date too.
Hope it helps.
Thanks,
Saipriya

Similar Messages

  • Fieldes planned delivery date and actual good recipt date for SAP QUERY

    Hi Gurus
    I am changing sap query. I need to find two fieldes  : planned delivery date and actual goods recipt date
    I dont know MM tables, do you know wrhere are?
    in table EKPO i don't find the fieldes.
    Thanks in advance

    Thank a lot!
    Regards

  • Reading Archived Data Through SAP Query Report

    Dear SAP Gurus,
    My client archived their SAP data in a particular year range and all the Z reports have to modified to read these archive data. Normal ABAP reports can be modified to read the archive data without no problem.
    But there are two Z SAP query reports which should be modified the same way so it will be able to read archive data.
    What is the best method for this? Does SAP Query tool provide facility to read archive data? or do I have to append the code?
    Thank you in advance for your help
    Regards,
    Isuru Fernando

    >
    Isuru U Fernando wrote:
    > hi Manthan,
    >
    > Yes I used these FMs and read the data without any problem for normal ABAP reports.
    >
    > But SAP query report is the problem. Is it advisobale to modify the SAP query generated report source code? since it is a system generated report.
    >
    > Regards,
    > Isuru
    No, do not adapt the SAP generated report source. The reason is: every time someone re-generates the query from tx. SQ01 your changes will be lost.
    You could add the functionality Manathan gave you to add to the infoset of said query - but to be honest: in my opinion that is shooting nuclear rockets at flies. Also you run the risk that every change of the infoset (add a join/delete a join) requires adjustment of said coding you applied ... and where will you be then? Fancy repairing the same query over and over again? Try talk sense to your client - go for a Z-report here ...

  • SAP Query - how to retrieve data within another program / FM

    Hi,
    I need to retrieve data from SAP Query, but when I used SUBMIT ..., the program results dump, because it is called within open custor loop.
    Is there any another way, some FM or sth else?
    thanks
    Juraj

    I already tried it, but I always get dump with CX_SY_OPEN_SQL_DB exception.
    The problem is, that I tried to execute the query within open custor loop and this exception is caused by calling commit work somewhere in query report.
    therefore I try to find another way
    thanks
    Juraj

  • SAP Query - Reporting on Simulation infotype 2501

    We defined reporting time types for the SAP delivered infotype 2501 to report from the ZL cluster.  However, when we report the data using SAP Query, for a few records, the following is observed:
    (1) Basic list output in Query report splits the record as only 50% (half) of the time is output when compared to the data in the cluster.
    (2) If you also use the same field in a Statistics output, it seems to report the full amount of time as recorded in the cluster.
    The discrepancy is noticed only in a very few records reported by SAP Query. We need to be absolutely sure as to why some records are not reported accurately by SAP query basic list output for the simulated infotype.
    I would appreciate your help
    Thanks
    Pascal

    Hi Pascal,
    Since the IT2501 is a "Simulated Time Infotype" you cannot look at the data in it, but you can confirm the data from the ZL cluster and the data from the employee.  Since it is only this employee or a few employees, it is probably not the configuration of the time buckets for the IT2501, but you may want to make sure all time times are captured as you want.  Then look at the time entries for this individual or individuals.  Did they enter a time type that was not expected or configured?  Is all their time approved and passed through Time Evaluation?  Finally check the Master Data for the employee - is the Planned Working Time (IT0007) infotype correct or has it been recently changed?  Is he in a special Cost Center (IT0027) or Project that is captured differently for time purposes? 
    Since it just one or a few individuals, I would suspect the Master Data and some inconsistant entry that affects the time cummulation for the IT2501.
    Paul

  • No hide fields or select fields in SAP Query Extractor?

    HI Gurus,
    I want to generate a data source, extraction data from SAP Query.
    Now I want to hide some fields or to mark some fields as relevant for selection.
    But after saving my settings are unavaiable...?
    Does somebody have an idea? Is this standard when extracting from Query or is this maybe an OSS...?
    Thanks

    Hello,
    Just logoff and Login again, then check it.
    Also see
    SAP Note 1014073 DFG: Changes to the DataSource are displayed incorrectly
    SAP Note 1073714 DataSource in RSA6: Unable to display/change customer fields
    SAP Note 925398 RSA6: DataSource enhancement only visible after restart
    Thanks
    Chandran

  • SAP Query - material costs split by labour/ingredients

    Hi,
    Is it possible to create a SAP query to show the following;
    Material / Lab unit cost / Material lab cost
    I'd also like to be able to select r show 1 or 2 cost variants.
    I essentially need a list of materials and their costs broken down into their constituent parts.
    How can I do this please?
    Thanks

    Hi Commandante
    You can not have WIP split in the FI GL accounts.....
    However, there is a work around possble which can give you the break up in report
    You need to do small tweaking to get WIP by cost component
    1. Define as many LINE IDs as your cost components in OKTZ
    2. For eg: If you have cost components like raw material, packing material, labor, machine cost.... then define similar LINE IDs and do the relevant configuration for WIP as per these line IDs.... Assign the specific cost elements in WIP config instead of masking....
    3. Assign cost comp str in OKN0 and choose product group = Material Group.. Transport it to production
    4. Run KKRV to collect the data
    5. Now run the WIP reports in KKO0
    When you execute your KKO0 reports, WIP would be with the same breakup as your cost components
    This is a tried and tested approach!!
    Regards
    Ajay M

  • Help Required -- Can we use SQL Query to READ data from SAP MDM Tables

    Hi All,
    Please help.........
    Can we use SQL Query to READ(No Creation/Updation/Deletion  just Read) Data from SAP MDM tables directly, without using MDM Syndicator.
    Or direct SQL access to SAP MDM tables is not possible. Only through MDM Syndicator can we export data.
    Thanks in Advance
    Regards

    All the tables you create in Repository comes under A2i_CM_Tables in Database named as your repository name. So the tables names are fields of table A2i_CM_Tables. Now i tried it but cant make it.
    Now, I dont think its possible to extract all fields in tables and there values using select query. May be pure sql guy can do that or not.
    But there is no relation of data extraction and syndicator. Data is viewed in Data Manager. and you can also store data in a file from DM also.
    BR,
    Alok

  • SAP QUERY -logical data base ADA

    I have created a SAP Query with logical data base ADA,I have selected four tables in it.Do i need to link these tables if yes..where and how?The report is for fields in asset master data.
    .But i get below error when i try to genaret the output :
    Fields from parallel tables within a line
    Line: 01
    Field: Asset description
    (ANLT-TXT50, table ANLT)
    Field: License plate no. of vehichle
    (ANLZ-KFZKZ, table ANLZ)
    i get such similar five messages but they are warning..when i execute with warning however i get the fields with description but not with Value.Ex:i get asset description and not Asset number as required.

    You don't have to link them, they ar linked that is the power of a logical data base
    To get the text in your report you need the key fields
    Like
    (Lanque Key)
    company code
    asset number
    Asset sub number
    Go to info sets and look to the standard ones like /SAPQUERY/AM01

  • SAP query error - 1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Conversion failed when converting date and/or time from character string.  'Received Alerts' (OAIB)

    SAP query error - 1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Conversion failed when converting date and/or time from character string.  'Received Alerts' (OAIB)
    SELECT    
    CASE WHEN T0.DocStatus = 'O' THEN 'OPEN'
    WHEN T0.DocStatus = 'C' THEN 'CLOSED'  END  AS 'Document Status',
    T0.DocDate AS 'Posting Date',
    T0.DocNum AS 'Doc.No',
    T0.NumAtCard,
    T0.TransId AS 'Trans. No.',
    T0.Comments AS 'Remarks',
    T0.CardCode AS 'Offset Acct',
    T0.CardName AS 'Offset Acct Name',
    sum(T0.DocTotal) + (T0.WTSum) as 'DocTotal',
    T3.DueDate AS 'Cheque Date',
    T3.CheckSum AS 'Amount'
    FROM         ODPO AS T0 LEFT OUTER JOIN
                          VPM2 AS T1 ON T0.ObjType = T1.InvType AND T0.DocEntry = T1.DocEntry LEFT OUTER JOIN
         OVPM AS T2 ON T2.DocEntry = T1.DocNum LEFT OUTER JOIN
                          VPM1 AS T3 ON T2.DocEntry = T3.DocNum
    where T0.DocDate>='[%0]' and T0.DocDate<='[%1]'

    Hi,
    Try this:
    SELECT   
    CASE WHEN T0.DocStatus = 'O' THEN 'OPEN'
    WHEN T0.DocStatus = 'C' THEN 'CLOSED'  END  AS 'Document Status',
    T0.DocDate AS 'Posting Date',
    T0.DocNum AS 'Doc.No',
    T0.NumAtCard,
    T0.TransId AS 'Trans. No.',
    T0.Comments AS 'Remarks',
    T0.CardCode AS 'Offset Acct',
    T0.CardName AS 'Offset Acct Name',
    sum(T0.DocTotal) + (T0.WTSum) as 'DocTotal',
    T3.DueDate AS 'Cheque Date',
    T3.CheckSum AS 'Amount'
    FROM         ODPO  T0 LEFT OUTER JOIN
                          VPM2  T1 ON T0.ObjType = T1.InvType AND T0.DocEntry = T1.DocEntry
    LEFT OUTER JOIN
         OVPM  T2 ON T2.DocEntry = T1.DocNum LEFT OUTER JOIN
                          VPM1  T3 ON T2.DocEntry = T3.DocNum
    where T0.DocDate >= '[%0]' and T0.DocDate <='[%1]'
    group by T0.DocStatus,T0.DocDate ,
    T0.DocNum ,
    T0.NumAtCard,
    T0.TransId ,
    T0.Comments ,
    T0.CardCode,
    T0.CardName ,
    T0.WTSum ,
    T3.DueDate ,
    T3.CheckSum
    Thanks & Regards,
    Nagarajan

  • SAP Query (SQ02) - Repeated Data

    Hi Gurus,
    I'm using the SAP Query tools to build a report.
    I have to compare four table but I have a problem: Data comes repeated.
    In the outbound delivery, I need to check for one position and material number the stock that I have in two differente storage type in the WM module.
    When I execute the query, the item line of the delivery as well as its quantity is repeated as much as storage bin found for this material:
    Oubound Delivery Number  Item  Material     Delivery Quantity    Storage bin    Storage bin quantity
    80000000230--1XXXXXXXX1AD1--
    60
    80000000230--1XXXXXXXX1AD2--
    40
    80000000230--1XXXXXXXX1AD3--
    35
    80000000230--1XXXXXXXX1AD4--
    60
    I would like the result to appear as follows, but i don't any programming knoledge. I know there is an option to put some coding in the query. Could anyone guide me or give me a piece of the code that I would have to put ?
    80000000230--1XXXXXXXX1AD1--
    60
    AD2----
    40
    AD3----
    35
    AD4----
    60
    Best regards,
    Remi

    Assuming that you are outputting your query as an ALV list, use the sorting functionality to get the display to look exactly as you have depicted.   In the ALV display, select the first two columns and click on the sort button.

  • Use data in structure in SAP Query

    I am creating a SAP query using a logical database but will like to include data from a Structure can anyone help me.

    Do not worry about this topic, I have obtained the result by myself, it can be done with global variables. The error was in the initialization of some of the variables involved.
    Thank you any way and forgive me for the disturbance.
    Sinceresly,
    Miguel.

  • SAP Query Display data from 2 internal tables

    Hi ABAP Gurus,
    I am developing a SAP Query.
    I have created an infoset with the custom infotype 9050 and added the table ZPA9050 into the Infoset.
    How do I input values to the ZPA9050 fields? A checkbox for making a Selection field is not available in the Query (SQ01)
    For every pa9050 entry there exist multiple records of ZPA9050. I need to display the pa9050 fields in the 1st row and the corresponding zpa9050 fields in the subsequent rows.
    Kindly advise how to accomplish this task. 
    A quick reply is highly appreciated.
    Useful answers will be rewarded.
    Thanks
    Sriram

    Hi Deepika,
       Your reqirement is to print data from the two internal tables ..and if u r not using interactive alv  then u need to merge data into single internal table... if anycase u dont want to merge in the table itab as u told u can use another final internal table in which u can merge data from the two previous interal tables then u pass this final internal table to ur FM.
    Thanks & Regards
    Ashu Singh

  • Extracting SAP Query,Infoset  Data from VB Application

    Hi,
    I need to get all SAP Queries,Infosets and SAP Query Group data from a VB application.
    I have found a Remote Enabled Function called    IQAPI_READ_QUERY_CATALOG.
    But when I call the Function from a VB application ,the call is not successful and even I am not getting any exception.
    The call is getting false with null exception .
    Can anyone please guide me.
    Or is there any other function module /procedure / table to extract SAP Query ,Infoset,SAP Query Group data??
    Thanks in Advance.

    http://stackoverflow.com/questions/3765373/how-do-i-do-a-select-distinct-using-a-sap-infoset-query

  • PDV and SAP Query - Missing Date Params

    Hello,
    I am working on getting an SAP Query onto our MSS portal using the PDV SAPQuery template.  I want the query to report data as of 1/1/06 but cannot seem to get it to work.  I set up a variant in the system to set the dates but the iview seems to overwrite the date settings at runtime. 
    The function module that is called by this iview seems to be looking for the parameters Begin_Date and End_Date but the iview does not have any such parameters.  Are these supposed to be delivered with the template?  Is there a way to add them?  Has anyone else sucessfully implemented a time sensitive query in the PDV? 
    Thank you,
    Josh

    Hi Josh,
    I ran into the same problem.
    I cannot select any dates. When I run the query without variant, I get results valid only on the system date. If I try to use a query variant with a selected period, I get the message that no dates can be selected.
    Have you or anybody solved the problem?
    Beata

Maybe you are looking for