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: 

BDC program - how to save data for TEXT 'special fields'

Former Member
0 Kudos

Hi everyone. Need help for a special 'field' in a BDC program.

I've a BDC program for transaction MM01. My main question is how to save data for the fields for texts in views/tabs?

To illustrate (example for tcode MM01): under tab 'Purchase Order Text', this is the area where we input text messages (but area is larger than for the usual fields). This can also be seen in Sales Text, Basic Data Text.

There is no F1 help where I usually get the technical info for the names of tables/structures and-field. Hence, I do not know how to save this in BDC as there is no usual "table-field or structure-field" - where we save this from the screen in the abap syntax.

The error message and corresponding explanation from system is:

======================

No text maintained; a blank text has been created in English automatically

Message no. MM630

Diagnosis

For your convenience, a blank text has been created in the language English automatically.

Procedure

You can maintain this text. If you exit text maintenance without maintaining it, it will be deleted automatically.

================================

Q # 1: Where to maintain this text? Functional or technical? In which tcode?

Q # 2: How do I get the technical info (like from F1) for the table-field name or any where info for text can be saved.

Your inputs will be highly appreciated.

Thanks and God bless!

Celeste

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Celeste ,

You will have to save the text using the FM <b>SAVE_TEXT</b>

Regards

Arun

4 REPLIES 4

Former Member
0 Kudos

Hi Celeste ,

You will have to save the text using the FM <b>SAVE_TEXT</b>

Regards

Arun

0 Kudos

Thanks for your reply, Arun.

I checked out the function module SAVE_TEXT. What valid values should be supplied for the Parameters of the FM? Kindly give sample.

Thanks and God bless!

Celeste

0 Kudos

hi,,

save_text is used to upload the long text...u pass four parameters here one is the text name, which in the case of purchase order contains the order no + item no..text object EKPO, text id F01 and language sy-langu...this will do...to see, the corresponding values for any item, just go to the long text editor and go to-> header..you will find the values...append the long text taht you want to upload to the itab txtlines, which will be of structure tline...hope this helps

CONCATENATE P_EBELN P_ITEM INTO tname-tdname.

MOVE 'EKPO' TO TNAME-TDOBJECT.

MOVE 'F01 TO TNAME-TDID.

MOVE SY-LANGU TO TNAME-TDSPRAS.

APPEND TNAME

TXTLINES-TDFORMAT = '*'.

TXTLINES-TDLINE = 'This is your purchase order text'.

APPEND TXTLINES.

CLEAR TXTLINES.

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

CLIENT = SY-MANDT

HEADER = TNAME

INSERT = 'X'

SAVEMODE_DIRECT = 'X'

  • OWNER_SPECIFIED = ' '

  • LOCAL_CAT = ' '

IMPORTING

  • FUNCTION =

NEWHEADER = TNAME

TABLES

LINES = TXTLINES

  • EXCEPTIONS

  • ID = 1

  • LANGUAGE = 2

  • NAME = 3

  • OBJECT = 4

  • OTHERS = 5

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

*

if helpful, reward

Sathish. R

former_member186741
Active Contributor
0 Kudos

as others have pointed out you need to use fm SAVE_text to do this sort of thing.

The key parameters to pass are:

ID 'BEST'

NAME the material number with leading zeros to the ull 18 chars

OBJECT 'MATERIAL'

Try and use fm read_text for another materail which has such a text to get an idea...or put a break-point in 'read_text' and do MM03 on such a material.