cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Code Text Reading Issue in SAP CDS View

huny
Explorer
0 Kudos
201

Hello Guru!

In Custom Fields and Logic, custom Code and TEXT were added as shown below.
And I posted it with a custom code in the Accounting journal entry app. I also confirmed that the corresponding code was saved in the I_GLACCOUNTLINEITEMRAWDATA table (CDS view).

huny_0-1721785874330.pnghuny_1-1721785883771.png


In a custom development report that reads the I_GLACCOUNTLINEITEMRAWDATA table (CDS view)
I want to read the text corresponding to the custom code.

It cannot be read because the API State is Cannot be set.

huny_2-1721785934298.png

YY1_ACTIVITYCODE_W

huny_3-1721785946594.png

huny_4-1721785958645.png


Please help me with how to read the text of Custom Code.

thank you

Huny

OwenLiu
Product and Topic Expert
Product and Topic Expert
Added Finance tag.

Accepted Solutions (1)

Accepted Solutions (1)

Meghana
Product and Topic Expert
Product and Topic Expert

Hi,

For the input value in custom field on an Accounting Document (I_GLACCOUNTLINEITEMRAWDATA), to read the corresponding description, please try sample code in this manner:

SELECT SINGLE Description

FROM YY1_ACTIVITYCODE_W

INTO @DATA(lv_desc)

WHERE Code = @LS_glaccountlineitemrawdata-yy1_activitycode_cob AND Language = ‘EN’.

 

ls_glaccountlineitemrawdata is a single item data structure from Accounting Document.

Instead of hardcoding EN, you can also try to extract logon user language or please check in the custom development, if user language is available.

 

Best regards,

Meghana

Answers (0)