Maybe simply
CREATE FUNCTION [dbo].[fnct_rpt_ActiveHC_WithoutGrp_tarun1]
(
@adid1 VARCHAR(25),
@number INT
)
RETURNS TABLE
AS
RETURN
SELECT *
FROM OD_SAP.dbo.ty_rpt_ActiveHC_WithoutGrp a
JOIN [BI_Control].[dbo].[tbl_BI_AccessMatrix_ADIDcc] b ON a.CostCode = b.cc
JOIN [BI_Control].[dbo].[tbl_BI_AccessMatrixMaster] C ON b.ADID = c.ADID AND C.IsActive = 1
WHERE @adid1 NOT IN ('tachakr','BEULA','NI345519')
OR (b.ADID = @adid1 AND b.ReportID = @number)
?