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: 

Handling long text in bdc

Former Member
0 Kudos

Hi,

I need to handle a long text of around 500 characters in my BDC. I uploaded the text from excel sheet into my internal table.

Now, i need to update this long text.

What procedure should i follow inorder to upload this long text into my bdc?

Any help in this regard will be greatly apprciated.

thanks

vijay.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi u have to use function modules

save_text

identify the target long text name and ID and pass it to the function modules save_text to create the long text

Or try with Creat_text.

If useful reward points.

Regards,

Vasanth

15 REPLIES 15

Former Member
0 Kudos

hi u have to use function modules

save_text

identify the target long text name and ID and pass it to the function modules save_text to create the long text

Or try with Creat_text.

If useful reward points.

Regards,

Vasanth

Former Member
0 Kudos

cannot record long text using BDC, so once the BDC for a particular transaction is complete, then read the contents of the created file from database then use function module SAVE_TEXT to upload long text. you cannot upload long text using BDC.

0 Kudos

Hi Sharath,

Could u plz giude me how to proceed?

THanks and regards.

vijay.

0 Kudos

what transaction are you doing BDC ? for any TEXT, we will have

TEXT OBJECT

ID

LANGUAGE

NAME.

for example : PO header text, SHIPPING instructions text,

these are the details,

Text Name 4500127478

Language EN

Text ID F00 SX Shipping Instructions

Text object EKKO Purchasing doc. header texts

here is the way to find out

goto-> texts -> select which text you want- > then select SAP SCRIPT EDITOR -> THEN you will see a script editor screen there, goto->header ->

here you will see all those above details.

these 4 details you have to give in the program to save the text in the transaction for a particular text.

here is the way to do this in program

DATA : LV_NAME TYPE THEAD-TDNAME,

LV_TEMP(128) TYPE C .

*--assign the above fetched values to the below fields.

LV_NAME = 'may be delivery/salesorder/po no "

X_HEADER-TDOBJECT = 'VBBK'.

X_HEADER-TDNAME = LV_NAME . "P_DELV_NO.

X_HEADER-TDID = 'ZMAN'.

X_HEADER-TDSPRAS = 'E'.

LOOP AT IT_TEXT .

LV_TEMP = it_text-line.

"assume my text is stored in IT_TEXT-LINE.

IT_TLINES-TDFORMAT = '*'.

IT_TLINES-TDLINE = LV_TEMP.

APPEND IT_TLINES.

CLEAR IT_TLINES.

ENDLOOP.

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

CLIENT = SY-MANDT

HEADER = X_HEADER

SAVEMODE_DIRECT = 'X'

TABLES

LINES = IT_TLINES

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

OBJECT = 4

OTHERS = 5.

IF SY-SUBRC <> 0.

*--ERROR.

ELSE.

*--SUCCESFULLY STORED your long text in the transaction

ENDIF.

revert, if you need any further help on this.

regards

srikanth

check the below links to get some more knowledge,

Message was edited by: Srikanth Kidambi

Message was edited by: Srikanth Kidambi

0 Kudos

Hi,

Thanks for providing me information. But I need some more guidence from u.

I need to handle long text in the BDC. There are around 40,000 records which need to updated. I am not maintaining a seperate it_table for long text.

All fields are maintained in the it_flat table.

Former Member
0 Kudos

You need to split the 500 character text in to 7 variables of 72 character each and in your BDC after you go the long text screen update the text as below:

PERFORM bdc_fld USING 'RSTXT-TXPARGRAPH(02)' '/'.

PERFORM bdc_fld USING 'RSTXT-TXLINE(02)' text1.

PERFORM bdc_fld USING 'RSTXT-TXPARGRAPH(03)' '/'.

PERFORM bdc_fld USING 'RSTXT-TXLINE(03)' text2.

PERFORM bdc_fld USING 'RSTXT-TXPARGRAPH(04)' '/'.

PERFORM bdc_fld USING 'RSTXT-TXLINE(04)' text3.

PERFORM bdc_fld USING 'RSTXT-TXPARGRAPH(05)' '/'.

PERFORM bdc_fld USING 'RSTXT-TXLINE(05)' text4.

PERFORM bdc_fld USING 'RSTXT-TXPARGRAPH(06)' '/'.

PERFORM bdc_fld USING 'RSTXT-TXLINE(06)' text5.

PERFORM bdc_fld USING 'RSTXT-TXPARGRAPH(07)' '/'.

PERFORM bdc_fld USING 'RSTXT-TXLINE(07)' text6.

PERFORM bdc_fld USING 'RSTXT-TXPARGRAPH(08)' '/'.

PERFORM bdc_fld USING 'RSTXT-TXLINE(08)' text7.

Alternatively you could use the function SAVE_TEXT to upload the long text.

-Kiran

*Please mark useful answers.

Former Member
0 Kudos

You should use SAVE_TEXT followed by COMMIT_TEXT to update the long texts of the business documents.

Regards,

Ravi

Note : Please mark all the helpful answers

former_member188685
Active Contributor
0 Kudos

Hi,

Better to use FM's SAVE_TEXT/CREATE_TEXT followed by COMMIT_TEXT instead of BDC for long texts upload.

Regards

vijay

0 Kudos

Hi vijay,

So, i need to write seperate prg for handling long text.

If so, could u please giude me how to proceed and plz send me the code.

Thanks.

Former Member
0 Kudos

its okay if you have only file for long text and other data, store the long text data in another internal table and other fields which will allow you to link it to the document (ref_key or count).

Logic will be.

loop at itab. (having normal data).

do bdc recording for other fields.

call transaction 'XXXX'.

if sy-subrc eq 0.

find out the name of document created.

call FM 'SAVE_TEXT'and pass the text data stored in other itab.

COMMIT WORK.

endif.

endloop.

0 Kudos

Hi,

This is first time I am using this func module could u plz guide me how to use this func module.

Because what i observed is every time the textid is changing.

thanks.

vijay.

0 Kudos

Hi,

check the details i have given in my earlier post & links

too, which have how to use SAVE_TEXT function module

regards

srikanth

Former Member
0 Kudos

Hi,

how can i get dynamically the text name. I donot have any prb using func module 'SAVE_TEXT' but i am unable to assing textname which is dynamically varying.

thanks.

vijay.

0 Kudos

When you call the transaction, it should be returning you some kind of document number or something depending on what you are creating. Read the return messages (that are returned to you through bdcmsgcoll structure) and form the text name from there.

As an example...

call transaction xxxx messages i_bdcmsgcoll.

read table i_bdcmsgcoll index 1.

textname = i_bdcmsgcoll-msgv1.

Former Member
0 Kudos

Which transaction is it? Can you not find a suitable BAPI for the purpose?