Skip to Content

Problem with GDATU field to get the year

Dear Friends,

I am writing select query on TCURR table , but unable to get the values from table because of the GDATU field as I am passing this from input screen as fiscal year in where condition and this is not matching with the GDATU as this is in different format.

I mean to say i have to fetch year from this GDATU so that I can pass this to input screen in where condition so that I can get the records from TCURR.

Please help me if you have idea .

MY query is as follows.

SELECT kurst

tcurr

gdatu

ukurs

FROM tcurr

INTO TABLE gt_tcurr1

WHERE kurst = 'F'

AND tcurr = 'GBP'

AND gdatu = if2. (input screen project defintion(for ex: fiscal year as 2013 as I have to take year from gdatu))

soon reply is highly appreciated .

Thanks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Nov 18, 2012 at 08:08 AM

    About SCN is for general SAP Community Network related discussions only.

    To get a quick (or any) response, create your new discussion in a space related to your query. This way it will be visible to topic experts who will then see and reply to it. The SCN Site Index contains a full listing of all SCN spaces.

    I believe this belongs in ABAP Development so I will move it to that space now.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 19, 2012 at 03:43 AM
    Hi, the date GDATU in table TCURR is an inverted date. To get it you need to subtract the date from 99999999. Regards Jack DATA gdatu(08) TYPE n.DATA gdatu_inv TYPE gdatu_inv.DATA gdatu_where TYPE wheretxt.
    CONCATENATE if2 '0000' INTO gdatu.gdatu_inv = 99999999 - gdatu.CONCATENATE gdatu_inv(04) '____' INTO gdatu_where.
    SELECT kurst tcurr gdatu ukurs FROM tcurr INTO TABLE gt_tcurr1 WHERE kurst = 'F' AND tcurr = 'GBP' AND gdatu LIKE gdatu_where.
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 19, 2012 at 07:46 AM
    • First convert fiscal year to a date range with a FM like FIRST_AND_LAST_DAY_IN_YEAR_GET
    • Then convert it into an inverted date with statement CONVERT DATE wa_date INTO INVERTED-DATE wa_gdatu. (CONVERT - INVERTED-DATE)
      NB: don't forget to switch between low and high values in the range.

    Regards,

    Raymond

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.