07-10-2006 1:36 PM
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.
07-10-2006 1:39 PM
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
07-10-2006 1:39 PM
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
07-10-2006 1:41 PM
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.
07-10-2006 1:43 PM
Hi Sharath,
Could u plz giude me how to proceed?
THanks and regards.
vijay.
07-10-2006 1:53 PM
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
07-10-2006 2:12 PM
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.
07-10-2006 1:41 PM
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.
07-10-2006 1:41 PM
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
07-10-2006 2:07 PM
Hi,
Better to use FM's SAVE_TEXT/CREATE_TEXT followed by COMMIT_TEXT instead of BDC for long texts upload.
Regards
vijay
07-10-2006 2:15 PM
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.
07-10-2006 2:16 PM
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.
07-10-2006 2:52 PM
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.
07-10-2006 2:55 PM
Hi,
check the details i have given in my earlier post & links
too, which have how to use SAVE_TEXT function module
regards
srikanth
07-10-2006 6:58 PM
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.
07-10-2006 7:04 PM
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.
07-10-2006 7:04 PM
Which transaction is it? Can you not find a suitable BAPI for the purpose?