You are on page 1of 2

Modify Standard Purchasing Report Output of ME2N

By Ansumesh Kumar Samal, IBM


A very common requirement from customer is to modify the outputs of standard
reports.
Here I have tried to explain how to modify the standard report ME2N output.
Requirement
Purchase Orders by PO Number: T-code: ME2N is a standard report that
retrieves a purchase order
details via a document number and other user-defined parameters.
Minimum parameters in selection-screen we need to pass are valid PO number and the
Scope of List.
Scope of List defines the format in which report will get display.

Report output look like below.

Here in this output we need to add one additional column which will display some
information as
per the requirement. Here lets add an extra field/column and display text SAP
Technical in that.
If in scope of list field ALV format is not available then you can do the below
SPRO configuration to bring
the same. One customizing request will be generated for same.

For modifying above report output, we need to modify the underlying


database structure of the report.
And here the structure is MEREP_OUTTAB_PURCHDOC (view: basic list). Then we
can make use of
any appropriate BADI/Enhancement available for population of value to the
newly added field in the
structure.
Note: There are several other underlying applicable structures exists for this
report which can be used in
similar manner as explained below for other reporting and its
modification. Here we are modifying the
simple basic view of the purchasing report ME2N
Examples of other structures:
MEREP_OUTTAB_SCHEDLINES: Schedule Lines for List Displays in Purchasing
MEREP_OUTTAB_ACCOUNTING: Account Assignment for List Display Purchasing
Our scope for this example limits to structure MEREP_OUTTAB_PURCHDOC .Lets
do a append
structure for structure MEREP_OUTTAB_PURCHDOC in SE11

Add our new field for the report here, maintain enhancement category and then
activate.

Ignore warning message during activation if any.

Now we are done with enhancement of underlying structure. Lets execute the report
ME2N and see our
newly added field. You need to choose the field from Layout Option.

Now appropriate BADI/Enhancement needs to be used for population of value to the


newly added field
in the structure.
For this requirement we have BADI/Enhancement which varies from R3 system release
to release.
In release ECC 6.0, we have below BADI but its only for SAPs internal
use. It can not be used by
customer, so in this version of R3 we need to search for some other alternatives or
enhancement spot for
this..

However in SAP ECC release with EHP4 FOR SAP ERP 6.0 / NW7.01 we have the
same BADI with a
different name which is available for customer usage. The same is shown below

Since I have made this example in system ECC 6.0, I will be using one enhancement
spot for population
of value to the newly added field to the report.
Note: There is no specific way where you can find the appropriate
enhancementspot/point/section. I
found it by debugging standard program for the report and with little search in SDN
& Google.
When we run the report ME2N, main program SAPLMEREP will run and the include
LMEREPD02 in it.
We can find different enhancement point in the include which can be analyzed.

Creating an enhancement spot and including our custom logic in it inside


the
methodBUILD_BASE_LIST will solve our purpose.
Double click on above method, click on ENHANCE button and then scroll down to the
enhancement point
which is present immediate before ENDMETHOD statement of above method.

Create an Enhancement here and include your custom logic. This


place/enhancement will trigger for
each PO and its Items.

In this enhancement point, structure RE_OUTTAB_PURCHDOC will have all the


report output fields
including our new additional field. Code can be written here to manipulate
values for other report fields.
Write code as above Activate the enhancement .Then run the report to see the
result.

In release SAP ECC release with EHP4 FOR SAP ERP 6.0 / NW7.01 as
discussed above you can
implement the BADI and inside the implementing class you can include
your custom logic. At run time
Table CH_OUTTAB will have all the final output records.
SAP ECC release with EHP4 FOR SAP ERP 6.0 / NW7.01

Note: This is a real-time requirement and the solution is stated above. However
for this requirement we
did not follow any specific methodology or procedure to find the program name,
enhacement point name
or structure name that needs to be modified. Debugging and searching in
different sites helped us to
reach to the conclusion.

You might also like