Documente Academic
Documente Profesional
Documente Cultură
Here if we enter the enhancement name it results the list of user exit names.
But we dont known the Enhancement name so press the Utilities > Find menu option.
Press Execute
In the above enhancements our program name SAPMV45A Matches four enhancements.
So, In the below enhancements we have to check the right one.
V45A0001
V45A0002
V45A0003
V45A0004
There is no way to get VBAK EBELN (Sales Order No.) and other header data form VBAK.
EXIT_SAPMV45A_002.
TVAK
TVTA
LIKE
Schnittstelle:
IMPORTING
STRUCTURE
TVAK
STRUCTURE
TVTA
VBAK-VKGRP
V45A0004 - Copy packing proposal Into Out bound delivery. This description implies that whenever we
create a Delivery Order from Sales Order it copies the packing proposal Based on the already created
Sales order. So, there is no chance for us to save the data while we create or change a Sales
order.
V45A0003 - Collector for customer function module pool MV45A - This description some what looks
good . But description there is no functionality mentioned. So, let us drill down.
We have 2 exits.
Function module
Short Text
EXIT_SAPMV45A_003
EXIT_SAPMV45A_004
FUNCTION
*"---------------------------------------------------------------------*"*"Lokale
*"
*"
VALUE(I_SCREEN_NAME)
*"
VALUE(I_VBAP)
LIKE
VBAP
*"
VALUE(I_VBUP)
LIKE
VBUPVB
*"
VALUE(I_SCREEN_GROUP4)
*"
VALUE(I_T180_AKTYP) LIKE T180-AKTYP
EXIT_SAPMV45A_004.
LIKE
STRUCTURE
STRUCTURE
LIKE
Schnittstelle:
IMPORTING
FELD-NAME
VBAP
VBUPVB
FELD-GRP4
From Exit 004 Description and Importing parameters we can clearly see that this exit is used for Field
modifications.
EXIT_SAPMV45A_003 - From the Description and Importing parameters we get the header data that can
be used for our requirement.
FUNCTION
*"---------------------------------------------------------------------*"*"Lokale
*"
*"
VALUE(XVBAK)
LIKE
VBAK
*"
VALUE(XVBUK)
LIKE
VBUK
*" VALUE(XKOMK) LIKE KOMK STRUCTURE KOMK
EXIT_SAPMV45A_003.
STRUCTURE
STRUCTURE
Schnittstelle:
IMPORTING
VBAK
VBUK
click on Create.
Now in the next screen (see below), click on Save and then on Enhancement assignments)
Now enter your enhancement name, click on Save and then on Components
data:
gt_exit
gs_vbeln
type
TYPE
zexit,
zexit-vbeln,
gs_inr
gs_loc type vbak-waerk value 'INR'.
CALL
MESSAGE
ID
WITH
TYPE
vbak-netwr,
FUNCTION
'CONVERT_TO_LOCAL_CURRENCY'
EXPORTING
CLIENT
=
SY-MANDT
date
=
sy-datum
foreign_amount
=
xvbak-netwr
foreign_currency
=
xvbak-waerk
local_currency
=
gs_loc
RATE
=
0
TYPE_OF_RATE
=
'M'
READ_TCURR
=
'X'
IMPORTING
EXCHANGE_RATE
=
FOREIGN_FACTOR
=
LOCAL_AMOUNT
=
gs_inr
LOCAL_FACTOR
=
EXCHANGE_RATEX
=
FIXED_RATE
=
DERIVED_RATE_TYPE
=
EXCEPTIONS
NO_RATE_FOUND
=
1
OVERFLOW
=
2
NO_FACTORS_FOUND
=
3
NO_SPREAD_FOUND
=
4
DERIVED_2_TIMES
=
5
OTHERS
=
6
.
IF
sy-subrc
<>
0.
SY-MSGID
TYPE
SY-MSGTY
NUMBER
SY-MSGNO
SY-MSGV1
SY-MSGV2
SY-MSGV3
SY-MSGV4.
ENDIF.
if
gt_exit-zstatus
gs_inr
gs_inr
gs_inr
gt_exit-zstatus
>
>
'High
'100'
<
=
gs_inr
gt_exit-zstatus
endif.
'Normal
<
'Low
gt_exit-vbeln
gt_exit-vkorg
gt_exit-vtweg
gt_exit-spart = xvbak-spart.
insert
clear gt_exit.
into
=
=
=
zexit
'1000'.
Value'.
elseif
and
'1000'.
Value'.
elseif
'100'.
Value'.
xvbak-vbeln.
xvbak-vkorg.
xvbak-vtweg.
values
gt_exit.