Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

add zfield on headerlevel

Former Member
0 Kudos

Dear Abap Experts,

the requirement is to add a zfield (zdate) on headerlevel into the tabstrip 'Additional Data' at T-code ME21N (Create Purchase Order). Privously it was easier to implement such requirements through USER EXIT MM06E005.

But with the new T-code ME21N i have no idea how to do that.

I have added a field in the structure MEPO1229 in order to see whether it is visible within t-code ME21N since other fields

are defined right in this structure too. It was unsuccessful .

Later the field vale which has been enteren must be inserted into EKKO-zdate.

Can you please tell me the procedured to achieve this ?

Regards

MArco M.

8 REPLIES 8

Sandra_Rossi
Active Contributor
0 Kudos

This question should be asked in Enhancements forum. I don't understand why you have an issue with MM06E005, it should still work (it works in ECC 6)

Former Member
0 Kudos

MM06E005 doesnt influence ME21N

Regards

Marco

0 Kudos

Hi Marco,

I had the same requirement recently and we have done it successfully.

You can use enhancement "MM06E005" to add screen fields.

For header levee fields, add field in CI_EKKODB. For item level fields, add field in CI_EKPODB.

Sample code in EXIT_SAPMM06E_006 as follows:

gl_aktyp = i_trtyp.

gl_no_screen = i_no_screen.

ekko-zzevers = i_ci_ekko-zzevers .

IF NOT gl_aktyp EQ 'A'.

IF ekko-zzevers is initial.

ekko-zzevers = 'Z1' .

ENDIF.

IF ekko-zzevers NE i_ci_ekko-zzevers.

gl_ekko_ci-zzevers = ekko-zzevers .

ENDIF.

ENDIF.

Also if you want to add any validations, you can implement BADI "me_process_po_cust". It is working for us.

Let me know if you know some more details.

Regards,

Anil Salekar

Former Member
0 Kudos

Hello Anil thank you for much your reply.

I would rather like do that without BADI implementation. This would be my first BADI implementation.

Is it possible to achieve that through MM06E005. The problem what I have is.

For T-code me21 me22 me23 I have already implemented this requirement through MM06E005.

But for transaction ME21n ? I cant see this changes there. What has to made to see the result there.

All what I need is a ZField at headerlevel in the tabstrip 'Additional Data' at T-code ME21N .

Regards

Marco

0 Kudos

Hi Marco,

Using same enhancement, I have added 2 custom fields at header level on tabstip "Customer Data". I was able to save data into database as well as I was able to retrieve data from database. This is done for ME21N itself. You may be missing something.

I made those fields manadatory but the problem was validations were not getting fired unless user click on tab "Customer Data" so I have added validations in the BADI.

Regards,

Anil Salekar

0 Kudos

Hi Anil,

can you pls. try to give me more details on what you said.

What do you mean with enhancement

I dont need any validations. How can I achieve this requirement with MM06E005 ?

In the other transactions(me21,me22, me23) I have already implemented the req. .

All what I need now is ME21N

0 Kudos

Hi Marco,

Please find the sample code below.

----


  • INCLUDE LXM06F36 *

----


*

  • store transaction type for later modification of screen attributes

*

gl_aktyp = i_trtyp.

gl_no_screen = i_no_screen.

*

  • store current state of customer data in ekko_ci (structure for screen)

*

ekko_ci = i_ci_ekko.

*

  • store reference document

*

if i_rekko-ebeln ne gl_rekko-ebeln and

not i_rekko-ebeln is initial and

gl_rekko-ebeln is initial.

ekko_ci-zzflag = i_rekko-zzflag.

gl_rekko = i_rekko.

endif.

----


  • INCLUDE LXM06F37 *

----


*

  • e_ci_ekko is the returning parameter

  • gl_ekko_ci : values stored at PBO

*

e_ci_ekko = gl_ekko_ci.

