User exit or BADI while saving purchase order
Hello,
I want to use an user exit or BADI while saving of purchase order. The objective is to check the material group of the line item while saving. We don´t want to allow to save purchase orders for one material group.
Can you please guide me.
Thanks
Srinivasan
Hi
The Business Add-In (BAdI) ME_PROCESS_PO_CUST enables you to extend the business logic of the Enjoy purchase order on an individual basis.
You can thus influence the dialog transactions ME21N, ME22N, ME23N, and ME29N, and the BAPIs BAPI_PO_CREATE1 and BAPI_PO_CHANGE.
Typical applications for this BAdI include:
Processing of own objects
Processing of additional data on standard objects
Implementation of additional checks and derivationsChange of data in standard fields
Change in field selection
you can use this BADI for checking the material group
Thanks & Regards
Kishore
Similar Messages
-
What is the BADI while SAVING purchase order using me22n?
what is the BADI while SAVING purchase order using me22n?
while i will save purchase order through me22n, badi should be fire what is badi for that?
regards,
dushyant.Dushyant,
Hopefully you know how to implement the BADI ME_PROCESS_PO_CUST now.
The following are the codes that you can put in the method "Post".
DATA: LW_HEADER TYPE MEPOHEADER,
LW_POSTED_HEADER TYPE MEPOHEADER,
LW_VALID TYPE MMPUR_BOOL,
ITAB_ITEM TYPE PURCHASE_ORDER_ITEMS,
LW_ITEM TYPE MEPOITEM,
ITEM_INTERFACE TYPE PURCHASE_ORDER_ITEM,
ITAB_ACCT TYPE PURCHASE_ORDER_ACCOUNTINGS,
ACCT_INTERFACE TYPE PURCHASE_ORDER_ACCOUNTING,
LW_ACCT TYPE MEPOACCOUNTING,
LW_POSTED_ACCT TYPE MEPOACCOUNTING,
W_ACCT_CHANGED TYPE C,
W_GRANT_AMT TYPE EKPO-NETWR,
W_FINANCE_AMT TYPE EKPO-NETWR,
W_FLAG TYPE C.
Check if PO header data is valid
CLEAR LW_VALID.
CALL METHOD IM_HEADER->IS_VALID
RECEIVING
RE_VALID = LW_VALID.
CHECK LW_VALID = 'X'.
PO header data is valid
Get the newly updated PO header data
CLEAR LW_HEADER.
CALL METHOD IM_HEADER->GET_DATA
RECEIVING
RE_DATA = LW_HEADER.
Get the posted PO header data
CLEAR LW_POSTED_HEADER.
CALL METHOD IM_HEADER->GET_PERSISTENT_DATA
IMPORTING
EX_DATA = LW_POSTED_HEADER
EXCEPTIONS
NO_DATA = 1.
IF SY-SUBRC <> 0.
CLEAR LW_POSTED_HEADER.
ENDIF.
Get PO line items
REFRESH ITAB_ITEM.
CALL METHOD IM_HEADER->GET_ITEMS
RECEIVING
RE_ITEMS = ITAB_ITEM.
LOOP AT ITAB_ITEM INTO ITEM_INTERFACE.
Check if PO line item is valid
CLEAR LW_VALID.
CALL METHOD ITEM_INTERFACE-ITEM->IS_VALID
RECEIVING
RE_VALID = LW_VALID.
IF LW_VALID <> 'X'.
This PO line item is not valid
CLEAR W_ACCT_CHANGED.
EXIT.
ENDIF.
CLEAR LW_ITEM.
CALL METHOD ITEM_INTERFACE-ITEM->GET_DATA
RECEIVING
RE_DATA = LW_ITEM.
Get the account interface
REFRESH ITAB_ACCT.
CALL METHOD ITEM_INTERFACE-ITEM->GET_ACCOUNTINGS
RECEIVING
RE_ACCOUNTINGS = ITAB_ACCT.
LOOP AT ITAB_ACCT INTO ACCT_INTERFACE.
CLEAR LW_ACCT.
Get the newly updated PO item data
CALL METHOD ACCT_INTERFACE-ACCOUNTING->GET_DATA
RECEIVING
RE_DATA = LW_ACCT.
CLEAR LW_POSTED_ACCT.
Get the posted PO item data
CALL METHOD ACCT_INTERFACE-ACCOUNTING->GET_PERSISTENT_DATA
IMPORTING
EX_DATA = LW_POSTED_ACCT
EXCEPTIONS
NO_DATA = 1.
IF SY-SUBRC > 0.
CLEAR LW_POSTED_ACCT.
ENDIF.
IF LW_ACCT-LOEKZ <> LW_POSTED_ACCT-LOEKZ OR
LW_ACCT-KOSTL <> LW_POSTED_ACCT-KOSTL OR
LW_ACCT-PRCTR <> LW_POSTED_ACCT-PRCTR OR
LW_ACCT-PS_PSP_PNR <> LW_POSTED_ACCT-PS_PSP_PNR.
Account assignment was changed
We will force this PO to go through workflow
W_ACCT_CHANGED = 'Y'.
ENDIF.
ENDLOOP.
ENDLOOP. -
User Exit or BADI when saving Internal Orders
Hello, I need a user exit or BADI when saving a Internal Orders to shoot a workflow
REGARDS
DayanaHi
Why do you need a user exit or BADI.
Create a Custom Business Object(SWO1) and Create a New Event(SW01) and link it to the B.O. Or you could also create a CO Validation and use it for triggering a Validation and as a last resort you go for User Exit or Abap code.
Check if you have some workflow expertise in your tech team and you should be fine.
Thanks,
Praveen -
User Exit or BADI while posting GRs.
HI all,
I am looking for a User Exit or BADI while posting Goods Receipts for Purchase Orders.
I need to change the <b>POSTING DATE</b> on the receipt for certain document types.
i found a user exit : MB_CF001, but this is not allowing me to change the posting date on the material document.
Thanks for your help in advance.Hi Ravi,
This is ULitity program which takes Tcode or program name as a input and gives the BADI existing in the program. Please Allocate me the point if it is usefully to you
REPORT ZBADI_CHECK .
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.
endcase. -
Can anyone give me user exit name for create/update purchase order partners
Hello guys
Can anyone gives me user exit name for create/update purchase order partners?
Requirement is to insert/update partner when SC flag is checked while creating/updating purchase order (ME22N / ME21N) by using user exit.hi,
check these exits.
Transaction Code - ME21N Create Purchase Order
Enhancement/ Business Add-in Description
Enhancement
MEQUERY1 Enhancement to Document Overview ME21N/ME51N
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
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
MELAB001 Gen. forecast delivery schedules: Transfer schedule implem.
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
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
M06B0003 Number range and document number -
Error while saving purchase order
Hi all,
While saving purchase order i am getting the following error.
Syntax error in program SAPLV61A
in include RV64A932
in line 10
Statement"*&"is not defined.check your spelling.
Thanks& Regards,
Hari.Hi Hari,
I've just encountered the same problem as you have now in your latest post.
Normally the include that you mentioned is a formula condition value include which you can modify but you probably have
to register this object first on the SAP OSS pages to get an Access key to modify it.
After you've obtained a key launch transaction VOFM and comment out the line "TABLES: VBRK, VBAK".
As you see below SAP did exactly the same thing in several other includes.
Include FV64A582
-> is a formula condition value
tx VOFM
-> Formulas
-> Condition Value
-> Routine number 582
At line 37 I commented out "TABLES: VBRK, VBAK." which is not used
anyway in this include.
On top of that SAP commented out these definitions in several other
includes: eg. FOICH002, FOICH002, OI_LV61ATOI.
If other persons have comments on this topic please respond/advise.
Hari, inform us if this resolved your problem.
Also reward points if my post aided you in resolving your issue.
Thank you for feedback.
Best regards,
Tom Cockaert. -
User Exit for ME22N while saving of PO
Hi all,
i want a USER EXIT for ME22N while saving. i want EKET data.
After checking EKET data, i want to chage EKPO data.
Thanks
pabiHi,
Below Exit you can have access to EKET and EKPO data in the tables paramters before the SAVE
EXIT_SAPMM06E_012
TEKPO: EKPO data
TEKET: EKET data
Enhancement:MM06E005 (Check in SMOD transaction)
Check for one Paramter: I_TRTYP (This is for Create/Change/Display Modes) or You can check on Sy-Tcode = ME22N
Hope this helps
Regards
Shiva -
User Exit or BADI on saving of Sales order cost estimate (CK51N)
Hi,
Can any one share with me what are the User Exit or BADI that gets triggered on saving of Sales order cost estimate (CK51N).
Regards,
BijayHi
Check the link
Need Enhancement Spot or BADI for transaction ck51n
Regards
Sanil -
User Exit or BADI for Blocking process orders from R/3 to APO?
Dear Experts,
I am looking for a user exit or badi to block the process orders from R/3 to APO. As per standard it is not transferring orders which are clsd(closed status). Means that it is not updating live cache but its reading from R3.
We are facing some problems in cif queues which are not correctly maintained in R3 side. We dont want to touch those orders bcoz its very old data which is not required for planning.
There will be huge data which needs to be deleted while transferring through cif.
Please give any user exit (outbound intial transfer) from R/3.
Or any sugg. I apprecite your inputs...
Thanks
CrisHi Cris,
You can use user exit APOCF004 - Inbound Processing: Production Order/Planned Order in APO to prevent orders coming to APO by deleting orders which are not intended to goto APO from internal tables IT_ORD and IT_OUT.
Hope this helps.
Best Regards,
Ramesh M -
User exit or BADI after saving in ML81N
Hi,
I have created a Custom tab at header level in ML81N. In this tab the user enters the data which is to be stored in Ztables once the entry sheet is successfully saved. I am searching for BADI or user exits for saving the data. Can anyone tell me user exit or BADI which is triggered after saving the data?
Thanks in advance.Hi Poorvi,
Please get your results from the search.
http://www.sdn.sap.com/irj/scn/advancedsearch?query=userExitBadiML81N -
User Exit/ Enahancement/BADI in the sales order creation process
Hi,
We have an EDI process for creating a sales order, we want to change one of the partners on some of the lines according to the document type,
We know how to do it using the MV45AFZZ user exits but we want to do it using a BADI or an Enhancement,
Can anyone help us find a User Exit/ Enahancement/BADI ?
Thanks,
MickeyHi,
Thanks for the quick answer,
i created an implementation for this BADI and put a break point there but it didnt stop there,
i also tried a break point on FM "SXV_GET_CLIF_BY_NAME" to see if this BADI is on the list but i didnt find it,
i tried creating the sales order via VA01 and via the IDOC process,
Thanks,
Mickey -
MB1B User exit or Badi before saving transaction
Dear friends ,
I need to identify a user exit or badi that I can use to populate one field in tcode MB1B before saving.
How could I find it ?!
best regards,
AleHi Alessandro,
Hope you find this useful..
For Finding user exits
[http://www.erpgenie.com/sap/abap/code/abap26.htm]
Find a BADI called from within an SAP transaction
The following steps will allow you to simply find a BAPI that is linked to an SAP transaction code.
1. Execute transaction SE37 or SE80 and find function module 'SXV_GET_CLIF_BY_NAME'.
2. Insert a breakpoint in it.
3. Now go to the SAP transaction you want to find a BADI in.
4. When you execute it, it will stop at the above function module.
5. Look at the value of field EXIT_NAME.
6. This will provide you with the name of the BADI that is available in your SAP transaction code.
This technique can be used to find out the BADI for given transaction.
Follow below steps.
Go to transaction ST05, select buffer trace and click on activate trace button.
Now run your transaction code for which you want to find out the customer exits.
Go back to ST05, click on deactivate trace and display trace.
A popup screen "Set Restrictions for Displaying Trace" appears. Now, filter the trace on Objects V_EXT_IMP and V_EXT_ACT
All the interface class names of view V_EXT_IMP start with IF_EX_. The BADI name is the name after the IF_EX_.
E.G: in the name IF_EX_ME_PROCESS_PO_CUST BADI name is ME_PROCESS_PO_CUST.
How to find BADI
1. Go to the TCode SE24 and enter CL_EXITHANDLER as object type.
2. In 'Display' mode, go to 'Methods' tab.
3. Double click the method 'Get Instance' to display it source code.
4. Set a breakpoint on 'CALL METHOD cl_exithandler=>get_class_name_by_interface'.
5. Then run your transaction.
6. The screen will stop at this method.
7. Check the value of parameter 'EXIT_NAME'. It will show you the BADI for that transaction.
Regards -
User-Exit or BAdI when saving an asset?
Hi experts,
I would describe our problem and I wish you could guide us to the best solution.
We have create a Workflow that synchronises the creation of a functional location with the asset (because we don't find any user-exit that allowed this requirement). The process is the following:
1.- First of all, Workflow validates that WBS Element of the functional location exists. In afirmative case, it continues to step nº 2. Otherwise, WorkItem is cancelled.
2.- We create a functional location with tx. IL01 and as a result of that, a WorkItem is created related to some specific user. He opens the SAP Business Workplace and approve it.
3.- Then, when he approves that WorkItem we call to the method BAPI_FIXEDASSET_CREATE1 that creates the asset.
Now we would like to get some User-Exit or BAdI that makes our data persisted before the user press SAVE button, because i have to inform the asset and subnumer to the functional location with the number of the asset we have just created.
Could that be possible?
Lots of thanks.
JaviHi,
I am still having trouble with this topic...
No enhancements posted at the message before solved the described problem. So I started to think in another way...
At the Workflow circuit defined to synchronise functional locations with asset master, we would like some function like "CreateBright" in Object "EQUI_EXT" (tx. SWO1). Inside the code, there is a call function to "AAPM_AA_SYNC_BY_WORKFLOW" that automatically creates the equipment and join the asset master.
In functional locations, we don't have this function so what can I do to have the same concept in functional creations and not equipments? Any idea?
Lots of thanks for the answers.
Javi -
[Request] Special user-exit we need during creating purchase order
Hi, Gurus!
We need to make specific User-Exit during creating Purchase order.
When user creates/change a PO document (ME21N/22N), SAP has to check the u2018CUSTOMERu2019 filed whether it is BLANK or NOT in Delivery Address tab at ITEM LEVEL.
If there is no value in that field, system will automatically input right value with useru2019s business logic.
Thatu2019s what we want to implement in the future.
If you have any solution or recommendation for this, Please help us.
I really appreciate your help in advance.
Best Rgds;
IanFor checking user exit - SMOD, you need to activate this exit via CMOD
For Badi - SE18 to check & SE19 to implement
Take the help of your abaper, give him / her your logic.
Hope the above answers your query.
Regards,
Vivek -
Issue while saving Purchase Order
Dear all
I am trying to save a Purchase order, the taxes in Purchase order -> Invoice -> Taxes are not getting populated corectly.
Is there any user exit/Badi to populate the same.
Thanks in advance.
Regards
Dineshif tax rate not triggered in po mean, some where wrong in ur tax process , pls check the blw
If its Taxinn procedure,
1- check in FTXP the tax code is created towards ur tax procedure and country
2- check in FV12 for the condition types say JMOP,JEC1 and others, whthere tax rate and validity are defined properly.
3- for JMX1 cond type , keep its 100%
4- check in obbg , the tax proce is assinged to ur country or not??
let me knw, if u r not able to solve???
Maybe you are looking for
-
Ipod classic 80gb will not connect after update to itunes 7.5
I just updated to itunes 7.5 and i cannot get the device to sych anymore. it connects and then automatically ejects after I plug it in. I still have another computer with itunes 7.4 and i will use that until i get it fixed. I tried uninstalling and r
-
Oracle 10g Express Edition doesn't works on Win SBS 2011
Deutsch Hallo zusammen! Ich ein kleines Problem mit der Installation von Oracle 10g Express Edition Release 10.2.0.1.0. Zuerst, ich muss die ältere Version nehmen, weil das Programm welches dann auf Oracle zugreift sehr „sensibel" ist und wohlmöglich
-
Export problems in Lightroom 4.4
I just updated to Lightroom 4.4 (mac) and now I have problems to export my photos. I was trying to export them and it appeared the following msg: "An internal error has occurred. ?:0: attempt to call field 'getCameraRawMaxPixelCount'(a nil value). Wh
-
Hi all, One of our process chain failed at data loading step. In monitor screen the status tab ismessage as :: Error message from the source system Diagnosis An error occurred in the source system. System Response Caller 09 contains an error message.
-
2012 Retina Mac Book Pro (Mountain Lion) crashes while using Finder
I used the Migration Assistant to move over my settings and file from a 2009 Mac Book Pro to a brand new Retina version. Everything was working well until, on the first day, I needed to use the finder to search for photo files on the hard drive. I am