cancel
Showing results for 
Search instead for 
Did you mean: 

Hiding selective fields in a report based on other field in the same report

Former Member
0 Kudos

Hello!

I am trying to create a report of the inventory items. 2 of the fields in the report would be the sale price of the item, and one of the properties (prop1) from the Item Master Property tab.

Depending on whether Prop1 is Y/N, the price of the item should be displayed.

If Prop1 = N, Price is displayed

If Prop1 = Y, Price gets hidden

Using queries, is it possible to create this kind of reports?

I am using SAP 2005b PL 42.

Thanks for any suggestions....

Prajwal

Accepted Solutions (1)

Accepted Solutions (1)

former_member583013
Active Contributor
0 Kudos

Hello Prajwal,

It is definely possible !!

If you have already created your query pls paste the same here so that I can help you otherwise. I will give you a general guidelines and you can take it from there..

Using the CASE Statement inside your SELECT you can achieve this.

SELECT T1.ItemCode AS 'Item No.', T1.ItemName AS 'Item Description', 
CASE WHEN  T1.QryGroup1 = 'N' THEN T0.Price ELSE 0 END 'List Price' 
FROM  [dbo].[ITM1] T0  INNER  JOIN [dbo].[OITM] T1  ON  T1.ItemCode = T0.ItemCode   WHERE T0.PriceList = 1

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Prajwal,

If you don't need complete item show 0 price, an alternaive could be just displayimg the price list for those part of items with Prop1 set to 'Y':


SELECT T1.ItemCode, T1.ItemName, T0.Price 
FROM  [dbo].[ITM1] T0  
INNER  JOIN [dbo].[OITM] T1 ON T1.ItemCode = T0.ItemCode and T1.QryGroup1 = 'Y'
WHERE T0.PriceList = 1

Thanks,

Gordon

Former Member
0 Kudos

Thanks Suda!

That seems to have worked! I'll report back in case I need further help to this.

Thanks again!

Prajwal