Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8581

Re: How to check the two logic at a single statement for a particular filed in a table using 'WHERE' ?

$
0
0

Really Thanks to all of you.. I tried with all of your suggestion but still i couldn't get it. I am very sorry if i am unable to understand the logic itself. Here i have stated my request clearly Please help me to find the solution .

 

 

Cab Request NumberPERNRStatus
1001S   "Request Created
1002A    "Approved by T-Desk
1003P   "Confirmed by cab vendor
---------------------------
2001S   "Request Created
2001C   " Cancelled By Employee
---------------------------------
3001S    " Request Created
3002A   " Approved By T-desk.
3003P   "Confirmed by Cab vendor
---------------------------------------
4001S  "Request Created
4002R  "Request Rejected by T-Desk
------------------------------------
5001S  "Request Created by Employee
5002S  "Approved by T-desk
5003P  "Confirmed by Cab vendor
5001C  "Cancelled By Employee
-------------------------------------
6001S  "Request Created by Employee
6002S  "Approved by T-desk
6003P  "Confirmed by Cab vendor
6001C  "Cancelled By Employee

 

 

Here i need to fetch list of cab service utilized by the employee, That is cab request number ( 1,3 ) only.

 

I used following statements to perform this process.

 

 

*  WHERE stats  in ('P') and stats not in ('C').

*  WHERE STATS NE 'C' AND STATS EQ 'P'.

*  WHERE STATS EQ 'P' AND STATS NE 'C'.

*  WHERE STATS EQ 'P' or STATS ne 'C'.

*  WHERE STATS EQ 'P' AND STATS not LIKE 'C'.

*  WHERE  stats NOT IN ('A', 'S', 'D', 'S', 'T', 'C').

*  WHERE stats = 'P' and ( stats <> 'C' and stats = 'P' ).

*  WHERE stats LIKE '%P%' and stats NOT LIKE '%C%'.

*  WHERE stats LIKE 'P%' and stats NOT LIKE 'C%'.

*  WHERE stats LIKE '%P' and stats NOT LIKE '%C'.

*  WHERE stats IN it_stats.

 

 

But these are not return expected result. It returns cab request number ( 1, 3, 5, 6 ).

 

 

Request number 5 and 6 are approved by vendor but again it has cancelled by employee So i don't want to include this request under utilized list.

 

In actual coding i have used DYNAMIC WHERE CONDITION, It has already done but this cancellation of after confirmation is their new requirement Moreover i am very new to SAP , This is my first opportunity to work  in SAP project , Now i have used  DELETE STATEMENT to remove the Cancelled request. It is working fine but i feel there is a solution to fetch only status = s and status <> c .


Viewing all articles
Browse latest Browse all 8581

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>