Skip to Content
Technical Articles

Custom function code in MM06E005

Searching for a way to process a custom function code in subscreen from MM06E005 enhancement will probably take you to function module SCREEN_SEQUENCE_CONTROL. Further exploring will point you to tables T186 and T186 which holds a lot of function codes… and all of this seems a little bit complicated. Hopefully, SAP published a note 138855 about this issue, here is an example of implementation:

1. Add your custom function code to a subscreen element – it must have Z_xx format. Here I added a button with Z_GO code to RFQ screen.

/wp-content/uploads/2012/05/sc1_105683.jpg

/wp-content/uploads/2012/05/sc5_105694.jpg

2. There is a statement in the note about applying corrections to exit function modules, but as of release 4.6A they are contained in the standard system.

These modules from XM06 function group have params for carrying a custom function code from/to a customer subscreen:

EXIT_SAPMM06E_007, import param I_UCOMM type SY-UCOMM – the module for export data to a subscreen in header screens in PAI events

EXIT_SAPMM06E_017, import param I_UCOMM type SY-UCOMM – for importing data from a custom subscreen in header screens

EXIT_SAPMM06E_008, export param E_UCOMM type SY-UCOMM – for export data to a subscreen in item screens in PAI events

EXIT_SAPMM06E_018  export param E_UCOMM type SY-UCOMM – for importing data from a custom subscreen in item screens

You have to create (in ZXM06TOP) a global field for holding the value from these parameters.

(ZXM06TOP can be created using forward navigation from LXM06TOP)

/wp-content/uploads/2012/05/sc2_105684.jpg

3. Now you have to transfer the function code from/to your custom subscreen to the just created global field. The function code is carried out in exit function modules parameters mentioned above. In our case we use only a header screen so in export modules EXIT_SAPMM06E_007 (include ZXM06U38) we must put:

/wp-content/uploads/2012/05/sc3_105685.jpg

In import module EXIT_SAPMM06E_008 (include ZXM06U37) we do the opposite:

/wp-content/uploads/2012/05/sc4_105689.jpg

If you want to use an item type screen, do the same with EXIT_SAPMM06E_008 and EXIT_SAPMM06E_018.

4. Program PAI of your subscreen. What’s important – after processing you custom function code you have to set the global value (gv_ucomm in our case) to one of the codes from table T168F. If you won’t do this, you’ll end with error code. So, in PAI module for 301 subscreen I added a simple message and at the end I set  gv_ucomm to KOPF function code which directs logic to the header screen again (use the debugger for finding specified codes, for example if you want to forward logic to other screen).

/wp-content/uploads/2012/05/sc8_105698.jpg

That’s all. Now button is on the RFQ screen and its function code is handled properly.

/wp-content/uploads/2012/05/sc9_105699.jpg

Without setting gv_ucomm value to a code from T168F program would end with error:

/wp-content/uploads/2012/05/sc10_105700.jpg

2 Comments
You must be Logged on to comment or reply to a post.