SP for Sales Opportunity fields

Dear Experts,
I want to set some fields in Sales Opportunity as mandatory and I think can be possible through SP transaction notification but am not able to write procedure.
I want the followings fields to be set as mandatory and the document does not get saved untill and unless these fields are not put. The fields are from Sales Opportunity as under :
1) Opportunity Name
2) Contact Person
3) Territory
4) Sales Employee
I know the object for Sales Opportunity seems to be 97. Would be thankful if you can help me in writing the SP.
Thanks in advance.
Regards,
Kamlesh

Hi
Use the following SP:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER proc [dbo].[SBO_SP_TransactionNotification]
@object_type nvarchar(25),           -- SBO Object Type
@transaction_type nchar(1),          -- [A]dd, <u>pdate, [D]elete, [C]ancel, C[L]ose
@num_of_cols_in_key int,
@list_of_key_cols_tab_del nvarchar(255),
@list_of_cols_val_tab_del nvarchar(255)
AS
begin
-- Return values
declare @error  int               -- Result (0 for no error)
declare @error_message nvarchar (200)      -- Error string to be displayed
select @error = 0
select @error_message = N'Ok'
IF (@transaction_type = 'A' or @transaction_type = 'U') AND @object_type = '97'
BEGIN
if exists (Select T0.cardcode from OOPR T0 where ((T0.Name is null) or (T0.cprcode is null) or (T0.territory is null) or (T0.slpcode =-1)) and (T0.opprid = @list_of_cols_val_tab_del))
begin
     SET @error = 10
     SET @error_message = N'Some of the Fields are Null'
end
END
-- Select the return values
select @error, @error_message
end

