Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

SP para maestro de artículos

Hola todos,

Estoy creando un SP para el maestro de articulos para que no me creen un artículo nuevo sin la unidad de medida, pero no he podido encontrar el ObjType de la tabla OITM.

JUAN CAMILO

Former Member
Former Member replied

Corregido

IF @object_type = '4' AND @transaction_type IN ('A','U') 
BEGIN
IF EXISTS(SELECT T0.InvntryUom 
		FROM OITM T0
		WHERE T0.ItemCode= @list_of_cols_val_tab_del AND (T0.InvntryUom NOT IN ('UND','KG','MT','LT') OR T0.InvntryUom IS NULL))
BEGIN
	SELECT @error = -2000, @error_message = 'SP:Ingrese Unidad de medida de inventario valida'
END 
ELSE
IF EXISTS(SELECT T0.BuyUnitMsr
		FROM OITM T0
		WHERE T0.PrchseItem='Y' AND T0.ItemCode= @list_of_cols_val_tab_del AND (T0.BuyUnitMsr NOT IN ('UND','KG','MT','LT') OR T0.BuyUnitMsr IS NULL))
BEGIN
	SELECT @error = -3000, @error_message = 'SP:Ingrese Unidad de medida de compras valida'
END
ELSE
IF EXISTS(SELECT T0.SalUnitMsr
		FROM OITM T0
		WHERE T0.SellItem='Y' AND T0.ItemCode= @list_of_cols_val_tab_del AND (T0.SalUnitMsr NOT IN ('UND','KG','MT','LT')OR T0.SalUnitMsr IS NULL))
BEGIN
	SELECT @error = -4000, @error_message = 'SP:Ingrese Unidad de medida de ventas valida'
END
END

Slds

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question