SP Transaction Notification For Service Type Documens Only

Hi All,
Just a little help here please.
I have a query in my Transaction Notification that I only want to run for service type documents however when I put the code in I am getting an error.
Below you will see my query and the part I put in for service type documents is the first part of the WHERE clause.
Please explain to me how to do this correctly.
/*Check for Cost Center On Marketing Documents*/
IF ((@transaction_type = 'A'
       OR @transaction_type = 'U')
     AND (@object_type = '13'
            OR @object_type = '14'
            OR @object_type = '18'
            OR @object_type = '19'
            OR @object_type = '20'
            OR @object_type = '22'))
    BEGIN
          SELECT @table = CASE @object_type
                                WHEN '13' THEN 'INV'
                                WHEN '14' THEN 'RIN'
                                WHEN '18' THEN 'PCH'
                                WHEN '19' THEN 'RPC'
                                WHEN '20' THEN 'PDN'
                                WHEN '22' THEN 'POR'
                              END
          SELECT 1 cnt
          INTO   #temptable15
          WHERE  1 = 0
          SET @sqlstr = ' insert into #temptable15
                              SELECT     1 AS cnt
                              FROM         [' + @table + '1] INNER JOIN
                                          [O' + @table + '] ON [' + @table + '1].DocEntry = [O' + @table + '].DocEntry
                              WHERE     ([O' + @table + '].DocType = S) AND ([' + @table + '1].OcrCode IS NULL) AND ([' + @table + '1].DocEntry =  ' + @list_of_cols_val_tab_del + ')'
          EXECUTE( @sqlstr)
          SET @CostCenter = (SELECT TOP 1 cnt
                               FROM   #temptable15)
DROP TABLE #temptable15
          IF (@CostCenter = 1)
               BEGIN
                    SELECT @error = 1
                    SELECT @error_message = 'Please fill in Cost Center!!!'
               END
     END
Any help will be greatly appreciated.
Regards,
Quinn

Hi Quinn Verburgt ,
Check This...
This SP make Cost Center field mandetory for Service Type Document.
If @object_type in ('17','22','14','18','19','20') and @transaction_type='A'
BEGIN
If Exists (Select T0.DocEntry from ORDR T0 Inner Join RDR1 T1
On T0.DocEntry=T1.DocEntry
Where T1.OcrCode Is Null and T0.DocType ='S'
And T0.DocEntry = @list_of_cols_val_tab_del)
(Select T0.DocEntry from OPOR T0 Inner Join POR1 T1
On T0.DocEntry=T1.DocEntry
Where T1.OcrCode Is Null and T0.DocType ='S'
And T0.DocEntry = @list_of_cols_val_tab_del)
(Select T0.DocEntry from ORIN T0 Inner Join RIN1 T1
On T0.DocEntry=T1.DocEntry
Where T1.OcrCode Is Null and T0.DocType ='S'
And T0.DocEntry = @list_of_cols_val_tab_del)
(Select T0.DocEntry from OPCH T0 Inner Join PCH1 T1
On T0.DocEntry=T1.DocEntry
Where T1.OcrCode Is Null and T0.DocType ='S'
And T0.DocEntry = @list_of_cols_val_tab_del)
(Select T0.DocEntry from ORPC T0 Inner Join RPC1 T1
On T0.DocEntry=T1.DocEntry
Where T1.OcrCode Is Null and T0.DocType ='S'
And T0.DocEntry = @list_of_cols_val_tab_del)
(Select T0.DocEntry from OPDN T0 Inner Join PDN1 T1
On T0.DocEntry=T1.DocEntry
Where T1.OcrCode Is Null and T0.DocType ='S'
And T0.DocEntry = @list_of_cols_val_tab_del)
BEGIN
Select @error = -1,
@error_message = 'Please fill in Cost Center!!!'
End
End
Thanks,
Srujal Patel

Similar Messages

  • SRM 4.0- How to set the default values for product type (01) only for SC

    The radio button “Service” should not be visible.
    Also for search help (e.g. search for internal products) where a search should only be possible for product type 01 (goods). The system should not display the product type and internally always search for goods only.
    How to set the default values for product type (01) only for SC
    We needs to use Search help BBPH_PRODUCT which having parameter PRODUCT_TYPE
    Here we can set defalut value 01 but it is not correct one since same search help is using several places.
    We need to limit the search help results only for SC.
    Kindly help out me ASAP.

    The easiest way to set defautl values is to edit the batch class.
    Goto the characteiristic and go to update values.
    In here you probably have something like 0 - 100 as a spec range.
    On the next line enter the default value within this range.  At the end of the line, click in the box in the column labelled "D".  This indicates the defautl value for the characteristic.
    If you need to you can do this in the material classification view as well.
    Just to be clear, these values will only show up in the batch record.  You can not have defautl values in resutls recording screens.
    FF

  • Transaction Notification For User Defined Object

    Dear Expert,
    I want to create a transaction notification for my user defined form. I have a matrix on my form which has a field as 'Code'. I want that this field (On Row Level) should have unique values all the time while adding or updating the form.
    Object Type: MaterialMaster
    Table Name: MaterialDetails
    FieldName: U_Code
    Plz help me to get this notification.
    Regards

    Hi Amit,
    Please check below query.
    IF @object_type = 'MaterialMaster' AND @transaction_type IN('A','U') and @error = 0
    BEGIN
    IF ( SELECT COUNT(*)
    FROM MaterialDetails A
    WHERE A.U_Code IN (SELECT U_Code FROM MaterialDetails WHERE  U_Code = @list_of_cols_val_tab_del)
    GROUP BY A.U_Code
    HAVING COUNT(*) > 1
    ) >1
    BEGIN
      set @error = -10
      set @error_message = 'You can not Add Dublicate Code'
    END
    End
    Hope this help
    Regards::::
    Atul Chakraborty

  • Creating a transaction code for variant type in se93

    hai all,
    i created transaction's for dialogue type and report type,now i am trying to create transaction for variant type. in that what we have to provide in transaction text box where the f4 functionality is provided for that text box.
    could any one plz help me out.
    Thanks in Advance.

    Hi,
    U need to create transaction variant in SHD0 transaction before creation transaction by variant.
    Go thru the following link carefully.
    Certainly it will be helpful to you.
    http://www.mortenhjorthnielsen.dk/Security/transactionvariants.htm
    Regards
    Vadi

  • Info./links for service type PO process

    Could anyone who has a links or useful references (other than the help.sap stuff) on the process and config. steps for service type POs please provide them.
    Thanks,
    Nick

    Hi,
    The below link may explain the process.
    http://sapmm.wordpress.com/category/service-master/
    Regards,

  • SP Transaction Notification - what object type number to use for BP Activity

    Have to re-post it, the previous one has been accidently marked as answered.
    I'm trying to add some script into SP Transaction Notification and want to make it
    run when user add a new "BP Activity" into B1.
    What object type number should I use in SP Transaction Notification stored
    procedure?
    BTW, following this article:
    SAP Business One Form Types and Object Types
    http://scn.sap.com/community/business-one/blog/2013/07/09/sap-business-one-form-types-and-object-types
    I tried 103, but it seems like doesn't work.
    103 ActivityTypes object
    Thanks.

    Found my answer here, object type should be 33. Strange, this is inconsistent with article in my original post
    Object code for Activity (OCLG)

  • Purchasing - A/P Transaction Processing for Services and Non Inventory Item

    On of the main areas of concern that businesses have is in the area of Purchasing, Goods Receipts and AP Invoices Processing - There is a requirement that businesses have widely referred to as 3-way matching.
    While SAP Business One has this functionality covered quiet well via the following, there is still some need for enhancements so that the application can correctly reflect the AP Accruals:
    - Purchase Order processing with Approval Process (if configured)
    - Ability to perform Goods Receipts for Services.
    - Matching of AP Invoices to Goods Receipts with AP Invoice Approval Process (if configured)
    The above transactions serve the 3-way matching quiet well for all purchases however when it comes to accuring for Services that have been provided, the application does not do this. The Goods Receipt transaction processing to acknowledge the service delivery is allowed however the related posting to the allocation account is missing.
    The process that is followed by the application is same for Items that have not Inventory Items in Item Master.
    As a result of the above, the business have to manually work out what the Accurals for services provided but not invoiced should be.
    With little enhancement to the product this shortfall could very easily be overcome.

    Hi,
    Once there are transactions, we cannot make existing Inventory type item to Non Inventory type item.
    Check SAP note:937297 which states as follows :
    Symptom
    Changing the status of the Inventory Item checkbox (in Item Master Data) for items with inventory transactions and documents, might lead to inaccuracies in the calculations of inventory value.
    Other terms
    Inventory Item, Non-inventory Item, Item Master Data, Continuous Stock, Perpetual Inventory, Inventory Valuation, 2004, 2005, 2005 A SP01
    Reason and Prerequisites
    Consulting Note
    Solution
    The status of an item (Inventory Item/Non-Inventory item as selected in the Inventory Item checkbox in the Item Master Data window), cannot be changed once an A/P, A/R, or Inventory document is posted for the item.
    Regards,
    Jitin Chawla

  • Idoc segment for shpmnt notification for idoc type shpmnt02

    Hi gurus,
               I have to find the idoc segment for shipment notification,idoc  type which we are going to use is shpmnt02 or shpmnt01,Can any one of you please tell me the idoc segments for this idoc type with fields and table name?.Thanks in  advance.

    Hi Nagarathinam
    You can use transaction WE60 for documentation on IDOCs
    Best regards,
    Chris

  • Account / Transaction key for Services

    Dear Sappers,
    I am maintaining a condition for services. IMG MM - External Services Management -> Maintain Condition for services . Here i have created condition type and maintained in conditions: Schemas for services. But i cannot create Account key / Transaction key here. Can anyone guide me where i can create account / transaction key for external service management.
    Account / Transaction key can be maintained for normal PO conditions in IMG MM -> Purchasing -> Conditions -> Price Determination but those account keys are not appearing in External Service Management calculation schema for services.
    Thanks.
    Shahzad Shakoor

    Using OMGH the transaction key can be maintained but it doesnt appears in Service Management calculation schema.
    Using SM30 V_T687 transaction key is maintained and it is accepted in Service Management  caculation schem but now i have to assign GL accoutn to it.
    Kindly guide me where i can assign GL account for this newly created transaction key as this one is not appearing in OBYC.
    Thanks a lot.

  • Transaction Notification for Blocking Batch

    Dear Experts,
    I am facing a critical situation. My Client wants to Block the material movement  if it is not inspected through Quality Personal. I have already Locked batches through General Settings > Inventory > Batch Status . But it only blocks the batches for Goods Issue and Receipts Transactions. It is not working in case of Inventory transfers.
    I have created UDF on GRPO called U_InspStatus where by default value is Pending once the Quality personal changes the UDF value to Completed then only the batch should be able to move through Inventory Transfer.
    Can anyone help me in creating Transaction Notification on Inventory Transfer Document  which can block batches if there status is pending ?
    Waiting for your replies.
    Regards,
    RK

    Hi Naga,
    Please find below mentioned answer to your queries -
    1. Inventory transfer done by means of posting inventory transfer document? - Yes
    2. Inventory transfer as applicable to customer not vendor. How do you select vendor in inventory transfer document? - Not selecting the customer in Inventory Transfer document not required I am moving material from one warehouse to another.
    3. How did you update inspection status in inventory transfer document - Inspection status is updated in Quality Add on and not in Inventory Transfer. But if I am transferring material from one warehouse to another without Inspection then it should block the batch whose Inspection status is pending.

  • Use SP Transaction Notification for trigger on user defined table

    Hi i need some help. I have a user defined table in sap (@LAU_ACCT) .
    I need way to catch the event on the table (update , delete , add).
    I heard about SP Transaction Notification , but how use it with udt ?
    Thanks!

    Hi Pavel,
    it is only possible if the UDT is registered as part of an object ( UDO ) - further info http://scn.sap.com/thread/3277846 . So for pure UDT actions you have to find another way ( SQL trigger, UI API, periodic query ).
    regards,
    Maik

  • Transaction Key for Movement Type 561

    Hello,
    For movement type 561, I know one of the Transaction Key is BSX.  I would like to ask what is the other Transaction Key as I would like to set the GL Account Determination.  Thanks.
    Thanks.

    Hi
    Transaction keys required for 561 movemnt type are
    BSX - For the inventory posting
    GBB - BSA - For initial entry of stock balances
    For performing the 561 movment G/L account needs to be assigned to both these transaction keys.
    Thanks & Regards
    Kishore

  • How to know debit and credit transaction key for movement type

    Hi,
    With T. code OMWB  account assignment simulation we can see all the accounts which are involve for debit and credit enties   but I want to know is there any T. code or method  with which we can know  which transaction key will be debit and which will be credited  like  for movement type  101 the transaction keys are GBB, BSX  WRX  etc.  i want o know whethere GBB a

    Hi,
      Thanks for your reply,  but with this we can see the for GBB which is the credit account and which account is use for debit entry,  like this for all transaction event key like WRX, BSX etc. we can see the G/L account use for Debit and credit,  but i want to know for particular selction of Plant, material , movement type,  my GBB account will have entry in debit account or credit account  How we can know this.
    regards,
    zafar

  • Quantity for service type invoice

    hello
    i am trying to create a service type purchase order. i have created row level udfs for unit price and quantity. price should be multiplied by unit price and the total should be displayed as the total for the invoice. how can i do this?
    secondly, when i create an invoice based on this purchase order, if i get a short delivery, the customer wants the system to automatically be able to compute the total amount when we enter the quantity. is this possible?
    any help will be greatly appreciated. thanks!

    Have you tried formatted searches. I am sure it will do the trick. 
    For the first one: Use a formatted search in the Row Total field that selects your UDF's qty*price.
    second one: I am not too sure about all the requirements, but I think something similar will work.
    Hope it helps!
    Regards

  • Transaction Notification for Restrict user to delere row but new item addition will allowed in Production Order

    Dear All Experts,
    My client having some custom requirement in Production Order.
    1) When Production Order will created and its status will released then it will allowed user to update any quantity of any items or add any new items but it will not allowed to delete any items from row level.
    2) When any item will be deleted then our transaction notification will be raised.
    I created one Transaction Notification Code but it will restricted to update anything or delete.
    IF (@transaction_type = 'A' or @transaction_type = 'U') AND @object_type = '202'
    BEGIN
    Declare @VisOrder1 nvarchar(255)
    Set @VisOrder1=(SELECT Top 1 T1.VisOrder+1 FROM OWOR T0 INNER JOIN WOR1 T1 ON T0.DocEntry = T1.DocEntry 
    WHERE (T0.Status = 'R' and T1.VisOrder=(select TOP 1 VisOrder from wor1 where DocEntry=@list_of_cols_val_tab_del order by VisOrder Desc)))
      If @VisOrder1 >0
      begin
      SET @error = 231
      SET @error_message =  'You have not rights to delete any Item - Please Contact System Administrator ' + @VisOrder1
      end
    END
    Please help me for solve this problem.
    I wait for your warm replay.
    Thanks & Regards,
    Nishit Makadia

    Hi,
    Please check these threads. Let me know your feedback.
    http://scn.sap.com/thread/3518208
    http://scn.sap.com/thread/3545101
    Thanks & Regards,
    Nagarajan

Maybe you are looking for