Examples of code ritten in includes in user exits
Can anyone send some examples on code written in includes of user exits.
Thanks in advance
U S E R E X I T F O R P A 0 0 0 8 *
IF innnn-infty = '0008' AND
( ipsyst-ioper = 'INS' OR
ipsyst-ioper = 'COP' ).
G L O B A L D E C L A R A T I O N S *
DATA:
g_lga TYPE lgart, " Wagetype
g_count(2) TYPE n,
g_cnt_blank(2) TYPE n, " Record position for hrly WT
g_cnt_hrly(2) TYPE n, " Record position for hrly WT
g_cnt_inc(2) TYPE n, " Record position for inc WT
g_cnt_lng(2) TYPE n, " Record position for lng WT
g_cnt_ret(2) TYPE n, " Record position for ret WT
g_wtype(11) TYPE c, " Wage type
g_wrate(11) TYPE c, " Wage rate
g_ht510_rate TYPE betrg, " Default rate for WT0011 from T510
g_maxrate_inc TYPE betrg, " Maximum Incumbency Rate
g_maxrate_lng TYPE betrg, " Maximum Longevity Rate
g_maxrate_ret TYPE betrg. " Maximum Retention Rate
D A T A D E C L A R A T I O N *
DATA:
it_9006 TYPE TABLE OF pa9006,
st_9006 TYPE pa9006,
i0008 TYPE p0008,
st_grdcode TYPE zthhr_grdcode.
F I E L D S Y M B O L S *
FIELD-SYMBOLS: <fs_wtype> TYPE ANY, " Used for Wage Type
<fs_wrate> TYPE ANY. " Used for Amount
C O N S T A N T S *
CONSTANTS:
c_molga_10 type molga value '10', " Country grp for US
c_hlgar_0011 TYPE lgart VALUE '0011', " Hourly Wage Type
c_ilgar_0012 TYPE lgart VALUE '0012', " Incumbent Wage Type
c_llgar_0147 TYPE lgart VALUE '0147', " Longevity Wage Type
c_rlgar_01e0 TYPE lgart VALUE '01E0', " Retention Wage Type
c_subty_inc TYPE subty VALUE '1', " Subtype for Incumbency
c_subty_lng TYPE subty VALUE '4', " Subtype for Longevity
c_subty_ret TYPE subty VALUE '5'. " Subtype for Retention
P R O C E S S I N G *
Typecast PRELP to PNNNN structure
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
EXPORTING
prelp = innnn
IMPORTING
pnnnn = i0008.
Refresh & Clear Process variables.
CLEAR: g_lga, g_count, g_cnt_blank, g_cnt_hrly, g_cnt_inc,
g_cnt_lng, g_cnt_ret, g_wtype, g_wrate, g_maxrate_inc,
g_maxrate_lng, g_maxrate_ret.
Populate all unexpired & applicable records of IT9006 of subtype:
Incumbency, Longevity and Retention
REFRESH: it_9006.
SELECT * FROM pa9006 INTO TABLE it_9006
WHERE pernr EQ i0008-pernr
AND begda LE i0008-begda
AND endda GE i0008-begda
AND ( subty EQ c_subty_inc
OR subty EQ c_subty_lng
OR subty EQ c_subty_ret )
AND zapplflg EQ 'X'.
Sort IT9006 Table descending based on Amount
SORT it_9006 BY zwage zaddamt DESCENDING.
Check for validity of Pay Scale Group & Level
SELECT * FROM zthhr_grdcode UP TO 1 ROWS
INTO st_grdcode
WHERE trfgr = i0008-trfgr
AND trfst = i0008-trfst.
ENDSELECT.
IF sy-subrc EQ 0.
If valid, read the Maximum Incumbency Rate
READ TABLE it_9006 INTO st_9006
WITH KEY zwage = c_ilgar_0012
zgrdcode = st_grdcode-grdcode
TRANSPORTING zaddamt.
IF sy-subrc EQ 0.
g_maxrate_inc = st_9006-zaddamt.
ENDIF.
ENDIF.
Get Max Longevity rate
READ TABLE it_9006 INTO st_9006 WITH KEY zwage = c_llgar_0147
TRANSPORTING zaddamt. " to g_maxrate_inc.
IF sy-subrc EQ 0.
g_maxrate_lng = st_9006-zaddamt.
ENDIF.
Get Max Retention rate
READ TABLE it_9006 INTO st_9006 WITH KEY zwage = c_rlgar_01e0
TRANSPORTING zaddamt. " to g_maxrate_inc.
IF sy-subrc EQ 0.
g_maxrate_ret = st_9006-zaddamt.
ENDIF.
CLEAR : g_count, g_cnt_blank, g_cnt_hrly, g_cnt_inc,
g_cnt_lng, g_cnt_ret.
Check Infotype 0008 Wagetype entries
DO 40 TIMES
VARYING g_lga FROM i0008-lga01 NEXT i0008-lga02.
g_count = g_count + 1.
IF NOT g_lga IS INITIAL. " Fill max no of field filled
g_cnt_blank = g_count.
ENDIF.
IF g_lga = c_hlgar_0011. " Get Rec Pos for Hrly WT
g_cnt_hrly = g_count.
ELSEIF g_lga = c_ilgar_0012. " Get Rec Pos for Inc WT
g_cnt_inc = g_count.
ELSEIF g_lga = c_llgar_0147. " Get Rec Pos for Lng WT
g_cnt_lng = g_count.
ELSEIF g_lga = c_rlgar_01e0. " Get Rec Pos for Ret WT
g_cnt_ret = g_count.
ENDIF.
ENDDO.
g_cnt_blank = g_cnt_blank + 1. " Next Avl. Pos for WT entry
Incumbency Processing
0011 and 0012 both not found
IF g_cnt_hrly = 0 AND g_cnt_inc = 0.
Do Nothing
0011 Not found but 0012 found
ELSEIF g_cnt_hrly = 0 AND g_cnt_inc > 0.
CONCATENATE 'I0008-LGA' g_cnt_inc INTO g_wtype.
CONCATENATE 'I0008-BET' g_cnt_inc INTO g_wrate.
ASSIGN (g_wtype) TO <fs_wtype>.
ASSIGN (g_wrate) TO <fs_wrate>.
IF g_maxrate_inc <> 0.
<fs_wtype> = c_ilgar_0012.
<fs_wrate> = g_maxrate_inc.
ELSE.
If WT0012 has expired in IT9006, revert to WT0011 with
default rate from T510
<fs_wtype> = c_hlgar_0011.
SELECT betrg FROM t510 UP TO 1 ROWS
INTO g_ht510_rate
WHERE molga = c_molga_10
AND trfar = i0008-trfar
AND trfgb = i0008-trfgb
AND trfgr = i0008-trfgr
AND trfst = i0008-trfst
AND lgart = c_hlgar_0011
AND begda LE i0008-begda
AND endda GE i0008-endda.
ENDSELECT.
IF sy-subrc = 0.
<fs_wrate> = g_ht510_rate.
ENDIF.
ENDIF.
0011 found but 0012 Not found
ELSEIF g_cnt_hrly > 0 AND g_cnt_inc = 0.
IF g_maxrate_inc <> 0.
Update 9006 amount if greater. And Replace 0011 with 0012
CONCATENATE 'I0008-LGA' g_cnt_hrly INTO g_wtype.
CONCATENATE 'I0008-BET' g_cnt_hrly INTO g_wrate.
ASSIGN (g_wtype) TO <fs_wtype>.
ASSIGN (g_wrate) TO <fs_wrate>.
IF <fs_wrate> < g_maxrate_inc.
<fs_wtype> = c_ilgar_0012.
<fs_wrate> = g_maxrate_inc.
ELSE.
Do Nothing
ENDIF.
ELSE.
Do Nothing
ENDIF.
0011 and 0012 both found
ELSEIF g_cnt_hrly > 0 AND g_cnt_inc > 0.
Rate in IT9006 exists.
IF g_maxrate_inc <> 0.
Remove existing 0011
CONCATENATE 'I0008-LGA' g_cnt_hrly INTO g_wtype.
CONCATENATE 'I0008-BET' g_cnt_hrly INTO g_wrate.
ASSIGN (g_wtype) TO <fs_wtype>.
ASSIGN (g_wrate) TO <fs_wrate>.
If hourly rate < Max Inc Rate, Clear Hrly WT & update WT0012
IF <fs_wrate> LT g_maxrate_inc.
CLEAR : <fs_wtype>, <fs_wrate>.
Update existing 0012 with new amount
CONCATENATE 'I0008-LGA' g_cnt_inc INTO g_wtype.
CONCATENATE 'I0008-BET' g_cnt_inc INTO g_wrate.
ASSIGN (g_wtype) TO <fs_wtype>.
ASSIGN (g_wrate) TO <fs_wrate>.
<fs_wtype> = c_ilgar_0012.
<fs_wrate> = g_maxrate_inc.
If hourly rate > Max Inc Rate, clear WT0012
ELSE.
CONCATENATE 'I0008-LGA' g_cnt_inc INTO g_wtype.
CONCATENATE 'I0008-BET' g_cnt_inc INTO g_wrate.
ASSIGN (g_wtype) TO <fs_wtype>.
ASSIGN (g_wrate) TO <fs_wrate>.
CLEAR : <fs_wtype>, <fs_wrate>.
ENDIF.
Rate in IT9006 do not exists.
ELSE.
Let 0011 be there but remove 0012.
CONCATENATE 'I0008-LGA' g_cnt_inc INTO g_wtype.
CONCATENATE 'I0008-BET' g_cnt_inc INTO g_wrate.
ASSIGN (g_wtype) TO <fs_wtype>.
ASSIGN (g_wrate) TO <fs_wrate>.
CLEAR : <fs_wtype>, <fs_wrate>.
ENDIF.
ENDIF.
Longevity Processing
Wage type 0147 already exists
IF g_cnt_lng > 0.
CONCATENATE 'I0008-LGA' g_cnt_lng INTO g_wtype.
CONCATENATE 'I0008-BET' g_cnt_lng INTO g_wrate.
ASSIGN (g_wtype) TO <fs_wtype>.
ASSIGN (g_wrate) TO <fs_wrate>.
IT9006 contains the rate.
IF g_maxrate_lng > 0.
Update the existing amount
<fs_wtype> = c_llgar_0147.
<fs_wrate> = g_maxrate_lng.
ELSE.
Remove Wage Type 0147
CLEAR <fs_wtype>.
CLEAR <fs_wrate>.
ENDIF.
Currently no 0147 exists
ELSE.
IT9006 contains the rate.
IF g_maxrate_lng > 0.
Add 0147 with amount
CONCATENATE 'I0008-LGA' g_cnt_blank INTO g_wtype.
CONCATENATE 'I0008-BET' g_cnt_blank INTO g_wrate.
ASSIGN (g_wtype) TO <fs_wtype>.
ASSIGN (g_wrate) TO <fs_wrate>.
<fs_wtype> = c_llgar_0147.
<fs_wrate> = g_maxrate_lng.
g_cnt_blank = g_cnt_blank + 1.
IT9006 does not contain the rate.
ELSE.
Do Nothing
ENDIF.
ENDIF.
Retention Processing
Wage type 01E0 already exists
IF g_cnt_ret > 0.
CONCATENATE 'I0008-LGA' g_cnt_ret INTO g_wtype.
CONCATENATE 'I0008-BET' g_cnt_ret INTO g_wrate.
ASSIGN (g_wtype) TO <fs_wtype>.
ASSIGN (g_wrate) TO <fs_wrate>.
IT9006 contains the rate.
IF g_maxrate_ret > 0.
Update the existing amount
<fs_wtype> = c_rlgar_01e0.
<fs_wrate> = g_maxrate_ret.
ELSE.
Remove Wage Type 01E0
CLEAR <fs_wtype>.
CLEAR <fs_wrate>.
ENDIF.
Currently no 01E0 exists
ELSE.
IT9006 contains the rate.
IF g_maxrate_ret > 0.
Add 01E0 with amount
CONCATENATE 'I0008-LGA' g_cnt_blank INTO g_wtype.
CONCATENATE 'I0008-BET' g_cnt_blank INTO g_wrate.
ASSIGN (g_wtype) TO <fs_wtype>.
ASSIGN (g_wrate) TO <fs_wrate>.
<fs_wtype> = c_rlgar_01e0.
<fs_wrate> = g_maxrate_ret.
g_cnt_blank = g_cnt_blank + 1.
IT9006 does not contain the rate.
ELSE.
Do Nothing
ENDIF.
ENDIF.
Typecast the PNNNN to PRELP structure
CALL METHOD cl_hr_pnnnn_type_cast=>pnnnn_to_prelp
EXPORTING
pnnnn = i0008
IMPORTING
prelp = innnn.
Show Data Again Switch to display the field values again
show_data_again = 'X'.
ENDIF.
Similar Messages
-
Modify Std. code to get value for User Exit.
I am executing release strategry at user exit EXIT_SAPLEBND_002 ( Exit Name M06E0004 ), for the field ( USRN1)
This has got user program ZXM06U22 in it. In this exit I get values from I_CEKKO , IT_BEKPO, IT_BEKET, IT_EKKNU
and I have to pass the PO value from these structures to E_CEKKO-USRN1 ( This field has set in SPRO setting ) .
I get the PO value as per standard calculation in the field IT_BEKPO-EFFWR , I also get a value in I_CEKKO-GNETW. However not one of both these values satisfy any one of my conditions. My document condition is defined in SPRO as ZVPA and values against it is calculated considering Taxes On PO. The fields EFFWR or GNETW does not include taxes. And my release startegy should get executed after considering the amount with taxes.
After debugging a lot I have found that the PO_AMOUNT can be obtained from the Internal Table TKOMV. In this it is stored at TKOMV-KAWRT. I can get the TKOMV values at the point where this user-exit is called.
i.e. in program MM06EF0S_STRATEGIE_CEKKO in the last you can see the call to user exit wriiten as below
CALL FUNCTION 'EXIT_SAPLEBND_002'
EXPORTING
i_cekko = cekko
it_bekpo = pot[]
it_beket = ett[]
it_ekknu = knt[]
IMPORTING
e_cekko = cekko.
If I put the debugger on CALL FUNCTION 'EXIT_SAPLEBND_002 and go to TABLES tab and enter there 'TKOMV'
I can get the table and it's values. However If I press F5 then I go inside my exit code i.e. ZXM06U22. But Here I Don't Get access to the internal table TKOMV , which is accessible from main calling program MM06EF0S_STRATEGIE_CEKKO.
My job can be done if I get value from TKOMV inside the code of ZXM06U22. However to get that code in ZXM06U22 what right now I can do is to get the access key of MM06EF0S_STRATEGIE_CEKKO and write code before exit Call and pass the ZVPA from TKOMV there. However many people here advised me not to do that since it is a STANDARD CODE.
So I would like to know your suggestion in this regard.
AmolHi All
Thanks for your quick replies. I wrote code below in my exit. But I am getting Compilation error at following line ( In Bold )
DATA: l_name(50).
DATA: my_tkomv TYPE TABLE OF komv.
<b>FIELD-SYMBOLS: <tkomv> type standard table of komv.</b>l_name = '(SAPMMM06E)TKOMV[]'.
ASSIGN (l_name) TO <tkomv>.
my_tkomv[] = <tkomv>.
The error is below
"," expected after "TABLE".
I don't know whether TYPE TABLE OF is correct or not.
I will be glad If I get some further help.
Amol -
How to write include in user exit userexit_save_document
when i am trying to insert a inlcude in the exit userexit_save_document. i am getting error.
i ahve written a statement 'include 'Zabcd' inside the user exit.
doubl clicked on the include->system asked to create a new include-> opted for yes-> an editor came inc hange mode-> i ahve witten the statements form test. endform.
when i am trying to activate my include 'Zabcd' ,, ia m getting an error. "the corresponding form should have an edform"
i cant proceed , it is beyond my imagination
can some help me out of this situation.
Best Regards
Amarender Reddy BSo you have
FORM userexit_save_document.
INCLUDE zabcd.
ENDFORM.
And your include contains
FORM myform.
ENDFORM.
Include just inserts source code at the INCLUDE point, so effectively you've written:
FORM userexit_save_document.
FORM myform.
ENDFORM.
ENDFORM.
Now do you see the problem?
matt -
New include proram -user exit- sales order
hi
i have to create a new screen which has to be displayed as a pop up
from the user exit "<u>userexit_save_document_prepare"</u> which is present in MV45AFZZ
the processing logic for the screen should be written in include program which is to be included in the specified userexit.
the include program which i created while syntax checking shows
"include <u>prg-name</u> is not accesible".
why this is occuring.
Another question is whether can i write the modules for pbo,pai and the subroutines i.e form & end-form all in the include program which iam creating.
It is showing incorrect nesting. write end-form for the form before moduele.
whether i have to write PBO,PAI,subroutines in independent include programs.
Please give reply ASAP.in that case then
call like this
perform check (in program).
<b>what i am thinking is THIS program in Update Mode may be bcos of that.</b>
Regards
prabhu
Message was edited by:
Prabhu Peram -
Code for i_step = 2 in user exit ZXRSRU01 for selection screen validation
Hello Experts,
I have BI report, in which on selection screen I have 4 formula variable.
I want to check, what number user has entered in these variables and summation of these fields should not be getter than 100 or less than 100. It should be 100 only. If that summation is not 100 then, I have to display message and again go back to selection screen so that user will make the correction.
I came to know that for this I have to write a code in user exit ZXRSRU01, when i_step = 2. I have written the code but it's not working. I have declare one more variable which is not ready for input and which I am checking in the code.
Can anyone help me out in this regards.
Thanks
ChetanHi
Have you gone through the proper steps for creating and activating the enhancement?
You can find more detailed documentation in the[ SAP Help|http://help.sap.com/saphelp_nw70/helpdata/en/f1/0a56f5e09411d2acb90000e829fbfe/frameset.htm].
Regards -
How to find T-codes for a list of User exits
Hi All,
We have been provided with the list of user exits found in the system. I need to find the T-codes where these user-exits have been used.
Can anyone provide pointers for this?
Thanks and Regards,
Sridevi Sridharuse logic of the program....
*& Report ZCG_USER_EXIT_FIND
*& Utility program to find out the User Exits within a transaction
REPORT ZCG_USER_EXIT_FIND.
tables : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir.
tables : tstct.
data : jtab like tadir occurs 0 with header line.
data : field1(30).
data : v_devclass like tadir-devclass.
parameters : p_tcode like tstc-tcode obligatory.
select single * from tstc where tcode eq p_tcode.
if sy-subrc eq 0.
select single * from tadir where pgmid = 'R3TR'
and object = 'PROG'
and obj_name = tstc-pgmna.
move : tadir-devclass to v_devclass.
if sy-subrc ne 0.
select single * from trdir where name = tstc-pgmna.
if trdir-subc eq 'F'.
select single * from tfdir where pname = tstc-pgmna.
select single * from enlfdir where funcname =
tfdir-funcname.
select single * from tadir where pgmid = 'R3TR'
and object = 'FUGR'
and obj_name eq enlfdir-area.
move : tadir-devclass to v_devclass.
endif.
endif.
select * from tadir into table jtab
where pgmid = 'R3TR'
and object = 'SMOD'
and devclass = v_devclass.
select single * from tstct where sprsl eq sy-langu and
tcode eq p_tcode.
format color col_positive intensified off.
write:/(19) 'Transaction Code - ',
20(20) p_tcode,
45(50) tstct-ttext.
skip.
if not jtab[] is initial.
write:/(95) sy-uline.
format color col_heading intensified on.
write:/1 sy-vline,
2 'Exit Name',
21 sy-vline ,
22 'Description',
95 sy-vline.
write:/(95) sy-uline.
loop at jtab.
select single * from modsapt
where sprsl = sy-langu and
name = jtab-obj_name.
format color col_normal intensified off.
write:/1 sy-vline,
2 jtab-obj_name hotspot on,
21 sy-vline ,
22 modsapt-modtext,
95 sy-vline.
endloop.
write:/(95) sy-uline.
describe table jtab.
skip.
format color col_total intensified on.
write:/ 'No of Exits:' , sy-tfill.
else.
format color col_negative intensified on.
write:/(95) 'No User Exit exists'.
endif.
else.
format color col_negative intensified on.
write:/(95) 'Transaction Code Does Not Exist'.
endif.
at line-selection.
get cursor field field1.
check field1(4) eq 'JTAB'.
set parameter id 'MON' field sy-lisel+1(10).
call transaction 'SMOD' and skip first screen. -
i want to include my BDC in that include INCLUDE ZXF04U01 for tcode XD01.
but parametrs , selection screen and form are not accepted. any other way to include my BDC in that include INCLUDE ZXF04U01. or do we have any standard BAPI for credit customer?
plz give step by step guide
ur rewarded.
regards
vinoth.vTake it from calling stack.
DATA: GW_FIELD(60) TYPE C,
L_KLIMK TYPE KNKA-KLIMK.
FIELD-SYMBOLS: <GW_KLIMK_VAL> TYPE KNKA-KLIMK.
CLEAR: GW_FIELD, L_KLIMK .
MOVE '(SAPLXF04)KNKA-KLIMK' TO GW_FIELD.
ASSIGN (GW_FIELD) TO <GW_KLIMK_VAL>.
IF <GW_KLIMK_VAL> IS ASSIGNED.
L_KLIMK = <GW_KLIMK_VAL>.
ENDIF.
Do the same stuff for KNKA-CTLPC.
G@urav. -
A/R User Exit Spec and code
The spec -
1. Canadian tax - currently based on Freight type: Read the country(?) Ship-from (plant jurisdiction) to Ship-to(customer jurisdiction) and the inco term on the line item of the sales order and if it's not equal to 'DDP' the line item tax classification will be set to '0' exempt. (This is freight that comes into Canada from the US)
We will look at the shipto and shipfrom txjcd on the sales order document and billing document along with the inco term logic and we will tax freight when they are both Canada
Example Scenario:
For Freight charges where the Ship from is in Canada (Bedco, Artmedco, etc) and the Ship-to is in Canada the freight will always be taxable regardless of the inco term. This is freight that ships within Canada, no boarder crossing.
2. Regular Freight - US & Canada: If separate line item on sales order, it may be exempt from tax based upon state. revisit
a. D.1 Freight included on the line item
i. The freight is passed to the external system by populating the field FREIGHT. The freight amount is always included in the base amount.
ii. An example to fill the freight using the user-exit:
iii. In the customer pricing procedure (for example ZUSA01) enter 4 in the subtotal field of the freight condition type (OTC must have this configuration in the pricing procedure for the freight pricing conditions).
iv. In the customer structure CI_TAX_INPUT_USER, add the field KZWI4 as in KOMP-KZWI4.
v. In the user-exit, add the code CH_USER_CHANGED_FIELDS-FREIGHT_AM = I_INPUT_USER-KZWI4.
3. For PO Specific A/R Tax Exemptions using material tax class of 2, pass the TAXM1 field to the ACCOUNT_NO field in Taxware
oSolution:
For PO Specific Tax Exemptions CSR will go to the line item detail Billing Tab, Tax Classification field (TAXM1) and change that to 2 One-Time Exemption. Configuration complete.
CSR will go to the Text Tab, Internal Item Notice and CSR will provide a brief description as to why that line is tax exempt.
This the code----
TABLES: KNVV, KNA1, KOMK, MLAN, T001W, KNVI.
DATA: w_taxm1 LIKE mlan-taxm1,
i_kna1 LIKE kna1,
c_com_tax type com_tax,
i_komk LIKE KOMK.
*--- if this freight comes into canada from US then set TAXM1 to 0
*----otherwise set TAXM1 to 2 and apply frieght charges. Set ACCNT_CLS
*----to 'Y' each time TAXM1 is passed to ACCNT_NO.
IF KNA1-LAND1 EQ 'CA'.
IF C_COM_TAX-TXJCD_SF EQ C_COM_TAX-TXJCD_ST.
CH_USER_CHANGED_FIELDS-FREIGHT_AM = I_INPUT_USER-KZWI4.
w_taxm1 = 2.
CH_USER_CHANGED_FIELDS-ACCNT_NO = W_TAXM1.
CH_USER_CHANGED_FIELDS-ACCNT_CLS = 'Y'.
ELSEIF C_COM_TAX-TXJCD_SF NE C_COM_TAX-TXJCD_ST.
C_COM_TAX-TXJCD_SF = C_COM_TAX-TXJCD_ST.
C_COM_TAX-TXJCD_POA = C_COM_TAX-TXJCD_ST.
SELECT SINGLE * FROM KNVV
WHERE INCO1 = KOMK-INCO1
AND INCO1 NE 'DDP'.
IF SY-SUBRC EQ 0.
w_taxm1 = 0.
CH_USER_CHANGED_FIELDS-ACCNT_NO = W_TAXM1.
CH_USER_CHANGED_FIELDS-ACCNT_CLS = 'Y'.
ENDIF.
ENDIF.
ENDIF.
SELECT SINGLE taxkd FROM knvi INTO knvi-taxkd
WHERE kunnr = i_komk-kunwe
AND aland = i_komk-land1.
IF SY-TCODE = 'VA01' OR SY-TCODE = 'VA02' OR SY-TCODE = 'VA03' OR
SY-TCODE = 'VF01' OR SY-TCODE = 'VF02' OR SY-TCODE = 'VF03' OR SY-TCODE
= 'VF04' OR SY-TCODE = 'VF05' OR SY-TCODE = 'VF05'.
SELECT SINGLE * FROM kna1 INTO i_kna1
WHERE kunnr = i_komk-kunwe.
IF i_KNA1-land1 EQ 'CA'.
C_COM_TAX-TXJCD_SF = C_COM_TAX-TXJCD_ST.
C_COM_TAX-TXJCD_POA = C_COM_TAX-TXJCD_ST.
ENDIF.
ENDIF.
I am able to enter the user exit, but there is no value for KNA1-LAND1 or C_COM_TAX-TAXJCD_SF or C_COM_TAX-TAXJCD_ST. Does anyone what I am missing ? Please help.
Thanks in advance !!!!
NHi NP ,
which User exit ur using ? Are u talking abt MIRO or VF01.
Regards
Prabhu -
Problem in triggering the code for CO02 User Exit
Hi,
I am using the code for the Tcode CO02 (User Exit) and i am facing a problem that when i am using the code as a normal program it is executing fine and displaying the pop up window and showing the data in it.
But when i am using that code in the USER EXIT code it is not trigerring that pop up window.
I am using the enhancement:-
*PPCO0007 * - Exit when saving production order
And the include in which i am writing the code is :-
INCLUDE ZXCO1U06
plzz provide me guidelines for solving this problem.hi ,
i am using the following: -
Enhancement No. -> PPCO0007 (Exit when saving production order)
When i click on the enhancement the following is displayed:-
Function exit -> *EXIT_SAPLCOZV_001 *
When i double click the function exit the code i had written in the following include:-
INCLUDE ZXCO1U06
plzz tell me whether i am doing it right or worng? -
BW User Exit - Code in function of the query name
Hi,
I would like to create an user exit code which execute a algorithm different in function of the query executed. do you know in which variable is store the technical name of the query.
CASE query
WHEN 'Z_ZAPO_001'.
V1 = 1
WHEN 'Z_ZAPO_002'.
V1 = 2 WHEN '10' OR '11' OR '12'.
ENDCASE.Yaroslav,
I_S_RKB1D-COMPID will never be filled for authorization user-exits (I_STEP = 0). Don't ask my why, I once raised this question to OSS and they replied it was never foreseen to work with authorization user-exits. God knows why, it's very unlogical and it wouldn't cost them a lot of work to get it working...
I could solve this problem by applying a little trick. In our queries we included a user-exit keydate variable. This will push the user-exit first in I_STEP = 1 mode where I_S_RKB1D-COMPID is filled. Then save the query name by exporting it to the ABAP-memory. Afterwards, the user exit with code for I_STEP = 0 will be processed and then you can import the query name from the ABAP memory.
I agree it sounds a little bit tricky but there is no better option I'm affraid. -
Code Review of User Exits with Code Inspector
Hi,
We are using Code Inspector(Tcode - SCI) for checking the quality of ABAP Codes. It is working fine for all custom programs. But when we are checking the code of User Exits i: e MV50AFZ1 or ZXM06U22 then it checks the std SAP program (SAPMV50A) or (SAPLXM06) for these exits in place of checking that particular Exit only . How the customer/User Exits can be checked using Code Inspector. Pls advice.Hi there!
Today, I stumbled over the same problem: Defining an Include for user exits leads to a check of the surrounding function group from SAP which I don't want to correct at all.
Is there a nice an elegant way of filtering out the SAP modules from checking? If not, the only way to get around this seems to be building an own implementation of the Code Inspector integration into CTS.
Thanks, Markus -
Hi,
I implemented a user exit and has implemented some codes on a particular form; after activating, the whole user exit has been grayed out from modification. How can I undo?
Thanks.Hi,
Go to the include inside user exit and switch off modification assistant by navigating following path
EDIT->MODIFICATION OPERATIONS->SWITCH OFF ASSISTANT.
Please let me know in case you face any more issues.
KR Jaideep, -
User exit to check PO company code and MIRO company code
HI,
when user entering an invoice in a company code different than what is on the PO. Currently, the system will let them key the invoice and it will automatically intercompany it to the correct company.
I want to Implement FI validation so that the system provides a warning when you post to FI MIRO. In the FI validation, use the user exit to get the PO company code and do a compare of the company code from the PO to the input field on the invoice and if not the same provide screen popup warning .
Using OBBH Create validation rule in user exit for input invoice and process MIRO associated company codes
Plese provide me correct user exit.
I tried BAdI INVOICE_UPDATE, but it didnt work.
Thank You,
ArchanaCheck Badi implementation MRM_HEADER_DEFAULT
Regards
Vinod -
What are the User Exits for Sales Order creation process?
Hi,
what are the User Exits for Sales Order creation process? how can I find them?
thanks in advance,
will reward,
MindaugasPlease check this info:
User Exits In Sales Document Processing
This IMG step describes additional installation-specific processing in sales document processing. In particular, the required INCLUDES and user exits are described.
Involved program components
System modifications for sales document processing affect different areas. Depending on the modification, you make the changes in the program components provided:
MV45ATZZ
For entering metadata for sales document processing. User-specific metadata must start with "ZZ".
MV45AOZZ
For entering additional installation-specific modules for sales document processing which are called up by the screen and run under PBO (Process Before Output) prior to output of the screen. The modules must start with "ZZ".
MV45AIZZ
For entering additional installation-specific modules for sales document processing. These are called up by the screen and run under PAI (Process After Input) after data input (for example, data validation). The modules must start with "ZZ".
MV45AFZZ and MV45EFZ1
For entering installation-specific FORM routines and for using user exits, which may be required and can be used if necessary. These program components are called up by the modules in MV45AOZZ or MV45AIZZ.
User exits in the program MV45AFZZ
The user exits which you can use for modifications in sales document processing are listed below.
USEREXIT_DELETE_DOCUMENT
This user exit can be used for deleting data which was stored in a separate table during sales document creation, for example, if the sales document is deleted.
For example, if an additional table is filled with the name of the person in charge (ERNAM) during order entry, this data can also be deleted after the sales order has been deleted.
The user exit is called up at the end of the FORM routine BELEG_LOESCHEN shortly before the routine BELEG_SICHERN.
USEREXIT_FIELD_MODIFICATION
This user exit can be used to modify the attributes of the screen fields.
To do this, the screen fields are allocated to so-called modification groups 1 - 4 and can be edited together during a modification in ABAP. If a field has no field name, it cannot be allocated to a group.
The usage of the field groups (modification group 1-4) is as follows:
Modification group 1: Automatic modification with transaction MFAW
Modification group 2: It contains 'LOO' for step loop fields
Modification group 3: For modifications which depend on check tables or on other fixed information
Modification group 4: is not used
The FORM routine is called up for every field of a screen. If you require changes to be made, you must make them in this user exit.
This FORM routine is called up by the module FELDAUSWAHL.
See the Screen Painter manual for further information on structuring the interface.
USEREXIT_MOVE_FIELD_TO_VBAK
Use this user exit to assign values to new fields at sales document header level. It is described in the section "Transfer of the customer master fields into the sales document".
The user exit is called up at the end of the FORM routine VBAK_FUELLEN.
USEREXIT_MOVE_FIELD_TO_VBAP
Use this user exit to assign values to new fields at sales document item level. It is described in the section "Copy customer master fields into the sales document".
The user exit is called up at the end of the FORM routine VBAP_FUELLEN.
USEREXIT_MOVE_FIELD_TO_VBEP
Use this user exit to assign values to new fields at the level of the sales document schedule lines.
The user exit is called up at the end of the FORM routine VBEP_FUELLEN.
USEREXIT_MOVE_FIELD_TO_VBKD
Use this user exit to assign values to new fields for business data of the sales document. It is described in the section "Copy customer master fields into sales document".
The user exit is called up at the end of the FORM routine VBKD_FUELLEN.
USEREXIT_NUMBER_RANGE
Use this user exit to define the number ranges for internal document number assignment depending on the required fields. For example, if you want to define the number range depending on the sales organization (VKORG) or on the selling company (VKBUR), use this user exit.
The user exit is called up in the FORM routine BELEG_SICHERN.
USEREXIT_PRICING_PREPARE_TKOMK
Use this user exit if you want to include and assign a value to an additional header field in the communication structure KOMK taken as a basis for pricing.
USEREXIT_PRICING_PREPARE_TKOMP
Use this user exit if you want to include or assign a value to an additional item field in the communication structure KOMP taken as a basis for pricing.
USEREXIT_READ_DOCUMENT
You use this user exit if further additional tables are to be read when importing TA01 or TA02.
The user exit is called up at the end of the FORM routine BELEG_LESEN.
USEREXIT_SAVE_DOCUMENT
Use this user exit to fill user-specific statistics update tables.
The user exit is called up by the FORM routine BELEG-SICHERN before the COMMIT command.
Note
If a standard field is changed, the field r185d-dataloss is set to X. The system queries this indicator at the beginning of the safety routine. This is why this indicator must also be set during the maintenance of user-specific tables that are also to be saved.
USEREXIT_SAVE_DOCUMENT_PREPARE
Use this user exit to make certain changes or checks immediately before saving a document. It is the last possibility for changing or checking a document before posting.
The user exit is carried out at the beginning of the FORM routine BELEG_SICHERN.
User exits in the program MV45AFZA
USEREXIT_MOVE_FIELD_TO_KOMKD
Use this user exit to include or assign values to additional header fields in the communication structure KOMKD taken as a basis for the material determination. This is described in detail in the section "New fields for material determination".
USEREXIT_MOVE_FIELD_TO_KOMPD
Use this user exit to include or assign values to additional item fields in the communication structure KOMPD taken as a basis for the material determination. This is described in detail in the section "New fields for material determination".
USEREXIT_MOVE_FIELD_TO_KOMKG
Use this user exit to include or assign values to additional fields in the communication structure KOMKG taken as a basis for material determination and material listing. This is described in detail in the section "New fields for listing/exclusion".
USEREXIT_MOVE_FIELD_TO_KOMPG
Use this user exit to include or assign values to additional fields in the communication structure KOMPG taken as a basis for material determination and material listung. This is described in detail in the section "New fields for listing/exclusion".
USEREXIT_REFRESH_DOCUMENT
With this user exit, you can reset certain customer-specific fields as soon as processing of a sales document is finished and before the following document is edited.
For example, if the credit limit of the sold-to party is read during document processing, in each case it must be reset again before processing the next document so that the credit limit is not used for the sold-to party of the following document.
The user exit is executed when a document is saved if you leave the processing of a document with F3 or F15.
The user exit is called up at the end of the FORM routine BELEG_INITIALISIEREN.
User-Exits in program MV45AFZB
USEREXIT_CHECK_XVBAP_FOR_DELET
In this user exit, you can enter additional data for deletion of an item. If the criteria are met, the item is not deleted (unlike in the standard system).
USEREXIT_CHECK_XVBEP_FOR_DELET
In this user exit, you can enter additional data for deletion of a schedule line. If the criteria are met, the schedule line is not deleted (unlike in the standard system).
USEREXIT_CHECK_VBAK
This user exit can be used to carry out additional checks (e.g. for completion) in the document header. The system could, for example, check whether certain shipping conditions are allowed for a particular customer group.
USEREXIT_CHECK_VBAP
This user exit can be used to carry out additional checks (e.g. for completion) at item level.
USEREXIT_CHECK_VBKD
The user exit can be used to carry out additional checks (e.g. for completion) on the business data in the order.
USEREXIT_CHECK_VBEP
This user exit can be use to carry out additional checks (e.g. for completion) on the schedule line. During BOM explosion, for example, you may want certain fields to be copied from the main item to the sub-items (as for billing block in the standard system).
USEREXIT_CHECK_VBSN
You can use this user exit to carry out additional checks (e.g. for completion) on the serial number.
USEREXIT_CHECK_XVBSN_FOR_DELET In this user exit, you can enter additional criteria for deletion of the serial number. If the criteria are met, the serial number is not deleted (unlike in the standard system).
USEREXIT_FILL_VBAP_FROM_HVBAP
You can use this user exit to fill additional fields in the sub-item with data from the main item.
USEREXIT_MOVE_FIELD_TO_TVCOM_H
You can use this user exit to influence text determination for header texts. For example, you can include new fields for text determination or fill fields that already exist with a new value.
USEREXIT_MOVE_FIELD_TO_TVCOM_I
You can use this user exit to influence text determination for item texts. For example, you can include new fields for text determination or fill fields that already exist with a new value.
User-Exits for product allocation:
The following user exits all apply to structure COBL, in which the data for account determination is copied to item level.
USEREXIT_MOVE_FIELD_TO_COBL
Option to include new fields in structure COBL.
USEREXIT_COBL_RECEIVE_VBAK
Option to assign values from the document header to the new fields.
USEREXIT_COBL_RECEIVE_VBAP
Option to supply values from the item to the new fields.
USEREXIT_COBL_SEND_ITEM
A changed field can be copied from the structure into the item. You could use the user exit to display a certain field in the account assignment block (see also MV45AFZB).
USEREXIT_COBL_SEND_HEADER
A changed field can be copied from the structure to the header (see source text MV45AFZB)
USEREXIT_SOURCE_DETERMINATION
You can use this user exit to determine which plant will be used for the delivery. In the standard system, the delivering plant is copied from the customer master or the customer-material info record. If you want to use a different rule, then you must enter it in this user exit.
USEREXIT_MOVE_FIELD_TO_ME_REQ
With this user exit you can include additional fields for the following fields:
EBAN (purchase requisition)
EBKN (purchase requisition-account assignment)
USEREXIT_GET_FIELD_FROM_SDCOM
Option to include new fields for the variant configuration. Fields that are included in structure SDCOM can be processed and then returned to the order.
USEREXIT_MOVE_WORKAREA_TO_SDWA
You can use this user exit to format additional work areas for the variant configuration. You will find notes on the user exit in MV45AFZB.
User-Exits for first data transfer:
The following user exits can only be used for the first data transfer.
Note
Only use the user exits if the names/fields do NOT have the same name.
USEREXIT_MOVE_FIELD_TO_VBAKKOM
Option to include additional fields in structure VBAKKOM (communiction fields for maintaining the sales document header)
USEREXIT_MOVE_FIELD_TO_VBAPKOM
Option to include additional fields in structure VBAPKOM (communication fields for maintaining a sales item)
USEREXIT_MOVE_FIELD_TO_VBEPKOM
Option to include additional fields in structure VBEPKOM (communication fields for maintaining a sales document schedule line)
USEREXIT_MOVE_FIELD_TO_VBSN
You can use this user exit to include fields in structure VBSN (scheduling agreement-related change status).
USEREXIT_MOVE_FIELD_TO_KOMKH
You can use this user exit to include new fields for batch determination (document header).
USEREXIT_MOVE_FIELD_TO_KOMPH
You can use this user exit to include new fields for batch determination (document item).
USEREXIT_CUST_MATERIAL_READ
You can use this user exit to set another customer number in the customer material info record (e.g. with a customer hierarchy)
USEREXIT_NEW_PRICING_VBAP
Option for entry of preconditions for carrying out pricing again (e.g. changes made to a certain item field could be used as the precondition for pricing to be carried out again). Further information in MV45AFZB.
USEREXIT_NEW_PRICING_VBKD
Option for entry of preconditions for carrying out pricing again (e.g. changes to the customer group or price group could be set as the preconditions for the system to carry out pricing again). Further information in MV45AFZB.
User-Exits in Program MV45AFZD
USEREXIT_CONFIG_DATE_EXPLOSION
The BOM is exploded in the order with the entry date. You can use this user exit to determine which data should be used to explode the BOM (explosion with required delivery date, for example).
User exits in the program FV45EFZ1
USEREXIT_CHANGE_SALES_ORDER
In the standard SAP R/3 System, the quantity and confirmed date of the sales document schedule line is changed automatically if a purchase requisition is allocated, and it or the sales document is changed (for example, quantity, date).
If you want to change this configuration in the standard system, you can define certain requirements in order to protect your sales orders from being changed automatically. Use this user exit for this purpose. Decide at this point whether the schedule lines are to be changed.
User-Exits in Program RV45PFZA
USEREXIT_SET_STATUS_VBUK
In this user exit you can you can store a specification for the reserve fields in VBUK (header status). Reserve field UVK01 could, for example, be used for an additional order status (as for rejections status, etc.).
The following workareas are available for this user exit:
VBUK (header status)
FXVBUP (item status)
FXVBUV (Incompletion)
USEREXIT_SET_STATUS_VBUP
In this user exit you can you can store a specification for the reserve fields for VBUP (item status).
The following workareas are available for this user exit:
FXVBAP (Item data)
FXVBAPF (Dynamic part of order item flow)
FXVBUV (Incompletion)
USEREXIT_STATUS_VBUK_INVOICE
You can use this user exit to influence billing status at header level.
User exits in the screens
Additional header data is on screen SAPMV45A 0309, additional item data on screen SAPMV45A 0459. These screens contain the Include screens SAPMV45A 8309 or SAPMV45A 8459 as user exits.
Fields which are also to be included in the sales document for a specific installation should be included on the Include screens for maintaining. If an application-specific check module is needed for the fields, this can be included in the Include MV45AIZZ. The module is called up in the processing logic of the Include screens.
For field transports, you do not have to make changes or adjustments.
Example
A new field, VBAK-ZZKUN, should be included in table VBAK.
If the check is defined via the Dictionary (fixed values or check table) the field must be included with the fullscreen editor in the Include screen SAPMV45A 8309. In this case, no change has to be made to the processing logic.
User Exits in Program MV45AFZ4
USEREXIT_MOVE_FIELD_TO_KOMK
You can use this user exit to add or edit additional header fields in the communication structure - KOMK- for free goods determination. For more information, see the New Fields for Free Goods Determination IMG activity.
USEREXIT_MOVE_FIELD_TO_KOMP
You can use this user exit to add or edit additional item fields in the communication structure KOMP for free goods determination. For more information see the New Fields for Free Goods Determination IMG activity.
User Exits in the SAPFV45PF0E and SAPFV45PF0C Programs
EXIT_SAPFV45P_001
You can use this user exit to decide whether intercompany billing data is used in the profitability segment for cross-company code sales, or whether the data comes from external billing (external customer, sales data from the selling company code.
Regards
Eswar -
What is user exit in MM?
is there any difference between user exit and enhancement? does a end user raise a ticket for user exit? please help
Edited by: sherlyn chopra on Oct 1, 2008 4:36 PMWhat is and how user exits can be used?
What is the transaction code to see all available user exits?
Method of using this?
User exit jus nothing but just a code ....which is not provided the standard sap system..but function could be added later into the code ..this is done by abap people...
User exit is a place where we can write our own logic inside SAP programs. Instead of modification of SAP code, we can place our custom logic in User Exit.
There are three types of User exits:
1. Function Exits
2. Menu Exits
3. User Exits
Finding User Exits:
1. Take VA03 as example. Go to System status; select the program (double click); Find by the key word u2018Call Customer-functionu2019; Double click on the u2018Call Functionu2019 to go to the code; Double click on the customer function no.
It will take to the function exit in which SAP provides a Include program, where we can write down our own logic.
2. Run transaction SE84 and click on u2018Enhancementu2019 on left screen. Then click on u2018Customer Exitsu2019. Then double click on u2018Enhancementsu2019.
3. In transaction CMOD, type the name of your project and press the CREATE pushbutton; Once you SAVE your project, you can add as many enhancements as you want by pressing the SAP enhancements pushbutton; Add the enhancements
you want to add to the Project.
4. There are some exit provided by SAP in the program as subroutines. For example, go to transaction VA02; Double click on the program. It will take to the program; Some includes are provided by SAP as user exit. Double click on the include name, then it will take inside the include. Double click on MV45AFZZ (Program)include; Here we have different forms which acts as user exits. In these forms we can include our custom logic
5. Open the program through SE80 transaction; Click on the u2018Screenu2019 and all the available screens will be displayed. Then search if any Exit screen is available. Normally short text of the screen gives an idea whether Exit screen or not.
6. Finding BADIs : Double click on the u2018Programu2019; Search by string u2018cl_exithandler=>get_instanceu2019
;Search result is displayed. Double click on any one in the list.
http://www.sap-basis-abap.com/abap/difference-between-user-exits-screen-exits-field-exits.htm
http://www.sap-basis-abap.com/pm/user-exits-in-sap-pm.htm
http://www.sap-basis-abap.com/sapab013.htm
for eg:
BAPI_INCOMINGINVOICE_CANCEL Invoice Verification: reverse invoice
BAPI_INCOMINGINVOICE_CREATE Invoice Verification: Post Invoice
BAPI_INCOMINGINVOICE_GETDETAIL Invoice Verification: display invoice
BAPI_INCOMINGINVOICE_GETLIST Invoice Verification: List Invoices
BAPI_INCOMINGINVOICE_PARK Invoice Verification: Park Invoice
BAPI_INCOMINGINVOICE_RELEASE Invoice Verification: release invoice
BAPI_INCOMINGINVOICE_SAVE Invoice Verification: Flag Invoice for Background Processing
Thanks & Regards,
Kiran
Maybe you are looking for
-
Worklist not getting displayed in responsibilites screen
Hi All I have Oracle Applications 11.5.10.2. Once I login to applications its showing me the responsibilites but its not displaying the notification list or worklist as it used to show in version 11.5.9. How to display this worklist without going thr
-
Problem with direction in a page(??????)
Hi every body, I have a problem with direction in some page when i change the language to Arabic(right to left language). in some page like welcome page its completely true ,but in some page that i buile with my self (and add some portlet to it like
-
Error in Flatfile (txt) to xml file scenario
hi, while executing the Flat file (txt) to xml file scenario, the txt file picked up from my source directory, but i could not find in my target directory. when i check message monitoring, it is showing successful. Audit Log for Message: af840930-3f
-
Since I go to business trip around the world quite ofter, I was looking for the best way for me to make and receive calls. Since most of my business partners are not skype users AND I may not have internet connection, I would like to know how can I m
-
IDVD (& iPhoto) won't open.
I click the icon either in dock or in applications and get one bounce then nothing.I have systematically gone through each step I've come across within support & discussions. Subsequently iMovie, iWeb and Garage band are now working, however iDVD and