How to create a query for purchase document releases
Need to create a query and generate a list of purchase document releases? Learn how in this user-submitted developer tip.
It is possible to generate a complete list of purchase document releases with the purchase document number (requisitions...
Continue Reading This Article
Enjoy this article as well as all of our content, including E-Guides, news, tips and more.
and orders), releaser, release date and release time.
* First, create an Infoset using transaction SQ02 directly reading from table CDPOS and create an additional table: CDHDR. If you are releasing purchase requsitions at the item level, it is convenient to create an additional field (PURPS LIKE EBAN-BNFPO) to capture the item number. Once the field is defined add the following code to it:
PURPS = CDPOS-TABKEY+14(5).
Once created, make sure to assign your Infoset to the user groups.
* Second, create an SAP Query (SQ00) or QuickViewer (SQVI) based on the Infoset you created previously. Set CDPOS-OBJECTID, PURPS (additional field), CDHDR-USERNAME, CDHDR-UDATE & CDHDR-UTIME, CDPOS-TCODE, CDPOS-VALUE_NEW, and CDPOS-VALUE_OLD as list fields (display screen).
Set CDPOS-OBJECTCLAS, CDPOS-OBJECTID, CDPOS-TABNAME, CDPOS-FNAME, CDPOS-CHANGIND, CDHDR-USERNAME, CDHDR-UDATE & CDHDR-UTIME as the selection fields (selection screen).
* Finally, execute your query. For filtering purchase requisition releases set:
Object class='BANF'
Table Name='EBAN'
Field Name='FRGKZ'
Change type='U'
For filtering purchase order releases set:
Object class='EINKBELEG'
Table Name='EKKO'
Field Name='FRGKE'
Change type='U'
Make sure to specify username, dates or purchase document number (object value) in order to reduce run times.