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: 

user exit in ME21N

Former Member
0 Kudos

hi everybody

I have added 2 additional fields(zzqty, zzprice) at item level in PO, Ive also added the subscreen in me21N

My requirement is that these 2 fields should be copied from the fields menge and netpr for each line

I have coded the following in the user exit

EXIT_SAPMM06E_016

DATA: ekpo type ekpo.

ekpo = i_ekpo.

ekpo-zzqty = i_ekpo-netpr.

ekpo-zzprice = i_ekpo-netpr.

FREE MEMORY ID 'CUS_AKTYP'.

EXPORT aktyp FROM I_AKTYP TO MEMORY ID 'CUS_AKTYP'.

EXIT_SAPMM06E_018

data: ekpo type ekpo.

move-corresponding ekpo to e_ci_ekpo.

but its not working

can somebody tell me wat im missing?

14 REPLIES 14

Former Member
0 Kudos

what are you trying to do and what is not working?

anyway your export command is wrong, it shoudl be EXPORT to ; not export from

former_member188685
Active Contributor
0 Kudos

i am not sure what you are doing///?

EXIT_SAPMM06E_016

DATA: ekpo type ekpo.

ekpo = i_ekpo.
ekpo-zzqty = i_ekpo-netpr.
ekpo-zzprice = i_ekpo-netpr.
"where are you exporting the data..?
"you are exporting only AKTYP 
"what about EKPO
FREE MEMORY ID 'CUS_AKTYP'.
EXPORT aktyp FROM I_AKTYP TO MEMORY ID 'CUS_AKTYP'.

EXIT_SAPMM06E_018

data: ekpo type ekpo.
"Where is the Import...?
move-corresponding ekpo to e_ci_ekpo.

0 Kudos

so how it should be?

0 Kudos

if you can tell me what you want to achieve , i can tell you what to code.

but as of now you can try with the below coding,

EXIT_SAPMM06E_016

DATA: ekpo type ekpo.
 
ekpo = i_ekpo.
ekpo-zzqty = i_ekpo-netpr.
ekpo-zzprice = i_ekpo-netpr.
EXPORT ekpo FROM ekpo TO MEMORY ID 'SOMEID'.

EXIT_SAPMM06E_018

data: ekpo type ekpo.

import ekpo to ekpo from memory id 'SOMEID'. 
"this id is should be same as above

move-corresponding ekpo to e_ci_ekpo.

0 Kudos

Im trying to copy the values of ekpo-menge to ekpo-zzqty

is it the code that u wrote previously?

thanks a lot

0 Kudos

>is it the code that u wrote previously?

you are moving price to qty , i am scared. and at this point i can't help you, until unless you mention what you are doing, it is not possible to proceed further.

0 Kudos

then why are you passign netprice to zzqty?

ekpo-zzqty = i_ekpo-netpr.

0 Kudos

i wrongly assigned, i was only testing it

sorry for that

im getting another problem

in fact when i click on the item line, the zzqty field is 0.000 even if the field menge is 2.000

but on saving, the values zzqty is getting saved

is there another exit where theres the possibility to click on the item line and the value zzqty is displayed as the exact copy of the field menge?

0 Kudos

Hi Shreya,

Probably you need to adjust your database through transaction SE14. This might resolve your problem.

Just enter the table on which you are entering new fields and click on the Adjust button it might fix your problem.

There are many cases where you need to adjust your table while adding new fields in the standard table.

Thanks,

Chidanand

0 Kudos

Hi Chidanand

thats not possible

the fields are getting updated in table ekpo but im not able to display them on screen

e.g. when I double click on an item line, the additional fields zzprice is not getting displayed

how we do that?

0 Kudos

Where do you ahev the Z fields on the screen?

0 Kudos

They are on item level, on the tab screen for item, where there are screens for Invoice, Account Assignment etc

the data are saved but cannot be displayed using tcode ME23N or by double clicking on an item line

thats why I was asking if there was any user exit for displaying the data or any other additional coding I should do to display the data

0 Kudos

What is the screen#? what is the field name on the screen you put? can you debug to see what is the field value in PBO for that screen in ME23

0 Kudos

if you are familiar with BADI's then check this BADI ME_GUI_PO_CUST

see the example implemenation class CL_EXM_IM_ME_GUI_PO_CUST , to know how to use the methods, how to populate the information to screen (from database) . from database to screen.