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

Data from text editor

Former Member
0 Likes
784

Hi,

Im trying to write a BDC for the PR05 transaction (create trip data). The screen has a 'Comments' tab that does not get recorded while executing the SHDB transaction.

I used the class C_TEXTEDIT_CONTROL to set the data from the comments tab into the R/3 table PCL1. The code looks like this -

CONSTANTS: TEXT_LINE_LENGTH TYPE I VALUE 72.

DATA: TEXT_EDITOR TYPE REF TO C_TEXTEDIT_CONTROL.

DATA: TEXT_REPID LIKE SY-REPID value 'SAPMP56T'.

DATA: TEXT_CONTAINER(30) TYPE C VALUE 'EDITOR_TEXT'.

DATA: TEXT_CONTROL_DYNNR LIKE SY-DYNNR VALUE '1315'.

DATA : I_LINEITEM1 LIKE PTP71 OCCURS 3.

DATA : wa_lineitem LIKE PTP71.

move 'test comments' to wa_lineitem-EDITOR_TEXT.

append wa_lineitem to i_lineitem1.

CREATE OBJECT TEXT_EDITOR

EXPORTING

REPID = TEXT_REPID

DYNNR = TEXT_CONTROL_DYNNR

DYNPRO_CONTAINER = TEXT_CONTAINER

WORDWRAP_MODE =

C_TEXTEDIT_CONTROL=>WORDWRAP_AT_FIXED_POSITION

WORDWRAP_POSITION = TEXT_LINE_LENGTH

WORDWRAP_TO_LINEBREAK_MODE =

C_TEXTEDIT_CONTROL=>TRUE.

  • EXCEPTIONS

  • OTHERS = 1.

  • CH_SUBRC = SY-SUBRC.

call method text_editor->set_text_as_r3table

exporting

table = I_LINEITEM1

exceptions

others = 1.

On executing the BDC, data is added to the PCL1 table, however, when I see the trip data through PR05 transaction, the comments tab is empty.

I think there is something wrong with the parameters I am passing for the constructor of the TEXT_EDITOR object but I'm unable to figure it out.

Would appreciate any ideas on how to go about this.

Regards,

Rohini

4 REPLIES 4
Read only

Former Member
0 Likes
676

I think what you are learning is that BDC does NOT support controls like the textedit control. Controls are supported at the frontend, for example, the GUI running on a PC, and because they require the GUI frontend to execute, they are not supported in BDC.

Your best bet is to try an find a BAPI to meet your needs. You can use tran BAPI to search for an appropriate BAPI or maybe another SDNer can post which BAPI to use.

Let us know how it goes.

Read only

Former Member
0 Likes
676

Hi,

See if you can get access to eCATT. Use it to create a recording. It supports BDC for controls installed in user desktop.

Regards

Read only

0 Likes
676

Yes ECATT supports the Controls but executing an ECATT script requires a GUI frontend. That implies a user invoking the script. If you can live with that, go for it.

ECATT is available in 4.7 and can be installed in 4.6C via a support package. You can access it via tran SECATT.

Read only

0 Likes
676

Hello,

eCATT requires Web AS 6.20 upwards as a server system.

It can test function modules and TCD down to release 4.6C.

In that sense, you cannot "install" eCATT on a 4.6C system; eCATT connects to a 4.6C system via RFC.

Regards,

Marc