cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP - Parameterized CDS - Casting the input field

thyagab
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

I have CDS to fetch data from table PLMM_AUDIT with parameter as GUID (key field).

In the UI, I pass only External format of the GUID, but that External format is not accepted by the CDS. It always expects Internal format.

How to solve this issue. Any suggestion.

Thanks,

Thiyagarajan

aoyang
Contributor

What is the UI you are displaying the data? Is it Data preview in Eclipse or SE16N/SE16H in SAP GUI?

Please also share your CDS view code.

Föß
Active Participant
0 Kudos

Hi,

what do you mean with external / internal format of a guid? Do you mean guid raw 16 and guid char 32?

lgf

thyagab
Product and Topic Expert
Product and Topic Expert
0 Kudos

johann.fleitner2

yes it is guid field.

Accepted Solutions (0)

Answers (3)

Answers (3)

alexandra_belova
Employee
Employee
0 Kudos

is this a custom CDS view? You can use funtction bintohex for converting RAW16 into CHAR32. I created a small example and it works fine with char32 incoming parameter:

define view ZI_PLMM_AUDIT as select from plmm_audit {

key client as Client,

key bintohex( guid ) as Guid,

...

}

define view ZI_PLMM_AUDIT_PARAMETER

with parameters p_guid : abap.char( 32 )

as select from ZI_PLMM_AUDIT {

key Guid,

...

} where Guid = $parameters.p_guid

If this is a standard CDS view please provide the name.
aoyang
Contributor
0 Kudos

thyagab1984

If the data is displayed via SE16N/SE16H, conversion exit(CONVERSION_EXIT_PLMAM_INPUT/OUTPUT) in the GUID domain PLM_AUDIT_GUID_AUD is triggered and convert internal value to external value.

If the data is displayed in the backend via ADT in Eclipse, no conversion exit is triggered and thus if you preview the data, GUID is in the internal value.

Now in your case it's Fiori KPI report so I assume your report is custom analytical query by consuming CDS view in the form of Cube/Query. If you do preview the data on those Cube/Query in ADT, I think it's still internal format, thus on Fiori it displays the same data without triggering conversion exit.

I think to meet your requirement, it's worth a try creating Odata from the CDS and consume it as custom Fiori UI5 app. I see in my Odata published from CDS(VBAK data), the Odata contents show the SO number(VBELN) value in external format.

thyagab
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi aocheng

,This is a FIORI KPI Report Thanks.