Skip to content

Instantly share code, notes, and snippets.

@ddanielsantos
Last active February 14, 2022 17:54
Show Gist options
  • Save ddanielsantos/a28f2ae34e0a66ab60c6b532c4efd879 to your computer and use it in GitHub Desktop.
Save ddanielsantos/a28f2ae34e0a66ab60c6b532c4efd879 to your computer and use it in GitHub Desktop.
SAP Utilities
-- you must use this syntax to the trick work
-- youre going to select a variable based on the desired field
-- change the line 5 accordingly to your desired table
/* SELECT * FROM OITB x */
DECLARE @ItemGroup AS VARCHAR(MAX)
-- your variable from SAP becomes a SQL server variable
SET @ItemGroup = '%' + /* x.ItmsGrpNam */ [%0] + '%'
SELECT
*
FROM (
SELECT
T0.ItemName,
FROM
OITM T0
WHERE
T0.ItemName LIKE @ItemGroup
) AS TAB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment