cancel
Showing results for 
Search instead for 
Did you mean: 

HOW TO LIST PM ORDER'S THE LATEST SYSTEM STATUS IN SAP QUERY

sallyxu-cn
Active Participant
0 Kudos

Hi PM Guru,

We build a query for PM orders but how can only display the order with the latest system status.

E.g. each status is represented as one line in the query.

How shall we do to make one line for each order? Either latest status or the combination of all statues?

Pls kindly help,

Sally

Accepted Solutions (0)

Answers (3)

Answers (3)

johnstog
Active Participant

You can also use fields PHAS0 (CRTD), PHAS1 (REL), PHAS2 (TECO) & PHAS3 (CLSD) in table AUFK. I have found this to be very useful in queries and CDS views for Fiori apps.

Hope this helps

sallyxu-cn
Active Participant
0 Kudos

Hi Graham,

I used AUFK in the query and if we don't use JEST for status description, one order is one line.

I think that is also an option,

Thank you,

Sally

venkateswaran_k
Active Contributor
0 Kudos

Hi

You join the AUFK and JEST with object number to get the status

Inner JOIN JCDS with same object number

(here in jcds you get the latest record by maximum of UDATE and UTIME)

AUFK --> JCDS --> link by object number where JCDS-UDATE is maximum

sallyxu-cn
Active Participant
0 Kudos

Hi Venka,

Could you please let me know how to get the max of UDATE & UTIME?

In SQ02 by adding a custom field? What is the coding?

Or SQ01, What is the formula?

Pls kindly shed more light.

Sally

Varatha_sap
Participant
0 Kudos

Hi Sally,

You have to go for a custom field in the query by concatenate all the active status from JEST table and delete the duplicate entries or use the BAPI BAPI_ALM_ORDER_GET_DETAIL in the query to get the status from export parameter ES_HEADER (SYS_STATUS).

I would request to check the standard report IW39 you will get the status and most of the details there, instead going for a query or custom developments.

Please let me know if this fix your problem.

Thanks

Varatha

sallyxu-cn
Active Participant
0 Kudos

Hi Varatharajan,

Thank you so much for your feedback.

IW39 does not have partner info.

That BAPI does have the system status.

Pls advise or direct me how to add it in SQ02.

Appreciate your extended help.

Sally

Varatha_sap
Participant
0 Kudos

Hi Sally,

Please check with your developer. You can add your code in the query. There you can pass the maintenance order number into the BAPI and get the system status and display in the query.