cancel
Showing results for 
Search instead for 
Did you mean: 

Max time & date in SAP query

0 Kudos

Hi,

I'm trying to make a SAP query for table LTAP with the following fields:

LTAP-LGNUM (Warehouse Number)

LTAP-MATNR (Material Number)

LTAP-WERKS (Plant)

LTAP-NLTYP (Destination Storage Type)

LTAP-NLPLA (Destination Storage Bin)

LTAP-PQUIT (Indicator: confirmation complete)

LTAP-QDATU (Date of confirmation)

LTAP-QZEIT (Time of confirmation)

The idea here is, by entering with warehouse number, plant, storage type and with some materials. Get the last storage bin where the material was stored.

Is it possible to create a  Z field with code in the coding area of the info-set (one for max LTAP-QDATU and one for max LTAP-QZEIT)?

Can some one provide it?

Thanks in advance.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Yes this is possible create a z field and write the required code form featching the data in SQ02.

and this very easy to make, prove on which basis you want to calculate the field so that we may provide you the code.

regards,

Abdul Rahim

0 Kudos

Hi Shaik,

As an example, with the data below (table 1), by entering in the query with fields LGNUM, MATNR, WERKS, NLTYP, VLTYP and PQUIT (Indicator: confirmation complete), I want to get for material A and material B the storage bins with last confirmation date and confimation time. After process the query, the result should be as shown in table 2.


As I understant, QDATU and QZEIT, should be ZQDATU an ZQZEIT so we can insert the coding.

In which one of the code sections should the code be inserted?

Table 1:

LGNUMNLTYPMATNRMAKTXNLPLAQDATUQZEIT
XXXYYYMAT AAAAAACC-YY-ZZ17-09-201315:34:52
XXXYYYMAT AAAAAADD-YY-ZZ07-10-201317:04:19
XXXYYYMAT AAAAAAEE-YY-ZZ07-10-201317:04:22
XXXYYYMAT AAAAAAFF-YY-ZZ09-10-201310:12:58
XXXYYYMAT BBBBBBGG-AF-0217-09-201315:34:52
XXXYYYMAT BBBBBBHH-AF-0317-09-201315:34:53
XXXYYYMAT BBBBBBII-AF-0207-10-201317:04:19

Table 2:

LGNUMNLTYPMATNRMAKTXNLPLAQDATUQZEIT
XXXYYYMAT AAAAAAFF-YY-ZZ09-10-201310:12:58
XXXYYYMAT BBBBBBII-AF-0207-10-201317:04:19

Thanks in advance.

Former Member
0 Kudos

Dear,

what is your exact requirement let me know so that i can guide you accordingly, what is once of MAX

LTAP-QDATU and one for max LTAP-QZEIT)?


when LTAP is having the field you can fetch them directly, if the field is not available or the field is external field. then we can write the code and populate it then the infoset.


Regards,

Abdul Rahim

0 Kudos

Hi,

The result shown should be, by selecting MAX LATAP-QDATU and then by MAX LTAP-QZEIT, having just one line for each material.

Is a direct read to table LTAP, if it's not needed a Z field better.

Regards,

0 Kudos

Hi Shaik Abdul,

Can you please provide de code for the above issue?

Regards,


JL23
Active Contributor
0 Kudos

Have a look into this document, it explains the usage of user defined fields: Infoset Query: User Defined Fields

You can find more documents/blogs/wikis  in SCN if you use the search term: query infoset own field