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 function module include how to write the code

Former Member
0 Kudos

hi all,

i am creating user exit for ME22N using this enhance MM06E005 .

in this i created subscreen and set some fields .

that data has to be stoe in EKPO.

inside the include i have to write the logic plz guide me how to follow .

once i enter it will store on wish internal table and wish internal table to shall i move to EKPO .

If Tcode is ME23N how to display data in disable mode.

Regards,

Hari.

3 REPLIES 3

jaideepsharma
Active Contributor
0 Kudos

Hi,

Check the function module interface of the user exit and see what structures are available to you ?

You will have to declare your own internal tables and pass the data to the tables parameter in the function module.

Press Enter to skip the warning message and you can go into the include and write your code.

KR Jaideep,

0 Kudos

This is the code inside the function module .

once i enter data in custom field the below wish table it will store.

FUNCTION EXIT_SAPMM06E_016.

*"----


""Lokale Schnittstelle:

*" IMPORTING

*" VALUE(I_EKPO) LIKE EKPO STRUCTURE EKPO

*" VALUE(I_AKTYP)

*" VALUE(I_CI_EKPO) LIKE EKPO_CI STRUCTURE EKPO_CI

*" VALUE(I_BSTYP) LIKE EKKO-BSTYP

*" VALUE(I_NO_SCREEN)

*" VALUE(I_LFA1) LIKE LFA1 STRUCTURE LFA1

*" VALUE(I_LFM1) LIKE LFM1 STRUCTURE LFM1

*" VALUE(I_EKKO) LIKE EKKO STRUCTURE EKKO

*" VALUE(I_REKPO) LIKE EKPO STRUCTURE EKPO OPTIONAL

*" VALUE(I_KEKPO) LIKE EKPO STRUCTURE EKPO OPTIONAL

*" VALUE(I_AEKPO) LIKE EKPO STRUCTURE EKPO OPTIONAL

*" VALUE(I_REBAN) LIKE EBAN STRUCTURE EBAN OPTIONAL

*" VALUE(I_MT06E) LIKE MT06E STRUCTURE MT06E OPTIONAL

*" VALUE(I_EINA) LIKE EINA STRUCTURE EINA OPTIONAL

*" VALUE(I_EINE) LIKE EINE STRUCTURE EINE OPTIONAL

*" VALUE(I_EKPO_OLD) LIKE EKPO STRUCTURE EKPO OPTIONAL

*" VALUE(I_KOMP) LIKE KOMP STRUCTURE KOMP OPTIONAL

*" VALUE(I_ENJ_CALL) OPTIONAL

*" TABLES

*" TEKPO STRUCTURE BEKPO OPTIONAL

*" TEKET STRUCTURE BEKET OPTIONAL

*" TEKKN STRUCTURE EKKNU OPTIONAL

*" TKOMV STRUCTURE KOMV OPTIONAL

*"----


INCLUDE ZXM06U41 .

ENDFUNCTION.

inside the INCLUDE ZXM06U41 . i writen this code

&----


*& Include ZXM06U41

&----


DATA :

FS_EKPO TYPE EKPO_CI.

IF ( SY-TCODE EQ 'ME22N' OR SY-TCODE EQ 'ME23N'

OR SY-TCODE EQ 'ME22' OR SY-TCODE EQ 'ME23' ) .

LOOP AT TEKPO.

IF ( TEKPO-EBELN EQ i_EKPO-EBELN

AND TEKPO-EBELP EQ i_EKPO-EBELP ) .

EKPO_CI-ZMATERIAL = TEKPO-ZMATERIAL.

EKPO_CI-ZQUANTITY = TEKPO-ZQUANTITY.

EKPO_CI-ZUNIT = TEKPO-ZUNIT.

EKPO_CI-ZPRICE = TEKPO-ZPRICE.

EKPO_CI-ZCURRENCY = TEKPO-ZCURRENCY.

ENDIF.

ENDLOOP.

ENDIF.

Regards,

Hari.

0 Kudos

Hi,

Can you please be more clear in your requirement ?

KR Jaideep,