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 Number | PERNR | Status |
|---|---|---|
| 1 | 001 | S "Request Created |
| 1 | 002 | A "Approved by T-Desk |
| 1 | 003 | P "Confirmed by cab vendor |
| ------------- | ------- | ------- |
| 2 | 001 | S "Request Created |
| 2 | 001 | C " Cancelled By Employee |
| -------------- | -------- | ----------- |
| 3 | 001 | S " Request Created |
| 3 | 002 | A " Approved By T-desk. |
| 3 | 003 | P "Confirmed by Cab vendor |
| ---------------- | ----------- | ------------ |
| 4 | 001 | S "Request Created |
| 4 | 002 | R "Request Rejected by T-Desk |
| --------------- | --------- | ------------ |
| 5 | 001 | S "Request Created by Employee |
| 5 | 002 | S "Approved by T-desk |
| 5 | 003 | P "Confirmed by Cab vendor |
| 5 | 001 | C "Cancelled By Employee |
| --------------- | ------------- | --------- |
| 6 | 001 | S "Request Created by Employee |
| 6 | 002 | S "Approved by T-desk |
| 6 | 003 | P "Confirmed by Cab vendor |
| 6 | 001 | C "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 .