Skip to Content
author's profile photo Former Member
Former Member

Abap: How to get the maximum date of IT 0105 when several subtypes exist (several AEDTM)

Hi all,

I'm all fresh in Abap programming and I am stuck with the following:

I must retrieve the maximum date of change (AEDTM) of the infotype 0105, for all subtypes of IT 0105.

E.g.: Subtype 1 AEDTM = 21.09.2012

Subtype 2 AEDTM = 12.09.2012

Subtype 3 AEDTM = 27.09.2012

Subtype 4 AEDTM = 17.11.2011

I want to get the maximum AEDTM which is 27.09.2012.

How is it possible to do that?

Thanks in advance for your help;

Angie

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 02, 2012 at 08:43 PM

    I think you can have something similar to:

    SELECT max( AEDTM ) from PA0105 INTO TABLE IT_PA105 GROUP BY PERNR.

    Remember to create your internal table accordling to the fields you want to retrieve.

    My question will be why do you need the maximum AEDTM? Are you sure is not the ENNDA? Because every subtype represent something different. I don't think you should be retieving just the new one.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      If you only want only one record it doesn't matter how many PERNR are in the table Sumitha answer will work flawlesly.

      But remember that IT0105 store different comunication data. That is the reason of the differents subty.

  • Posted on Oct 03, 2012 at 09:11 AM

    Hi Angie,

    You must be using your logical database right.

    So I assume that you would be using your get pernr or get peras statement in the program.

    To get the last changed record.

    get peras . "(If pnpce database is used)

    .......

    sort p0105 by aedtm descending.
    read table p0105 index 1.

    Now p0105 will have the last changed record in IT 0105.

    Similarly you can do it for the other infotypes.

    Thanks,

    Susmitha

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 24, 2013 at 07:52 PM

    I found this worked, tested by changing ascending to descending, can get last or first that way.

    *get most current record (last by date/time)
    select * from ZTT_JCDS up to 1 rows into CORRESPONDING FIELDS OF ES_ADDL_PR_DATA
    where objnr = lv_objnr
    order by udate descending utime descending.
    ENDSELECT.

    Good luck!

    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.