Application Development 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: 

making approval note uneditable in mm module

Former Member
0 Kudos

Dear all , i want to make approval note uneditable after writing text and saving it in Tcode ME29n. while doing so note is saved in non editable mode but user date and time is asved in editable mode . i have used enhancement in include LMMTEF01 and LMMTEF08.

LMMTEF01:IF SY-UCOMM = 'MESAVE' .

wa_Save = sy-ucomm.

export wa_Save to MEMORY ID 'ZSV'." Exporting the Value as soon as Save Is clicked

endif.

if GT_CONTROL-CURRENT_NODE = 'F33' or GT_CONTROL-CURRENT_NODE = 'B20'.

  • Exporting the chagned value so that the tag line should only appear at the time of saving

clear: w_ltexttile.

read TABLE GT_CONTROL-textlines_ch into w_ltexttile with key TDID = 'F33'.

if sy-subrc = 0.

L_TEXTLINE_TEMP[] = GT_CONTROL-textlines_ch[].

export L_TEXTLINE_TEMP[] to MEMORY ID 'TCH'.

if GT_CONTROL-textlines_ch[] is not INITIAL.

CALL FUNCTION 'BAPI_USER_GET_DETAIL'

EXPORTING

USERNAME = sy-uname

IMPORTING

ADDRESS = l_addr

TABLES

RETURN = l_return.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X' .

  • IMPORTING

  • RETURN =

  • .

l_date0(2) = sy-datum6(2).

l_date+2(1) = '.'.

l_date3(2) = sy-datum4(2).

l_date+5(1) = '.'.

l_date6(4) = sy-datum0(4).

clear: l_tag.

write: sy-uzeit to l_time USING EDIT MASK '__.__.__'.

  • CONCATENATE l_date l_time 'Changed By:' l_addr-FULLNAME '(' sy-uname ')' into l_tag

CONCATENATE l_date l_time ':' l_addr-FULLNAME into l_tag

SEPARATED BY space.

  • * Appending A Tag Line at the End of the Textline

w_ltexttile-TDID = 'F33'.

w_ltexttile-TDFORMAT = '*'.

w_ltexttile-TDOBJECT = 'EKKO'.

w_ltexttile-TDLINE = l_tag.

DESCRIBE TABLE GT_CONTROL-textlines_ch LINES count .

READ TABLE GT_CONTROL-textlines_ch into w_ltexttile_t index count .

if sy-subrc = 0 and w_ltexttile_t-TDID = 'F33'.

if w_ltexttile_t-TDLINE is INITIAL.

insert w_ltexttile INTO GT_CONTROL-textlines_ch index count.

modify GT_CONTROL INDEX 1.

  • if count is not INITIAL.

  • count_t = count - 1.

  • else.

  • count_t = count.

  • endif.

  • MODIFY GT_CONTROL-textlines_ch from w_ltexttile index count_t.

  • modify GT_CONTROL INDEX 1.

else.

count = count + 1.

insert w_ltexttile INTO GT_CONTROL-textlines_ch index count.

modify GT_CONTROL INDEX 1.

endif.

count = count + 1.

CALL METHOD gt_control-editor_handle->protect_lines

EXPORTING

from_line = 1

protect_mode = 0"TRUE

to_line = count

enable_editing_protected_text = cl_gui_textedit=>false

  • EXCEPTIONS

  • error_cntl_call_method = 1

  • invalid_parameter = 2

  • others = 3

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

endif.

endif.

IF SY-UCOMM = 'MECHECKDOC'.

L_UCOMM = SY-UCOMM.

export L_UCOMM to MEMORY ID 'UCO'.

elseIF SY-UCOMM = 'METOGG' OR SY-UCOMM = 'MECHOB'.

FREE MEMORY ID 'UCO'.

endif.

else.

  • * Exporting the chagned value so that the tag line should only appear at the time of saving

clear: w_ltexttile.

read TABLE GT_CONTROL-textlines_ch into w_ltexttile with key TDID = 'B20'.

if sy-subrc = 0.

L_TEXTLINE_TEMP[] = GT_CONTROL-textlines_ch[].

export L_TEXTLINE_TEMP[] to MEMORY ID 'TCH'.

if GT_CONTROL-textlines_ch[] is not INITIAL.

CALL FUNCTION 'BAPI_USER_GET_DETAIL'

EXPORTING

USERNAME = sy-uname

IMPORTING

ADDRESS = l_addr

TABLES

RETURN = l_return.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X' .

  • IMPORTING

  • RETURN =

  • .

l_date0(2) = sy-datum6(2).

l_date+2(1) = '.'.

l_date3(2) = sy-datum4(2).

l_date+5(1) = '.'.

l_date6(4) = sy-datum0(4).

clear: l_tag.

write: sy-uzeit to l_time USING EDIT MASK '__.__.__'.

  • CONCATENATE l_date l_time 'Changed By:' l_addr-FULLNAME '(' sy-uname ')' into l_tag

CONCATENATE l_date l_time ':' l_addr-FULLNAME into l_tag

SEPARATED BY space.

  • * Appending A Tag Line at the End of the Textline

w_ltexttile-TDID = 'B20'.

w_ltexttile-TDFORMAT = '*'.

w_ltexttile-TDOBJECT = 'EBANH'.

w_ltexttile-TDLINE = l_tag.

DESCRIBE TABLE GT_CONTROL-textlines_ch LINES count .

READ TABLE GT_CONTROL-textlines_ch into w_ltexttile_t index count .

if sy-subrc = 0 and w_ltexttile_t-TDID = 'B20'.

if w_ltexttile_t-TDLINE is INITIAL.

if count is not INITIAL.

count_t = count - 1.

else.

count_t = count.

endif.

MODIFY GT_CONTROL-textlines_ch from w_ltexttile index count_t.

modify GT_CONTROL INDEX 1.

else.

count = count + 1.

insert w_ltexttile INTO GT_CONTROL-textlines_ch index count.

modify GT_CONTROL INDEX 1.

endif.

endif.

endif.

IF SY-UCOMM = 'MECHECKDOC'.

L_UCOMM = SY-UCOMM.

export L_UCOMM to MEMORY ID 'UCO'.

elseIF SY-UCOMM = 'METOGG' OR SY-UCOMM = 'MECHOB'.

FREE MEMORY ID 'UCO'.

endif.

endif.

endif.

endif.

  • for making the approvers note word/text editor display only

if sy-ucomm = 'METEXTHEED'.

if GT_CONTROL-CURRENT_NODE = 'F33' .

read table GT_CONTROL-TEXTTYPES into wa_texttypes with key TDOBJECT = 'EKKO'

TDID = 'F33'.

if sy-subrc = 0.

wa_texttypes-displaymode = C_X.

Modify GT_CONTROL-TEXTTYPES from wa_texttypes index sy-tabix .

modify GT_CONTROL index 1.

endif.

endif.

endif.

1 REPLY 1

Former Member
0 Kudos

Dear all , i want to make approval note uneditable after writing text and saving it in Tcode ME29n. while doing so note is saved in non editable mode but user date and time is asved in editable mode . i have used enhancement in include LMMTEF01 and LMMTEF08.