11-29-2011 8:29 AM
Hi Friends,
I created one Custom Tab under Header level in me21n using screen exit MM06E005.
It's working fine.And My requirement is, whenever open ME21N t-code it display my custom tab first
So, How to do this?
11-30-2011 10:22 AM
Hi,
The ME2xN transactions reads the user settings from table ESDUS using function module ES_READ_USER_SETTINGS, and save them at the end of the transaction using function module ES_APPEND_USER_SETTINGS.
You need to overwrite the displayed header tab number using ES_APPEND_USER_SETTINGS just at the beginning of the transaction. I think that a godd point to do this is in the subroutine INIT_TRANSACTION of report RM_MEPO_GUI. You can do this using the enhacement framework. I have tested it and it works for me. This is the code you should insert:
FORM init_transaction CHANGING ch_document TYPE mepo_document
ch_exit TYPE mmpur_bool
ch_requisitions TYPE mereq_t_eban_mem
ch_requisition_acc TYPE mereq_t_ebkn.
"""""""""""""""""""""""""""""$"$\SE:(1 ) Forma INIT_TRANSACTION, Inicio D
*$*$-Start: (1 )-----------------------------$*$*
ENHANCEMENT 1 ZTEST. "active version
*Expand header------
CALL FUNCTION 'ES_APPEND_USER_SETTINGS'
EXPORTING
iaction = 'PurchaseOrder'
ielement = 'DYN_4000-BUTTON TOGGLE_STATE'
iactive = '2'.
*Move to 2nd tab ----
CALL FUNCTION 'ES_APPEND_USER_SETTINGS'
EXPORTING
iaction = 'PurchaseOrder'
ielement = 'HEADER-TABSTRIP SUBVIEW_INDEX'
iactive = '2'.
ENDENHANCEMENT.
*$*$-End: (1 )-----------------------------$*$*
DATA: l_ebeln TYPE ekko-ebeln,
l_ebelp TYPE ekpo-ebelp,
11-30-2011 4:15 AM
11-30-2011 5:37 AM
Hi Vishnu,
Thanks for Reply.
I am using screen variant,this will work on Fields level only.
I don't know how to use Screen variant for setting default screen.
If you know,Share with me.Otherwise any other exit/badi is there for setting default screen.
11-30-2011 10:22 AM
Hi,
The ME2xN transactions reads the user settings from table ESDUS using function module ES_READ_USER_SETTINGS, and save them at the end of the transaction using function module ES_APPEND_USER_SETTINGS.
You need to overwrite the displayed header tab number using ES_APPEND_USER_SETTINGS just at the beginning of the transaction. I think that a godd point to do this is in the subroutine INIT_TRANSACTION of report RM_MEPO_GUI. You can do this using the enhacement framework. I have tested it and it works for me. This is the code you should insert:
FORM init_transaction CHANGING ch_document TYPE mepo_document
ch_exit TYPE mmpur_bool
ch_requisitions TYPE mereq_t_eban_mem
ch_requisition_acc TYPE mereq_t_ebkn.
"""""""""""""""""""""""""""""$"$\SE:(1 ) Forma INIT_TRANSACTION, Inicio D
*$*$-Start: (1 )-----------------------------$*$*
ENHANCEMENT 1 ZTEST. "active version
*Expand header------
CALL FUNCTION 'ES_APPEND_USER_SETTINGS'
EXPORTING
iaction = 'PurchaseOrder'
ielement = 'DYN_4000-BUTTON TOGGLE_STATE'
iactive = '2'.
*Move to 2nd tab ----
CALL FUNCTION 'ES_APPEND_USER_SETTINGS'
EXPORTING
iaction = 'PurchaseOrder'
ielement = 'HEADER-TABSTRIP SUBVIEW_INDEX'
iactive = '2'.
ENDENHANCEMENT.
*$*$-End: (1 )-----------------------------$*$*
DATA: l_ebeln TYPE ekko-ebeln,
l_ebelp TYPE ekpo-ebelp,
11-30-2011 11:18 AM
Hi Arseni Gallardo ,
The above code didn't work.
My requirement is when open me21n t-code, always it will show my custom tab.
It doesn't show last opening that tab.
11-30-2011 11:47 AM
What does "didn't work" mean? Didn't it select the 2nd tab? If it did you only have add an IF just to make sure that it only works for ME21n and replace the '2' in the second call to ES_APPEND_USER_SETTINGS by the proper tab index (which I can not know because I have no customer tab in my system).
ENHANCEMENT 1 ZTEST. "active version
IF sy-tcode EQ 'ME21N'.
*Expand header------
* CALL FUNCTION 'ES_APPEND_USER_SETTINGS'
* EXPORTING
* iaction = 'PurchaseOrder'
* ielement = 'DYN_4000-BUTTON TOGGLE_STATE'
* iactive = '2'.
*Move to 2nd tab ----
CALL FUNCTION 'ES_APPEND_USER_SETTINGS'
EXPORTING
iaction = 'PurchaseOrder'
ielement = 'HEADER-TABSTRIP SUBVIEW_INDEX'
iactive = '2' "<<<<< Replace this by the tab index of your custom dynpro.
ENDIF.
ENDENHANCEMENT.
By the way, I hve tried it in a ECC 6.0
Edited by: Arseni Gallardo on Nov 30, 2011 12:48 PM
11-30-2011 12:33 PM
Hi Arseni Gallardo,
Thanks .
This is exactly working very good.
my requirement is resolved.