Skip to Content
0

Purchase Quotation Update Query on Agreement.

May 06, 2017 at 04:08 PM

58

avatar image

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)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Danilo Kasparian May 06, 2017 at 08:10 PM
0

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.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

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

0
Nagarajan K May 14, 2017 at 09:30 AM
0

Hi,

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

Regards,

Nagarajan

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Nagarajan,

How does above query effect on my database? Please let me know.

0

I can see Update command in your stored procedure. Please refer SAP note,

2371729 - Data modification guidelines when customizing SAP Business One

0