Changing the description of the standard SAP fields

本文介绍如何在SAP系统中更改客户主数据字段的描述,例如将“Telebox”字段的描述更改为“MobileNo”,以更好地适应业务需求。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

By Madhavi

Consider the following scenario:<?XML:NAMESPACE PREFIX = O />

When entering the customer master details, we have the provision for entering the telephone number with extension, fax and telebox. Assume that we also need to enter the mobile number of the customer for which there is no provision. Also assume that we do not use telebox for any of our customers and want to use that field for entering the mobile number. Though you can directly enter the mobile number in the field “telebox” , the description ‘telebox’ always misguides us. See the screenshot below:

change1.jpg

This tutorial focuses on changing the field descriptions for scenarios similar to above.

All the short-descriptions for the fields are retrieved from the data element level of the corresponding fields. So we need to change the descriptions at the data-element level.

So our first step is to know the data element used for the field “Telebox”. Press F1 and then F9 to know the data element. See the screenshot below:

change2.jpg

Make a note of the data element.

Now go to transaction CMOD

change3.jpg

Click on Goto à Text enhancements à Keywords à Change

change4.jpg

Enter the data element.

change5.jpg

Click enter. The following screen would appear:

change6.jpg

Now change the descriptions as per the requirement. See the screenshot below:

change7.jpg

Click on save.

Now to verify the changes, go to SE11 and enter the table name ADDR1_DATA. Check the short description for the field EXTENSION2:

change8.jpg

Also go to transaction XD01 / XD02 and check the field:

change9.jpg

