Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] 'OR' statement doesn't work properly.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] 'OR' statement doesn't work properly.
 Login/Join
 
Platinum Member
posted
This is my join. I join VBAK with VBFA, VBAK with VBUK and then join VBFA with LIKP
  
JOIN
 LEFT_OUTER SAP_VBAK.VBAK.VBAK_VBELN IN SAP_VBAK TO MULTIPLE
 SAP_VBFA.VBFA.VBFA_VBELV IN SAP_VBFA TAG J0 AS J0
 END
JOIN
 LEFT_OUTER SAP_VBAK.VBAK.VBAK_VBELN IN SAP_VBAK TO MULTIPLE
 SAP_VBUK.VBUK.VBUK_VBELN IN SAP_VBUK TAG J1 AS J1
 END
JOIN
 LEFT_OUTER SAP_VBFA.VBFA.VBFA_VBELN IN SAP_VBFA TO MULTIPLE
 LIKP.LIKP.LIKP_VBELN IN SAP_VBUK TAG J2 AS J2
 END
TABLE FILE SAP_VBAK
PRINT 
     SAP_VBAK.VBAK.VBAK_VBELN
     J1.VBUK.VBUK_LFSTK
     J1.VBUK.VBUK_GBSTK
     J2.LIKP.LIKP_WADAT_IST
WHERE ( J1.VBUK.VBUK_LFGSK NE 'C' ) OR ( J1.VBUK.VBUK_GBSTK NE 'C' );
END

The issue I got is when I used OR to filter record from VBUK, I got the correct result.
EX : Output I got
  
   VBELN    LFSTK   GBSTK   WADAT_IST
   1111     A       C       
   2222     C       B    

But if I used 1 more OR with LIKP, I will not get those records ( 1111 and 2222) which suppose to be there.
  
WHERE ( J1.VBUK.VBUK_LFGSK NE 'C' ) OR ( J1.VBUK.VBUK_GBSTK NE 'C' ) OR (J2.LIKP.LIKP.WADAT_IST EQ '');

For me, It sounds like I only can use OR in one table. Anybody has suggestion for me. Thanks.

This message has been edited. Last edited by: hainguyen,


WebFOCUS 7.7.03
Windows, All Outputs
 
Posts: 125 | Registered: June 17, 2013Report This Post
Virtuoso
posted Hide Post
This may be related with dealing with a MISSING segment on J2 on not really with the number of OR's in your filter.

You're using LEFT_OUTER joins so I assume you expect records on either J1 or J2 to not exist for a given VBAK_VBELN. Try to test on J2.LIKP.LIKP.WADAT_IST EQ '' may be forcing the whole record to be excluded due to a missing segment on that end.

SET ALL=PASS is terrific at dealing with cases like that *if* you were dealing with FOCUS files but doesn't always help when using DBMS tables.

What happens if you do this instead? :

WHERE ( J1.VBUK.VBUK_LFGSK NE 'C' ) OR ( J1.VBUK.VBUK_GBSTK NE 'C' ) OR (J2.LIKP.LIKP.WADAT_IST EQ MISSING);

This message has been edited. Last edited by: njsden,



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Platinum Member
posted Hide Post
Thanks njsden. This is awesome. SET ALL=PASS solved the problem but I still have to use J2.LIKP.LIKP.WADAT_IST EQ ''.


WebFOCUS 7.7.03
Windows, All Outputs
 
Posts: 125 | Registered: June 17, 2013Report This Post
Virtuoso
posted Hide Post
Hmmm, isn't that interesting?



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Platinum Member
posted Hide Post
My bad, I did the wrong test. Both J2.LIKP.LIKP.WADAT_IST EQ '' and J2.LIKP.LIKP.WADAT_IST EQ MISSING work. Thanks and happy valentine.


WebFOCUS 7.7.03
Windows, All Outputs
 
Posts: 125 | Registered: June 17, 2013Report This Post
Virtuoso
posted Hide Post
So, you are using FOCUS files.

When you use SQL tables, don't forget to issue:
SET SHORTPATH=SQL


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] 'OR' statement doesn't work properly.

Copyright © 1996-2020 Information Builders