Professional Documents
Culture Documents
Header Data
Released On 15.05.2009 10:45:46
Release Status Released for Customer
Component SRM-EBP-CA-DEX Document Extensibility
Priority Recommendations / Additional Info
Category Consulting
Symptom
Within the ITS UI technology used in SRM releases older than SRM 6.0, system control variables like
SY-TCODE and SY-UCOMM were used in customer BAdI implementations to retrieve information of the
environment of the BAdI call.
Other Terms
SY-TCODE, SY-UCOMM, BAdI implementation, workaround
Solution
The values for the transaction groups in this solution would substitute the usage of the system
variable SY-TCODE, formerly used in the context of the SAPGUI technology.
The values for the actions would substitute the usage of system variable SY-UCOMM.
The actions in SRM 6.0 and up were defined in a standardized way. The action values and the
corresonding set type are returned as defined in view "/SAPSRM/V_ACTSET". Corresponding constants
can be found in interface /SAPSRM/IF_PDO_ACTION_C.
The supported actions are associated with the buttons on the FPM (Floor Plan Manager) button row of
the OIF and GAF component.
DISCLAIMER:
This SAP Note describes UI specfic information.
There will be no guarantee, that the provided interface will stay stable, if the UI or the
global architecture would be changed.
This SAP Note is meant as substitute and workaraound for the system fields SY-TCODE,
SY_UCOMM used in BAdIs with ITS technology.
Any problems caused by applying this note is the responsibility of the customer
modification.
Suggested workaround:
To retrieve the values stored for the action and transaction code class
"/SAPSRM/CL_TRANSACTION_CONTEXT"
provides methods to get the values of the current action as well as the transaction group.
These method calls could be added to the coding of the method of the of the customer BAdI
implementation (e.g. "BBP_DOC_CHANGE_BADI").
The first step would be to get the instance of the transaction context class, i.e. method
"/SAPSRM/CL_TRANSACTION_CONTEXT=>/SAPSRM/IF_TRANSACTION_CONTEXT~GET_INSTANCE( )" needs to be called
to get an instance of the class.
The instance method "/SAPSRM/IF_TRANSACTION_CONTEXT->GET_CURRENT_ACTION( )" can be called to get the
currently executed action.
The returned action ID is filled with the action ID as it is used in the PDO layer and for metadata.
The instance method "/SAPSRM/IF_TRANSACTION_CONTEXT->GET_TRANSACTION_GROUP( )" can be called to get
the currently transaction context.
To destinguish between the supported transction groups, constants are available as attributes in
interface "/SAPSRM/IF_TRANSACTION_CONTEXT" (see example coding below).
This coding could be added for example in the change-BAdI or anywhere else in the coding that is run
when an action is executed.
Example coding could look like this:
"
DATA: lo_transaction_context TYPE REF TO /sapsrm/if_transaction_context.
lo_transaction_context = /sapsrm/cl_transaction_context=>/sapsrm/if_transaction_context~get_instance
( ) .
CASE lo_transaction_context->get_current_action( ).
WHEN /sapsrm/if_pdo_action_c=>gc_action_edit.
"'EDIT', PDO Action to Edit
" ...
WHEN /sapsrm/if_pdo_action_c=>gc_action_save.
"'SAVE', PDO Action for Save
" ...
ENDCASE.
CASE lo_transaction_context->get_transaction_group( ).
WHEN if_transaction_context=>gc_ta_group_sc.
"Process Shopping Cart 'BUS2121'
" ...
WHEN if_transaction_context=>gc_ta_group_sc_wizard.
" Shopping Cart Wizard 'BUS2121_WIZARD'
" ...
WHEN if_transaction_context=>gc_ta_group_soco.
" Sourcing Cockpit 'SOCO'
" ...
ENDCASE.
"
The necessary steps are to first find the event handler of the action. Then the action ID needs to
be set before and cleared after this event handler call. To read the action ID e.g. in a BAdI
implementation follow the steps described above.
Start application. Click right and select "More field help". A popup "More Field Help" appears
displaying technical details of the following topics:
l View Information
l Field ID
To make this information available the set method "SET_CURRENT_ACTION" needs to be called before the
event handler is triggered. This could be done in a pre coding part of the event handler method.
After the event handler was triggered a further call of method "SET_CURRENT_ACTION" is necessary to
clear the action value.
This could be done in a post-coding part of the event handler method.
I.e. the set method needs to be called twice, before the action is triggered by the event handler
and after the event handler call to clear the action value.
* Clear action id
*
lo_transaction_context->set_current_action( iv_current_action = space ).
Validity
Software Component From Rel. To Rel. And Subsequent
SRM_SERVER 700 700
701 701