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

Text in RTF Format

Former Member
0 Likes
1,542

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

4 REPLIES 4
Read only

former_member388485
Contributor
0 Likes
1,107

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

Read only

0 Likes
1,107

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

Read only

Former Member
0 Likes
1,107

solved.

Read only

Former Member
0 Likes
1,107

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