Validation according to Document type

Hi all,
i have defind validation in sales order using transaction notification stored procedure. ex:- sales order should be based on sales quotation etc. and code is as follows
--- Sales Order Not Based On Sales Quotaion
IF @transaction_type = 'A' AND @object_type = '17'
BEGIN
IF EXISTS (SELECT T0.ItemCode FROM [dbo].[RDR1] T0 inner join [dbo].[ORDR] T1 on T0.DocEntry = T1.DocEntry
WHERE T0.BaseType = -1 AND T0.DocEntry = @list_of_cols_val_tab_del and T1.DocType= 'I')
BEGIN
SELECT @Error = 1, @error_message = 'Sales Order not based on Sales Quotation '
END
END
now i want to apply this validation to only 'ITEM' type document instead of 'SERVICE' type document.
how to do it?

hi,
Execute stored procedure in MS SQL Studio management on demo database first
and then incorporate it in live db.
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER proc [dbo].[SBO_SP_TransactionNotification]
@object_type nvarchar(25),
@transaction_type nchar(1),
@num_of_cols_in_key int,
@list_of_key_cols_tab_del nvarchar(255),
@list_of_cols_val_tab_del nvarchar(255)
AS
begin
declare @error  int                    
declare @error_message nvarchar (200)           
select @error = 0
select @error_message = N'Ok'
IF @transaction_type = 'A' AND @object_type = '17'
BEGIN
IF EXISTS (SELECT T0.ItemCode FROM dbo.RDR1 T0 inner join dbo.ORDR T1 on T0.DocEntry = T1.DocEntry
WHERE T0.BaseType = -1 AND T0.DocEntry = @list_of_cols_val_tab_del and T1.DocType= 'I')
BEGIN
SELECT @Error = 1, @error_message = 'Sales Order not based on Sales Quotation '
END
END
select @error, @error_message
end
Jeyakanthan

