User Exit for Variable
Hi BI Guru's,
In Query Fiscal Year Period (having Single Value Variable), Plant, Issued Qty etc are there.
After executing Report, In Variable Pop Menu , Entered For Example 011.2007, I need to display out of the report as given below link
http://img507.imageshack.us/img507/5492/testzf0.jpg
For Current Month it will get the current month qty.
For Previous Month , If i will use OffSet -1 , it will get the previous month qty.
For Progressive Year (April 2007 means year Start to Current Month which we entered) for this we need to write customer exit. For this any one is having sample code.
If any one having sample code , could pls help me out.
Thanks,
Bhima
Edited by: Bhima Chandra Sekhar Guntla on May 1, 2008 9:33 AM
Hi Bhima,
Check the below link for reference...
http://help.sap.com/saphelp_bw32/helpdata/en/1d/ca10d858c2e949ba4a152c44f8128a/frameset.htm
Find below Sample code for your info:
Go to CMOD tcode and create a project for enhancement RSR00001.
In the Function module EXIT_SAPLRRS0_001 create the include ZXRSRU01 (double click on ) and there put your code.
DATA : wa_var_range LIKE LINE OF i_t_var_range,
wa_e_t_range TYPE LINE OF rsr_t_rangesid.
CASE i_vnam.
WHEN 'a'.
Step 1 for population your variables before selection screen is presented...Step 2 is after data entry for selection screen...
WHEN 'Current_Month'.
CLEAR: W_I_T_VAR_RANGE_IN, L_S_RANGE.
IF I_STEP = 1.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
l_s_range-low = '1'. --> Current Month number
ENDIF.
when 'Previous_Month'.
Repeat the above same step for previous month if it is different field.
Hope this helps u...
Regards,
KK.
Similar Messages
-
Funtion Module for user exits for variables used in BEx Queries.
Hi,
This is for BW Query customer exit variable (zvar2) for include ZXRSRU01 and exit :EXIT_SAPLRRS0_001.
Can anyone please suggest the function modules that can be used to do the following.
1)Read value of zvar1 from selection screen whatever
user enters at run time.
2)How to define the zvar2 in the include. zvar2 is the
variable created in BEx to be populated from this
customer exit.
3)How to use case statment where once the value for zvar1
is determined then,
Case zvar1.
when zvar1 = 0 , then zvar2 = 10
when zvar1 = 1 , then zvar2 = 20
3) Assign zvar2 value as computed in the case statement.
Can anyone please help with the code to achieve this.
Any information regarding function modules that can help write user exits for variable reading and input will be greatly helpful.
Thanks
Sarah.Hi Sarah,
You don't need any FM for your issue.
Please try thie sample code :
DATA: VAR_INPIUT LIKE RRRANGEEXIT.
CASE I_VNAM.
WHEN 'ZVAR2'.
CLEAR L_S_RANGE.
IF I_STEP = 2."PROCESSED AFTER VARIABLE INPUT
*Reading value of ZVAR1
LOOP AT I_T_VAR_RANGE INTO VAR_INPIUT
WHERE VNAM = 'ZVAR1'.
CASE VAR_INPIUT-LOW.
*FILLING ZVAR2
WHEN 0.
L_S_RANGE-LOW = 10.
WHEN 1.
L_S_RANGE-LOW = 20.
ENDCASE.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
EXIT.
ENDLOOP.
ENDIF.
ENDCASE.
Hope this helps
Joe -
User Exit for Variable which calls to a Function Module is NOT working ???
Hi all,
I have a created a variable 'ZNBUSDAY' with Processing Type 'Customer Exit' on 0SCL_DELDAT (Date). The query is on 0PUR_C04 and passing 0SCL_DELDAT to Function Module Z_WORKDAY to get the Next Business Day by using the company Calendar(30). The following code is NOT working and what is WRONG with it, PLEASE? The FM is working FINE.
DATA: wa_calendar(2) TYPE c value '30',
wa_znbusday like sy-datum,
0scl_deldat like sy-datum,
p_days TYPE i value 1.
case i_vnam.
when 'ZNBUSDAY'.
CLEAR wa_znbusday.
CALL FUNCTION 'Z_WORKDAY'
EXPORTING
CURR_DATE = 0scl_deldat
NUMBER_DAYS = p_days
CALENDAR = wa_calendar
IMPORTING
WORK_DAY = wa_znbusday
l_s_range-low = wa_znbusday.
l_s_range-opt = 'EQ'.
l_s_range-sign = 'I'.
append l_s_range to e_t_range.
endcase.
Thanks,
Venkat.Hi Venkat,
Looks like you're only assigning type sy-datum to 0scl_deldat but not the actual value. Try the following:
DATA: wa_calendar(2) TYPE c value '30',
wa_znbusday like sy-datum,
0scl_deldat like sy-datum,
p_days TYPE i value 1.
case i_vnam.
when 'ZNBUSDAY'.
CLEAR wa_znbusday.
0scl_deldat = sy-datum.
CALL FUNCTION 'Z_WORKDAY'
EXPORTING
CURR_DATE = 0scl_deldat
NUMBER_DAYS = p_days
CALENDAR = wa_calendar
IMPORTING
WORK_DAY = wa_znbusday
l_s_range-low = wa_znbusday.
l_s_range-opt = 'EQ'.
l_s_range-sign = 'I'.
append l_s_range to e_t_range.
endcase.
Kind regards,
Alex -
User Exit for For Variable G_Set_Formula_Exit on Report Writer
Hi SAP Experts,
I want to create user exit for formula variable for Cost Center Group with alphanumeric type ( like 1KOSET- but 1KOSET is a set variable). I will use it as one of my row formula in report writer.
There is one alphanumeric user exit example, which is Controlling Area (#S010) in GS13. SAP message said that I can create other alphanumeric user exit by using user exit G_Set_Formula_Exit.
Can someone advice on how to implement this user exit?
Your advice on this issue is highly appreciated.
Thanks,
CWHello Ce Wie,
Were you able to implement G_SET_FORMULA_EXIT? I am also very interested on this issue.
Thanks!
Josep -
How to find the user-exit for transaction fpp2
Hi experts,
could you help me how can I find the user-exit for transaction fpp2. I tried to after the package, but I did not find it.Hi,
Use the following program to find user exits of specified code.
*& Tables
TABLES : tstc, "SAP® Transaction Codes
tadir, "Directory of Repository Objects
modsapt, "SAP® Enhancements - Short Texts
modact, "Modifications
trdir, "System table TRDIR
tfdir, "Function Module
enlfdir, "Additional Attributes for Function Modules
tstct. "Transaction Code Texts
*& Variables
DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE.
DATA : field1(30).
DATA : v_devclass LIKE tadir-devclass.
*& Selection Screen Parameters
SELECTION-SCREEN BEGIN OF BLOCK a01 WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP.
PARAMETERS : p_tcode LIKE tstc-tcode OBLIGATORY.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN END OF BLOCK a01.
*& Start of main program
START-OF-SELECTION.
Validate Transaction Code
SELECT SINGLE * FROM tstc
WHERE tcode EQ p_tcode.
Find Repository Objects for transaction code
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 = enlfdir-area.
MOVE : tadir-devclass TO v_devclass.
ENDIF.
ENDIF.
Find SAP® Modifications
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.
Take the user to SMOD for the Exit that was selected.
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 executed the above program but there are no user exits for the specified Transaction.
Thanks,
Naveen Kumar. -
What are the different methods to find the user-exit for any requirement?
Hi Everybody,
What are the different methods to follow to find the user-exit for any requirement?
Thanks & Regards,
Nagaraju MaddiThe following program search all the user exits involved with a T-code:
Selection Text: P_TCODE: Transaction Code to Search
Text Symbols: 001 - Enter the Transaction Code that you want to search through for a User Exit
REPORT z_find_userexit NO STANDARD PAGE HEADING.
*& Enter the transaction code that you want to search through in order
*& to find which Standard SAP® User Exits exists.
*& Tables
TABLES : tstc, "SAP® Transaction Codes
tadir, "Directory of Repository Objects
modsapt, "SAP® Enhancements - Short Texts
modact, "Modifications
trdir, "System table TRDIR
tfdir, "Function Module
enlfdir, "Additional Attributes for Function Modules
tstct. "Transaction Code Texts
*& Variables
DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE.
DATA : field1(30).
DATA : v_devclass LIKE tadir-devclass.
*& Selection Screen Parameters
SELECTION-SCREEN BEGIN OF BLOCK a01 WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP.
PARAMETERS : p_tcode LIKE tstc-tcode OBLIGATORY.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN END OF BLOCK a01.
*& Start of main program
START-OF-SELECTION.
* Validate Transaction Code
SELECT SINGLE * FROM tstc
WHERE tcode EQ p_tcode.
* Find Repository Objects for transaction code
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 = enlfdir-area.
MOVE : tadir-devclass TO v_devclass.
ENDIF.
ENDIF.
* Find SAP® Modifications
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.
* Take the user to SMOD for the Exit that was selected.
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. -
Help required regarding user exit for STPSHH01 IDOC
Need help regarding user exit.
I append the structure of VTTP and add one field with the name of ZDELCST i.e Delivery cost so i want to update that table once the idoc will post.
I have to write the user exit for this but i have no idea how to do this so kindly requesting someone to please write the code for me and i will be very grateful to him/her.
The functional module is IDOC_INPUT_SHIPPL
and there is a CALL CUSTOMER-FUNCTION '012'
this will take us to function module EXIT_SAPLV56I_012
This includes ZXV56U08
Within this include in need to map the delivery cost from the idoc to the new append filed VTTP-ZDELCSTHi,
use this FM to update ur shipment
variables
DATA: lo_tp_g_tra TYPE v56e_shipment_activities, "Data to modify
lo_tp_g_shp TYPE v56e_shipment,
lo_tp_g_log TYPE v56e_logfile, " Errors function
call the function to modify shipments
CALL FUNCTION 'SD_SHIPMENT_PROCESS'
IMPORTING
e_logfile = lo_tp_g_log
CHANGING
c_activities = lo_tp_g_tra
c_shipment = lo_tp_g_shp
EXCEPTIONS
error = 1
OTHERS = 2.
Thanks,
Sendil. -
Badi or user exit for changing currency INR to EUR
hi friends,
in po header there is one tab called status.
in this tab there is one field called delivery payment
which has curr INR but i want to change that INR CuRR
to EUR.Can any one tell me how do this is there any badi or user exit
for this req.
thanks.Hi Sonu,
Use the following program to find out the appropriate user exist for ur transaction:
REPORT ZGURU_USER_EXIT_FIND .
*& Enter the transaction code that you want to search through in order
*& to find which Standard SAP User Exits exists.
*& Tables
TABLES : tstc, "SAP Transaction Codes
tadir, "Directory of Repository Objects
modsapt, "SAP Enhancements - Short Texts
modact, "Modifications
trdir, "System table TRDIR
tfdir, "Function Module
enlfdir, "Additional Attributes for Function Modules
tstct. "Transaction Code Texts
*& Variables
DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE.
DATA : field1(30).
DATA : v_devclass LIKE tadir-devclass.
*& Selection Screen Parameters
SELECTION-SCREEN BEGIN OF BLOCK a01 WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP.
PARAMETERS : p_tcode LIKE tstc-tcode OBLIGATORY.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN END OF BLOCK a01.
*& Start of main program
START-OF-SELECTION.
Validate Transaction Code
SELECT SINGLE * FROM tstc
WHERE tcode EQ p_tcode.
Find Repository Objects for transaction code
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 = enlfdir-area.
MOVE : tadir-devclass TO v_devclass.
ENDIF.
ENDIF.
Find SAP Modifactions
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.
Take the user to SMOD for the Exit that was selected.
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.
Then u can use the function CONVERT_TO_LOCAL_CURRENCY to change the amount from INR to EUR.
Regards,
Himanshu -
How can we find the list of user exits for a transaction
hi all
iam new in user exits please send the basic details
how can we find the list of user exit for a perticular transaction and how can we determine that a particulr user exit is used for a field
regards
jagadishhi,
check the below links for userexits
http://help.sap.com/saphelp_46c/helpdata/en/64/72369adc56d11195100060b03c6b76/frameset.htm
FAQ's
http://http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
http://www.ficoexpertonline.com/downloads/User%20ExitsWPedit.doc
http://www.easymarketplace.de/userexit.php
http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction
1. what is the defference between enhancement and user-exits?
http://www.sap-img.com/abap/difference-between-badi-and-user-exits.htm
Re: difference between user exits & customer exits
Some Questions ! Plz help...
http://searchsap.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid21_gci1190924_tax299358,00.html?bucket=ETA
2. Difference between CMOD and SMOD?
http://www.sap-img.com/abap/what-is-the-difference-between-smod-and-cmod.htm
http://www.sap-img.com/abap.htm
http://sap.ittoolbox.com/groups/technical-functional/sap-r3-dev/diff-between-cmod-and-smod-236095
http://sap.ittoolbox.com/groups/technical-functional/sap-r3-dev/diff-between-cmod-and-smod-236107
check these links..
http://www.sapgenie.com/abap/tips_and_tricks.htm
http://www.sap-img.com/abap/field-exits-smod-cmod-questions-and-answers.htm
http://www.sap-img.com/abap/what-is-user-exits.htm
passing selet-option variable to subrouine...
Finding the user-exits of a SAP transaction code
Finding the user-exits of a SAP transaction code
Enter the transaction code in which you are looking for the user-exit
and it will list you the list of user-exits in the transaction code.
Also a drill down is possible which will help you to branch to SMOD.
Written by : SAP Basis, ABAP Programming and Other IMG Stuff
http://www.sap-img.com/*
report zuserexit no standard page heading.
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.
*---End of Program
if u want to find the function exit
then check the below code
REPORT ZV_FIND_EXIT NO STANDARD PAGE HEADING.
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.
or
1. in se11, goto table MODSAP
View table contents
2. in Type field, enter 'E' (for function exit)
3. For that tcode, u should know the program name.
eg. SAPLLMOB
4. then type SAPLLMOB and execute
or
REPORT z34331_user_exit .
TABLES : tstc, "SAP Transaction Codes
tadir, "Directory of Repository Objects
modsapt, "SAP Enhancements - Short Texts
modact, "Modifications
trdir, "System table TRDIR
tfdir, "Function Module
enlfdir, "Additional Attributes for Function Modules
tstct. "Transaction Code Texts
DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE.
DATA : field1(30).
DATA : v_devclass LIKE tadir-devclass.
SELECTION-SCREEN BEGIN OF BLOCK a01 WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP.
PARAMETERS : p_tcode LIKE tstc-tcode OBLIGATORY.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN END OF BLOCK a01.
START-OF-SELECTION.
Validate Transaction Code
SELECT SINGLE * FROM tstc
WHERE tcode EQ p_tcode.
Find Repository Objects for transaction code
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 = enlfdir-area.
MOVE : tadir-devclass TO v_devclass.
ENDIF.
ENDIF.
Find SAP Modifactions
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.
Take the user to SMOD for the Exit that was selected.
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.
Regards,
Naveen -
User Exits for Vendor Transaction
In Vendor Master Display XK02, for Payment Transactions there is a Checkbox for Double Invoice. If the Invoice is already made, I want to raise a error message. Is there any User Exit for that Vendor Transaction to achieve this functionality.
Hi
Find the available exits with the following program:::
*& Report ZFINDUSEREXIT
report zfinduserexit.
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).
If there are no available user exits you could go for badi's.
To search for a badi, go to se 24 display class cl_exithandler. double click on method get_instance, get a break point on case statement. execute and start the required transaction in new session. look for variable exit_name. It would show the available badi's.
<b>please reward if useful...</b>
regards
dinesh -
User Exit Formula Variable - to calculate #days of any month
Hello Team,
I need a column in my report layout which shows the #days of any month entered by the user. User entry 01.2014 to 03.2014 report should have 31 28 & 31 according to the Calendar month in the rows.
To achieve this I'm using a user exit formula variable in my local calculation. An Optional Interval User Entry variable on CALMONTH is also put in at the filter section.
I created a CLASS with 2 methods CONSTRUCTOR( vNam = 'ZC2C_DSONWDAYS') & GET_VALUES. We may also use FM /OSP/GET_DAYS_IN_MONTH but i need the code because I failed terribly.
GET_VALUES method code:
if i_step = 2.
DATA: wa like line of i_t_var_range[].
DATA: L_V_INDICATOR TYPE SCAL-INDICATOR.
data: begin of ccrange ,
iobjnm(30) type c,
sign(1),
opt(2),
low(7) type c,
high(7) type c,
end of ccrange.
data: l_s_range type rrrangesid,
no_of_wrkdays type i value 0,
startdate type d,
enddate type d,
startmth(2) type c,
endmth(2) type c,
startyr(4) type c,
endyr(4) type c,
endday(2) type c,
leapyear type i value 0,
dayofmth type syst-datum.
DATA: day type SCAL-INDICATOR.
loop at i_t_var_range into wa.
if wa-iobjnm = '0CALMONTH'.
ccrange-sign = wa-sign.
ccrange-opt = wa-opt.
ccrange-low = wa-low.
ccrange-high = wa-high.
exit.
endif.
endloop.
startyr = ccrange-low+0(4).
startmth = ccrange-low+4(2).
endyr = ccrange-high+0(4).
endmth = ccrange-high+4(2).
concatenate startyr startmth '01' into startdate.
* determine last day of the end month
if endmth = '02'.
leapyear = endyr mod 4.
if leapyear = 0.
endday = '29'.
else.
endday = '28'.
endif.
elseif ( endmth = '04' or endmth = '06' or endmth = '09' or endmth = '11' ).
endday = '30'.
else.
endday = '31'.
endif.
concatenate endyr endmth endday into enddate.
dayofmth = startdate.
IF startmth <= endmth.
startmth = startmth+1.
ENDIF.
* do it for all days in space of time
WHILE dayofmth <= enddate. "to date
CALL FUNCTION '/OSP/GET_DAYS_IN_MONTH'
EXPORTING
input = startmth
IMPORTING
output = no_of_wrkdays.
CLEAR l_s_range.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
l_s_range-low = no_of_wrkdays.
append l_s_range to e_t_range.
startmth = startmth + 1.
CONCATENATE startyr startmth '01' into dayofmth.
ENDWHILE.
endif.
endmethod.Hi Vasavi,
1) Create a FV to calculate no.of days like below, with calmonth in ref characteristics :
2. If you see number of days is an attribute of calmonth. Please enter that as below :
3. Create a formula with above variable and make sure calmonth is added in the row.
Its giving output like this :
I hope this will help you.
Thanks, -
User exit for item level in PO
Hi:
Once we create a PO based on PR. I should not be able to change the net price. I need to through a ERROR MESSAGE.
The price of PR and PO Shuold be same. Used should not change the net price, If he tries to change it, A error msg should be thrown.
Please let me know the Correct User Exit for this.
Thanks
SenthilHi,
Please check sample program to find user exits available for a given transaction code.
REPORT z_find_userexit NO STANDARD PAGE HEADING.
*& Enter the transaction code that you want to search through in order
*& to find which Standard SAP User Exits exists.
*& Tables
TABLES : tstc, "SAP Transaction Codes
tadir, "Directory of Repository Objects
modsapt, "SAP Enhancements - Short Texts
modact, "Modifications
trdir, "System table TRDIR
tfdir, "Function Module
enlfdir, "Additional Attributes for Function Modules
tstct. "Transaction Code Texts
*& Variables
DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE.
DATA : field1(30).
DATA : v_devclass LIKE tadir-devclass.
*& Selection Screen Parameters
SELECTION-SCREEN BEGIN OF BLOCK a01 WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP.
PARAMETERS : p_tcode LIKE tstc-tcode OBLIGATORY.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN END OF BLOCK a01.
*& Start of main program
START-OF-SELECTION.
Validate Transaction Code
SELECT SINGLE * FROM tstc
WHERE tcode EQ p_tcode.
Find Repository Objects for transaction code
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 = enlfdir-area.
MOVE : tadir-devclass TO v_devclass.
ENDIF.
ENDIF.
Find SAP Modifactions
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.
Take the user to SMOD for the Exit that was selected.
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.
or
Enhancement
MEVME001 WE default quantity calc. and over/ underdelivery tolerance
MM06E001 User exits for EDI inbound and outbound purchasing documents
MM06E003 Number range and document number
MM06E004 Control import data screens in purchase order
MM06E005 Customer fields in purchasing document
MM06E007 Change document for requisitions upon conversion into PO
MM06E008 Monitoring of contr. target value in case of release orders
MM06E009 Relevant texts for "Texts exist" indicator
MM06E010 Field selection for vendor address
MM06E011 Activate PReq Block
MMAL0001 ALE source list distribution: Outbound processing
MMAL0002 ALE source list distribution: Inbound processing
MMAL0003 ALE purcasing info record distribution: Outbound processing
MMAL0004 ALE purchasing info record distribution: Inbound processing
MMDA0001 Default delivery addresses
MMFAB001 User exit for generation of release order
MRFLB001 Control Items for Contract Release Order
AMPL0001 User subscreen for additional data on AMPL
LMEDR001 Enhancements to print program
LMELA002 Adopt batch no. from shipping notification when posting a GR
LMELA010 Inbound shipping notification: Transfer item data from IDOC
LMEQR001 User exit for source determination
LMEXF001 Conditions in Purchasing Documents Without Invoice Receipt
LWSUS001 Customer-Specific Source Determination in Retail
M06B0001 Role determination for purchase requisition release
M06B0002 Changes to comm. structure for purchase requisition release
M06B0003 Number range and document number
MEQUERY1 Enhancement to Document Overview ME21N/ME51N
MELAB001 Gen. forecast delivery schedules: Transfer schedule implem.
MEFLD004 Determine earliest delivery date f. check w. GR (only PO)
MEETA001 Define schedule line type (backlog, immed. req., preview)
ME590001 Grouping of requsitions for PO split in ME59
M06E0005 Role determination for release of purchasing documents
M06E0004 Changes to communication structure for release purch. doc.
M06B0005 Changes to comm. structure for overall release of requisn.
M06B0004 Number range and document number
Business Add-in
ME_PROCESS_REQ_CUST Enhancements for Processing Enjoy PReqs: Customer
ME_PROCESS_REQ Enhancements for Processing Enjoy PReqs: Internal
ME_PROCESS_PO_CUST Enhancements for Processing Enjoy Purchase Order: Customer
ME_PROCESS_PO Enhancements for Processing Enjoy Purchase Order: Intern.
ME_PROCESS_COMP Processing of Component Default Data at Time of GR: Custome
ME_PO_SC_SRV BAdI: Service Tab Page for Subcontracting
ME_PO_PRICING_CUST Enhancements to Price Determination: Customer
ME_PO_PRICING Enhancements to Price Determination: Internal
ME_INFOREC_SEND Capture/Send Purchase Info Record Changes - Internal Use
ME_HOLD_PO Hold Enjoy Purchase Orders: Activation/Deactivation
ME_GUI_PO_CUST Customer's Own Screens in Enjoy Purchase Order
ME_FIELDSTATUS_STOCK FM Account Assignment Behavior for Stock PR/PO
ME_DP_CLEARING Clearing (Offsetting) of Down Payments and Payment Requests
ME_PURCHDOC_POSTED Purchasing Document Posted
SMOD_MRFLB001 Control Items for Contract Release Order
EXTENSION_US_TAXES Extended Tax Calculation with Additional Data
ARC_MM_EKKO_WRITE BAdI: Enhancement of Scope of Archiving (MM_EKKO)
ARC_MM_EKKO_CHECK BAdI: Enhancement of Archivability Check (MM_EKKO)
MM_EDI_DESADV_IN Supplementation of Delivery Interface from Purchase Order
MM_DELIVERY_ADDR_SAP Determination of Delivery Address
ME_WRF_STD_DNG PO Controlling Reminder: Extension to Standard Reminder
ME_TRIGGER_ATP Triggers New ATP for Changes in EKKO, EKPO, EKPV
ME_TRF_RULE_CUST_OFF BADI for Deactivation of Field T161V-REVFE
ME_TAX_FROM_ADDRESS Tax jurisdiction code taken from address
ME_REQ_POSTED Purchase Requisition Posted
ME_REQ_OI_EXT Commitment Update in the Case of External Requisitions
ME_RELEASE_CREATE BAdI: Release Creation for Sched.Agrmts with Release Docu.
ME_DEFINE_CALCTYPE Control of Pricing Type: Additional Fields
ME_CHANGE_OUTTAB Enrich ALV Output Table in Purchasing
ME_CHANGE_CHARACTER Customer-Specific Characteristics for Product Allocation
ME_CCP_DEL_DURATION Calc. of Delivery Duration in CCP Process (Not in Standard)
ME_CCP_BESWK_AUTH_CH BAdI for authorization checks for procuring plant
ME_CCP_ACTIVE_CHECK BAdI to check whether CCP process is active
ME_BSART_DET Change document type for automatically generated POs
ME_BAPI_PR_CREATE_02
ME_BAPI_PR_CREATE_01
ME_BAPI_PO_CREATE_02
ME_BAPI_PO_CREATE_01
ME_BADI_DISPLAY_DOC BAdI for Internal Control of Transaction to be Invoked
ME_ACTV_CANCEL_PO BAdI for Activating the Cancel Function at Header Level
MEGUI_LAYOUT BAdI for Enjoy Purchasing GUI
ME_CHECK_ALL_ITEMS Run Through Items Again in the Event of Changes in EKKO
ME_COMMTMNT_REQ_RE_C Check of Commitment Relevance of Purchase Requisitions
ME_COMMTMNT_REQ_RELE Check of Commitment Relevance of Purchase Requisitions
ME_COMMTMNT_PO_REL_C Check for Commitment-Relevance of Purchase Orders
ME_COMMTMNT_PO_RELEV Check for Commitment-Relevance of Purchase Orders
ME_COMMITMENT_STO_CH BadI for checking if commitments for STOs are active
ME_COMMITMENT_RETURN Commitment for return item
ME_CIP_REF_CHAR Enables Reference Characteristics in Purchasing
ME_CIP_ALLOW_CHANGE Configuration in Purchasing: Changeability Control
ME_CIN_MM06EFKO Copy PO data for use by Country version India
ME_CIN_LEINRF2V BADI for LEINRF03 excise_invoice_details
ME_CIN_LEINRF2R BADI for CIN India - Delivery charges
ME_CHECK_SOURCES Additional Checks in Source Determination/Checking
ME_CHECK_OA Check BAdI for Contracts
Reward if helpful.
Regards,
Harini.S -
Hi,
My requirement is that the user who has parked the document should not be able to post the parked document through tcode FBV0.
Is there any user exit where in I can validate the current system user and the user who has parked the document?
I have tried the user-exit SAPLF040,but this does not suffice my requirement.
Also is it possible to define our own exits in tcode OB28?
Regards,
RajeevInfo on user exits can be found here http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
Transaction Code - FBV0 Post Parked Document
|Exit Name |Description |
|F050S001 |FIDCMT, FIDCC1, FIDCC2: Edit user-defined IDoc segment |
|F050S002 |FIDCC1: Change IDoc/do not send |
|F050S003 |FIDCC2: Change IDoc/do not send |
|F050S004 |FIDCMT, FIDCC1, FIDCC2: Change outbound IDoc/do not send |
|F050S005 |FIDCMT, FIDCC1, FIDCC2 Inbound IDoc: Change FI document |
|F050S006 |FI Outgoing IDoc: Reset Clearing in FI Document |
|F050S007 |FIDCCH Outbound: Influence on IDoc for Document Change |
|F180A001 |Balance Sheet Adjustment |
|FARC0002 |Additional Checks for Archiving MM Vendor Master Data |
|RFAVIS01 |Customer Exit for Changing Payment Advice Segment Text |
|RFEPOS00 |Line item display: Checking of selection conditions |
|RFKORIEX |Automatic correspondence |
|SAPLF051 |Workflow for FI (pre-capture, release for payment) |
No of Exits: 13
These are the user exits possible for FBV0
<b>we can find user exit for any transaction, copy and run the following code in SE38</b>
report z_find_userexit no standard page heading.
*& Enter the transaction code that you want to search through in order
*& to find which Standard SAP User Exits exists.
*& Tables
tables : tstc, "SAP Transaction Codes
tadir, "Directory of Repository Objects
modsapt, "SAP Enhancements - Short Texts
modact, "Modifications
trdir, "System table TRDIR
tfdir, "Function Module
enlfdir, "Additional Attributes for Function Modules
tstct. "Transaction Code Texts
*& Variables
data : jtab like tadir occurs 0 with header line.
data : field1(30).
data : v_devclass like tadir-devclass.
*& Selection Screen Parameters
selection-screen begin of block a01 with frame title text-001.
selection-screen skip.
parameters : p_tcode like tstc-tcode obligatory.
selection-screen skip.
selection-screen end of block a01.
*& Start of main program
start-of-selection.
* Validate Transaction Code
select single * from tstc
where tcode eq p_tcode.
* Find Repository Objects for transaction code
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 = enlfdir-area.
move : tadir-devclass to v_devclass.
endif.
endif.
* Find SAP Modifactions
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,
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.
* Take the user to SMOD for the Exit that was selected.
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. -
Abap code of user EXIT for my first post on FISCPER_CALC_MONTH or year
*ZSIGFISCPER Exercice cumulé jusqu'à la période selectionnée par utilisateur
TABLES: TVARVC.
DATA: L_S_RANGE TYPE RSR_S_RANGESID.
DATA : LOC_VAR_RANGE LIKE RRRANGEEXIT,
v_year like T009B-BDATJ,
v_per3 like T009B-POPER,
v_month(3) type c,
v_initial(7) type c,
v_date type d,
w_progcod like tvarvc-low.
BREAK-POINT.
CASE I_VNAM.
WHEN 'ZSIGFISCPER'.
IF I_STEP = 2. "after the popup
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE WHERE VNAM = 'ZP_FIL_FISCPER'.
CLEAR L_S_RANGE.
v_year = LOC_VAR_RANGE-LOW(4).
concatenate v_year '001' into v_initial.
L_S_RANGE-LOW = v_initial.
L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'BT'.
APPEND L_S_RANGE TO E_T_RANGE.
ENDLOOP.
ENDIF.
WHEN 'ZSIGVFISCYEAR'.
IF I_STEP = 2. "after the popup
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE WHERE VNAM = 'ZP_FIL_FISCPER'.
CLEAR L_S_RANGE.
CLEAR v_year.
v_year = LOC_VAR_RANGE-LOW(4).
L_S_RANGE-LOW = v_year.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
ENDLOOP.
ENDIF.
*Sélection de la période 1 par rapport à une période sélectionnée via la variable 'ZP_FIL_FISCPER'
WHEN 'ZVUEPER1'.
IF I_STEP = 2. "after the popup
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE WHERE VNAM = 'ZP_FIL_FISCPER'.
CLEAR L_S_RANGE.
CLEAR v_year.
v_year = LOC_VAR_RANGE-LOW(4).
concatenate v_year '001' into v_initial.
L_S_RANGE-LOW = v_initial.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
ENDLOOP.
ENDIF.
*Sélection de la période 1 par rapport à une période sélectionnée via la variable 'ZSIGFISC'
WHEN 'ZVUEPER2'.
IF I_STEP = 2. "after the popup
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE WHERE VNAM = 'ZSIGFISC'.
CLEAR L_S_RANGE.
CLEAR v_year.
v_year = LOC_VAR_RANGE-LOW(4).
concatenate v_year '001' into v_initial.
L_S_RANGE-LOW = v_initial.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
ENDLOOP.
ENDIF.
Variables pour la requête ZSIGRQ_ZSIGMCM1_01 (Suivi des investissements)
WHEN 'ZSIGCDR2'.
IF I_STEP = 2. "after the popup
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE WHERE VNAM = 'ZP_FIL_FISCPER'.
CLEAR L_S_RANGE.
CLEAR v_year.
v_year = LOC_VAR_RANGE-LOW(4).
CONCATENATE v_year '01' '01' INTO v_date.
L_S_RANGE-LOW = v_date.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
ENDLOOP.
ENDIF.
WHEN 'ZSIGCDMS'. " Date de mise en service
IF I_STEP = 2. "after the popup
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE WHERE VNAM = 'ZP_FIL_FISCPER'.
CLEAR L_S_RANGE.
CLEAR v_year.
v_year = LOC_VAR_RANGE-LOW(4).
CONCATENATE v_year '01' '01' INTO v_date.
L_S_RANGE-LOW = v_date.
CONCATENATE v_year '12' '31' into v_date.
L_S_RANGE-HIGH = v_date.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'BT'.
APPEND L_S_RANGE TO E_T_RANGE.
ENDLOOP.
ENDIF.
WHEN 'ZSIGHIM'. " Hierarchie
IF I_STEP = 1. "before the popup
Clear v_year.
SELECT SINGLE * FROM TVARVC WHERE NAME EQ 'ZSIG_REF_0APPR_YEAR'.
IF sy-subrc EQ 0.
v_year = TVARVC-low.
ENDIF.
CLEAR w_progcod.
SELECT SINGLE * FROM TVARVC WHERE NAME EQ 'ZSIFVA_REF_0PROG_DEF_S'.
IF sy-subrc EQ 0.
w_progcod = TVARVC-low.
ELSE.
MESSAGE 'Variable ZSIFVA_REF_0PROG_DEF_S is missing in TVARVC' TYPE 'E'.
ENDIF.
CONCATENATE w_progcod v_year INTO L_S_RANGE-LOW.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
ENDIF.
IF I_STEP = 2. "after the popup
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE WHERE VNAM = 'ZP_FIL_FISCPER'.
CLEAR L_S_RANGE.
CLEAR v_year.
v_year = LOC_VAR_RANGE-LOW(4).
CLEAR w_progcod.
SELECT SINGLE * FROM TVARVC WHERE NAME EQ 'ZSIFVA_REF_0PROG_DEF_S'.
IF sy-subrc EQ 0.
w_progcod = TVARVC-low.
ELSE.
MESSAGE 'Variable ZSIFVA_REF_0PROG_DEF_S is missing in TVARVC' TYPE 'E'.
ENDIF.
CONCATENATE w_progcod v_year INTO L_S_RANGE-LOW.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
ENDLOOP.
ENDIF.
WHEN 'ZSIGCAC'. " version
IF I_STEP = 2. "after the popup
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE WHERE VNAM = 'ZP_FIL_FISCPER'.
CLEAR L_S_RANGE.
CLEAR v_month.
v_month = LOC_VAR_RANGE-LOW+4(3).
IF v_month LE '003'.
L_S_RANGE-LOW = 'PLA'.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
ELSEIF v_month LE '008'.
L_S_RANGE-LOW = 'AC1'.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
ELSE.
L_S_RANGE-LOW = 'AC2'.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
ENDIF.
APPEND L_S_RANGE TO E_T_RANGE.
ENDLOOP.
ENDIF.
WHEN 'ZSIGDDP'.
IF I_STEP = 2. "after the popup
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE WHERE VNAM = 'ZP_FIL_FISCPER'.
CLEAR L_S_RANGE.
CLEAR v_year.
v_year = LOC_VAR_RANGE-LOW(4).
v_per3 = LOC_VAR_RANGE-LOW+4(3).
CALL FUNCTION 'LAST_DAY_IN_PERIOD_GET'
EXPORTING
I_GJAHR = v_year
I_MONMIT = 00
I_PERIV = 'K4'
I_POPER = v_per3
IMPORTING
E_DATE = v_date
EXCEPTIONS
INPUT_FALSE = 1
T009_NOTFOUND = 2
T009B_NOTFOUND = 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.
ENDIF.
L_S_RANGE-LOW = '20101231'."v_date.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
ENDLOOP.
ENDIF.
Variable Z_DATE_REF_INF_FOUR pour caracteristique 0CALDAY
Intervalle
WHEN 'Z_DATE_REF_INF_FOUR'.
IF I_STEP = 2. "after the popup
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE WHERE VNAM = 'Z_DATE_REF_SUP_FOUR'.
CLEAR L_S_RANGE.
CLEAR v_date.
v_date = LOC_VAR_RANGE-low.
break-point.
CALL FUNCTION 'SALP_CALC_DATE'
EXPORTING
IN_RECTYPE = 'M'
IN_NBR_DWXMQY = '6'
IN_DATE = v_date
IMPORTING
OUT_DATE = v_date
EXCEPTIONS
OTHER_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'SALP_CALC_DATE'
EXPORTING
IN_RECTYPE = 'Y'
IN_NBR_DWXMQY = '-2'
IN_DATE = v_date
IMPORTING
OUT_DATE = v_date
EXCEPTIONS
OTHER_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
L_S_RANGE-LOW = v_date.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
ENDLOOP.
ENDIF.
Variable Z_DATE_REF_INF_FOUR pour caracteristique 0CALDAY
Intervalle
Variables pour Production interne
Intervalle
Debut - FDUPEYROUX - 11/01/2010
WHEN 'ZSIGPEROI'.
IF I_STEP = 2. "after the popup
CLEAR L_S_RANGE.
CLEAR v_date.
READ TABLE I_T_VAR_RANGE INTO LOC_VAR_RANGE
WITH KEY VNAM = 'ZSIGPERPI'.
L_S_RANGE-LOW = LOC_VAR_RANGE-HIGH.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
ENDIF.
WHEN 'ZSIGPEROI_ENT'.
IF I_STEP = 2. "after the popup
CLEAR L_S_RANGE.
READ TABLE I_T_VAR_RANGE INTO LOC_VAR_RANGE
WITH KEY VNAM = 'ZSIGPERPI'.
L_S_RANGE-HIGH = LOC_VAR_RANGE-HIGH.
L_S_RANGE-LOW = '1000001'.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'BT'.
APPEND L_S_RANGE TO E_T_RANGE.
ENDIF.
WHEN 'ZSIGPEROI_P1'.
IF I_STEP = 2. "after the popup
CLEAR: L_S_RANGE, v_per3.
READ TABLE I_T_VAR_RANGE INTO LOC_VAR_RANGE
WITH KEY VNAM = 'ZSIGPERPI'.
IF LOC_VAR_RANGE-LOW+4(3) = '001'.
LOC_VAR_RANGE-LOW(4) = LOC_VAR_RANGE-LOW(4) - 1.
LOC_VAR_RANGE-LOW+4(3) = '012'.
ELSE.
v_per3 = LOC_VAR_RANGE-LOW+4(3) - 1.
LOC_VAR_RANGE-LOW+4(3) = v_per3.
ENDIF.
L_S_RANGE-LOW = LOC_VAR_RANGE-LOW.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
ENDIF.
WHEN 'ZSIGPEROI_PINF'.
IF I_STEP = 2. "after the popup
CLEAR: L_S_RANGE, v_per3.
READ TABLE I_T_VAR_RANGE INTO LOC_VAR_RANGE
WITH KEY VNAM = 'ZSIGPERPI'.
IF LOC_VAR_RANGE-LOW+4(3) = '001'.
LOC_VAR_RANGE-LOW(4) = LOC_VAR_RANGE-LOW(4) - 1.
LOC_VAR_RANGE-LOW+4(3) = '012'.
ELSE.
v_per3 = LOC_VAR_RANGE-LOW+4(3) - 1.
LOC_VAR_RANGE-LOW+4(3) = v_per3.
ENDIF.
L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW.
L_S_RANGE-LOW = '1000001'.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'BT'.
APPEND L_S_RANGE TO E_T_RANGE.
ENDIF.
WHEN 'ZSIGPERAN'.
IF I_STEP = 2. "after the popup
CLEAR L_S_RANGE.
READ TABLE I_T_VAR_RANGE INTO LOC_VAR_RANGE
WITH KEY VNAM = 'ZSIGPERPI'.
L_S_RANGE-HIGH = LOC_VAR_RANGE-HIGH.
L_S_RANGE-LOW = '1000001'.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'BT'.
APPEND L_S_RANGE TO E_T_RANGE.
ENDIF.
WHEN 'ZSIGVDRPI'.
IF I_STEP = 2. "after the popup
CLEAR: L_S_RANGE,v_date,v_year,v_per3.
READ TABLE I_T_VAR_RANGE INTO LOC_VAR_RANGE
WITH KEY VNAM = 'ZSIGPERPI'.
v_year = LOC_VAR_RANGE-HIGH(4).
v_per3 = LOC_VAR_RANGE-HIGH+4(3).
CALL FUNCTION 'LAST_DAY_IN_PERIOD_GET'
EXPORTING
I_GJAHR = v_year
I_MONMIT = 00
I_PERIV = 'K4'
I_POPER = v_per3
IMPORTING
E_DATE = v_date
EXCEPTIONS
INPUT_FALSE = 1
T009_NOTFOUND = 2
T009B_NOTFOUND = 3
OTHERS = 4.
L_S_RANGE-LOW = v_date.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
ENDIF.
Variables pour Production interne
Intervalle
Variables pour Production interne
Intervalle
WHEN 'ZSIGVDRPIM1'.
IF I_STEP = 2. "after the popup
CLEAR: L_S_RANGE,v_date,v_year,v_per3.
READ TABLE I_T_VAR_RANGE INTO LOC_VAR_RANGE
WITH KEY VNAM = 'ZSIGPERPI'.
IF LOC_VAR_RANGE-LOW+4(3) = '001'.
LOC_VAR_RANGE-LOW(4) = LOC_VAR_RANGE-LOW(4) - 1.
LOC_VAR_RANGE-LOW+4(3) = '012'.
ELSE.
v_per3 = LOC_VAR_RANGE-LOW+4(3) - 1.
LOC_VAR_RANGE-LOW+4(3) = v_per3.
ENDIF.
v_year = LOC_VAR_RANGE-LOW(4).
v_per3 = LOC_VAR_RANGE-LOW+4(3).
CALL FUNCTION 'LAST_DAY_IN_PERIOD_GET'
EXPORTING
I_GJAHR = v_year
I_MONMIT = 00
I_PERIV = 'K4'
I_POPER = v_per3
IMPORTING
E_DATE = v_date
EXCEPTIONS
INPUT_FALSE = 1
T009_NOTFOUND = 2
T009B_NOTFOUND = 3
OTHERS = 4.
L_S_RANGE-LOW = v_date.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
ENDIF.
Variables pour Production interne
Intervalle
Edited by: Yass79 on Jan 9, 2012 8:55 PMHi ricx,
hmm, Finally I got you...
What you are asking is;
Is it possible to have User exit for Custom Developed ABAP Programs?
Am i right?
If this is your question, i can say it is not needed as we can edit Zprograms whenever we need.
If you have more doubts, revert back....
Regards
Karthik D -
How to create user Exits for selecting ranges of the month
Hi Bw Experts,
Right now i need to create a user exits for my report which is coming from Infocube which has 12 months and 12 qtys. But if my client want to see the content of the report for e.g 1 to 3 months in selection screen means then we need to create a variable and user exit to accomplish this problem or is there any solution by which we can solve the problem. Try to suggest me and steps to achieve.
Thanks in advance,Hi,
Thanks for your input. But the questions is 12 amounts and 12 qtys not 12 months sorry for the typoerror. We are not carrying month field. But the User want to see the for e.g 1 to 3 months data means then how it is possible to accomplish this issue. Try to suggest me.
Thanks in advance
Message was edited by:
mano_biw durai
Maybe you are looking for
-
NullPointerException while uploading wrong file in af:inputfile
Hi All, I am uploading excel sheet data into jspx Page(database table) by using af:inputFile.After uploading file af:inputFile need to be refresh.It is getting refresh for right file(excel file),but it is not refreshing for wrong file upload. it show
-
SR MBP Wakes immediately after being put to sleep
Background: I've recently been experiencing consistent random sleep failures with my Santa Rosa Macbook Pro. Whether I sleep via the apple menu, or close the lid, the MBP goes through its sleep procedure, then the split second that the MBP latch ligh
-
Screen cracked due to weather change is it covered by warranty
so yea i work as a rink gaurd (ice arena) and it was really cold in there i belive minus 15 when i left and went outside the scrren cracked weather it was +26 so please is it still under warrent ipod touch 4g
-
Hello, I want to set the height of tables rows but I couldn't find the function or the right way to do it. The table is in Column mode. The row size mode is set to Use Explicit Size First I remove all rows and columns and then the following code: Ins
-
About source system parameters.
when I create a source system in BW for connecting to R/3,what's the meaning of available destination(it provide several options,I think they are logical system and all refer to BW itself).There are 2 logical server targets,BW and R/3,but they are th