‎2008 Feb 13 12:40 PM
Hi all,
I am creating a sales activity by using FM BAPI_BPCONTACT_CREATEFROMDATA. it works fine and returns sales activity number.
Now i want to enter text with sales activity, when i am using this , it gives an error that text is not in rtf format.
Suggess how to solve it.
Thanks
Sanket sethi
‎2008 Feb 26 1:20 PM
Hi,
Convert the text to rtf format.
You can use Function module: CONVERT_ITF_TO_RTF or in older versions CONVERT_TEXT.
for example:
DATA temp_itf TYPE tline OCCURS 0.
DATA temp_rtf TYPE tline OCCURS 0.
DATA: temp_text LIKE text,
converted_text LIKE text OCCURS 0.
DATA line TYPE tline.
LOOP AT text.
CLEAR temp_itf.
APPEND text-text_line TO temp_itf.
MOVE-CORRESPONDING text TO temp_text.
CALL FUNCTION 'CONVERT_TEXT'
EXPORTING
* CODEPAGE = '1133'
* DIRECTION = 'EXPORT'
* FORMAT_TYPE = 'RTF'
* FORMATWIDTH = 72
* HEADER = ' '
* SSHEET = ' '
* WITH_TAB = ' '
* WORD_LANGU = SY-LANGU
tabletype = 'BIN'
* TAB_SUBSTITUTE = 'X09 '
* LF_SUBSTITUTE = ' '
* REPLACE_SYMBOLS = 'X'
* REPLACE_SAPCHARS = 'X'
* MASK_BRACKETS = 'X'
* IMPORTING
* NEWHEADER =
* WITH_TAB_E =
* FORMATWIDTH_E =
TABLES
foreign = temp_rtf
itf_lines = temp_itf
* LINKS_TO_CONVERT =
.
LOOP AT temp_rtf INTO temp_text-text_line.
APPEND temp_text TO converted_text.
ENDLOOP.
ENDLOOP.
CALL FUNCTION 'BAPI_BPCONTACT_CREATEFROMDATA'
EXPORTING
sender = ''
* TESTRUN = ' '
TABLES
generaldata = generaldata
* GENERALDATAX =
businesspartner = businesspartner
* BUSINESSPARTNERX =
* PARTNERADDRESS =
text = converted_text
* OBJECT_REFERENCE_LIST =
* return = return
.Best regards,
Avishai Zamir
‎2009 Feb 02 12:48 PM
Hi Avishai Zamir,
same thing i have written in code, but it is giving dump saying that.
example : Invalid partial field access: Length is too large
"RTF_SET_FORMAT"
will it work if we write like this for this bapi
Thanks & Regards
Murali Papana
‎2009 Apr 27 12:30 PM
‎2009 Apr 27 12:31 PM
Stop bumping your old not-followed-up threads by writing useless comments. The Comment Box while closing the thread is to post a solution. If you do not want to/do not know the sloution, you can skip that box. Its not mandatory.
By bumping old threads back into the queue without providing any solution, you are only messing up the forum.
pk