cancel
Showing results for 
Search instead for 
Did you mean: 

Updating long text in BP of type ORG through ELM

Former Member
0 Kudos

Hi,

I have an requirement to update BP of type ORG with the long text .

I have added 3 fields TDID TDID

TDSPRAS CRMT_MKTLIST_BU_LANG

TDLINE CRM_PRT_DATA_FIELD in CRMT_MKTLIST_ORG_EXT structure .

What coding I need to do in CRM_MKTLIST_BADI.

Thanks in advance.

Best Regards

Basav

Edited by: Basavaraj Kumbar on Mar 6, 2012 11:32 AM

Accepted Solutions (1)

Accepted Solutions (1)

ajaya_kumar
Active Participant
0 Kudos

Hi Basav,

The field TDLINE CRM_PRT_DATA_FIELD, you are using for Notes (long text) has length 132 Chars, instead you can use TDLINE TYPE CRMT_NOTE_TEXT which has 255 Chars.

You are supposed to add long text in both scenario i.e. Create and Update so my suggestion would be to create a private method ADD_LONG_TEXT with following implementation:


*  Add Notes to BP

* Add long text to BP only if there is no error in processing uptill now.

   CHECK NOT iv_notes IS INITIAL AND lv_error <> 'X'.

   DATA: notes           TYPE string,
         lt_lines        TYPE comt_text_lines_t,
         ls_header       TYPE thead,
         lines           TYPE tline.

   notes = iv_notes.

   CALL FUNCTION 'CONV_TEXTSTRING_TO_ITF'
     EXPORTING
       iv_textstring = notes
     IMPORTING
       et_itf        = lt_lines.

   ls_header-tdid     = '0001'. " I have hard coded text type you can pass it thru file
   ls_header-tdspras  = 'EN'. " I have hardcoded the language you can pass it thru file
   ls_header-tdname   = iv_bp.
   ls_header-tdobject = 'BUT000'.


   CALL FUNCTION 'SAVE_TEXT'
     EXPORTING
       header          = ls_header
       insert          = 'I'
       savemode_direct = 'X'
     TABLES
       lines           = lt_lines
     EXCEPTIONS
       id              = 1
       language        = 2
       name            = 3
       object          = 4
       OTHERS          = 5.

   IF sy-subrc = 0.

   ENDIF.

Now, you need to call this method inside CREATE_ORGANIZATION and UPDATE_ORGANIZATION passing the required data to this method.

Note: If you pass more than 255 Chars to the field for long text it would give you an error at mapping stage. You can write the mapping rule code to get first 255 Chars in case more than 255 Chars is passed.

Regards

Ajay

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ajay,

Its solved,I used BUPA_EXECUTE_LONGTEXT function module

Anyway,Thanks for your reply and time.

Best Regards

Basav