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: 

Syst variable for transaction variant?

Former Member
0 Kudos

Hi,

How to identify current transaction code with variant. We can't use sy-tcode as it shows orginal transaction code. Sy-slset is also empty allways?

Thanks

Shekar

12 REPLIES 12

Former Member
0 Kudos

Hi Reddy ?

y we cannt use sy-tcode ? i am getting the values for sy-tcode , and i have t.variant for that Tcode ? Just Debug that one , u will get the values.

regards

Prabhu

Former Member
0 Kudos

Hi Prabhu,

My question is we created 'ZFB50' (transaction code with variant) for original transaction 'FB50' with Transaction

variant 'Z_FI_FB50'. But Sy-tcode shows only 'FB50', not 'ZFB50'. SY-slset supposed to show screen variant name, but it is not showing?

How to identify this 'ZFB50' transaction with variant?

Thanks

Shekar

0 Kudos

Hi

I believe that information is missed after calling the main transaction.

Max

Former Member
0 Kudos

I doubt if there is any system variable which gives you that sort of information but you can read TSTC table with the ABAP name (SY-CPROG) and get the transaction code as an alternative.

Regards

Anurag

Former Member
0 Kudos

Thanks Guys. SY-CPROG will not help, as it is same for original transaction and transaction variant.

Is there any function module which reads current transaction variant?

Thanks

Shekar

0 Kudos

check table entries <b>SHDTVCIU</b>with Tcode.

regards

Prabhu

Former Member
0 Kudos

Hi Prabhu,

Thanks for info. First of all we need to know the transaction, then we can do any thing. Table SHDTVCIU just gives information about original transaction and transaction variant.

Our transaction can be called directly or using transaction variant. We need to know "when it is called from transaction variant".

Thanks

Shekar

0 Kudos

hi Reddy ,

check the Documentation of SHD0.Its nothing but modifications of Screen fields.

Regards

Prabhu

Transaction Variants and Screen Variants
Transaction variants can simplify transaction runs as they allow you to:

Preassign values to fields
Hide and change the 'ready for input' status of fields
Hide and change table control column attributes
Hide menu functions
Hide entire screens
In particular, hiding fields in connection with screen compression, and hiding screens, can result in greater clarity and simplicity.

Transaction variants are made up of a sequence of screen variants. The field values and field attributes for the individual screens found in transaction variants are stored in screen variants. Each of these variants is assigned to a specific transaction, can, however, also contain values for screens in other transactions if this is required by transaction flow. The transaction that the variant is assigned to serves as initial transaction when the variant is called.

There are both client-specific and cross-client transaction variants. All screen variants are cross-client, but may be assigned to a client-specific transaction variant.

A namespace exists for cross-client transaction variants and screen variants and both are automatically attached to the Transport Organizer. Client-specific transaction variants must be transported manually.

In principle, transaction and screen variants can be created for all dialog and reporting transactions. There are, however, certain Restrictions that apply to certain transactions, depending on their internal structure.

No transaction variants are possible with transactions already containing preset parameters (parameter transactions and variant transactions).

Regards

Prabhu

PS : Customer is First Points next

Former Member
0 Kudos

Hey Shekar,

I had just the same problem/question. Maybe in the meantime you figured out a solution yourself. This is what I did.

Didn't check on the transaction code but on the variant linked to it. I used it in the validation rules. Via the assign you get the variant and you can do any checks you want.

Hope it helps.

Greetz,

Pieter

  • Screen variant provided by transaction variant

FIELD-SYMBOLS: <f_scvariant> TYPE scvariant.

ASSIGN ('(SAPMF05A)g_scvariant')

TO <f_scvariant>.

IF sy-subrc EQ 0.

Former Member
0 Kudos

Hi Pieter,

Thank you for that. That was very helpful answer. I used the code to get screen variant adopted from function

'RS_HDSYS_GET_SC_VARIANT' as we are not getting value from " ASSIGN ('(SAPMF05A)g_scvariant') TO <f_scvariant>".

import i_shdfv to l_i_shdfv

i_shdfvgui to l_i_shdfvgui

screen_variants to l_screen_variants

i_shdguixt to l_i_shdguixt

from memory id '%_HD_TCVARIANT'.

Thank you

Shekar

Former Member

Hi Pieter,

To get variant transaction only, we can use the code as follws.

data: tcode type SHDTV-TCODE.

call 'DY_GET_CURRENT_TRANSACTION'

id 'TRANSACTION_NAME'

field tcode.

Cheers

Shekar

0 Kudos

Thanks Reddy,

It worked for me..