Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Reading text behind infotypes via table TRMAC

Former Member
0 Kudos

I'm looking for coding to read the text behind infotypes that are stored in tabel TRMAC. Can someone help me on (a part off) the coding to retrieve these data ?

We know we need to use the macro RP-IM-C1-TX.

Kind regards, Anne-Marie van Gool

2 REPLIES 2

Former Member
0 Kudos

Hi,

Use function READ_TEXT.

Set a break-point in this function module then display a text of an infotype you want. You will then be able to see what parameters you need to provide to the function.

Cheers

Colin

0 Kudos

Unfortunately you can't use the function read_text since the HR texts are stored in the PCL1(TX) cluster.

Anne-Marie, as you mentioned you can use the rp-imp-c1-tx macro (or otherwise use IMPORT FROM DATABASE direct).

Following a small example of how to read and update the text behind IT0048:

if not gs_0048o-itxex is initial. "Check if text is stored

move-corresponding gs_0048o to tx-key.

move '0048' to tx-key-infty.

rp-imp-c1-tx.

p_subrc = sy-subrc.

...

move-corresponding gs_0048n to tx-key.

move '0048' to tx-key-infty.

  • rp-exp-c1-tx.

export text-version ptext

to database pcl1(tx)

id tx-key.

p_subrc = sy-subrc.

The first example (read) uses the RMAC macro, the second (write) uses EXPORT TO DATABASE direct. Beware of the fact, that the flag in the Infotype (here itxex) doesn't get updated accordingly so if you "insert" a new text you also have to update the flag in the corresponding Infotype.

Regards

Roger