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: 

Dynamic Actions

Former Member
0 Kudos

Hi,

Can anybody send some sample code for inserting and reading long text into and from an infotype.

Appreciate.

Thanks.

Kavitha

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Please find the sample code for both below.

Inserting the text:

TABLES : pernr, pcl1, pcl2.

INFOTYPES : 0672.

*Data: gs_0672 TYPE STANDARD TABLE of pskey with header line.

INCLUDE rpppxd00.

DATA : BEGIN OF COMMON PART buffer.

INCLUDE rpppxd10.

DATA : END OF COMMON PART buffer.

INCLUDE rpc1tx00.

INCLUDE rpppxm00.

GET pernr.

UPDATE pa0672 SET itxex = 'X' WHERE pernr = pernr-pernr.

LOOP AT p0672.

MOVE-CORRESPONDING p0672 TO tx-key.

REFRESH ptext.

ptext-line = 'THIS IS A TRAIL INSERT INSERT INTO INFOTYPE TEXT1'.

APPEND ptext.

rp-exp-c1-tx.

ENDLOOP.

PERFORM prepare_update USING 'V'.

Reading long text:

tx-key-pernr = p0008-pernr.

tx-key-infty = p0008-infty.

tx-key-subty = p0008-subty.

*tx-key-OBJPS

*tx-key-SPRPS

tx-key-endda = p0008-endda.

tx-key-begda = p0008-begda.

tx-key-seqnr = p0008-seqnr.

rp-imp-c1-tx.

IF NOT ptext[] IS INITIAL.

READ TABLE ptext INDEX 1.

IF sy-subrc = 0.

MOVE ptext-line TO gt_data-comments.

ENDIF.

ENDIF.

Hope it helps.

Venu

1 REPLY 1

Former Member
0 Kudos

Hi,

Please find the sample code for both below.

Inserting the text:

TABLES : pernr, pcl1, pcl2.

INFOTYPES : 0672.

*Data: gs_0672 TYPE STANDARD TABLE of pskey with header line.

INCLUDE rpppxd00.

DATA : BEGIN OF COMMON PART buffer.

INCLUDE rpppxd10.

DATA : END OF COMMON PART buffer.

INCLUDE rpc1tx00.

INCLUDE rpppxm00.

GET pernr.

UPDATE pa0672 SET itxex = 'X' WHERE pernr = pernr-pernr.

LOOP AT p0672.

MOVE-CORRESPONDING p0672 TO tx-key.

REFRESH ptext.

ptext-line = 'THIS IS A TRAIL INSERT INSERT INTO INFOTYPE TEXT1'.

APPEND ptext.

rp-exp-c1-tx.

ENDLOOP.

PERFORM prepare_update USING 'V'.

Reading long text:

tx-key-pernr = p0008-pernr.

tx-key-infty = p0008-infty.

tx-key-subty = p0008-subty.

*tx-key-OBJPS

*tx-key-SPRPS

tx-key-endda = p0008-endda.

tx-key-begda = p0008-begda.

tx-key-seqnr = p0008-seqnr.

rp-imp-c1-tx.

IF NOT ptext[] IS INITIAL.

READ TABLE ptext INDEX 1.

IF sy-subrc = 0.

MOVE ptext-line TO gt_data-comments.

ENDIF.

ENDIF.

Hope it helps.

Venu