Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to use SMOD and CMOD for SD user Enhancement

Shulou Source: shulou.com Published: 2022-06-03 01:09:09 10月04日 Update

How to use SMOD and CMOD for SD user Enhancement

1. A brief introduction to enhancements

1.1 SMOD contains specific enhancements, while CMOD contains a set of enhancements written by SMOD.

1.2 User exits (Function module exits) is the exit provided by sap, and its naming rules are as follows:

EXIT_

Example:

The VA01 transaction of sd. The corresponding program is SAPMV45A. You will find the following code (using CALL CUSTOMER-FUNCTION string) in the program:

CALL CUSTOMER-FUNCTION '003'

Exporting

Xvbak = vbak

Xvbuk = vbuk

Xkomk = tkomk

Importing

Lvf_subrc = lvf_subrc

Tables

Xvbfa = xvbfa

Xvbap = xvbap

Xvbup = xvbup.

Then the name of exit calls function module is: EXIT_SAPMV45A_003

2. Try SMOD to build a SAP enhancement first.

2.1.Select an enhancement, such as SDVFX001, click modify to enter the sap enhanced maintenance screen

2.2. Click the "components" button to enter the component maintenance screen

Move the cursor to the "function module name" and enter the module name, such as EXIT_SAPLV60B_001

2.4. Select the "Code Modification" button to enter the function module

2.5. Double-click the inclusion unit of the function module, enter the inclusion unit, add the custom code and activate the save

3. Use CMOD to set up enhancement projects

3.1. Enter a custom project name and click "create"

3.2. Enter the enhancement project, select "configuration Enhancement" and enter the enhanced configuration screen.

Enter an enhanced name such as: SDVFX001

3.4. Save and exit

4. Use CMOD to activate the enhanced project, and the work will be completed.

How to find

* determine whether there is a corresponding enhanced definition (SMOD)

Select single name from modsapa into mod0-name

Where name = 'PPCO0002'.

If sy-subrc = 0.

Endif.

Select single * from tadir into ps_tadir_db

Where pgmid = 'R3TR'

And object = 'SMOD'

And obj_name = 'PPCO0002'.

* determine whether there is a definition of the corresponding enhancement project (CMOD)

SELECT SINGLE name FROM MODATTR into mod0-name

WHERE NAME = 'PPCO0002'..

* extract the components of the enhanced definition (you can use this to reverse the enhanced definition)

Select * from modsap

Where name = 'PPCO0002'.

* determine whether the enhancement is ported to the BADI implementation

* Enhancement & has already been migrated in Business Add-In definition

Select single migrated badi_def into (migrated, exit_name)

From modsapa where name = modname.

If sy-subrc = 0 and migrated = seex_true.

Message s621 with modname exit_name.

Check mode ne 'CHAM'.

Endif.

MODTYP type:

E: feature exit

S: screen

T: table

C: GUI code

SAP enhancements are stored in the MODSAP table

* get the enhanced component's see function MOD_SAP_MEMBER_TEXT

* get the information to exit the function module

Select single * from tftit

Where "SPRAS" ='1' AND "FUNCNAME" = 'EXIT_SAPLCORE_001'

If sy-subrc = 0.

Endif.

* functions worth learning

MOD_KUN_ACTIVATE (can manipulate related reports)

Https://mp.weixin.qq.com/s/aCzXtfJeT-QTTQvPl6Lz0g

Tags: Module code function component project function screen input selection function module unit button activation program configuration user transaction information cursor name Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft OPPO Reno Xiaomi Redmi vpn