Application Development and Automation 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: 
Read only

Create a Transaction Variant - Existing script doesn't work

Former Member
0 Likes
1,965

So,

I found the following:

http://wiki.sdn.sap.com/wiki/display/Snippets/Transaction+Variant+-+A+Step+by+Step+Guide+for+Creatio...

Sadly, It doesn't work.  At the very least, steps must be missing or it was written for a previous version of SAP.  I'm on EHP6 FOR SAP ERP 6.0. 

Can Someone please point me to a better script?

Neal

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,893

Yes it isn't that hard.

This thread deals with same issue.

The discussion says 2 things.

First, SHD0 can be used for dialog transactions, not report. So if there is a screen, and you press enter, screen's fields would show up as per wiki tutorial. Tutorial uses transaction CO01, which calls screen 100 of program SAPLCOKO1.

Second, for your report, parameter transaction would serve the purpose of hiding extraneous fields. Create a variant of program, while saving hide some fields. Then follow the correct answer in thread to parameter transaction that would run your program with new variant.

9 REPLIES 9
Read only

Former Member
0 Likes
1,893

Just to give a better example:

Step 2 ends with press the green check.

Then for me nothing happens.

Did they mean press save, back, or has the whole transaction changed all together?

Read only

Former Member
0 Likes
1,893

I wonder if part of the trouble is that I'm using a Z transaction which is on a Z ABAP Report Program?  Can you actually use SHD0 with Z code?

Neal

Read only

arindam_m
Active Contributor
0 Likes
1,893

Hi,

I think from step 2, you will just have to follow what you want from your ztransaction. Its like an recording. The example shows hows you can just initialize values in the starting fields. Its applicable to the initial screen with which the transaction opens.

In your custom transaction enter or the Green Button behavior might not be same as shown in the example T-Code. The idea is to exit the T-Code after the initial values are given, indicating end of recording that then takes us to the next screen.

Then we can do the rest with the default values and the fields. Hope that helps.

Cheers,

Arindam

Read only

Former Member
0 Likes
1,893

Arindam,

Here's my screen:

In SHD0

It doesn't give me any fields to edit properties of the fields:

I don't see how I can do what's intended from here!

Neal

Read only

Former Member
0 Likes
1,893

Hi Neal,

Let me understand what exactly are we trying to achieve through transaction variant as most of the time we use it for standard transcations .

As you are planning to use it for custom report .Could you please share the requirement ?

Thanks~

Read only

Former Member
0 Likes
1,893

Requirement:

Provide a transaction for the report program that for some users eliminates a number of the selection fields and will not allow them to add them back by choosing an alternate variant.  While for others (superusers) all fields are available.

Perhaps I misunderstand how SHD0 is to be used, but I thought it might allow me this.  Give the limited users a transaction variant and the others get a normal tcode.

Please let me know where I have been mistaken.  Clearly I must be or it wouldn't be this hard...

Neal

Read only

Former Member
0 Likes
1,893

Hi Neal,

I got it.Please go to your selection screen and try to save .

It will ask for creating Variant .Please check the fields you want to hide .

Save it and the variant is created.

Now create the TCODE for the report using SE93 AND Assign the variant .

Thanks!

Read only

Former Member
0 Likes
1,893

The one point that this doesn't meet is that if a second variant is created for the the super user group, then the common user could then call up that variant.  We need them to not have that option.

Now I must read further into Manish's answer to see what additional gems he may have left me!

Neal

Read only

Former Member
0 Likes
1,894

Yes it isn't that hard.

This thread deals with same issue.

The discussion says 2 things.

First, SHD0 can be used for dialog transactions, not report. So if there is a screen, and you press enter, screen's fields would show up as per wiki tutorial. Tutorial uses transaction CO01, which calls screen 100 of program SAPLCOKO1.

Second, for your report, parameter transaction would serve the purpose of hiding extraneous fields. Create a variant of program, while saving hide some fields. Then follow the correct answer in thread to parameter transaction that would run your program with new variant.