on 01-09-2009 9:40 PM
We have created a Z field which exists on the item level of our POs (table EKPO). It is available in the search criteria of our ME2N report, but not in the output. Does anyone know of a way to add additional fields to the output of ME2N? Thanks so much.
Jim
Hi. Just append a structure to MEREP_OUTTAB_PURCHDOC and add your Z field and it will work for all the ME2 reports.
Regards,
Dave.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would add something to this. Let's say you want a new report field, say a field from MARA or something. And assume this field is not already in EKPO or EKKO. You can add it to the structure. But where do you add the ABAP code to populate the information????????????????
If the field is in EKPO or EKKO, it is as simple as adding it to the structure. Piece of cake.
There must be an enhancement for this but I haven't found it yet.
ANSWER ON HOW TO POPULATE FIELDS YOU ADDED TO STRUCTURE MEREP_OUTTAB_PURCHDOC THAT ARE NOT PART OF THE EK* TABLES LIKE EKPO, EKKO, EKET, etc.
1) Go into include program, LMEREPI02
2) Show IMPLICIT ENHANCEMENTS (Edit>Enhancement Operations>Show Implicit Enhancement Options
3) Find method "if_reader_mm~read_table" in the code
4) Create an enhancement point just before the ENDMETHOD statement
5) You should know what structure you are working with; all report data will be in <OUTTAB>
SAMPLE CODE TO PUT THERE:
FIELD-SYMBOLS <ZZZZ_OUTLINE> TYPE merep_outtab_purchdoc.
IF my_struct_name = 'MEREP_OUTTAB_PURCHDOC'.
LOOP AT <OUTTAB> ASSIGNING <ZZZZ_OUTLINE>.
YOUR FIELD WILL BE IN THIS INTERNAL TABLE SO YOU CAN DO ANYTHING YOU WANT WITH IT
ENDLOOP.
ENDIF.
Lot of thanks Ken G, I follow your code and solved the same problem.
1st I add custom field YYJ_4KSCAT in structure MEREP_OUTTAB_PURCHDOC
then do that enhancement:
Tcode: ME2N/ME2W/...
program: LMEREPI02
Method: if_reader_mm~read_table
Code:
ENHANCEMENT 1 ZME2W_CUSTOM_FIELDS. "active version
*
FIELD-SYMBOLS: <ZZ_CUSTOM> TYPE MEREP_OUTTAB_PURCHDOC.
DATA: idx TYPE sy-tabix.
IF my_struct_name EQ 'MEREP_OUTTAB_PURCHDOC'.
LOOP AT <OUTTAB> ASSIGNING <ZZ_CUSTOM>.
idx = sy-tabix.
READ TABLE <ekko> into ls_ekko WITH KEY ebeln = <ZZ_CUSTOM>-ebeln.
clear lt_ekpo[].
my_any_ekpo->read_lines( exporting im_key = ls_ekko-ebeln
importing ex_table = lt_ekpo ).
READ TABLE lt_ekpo into ls_ekpo WITH KEY ebeln = <ZZ_CUSTOM>-ebeln
ebelp = <ZZ_CUSTOM>-ebelp.
<ZZ_CUSTOM>-YYJ_4KSCAT = ls_ekpo-j_4kscat.
MODIFY <OUTTAB> FROM <ZZ_CUSTOM> INDEX idx .
ENDLOOP.
ENDIF.
ENDENHANCEMENT.
For that you Need to Modify the ME2N Report Program by copying it to Z Report.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Since it is quite simple to set up the query joining two main tables EKKO and EKPO, I would suggest to set up such simple query in either SQVI or SQ01/SQ02 instead of customizing the standard program of ME2N transaction.
Cheers,
HT
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
in that case copy the progrm of ME2N and add your required cahnges and use that program
you can not add the field in ME2N without coremod
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.