Skip to Content
avatar image
Former Member

Purchase Quotation Update Query on Agreement.

pq-update.jpg

Hi Experts,

Can anyone help me to write a query for updating purchase quotation row (AgrNo) while adding/updating purchase blanket agreement.?

I have a field 'Purchase Quote' in Purchase Blanket Agreement. While adding/updating Purchase Blanket Agreement, i want to update the purchase quotation row (agrno) with agreement No.

Please help me to achieve this.

pq-update.jpg (222.8 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • May 06, 2017 at 08:10 PM

    You can't do it using query. I meant, you can, but it goes against SAP "rules", you will need to do it by SDK.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Danilo, Thanks for reply.

      I am using below query to update quotation on agreement through stored procedure. This is working fine for me.

      Does it effect on database??

      IF @Object_type = '1250000025' and @transaction_type = 'U'

      BEGIN
      declare @AgrNo int
      declare @AbsID nvarchar(20)
      Begin

      Declare UP_QTN_AGR cursor FOR
      (
      Select T0.AbsID from OOAT T0
      where T0.Series = '27'
      and T0.Status = 'A'
      and T0.BpType = 'S'
      And T0.U_PQNo is not null And T0.AbsID = @list_of_cols_val_tab_del
      )

      open UP_QTN_AGR
      FETCH UP_QTN_AGR INTO @AbsID
      WHILE @@FETCH_STATUS = 0

      begin

      declare @PQNr int
      select @AgrNo = T0.AbsID, @PQNr = T0.U_PQNo from OOAT T0 where T0.AbsID = @list_of_cols_val_tab_del


      --updating quotation with agreement no.
      UPDATE PQT1
      SET AgrNo = @AgrNo
      WHERE [DocEntry] = (
      select distinct x.DocEntry from PQT1 x inner join OPQT y on x.DocEntry = y.DocEntry
      where y.DocNum = @PQNr
      )

      FETCH UP_QTN_AGR INTO @AbsID

      end

      close UP_QTN_AGR

      DEALLOCATE UP_QTN_AGR

      End

      END

  • May 14, 2017 at 09:30 AM

    Hi,

    Yes , It will affect your database. As per SAP, update/insert/delete any SAP table against SAP support policy.

    Regards,

    Nagarajan

    Add comment
    10|10000 characters needed characters exceeded