Bismillah..
When you have to get or set text object, then you have to know ID, OBJECT, NAME, LANGUAGE of that text object. How do we know? This is my way to get text attributes
In this example, let’s open material master tcode -> MM03 , and go to any tab that have text object inside.

And then go to SE37 , set breakpoint at the first line of statement of function module READ_TEXT

Back to your MM03, and click any tab until the screen has changed, and then click again the previous tab.
Debug screen should be popping up to your screen. Let’s take a look at variable ID , LANGUAGE , NAME, OBJECT .

And there is it how you can get the text attributes.
I think that’s all. Thank you for reading.
See you