cancel
Showing results for 
Search instead for 
Did you mean: 

CRM TABE field SCAPPTSEG-TXT_PUB_ID Field in a HANA Calculation View

anup_deshmukh4
Active Contributor

Hello Experts,

We are trying to consume SCAPPTSEG-TXT_PUB_ID in a calculation view. SAP CRM System

The field stores a duration Values ( Value in DB looks like DUR####MINUTE LX##### )img-1.png.

When I am writing a plane SQL Query I am getting the attached img-2.png

We are unable to convert ( Duration type )those to Output.

The ABAP Code to do the same conversion is as below :

REPORT ZTEST11.
   data ls_duration_rule type crmt_date_duration_as_rule.
    data: zpub_id type scapptseg.
    FIELD-SYMBOLS: <xvalue> type x,
                   <xcontainer> type x.
    BREAK-POINT.
    select single * from scapptseg into zpub_id where APPT_TYPE = 'ZSLA_DUR_RGP' and
APPL_GUID = '005056970E361EE987BF12660CA873EB'.
      assign ls_duration_rule to <xvalue> casting.
      assign zpub_id-txt_pub_id          to <xcontainer> casting.
      <xvalue> = <xcontainer>.
      write: ls_duration_rule-duration.

Thanks and Regards,

Anup D

View Entire Topic
thalesvb
Active Contributor
0 Kudos

Hello anup.deshmukh4,

Your answer is in your own question: you should implement in your view a decoding logic for TXT_PUB_ID, like the one in your code snippet. Standard decodes it too when displaying in UI.