on 03-06-2012 10:32 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ajay,
Its solved,I used BUPA_EXECUTE_LONGTEXT function module
Anyway,Thanks for your reply and time.
Best Regards
Basav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.