Is there a way use mapping table instead of hardcoding of values and their replacements?
mapping table
| value | replacement |
|---|---|
| N | Module Not turned In |
| PC | Pending Corrections |
LT_REVIEW_STATUS = SELECT DISTINCT A.PRUEFLOS,
CASE WHEN UPPER(A.KTEXTLOS) LIKE '%:N%' THEN 'Module Not turned In'
WHEN UPPER(A.KTEXTLOS) LIKE '%PC%' THEN 'Pending Corrections'
WHEN UPPER(A.KTEXTLOS) LIKE '%RC%' THEN 'Not yet reviewed'
WHEN UPPER(A.KTEXTLOS) LIKE '%:O%' THEN 'Close Out'
WHEN UPPER(A.KTEXTLOS) LIKE '%RV%' THEN 'Reviewed'
ELSE 'N/A' END AS REVIEW_STATUS
FROM :LT_FIRST_QALS A;
Thanks
This requirement can be fullfilled with a join to a reference table.
Given a reference table
CODE_LOOKUPthat looks like this:see the documentation for
LOCATEhttps://help.sap.com/docs/SAP_HANA_PLATFORM/4fe29514fd584807ac9f2a04f6754767/20e3b6b77519101485e6bd62f7018f75.html