*

  • ekko_ci contains the actual values of the Dynpro fields

  • e_ci_update is only set if you really want the fields

  • on the Dynpro to be saved. You must set it then to 'X'

  • the field ekko_ci-zzflag will here only be saved if there

  • was a change and the transaction is not in display mode

*

if gl_ekko_ci-zzflag ne ekko_ci-zzflag.

e_ci_ekko-zzflag = ekko_ci-zzflag.

if gl_aktyp ne 'A'.

e_ci_update = 'X'.

endif.

endif.

----


  • INCLUDE LXM06F38 *

----


*

  • store ekko to gl_ekko

*

move-corresponding i_ekko to gl_ekko_ci.

----


  • INCLUDE LXM06F39 *

----


clear: ekko_ci,

ekpo_ci,

gl_no_screen,

gl_aktyp,

gl_ekko_ci,

gl_rekko,

gl_ekpo,

gl_ucomm.

refresh: gt_ref_ekpo_tab.

----


  • INCLUDE LXM06F40 *

----


*

  • move stored global values back to the returning structure

*

e_ci_ekpo = gl_ekpo_ci.

*

  • in case the Button was clicked the value of ekpo_ci-zzfield

  • will be taken from the copied PO

*

if i_ucomm = 'ZZDETERMINE'.

data: ls_ref_ekpo like line of gt_ref_ekpo_tab.

*

  • gt_ref_ekpo_tab contains all positions of the copied PO

*

read table gt_ref_ekpo_tab into ls_ref_ekpo

with key ebelp = gl_ekpo-ebelp.

if sy-subrc is initial.

ekpo_ci-zzfield = ls_ref_ekpo-ekpo-zzfield.

endif.

else.

*

  • return the function code of the Screen. This code will be handled

  • in the SAP program. It can only be handled if you use SAP function

  • codes

*

e_ucomm = i_ucomm.

endif.

*

  • ekko_ci contains the actual values of the Dynpro fields

  • e_ci_update is only set if you really want the fields

  • on the Dynpro to be saved. You must set it then to 'X'

  • the field ekko_ci-zzfield will here only be saved if there

  • was a change and the transaction is not in display mode

*

if gl_ekpo_ci-zzfield ne ekpo_ci-zzfield.

e_ci_ekpo-zzfield = ekpo_ci-zzfield.

if gl_aktyp ne 'A'.

e_ci_update = 'X'.

endif.

endif.

----


  • INCLUDE LXM06F41 *

----


data: ls_ref_ekpo like line of gt_ref_ekpo_tab.

*

  • store transaction type for later modification of screen attributes

*

gl_aktyp = i_aktyp.

gl_no_screen = i_no_screen.

*

  • store current state of customer data in ekko_ci (structure for screen)

*

ekpo_ci = i_ci_ekpo.

gl_ekpo = i_ekpo.

if not i_rekpo-ebeln is initial and

not i_ekpo-ebelp is initial.

clear ls_ref_ekpo.

read table gt_ref_ekpo_tab into ls_ref_ekpo

with key ebelp = i_ekpo-ebelp.

if ls_ref_ekpo-ekpo-ebeln ne i_rekpo-ebeln and

ls_ref_ekpo-ekpo-ebelp ne i_rekpo-ebelp.

ls_ref_ekpo-ebelp = i_ekpo-ebelp.

ls_ref_ekpo-ekpo = i_rekpo.

if sy-subrc is initial.

modify gt_ref_ekpo_tab from ls_ref_ekpo index sy-tabix.

else.

append ls_ref_ekpo to gt_ref_ekpo_tab.

endif.

endif.

endif.

----


  • INCLUDE LXM06F42 *

----


move-corresponding i_ekpo to gl_ekpo_ci.

gl_ekpo = i_ekpo.

Also refer SAP Notes 0000206043, 0000407975 and 000040801.

If you still face the problems, please let me know.

Regards,

Anil Salekar

Former Member
0 Kudos

I have solved the prbl by my self