on 2020 Mar 27 3:19 AM
I want to save text from some custom control.
when I double cllick column SO Comm Head, will appears modal dialog box for edit and save text (text header and text item).
the problem is i can't save both of text. and this my code
CASE SY-UCOMM.
WHEN 'SAVE'.
* REFRESH gi_dis_longtext.
CALL METHOD gv_text_editor->get_text_as_r3table
* EXPORTING
* ONLY_WHEN_MODIFIED = TRUE
IMPORTING
table = gi_dis_longtext
* IS_MODIFIED = IS_MODIFIED
EXCEPTIONS
error_dp = 1
error_cntl_call_method = 2
error_dp_create = 3
potential_data_loss = 4
OTHERS = 5.
IF sy-subrc = 0.
REFRESH it_lines .
LOOP AT gi_dis_longtext INTO gw_dis_longtext.
it_lines-tdformat = '/'.
it_lines-tdline = gw_dis_longtext-tdline.
APPEND it_lines.
ENDLOOP.
ENDIF.
IF it_lines[] IS INITIAL.
it_lines-tdformat = '*'.
it_lines-tdline = ''.
APPEND it_lines.
ENDIF.
CALL METHOD cl_gui_cfw=>flush
EXCEPTIONS
cntl_system_error = 1
cntl_error = 2
OTHERS = 3.
gv_header-tdname = wa_selected-vbeln.
gv_header-tdid = 'ZCOM'.
gv_header-tdobject = 'VBBK'.
gv_header-tdspras = sy-langu.
CLEAR p_name_i.
CONCATENATE wa_selected-vbeln wa_selected-posnr INTO p_name_i.
gv_header_i-tdname = p_name_i.
gv_header_i-tdid = 'ZCOM'.
gv_header_i-tdobject = 'VBBP'.
gv_header_i-tdspras = sy-langu.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
client = sy-mandt
header = gv_header
* INSERT = ' '
savemode_direct = 'X'
* OWNER_SPECIFIED = ' '
* LOCAL_CAT = ' '
* IMPORTING
* FUNCTION =
* NEWHEADER =
TABLES
lines = it_lines
EXCEPTIONS
id = 1
language = 2
name = 3
object = 4
OTHERS = 5.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
client = sy-mandt
header = gv_header_i
* INSERT = ' '
savemode_direct = 'X'
* OWNER_SPECIFIED = ' '
* LOCAL_CAT = ' '
* IMPORTING
* FUNCTION =
* NEWHEADER =
TABLES
lines = it_lines
EXCEPTIONS
id = 1
language = 2
name = 3
object = 4
OTHERS = 5.
IF sy-subrc EQ 0.
PERFORM f_clear_data.
MESSAGE s398(00) WITH 'Save Succeded' DISPLAY LIKE 'S'.
SET SCREEN 0.
ELSE.
MESSAGE s398(00) WITH 'Error when saving data to database' DISPLAY LIKE 'E'.
ENDIF.
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
Dear Saddam
Your perform routines
PERFORM f_read_text USING p_name_i 'ZCOM' 'VBBP', PERFORM f_read_text USING p_name_i 'ZCOM' 'VBBK'' are storing the results in same it_lines[].
(either refreshing or appending it).
So, please use different it_lines for each header and items and then save appropriatly.
Regards,
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
sure ase Venkat suggest it also i would give it a try.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you have to different calls.
One with gv_header one with gv_header_i.
But it_lines is same variable/value passed two times?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
53 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.