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

Adding Texts in BDC

Former Member
0 Likes
1,201

Hi Friends,

I have created sales order using BDC. Now I want to include the texts in the header data. How can I include the item texts in BDC? can anyone send me sample code if available.

Raj.

7 REPLIES 7
Read only

Former Member
0 Likes
952

Hi Raj,

You cannot achieve that using BDC.

Instead use, 'SAVE_TEXT' function module.

Regards,

Vamsi

Read only

0 Likes
952

Find out what text object/id that the long text uses in that particular transaction. You can view text objects/id in transaction code SE75. Then use SAVE_TEXT to save the long text to the object/id.

Regards,

Rich Heilman

Read only

0 Likes
952

Hi Vamshi,

I've already created a BDC program for the sales order. Can't I call this function module in my BDC program?

Raj.

Read only

0 Likes
952

Hi Raj,

Check this link for adding structure to ur program.

http://help.sap.com/saphelp_erp2005/helpdata/en/fa/0970a4543b11d1898e0000e8322d00/frameset.htm

Hope this helps u,

Regards,

Nagarajan.

Read only

Former Member
0 Likes
952

Hi,

there are 2 function modules, which we use to read text & save the text.

1. READ_TEXT

for this you have to pass the below fields to the fm

ID

LANGUAGE

NAME

OBJECT

and you will get already stored text for this ID into the LINES internal table.

the above values for ID,NAME,OBJECT etc. you can find in the transaction.

for example: for delivery,goto header-> texts -> select the text you want to proceed ->select DETAIL ->

you will see a new screen .there in the menu GOTO -> header .

here you can find all the required fields to pass to the function module.

2. SAVE_TEXT

for this what data you have to process first store in LINES internal table.but remember this function module will overwrite existing text,if it exists.so first get the records by using READ_TEXT . append ur lines to that then finally call this FM.

SAVEMODE_DIRECT set this field to X ,sothat changes will reflect immediately.

NOTE: dont call SAVE_TEXT directly, this will over write existing text,if any there.so first call Read_text & then append ur new text to this & finally call save_text sothat this will not disturb any existing texts.

place this function modules call after checking sy-subrc = 0.

i.e. call transaction success, then populate this text & store it .

Read only

Former Member
0 Likes
952

Or you could bypass the BDC all together and use the BAPI - BAPI_SALESORDER_CREATEFROMDAT2. It has text(s) tables that you can fill and it will create the text as you create the order.

Good luck!

Terry

Read only

0 Likes
952

What you would do is do the BDC first, make sure that it is successful by checking sy-subrc, then call the save_text function module giving the object/id/name and the text to be saved.

Regards,

Rich Heilman