Sapass

 Simplify SAP R/3 development with Excel VBA/VB RFC  
Home> UserExit>MEQUERY1



Index

MEQUERY1

User Exits: Purchase Requisition
Using this enhancement, you can:
  • Execute selection variants with your own queries
  • Overwrite and/or remove standard queries
  • Save your own selection variants
  • Save your own layout variants for selection variants

You can use this enhancement to create your own selection variants for the document overview, and then to include these in the selection menu for selection variants.
You can use these selection variants to execute your own, previously generated queries. You can also create your own variants for existing standard selections. Furthermore, you can assign your own layout variants to each selection variant.

Function exit 001:

EXIT_SAPLMEQUERY_001

In this function module, you can define an ID for your selection variant in the Class ID field, and a name in the Label field.

The ID that you define must be within the customer name range in order to prevent conflicts with existing IDs. For this reason, the ID should always begin with the letter 'Z'. This ID is required in order for you to be able to access the variant again.

The name is the description under which the variant will be displayed in the selection menu.

Note
Note, that the name is displayed in the interface, and is therefore language-dependent.

You can also remove the standard variants. All variants displayed are stored in table META_TABLE.
The class IDs in the standard system are stored in the type group MMPUR.

Funktion exit 002 :

EXIT_SAPLMEQUERY_002

In this function module, you can store the relevant required parameters for your selection variant. This function module is used for each selection variant that is used in the selection menu. Using the classid, you can change the following parameters:

  1. ch_queryname: Name of the query that must first be created using transaction SQ01, or usage of the SAP standard queries.
    To be able to use the standard queries, you must explicitly set the global work area using the variables ch_workspace.
  2. ch_usergroup: Name of user group to which the query is assigned.
  3. ch_variant: Name of the variant to be used to start the query.
    If you do not require a variant, then you can also transfer ' '.
  4. ch_handle: The handle you enter here enables you to find the layout variants for the selection again.
    You can also control the layout of the various selections in the document oveview using various layout variants. To store different layout variants for different selections, a handle is required. When you execute a selection variant, you can then choose from all the layout variants stored under a certain handle, or you can set a layout variant as an initial variant that is used for each new call.
    The handles already defined in the standard system are 0001 for purchase orders and 0002 for purchase requisitions. You can define your own handles from 9000.
  5. ch_workspace: If an X is transferred here, then the global work area is used and the system searches there for the query. For ' ', the system searches for the query in the local work area. Normally, only SAP queries are available in the global work area.

Example data is available for each function exit. You can call these up by displaying the components for the enhancement, and then displaying the function code for the function module you require.

Purchase order (Transactions ME21N / ME22N / ME23N)

If you want to use the Drag and Drop function in the shopping basket, or want to copy documents from the document overview into the purchase order (Using the icon Copy @14@ or by double-clicking on the document number), then you must include the following fields in the field selection for the query:

  • EKKO-BSTYP : Document category
  • EKKO-EBELN : Document number
  • EKPO-EBELP : Document item

If you do not include these fields in the selection, then you cannot copy the document into the purchase order.

Purchase requisition (Transaction ME51N / ME52N / ME53N)

If you want to use the Drag and Drop function in the shopping basket, or if you want to be able to copy documents from the document overview into the purchase requisition (Using the icon Copy @14@ or by double-clicking on the document number), then you must include the following fields in the field selection for the query:

  • EBAN-BANFN : PReq number
  • EBAN-BNFPO : PReq item

You must also define these fields as key fields.

Class IDs and corresponding parameters used by SAP:

Class ID Label Query

mmpur_dbl_po Purchase Orders MEPO

mmpur_dbl_rfq RFQs MEPO

mmpur_dbl_agreemnt Contracts MEPO

mmpur_dbl_schdlagrmnt Scheduling Agreements MEPO

mmpur_dbl_purchdocs General Purchasing Docs. MEPO

mmpur_dbl_req Purchase Requisitions MEBANF

mmpur_dbl_po_usr Meine Bestellungen MEPO

mmpur_dbl_parkedpo_usr Held Purchase Orders MEPO

mmpur_dbl_req_usr My Purchase Requisitions MEBANF

Class ID Variant Handle Workspace

mmpur_dbl_po SAP&MEPOBEST 0001 X

mmpur_dbl_rfq SAP&MEPOANFR 0001 X

mmpur_dbl_agreemnt SAP&MEPOKONT 0001 X

mmpur_dbl_schdlagrmnt SAP&MEPOLIEF 0001 X

mmpur_dbl_purchdocs 0001 X

mmpur_dbl_req SAP&MEBANF 0002 X

mmpur_dbl_po_usr SAP&MEPOBEST 0001 X

mmpur_dbl_parkedpo_usr SAP&MEPOBEST 0001 X


Function/Program:
  • EXIT_SAPLMEQUERY_001: Determine Available Datablades
  • EXIT_SAPLMEQUERY_002: Generate Query Object

02-Oct-2005