Skip to Content

How to get value of class attribute

Jul 25, 2017 at 12:04 PM


avatar image

Hi All,

How can i get value of class attribute?


i try like this:

but not assing.

Can you help me please?

          field-symbols: <var> type text_lh."any
          data: class_name(30) type c,
                class_var(30)  type c,
                class_ref(100) type c.
          class_name = 'CL_SCMG_SP_CASE_NOTES_BACKEND'.
          class_var  = 'GT_NEW_TEXTS'.

          concatenate class_name '=>' class_var into class_ref.
          assign (class_ref) to <var>.
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Łukasz Pęgiel Jul 25, 2017 at 12:56 PM

If you'd like to get GT_NEW_TEXTS then you would need to use one of existing methods from interface IF_SCMG_SP_CASE_NOTES_BACKEND or you can create a sub-class which inherits from CL_SCMG_SP_CASE_NOTES_BACKEND and then you can create a method to read/update of GT_NEW_TEXTS.

That's all without knowing the place where you'd like to fetch it.

Show 3 Share
10 |10000 characters needed characters left characters exceeded


I can get saved notes like this.

i want to check and control notes before save.

so,i dont catch buffer notes.

UDM_DC_NOTES_GET function not work for my issue.

  data: lr_case_api type ref to if_scmg_case_api,
        lr_case     type ref to if_scmg_case.
  data  lt_notes type text_lh.
  data: lt_text_data type text_lh.

          lr_case_api  ?= cl_scmg_case_api=>get_case( caseguid ).

          data: l_notes type ref to  if_scmg_sp_case_notes_backend.
          data: l_case          type ref to if_scmg_case_api.

          call method lr_case_api->get_backend_notes
              re_notes_backend = l_notes
              failed           = 1
              others           = 2.

In if_scmg_sp_case_notes_backend you have methods to get or change texts. Have you tried them?



i can get the notes.but recorded notes.not get the runtime notes(before save).

Horst Keller
Jul 25, 2017 at 12:08 PM
Show 3 Share
10 |10000 characters needed characters left characters exceeded


I tried the following code.But GT_NEW_TEXTS not assing.GT_NEW_TEXTS is protected attribute.

i can see value {O:1695*\CLASS=CL_SCMG_SP_CASE_NOTES_BACKEND}-GT_NEW_TEXTS when i paste on the debug tool.

       DATA(class_name) = 'CL_SCMG_SP_CASE_NOTES_BACKEND'.
        DATA(attr_name) =  'GT_NEW_TEXTS'.
        ASSIGN (class_name)=>(attr_name) TO FIELD-SYMBOL(<fs1>).

c2.png (9.0 kB)

"GT_NEW_TEXTS is protected attribute"

Well, then why do you ask?


"GT_NEW_TEXTS is protected attribute",

It is not assigned for this reason.