Similar Messages

  • Sales order list according to docu. type

    HI,
    How I can get list of sales order according to document type?
    Regards,
    Chetan.

    Dear Muthupandiyan
    Just for information, In VA05, we can generate the report without giving either customer code or material code.  Only in VF05, both these are mandatory and only if you give either of these, reports will be generated.
    thanks
    G. Lakshmipathi

  • Validation foe blocking document types in FY 2009

    Hi All,
    Please help me to set the validation for the document types used in FY 2009.
    We want to block document type DG, KZ , Z3 & ZK for posting in FY 2009 for all the users. But the same document types would be continued to use for posting the entries related to FY 2008 We have already created one validation as follows -
    Application Area - FI
    Call up point - 1
    Perquisite-
    User Name = '1010FIN' OR User Name = 'CONSULTANTS' OR User Name = 'BASIS'
    Check -
    Document Type <> 'DG' AND Document Type <> 'KZ' AND Document Type <> 'Z3' AND
    Document Type <> 'ZK' AND ( Fiscal Year <> '2009' )
    Message - Document type blocked for posting.
    But with the above validation it is giving me the same error message whenever i m trying to post the documents in FY 2008 with the above document types.
    Please guide me in setting the logic so that system will allow me to use same document types in FY 2008 & not in FY 2009
    Thanks
    Sonal

    Hi Sonal,
    The other approach will be to not authorize the users to the document type (which u require)
    The following is the object for document type:
    F_BKPF_BLA -
    Accounting Document: Authorization for Document Types
    Instead of *, include all the docs which u require the authorization for.
    And for year...
    Only open the year for the users u desire
    Regards,
    Kiran

  • Vendor selection according to Document Type

    Hi Expert,
    My Client wants that if he punches the service order then the vendor code selected should be SV001 and if he/she selected the item level vendor i.e. V0001 in the service PO then document should not be added.
    I created the seperate vendor code for both type of vendors
    for service type vendor i ceated SV001 and for item level vendor i created V0001 code respectively.
    Thanks & Regards,
    Pankaj Sharma

    Hi Pankaj,
    Use this SP.
    IF @transaction_type IN ('A', 'U') AND @object_type = '22'
    BEGIN
    If exists
    (Select docnum from OPOR
    Where doctype = 'S' and cardcode not like 'SV%'
       and DocEntry=@list_of_cols_val_tab_del)
    Select @error = 1, @error_message = 'Invalid Vedor '
    END
    Similarly write one for item type invoice and vendor
    Regards,
    Jimit Chhapia
    Edited by: Jimit Chhapia on Jan 4, 2011 7:22 AM

  • Validation for Document Type

    Hi,
    I want make a validation for document type wise posting for particular users like user ABC only post JV doc.type document. Please suggest me how I will make it.
    Thanks & Regards,
    Hemant Kumar Maurya

    Hello Hemant,
    You can manage this with authorization or validation (T Code OB28 or GGB0), for validation:
    1 - Create a validation at document header level.
    2 - You can create a set (table BKPF and filed - user name) with T code u2013 GS01 wherein you can give list of users for which you want to restrict posting only with document type u201CJVu201D. Attached this set or a single user in u201CPrerequisiteu201D section of validation.
    3 - In u201CChecku201D section of validation validate the document type u201CJVu201D syntax u201CBKPF-BLART <> JVu2019
    4 - Create and attach error message for above validation.
    5 - Attach this validation to your company code in OB28
    Since i donu2019t have SAP log on credential therefore cannot give you exact validation code syntax.
    Please try, hopefully this would help.
    Regards,
    Parag

  • Document Posting restriction using posting key,document type combination

    Hi
    We have a authorization restriction issue using posting key&document type&Accoutn type  combination.
    Requirement is
    User A should be able to post to vendors only for particular posting key&document type.He should be able to post to with any other posting keys and document types to vendors.
    We have tried with document type authorization object/vendor authorization objects from user profile but it does,t work.
    can any one suggest some way please/
    r
    regards

    Hi
    I think you should be able to achieve the same through Validation rule:
    Prerequisite
    Document Type - XXXX
    Check
    User name = 123 and Posting Key = XX
    You can set a an error messsage which would be bleeped when the check fails
    Regards
    Sanil Bhandari

  • Document types while uploading

    While Uploading a document, i could see document type as Normal Document and todos.
    My client requirement is, they want many other types to be added in the list, and is it possible to make the look on the iView according to document type and is it possible to search the document according those document types.
    Please help me
    thanx in advance
    Lakshmikantha

    Hi Lakshmikantha,
    > they want many other types to be added in the list
    That works by adding resource types, see http://help.sap.com/saphelp_nw04/helpdata/en/dd/a709407448c442e10000000a1550b0/frameset.htm for details.
    Hope it helps
    Detlev

  • Company code and plant should get defaulted from PO Document Type

    Dear All,
               We have three company codes 1000 ,1010 ,1020 .We have three purchase document types.NB,NB1,NB2.My requirement is if the user selects document type NB system should automatically take company 1000 and plant 1000 .Same is the requirement for other 2 documents . Is there any settings from which we can achieve company code ,plant getting defaulted according to document type ?
    Thanks & Regards
    Abhijit Das

    Dear,
    Ask your Abaper to write code in GUIXT scripts....
    There if you select particular document type then by default in PO it will popup your plant and company code.
    The above mentioned functionality we do not have in our current projetc, but related tho this we have done it by using the same scripts.
    Try def it will work.
    Regards
    Utsav

  • Validation at Document Type level

    Dear Seniors,
    We have a requirement to have a validation for posing various documents by different users.
    Document type  JV should be posted by only a set of users USERS1.
    Document type GB should be posted by only a set of users USERS2.
    Document type CV should be posted by both the sets of user viz., USERS1 and USERS2.
    How to put this validation.
    Regards
    KVKR

    Hi,
    Apart from the above given solutions, there is an alternative and easy solution available, which can be done without the help of ABAP / BASIS members.
    Create a set in GS01. (Table name: USR01 and field name BNAME)
    in GS01, create set IDs like GROUP1, GROUP2, (create one by one, using above said table and field names and by choosing BASIC SET selection.
    Then in the next screen,  assign the users to each set ID. and SAVE.
    Now in GGB0, create a validation rule (in FA ->header level), under that create 3 steps like
    STEP1:
    Prerequisite: IF BKPF-BLART = 'JV'
    Check:          BKPF-USNAM IN GROUP1
    Message: Put Error message according to your requirement.
    STEP2:
    Prerequisite: IF BKPF-BLART = 'GB'
    Check:          BKPF-USNAM IN GROUP2
    Message: Put Error message according to your requirement.
    STEP3:
    Prerequisite: IF BKPF-BLART = 'CV'
    Check:         BKPF-USNAM IN GROUP1 OR BKPF-USNAM IN GROUP2
    Message: Put Error message according to your requirement.
    And activate the validation rule in OB28 to your company codes.
    I really hope that your requirement can be fulfilled with this.
    Regards,
    Srinu
    DOCTYPE_VALIDATION_SRB

  • Validation Rule for Accounting Document type

    Hello Experts
       I have an requirement  to block certain accounting doc type to get vendor line item post in that. For that I tried to block direct through OBA7 but not be able to also can't delete number range as it is shared by another doc type. My last option is Validation rule but i never work on this ,so any suggest how to create validation rule " To Block Accounting Doc type SO THAT THERE WILL NOT BE ANY line item posting occur in that doc type.
    Regards.

    ok sure.  OB28 callpoint 1.  Create a step under this callpoint.
    1)  Prerequisite is as follows:  note XXXX is your company code and ZZ is your doc type.
    BKPF-BUKRS = 'XXXX' AND
    BKPF-BLART = 'ZZ'
    2)  Then you need to enter the check.  Here you can just put FALSE.
    3)  The last part is to create your message.  Message type E so they get an error and then create a message number in the class that you choose and give it a description:
    Document Type 'ZZ' is not allowed
    Save it and wah lah! 
    Let me know how it goes.
    Thanks,
    Jes

  • Maintain payment Terms according to PO Document Types

    Hi,
    We want to maintain Payment Terms according to PO Doc. type. Now in our system PO have disable Payment Terms.
    But we have a requirement that for 1 Doc. Type they should be changeable.
    How it is possible???

    Hi,
    Document type concept is used to differentiate the differentiate procurement processes like example:
    YNB: For Standard procurement
    YIMP: For Import
    YSUB: For Sub Contracting
    YSER: For Service
    A company may have 10 payment terms and one should not use document type based on payment term. Payment term is maintained in vendor master and from vendor master payment tem flow to purchase order.
    For each payment term, if one creates document type, then imagine how many document types will be created to meet business process requirement. Consultant should think & simplify business with proper designing for uses of minimum document types for procurement processes.
    Regards,
    Biju K

  • Validation for Document type in Vendor Invoice.

    Dear All,
    I need to restrict the user from posting vendor invoice other than document type KR. I thought of using validation with account type and posting key , but looking at more refined solution. Please suggest.
    Thanks & Regards

    Hi,
    Yes, this can be acheived using an validation at accounting document level.
    Validation must be like
    If posting key is 31---Prerequisite: BSEG-BSCHL = '31'
    then the doc type type should be KR---Check: BKPF-BLART = 'KR'
    Else put one error message.
    This will resolve your issue.
    Thanks,
    Srinu

  • Validation of document type in VA01

    23.12.2008
    Hi Gurus,
    We create a Sales Order (eg. ZXXX) through a Z-development. My requirement is that this particular document type should not be created using t.code VA01. Need a validation for VA01 in the first screen itself  ( where the document type, Sales Org, Dist Channel and Divn is entered) to restrict creation of document type ZXXX thru t.code VA01
    Regards

    Dear Sanjay,
    If your requirement is - To restrict Creation of Sales Document Type "ZXXX" with Transaction Code: VA01
    which, I have understood from your query:
    My requirement is that this particular document type should not be created using t.code VA01.
    ...the same could be achieved by changing/ modifying the Transaction Group in to Sales Document type.
    Path: T. Code: VOV8 --> Key-in Sales Doc. Type --> Go in to Detail-page --> Tab: Transaction Flow --> Field: Transaction Group
    If, we maintain entry as "0", the sale doc.will be created with VA01
    If, we maintain entry as "1", the sales doc. will be created with VA11.
    Note: If, you change Transaction Group to "1" for Standard Sales Doc. Type - OR; it will be created with VA11 and not with VA01.
    So, change the Transaction Group from "0" to "as reqd." for Sales Document Type "ZXXX" in VOV8
    Best Regards,
    Amit

  • Customization + SD + Add a Document Type as Valid

    Hi Experts
    This is related to Customization in SAP.
    I have the requirement that under Sales Document types, I need to remove a Blocked status of a document type and add this type as Valid document.
    I followed the below path:
    SPRO-> Sales & Distribution -> Sales -> Sales Documents -> Define & Assign Reason for Blocking.
    But, I could not make out where and what to do?
    Plz help.

    No response. Closed!

  • Asking to maintain a valid document type for inter company

    Hi friends
    We have created a purchase order. It is STO inter-Co
    There is no issue for a normal vendor when posting in MIGO; the error is just for inter-company vendors.
    When doing MIGO the document shows OK. When posting or saving the document it is showing an error as Use a valid document type for inter company.
    As per the error we have maintained the document types in OBA7 and the inter company posting are checked for the document types.
    Can anyone help me on this issue how to proceed?

    hI SUKANYA
    PLS EXPLAIN ME WHILE GL A/C CREATION FOR WE ASSIGNED G067 AND READY FOR A/C INPUT IS FOR WHAT
    CAN U PLS EXPLAIN ITS USES . MEE ANSWER KOSAM WAIT CHESTUNTAA
    THANKS
    MALLIKARJUNA

Maybe you are looking for

  • Script for adding datafile to tablespace

    Hi Does anyone have a template alter tablespace add datafile script handy? Basically, we need to, in the event of a tablespace alert, do two things: query that tablespace to see how much space is remaining. ascertain the size of the datafiles added t

  • Can't see screen during bootup m58

    Hi, I have a SFF ThinkCentre M58.  I had a video prob on one of my partitions (not related to my current prob).  I went into bios and switched my video from automatic to I think "IGN" (or something like that)which I thought would be on board video in

  • Forms Central Email

    Hi Can I use Forms Central in an email campaign. I want to send the form so email recipient's can fill it out in the email program not just click on a link to go to the form? Thanks bob

  • Trying to sync photo folder on iPad 2.

    Created folder on computer caled iPad Photos and loaded pics in. Renamed all photos from usual DSC 00297 etc. to a1, a2, etc. In folder they are in correct order, but after syncing the iPad photos are not in order. Why does this happen and can I corr

  • Please bring up The Cloud Server So I Can Print!

    Two days and missing print jobs is too much. In my eprintCenter it shows that my HP photosmart D110 printer is Connected <-----<<<<< is Ready.<-----<<<<< Two pending print jobs are shown. I did several refreshes it this stays the same. <---<<<< OK I