The description “Telebox” is now changed to “Mobile No”.
<!-- google_ad_client = "pub-1086451200925480"; google_alternate_color = "0000FF"; google_ad_width = 336; google_ad_height = 280; google_ad_format = "336x280_as"; google_ad_type = "text"; //2007-04-05: 336 x 280 google_ad_channel = "5227776827"; google_color_border = "FFFFFF"; google_color_bg = "FFFFFF"; google_color_link = "000000"; google_color_text = "000000"; google_color_url = "008000"; //--> window.google_render_ad();
report zz . tables : ekko, ekpo. data : gt_ekko type standard table of ekko, "po header gs_ekko type ekko, gt_ekpo type standard table of ekpo, "po item gs_ekpo type ekpo. "varaibles data : gv_ebelp type ekpo-ebelp, gv_max_ebelp type ekpo-ebelp. "for dynamic table field-symbols : <dyn_table> type table, <dyn_wa> type any, <dyn_field> type any, <fs1>. * Create the dynamic internal table *data : NEW_TABLE TYPE REF TO DATA, * NEW_LINE TYPE REF TO DATA. data: fieldname(20) type c, fieldvalue(60) type c. data: it_fldcat type lvc_t_fcat, wa_fldcat type lvc_s_fcat, gs_layout1 type lvc_s_layo. "slis_layout_alv, select-options s_ebeln for ekko-ebeln. select-options s_aedat for ekko-aedat. select-options s_bsart for ekko-bsart. start-of-selection. perform get_data. perform build_dynamic_table. perform build_data. perform alv_display. end-of-selection. *&---------------------------------------------------------------------* *& Form GET_DATA *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* form get_data . "select header data select * from ekko into corresponding fields of table gt_ekko where ebeln in s_ebeln and aedat in s_aedat and bsart in s_bsart. "select line item if not gt_ekko[] is initial. select * from ekpo into corresponding fields of table gt_ekpo for all entries in gt_ekko where ebeln = gt_ekko-ebeln. sort gt_ekpo descending by ebelp. clear : gs_ekpo. read table gt_ekpo into gs_ekpo index 1. gv_max_ebelp = gs_ekpo-ebelp. sort gt_ekpo by ebeln ebelp. endif. endform. *&---------------------------------------------------------------------* *& Form BUILD_DYNAMIC_TABLE *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* form build_dynamic_table . data: wa_fldcat type lvc_s_fcat, it_fldcat type lvc_t_fcat. clear wa_fldcat. wa_fldcat-fieldname = 'EBELN'. wa_fldcat-coltext = 'PO No.'. wa_fldcat-datatype = 'CHAR'. wa_fldcat-outputlen = '10'. wa_fldcat-emphasize = 'C5'. append wa_fldcat to it_fldcat. gv_ebelp = 10. do. clear wa_fldcat. concatenate gv_ebelp '_MATNR' into wa_fldcat-fieldname. concatenate 'Material Code_' gv_ebelp into wa_fldcat-coltext. wa_fldcat-datatype = 'CHAR'. wa_fldcat-outputlen = '18'. wa_fldcat-no_zero = 'X'. append wa_fldcat to it_fldcat. clear wa_fldcat. concatenate gv_ebelp '_TXZ01' into wa_fldcat-fieldname. wa_fldcat-coltext = 'Description'. wa_fldcat-datatype = 'CHAR'. wa_fldcat-outputlen = '40'. append wa_fldcat to it_fldcat. clear wa_fldcat. concatenate gv_ebelp '_MENGE' into wa_fldcat-fieldname. wa_fldcat-coltext = 'Quantity'. wa_fldcat-datatype = 'CURR'. append wa_fldcat to it_fldcat. clear wa_fldcat. concatenate gv_ebelp '_NETWR' into wa_fldcat-fieldname. wa_fldcat-coltext = 'Amount'. wa_fldcat-datatype = 'CURR'. append wa_fldcat to it_fldcat. if gv_ebelp = gv_max_ebelp. exit. else. gv_ebelp = gv_ebelp + 10. endif. enddo. data: new_table type ref to data, lt_alv_cat type table of lvc_s_fcat, ls_alv_cat like line of lt_alv_cat. call method cl_alv_table_create=>create_dynamic_table exporting * I_STYLE_TABLE = it_fieldcatalog = it_fldcat * I_LENGTH_IN_BYTE = importing ep_table = new_table * E_STYLE_FNAME = exceptions generate_subpool_dir_full = 1 others = 2 . if sy-subrc <> 0. * Implement suitable error handling here endif. assign new_table->* to <dyn_table>. data : new_line type ref to data. * Create dynamic work area and assign to FS create data new_line like line of <dyn_table>. assign new_line->* to <dyn_wa>. endform. *&---------------------------------------------------------------------* *& Form BUILD_DATA *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* form build_data . sort gt_ekko by ebeln. sort gt_ekpo by ebeln ebelp. loop at gt_ekko into gs_ekko. clear : <dyn_wa>. clear : fieldname, fieldvalue. fieldname = 'EBELN'. fieldvalue = gs_ekko-ebeln. condense fieldvalue. assign component fieldname of structure <dyn_wa> to <fs1>. <fs1> = fieldvalue. loop at gt_ekpo into gs_ekpo where ebeln = gs_ekko-ebeln. clear : fieldname, fieldvalue. concatenate gs_ekpo-ebelp '_MATNR' into fieldname. fieldvalue = gs_ekpo-matnr. condense fieldvalue. assign component fieldname of structure <dyn_wa> to <fs1>. <fs1> = fieldvalue. clear : fieldname, fieldvalue. concatenate gs_ekpo-ebelp '_TXZ01' into fieldname. fieldvalue = gs_ekpo-txz01. condense fieldvalue. assign component fieldname of structure <dyn_wa> to <fs1>. <fs1> = fieldvalue. clear : fieldname, fieldvalue. concatenate gs_ekpo-ebelp '_MENGE' into fieldname. fieldvalue = gs_ekpo-menge. condense fieldvalue. assign component fieldname of structure <dyn_wa> to <fs1>. <fs1> = fieldvalue. clear : fieldname, fieldvalue. concatenate gs_ekpo-ebelp '_NETWR' into fieldname. fieldvalue = gs_ekpo-netwr. condense fieldvalue. assign component fieldname of structure <dyn_wa> to <fs1>. <fs1> = fieldvalue. clear : gs_ekpo. endloop. append <dyn_wa> to <dyn_table>. clear : gs_ekko. endloop. endform. *&---------------------------------------------------------------------* *& Form ALV_DISPLAY *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* form alv_display . call function 'REUSE_ALV_GRID_DISPLAY_LVC' exporting i_callback_program = sy-repid is_layout_lvc = gs_layout1 it_fieldcat_lvc = it_fldcat[] * I_GRID_SETTINGS = gs_grid * IT_EVENTS = lt_evts[] * IT_EVENTS = I_EVENTS i_default = 'X' i_save = 'A' * IS_VARIANT = GS_VARIANT1 * IMPORTING * E_EXIT_CAUSED_BY_CALLER = * ES_EXIT_CAUSED_BY_USER = tables t_outtab = <dyn_table> exceptions program_error = 1 others = 2. if sy-subrc <> 0. * Implement suitable error handling here endif. 出現 RAISE_EXCEPTION Exception condition "NO_FIELDCATALOG_AVAILABLE" raised. 為何?
07-31
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值