3 weeks ago
From query, some BP validFor and frozenFor fields show as 'N', however, if I refer to the BP Master Data, the BP is active. At the list of Business Partner, the "Active' field is also showing 'No'. Why it is so?
This is an old bug from SAP. Unfortunately there are no plans to resolve this issue. The correct field for the queries is frozenFor and not validFor.
SAP note on this:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
if you want it complete real icluding the dates you can make a function. It returns Y/N
USE [YOURNAME]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:
-- Create date:
-- Description: Check if Item/BP is active
-- =============================================
ALTER FUNCTION [dbo].[YOURNAME]
(
-- Add the parameters for the function here
@ValidFor CHAR(1)
,@ValidFrom DATE
,@ValidTo DATE
,@FrozenFor CHAR(1)
,@FrozenFrom DATE
,@FrozenTo DATE
,@Date DATE
)
RETURNS Char
AS
BEGIN
RETURN CASE
WHEN
(
@validFor = 'N' OR (
@validFrom IS NULL OR @validFrom <= (@Date)
)
AND
(@validTo IS NULL OR @validTo >= (@Date))
)
AND
(
@frozenFor = 'N' OR @frozenFrom IS NOT NULL
AND
@frozenFrom > (@Date) OR @frozenTo IS NOT NULL
AND
@frozenTo < (@Date)
)
THEN 'Y'
ELSE 'N'
END
END
--SELECT
--CardCode
-- , ValidFor
-- , ValidFrom
-- , ValidTo
-- , FrozenFor
-- , FrozenFrom
-- , FrozenTo
-- , GETDATE()
--,(SELECT [dbo].[YOURNAME] (ValidFor,ValidFrom , ValidTo, FrozenFor , FrozenFrom , FrozenTo, GETDATE() ))
--FROM
--OCRD
--WHERE CardCode = 'XXXX'
regards Lothar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OCRD.frozenFor = 'N' means the BP is "Active".
This is the field I commonly use to indicate if the BP is inactive, but it's backwards to what you think. IE, frozenFor = 'Y' is "Inactive".
Without seeing your database, maybe you have an active or inactive date range? But in general for query purposes I only use "frozenFor" (Y/N) as my inactive/active indicator.
Let me know if this makes sense,
M
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
106 | |
12 | |
10 | |
5 | |
5 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.