Sp_Transaction Notification For Purchase Order Item Checking
Hello All,
I need to create a sp_Transaction notification for Purchase Order where system will check that the document to be added
with Vendor 'A' and ItemCode 'ERT' should not be be previously added for the same vendor 'A.
Example:-
Doc No. Vendor Item Code
1 A ERT
Is added
Next if the Purchase Order is added with same vendor and same Item then system should block the entry and throw a message
'Purchase Order Already Entered for Vendor 'A' with Item Code 'ERT'"
This checking will be done for each line item of currently entered Purchase Order Document.
Thanks ,
Amit
Hi Amit,
i found this on forum. Try this,
if @object_type = N'22' and @transaction_type in (N'A', N'U')
begin
declare @line1 int
declare @lin1 int
declare @out1 int
Set @out1 = 0
SET @lin1 = 0
Declare @Vend as varchar(200)
Declare @ItemCode as varchar(200)
Select @Vend = CardCode From OPOR Where DocEntry = @list_of_cols_val_tab_del
Select @line1 = Max (LineNum)FROM POR1 WHERE POR1.DocEntry = @list_of_cols_val_tab_del
While @lin1 < @line1
Begin
Select @ItemCode=ItemCode From POR1 Where DocEntry=@list_of_cols_val_tab_del and LineNum = @lin1
if (SELECT COUNT(T0.DocEntry) FROM POR1 T0 inner join OPOR T1 on T0.DocEntry = T1.DocEntry
WHERE T0.ItemCode = @ItemCode and T1.CardCode = @Vend)> 1
Begin
Set @Out1 = 1
Break;
END
Else
Begin
Set @lin1 = @lin1+1
Continue
END
END
Set @lin1 = @lin1 + 1
if @out1 = 1
begin
Set @error = 1
Set @error_message = 'Item Code in line ' + CONVERT(nvarchar(4), @lin1) + N'already Exists For This Vendor!'
End
END
Check this too Stored procedure in purchase order for duplicate item for a vendor
Thanks,
Joseph
Edited by: Joseph Antony on Jan 11, 2011 1:37 PM
Similar Messages
-
Sp Transaction Procedure For Purchase Order Item Checking
Hello All,
I need to create a sp_Transaction notification for Purchase Order where system will check that the document to be added
with Vendor 'A' and ItemCode 'ERT' should not be be previously added for the same vendor 'A.
Example:-
Doc No. Vendor Item Code
1 A ERT
Is added
Next if the Purchase Order is added with same vendor and same Item then system should block the entry and throw a message
'Purchase Order Already Entered for Vendor 'A' with Item Code 'ERT'"
This checking will be done for each line item of currently entered Purchase Order Document.
Thanks ,
AmitHello Amit,
You don't need post identical thread twice. This SP related discussion is usually posted on main forum.
Please close this one.
Thanks,
Gordon -
Class for Purchase order item components and Production order components
I'm looking for a some classes. I'm very new to objects, so I could be searching for them incorrectly.
The first class I'm looking for is a purchase order class that contains the item components. I've looked at CL_PO_ITEM_HANDLE_MM and CL_PO_HEADER_HANDLE_MM. I couldn't find components as a part of either of the classes.
The second one I'm looking for is not as critical. It is for the components for a production order. I have a function module: BAPI_PRODORD_GET_DETAIL that gets the components for the order. However, to take advantage of objects - I read somewhere - that if possible I should avoid calling a function module.
Any help that you could give would be greatly appreciated.
Thank you!
MichelleHello Michelle
I do not think there are already classes available on ERP 6.0 for reading production order (yet I might be wrong...). However, regarding purchase order you are already on the right track.
*& Report ZUS_SDN_OO_READ_PO
*& Thread: Class for Purchase order item components and Production order components
*& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1206523"></a>
"& NOTE: Coding adapted from BAPI_PO_GETDETAIL1
REPORT zus_sdn_oo_read_po.
TYPE-POOLS: abap, mmpur.
PARAMETER:
p_ebeln TYPE ebeln DEFAULT '3000000045'.
DATA: gs_document TYPE mepo_document,
go_po TYPE REF TO cl_po_header_handle_mm,
gs_header TYPE mepoheader,
gd_tcode TYPE sy-tcode,
gd_result TYPE mmpur_bool.
data: gt_items type PURCHASE_ORDER_ITEMS,
gs_itm type PURCHASE_ORDER_ITEM,
gs_item type mepoitem.
START-OF-SELECTION.
* prepare creation of PO instance
gs_document-doc_type = 'F'.
gs_document-process = mmpur_po_process.
gs_document-trtyp = 'A'. " anz. => display
gs_document-doc_key(10) = p_ebeln.
* object creation and initialization
** l_ebeln = purchaseorder.
CREATE OBJECT go_po.
CALL METHOD go_po->po_initialize( im_document = gs_document ).
CALL METHOD go_po->set_po_number( im_po_number = p_ebeln ).
CALL METHOD go_po->set_state( cl_po_header_handle_mm=>c_available ).
* read purchase order from database
gd_tcode = 'ME23N'.
CALL METHOD go_po->po_read
EXPORTING
im_tcode = gd_tcode
im_trtyp = gs_document-trtyp
im_aktyp = gs_document-trtyp
im_po_number = p_ebeln
im_document = gs_document
IMPORTING
ex_result = gd_result.
* there was a problem in reading the PO
IF ( gd_result EQ mmpur_no ).
** l_messages = l_handler->get_list_for_bapi( ).
** PERFORM return TABLES l_messages return
** poitem poschedule poaccount.
** CALL METHOD l_po->po_close( ).
ELSE.
gs_header = go_po->if_purchase_order_mm~get_data( ).
WRITE: / gs_header-ebeln,
gs_header-bukrs,
gs_header-bsart,
gs_header-lifnr.
ENDIF.
gt_items = go_po->if_purchase_order_mm~get_items( ).
LOOP AT gt_items INTO gs_itm.
gs_item = gs_itm-item->get_data( ).
write: / gs_item-ebelp,
gs_item-matnr,
gs_item-menge.
ENDLOOP.
END-OF-SELECTION.
Regards
Uwe -
Expand Table Control with Fields for Purchase Order Item Overview
Hi Gurus.
Hereu2019s something easy for you, I hope/ think. We just want to additionally show the field u201CMFRPNu201D in the purchase order item overview. See structure MEPO1211 for the table control.
How can we do this? Is it possible without a modification? Is there anything to pay attention to?
Lot's of questions, because we donu2019t find any complete solutions yet. It seems there are no official SAP suggestions for this issue.
Thanks in advance!
Regards
PatricIs there no one out there who can answer my question?
-
Quantity field to be shown on 1ST line only for purchase order items in ALV
Dear All,
I am fetching data from purchase order history table (EKBE) where PO line items contains multiple times. User does not want to view fields that are repeating multiple times in all lines, but in the top line. By sorting the same in ALV , I can do the same with character type fields, but how to do the same with quantity fields. One way out is converting the same into character fields. Is there any other way. Please give me some solution. Also while sorting , the number which gets repeated (i.e Items in PO for different PO's ) does not gets displayed. I want my program to display them.
Thanks,
Debopriyo MallickTry this
loop at ist_mseg into wa_mseg.
ON CHANGE OF wa_mseg-con.
move '111' to wa_mseg-con1.
modify ist_mseg from wa_mseg.
ENDON.
endloop.
loop at ist_mseg into wa_mseg.
if wa_mseg-con1 ne '111'.
move 0 to wa_mseg-menge.
move 0 to wa_mseg-netpr.
endif.
modify ist_mseg from wa_mseg.
endloop.
mseg-con is the concatenation of ebeln and ebelp values.
pk -
BADI for purchase order item confirmation?
Hi all,
In Purchase Order change mode (ME22N), we want to calculate the delivery date based on the confirmation date that was entered in the PO item detail, confirmation tab (instead of based on the PO creation date).
Please help by specifing Which BADI should we use for that purpose? And which method will be helpful?
Thanks,
Vamshi.Hi
You can use BADI ME_PROCESS_PO_CUST
Ranga -
Business Object For Purchasing Order Item
Hi All
I want to create event for every change in Purchase Order in the field Delivery Date
For that I am looking for business object in SWO1
Thanks in AdvanseHi,
Check the Business Object BUS2012.
Regards,
Vara -
Issue in finding GR posting date and quanity for Purchase order item
Hi All,
I have a requirement to list all PO items with Goods receipt posting date and quantity.
So for each po item I have fetched Goods receipt posting date and quantity from table EKBE for movement type 101.
But in transaction ME23n in PO history tab it is displaying 3 records.
2 are movement type 101 and 1 is movement type 102 GR quantity with minus sign.
How to find out Goods receipt posting date and quantity.
what are the movement types we have to consider.
Thanks,
Jwalamovement type 102 is for GR for PO reversal that is why the quantity is negative.
-
Issue in EXIT_SAPMM06E_016 for Purchase Order Items
Hi,
We have customer fields in PO header as well as in Items. If i update the value in PO header, the vlaues should pass to items based up on the quantity and order unit.
We have implemented this logic in EXIT_SAPMM06E_016, this is working fine when PO have only one item. If PO has more than one items, t we have to go every PO item manaully in screen o update the values, then only value is updating in screens.
When i read about this exit EXIT_SAPMM06E_016, it says this is PBO module, so it will update only if we go manually on screens. Is there any other way to update with out going on screens?
BADI ME_PROCESS_PO_CUST will work?Hi
Try to use if_ex_me_process_po_cust~process_item which will work .
surya -
Userexit to defualt values for Purchase Order
Hi,
My requirement is to defualt Latest GR Date for Purchase Order Items. Can someone tell me which user exit I can use to defualt the value.
Thanks,
ViswasTransaction Code - VA01 Create Sales Order
Exit Name Description
SDTRM001 Reschedule schedule lines without a new ATP check
V45A0001 Determine alternative materials for product selection
V45A0002 Predefine sold-to party in sales document
V45A0003 Collector for customer function modulpool MV45A
V45A0004 Copy packing proposal
V45E0001 Update the purchase order from the sales order
V45E0002 Data transfer in procurement elements (PRreq., assembly)
V45L0001 SD component supplier processing (customer enhancements)
V45P0001 SD customer function for cross-company code sales
V45S0001 Update sales document from configuration
V45S0003 MRP-relevance for incomplete configuration
V45S0004 Effectivity type in sales order
V45W0001 SD Service Management: Forward Contract Data to Item
V46H0001 SD Customer functions for resource-related billing
V60F0001 SD Billing plan (customer enhancement) diff. to billing plan
No of Exits: 15
Rewards if useful.................
Minal -
Non-valuated Goods Receipt for Purch.Order Item with multiple acct assgnt
Dears,
i used multiple account assignment functionality based on percentage for purchase order item and the system forced the goods receipt as "Non-valuated Goods receipt".
In this way i don't have FI-CO documents at Goods receipt; i got them only at Invoice verification. So i totally lose analysis on account "Invoice to Receive".
Please, give me some suggestion if you know something in matter.
Thanks in advance,
Regards
EnricoIt means that i didn't set non-valuated goods receipt.
The system automatically set the flag if more than one account assignment are used for one purchase order item.
If happens that just one account asignment is used for one purchase order item then the goods receipt is still valuated.
i didn't try so far with quantity instead of percentage but, anyway, i need to use percentage. -
Purchase Order item value breakup condition type wise
Dear Sir,
We are developing a custom report and in this report we need to reflect for Purchase Order item wise the break-up of values at the condition type level .
In Me23n , at at Item Level , when we click on tab <Condition> then all values break-up at condition type level gets displayed .
But to use in custom program , we need to know the table where this information is available .
Kindly guide us pl .
Regards
B MittalHi,
This suggestion is based on my understanding of your issue. May not be straight forward SAP solution.
I would suggest you to make following assessment for your custom program: (going through the condition tab will lead you to structures)
1. Try to figure out how the pricing condition are maintained. Normally you have your Base price PBXX or gross price per EA defined that can be found in the PIR of the material + Vendor combination or in the pricing condition you would have defined.
2. In same way figure out all the other absolute condition types. I mean any thing that is not % percentage based on PBXX value. (assess ;your pricing Schema to understand this.
3. Once you know how is your pricing schema breakup then try to pick the net price of PO and then do a backward calcuation based on PIR condition value. .
Hope this helps.
thx
MJ -
Use SP_Transaction notification for Production Oder
Hi all!
Can i use SP_Transaction notification for Production Order.
We have two user A and B is manager of A.
When A create a production order but A can not use Release function in order to chage status from Planed to Relase.
Only B can Release.
How can use SP_Transaction notification .
Thanks!Import this code into sp_transaction notifocation:
If @object_type =N'202'
begin
If (@transaction_type = N'A')
begin
declare @userBO nvarchar(2)
set @userBO = (select T0.usersign from OWOR T0 where T0.docentry=@list_of_cols_val_tab_del)
if @userBO = '1' --code user 'A'
begin
update OWOR
set status = 'R'
where docentry=@list_of_cols_val_tab_del
end
end
end
Then user A try to add document, click on add button, sp_transaction notification procedure will be executed, and status document will change to 'Released' -
No (suitable) item found for purchase order
Dear All,
The order is stock transfer order (STO) item category U. i saw GR is already create. GI and also DCGR. i want to do DCIR which is invoice receipt in tcode mr01, the error "No (suitable) item found for purchase order" is coming out. What would be the cause of this situation? i check with old last PO it is same set with the one that having in problem. i also double click the item to see the detail and what i can see tick option for del completed and no tick on final del.
no GR-based-4 or invoice receipt option to tick. means no tick option for this. but when i see previous po also same. but there is history on DCIR.
Really need to know what should i do? is bug?
Regards
AishahIn case of out company it was SA(schudule agrement) PO we try on the Credit memo by MIRO t-code through IV
but we met the same error message
The problem cause of not exist delivery schedule quantiry we have put in the qty to there by manually after than this issue cleared.
Hoil. -
No goods receipt possible for purchase order Number and Item number.
Hello experts,
When I create a Goods Reciept with reference to Purchase Order using BAPI_GOODSMVT_CREATE, the following error message appears.
No goods receipt possible for purchase order <PO number> <line item number>.
But the GR is getting created manually using Transaction MIGO for the same PO number.
I found some blogs to check for deletion indicator and Movement type and quantity, when I searched SDN for the same Issue.
In my case
1.deletion indicator is not set for the Purchase order line items
2.And Movement type is 101
3.And gm_code is 01.
Could anyone please suggest me, what else could be the reason for this error?Here is the code what i have written.
f_gmvt_header-pstng_date = sy-datum.
f_gmvt_header-doc_date = sy-datum.
f_gmvt_header-pr_uname = sy-uname.
f_gmvt_header-ref_doc_no = p_ebeln.
f_goodsmvt_code_tmp = '01'.
* Looping the PO details.
CLEAR: gf_item,f_gmvt_item.
LOOP AT gt_item INTO gf_item.
* fill the bapi item structure details
f_gmvt_item-material = gf_item-material.
f_gmvt_item-plant = gf_sbms-werks.
f_gmvt_item-stge_loc = '0001'.
f_gmvt_item-move_type = '101'.
f_gmvt_item-po_number = p_ebeln.
f_gmvt_item-po_item = gf_item-po_item.
f_gmvt_item-entry_qnt = gf_item-quantity.
f_gmvt_item-entry_uom = 'PC'.
f_gmvt_item-entry_uom_iso = 'PCE'.
f_gmvt_item-po_pr_qnt = gf_item-quantity.
f_gmvt_item-orderpr_un = 'PC'.
f_gmvt_item-orderpr_un_iso = 'PCE'.
f_gmvt_item-no_more_gr = 'X'.
f_gmvt_item-ref_doc = p_ebeln.
f_gmvt_item-prod_date = sy-datum.
f_gmvt_item-mvt_ind = 'B'.
f_gmvt_item-move_reas = '101'.
f_gmvt_item-vendor = gf_lfm1-lifnr.
APPEND f_gmvt_item TO t_gmvt_item.
CLEAR f_gmvt_item.
ENDLOOP.
* cALL THE bapi fm FOR gr POSTING
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = f_gmvt_header
goodsmvt_code = f_goodsmvt_code_tmp
* TESTRUN = ' '
* GOODSMVT_REF_EWM =
IMPORTING
goodsmvt_headret = f_gmvt_headret
* MATERIALDOCUMENT =
* MATDOCUMENTYEAR =
TABLES
goodsmvt_item = t_gmvt_item
* GOODSMVT_SERIALNUMBER =
return = t_return
* GOODSMVT_SERV_PART_DATA =
* EXTENSIONIN =
IF sy-subrc = 0.
* For commit the changes use BAPI_TRANSACTION_COMMIT FM.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
* MOVE: f_GMVT_HEADRET-MAT_DOC TO WA_DET-MBLNR,
* f_GMVT_HEADRET-DOC_YEAR TO WA_DET-MJAHR,
* f_GMVT_HEADER-REF_DOC_NO TO WA_DET-EBELN.
* APPEND WA_DET TO IT_DET.
* CLEAR WA_DET.
ENDIF.
Maybe you are looking for
-
Where did my script go? I still have it in CELTX TG.
I hadn't logged in for a month or two, but I had imported a script from CELTX (another free scrip writing software) and had added a little to it. I got an e-mail about a new release or something and I thought I'd check out adobe story again to see i
-
TIFF images are shown as blank when embedded in some web pages
After I upgraded to Snow Leopard, I see blank the TIFF images displayed in some web sites, like for example any patent image in the www.uspto.gov web site. This happens on both Safari and Firefox. They both use the QuickTime plugin (I have version 7.
-
End tag for "img" omitted, but OMITTAG NO was specified.
i am just wondering why it is that dw created <img> tags are all missing closing tags, therefore closing validation, or am i missing something here, maybe a doctype issue? link link
-
Webi Report - Error when doing drilldown
Hi Experts I'm facing a problem now that I hope to get some guidance from you all. I've created a Universe based on a MSAS Cube, It's working fine so far, but we realized during the tests that when we drill down or just include the fields (related t
-
2 different countries in same grping 99
HI Frnds, Im now Working on implemention Project For Ghana. in SAP this comes under other Countries. Our existing implementation has already considered other countries (99) group. so now can be possible to have both the abv into 99 or else how to ma