Similar Messages

  • Tables identification for sales order fields

    experts
    1)I am having an order and it may have multiple deliveries.
    in what way i need to fetch all the deliveries for that order?
    lips-vgbel = vbap-vbeln , lips-vgpos- posnr will this work ?  or something else i need to use to get all the deliveries for that order?
    2)and for that deliveries i will be having shippiments and how to get that?
    3) from which table i can see whether return order exists for the sales order ?
    4) how can we identity whether credit memo there for the sales order or not?
    5)where(table) can we find the atp qunatity field which is there in sales order scheduline line data tab?
    thank you for all the help

    Hi
    1)I am having an order and it may have multiple deliveries.
    in what way i need to fetch all the deliveries for that order?
    lips-vgbel = vbap-vbeln , lips-vgpos- posnr will this work ? or something else i need to use to get all the deliveries for that order?
    Goto VBFA table, give your sales order number as VBFA-VBELV and fetch VBFA-VBELN where VBTYP_N = J
    2)and for that deliveries i will be having shippiments and how to get that?
    Goto VBFA table, give your Delivery number as VBFA-VBELV and fetch VBFA-VBELN where VBTYP_N = 8.
    3) from which table i can see whether return order exists for the sales order ?
    Goto VBFA table, give your sales order number as VBFA-VBELV and fetch VBFA-VBELN where VBTYP_N = H.
    If sy-subrc = 0
      return order exists
    else not.
    4) how can we identity whether credit memo there for the sales order or not?
    Goto VBFA table, give your sales order number as VBFA-VBELV and fetch VBFA-VBELN where VBTYP_N = K.
    If sy-subrc = 0
       credit memo exists
    else not.
    Hope this is sufficient for your. Rest you can do R&D.

  • Stored procesdure for UDT linked to UDF in Stage of Sales Opportunity

    Dear All,
    I have an User Defined Table named 'process' in Sales Opportunity Row Stage Tab with some values as 1.1, 1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0 so on which is connected to a user defined field named 'Reasons'.
    Now the user does the sales opportunity entry and in the stage tab selects the process e.g 1.5 in the user defined field. Now I suppose 1.5 has a reason name of lost to others. Now I want to add a stored procedure that if the user selects lost in the Sales Opportunity summary tab and he has not selected the reason which is between 1.5 to 1.9 ( means lost reasons ) the sales opportunity should not get saved. An error message should show as please select proper reason.
    Can it be achived through SP. I think we can do it but cannot make the SP could you please guide and help me to resolve this issue..
    Appreciate your quick and positive response.
    Regards,
    Kamlesh

    Hi,
    I am trying to make the SP for cross checking the Lost reason if it is not put which are between 6.0 to 7.0 when the user selects lost in the summary tab but I am getting an error while executing the SP as - Msg 102, Level 15, State 1, Procedure SBO_SP_TransactionNotification, Line 243 Incorrect syntax near '='.
    Note the followings :
    In the OPR1 row I have a udf named U_Status
    My SP is as under :
    IF @transaction_type IN (N'U') AND @object_type = '97'
    begin
    if exists (SELECT * FROM [dbo].[opor] T0 INNER JOIN [dbo].[opr1] T1 ON T0.OpprId = T1.OpprId where T0.Name ='MACHINE' and T0.Status ='L' and T1 (U_status ='0' or U_Status ='1.1' or U_Status ='1.2' or U_Status ='1.3' or U_Status ='1.4' or U_Status ='1.5' or U_Status ='1.6' or U_Status ='1.7' or U_Status ='1.8' or U_Status ='1.9' or U_Status ='2.1' or U_Status ='2.2' or U_Status ='3.1' or U_Status ='3.2' or U_Status ='3.3' or U_Status ='3.4' or U_Status ='4' or U_Status ='4.1' or U_Status ='4.2' or U_Status ='4.3' or U_Status ='5' or U_Status ='5.1' or U_Status ='5.2' or U_Status ='5.3' or U_Status ='5.4' or U_Status ='5.5' or U_Status ='5.6')and T0.opprid =@list_of_cols_val_tab_del)
    begin
    SELECT @error = 10, @error_message = N' Please put proper reasons for Losing the Opportunity'
    end
    end
    Would be obliged if you can throw some light in it.
    regards,
    kamlesh

  • Sales Opportunity number field

    In Open Items report (Sales Orders) is it possible to have column displaying Sales opportunity number that the sales order was created from?
    I have looked through form settings but cannot find this field?

    Hi Andrew.......
    It is not possible to make any modification to the standard reports given by SAP. But you may have your own query report......
    Regards,
    Rahul

  • Add fields in Locator result  for Sales Document in GUI (anyone?)

    Dear all,
    I try to find information on how we can customize the locator's result column (especially for Sales document)
    in GUI mode. I know we can Change Layout to choose other available field column to be displayed in the
    locator result. How to add more fields so we can have more fields to choose when we change the layout?
    I searched the SDN CRM forum but no exact answer for this (missed it?)
    In fact, there is a bug on the locator search result when I set field Employee Responsible to be displayed
    on the search result, the system is showing other Partner number instead.
    If you have experienced in add fields on the Change Layout, please kindly share it.
    Appreciate your help (with points)
    Cheers,
    Gun.

    It is GENIL BOL concept and now using WebUI Search.

  • Custom field for sales order - Urgent.

    Hi all,
    I am novice at SD, want to append a custom field to header level tables - VBAK, LIKP, VBRK. for sales order.
    - Will append structure work for this requirement ?
    - Will this field automatically apears in VA01, VA02, VA03 screen ?
    Thanks in Advance.
    Regards,
    Mohan.

    Hi,
    Implementation Guide.
    This is the place where we do the configuaration settings for sap.
    This is the place where the core users or super users do the configuration changes if they want after the project is implemented.
    Mohan
    Award points if it helps

  • Update KOMV-KBETR field for sales order and billing

    I would like to update the KOMV-KBETR (condition amount or percentage) under condition tab for both Sales order and billing.
    example:There are two condition types ZA00 and ZB00 and need to get the KBETR value from ZA00 and add it to KBETR value of ZB00 and update the sum in KBER value of ZB00.
    1. creation of sales order & billing.
    2. Change of sales order & billing.
    3. For single & multiple line items in both sales order & billing.
    4. during updation of price in the change mode of sales order & billing.
    5.When user click on Update button in the condition tab(i.e., when clicked on Carryout new pricing)
    I tried with the VOFM routine but as the routine is triggering multiple times the sum is calculated again and again.For that I set flags also.It is working for sales orders but for billing creation the field XKOMV-KBETR is cleared after this routine.
    So I would like to know are there any EXITS for this scenario or any one entountered the similiar issue which I am facing.

    Hi Brad,
       It is an Client requirement.So need to do the addition of that condition types.
    Can you please let me know the configuration point where we can do it and the condition type which we need to update the Rate/Amount value.ie., KOMV-KBETR is and Price list value and not the subtotal one.
    Thanks,
    Srilakshmi Lagisetty.

  • Customer no to populate the Assignment field for Sales A/c using sort key

    Dear All,
    In 6.0, I am trying to get the Customer number to populate the Assignment field for Sales Account
    We have set the sales account to a 031 sort key - sort by customer, in FS00. When 031 is set, SAP goes to the BSEG table and looks at the KUNNR (customer) field and populates the Assignment field with what is in the KUNNR field of BSEG.
    The problem is: the customer number (KUNNR) does not contain any data in BSEG.
    The KUNNR field of all the other account lines for the document number are blank.
    Is it possible to bring the field in the General Ledger display?
    Does anyone know of a user exit or other solution?
    Thanks,
    Gov

    Hi,
    Check with SD consultant and use Copy control.

  • Help Required for Open Sales opportunity query

    Hi Experts
    I need to create a query on Open Sales Opportunity where quotation has not been submitted. also all opportunities with respective sales quotation
    How can i link Opr1 ( Stage), OOPR, oqut table.
    Regards
    Raman

    Thanks Gordon ,
    But this query is for all sales opportunity linked with Sale quotation. also it showing only last quotation .
    In case in 1 sales opportunity i have 3 quotation how can it will manage toh show all quotations linked with one opportunity.
    Regards
    Raman

  • GL listing with populated Plant field for Sales accounts

    Hi all,
    In GL listing (T-code-FBL3n) for Sales account-GL there is provision to see the line items detail of Sales Account  with Plant as field, but I am seeing the GL line items without Plant field populated, How this field can be automatically populated as this acounting line item automatically gets created as soon as we save Billing document(VF01) and posted to proper GL.
    Kindly help me to populate the Plant field.
    Thanks in advance....
    Raju

    Dear Raju,
    In FBL3N Report there is Change Layout Icon (Ctrl+F8) in Report Toolbar there you have to select Hidden Field Plant and add to report and press copy you will get Plant Column in your report.
    thx
    Ganpat Sundhesa

  • Field Exit for Sales Document Type in VA01

    hi
       i want to do field exit for Sales Document Type in VA01.
    but i dont know to find the correct exit.
    pls tell the exit name and the steps to find it.
    thank u

    Hi,
    Goto this link u will get the information u required....
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/9cd334f3-0a01-0010-d884-f56120039915
    Check the numerous threads that already exist in SDN :
    CMOD and SMOD
    http://www.sap-img.com/abap/what-is-user-exits.htm
    Regards,
    Manish

  • TABLE/FIELD FOR SALES ORDER'S SHIP TO LOCATION

    Hi everyone,
    Does anyone tell me what is the related tables/fields for Sales Order's Ship To Location? Since I want to display the Ship To Location information in the Oracle Report in Oracle Apps R11i.
    I tried to use the following SQL select statement to retrieve the Ship to address:-
    -- SHIP TO LOCATION
    select a.address_id, c.customer_name, C.CUSTOMER_ID, A.SITE_USE_ID from ra_Site_uses_all a, ra_addresses_all b, ra_customers c
    where a.site_use_code = 'SHIP_TO' and
    a.status = 'A' and
         b.address_id = a.address_id and
         c.CUSTOMER_ID = b.CUSTOMER_ID and
         b.status = 'A' and
         c.customer_id in (select customer_id from ra_customers) and
         c.status = 'A' and
         c.customer_name like 'CLARION (H.K.)%'
    But I found that the data is BILL TO address. Can anyone help me? Thanks.

    Hi all, I managed to solve my problem. Here's the query in case someone need it. Thanks
    SELECT party.party_name "Send to" (SELECT party.party_name
    FROM hz_cust_site_uses_all bill_su,
    hz_cust_acct_sites_all bill_cas,
    hz_party_sites bill_ps,
    hz_locations bill_loc,
    hz_parties party,
    oe_order_headers_all h
    WHERE h.invoice_to_org_id = bill_su.site_use_id
    AND bill_su.cust_acct_site_id = bill_cas.cust_acct_site_id
    AND bill_cas.party_site_id = bill_ps.party_site_id
    AND bill_loc.location_id = bill_ps.location_id
    AND bill_cas.party_site_id = bill_ps.party_site_id
    AND bill_ps.party_id = party.party_id
    AND h.order_number = 'your_order_number') "Invoice to"
    FROM oe_order_headers_all h,
    hz_cust_site_uses_all ship_su,
    hz_cust_acct_sites_all ship_cas,
    hz_party_sites ship_ps,
    hz_locations ship_loc,
    hz_parties party
    WHERE h.ship_to_org_id = ship_su.site_use_id
    AND ship_cas.party_site_id = ship_ps.party_site_id
    AND ship_su.cust_acct_site_id = ship_cas.cust_acct_site_id
    AND ship_cas.party_site_id = ship_ps.party_site_id
    AND ship_ps.party_id = party.party_id
    AND ship_loc.location_id = ship_ps.location_id
    AND h.order_number = 'your_order_number';

  • Table for sales order change by field

    Dear Friends,
    I want to get the data @ table level for the list of sales orders with changed by field. Can you please tell which table/s for sales order change by field can be used?
    Thanks,
    pinky

    Hi
    You can get the changes for SALES ORDER item in CDPOS table
    Goto SE16 and find the changes.
    hope it will serve your purpose.
    thanks,
    santosh

  • What is the field for sales order type?

    pls tell me what is the field for sales order type??
    and from which table........urgent

    Hi,
    Field for sales order type is AUART in table TVAK
    the Parent table for Sales order type is TVAK.
    Best regards,
    raam

  • Sales Opportunity Report

    Dear Experts,
    How to generate Summary Sales Opportunities Reports with these field.
    SR NO
    CUSTOMER NAME
    ACTUAL SALES VALUE
    SALES OPPORTUNITY VALUE
    %SALES ACHIEVED
    % SALES LOST
    1
    ABC
    100000
    50000
    10000
    90000
    Kindly provide some report related to these field.
    Regards
    Amol

    Dear Rajesh,
    Thanks for reply, I have some issue in query that Sales opportunity Value (Potential Amount) figure should comes from Sales Opportunity Module.
    Start Date,  Closing Date (Sales Opp Table),  BP Customer Group   Actual Sales Value (Sales Opportunity table Define UDF u_salestarget),   SALES ACHIEVED amount OINV   table  ,  Sales lost  Actual Sales Value - Sales Lost.
    Previous query gives wrong figure.Kindly provide the same.

