O'Reilly logo

Mastering SQL Queries for SAP Business One by Gordon Du

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Some example queries for this SP

Within this book, you have already found quite a few example queries. There is no exception in this chapter. I do believe query by example is one of the most efficient ways to learn queries.

Case 1—Blocking an outgoing payment for a specific BP

A user is trying to block outgoing payments (Object 46) for a specific Business Partner for some reason by using the following SP:

IF (@Object_Type = '46') AND (@transaction_type in (N'A', N'U'))
BEGIN
IF EXISTs (SELECT T0.[DocEntry] FROM OVPM T0 WHERE
T0.[DocEntry] = @list_of_cols_val_tab_del and T0.CardCode = 'V0271')
BEGIN
SET @error = 10
SET @error_message = N'Block BP'
END
END

However, this SP blocks all outgoing payments for all BP Codes. What is the problem with this ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required