Application Development and Automation 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: 
Read only

USEREXITS

Former Member
0 Likes
666

can any body tell hw to add customer fields in purchase document.

i got the user exit for that it is MM06E005

hw can i do it... can anybody gv me the code for it..... plz help me

4 REPLIES 4
Read only

Former Member
0 Likes
603

Hi,

look in txn CMOD or SMOD, check enhancement 0VRF0001. It uses function module EXIT_SAPL0VRF_001. It is used to manipulate route determination for SD.

Here is the code

DATA: ls_xvbpa LIKE xvbpa,

lf_aland LIKE tvst-aland,

lf_azone LIKE tvst-azone,

lf_lland LIKE trolz-lland,

lf_lzone LIKE trolz-lzone,

ls_vbadr LIKE vbadr,

ls_xvbap LIKE xvbap,

ls_tvst LIKE tvst,

lv_route LIKE trolz-route.

LOOP AT xvbap INTO ls_xvbap.

IF NOT ls_xvbap-vstel IS INITIAL.

SELECT SINGLE * FROM tvst

INTO ls_tvst

WHERE vstel EQ ls_xvbap-vstel.

IF sy-subrc = 0.

lf_aland = ls_tvst-aland.

lf_azone = ls_tvst-azone.

ENDIF.

ENDIF.

READ TABLE xvbpa INTO ls_xvbpa WITH KEY vbeln = ls_xvbap-vbeln

posnr = ls_xvbap-posnr

parvw = 'Q1'.

IF sy-subrc = 0.

CALL FUNCTION 'SD_ADDRESS_GET'

EXPORTING

fif_address_number = ls_xvbpa-adrnr

IMPORTING

fes_address = ls_vbadr

EXCEPTIONS

address_not_found = 1

address_type_not_exists = 2

no_person_number = 3

OTHERS = 4.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ELSE.

lf_lland = ls_vbadr-land1.

lf_lzone = ls_vbadr-lzone.

ENDIF.

ENDIF.

CALL FUNCTION 'SD_ROUTE_DETERMINATION'

EXPORTING

i_aland = lf_aland

i_azone = lf_azone

i_lland = lf_lland

i_lzone = lf_lzone

IMPORTING

e_route = lv_route

EXCEPTIONS

no_route_found = 1

departure_error = 2

destination_error = 3

invalid_generic_key = 4

customer_exit_error = 5

OTHERS = 6.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ELSE.

ls_xvbap-route = lv_route.

MODIFY xvbap FROM ls_xvbap TRANSPORTING route.

ENDIF.

ENDLOOP.

Regards

Read only

0 Likes
603

its gving an error mesage field xvbpa is unknown.

hw could i correct it kiran

Read only

Former Member
0 Likes
603

Satish,

First in the table EKKO double clink on CI_EKKODB and create that customer include and add new fields.

If you need to add the fields at header level implement below user exits

EXIT_SAPMM06E_006

EXIT_SAPMM06E_007

For Item level

EXIT_SAPMM06E_016

EXIT_SAPMM06E_017

Create Subscreen from SE51 Transaction Program SAPLXM06

Screen 0101 for header, 0111 for Item.

Regards,

Satish

Read only

Former Member
0 Likes
603

You can use the enhancement AMPL0001 to add your own fields to purchasing info record transaction

OR

This enhancement allows customers to specify their own criteria for the

admissibility of manufacturer parts.

The procedure is as follows:

1. You define your fields in INCLUDE CI_AMPL.

2. You specify these fields in the subscreen.

3. Using the function exit EXIT_SAPLMBAM_001, you pass on the field

contents from the INCLUDE CI_AMPL to your subscreen.

Customer-specific data can be entered, changed, or displayed on this

subscreen.

4. You use the function exit EXIT_SAPLMBAM_002 to pass entered and

changed data back to the standard program.

Reward points if found helpful....

Cheers,

Chandra Sekhar.