Maybe you are looking for

  • Text Entry with Tab Key not advancing to next slide

    I am using Captivate 1 to create a screen that has a text entry requiring the user to press the Tab key as the Shortcut Key. The users are having to press the Tab key multiple times to get the course to advance to the next slide. There does not seem

  • Error Message when converting to pdf

    When I try to convert a file into pdf with different fonts I get the following error message: cannot find or create the font ___________. Some characters or print may not display correctly. It won't let me bold, use italics regardless if I use Times

  • Help ! using Calendar & adding text to a page problem !!

    Let's hope I make this clear enough for someone to understand. I am making up a Calendar & I want to add text to certain pages ( photo ). I click on 'Design' & pick option 2 ( the one where you can add text ), now here is my problem. The text box alw

  • Running the JRE from a CD

    Hi all, I'm hoping to distribute a Java application I have written on CD but the majority of the people I will be giving it to won't have the Java Runtime Environment. Is it possible to burn the JRE onto a CD along with my class files so the user can

  • What's the correct order to install OEM Grid Control + DB + AS?

    Hi everbody! I'm getting start on OracleAS and Grid Control. What's the correct order to install: * Enterprise Manager 10g Grid Control * Database 10gR2 * Application Server 10gR3 (on RHEL4-Upd2) or the order is not important? I need have the environ