Skip to Content

Error in scripted calculation view

Hi Experts

Below is my code

 
 /********* Begin Procedure Script ************/ 
 BEGIN 
 	 var_out = CE_COLUMN_TABLE("SAPABAP1"."STXL",


             [    "SRTF2" ,
                  "CLUSTR",
                  "TDNAME",
                  CONVERT ("CLUSTD" USING utf8) AS "CONVERTED_TEXT" ]);


END /********* End Procedure Script ************/

I am trying to decode the value stored in table - STXL,field- CLUSTD but i am experiencing the following error

Message : Repository: Encountered an error in repository runtime extension;Model inconsistency. Deploy Calculation View: SQL: sql syntax error: incorrect syntax near "USING": line 9 col 32 (at pos 422) Set Schema DDL statement: set schema "SYSTEM" Type DDL: create type "_SYS_BIC"."TEST/CLV_SCRIPTED_CONVERT_TEXT/proc/tabletype/VAR_OUT" as table ("SRTF2" SMALLINT, "CLUSTR" SMALLINT, "TDNAME" NVARCHAR(70), "CLUSTD" BLOB) Procedure DDL: create procedure "_SYS_BIC"."TEST/CLV_SCRIPTED_CONVERT_TEXT/proc" ( OUT var_out "_SYS_BIC"."TEST/CLV_SCRIPTED_CONVERT_TEXT/proc/tabletype/VAR_OUT" ) language sqlscript sql security definer reads sql data as /********* Begin Procedure Script ************/ BEGIN var_out = CE_COLUMN_TABLE("SAPABAP1"."STXL", [ "SRTF2" , "CLUSTR", "TDNAME", CONVERT ("CLUSTD" USING utf8) AS "CONVERTED_TEXT" ]); END /********* End Procedure Script ************/

Please help me in this.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • May 01 at 12:47 AM

    Using CE_-function has been dis-encouraged now for years. Also, you're using a wrong syntax for it.

    The CONVERT function doesn't show up in my HANA reference documentation - it's just not a function that you can use there.

    CLUSTD is a binary encoded text field from ABAP systems.

    Just do the minimum search here on SCP and you'll find plenty discussions how to deal with this. Hint: it's not simply "convert to UTF-8".

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Indrajit,

      There is no option in HANA to decode CLUSTD into a readable format.

      Write an ABAP code either in ECC or in SLT to decode the Hexadeciaml into readable format.

      I would prefer using ABAP keyword IMPORT instead of using FM: READ_TEXT, since FM executes for reach record which is performance intensive

      Please refer this blog for more details

      Regards,

      Nag