Urgent-help in code of a user exit
Hi,
I want update the IDoc segment E1EDL20 with warehouse number in EXIT_SAPLV56K_002.
SELECT SINGLE NAME1
INTO E1EDL20-ABLAD FROM T001W
WHERE WERKS = LIPS-WERKS.
PERFORM IDOC_DATA_APPEND USING C_SEGNAM_E1EDL20
E1EDL20.
but this is not working.
Please help me..........
thanks
sangeetha
Hi,
I don't think it requires loop statement becoz this exit is executing whenever there is an append form to IDoc-data table.
I problem is that there is data in IDoc_data table when read it, but there is no data in Idoc_data-segnam.
My code is as follows:
DESCRIBE TABLE IDOC_DATA LINES XLINES.
IF XLINES = 0.
EXIT.
ENDIF.
CASE IDOC_DATA-SEGNAM.
WHEN 'E1EDL20'.
<val>
WHEN <...>
OTHERS.
ENDCASE.
please help me out with this.
thanks
Similar Messages
-
Help needed in BAdi and user-exits
Hi ,
Can any one send me the procedure how to find out user-exits and about BAdi's.
Thanks in advance
Udayhi Uday,
Welcome to <b>SDN</b>
here is the sample program to find the user exits
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
To find the function exit
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.
if u find it useful plz markt the points
Regards,
Naveen -
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? -
HOW TO FIND TRANSACTION CODE BASED ON uSER eXIT.
HI FRIENDS,
I WOULD LIKE TO KNOW HOW WE CAN FIND OUT A TRANSACTION CODE OF AN USER EXIT.
MY USER EXIT IS : EXIT_SAPLV60B_002 .
PLEASE LET ME KNOW .
THANS IN ADVANCE,
REGARDS,
ROBERTS.KFUNCTION EXIT_SAPLV60B_002.
""Lokale Schnittstelle:
*" IMPORTING
*" VALUE(XACCIT) LIKE ACCIT STRUCTURE ACCIT
*" VALUE(VBRK) LIKE VBRK STRUCTURE VBRK
*" REFERENCE(DOC_NUMBER) LIKE VBRK-VBELN OPTIONAL
*" EXPORTING
*" VALUE(XACCIT) LIKE ACCIT STRUCTURE ACCIT
*" TABLES
*" CVBRP STRUCTURE VBRPVB OPTIONAL
*" CKOMV STRUCTURE KOMV
INCLUDE ZXVVFU02.
ENDFUNCTION.
Above is the interface of the function module stated by you, create the include zxvvfu02 by double clicking on it,
put a break point in it and activate and in the debugging mode you can see that the structure XACCIT has EBELN i.e.
purchase order no. assign it to the reqd field. -
Need help in finding tcode - in user exits
hi experts
in user exits, i can find many exits name using <b>SPRO </b>or <b>SMOD</b>. and by this i can find the package also.
my question is how to know where these exits are exactly used, ie., in which transaction these exits are used.
is there any way to find out the tcode, if we know exit name.
thanks
akilaHi
User exits (Function module exits) are exits developed by SAP. The exit is implementerd as a call to a function module. The code for the function module is written by the developer. You are not writing the code directly in the function module, but in the include that is implemented in the function module.
The naming standard of function modules for functionmodule exits is:
EXIT_<program name><3 digit suffix>
The call to a functionmodule exit is implemented as:
CALL CUSTOMER.-FUNCTION <3 digit suffix>
To find a Exit.
Goto Transaction -- Find The Package
SMOD >f4>Use the Package here to Find the Exits In the Package.
Else if you Want to search by Application Area wise ,
There is one more tab to find the Exits in the Respective Application Area.
Implementing the Exit-- CMOD Create ProjectsAssgn your Component .
Now Run ur Transaction to Check if it Triggers.
Thats it..
Suppose you need to find out all the user exits related to a tcode.
1. Execute the Tcode.
2. Open the SAP program.
3. Get the Development Class.
4. Execute Tcode SE84.
5. Open the Node 'Envir. -> Exit Techniques -> 'Customer Exits -> Enhancements'
6. Enter the Development class and execute.
Check out this thread..
The specified item was not found.
1. Type the transaction : system->status-> <PROG. NAME>
2 open SE37 , type EXIT<PROG NAME> and press F4 to get the list of function exits available.
3. Open CMOD utilities->SAP enhancements
EDIT->All selections
4.type the function module name obtained in step 2, in fields 'component name' in 'additional selections' block. and execute.
5. The displayed list contains the enhancements names for the transaction You were looking for.
6. Create a project in CMOD and the code in default include->activate.
http://www.erpgenie.com/sap/abap/code/abap26.htm
which gives the list of exits for a tcode
http://help.sap.com/saphelp_nw04/helpdata/en/bf/ec079f5db911d295ae0000e82de14a/frameset.htm
For information on Exits, check these links
http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
http://www.sapgenie.com/abap/code/abap26.htm
http://www.sap-img.com/abap/what-is-user-exits.htm
http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction
http://www.easymarketplace.de/userexit.php
http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
http://www.sappoint.com/abap/userexit.pdfUser-Exit
http://www.planetsap.com/userexit_main_page.htm
User-Exits
http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
http://www.sap-img.com/ab038.htm
http://www.planetsap.com/userexit_main_page.htm
http://www.sap-basis-abap.com/sapab013.htm
http://sap.ittoolbox.com/documents/popular-q-and-a/user-exits-for-the-transaction-code-migo-3283
These links will help you to learn more on user exits.
http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c8/1975cc43b111d1896f0000e8322d00/frameset.htm
http://www.planetsap.com/userexit_main_page.htm
http://www.allsaplinks.com/user_exit.html
www.sap-img.com/abap/what-is-user-exits.htm
Also please check these threads for more details about user exits.
Re: Screen exit
user exit and customer exit
user exit
1. Document on UserExits in FI/CO
http://www.ficoexpertonline.com/downloads/User%20ExitsWPedit.doc
2. Finding User Exits...
http://sap.ionelburlacu.ro/abap/sap2/Other_Useful_Tips.html#Finding_User_Exits
3. List of all User Exits...
http://www.planetsap.com/userexit_main_page.htm
Reward points for useful Answers -
Checking code for SAP USER EXIT
we have enhanced SAP given data-source 2LIS_XX_XXXXX, there are hard coded user exits for this extractor. How to debug the code for enhancements?
I know we enhance data-source in CMOD....SAPLRSAP001 (transactional data)....SAPLRSAP002(attributes)Hi Monica,
There are many ways to debug the code if you wish to enhance the DataSource. In RSA3 you can do that by clicking Debug mode option. This is already been suggested by Srini.
I would like to give you another way to do so.
If you want to enhance the Transcational data then you need to choose EXIT_SAPLRSAP_001 component of RSAP001 enhancement. It has 4 component for master data( Text, hierarchy...etc).
This is a function module enhancement. If you goto the source code of the function module, you will find an include program i.e. ZXRSAU01. double click on this program which will take you to the body of the program. This is the place where you need to write code.
here you need to write the code as follows.
case i_datasource.
when '2LIS_XX_XXXXX'.
Now here you can set a break point. This can be soft or hardcoded break point if you need to debug.
Better Hardcode it. Write
BREAK-POINT or BREAK username.
Now when you execute the DS through RSA3, The program will stop here. The data extracted from DS will be available in an internal table C_T_DATA. Now you can enhance this by writing code. Again you can debug by pressing F5 or F6. This is as usual the way you debug an ABAP program.
Hope this helps. If you need any further help contact at [email protected]
Give reward point if you're satisfied.
Happy debugging....
cheers,
Message was edited by: tapan tripathy -
Help me for finding out user-exits in sap
hi,
i am subhasis . i want to know how u will know where the user-exits available.
please replay.Hi,
Go through this program and another way is there go through that also.
1) Open CMOD(Project maintenance) Transaction. Enter a project name starting with Z. Press enter.
2) Goto Enhancement window by clicking the enhancement button in the application tool bar.
3) Write SUSR0001 in the enhancement column and press enter.
4) Goto Components window (It will show all the exits included in this enhancement), in our case only one Function Exit will be shown.
5) Double click on the Function exit EXIT_SAPLSUSF_001.
The following function source code will be displayed in the function editor
just run this report u get badi
REPORT ZNEGI16 .
TABLES : TSTC,
TADIR,
MODSAPT,
MODACT,
TRDIR,
TFDIR,
ENLFDIR,
SXS_ATTRT ,
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,
P_PGMNA LIKE TSTC-PGMNA .
DATA wa_tadir type tadir.
START-OF-SELECTION.
IF NOT P_TCODE IS INITIAL.
SELECT SINGLE * FROM TSTC WHERE TCODE EQ P_TCODE.
ELSEIF NOT P_PGMNA IS INITIAL.
TSTC-PGMNA = P_PGMNA.
ENDIF.
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 in ('SMOD', 'SXSD')
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:/(105) SY-ULINE.
FORMAT COLOR COL_HEADING INTENSIFIED ON.
Sorting the internal Table
sort jtab by OBJECT.
data : wf_txt(60) type c,
wf_smod type i ,
wf_badi type i ,
wf_object2(30) type C.
clear : wf_smod, wf_badi , wf_object2.
Get the total SMOD.
LOOP AT JTAB into wa_tadir.
at first.
FORMAT COLOR COL_HEADING INTENSIFIED ON.
WRITE:/1 SY-VLINE,
2 'Enhancement/ Business Add-in',
41 SY-VLINE ,
42 'Description',
105 SY-VLINE.
WRITE:/(105) SY-ULINE.
endat.
clear wf_txt.
at new object.
if wa_tadir-object = 'SMOD'.
wf_object2 = 'Enhancement' .
elseif wa_tadir-object = 'SXSD'.
wf_object2 = ' Business Add-in'.
endif.
FORMAT COLOR COL_GROUP INTENSIFIED ON.
WRITE:/1 SY-VLINE,
2 wf_object2,
105 SY-VLINE.
endat.
case wa_tadir-object.
when 'SMOD'.
wf_smod = wf_smod + 1.
SELECT SINGLE MODTEXT into wf_txt
FROM MODSAPT
WHERE SPRSL = SY-LANGU
AND NAME = wa_tadir-OBJ_NAME.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
when 'SXSD'.
For BADis
wf_badi = wf_badi + 1 .
select single TEXT into wf_txt
from SXS_ATTRT
where sprsl = sy-langu
and EXIT_NAME = wa_tadir-OBJ_NAME.
FORMAT COLOR COL_NORMAL INTENSIFIED ON.
endcase.
WRITE:/1 SY-VLINE,
2 wa_tadir-OBJ_NAME hotspot on,
41 SY-VLINE ,
42 wf_txt,
105 SY-VLINE.
AT END OF object.
write : /(105) sy-ULINE.
ENDAT.
ENDLOOP.
WRITE:/(105) SY-ULINE.
SKIP.
FORMAT COLOR COL_TOTAL INTENSIFIED ON.
WRITE:/ 'No.of Exits:' , wf_smod.
WRITE:/ 'No.of BADis:' , wf_badi.
ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(105) 'No userexits or BADis exist'.
ENDIF.
ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/(105) 'Transaction does not exist'.
ENDIF.
AT LINE-SELECTION.
data : wf_object type tadir-object.
clear wf_object.
GET CURSOR FIELD FIELD1.
CHECK FIELD1(8) EQ 'WA_TADIR'.
read table jtab with key obj_name = sy-lisel+1(20).
move jtab-object to wf_object.
case wf_object.
when 'SMOD'.
SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).
CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
when 'SXSD'.
SET PARAMETER ID 'EXN' FIELD SY-LISEL+1(20).
CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.
Hi Crm_learner,
gothrough this navigation.
se93->provide for which transaction code u want to impliment the badi->display option->copy the package name.
next
se18->press f4 help->information system->provide the package name->enter
It will display the all the badis.
provode the badi name->select implimentation option in menubar->create->prvide the implimantation name->enter
provide the implimantation shrt text->save the badi.
Go for the interface option->double click onthe method->provide the coding in between method and endmethod. and active the badi.
program automatically call this badi and execute u code.
This is the badi.
DEFINING THE BADI
1) execute Tcode SE18.
2) Specify a definition Name : ZBADI_SPFLI
3) Press create
4) Choose the attribute tab. Specify short desc for badi.. and specify the type :
multiple use.
5) Choose the interface tab
6) Specify interface name: ZIF_EX_BADI_SPFLI and save.
7) Dbl clk on interface name to start class builder . specify a method name (name,
level, desc).
Method level desc
Linese;ection instance methos some desc
8) place the cursor on the method name desc its parameters to define the interface.
Parameter type refe field desc
I_carrid import spfli-carrid some
I_connid import spefi-connid some
9) save , check and activate adapter class proposed by system is
ZCL_IM_IM_LINESEL is genereated.
IMPLEMENTATION OF BADI DEFINITION
1) EXECUTE tcode se18.choose menuitem create from the implementation menubar.
2) Specify aname for implementation ZIM_LINESEL
3) Specify short desc.
4) Choose interface tab. System proposes a name fo the implementation class.
ZCL_IM_IMLINESEL which is already generarted.
5) Specify short desc for method
6) Dbl clk on method to insert code..(check the code in AAA).
7) Save , check and activate the code.
Some useful URL
http://www.esnips.com/doc/e06e4171-29df-462f-b857-54fac19a9d8e/ppt-on-badis.ppt
http://www.esnips.com/doc/10016c34-55a7-4b13-8f5f-bf720422d265/BADIs.pdf
http://www.esnips.com/doc/43a58f51-5d92-4213-913a-de05e9faac0d/Business-Addin.doc
http://www.esnips.com/doc/1e10392e-64d8-4181-b2a5-5f04d8f87839/badi.doc
www.sapgenie.com/publications/saptips/022006%20-%20Zaidi%20BADI.pdf
http://www.sapdevelopment.co.uk/enhance/enhance_badi.htm
http://help.sap.com/saphelp_nw04/helpdata/en/04/f3683c05ea4464e10000000a114084/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/e6/d54d3c596f0b26e10000000a11402f/content.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/c2/eab541c5b63031e10000000a155106/frameset.htm
Now write a sample program to use this badi method..
Look for BBB sample program.
AAA
data : wa_flights type sflight,
it_flights type table of sflight.
format color col_heading.
write:/ 'Flight info of:', i_carrid, i_connid.
format color col_normal.
select * from sflight
into corresponding fields of table it_flights
where carrid = i_carrid
and connid = i_connid.
loop at it_flights into wa_flights.
write:/ wa_flights-fldate,
wa_flights-planetype,
wa_flights-price currency wa_flights-currency,
wa_flights-seatsmax,
wa_flights-seatsocc.
endloop.
BBB
*& Report ZBADI_TEST *
REPORT ZBADI_TEST .
tables: spfli.
data: wa_spfli type spfli,
it_spfli type table of spfli with key carrid connid.
*Initialise the object of the interface.
data: exit_ref type ref to ZCL_IM_IM_LINESEL,
exit_ref1 type ref to ZIF_EX_BADISPFLI1.
selection-screen begin of block b1.
select-options: s_carr for spfli-carrid.
selection-screen end of block b1.
start-of-selection.
select * from spfli into corresponding fields of table it_spfli
where carrid in s_carr.
end-of-selection.
loop at it_spfli into wa_spfli.
write:/ wa_spfli-carrid,
wa_spfli-connid,
wa_spfli-cityfrom,
wa_spfli-deptime,
wa_spfli-arrtime.
hide: wa_spfli-carrid, wa_spfli-connid.
endloop.
at line-selection.
check not wa_spfli-carrid is initial.
create object exit_ref.
exit_ref1 = exit_ref.
call method exit_ref1->lineselection
EXPORTING
i_carrid = wa_spfli-carrid
i_connid = wa_spfli-connid.
clear wa_spfli.
Rewards some points.
Rgds,
P.Naganjana Reddy -
Populating cost center automatically by Ts code WVFB - Which user exit ?
Hi experts,
I want to populate cost center and to do 'k' assignment automatically using WVFB for Sotre Order creation.
Which user-exit should be activate? thanks a lot in advance.
( the purpose is when user create a store order by transaction code WVFB , the fields of 'k' assingment and cost center don't need to be filled out, an user exit should make 'k' assignment & fill out cost center KOSTL. I just need to know this user exit).
EXIT_SAPLWVFB_002 will be good for my problem? please advice. thanks.Yes. I solved my problem.
EXIT_SAPLWVFB_002 was used to do it. -
Why the code in a user exit is executed twice?
Hi all,
I've got a development in a user exit EXIT_SAPMP56T_001.
This user exit allows us to control the travel expenses.
When you go to the TX: PR05 you can see a list with travels to add expenses. Here you can select one item on the list and press the edit button to add new expenses.
We want to control this and we use this user exit for that purpose.
When the user selects a row and presses the edit button, the user exit is triggered. We can check the values of the table and see which row is selected. But this exit is executed twice. The first time the table doesn't have any changes on it, the second time it has marked the selected row.
Why is this happening? Why is this exit executed twice? And how can I control that the table is properlly updated?
Thank you.Hi,
I think this user exist in getting triggered both in the PAI and PBO of that screen.
For avoiding this use the flag.
If flag is initial then only your code needs to trigger.
if flag is initial.
flag = 'X'.
then your code.
endif.
So when it again comes into the PBO it will check the flag and the same code will not be triggered for the second time.
With Regards,
Sumodh.P -
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 -
Urgent. Need to know about user exits.
Hello Everyone,
I am new to this forum. I need to know about user exits.
My next project requires me to implement user exits, screen exits, etc.
I am a rookie to this topic.
Can anyone help me as to how to start with his topic.
Any sort of help is appreciated.
Cheers,
Neelam.Hi Neelam,
Welcome to sdn.
This is a very frequently asked topic.
Please use teh search forum option for this type of queries.
http://help.sap.com/saphelp_47x200/helpdata/en/c8/19763443b111d1896f0000e8322d00/frameset.htm
Regards,
Ravi -
T.codes for MM User exit
Hi Alll,
Could any body tell me the transaction available to check the user exits for PR,PO and so on
thanks in advance
regards
sapmmSapmm,
I am not sure what you mean by check. I will assume you want to know which user exits are available. From here you can discover which ones, if any, are actually being used, and what they actually do, by reviewing the developed code using one of the ABAP editors.
You can use SMOD to review all enhancements, but I find it a little less confusing to use the following method. Try this:
SPRO > IMG > Search (binoculars) for "Enhancements". In the search results, they will be ordered by functional area (the right hand pane) Scroll down to the functional area of interest (You will get BADIs as well using this technique). Select the item of interest and go there.
You will be taken to the config section for that enhancement. Select the 'IMG actitivy documentation' icon (paper to the left). It will give a brief description of the standard enhancements. You can review these in detail using SMOD.
If any userexits have actually been implemented in your system, it will be via a project. You can review existing projects using CMOD. Select any active projects and review to see which enhancements have been assigned to the projects.
Normally, the above tasks are performed by an ABAPer. Most functional consultants don't get into the nasty details of Userexits.
Rgds,
DB49 -
PLZ HELP ME....USER EXITS
hi,
can anybdy provide me sample codes on the following user exits?
i) SAPMF02D (Customer Master data) XD03
ii) SAPMF02K (Vendor Master Data) LFA1
iii) MBCF0002 (user exit for materials documents)
iv) M06B0003 (MM documents)
thanks in advancewhat do you mean by sample code ?
user exit is used to acheive a particular requirement specific for that client, right ?
using smod, attach these enhancements to a project, then double click on the includ ename..and write code you want to....activate the project.
here is a sample code in MBCF0002
IF I_MSEG-SOBKZ = 'E' AND I_MSEG-KZBWS IS INITIAL.
MESSAGE E002(ZSD01).
ENDIF. -
Required the transaction code for the user exit
Hi Abap Gurus,
i want to find out the *sap transaction code for which the user exit belongs to from the below code i am getting the enhancement name and the type.
i want to know the transaction code for exit EXIT_SAPLMEKO_002 and EXIT_SAPLFYTX_USER_001
data: begin of it_modsap occurs 0,
name type modsap-name,
typ type modsap-typ,
member type modsap-member,
end of it_modsap.
type-pools:slis.
data:wa_layout type slis_layout_alv.
data:it_sort type slis_t_sortinfo_alv.
data:wa_sort like line of it_sort.
parameters:p_exit type modsap-member.
select * from modsap into table it_modsap where member = p_exit.
read table it_modsap index 1.
select * from modsap into table it_modsap where name = it_modsap-name.
wa_layout-colwidth_optimize = 'X'.
wa_sort-fieldname = 'NAME'.
wa_sort-tabname = 'IT_MODSAP'.
wa_sort-up = 'X'.
append wa_sort to it_sort.
clear wa_sort.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = sy-repid
i_structure_name = 'MODSAP'
is_layout = wa_layout
it_sort = it_sort
tables
t_outtab = it_modsap.HI
The user exit EXIT_SAPLFYTX_USER_001 is trigered for the below transactions and also postings via IDOC.
'ME21' 'ME21N' 'ME22' 'ME22N' 'ME23' 'ME23N' 'ME31L' 'ME31' 'ME32L' 'ME32' 'ME33L' 'ME33' 'ME38' 'ME39' 'VL31N' 'VL32N' 'VL33N'.
This is basically used for tax calculation purposes.
The user exit EXIT_SAPLMEKO_002 is trigerred for multiple transactions of purchansing scenario.
Also use user exit for your business scenario.
Br
Vijay V -
Urgent Help Needed - Associating Statistics with User-Defined Functions
Hello,
We have an appication uses cost-based optimizer and uses a lot of TO_DATE and SYSDATE calls in FROM and WHERE clauses. For certain reasons, every call to TO_DATE and SYSDATE has been replaced by MY_TO_DATE and MY_SYSDATE respectively (which in turn call built-in functions). However, cost based optimizer is behaving strangely, which is understanble, based on the lack of user-defined functions statistics. I am under the impression that I should use something like:
ASSOCIATE STATISTICS WITH FUNCTIONS my_to_date DEFAULT SELECTIVITY ?;
ASSOCIATE STATISTICS WITH FUNCTIONS my_to_date COST (?,?,?);
ASSOCIATE STATISTICS WITH FUNCTIONS my_sysdate DEFAULT SELECTIVITY ?;
ASSOCIATE STATISTICS WITH FUNCTIONS my_sysdate COST (?,?,?);
but what should the values (?) be?. I guess I want to replicate TO_DATE and SYSDATE values, but how would I find out what they are? Thanks in advance...
P.S. I am also looking for workarounds (I cannot create a synonym for TO_DATE right?), so any help is welcome!!!Hi emmalou69 ,
You told your actual parameter is
5, 5, 7.3 and 'z'
so change your method like
public static int test(int x, int y, double d, char ch)
because 5 - int; 7.3- float or double; z is char.
your method returns
public static int.
so you should return only int variable. but in your code you mentioned double. it's not correct.
The original code should look like
public class rubbish
public static void main(String args[]){
rubbish f = new rubbish();
f.test(5, 5, 7.3 ,'z');
public static int test(int x, int y, double d, char ch)
int value;
x = 5;
y = 5;
d= 7.3;
ch = 'z';
value =((int) d + x + y + ch);
System.out.println( x + ch + d + y);
return value;
}//here int value of z is 122.
and int(7.3) is 7
so 7+5+5+122 = 139.3
but value =((int) d + x + y + ch); returns 139. because you convert double to int that is 7.3 to 7
If it is useful, rate me duke dollars,
Thanks
Maybe you are looking for
-
Problem with display firefox 11
I installed Firefox 11.o today. Since then the display with the browser is all wrong. See the link below [http://lamortdanslart.com/firefox11_screen.jpg Print screen]
-
Problem, radio dont starts after update to Mozilla Firefox 12
I have problem with a radio in a website after the update of Mozilla Firefox 12 When i log in the webste the radio dont starts, when i use the Internet Explorer the radio starts. Check the picture http://img859.imageshack.us/img859/3150/egweggwe.png
-
Could anyone tell me what is a senior member in a coherence cluster?
Hi all, I am problem finding the definition of Senior member in coherence documentation. Could anyone tell me what is a Senior member in a coherence cluster? Could we configure which server is Senior? How? Thanks and Regards, NB
-
DR server setup from production
Hi Experts, We are implementing ECC6.0 and also we have to install the DR server also. The data guard integration between our production server and DR server will be done by our hardware vendor. Now I would like to know that DR server SID will be sam
-
Condition group in Sales order
Hi Experts, I need help in maintaining the <b>condition group 1</b> value in tab <b>additional dataA</b> in sales order item level. Right now we are getting the values based on the sold to customer of the sales order but we need it based on the ship