Delete layout variant in the ALV
Does anyone know how to delete the function 'layout variant' int the ALV of the ABAP web dynpro?
So the pulldown menu won't be visible on the header of the ALV screen?
I found the answer in the model class of the ALV
Similar Messages
-
Get layout variant created in ALV in WDA
Dear all,
I created some layout variant in my ALV table in my WD abap
I need to create an abap report to send the ALV table by mail, and I need to retrieve the layout variant created on the WD and use it in my abap report.
I found the table WDY_CONF_USER and WDY_CONF_USERT but I don't know where are stored the details of the columns of the variant.
These 2 tables are not available by SE16 or SM30.
Do you know if I can use some method of class or something else ?
Thanks for your quick help.
VéroniqueHi,
Before the call to method set_table_for_first_display, populate
wa_variant-report = sy-repid.
Best regards,
Prashant -
What is the use of variant in the alv report
hello all,
what is the use of variant in the alv reportHi,
For Variants
follow the link:
http://help.sap.com/search/highlightContent.jsp
Variants allow you to save sets of input values for programs that you often start with the same selections. You can use them for any programs except subroutine pools (type S).
Contents
Variants: Overview
Initial Screen
Displaying a Variant Overview
Creating and Maintaining Variants
Creating Variants
Attributes of Variants
Changing Variants
Deleting Variants
Printing Variants
Variable Values in Variants
Creating Variables for Date Calculations
User-specific Selection Variables
Creating User-specific Variables
Changing Values Interactively
Changing Values from the Program
Fixed Values from Table TVARV
Creating Table Variables from TVARV
Changing TVARV entries
Running a Program with a Variant
Variants: Overview
Use
Whenever you start a program in which selection screens are defined, the system displays a set of input fields for database-specific and program-specific selections. To select a certain set of data, you enter an appropriate range of values.
For further information about selection screens, see Working with selection screens in the ABAP User's Guide.
If you often run the same program with the same set of selections (for example, to create a monthly statistical report), you can save the values in a selection set called a variant.
You can create any number of variants for any program in which selection screens are defined. Variants are assigned exclusively to the program for which they were created.
You can also use variants to change the appearance of the selection screen by hiding selection criteria. This is particularly useful when you are working with large selection screens on which not all of the fields are relevant.
Reports, module pools, and function groups may have several selection screens. It is therefore possible to create a variant for more than one selection screen.
Variants are an interface between the user and the selection screen. They can be used both in dialog and in background mode, although their uses are slightly different.
Variants in Dialog Mode
In dialog mode, variants make things easier for the user, since they save him or her from continually having to enter identical values. They can also make the selection screen easier to read, because you can use them to hide input fields. Running an executable program with a variant containing an optimal set of values also reduces the capacity for user error. The optimized database selections speed up the runtime of the program.
Variants in Background Mode
Variants are the only method for passing values to a report program in a background job. Therefore, when you run a program in the background, you must use a variant (or SUBMIT... VIA JOB). To avoid you having to create a new variant each time you run the report, ABAP contains a mechanism allowing you to pass variable values to variants. See variable values in variants.
To ensure that an executable program is always started using a variant, you can specify in the program attributes that the program may only be started in this way.
Features
Creation of variants
Display, change, copy, print, and delete variants
Use and definition of variables in variants
Variable date calculation
User-specific fixed values
Fixed values in table TVARV
You access the variant maintenance tool from the initial screen of the ABAP Editor. Enter the name of the program, select Variants in the Sub-objects group box, and then choose Display or Change.
Functions
The above screen allows you to:
Create variants
Display the variant directory
Display and change values and attributes
Copy, delete, and rename variants
Before creating a new variant for a program, you should check whether you can use or adapt an existing variant instead.
There are two ways to display variants:
Position the cursor on the Variant field on the initial screen and press F4. The following dialog box lists all of the available variants:
Choose Variants ® Directory on the initial screen:
Creating Variants
Prerequisites
You must have defined one or more selection screens for the relevant program. The program may have any type except type S.
Procedure
On the initial screen of the ABAP Editor, enter the name of the program for which you want to create a variant, select Variants in the Sub-objects group box, and choose Change.
On the variant maintenance initial screen, enter the name of the variant you want to create.
Note the naming convention for variants (see below).
Choose Create.
If the program has more than one selection screen, a dialog box appears in which you can assign the variant to one or more screens. The dialog box does not appear if the program only has one selection screen. In this case, the selection screen of the program appears straight away.
If there is more than one selection screen, select the screens for which you want to create the variant.
Example:
If you choose Variant for all selection screens, the variant also applies to any selection screens that you create after creating the variant.
Otherwise, the variant only supplies values to the selection screens that you select in the list.
Choose Continue.
The (first) selection screen of the program appears.
If your program has more than one selection screen, use the scroll buttons in the left-hand corner of the application toolbar to navigate between them. If you keep scrolling forwards, the Continue button appears on the last selection screen.
Enter the required selections, including multiple and dynamic selections.
Choose Continue.
Result
When you have finished, an overview screen appears (ABAP: Save Attributes of Variant), on which you can enter the attributes of your variant and save it.
Note that when you create a new variant, you must enter both values and attributes.
Names of variants: Names can consist of up to 14 alphanumeric characters. The "% " character is not allowed. If you want the variant to be transported automatically with its program, you must create a system variant. The name of a system variant starts "CUS&" for customers, and "SAP&" for SAP system variants. You can only use the "&" character within this prefix in the name of a system variant. It may not occur in any other context. System variants are administered by the Workbench Organizer. Although you can create and access variants from any client, they are always stored in client "000".
Creating Variants
Prerequisites
You must have defined one or more selection screens for the relevant program. The program may have any type except type S.
Procedure
On the initial screen of the ABAP Editor, enter the name of the program for which you want to create a variant, select Variants in the Sub-objects group box, and choose Change.
On the variant maintenance initial screen, enter the name of the variant you want to create.
Note the naming convention for variants (see below).
Choose Create.
If the program has more than one selection screen, a dialog box appears in which you can assign the variant to one or more screens. The dialog box does not appear if the program only has one selection screen. In this case, the selection screen of the program appears straight away.
If there is more than one selection screen, select the screens for which you want to create the variant.
Example:
If you choose Variant for all selection screens, the variant also applies to any selection screens that you create after creating the variant.
Otherwise, the variant only supplies values to the selection screens that you select in the list.
Choose Continue.
The (first) selection screen of the program appears.
If your program has more than one selection screen, use the scroll buttons in the left-hand corner of the application toolbar to navigate between them. If you keep scrolling forwards, the Continue button appears on the last selection screen.
Enter the required selections, including multiple and dynamic selections.
Choose Continue.
Result
When you have finished, an overview screen appears (ABAP: Save Attributes of Variant), on which you can enter the attributes of your variant and save it.
Note that when you create a new variant, you must enter both values and attributes.
Names of variants: Names can consist of up to 14 alphanumeric characters. The "% " character is not allowed. If you want the variant to be transported automatically with its program, you must create a system variant. The name of a system variant starts "CUS&" for customers, and "SAP&" for SAP system variants. You can only use the "&" character within this prefix in the name of a system variant. It may not occur in any other context. System variants are administered by the Workbench Organizer. Although you can create and access variants from any client, they are always stored in client "000".
reward all help full answers -
Dear Experts,
As we have transaction SHD0 to Create or Delete Transaction and Screen variants. Do we have any transaction to delete layout variant in ALV?
I have to delete some layout variants in Interactive ALV report.
Thank You,
Best Regards
VenkiDid you explore?
Settings > layout > layout management-> Edit - delete layout or trash -
Can any body tell me how to create a layout variant in the selection
hi friends i would like to know how to create a layout variant in the selection screen and how to select the variant to display the ouptut using the layout using disvariant.please if possible give me example. thanks in advance.
hi,
I shall give you the code. It will definitely work.
<u><b>Declerations you need to make</b></u>
data: WK_VARIANT LIKE DISVARIANT,
WX_VARIANT LIKE DISVARIANT,
WK_REPID LIKE SY-REPID,
WK_VARIANT_SAVE(1) TYPE C,
WK_EXIT(1) TYPE C.
<b><u>Things you need to do in the initialization event:</u></b>
INITIALIZATION.
PERFORM F_INIT_VARIANT.
PERFORM F_VARIANT_DEFAULT USING PR_VARI.
*& Form f_init_variant
FORM F_INIT_VARIANT .
CLEAR WK_VARIANT.
WK_REPID = SY-REPID.
WK_VARIANT-REPORT = WK_REPID.
WK_VARIANT-USERNAME = SY-UNAME.
WK_VARIANT_SAVE = 'A'.
ENDFORM. " f_init_variant
*& Form f_variant_default
FORM F_VARIANT_DEFAULT USING P_PR_VARI.
WX_VARIANT = WK_VARIANT.
IF NOT P_PR_VARI IS INITIAL.
WX_VARIANT-VARIANT = P_PR_VARI.
ENDIF.
CALL FUNCTION 'LVC_VARIANT_DEFAULT_GET'
EXPORTING
I_SAVE = WK_VARIANT_SAVE
CHANGING
CS_VARIANT = WX_VARIANT
EXCEPTIONS
WRONG_INPUT = 1
NOT_FOUND = 2
PROGRAM_ERROR = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CASE SY-SUBRC.
WHEN 0.
P_PR_VARI = WX_VARIANT-VARIANT.
WHEN 2.
CLEAR P_PR_VARI.
ENDCASE.
ENDFORM. " f_variant_default
<b><u> After this Things you need to do in the At selection screen event:</u></b>
AT SELECTION-SCREEN ON VALUE-REQUEST FOR PR_VARI.
PERFORM F_VARIANT_F4 USING PR_VARI.
*& Form f_variant_f4
FORM F_VARIANT_F4 USING P_PR_VARI.
CALL FUNCTION 'LVC_VARIANT_F4'
EXPORTING
IS_VARIANT = WK_VARIANT
I_SAVE = WK_VARIANT_SAVE
IMPORTING
E_EXIT = WK_EXIT
ES_VARIANT = WX_VARIANT
EXCEPTIONS
NOT_FOUND = 1
PROGRAM_ERROR = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF WK_EXIT IS INITIAL.
WK_VARIANT-VARIANT = WX_VARIANT-VARIANT.
P_PR_VARI = WX_VARIANT-VARIANT.
ENDIF.
ENDFORM. " f_variant_f4
After this finally when you call the output using REUSE_ALV_GRID_DISPLAY YOU NEED TO mention this parameter in the function module
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
<i><u><b>IS_LAYOUT = WA_LAYOUT</b></u></i>
<i><u><b>I_SAVE = 'X'</b></u></i>
<u><i>I_DEFAULT = 'X'</i></u>
<u><b>IS_VARIANT = WK_VARIANT</b></u>
TABLES
T_OUTTAB = ITAB1
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
Once you do this,,, you can create a layout variant.
P.S. Mark all helpful answers for points.
JLN -
How to attach the layouts or variants to the alv report
hi all,
i have seen that using FM REUSE_ALV_VARIANT_F4 for some reports iam
getting the layouts
for some reports its giving message that NO LAYOUTS FOUND.
is there any way to define new layouts or else how can i use existing layouts.
any help will be greatly appreciated,
thanks and regards,
cnu.Hi cnu,
First set <b>I_SAVE = 'A'</b> in the alv grid or list display FM. You can create new layouts by using 'change layout' button.but to save those layouts you have to set the save attribute. see below ex code.So that you can create some layout sets
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = IT_FIELDCAT[]
IT_SORT = IT_SORT[]
IT_EVENTS = IT_EVENTS[]
I_SAVE = 'A'
TABLES
T_OUTTAB = IT_MLGT[]
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
plz reward points if helpful
thanks,
Suma. -
Reg. copying Layout Variants from 1 ALV pgm to another
Hi Friends,
I am currently copying an ALV program Ztest1 to ztest2 through ztest5. While doing so I want the LAYOUT variants that are available for ztest1 also to be copied to these other programs.
All I am aware is that the table LTDX stores all the layout variants for a particular program.
Could anybody provide me the right inputs on this.
Thanks in Advance.
Rgrds,
Gayathri N.I took this approach and it worked for me:
1) Change your program so that everytime an ALV function is called it is using the original program name in the variant declaration, ensure you keep the original code commented out, you will need to put it back later. Examples:
FORM variant_init USING varname TYPE slis_vari.
CLEAR g_variant.
g_variant-report = g_repid.
g_variant-report = 'ORIGINAL_PROGRAM_NAME'.
FORM f4_for_variant.
g_variant-report = sy-repid.
g_variant-report = ORIGINAL_PROGRAM_NAME.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
FORM check_variant.
IF NOT p_vari IS INITIAL.
g_variant-report = sy-repid.
g_variant-report = ORIGINAL_PROGRAM_NAME.
g_variant-variant = p_vari.
CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
2) Display function lt_variant_save via SE37, set a breakpoint at the first executable line:
perform variant_save tables it_fieldcat
4) Run your program with the layout variant you wish to copy.
5) Hit Save Variant. You are now in debug mode.
6) Enter variable CS_VARIANT-REPORT in the variables 1 panel.
7) Double-click on CS_VARIANT-REPORT.
8) Hit the Change Field Content button
9) Change the value to the name of your new program, then hit Enter.
10) Hit Execute (F8). You have now saved the variant under your new program name.
11) Exit and rerun your program as necessary for as many variants as you want to copy
12) Change your program back to using sy-repid (or whatever else it was referencing) wherever you changed it in step 1.
13) The variants have now been copied and you can run your program with the new variants. -
Problem with same layout (variant) for two ALV Grid and ALV Tree
Hello!
I have two docking containers on the screen. On the left i have cl_gui_alv_tree, on the right cl_salv_table.
When a user set a default layout for ALV Grid (or ALV Tree), raport starts and sets this layout in both objects (tree and grid).
How to avoid this?Hi,
Take Two radio buttons.
First radion button display the two containers in grid format,
second radio button display the two containers in tree format base on user selection.
CREATE OBJECT G_DOCING_CONTAINER
EXPORTING PARENT = G_CUSTOM_CONTAINER."G_CONTAINER.
DISPLAY THE DATA IN GRID FORMATA
CREATE OBJECT r_grid
EXPORTING
i_parent = G_DOCING_CONTAINER
CALL METHOD g_docing_container->set_width
EXPORTING
width = 1300.
DISPLAY THE GRID DATA IN SECOND CONTAINER
CREATE OBJECT r_grid1
EXPORTING
i_parent = G_DOCING_CONTAINER
CALL METHOD g_docing_container->set_width
EXPORTING
width = 1300.
OTHERWISE WE CAN DISPLAY THE TWO CONTAINERS DATA IN A GRID FORMAT
CREATE OBJECT g_tree
EXPORTING
parent = g_docing_container"g_custom_container
IF R1 = 'X'. "FOR GRID DISPLAY
CALL METHOD r_grid1->set_table_for_first_display
CALL METHOD r_grid2->set_table_for_first_display
ELSE.
************TREE DISPLAY
ENDIF.
regards,
muralii -
Hi all.
When I create a variant for a layout (ALV) the user-specific flag is locked.
How can I unlock this flag for deselect it?
All layout that I create are like user-specific.
Thanks (Obrigado).
<b>Pedro</b>Hi Pedro,
If you use reports that internally are based on the function module HR_DISPLAY_BASIC_LIST or DISPLAY_BASIC_LIST and you want to create a user independent layout variant for the ALV output, the check box 'user specific' in the dialog is always checked and not changeable.What support pack level your on? you hve to increase the patch level.l refer note 336054 for further info.
Cheers,
Shyam -
Hi ,
I have executed a report . I hide one column and saved the layout. The layout name comes on to the selection screen parameter which i have defined on the selection screen.
PARAMETERS: p_vari LIKE disvariant-variant. " ALV Variant
i have made the i_save = 'A' and is_default = 'x'. and also used other function modules reg. Variants.
but if i select the layout variant in the selection screen and execute it is not working . the hidden column also coming on the output.
But if the select the layout variant on the output of the report from the icon select layout it is working fine. the column which i have hidden is not coming. it is perfect. why it is not working when i select the variant in the selection screen.
Regards,
Rose.Hi,
Please try this code
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
w_variant-report = sy-repid.
* Function module to show the variant of a ALV report
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = w_variant
i_save = 'A'
IMPORTING
es_variant = w_kvariant
EXCEPTIONS
not_found = 2.
IF sy-subrc = 2.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
p_vari = w_kvariant-variant.
ENDIF.
END-OF-SELECTION.
MOVE w_variant TO w_kvariant.
MOVE p_vari TO w_kvariant-variant.
MOVE sy-repid TO w_kvariant-report.
* Function module to check the variant existence
CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
EXPORTING
i_save = w_save
CHANGING
cs_variant = w_kvariant.
w_variant = w_kvariant.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
i_callback_html_top_of_page = 'HTML_HEADING'
i_grid_title = text-t06
i_grid_settings = wa_grid_set
is_layout = wa_layout
it_fieldcat = t_fieldcat
i_save = 'X'
is_variant = w_variant
is_print = wa_print
TABLES
t_outtab = t_header
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
CASE sy-subrc.
WHEN 1. RAISE program_error.
WHEN 2. RAISE others.
ENDCASE.
ENDIF.
Regards
Krishna
Edited by: Krishna Gowrneni on Apr 17, 2009 5:27 PM -
Report Layout Variant - transaction S_AHR_61016503 - Staff Assignments
Hi,
One of our users has created a layout variant in the above report. Some other users can view and choose the layout but one cannot. Is there an authorisation object missing? If not, does anyone have any ideas why this one person cannot view it.
Thanks
HannahHi Arun,
Thanks for your reply. If the authorisation group is blank, shouldn't anyone be able to view it?
Thanks
Hannah -
Hi Experts,
I am working on a POWL for Performance management. When I try to change the fields displayed in the layout variant in the transaction POWL_QUERYR, the changes made is reflecting only for me and not for other users.
Could you tell me what should be done for reflect it for other users.
Thanks & Regards,
Arun.Hi Arun,
To reflect this for all users you need to enter your application in administration mode (usually there is a flag on the url: sap-config-mode=X). Once in there you can make changes by holding down CTRL and right clicking on any element.
There are some authorisations needed to complete this - more detail on that can be found [here|http://help.sap.com/saphelp_nw04s/helpdata/en/46/98ce61f37d19ace10000000a11466f/content.htm]
When you are finished and click save it should then ask you to transport your changes.
Hope that helps,
Brenton. -
Unable to set default layout variant in POWL
Hi Experts
We have performed below activity in POWL_QUERY to assign default layout variant.
1. Choose Layout variant.
2. A browser window for the POWL_MASTER_QUERY appears.
3. Change the sap-config-mode from "X" to "config" within the URL.
4. Now you can define your layout variant and save your changes.
5. Log on to the Customizing client and start transaction POWL_QUERY.
6. Assign your created layout variant in the Layout selection field.
But Still I am not able to see selected layout.
I am using NWBC 4.0 and NW - 7.02.
Please advice.
Regards,
YogeshHi!
We have same problem!
The layout can be selected in application, but it is not taken as default.
We appreciate your feedback
Best Regards.
Angelica -
Layout Variants - global defaults
Is there a way for users to be able to setup a global layout variant, save it as their personal default and not affect anyone elseu2019s default global layout variant?
In other words, say a manager wants to set up a layout variant for all of their subordinates; the manager sets up a global layout variant, the subordinates display and save that global layout variant as their personal default layout variant (without first saving it as a user-specific variant). It then becomes their personal default layout variant without changing the default global layout variant across the system.
Thanks.Sorry my earlier solution won't work(I did't test).
I think there is no straight option for doing this.but i'm sure some work around this would achieve our purpose.
See,in this way you may need to create two exact same layouts for each user.One layout should be set as user-specific and default both.
And other one should not be set neither user-specific nor default just simply save and this one will be available for all other users.
so this kind of work around and maintaining two exact layouts per user would solve our problem surely. -
I have been asked to support a 4.5 system and they are using SIS which I have no experience. The consultant set up the structures and everything seems to be meeting the business needs.
One issue is that users would like to save layout variants. The selection variants are fine but the layout variant option is disabled in the menu bar.
Can anyone tell me how I can enable layout variants? Is it authorizations related or something else?
Thanks,
BrianHi Brian;
Yes, this is indeed an authorization issue. I had a similar issue and found out that this to be an auth issue.Pls check with Basis and get your auth.
Regards,
Mani.
Maybe you are looking for
-
To identify the user running the job at runtime
Hi All, My requirement is to develop a program which need to send mail only if a particular user runs the job. I need to read the user who runs the job at runtime, i tried with SY-UNAME but it holds the user name of the person who created the job at
-
HP 1200 not printing pdfs/uses default fonts in Word docs
Happy Birthday USA! Last week I loaded 10.4.10 to Mac mini and eversince I have not been able to print pdfs from Adobe Reader or print desired fonts from Word. (I have overcome default to US letter problem in Word) I have loaded latest drivers from H
-
PDF shows background color as white. Prints black. HELP!
I'm trying to print the screen the way I see it which is a white background with black font and an image, but it won't. I went under preferences and accesibility and replaced document colors to black text and white background. However, it still print
-
Messages fail in PI with error "Message ID already exists in database"
Hi Guru's, The scenario is from FILE->PI->MDM . Few messages fail in PI with the error Message ID 415a6324-dd3d-11e3-94e0-00000613e84e already exists in database . I have already seen the SAP NOTE : 1361305 , My doubt is if this error is any way rela
-
Tuple Loads using Import Manager
Running on 7.1 SP05 using the SAP supplied Vendor Master repostory archive. Attempting to load company code data in the Vendors main table. Company Code Data is set-up as a tuple table in Console. When defining the map in Import Manager it will only