P_IN_CUSTOMERGSTHEALTHCHECK is a Composite CDS View in SAP S/4HANA. It reads from 3 data sources (I_IN_CustomerGSTHlthChkList, I_Customer, I_CustomerCompany) and exposes 13 fields with key fields CompanyCode, Customer, IN_GSTHlthChkCategory, IN_GSTHealthCheck.
Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.
-- Derived SQL interpretation of CDS view P_IN_CUSTOMERGSTHEALTHCHECK.-- Reconstructed from parsed metadata (data sources, associations, fields).-- SAP annotations are omitted and the structure is reformulated as SQL;-- this is a functional approximation, not the verbatim SAP source. Some join-- conditions may be unavailable and a few CDS constructs are kept as-is.CREATE VIEW P_IN_CUSTOMERGSTHEALTHCHECK ASSELECT
I_CustomerCompany.CompanyCode AS CompanyCode,
I_CustomerCompany.Customer AS Customer,
CustMasterCheckList.IN_GSTHlthChkCategory AS IN_GSTHlthChkCategory,
CustMasterCheckList.IN_GSTHealthCheck AS IN_GSTHealthCheck,
I_CustomerCompany._CompanyCode.CompanyCodeName AS CompanyCodeName,
I_Customer.CustomerFullName AS CustomerFullName,
I_Customer._CustomerToBusinessPartner._BusinessPartner.BusinessPartner AS BusinessPartner,
CustMasterCheckList.IN_GSTHlthChkCatFldName AS IN_GSTHlthChkCatFldName,
CustMasterCheckList.IN_GSTHealthCheckCatDesc AS IN_GSTHealthCheckCatDesc,
replace_regexpr( pcre => abap.sstring'[A-Za-z0-9]', value => CustomerTaxNumber.TaxNumber3, with => abap.char'Z', result_length => abap.int1'15' ) AS TaxNumber3,
casewhen CustMasterCheckList.IN_GSTHlthChkCategory = abap.char'001' and CustMasterCheckList.IN_GSTHealthCheck = abap.char'00001' and IN_UndefinedCustomerSalesTax.CustomerTaxCategory isnulland CustomerTaxNumber.TaxNumber3 is initial then abap.char'X' when CustMasterCheckList.IN_GSTHlthChkCategory = abap.char'001' and CustMasterCheckList.IN_GSTHealthCheck = abap.char'00002' and IN_UndefinedCustomerSalesTax.CustomerTaxCategory isnulland CustomerTaxNumber.TaxNumber3 isnot initial and CustomerTaxNumber.IN_GSTLegalStateCode isnot initial and substring(CustomerTaxNumber.TaxNumber3, 1, 2 ) <> CustomerTaxNumber.IN_GSTLegalStateCode then abap.char'X' when CustMasterCheckList.IN_GSTHlthChkCategory = abap.char'001' and CustMasterCheckList.IN_GSTHealthCheck = abap.char'00003' and IN_UndefinedCustomerSalesTax.CustomerTaxCategory isnulland CustomerTaxNumber.TaxNumber3 isnot initial and length(CustomerTaxNumber.TaxNumber3) <> abap.int1'15' then abap.char'X' when CustMasterCheckList.IN_GSTHlthChkCategory = abap.char'001' and CustMasterCheckList.IN_GSTHealthCheck = abap.char'00004' and IN_UndefinedCustomerSalesTax.CustomerTaxCategory isnulland I_Customer.TaxNumber3 isnot initial and length(CustomerTaxNumber.TaxNumber3) = abap.int1'15' and TaxNumber3 <> abap.char'ZZZZZZZZZZZZZZZ' then 'X' when CustMasterCheckList.IN_GSTHlthChkCategory = abap.char'002' and CustMasterCheckList.IN_GSTHealthCheck = abap.char'00001' and CustomerTaxNumber.IN_GSTLegalStateCode isnullthen abap.char'X' when CustMasterCheckList.IN_GSTHlthChkCategory = abap.char'003' and CustMasterCheckList.IN_GSTHealthCheck = abap.char'00001' and I_Customer.OrganizationBPName1 is initial then abap.char'X' when CustMasterCheckList.IN_GSTHlthChkCategory = abap.char'004' and CustMasterCheckList.IN_GSTHealthCheck = abap.char'00001' and IN_UndefinedCustomerSalesTax.CustomerTaxCategory isnot initial and IN_UndefinedCustomerSalesTax.CustomerTaxClassification is initial then abap.char'X' when CustMasterCheckList.IN_GSTHlthChkCategory = abap.char'005' and CustMasterCheckList.IN_GSTHealthCheck = abap.char'00001' and IN_UndefinedCustAddrSalesTax.CustomerTaxCategory isnot initial and IN_UndefinedCustAddrSalesTax.CustomerTaxClassification = abap.char'' then abap.char'X' else abap.char'' endas IN_CustHasGSTHlthChkErr AS charendasIN_CustHasGSTHlthChkErr,
casewhen CustMasterCheckList.IN_GSTHlthChkCategory = abap.char'001' thencast( CustomerTaxNumber.TaxNumber3 as abap.char (100) ) when CustMasterCheckList.IN_GSTHlthChkCategory = abap.char'002' thencast( CustomerTaxNumber.IN_GSTLegalStateCode as abap.char (100) ) when CustMasterCheckList.IN_GSTHlthChkCategory = abap.char'003' thencast( I_Customer.OrganizationBPName1 as abap.char (100) ) when CustMasterCheckList.IN_GSTHlthChkCategory = abap.char'004' thencast( IN_UndefinedCustomerSalesTax.CustomerTaxClassification as abap.char (100) ) when CustMasterCheckList.IN_GSTHlthChkCategory = abap.char'005' thencast( IN_UndefinedCustAddrSalesTax.CustomerTaxClassification as abap.char (100) ) elsecast( abap.char'' as abap.char (100) ) endas IN_GSTHlthChkCatFldVal AS char100endasIN_GSTHlthChkCatFldVal,
CustMasterCheckList.IN_GSTHlthChkCrrtnStp AS IN_GSTHlthChkCrrtnStp
FROM I_CustomerCompany
INNERJOIN I_Customer ON /* join condition not captured in parsed metadata */
CROSSJOIN I_IN_CustomerGSTHlthChkList AS CustMasterCheckList
;