cancel
Showing results for 
Search instead for 
Did you mean: 

SRM 7.0 Sy-ucomm & Sy-tcode is not working

Former Member
0 Kudos

Hello SRM Gurus,

I have a problem with bbp_item_check_badi BADI in SRM 7.0.

I am trying to check Sy-ucomm or Sy_tcod to validate the RFX response. But the problem is both Sy-ucomm and Sy_tcod are not working and it always showing empty value.

Kindly suggest me to overcome this issue.

Thanks.

Regards,

Magesh

Accepted Solutions (1)

Accepted Solutions (1)

former_member183819
Active Contributor
0 Kudos

Note 1334202 - How to get current action ID and transaction group

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

Reason and Prerequisites

Within the ITS UI technology used in older SRM releases, 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.

Since WebDynpro technology has in contrast to the SAPGUI technology no access to theses system variables, this Note describes a workaround to substitute the usage of these variables.

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.

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:

Former Member
0 Kudos

Thanks for the information.

Regards,

Magesh.

Answers (0)