Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Transaction Variant Tcode in a transaction

former_member143179
Participant
0 Kudos

Dear Sir,

We have created a transaction variant "ZMB1A" for a dialog transaction MB1A .  During execution of ZMB1A , by using USER-EXIT we want to know the name of transaction being used .  For this in a USER-EXIT associated with MB1A , we are using SY-TCODE  , but the problem is that SY-TCODE is returning MB1A and not ZMB1A .

Kindly guide us , how can we get the actual transaction name i.e ZMB1A .

With regards

B Mittal

4 REPLIES 4

matt
Active Contributor
0 Kudos

http://scn.sap.com/thread/0001961229

Oliver Russinger said "see class cl_abap_syst and documentation on mehtod get_transaction_code , it returns the name of the FIRST calles transaction"

0 Kudos

Hi Matthew.

For a transaction variant will call the original tcode, I don't think that this will work properly.

Regards,

Klaus

former_member195402
Active Contributor
0 Kudos

Hi,

please check this code from include report LSHSYU01:

* New field: transaction variant

  CALL 'DY_GET_TX_VARIANT'

       ID 'VARIANT' FIELD TCODE_VARIANT

       ID 'CLIENT_INDEPENDENT' FIELD TCODE_VARIANT_CLIIDEP.

I've checked it with VF01 and a transaction variant of VF01. I think, you can use it in your userexit.

Regards,

Klaus

Former Member
0 Kudos

These allow you to preassign values to fields within a transaction, define field attributes, or hide entire screens.

You can find straight solution to your question which is already available in SCN.

Check for useful ness : http://scn.sap.com/thread/1632369

Cheers

Ansumesh