Stored Procedure for Zero Price in GRPO

Hi all,
   Can anybody let me know the required stored procedure for restricting zero price in the GRPO transaction .
Thanks in advance ,
Aditya

Use this in your SBO_SP_TransactionNotification
IF @transaction_type = 'A' AND @object_type = '20'
BEGIN
IF EXISTS (SELECT T0.ItemCode FROM [dbo\].[PDN1\] T0
WHERE (T0.Price = 0 OR T0.Price IS NULL) AND T0.DocEntry = @list_of_cols_val_tab_del
BEGIN
SELECT @Error = 1, @error_message = 'Item without Price'
END
END
Suda

Similar Messages

  • Stored Procedure for Accounts Receivable

    Hi. First off, apologies in advance if I have put this question into the wrong topic. Secondly, I first saw SAP 3 weeks ago when I stared my new job and have had no training so please bear with me if some of what I ask doesn't make much sense.
    OK, the issue is this.  In SAP B1, there is a built in Report called "Customer Receivables Aging" which allows you to see Customer Receivable Accounts by age (e.g 0-30, 31-60, 61-90, 90+) and so on.  The problem with the built in report is that it doesn't show all the fields I want - it only shows the Customer Name, balance, and then the aging balances.  I want to be able to see things like the customer's contact details, etc. I know this makes no sense because the whole point of the report is to be able to drill down into the different rows, but this report needs to be issued in printed form, hence the need for the extra fields.
    Since I can't seen any way from within SAP to change the fields returned by this report, I thought I'd have a stab at writing my own SQL to select out the same data along with the extra fields I wanted.  That's when the problems began...try as I might, I cannot get my figures to tally with the SAP Report.
    They are almost correct, but not quite. I am sure that I am missing a selection or some other element of the logic that B1 uses to create the built in report.
    If you want, I can post the SQL I'm using....I'm not an SQL guru by any means, but I do know my way around it; the biggest problem I have is that I cannot find any documentation as to the 4 letter tables that SAP uses and their relationships except on the most basic level (e.g ORIN is Open Return Invoice [maybe])
    Then I thought maybe it might be possible to edit that report section in B1 using the SDK.  That would be a better solution as I would not have to 'reinvent the wheel', I can just SELECT an extra field or three to include in the report.
    So my question is
    ->Does anyone have a stored procedure for SQL Server that can replicate correctly the SAP B1 "Customer Receivable Aging", even just the process SAP uses to gather this data would be good.
    OR
    is it possible to edit this report in SAP to put in the extra fields I want.
    Or, am I totally barking up the wrong tree? Thanks in advance, I know this is a long post.

    Hi Stephen,
    There should be a print layout attached to the on-screen report. This can be altered to show the additional fields you want without resorting to SDK or SQL development.
    When you have the Customer Receivables Ageing report open on screen, choose Tools-Print Layout Designer or click on the Print Layout Designer icon on the toolbar. When prompted, choose the layout you wish to edit and you'll be taken to the layout design. In the layout, you can add additional fields and should be able to add most business partner fields. As the report is set to portrait by default, I recommend changing it to landscape so you have lots more space to add the extra fields you want. This report writer is fairly intuitive, if a little basic.
    You will need to save this new report design, set it to be the default layout and then when you select to print the Customer Receivables Ageing report (ie Print Preview or Print) you will see the new report.
    Hope this helps,
    Owen

  • Stored Procedure For Web Service in Visual Composer 7.1

    Hello,
    I want to use stored procedure for Webservice in Visual Composer 7.1
    I can find this Web service but not supported. ( ex) prcreleased_test - Not supported )
    Log.
    Message: Error in connection - Can' t execute Web service.
    Date: 2008-07-01
    Time: 16:41:43:906
    Category: com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent
    Location: com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent.processExecution: 
    Application: sap.com/test~kmshim_wf_impl
    Thread: HTTP Worker [1]
    Data Source: j2ee\cluster\server0\log\defaultTrace_00.trc
    Correlator ID: 240496500000034715
    Argument Objects: 
    Arguments: 
    DSR Component: n.a.
    DSR Transaction: cb4b3560473711dd9fb4001e4f3b8fcb
    Log2
    Message: Stopped further execution since the interpreter is unusable
    Date: 2008-07-01
    Time: 16:41:43:906
    Category: com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent
    Location: com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent.XGLInterpreter
    Application: sap.com/test~kmshim_wf_impl
    Thread: HTTP Worker [1]
    Data Source: j2ee\cluster\server0\log\defaultTrace_00.trc
    Correlator ID: 240496500000034715
    Argument Objects: 
    Arguments: 
    DSR Component: n.a.
    DSR Transaction: cb4b3560473711dd9fb4001e4f3b8fcb '
    Help me^^ plz..

    Hi Tanna.
    Thanks for your reply^^
    I create webservice that access my stored procedure.
    But not supported.
    http://dmp.humaxdigital.com/HumaxCmdwService/Service1.asmx?wsdl
    There are two service. (Hello World - Test, prcrelease_test - Stored Procedure )
    'Hello World' is supported but prcrelease_test is not supported. I can't drag to storyboard.
    Our company's DB is MSSQL2005.
    please help me^^

  • Stored Procedure for Crystal Reports

    Hi All,
    I developed this test stored procedure to see wheather we could a stored procedure for crystal reports. It compiled without any problem, but when I run it, it gives me error message. Here is the stored Procedure..
    CREATE OR REPLACE PROCEDURE WOLD1SIM.TEST_PROCEDURE(
    TEST_CURSOR IN OUT TEST_PACKAGE.TEST_TYPE,
    TEST_PARAMETER IN TEST_TABLE.ID%TYPE)
    AS
    BEGIN
    OPEN TEST_CURSOR FOR
    SELECT *
    FROM TEST_TABLE
    WHERE TEST_TABLE.ID = TEST_PARAMETER;
    END TEST_PROCEDURE;
    And
    This is the error message..
    ERROR at line 2:
    ORA-06550: line 2, column 1:
    PLS-00201: identifier 'TEST_PROC' must be declared
    ORA-06550: line 2, column 1:
    PL/SQL: Statement ignored
    I have created the package sucessfully.
    I was wondering If any one of you can advice me where I am making the mistake.
    Thank you

    CREATE OR REPLACE PROCEDURE WOLD1SIM.TEST_PROCEDURE(TEST_CURSOR IN OUT TEST_PACKAGE.TEST_TYPE,
                                                         TEST_PARAMETER IN TEST_TABLE.ID%TYPE)
    ...you have 2 parameters in your procedure WOLD1SIM.TEST_PROCEDURE(). you should also use two parameters when you execute the procedure.

  • Stored Procedure for restrict to close documents

    Hi,
    I want to create a Stored Procedure for restrict to close sales orders for some users, because in Standard Authorizations you have one option to restrict to close, but I need that some users can close quotations and also this users can´t close sales orders. I have this query :
    F @object_type='17' AND (@transaction_type='a' or @transaction_type='U' )
    BEGIN
    IF EXISTS (
    SELECT T0.DOCENTRY FROM adoc T0 WHERE T0.[ObjType] = '17'
    AND T0.[UserSign] = '1' AND    T0.[DocStatus] = 'C'   AND
    T0.DOCENTRY= @list_of_cols_val_tab_del )
    BEGIN
    SELECT @Error = 1, @error_message = 'You are not permitted to close Sales Orders'
    END
    END
    But It doesn´t work. I need help!!!
    Thanks

    Hi Jose,
    You have to correct your transaction type parameters.  When you perform close or cancel operations on document; the trasnsaction notification receives parameters u201CCu201D for Cancel and u201CLu201D for Close. So instead of checking add u201CAu201D or update u201CUu201D;  you have to modify your transaction type filters for cancel u201CCu201D or close u201CLu201D.  It will go like belowu2026
    IF @object_type='17' AND (@transaction_type='C' or @transaction_type='L')
    Please try above and let me know the results.
    Thanks & Regards,
    Nitin
    Manager, SAP Business One
    Greytrix
    It's time to think outside the box.
    Email: sap at greytrix.com | Web: www.greytrix.com
    u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026
    Development Partners for SAP B1

  • Stored procedure for arhive

    I created a stored procedure for send data from a source bd to the bd destination with a link between BD
    But it will not work
    CREATE OR REPLACE PROCEDURE archivage ( source IN VARCHAR2, destination IN VARCHAR2)
    BEGIN
    / * - Prepare a cursor to select from the bd_source: * /
    source_cursor: = dbms_sql.open_cursor;
    DBMS_SQL.PARSE (source_cursor,
    'SELECT table_name FROM dba_tables' | | source,DBMS_SQL.NATIVE);
    LOOP i in source_cursor
    /* Or i use this !!!!
    SELECT object_name FROM dba_objects WHERE owner = 'SCOTT' AND object_type = 'TABLE'*/
    DBMS_SQL.DEFINE_COLUMN (source_cursor, i);
    end loop
    ignorer: DBMS_SQL.EXECUTE = (source_cursor);
    / * - Prepare a cursor to insert into the destination db: * /
    destination_cursor: = DBMS_SQL.OPEN_CURSOR;
    DBMS_SQL.PARSE (destination_cursor,
    'INSERT INTO' | | destination | | DBMS_SQL.NATIVE);
    / * - Fetch a row from the source table and insert it into the destination table: * /
    loop
    if DBMS_SQL.FETCH_ROWS (source_cursor)> 0 ALORS
    - Obtenir des valeurs de colonne de la ligne
    DBMS_SQL.COLUMN_VALUE (source_cursor,i);
    DBMS_SQL.BIND_VARIABLE (destination_cursor,i);
    ignorer: DBMS_SQL.EXECUTE = (destination_cursor);
    ELSE
    EXIT;
    End If;
    END LOOP;
    /*-Close cursor */
    COMMIT;
    DBMS_SQL.CLOSE_CURSOR (source_cursor);
    DBMS_SQL.CLOSE_CURSOR (destination_cursor);
    EXCEPTION
    WHEN OTHERS, THEN
    if
    DBMS_SQL.IS_OPEN (source_cursor)then
    DBMS_SQL.CLOSE_CURSOR (source_cursor);
    End If;
    if DBMS_SQL.IS_OPEN (destination_cursor) then
    DBMS_SQL.CLOSE_CURSOR (destination_cursor);
    End If;
    RAISE;
    END;

    find 10 differences ... :(
    CREATE OR REPLACE PROCEDURE archivage (source        IN VARCHAR2,
                                           destination   IN VARCHAR2)
    IS
       source_cursor        INTEGER;
       destination_cursor   INTEGER;
       ignorer              INTEGER;
    BEGIN
       /* - Prepare a cursor to select from the bd_source: */
       source_cursor := DBMS_SQL.open_cursor;
       DBMS_SQL.
        PARSE (source_cursor,
               'SELECT table_name FROM dba_tables' || source,
               DBMS_SQL.NATIVE);
       FOR i IN source_cursor
       LOOP
          /* Or i use this !!!!
          SELECT object_name FROM dba_objects WHERE owner = 'SCOTT' AND object_type = 'TABLE'*/
          DBMS_SQL.DEFINE_COLUMN (source_cursor, i);
       END LOOP;
       ignorer := DBMS_SQL.EXECUTE (source_cursor);
       /* - Prepare a cursor to insert into the destination db: */
       destination_cursor := DBMS_SQL.OPEN_CURSOR;
       DBMS_SQL.
        PARSE (destination_cursor,
               'INSERT INTO ' || destination,
               DBMS_SQL.NATIVE);
       /* - Fetch a row from the source table and insert it into the destination table: */
       LOOP
          IF DBMS_SQL.FETCH_ROWS (source_cursor) > 0
          THEN
             --ALORS
             -- Obtenir des valeurs de colonne de la ligne
             DBMS_SQL.COLUMN_VALUE (source_cursor, i);
             DBMS_SQL.BIND_VARIABLE (destination_cursor, i);
             ignorer := DBMS_SQL.EXECUTE (destination_cursor);
          ELSE
             EXIT;
          END IF;
       END LOOP;
       /*-Close cursor */
       COMMIT;
       DBMS_SQL.CLOSE_CURSOR (source_cursor);
       DBMS_SQL.CLOSE_CURSOR (destination_cursor);
    EXCEPTION
       WHEN OTHERS
       THEN
          IF DBMS_SQL.IS_OPEN (source_cursor)
          THEN
             DBMS_SQL.CLOSE_CURSOR (source_cursor);
          END IF;
          IF DBMS_SQL.IS_OPEN (destination_cursor)
          THEN
             DBMS_SQL.CLOSE_CURSOR (destination_cursor);
          END IF;
          RAISE;
    END;
    /

  • Stored Procedure for Batch Number Format and Block Duplicate Batch Number

    Hi Experts !
    I am new one in forum asking question.. I want Stored procedure for Batch Number Format. I want fix one Batch number format in Stored Procedure.
    Example :
    My Batch number format Like  BATCH00001 - It should be first five digit is text format and next five is Numeric.
    IF create Goods receipt PO or Goods receipt stage I create batch number like BATCH 00001 or any other number means don't add that document and also duplicated batch number also does not allowed. please give me the solutions. I am sorry for my bad english .

    Dear Nagarajan K.
                         Thanks for your replay ..
    IF @transaction_type IN ('A','U') AND (@object_type = '106' )
    BEGIN
    set @item = LEFT( @list_of_cols_val_tab_del, CHARINDEX(CHAR(9),  @list_of_cols_val_tab_del,1) - 1)
    set @batch = substring(@list_of_cols_val_tab_del, len(@item)+1, (CHARINDEX(CHAR(9),  @list_of_cols_val_tab_del,len(@item)+2)) - (len(@item)+1))
    --set @base =( select basetype from ibt1 where batchnum = ltrim(rtrim(replace(@batch,char(9),''))))
    set @count = (select count(*) from oibt quantity > 0 and where  batchnum = ltrim(rtrim(replace(@batch,char(9),''))))
    if @count > 1
    begin
    set @error = 1
    set @error_message = 'Please enter different Batch Code for batch ''' + @batch + ''' for item ' + @item 
    select @error, @error_message
    END
    END
                  I used above Stored Procedure. here we can use one batch number for different item but  i want to block one batch we should use one item and one time only after than we never use that batch number for same item and another item.
             After that I want format for Batch, we should follow unique Batch number for all items.

  • Stored procedure for getting host name, host instance and status of that host is it running or stopped.

    Hello all,
    yesterday I got one task in that I have to stored procedure for getting host name, host instance and status of that host is it running or stopped.
    any body knows where exactly, In which table this details are there in BizTalk databases.
    thanks

    Status of the host instance is not stored in the SQL database for you to query the status using stored procedure. You have to either use Powershell or WMI to get the status.
    In SQL, following table contains the details about the host like Name, LoginName, IsDisables etc but status of the host instance is not stored in the database.
    SELECT * FROM BizTalkMgmtDb..adm_HostInstance
    Powershell to get the status:
    http://axonolympus.nl/?page_id=186&post_id=969&cat_id=6&lang=en
    WMI to get the status:
    https://msdn.microsoft.com/en-us/library/aa561820.aspx?f=255&MSPPError=-2147217396
    https://msdn.microsoft.com/en-us/library/aa578621.aspx
    Regards,
    M.R.Ashwin Prabhu
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Stored procedure for disabling all foreign key constraints ?

    hi all,
    I need a stored procedure for disabling / enable all constraints in that database schema.
    Create or replace procedure enable_disable_proc(status varchar2(3),schema_name varchar2(20))
    ---> where 'status' parameter condition should be ( YES for enable) (NO for disable)
    ---> 'schema_name' is a parameter where ,only this schema should be affected with this procedure..
    Thanks in Advance..

    Hi,
    Try this code
    /* Formatted on 2009/07/16 08:15 (Formatter Plus v4.8.8) */
    CREATE PROCEDURE enab_disab_proc (
       enforce          IN   VARCHAR2,
       current_schema   IN   VARCHAR2
    IS
       v_alter_table_sql   VARCHAR2 (2000);
    BEGIN
       FOR rec_con IN (SELECT table_name, constraint_name
                         FROM user_constraints
                        WHERE owner = current_schema)
       LOOP
          IF (enforce = 'NO')
          THEN
             v_alter_table_sql :=
                   ' alter table '
                || current_schema
                || '.'
                || rec_con.table_name
                || ' disable constraint '
                || rec_con.constraint_name;
          ELSE
             v_alter_table_sql :=
                   ' alter table '
                || current_schema
                || '.'
                || rec_con.table_name
                || ' enable constraint '
                || rec_con.constraint_name;
          END IF;
          EXECUTE IMMEDIATE v_alter_table_sql;
       END LOOP;
    END;Edited by: Salim Chelabi on 2009-07-16 05:15

  • Stored Procedure for lead code to be entered in sales order

    Hi All,
    I was trying to work on stored procedure for lead code not to be allowed to enter in sales order.
    It is system behaviour that it is allowing to take even lead code in sales order and add the transaction but my customer wants to block if any one of you could help me out to develop stored procedure.
    Thanks & regards-
    Monika

    Hi Monika,
    Try:
    If @object_type='17' and @transaction_type IN ('A','U')
    BEGIN
    If Exists (Select T0.DocEntry from ORDR
    Where T0.CardCode IN (SELECT CardCode FROM OCRD WHERE CardType = 'L')
    And T0.DocEntry = @list_of_cols_val_tab_del)
    Begin
    Select @error = 17, @error_message = 'Lead is not allowed for Sales Order'
    End
    END
    Thanks,
    Gordon

  • Calling a stored procedure for each row returned

    I need to call a stored procedure for each row returned by a repeating frame. I called the stored procedure from the repeating frame format trigger, but that did not work( it did no populated the tables populated by the stored procedure)
    How can I call a stored procedure for each row returned by a repeating frame.
    Thank you

    Include it as a formula column in your data model.

  • Using a stored procedure for a  sender jdbc adapter

    Hi all,
    The requirement is to use a stored procedure, for extracting data from a oracle database.
    Is it possible to do this.
    If yes, what should be the source structure in this case.
    Please help with the exact soln.
    Thanks!!
    Younus

    Hi,
    Did you check the blog pointed by Aamir?
    /people/jegathees.waran/blog/2007/03/02/oracle-table-functions-and-jdbc-sender-adapter
    You will need to use Oracle Functions instead of Oracle Stored Procedures. Read thru the blog and the note pointed in the blog . Think it is quite a good example.
    Regards
    Bhavesh

  • Stored procedures for User Tables

    Can somebody please help me with this matter?. I need to add stored procedures for user tables. Is there any way  of doing so?.
    Thanks in advance.
    Ernesto.

    Ernesto,
    You have posted multiple threads for the same question.  Please check the other thread and close this one:
    Stored procedures in User Tables
    Thanks,
    Gordon

  • Stored Procedure for Outgoing Payment Approval

    Hi
    I am writing a stored procedure for Outgoing Payment (Draft) which is not validating my fields
    1.Outgoing Draft (Procedure Not Working)
       If @object_type = '140' and @transaction_type = 'A'
       begin
         if exists(select t0.DocEntry  from OPDF T0 inner join PDF4  T1 on
         T0.DocNum = T1.DocNum where t1.ObjType ='46' AND (T0.Series = '15' AND T1.OcrCode <> 'U-1')
         and T0.DocEntry = @list_of_cols_val_tab_del)
         begin
              set @error = 1
              set @error_message = 'Check Unit'
         end
       End
    Regards
    John
    Edited by: JohnSmith@B1 on Sep 9, 2011 4:49 PM

    John......
    Try this.....
    IF (@object_type = '140' And (Select ObjType From OPDF
           Where DocEntry = @list_of_cols_val_tab_del)='46'
    AND @transaction_type IN ('A'))
    BEGIN
    if exists(select t0.DocEntry from OPDF T0 inner join PDF4 T1 on
    T0.DocNum = T1.DocNum where t1.ObjType ='46' AND (T0.Series = '15' AND T1.OcrCode != 'U-1')
    and T0.DocEntry = @list_of_cols_val_tab_del)
    begin
    select @error = 1,
    @error_message = 'Check Unit'
    end
    End
    Above SP will only work when your Series Code is 15 and OcrCode is not equal to 'U-1'....
    Please confirm........
    And Object type for Payment Draft 140 is right.....
    Regards,
    Rahul

  • TimeStamp in Stored Procedure for JDBC adapter

    Hi,
    I have a Date Timestamp field (DD/MM/YYYY HH:MM:SS) in my stored procedure (target system), how do I pass an empty value when there is no date coming from the source system.
    I am able to send the date field in the format when I get the date timestamp field in the source message but sometimes the date field will be empty in the source message, where in I have a issue to pass to stored procedure.
    Error details - java.sql.SQLException: ORA-01830: date format picture ends before converting entire input string ORA-06512: at line 1
    Thanks.
    Yeshwanth

    but sometimes the date field will be empty in the source message, where in I have a issue to pass to stored procedure.
    Why not to avoid creating the DATE field in the target when the source is empty or not present? Just make a check on the source field....check if it is not-blank and then only create the target node....if the source field is blank then the target wont be created and hence wont be inserted into the DB....check if this works for you.
    Also check the XML Schema Interpreter (Interpretation of Empty String Values) section from this help section:
    http://help.sap.com/saphelp_nw70/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/content.htm
    Regards,
    Abhishek.
    Edited by: abhishek salvi on Jul 16, 2010 3:23 PM

Maybe you are looking for

  • Itunes won't open: "the folder cannot be found or created ans is required"

    HELP! When I try to open my itunes a message occurs that states: The folder "itunes"cannot be found or created, and is required. The default location for this folder is inside the "my music" folder. When I click on the my documents/my music folder it

  • --- Windows 8.1 update - information page -- -- -- IMPORTANT ! -- --

    For all who update the system from Win 8 to Win 8.1. I found very interesting and useful information on Toshiba EU support page: I recommend checking this Toshiba Update to Windows 8.1 information page: [Update to Windows 8.1|http://www.toshiba.eu/in

  • "build EJB archive" context menu is disabled...

    hello, I changed java beans file, and tried to build jar file again, then the "build EJB archive" context menu is disabled so I can not make EJB jar file! So frustrated.. NWDS recognizes the changes in the java files , right? How come there 's no Bui

  • "A plugin is needed to display this content"

    I saw a a previous post with a similar problem (https://support.mozilla.org/en-US/questions/1008744?esab=a&as=aaq) , but it's not for the same sort of content, and the answers did not help me. I'm trying to view a virtual tour on a website, and I don

  • HELP!!My ibook won't boot (has nothing to do with the MAC OSX update)

    My preview, i photo, and all other picture galleries weren't working so i turned the computer off and when i tried to turn it back up it got to the grey screen with turning wheel but wouldnt go further even after an hour. Two questions: 1) is there a