Application Development and Automation 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: 
Read only

Write Cluster TX (PCL1)

Former Member
0 Likes
4,476

Hi,

i would like to create/change an it 0040 (objects on loan) without using PA 30 or Batch-Input. I would prefer to use HR_INFOTYPE_OPERATION. But i can not handover the textlines given in It 0040 ( can i ???? ).

It is not a problem to read the texts from the infotype with i.e. HRWPC_RFC_IT0XXX_TEXT_GET or rp-imp-c1-tx.

But how can i write back the infotype data ? When i use rp-exp-c1-tx (with correct pskey) it seems like the cluster does no longer refer to the infotype and all textlines in it 0040 are blank.

Does anybody know how to write the cluster tx and fill the textlines in it 0040.

1 ACCEPTED SOLUTION
Read only

FredericGirod
Active Contributor
0 Likes
3,135

I do like this :

data begin of common part cluster_edinition.

include rprstr00.

include rpc1te00.

include mp56tt99.

date end of common part.

you must set the data to the te-key (the key of the PCL1 table).

and the macro rp-exp-c1-te-my. (see include RPC1TE00)

Rgd

Frédéric

Message was edited by: Frédéric Girod

12 REPLIES 12
Read only

suresh_datti
Active Contributor
0 Likes
3,135

Hi Thomas,

try this..

1. set the field ITXEX to 'X' using HR_INFOTYPE_OPERATION

2. use rp-exp-c1-tx (with correct pskey)to update the text.

Good Luck,

Suresh Datti

P.S. Ignore this reply.. I thought you were trying to enter long texts on the infotype

Message was edited by: Suresh Datti

Read only

0 Likes
3,135

Hi Suresh Datti,

well, yes, i want to enter long texts on the infotype.

I tried to set itxex = X, but it also didn't work.

(There is no entry in Table PCL1 after i created the infotype)

I have no idea how to get a text on the textfield of the infotype because i do not see a possibility to handover the text. (Of course i tried to modify table ptext before i called rp-exp-c1-tx)

Read only

0 Likes
3,135

Hi Thomas,

Any specific reason why you are not inclined to go with the BDC?

Suresh Datti

Read only

FredericGirod
Active Contributor
0 Likes
3,136

I do like this :

data begin of common part cluster_edinition.

include rprstr00.

include rpc1te00.

include mp56tt99.

date end of common part.

you must set the data to the te-key (the key of the PCL1 table).

and the macro rp-exp-c1-te-my. (see include RPC1TE00)

Rgd

Frédéric

Message was edited by: Frédéric Girod

Read only

0 Likes
3,135

have you tried this?

CALL METHOD cl_hrpa_text_cluster=>update

EXPORTING

tclas = 'A'

pskey = pskey

no_auth_check = 'X'

IMPORTING

text_tab = text.

Good luck,

Suresh Datti

Read only

0 Likes
3,135

Hi Thomas,

the following piece of code worked for me. I was able to update the text on an existing record.

*************

report zp0040_tst .

data: i0040 like p0040 occurs 0 with header line.

data: pskey like pskey.

data: subrc like sy-subrc.

data: text type hrpad_text_tab.

data: asset_rec like line of text.

call function 'HR_READ_INFOTYPE'

exporting

pernr = '9802'

infty = '0040'

begda = '20051201'

endda = '20051231'

importing

subrc = subrc

tables

infty_tab = i0040

exceptions

infty_not_found = 1

others = 2.

pskey = i0040.

asset_rec = 'line1'.

append asset_rec to text.

asset_rec = 'line2'.

append asset_rec to text.

asset_rec = 'line3'.

append asset_rec to text.

call method cl_hrpa_text_cluster=>update

exporting

tclas = 'A'

histo = space

pgmid = space

pskey = pskey

no_auth_check = 'X'

text_tab = text.

**************************

Good Luck,

Suresh Datti

Read only

0 Likes
3,135

Hi Suresh,

almost perfect. But unfortunately it works only once. Means: if you change an existing record, the textlines are shown on the infotype. but if you change the asset_rec (coding) lines and write a different text and run the program again, all textlines are space and not updated. i would appreciate if you can try this, too, and tell me how it works on your system when you run the program twice for the same record. nevertheless thanks a lot for your effort.

Thomas

Amazing: when i use HR_READ_INFOTYPE and afterwords HRWPC_RFC_IT0XXX_TEXT_GET, the textlines are shown in ptext as written in your asset_rec-coding. but: the lines are not shown on the infotype. it seems like the infotype looses the reference to the updated cluster.

Message was edited by: Thomas

Read only

0 Likes
3,135

Hi Thomas,

I just ran three consecutive tames.. each time with a diff text and the record got updated every single time..

Are you using the exact same code or did you make nay changes?

Suresh Datti

Read only

0 Likes
3,135

Hi, the following coding works well on 4.7:

TRY.

CALL METHOD cl_hrpa_text_cluster=>update

EXPORTING

tclas = 'A'

pskey = pskey

histo = space

pgmid = ' '

text_tab = text

no_auth_check = 'X'.

CATCH cx_hrpa_missing_authorization .

CATCH cx_hrpa_violated_assertion .

ENDTRY.

But now i have to install my program on a 4.6C System where class CL_HRPA_TEXT_CLUSTER does not exist. Any idea how to update cluster tx when a IT0040-record was modified by function HR_INFOTYPE_OPERATION ?

regards

Thomas

by the way: rp-exp-c1-tx doesn't work.

Read only

0 Likes
3,135

Hi Thomas,

You have to copy the code in the 'UPDATE' method of this class into your custom Program in the 46c system..

ie the following..

pcl1-histo = histo.

pcl1-uname = uname.

pcl1-aedtm = aedtm.

pcl1-pgmid = pgmid.

EXPORT

text-version FROM version

ptext FROM text_tab

TO DATABASE pcl1(tx) ID pskey

FROM pcl1.

******************************************

Good Luck,

Suresh Datti

Read only

0 Likes
3,135

Yes, that's it. It works.

Thanks a lot !!!!

Read only

0 Likes
3,135

I am glad it worked.. PL close the thread..

Suresh Datti