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: 

Transaction variant SYST-TCODE

frank_bork
Participant

Dear all,

I created transaction variant ZVA02 as copy of VA02. If I start transaction ZVA02 the field SYST-TCODE is filled with VA02. Where can I see that the transaction was started via ZVA02. Is this information available in the order entry process?

Thanks.

Kind regards

Frank

1 ACCEPTED SOLUTION

SuhaSaha
Advisor
Advisor
0 Kudos

You can use the method GET_CURRENT_TRANSACTION of class CL_DYNPRO.

An excerpt from the SAP documentation:

Alternatively, the method GET_CURRENT_TRANSACTION of the class CL_DYNPRO can be used to obtain the transaction code of the current transaction. This method returns the transaction code during a parameter transaction or variant transaction instead of the transaction code of the implicitly called dialog transaction.

Source: [http://help.sap.com/abapdocu_70/en/ABAPLEAVE_TO_TRANSACTION.htm|http://help.sap.com/abapdocu_70/en/ABAPLEAVE_TO_TRANSACTION.htm]

Hope this helps.

BR,

Suhas

3 REPLIES 3

Former Member
0 Kudos

Frank,

You can use function RS_HDSYS_GET_TC_VARIANT. Hope that helps.

vinod_vemuru2
Active Contributor
0 Kudos

Hi,

Though this is not the exact answer you are expecting, Is your transaction variant working??? You need to populate the variant name in exit MV45AFZZ (TVAK-VARIANT = 'Transaction variant name). Else you need to configure in SPRO. Because VA02 transaction variant works at order type level. With out using exit, you can see the changes done in the variant only in the initial screen. For further screens changes won't work.

I also tried in many ways. But was not able to get the variant name and ended up in creating a custom program for calling the transaction variant. Exported the T-code name to memory from here and import in the exits.

Thanks,

Vinod.

SuhaSaha
Advisor
Advisor
0 Kudos

You can use the method GET_CURRENT_TRANSACTION of class CL_DYNPRO.

An excerpt from the SAP documentation:

Alternatively, the method GET_CURRENT_TRANSACTION of the class CL_DYNPRO can be used to obtain the transaction code of the current transaction. This method returns the transaction code during a parameter transaction or variant transaction instead of the transaction code of the implicitly called dialog transaction.

Source: [http://help.sap.com/abapdocu_70/en/ABAPLEAVE_TO_TRANSACTION.htm|http://help.sap.com/abapdocu_70/en/ABAPLEAVE_TO_TRANSACTION.htm]

Hope this helps.

BR,

Suhas