How to fix a variant in ALV layout management
Hi experts
I have a requirement to fix one of standard layout of a ALV when user execute it, is there a way to excecute it (variant) from code lines in program?
I will appreciate any information.
Regards
mgg
Solved.
I create a layout variant and transport it.
Thanks.
Similar Messages
-
How to transport display variants in alv
Hi,
Can any one please help me in transporting alv display variants?Actually I have transported the variants ,but only selection variants are getting transported.I want to transport ALV display variants accross the clients.
Please reply soon.It is very urgent.Hi,
Please use the following :
First execute the report .
Then Menubar Settings> Layout> layout management>select your variant> menubar layout--> transport
This will work only when your variant management is activve in your ALV report. -
How to fix few rows in ALV after filtering on a column in Web Dynpro ABAP
Hi,
I have the following requirement:
In an ALV, when i filter based on a column, then this filter should not be applied to 2 of its rows.
These rows relate to totals. The totals are manually calculated as they require other component information too.
Along with the filter result, these total rows have to be displayed.
Let me know in case ALV in Web Dynpro ABAP supports this functionality.
Regards,
RekhaHi,
ALV table does not support this functionality.
You can display the total in an another table instead.
I had the same requirement with total and had to display the totals separately.
Thanks,
Feroz -
BW BPS Web Page(BSP App): how to Freeze columns in a ALV Layout?
Hi Gurus,
I'm trying to freeze the first columns of my layout when scrolling to the right.
I got the scrollbar including html(javascript) text element in my web page, but i for the moment I'm stuck with the freezing column.
I'd appreciate some help.
Thanks in advance.
IPHi, the problem is in the Web page, not in the layout definition.
The first thing i did was to freeze columns in the layout definition, but when you build your web page(bps_wb) those settings aren´t applying.
I guess i need javascript to do it. Any suggestion?
Thanks -
Variant in ALV selection screen
Hi friends,
How to protect a variant in ALV selection screen from changing or deleting by other users.
Thanks,
RajeshRajesh,
You still need someone to be able to change the variant, right? That is what exactly PROTECT VARIANT does.
If you select the field Protect variant, the variant can only be changed by the person who created it or last changed it.
Regards,
Ravi
Note :Please mark the helpful answers and close the thread if the quesiton is answered -
Hi Guys,
Any ideas how can I set the specific ALV layout fo FBL1N report in the way, that special group of users see only one/few specific document types (not all of them) for the certain supplier. I don't want to do that in ABAP.
Regards
Adamhi Adam,
you can assign authorization to each single document type in transaction OBA7. You also have to maintain the user profiles as well (the respective auth object is F_BKPF_BLA). Of course this will be valid in the whole system, but it does not make much sense that users have limited authorization in one specific transaction only.
hope this helps
ec -
Does anyone know how to win a fight with layout manager?
I am using the form designer in netBeans to design my page, which has a jPanel on the left and a number of controls on the right.
My problem is that when I eventually get it to look half right at design time, it looks different at run time. The fonts are different, the combo boxes are a different height and some of my text boxes are 4 times as wide. http://RPSeaman.googlepages.com/layout.GIF shows both the design-time view and the run-time view. How can I win my fight with layout manager?I'd like to do an experiment where you take say 20 pairs of students of java, with each pair matched in terms of prior programming and java experience, general knowledge, etc... and set one of each pair to learn Swing using netbeans and its layout generator with the other pair learning to code Swing by hand. Then 6 months later compare their abilities. I'll bet that the code by hand group will blow the other group out of the water in terms of understanding and ability.
Just my 2 Sheckel's worth. -
How to make Default ALV layout
Hi,
I want to make 'STANDARD view' as a default ALV Layout...If anybody execute my ALV Report STARD Layout variant should display by default. Other variant layouts they can select from drill down..
I know class and method but i don't know how to write code for this with paremeters..Can anybody help on code please..
CLASS : CL_SALV_WD_C_TABLE
METHOD : IF_SALV_WD_COMP_TABLE_PERS~SET_STANDARD_VIEW
My current ALV CODE
DATA: l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table .
DATA: l_value TYPE REF TO cl_salv_wd_config_table.
l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).
l_value = l_ref_interfacecontroller->get_model( ).
Thanks.,
SubbaHi sarbjeet singh,
Thanks for your reply...
I didn't understand your answer...Already this view gone to production system and every USER created his own view..
Now how can make default standard view to all users..
If i keep Standard view as Intial view and release transport to production is it effected to all users and display standard view as initial view?
Thanks,
Subba -
Unable to save the ALV layout variant and display of selection screen on F4
Hi All,
The end user wants to directly select the layout variant (SLIS_VARI). I have used the following code to display the layout variant on selection screen. But, I am unable to save the variant on ALV. Whenever I am trying to select the layout variants (by doing F4 on selection screen) its displaying "No Layout found".
Following is the code for displaying layout variant:
PARAMETERS: p_var TYPE slis_vari.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var.
PERFORM f4_variant CHANGING p_var.
FORM f4_variant CHANGING c_variant TYPE slis_vari.
DATA: ls_variant TYPE disvariant,
l_exit TYPE char1.
ls_variant-report = sy-repid.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = ls_variant
i_save = 'A'
IMPORTING
e_exit = l_exit
es_variant = ls_variant
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.
IF l_exit EQ space.
c_variant = ls_variant-variant.
ENDIF.
ENDIF.
ENDFORM. " f4_variant
and following is the code for displaying the ALV:
FORM edition_alv.
ws_variant2 = ls_variant.
* Call ALV editor in list mode
IF p_list = 'X'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = ws_extract1-report
i_callback_user_command = ws_user_command
is_layout = ws_layout
it_fieldcat = wt_fieldcat
it_sort = wt_sort
i_save = 'A'
is_variant = ws_variant2
it_events = wt_events[]
TABLES
t_outtab = wt_edition.
* Call ALV editor in grid mode
ELSE.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = ws_extract1-report
i_callback_user_command = ws_user_command
it_fieldcat = wt_fieldcat
it_sort = wt_sort
i_save = 'A'
is_variant = ws_variant2
it_events = wt_events[]
TABLES
t_outtab = wt_edition.
ENDIF.
ENDFORM.
I am not sure whats going wrong, but I am unable to save variants.
Please help.
Thanks,
Vishal.The F4 will display you the existing layouts only. So you need to save the layout first & then execute the report again & check if you are getting F4 values for that field.
The Layout needs to get stored with variant.
Regards,
Mahesh -
ALV layout variant missing in background job.
hi guys,
Having problem on getting the default ALV layout variant when run the job in backgorund. Please advise any correction needed in the following code.
Thanks.
*& Include Z_MM_KBR_AGSUBCONINV_MOD2 *
MODULE status_0100 OUTPUT.
SET PF-STATUS '100'.
SET TITLEBAR '100'.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module display_data OUTPUT
text
MODULE display_data OUTPUT.
IF sy-batch IS INITIAL. "Foreground
IF w_container IS INITIAL.
IF cl_gui_alv_grid=>offline( ) IS INITIAL.
*Creating the container
CREATE OBJECT w_container
EXPORTING
container_name = c_container
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
*Creating the ALV GRID
CREATE OBJECT w_grid
EXPORTING
i_parent = w_container
i_appl_events = c_check
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
else.
exit.
ENDIF.
ELSE.
*Creating the ALV GRID
CREATE OBJECT w_grid
EXPORTING
i_parent = go_dock_container
i_appl_events = c_check
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5.
IF sy-subrc <> 0.
WRITE:/ 'Error in grid'.
ENDIF.
CREATE OBJECT w_grid
EXPORTING i_parent = go_dock_container.
ENDIF.
*getting the variant option
wa_variant-report = sy-repid.
wa_variant-username = sy-uname.
wa_layout-grid_title = sy-title.
wa_layout-cwidth_opt = c_check.
wa_layout-zebra = c_check.
wa_layout-no_f4 = c_check.
wa_layout-sel_mode = 'D'.
*Excluding the unwanted buttons
PERFORM exclude_toolbar_buttons.
build field catalog.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_buffer_active = c_check
i_structure_name = c_fcat_str
i_bypassing_buffer = c_check
CHANGING
ct_fieldcat = t_fieldcat
EXCEPTIONS
inconsistent_interface = 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.
loop at t_fieldcat into w_fieldcat.
if w_fieldcat-FIELDNAME = 'AGING1'.
W_FIELDCAT-NO_ZERO = 'X'.
MODIFY t_fieldcat FROM W_FIELDCAT INDEX SY-TABIX.
ENDIF.
endloop.
Generate sort critria
PERFORM generate_sort.
Create object of class lcl_event_receiver.
CREATE OBJECT w_event.
Handler for events.
SET HANDLER w_event->handle_top_of_page FOR w_grid.
SET HANDLER w_event->handle_print_top_of_page FOR w_grid.
SET HANDLER w_event->handle_print_end_of_list FOR w_grid.
SET HANDLER w_event->handle_hotspot_click FOR w_grid.
*Displaying the alv
IF NOT sy-batch IS INITIAL.
PERFORM create_snp.
ENDIF.
t_data = i_final.
CALL METHOD w_grid->set_table_for_first_display
EXPORTING
i_save = 'A'
is_layout = wa_layout
is_variant = wa_variant
CHANGING
it_outtab = t_data
it_fieldcatalog = t_fieldcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
ENDIF.
ENDIF.
ENDIF.
ENDMODULE. " display_data OUTPUT
*& Module user_command_0100 INPUT
text
MODULE user_command_0100 INPUT.
DATA: lt_rows TYPE lvc_t_row,
w_rows TYPE lvc_s_row.
CASE sy-ucomm.
WHEN c_back.
LEAVE TO SCREEN 0.
WHEN c_exit.
LEAVE TO SCREEN 0.
WHEN c_cancel.
LEAVE TO SCREEN 0.
WHEN 'BILDET'.
CALL METHOD w_grid->get_selected_rows
IMPORTING
et_index_rows = lt_rows.
CALL METHOD cl_gui_cfw=>flush.
IF sy-subrc EQ 0.
READ TABLE lt_rows INTO w_rows INDEX 1.
READ TABLE i_vbfa INTO w_vbfa INDEX w_rows-index.
IF sy-subrc EQ 0.
CLEAR i_zbw_br_nf4.
LOOP AT i_zbw_br_nf3 INTO w_zbw_br_nf3 WHERE
refkey = w_vbfa-v_vbeln.
APPEND w_zbw_br_nf3 TO i_zbw_br_nf4.
ENDLOOP.
call dialog screen and display new alv control
CALL SCREEN 101 STARTING AT 10 5.
ENDIF.
ENDIF.
WHEN 'NOTAF'.
CALL METHOD w_grid->get_selected_rows
IMPORTING
et_index_rows = lt_rows.
CALL METHOD cl_gui_cfw=>flush.
IF sy-subrc EQ 0.
READ TABLE lt_rows INTO w_rows INDEX 1.
READ TABLE i_zbw_br_nf3 INTO w_zbw_br_nf3 INDEX w_rows-index.
DATA docnum LIKE j_1bdydoc-docnum.
docnum = w_zbw_br_nf3-docnum.
SET PARAMETER ID 'JEF' FIELD docnum.
CALL TRANSACTION 'J1B3N' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDMODULE. " user_command_0100 INPUT
*& Form modify_col_name
text
-->P_<FCAT> text
-->P_TEXT_H01 text
FORM modify_col_name USING pwa_fcat TYPE lvc_s_fcat
value(pw_text) TYPE any.
pwa_fcat-coltext = pw_text.
pwa_fcat-scrtext_l = pw_text.
pwa_fcat-scrtext_m = pw_text.
pwa_fcat-scrtext_s = pw_text.
ENDFORM. " modify_col_name
FORM display_hotspot *
FORM display_hotspot USING pw_row_id TYPE lvc_s_row
pw_column_id TYPE lvc_s_col.
FIELD-SYMBOLS <l_data> TYPE zbrforecast.
READ TABLE t_br_nf_acum ASSIGNING <l_data> INDEX pw_row_id-index.
CHECK sy-subrc = 0.
IF pw_column_id = ' '.
ENDIF.
ENDFORM. "display_hotspot
*& Form generate_sort
Genereate Sort criteria
FORM generate_sort.
Local variables
DATA: wal_sort TYPE lvc_s_sort,
wl_pos TYPE numc2.
wl_pos = 01.
sort ORDER
wal_sort-spos = wl_pos.
wal_sort-fieldname = c_aufnr.
wal_sort-up = c_check.
APPEND wal_sort TO t_sort.
ENDFORM. "generate_sort
*& Form f4_variant
text
<--PW_VARI text
FORM f4_variant CHANGING pw_vari TYPE disvariant-variant.
wa_variant-report = sy-cprog.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = wa_variant
i_save = c_u
IMPORTING
es_variant = wa_variant
EXCEPTIONS
not_found = 1
program_error = 2
OTHERS = 3.
IF sy-subrc IS INITIAL.
pw_vari = wa_variant-variant.
ELSE.
MESSAGE s208(00) WITH text-t04.
ENDIF.
ENDFORM. " f4_variant
*& Form validate_layout
*This subroutine is to validate the layout
No parameters are passed to this subroutine
FORM validate_layout.
IF NOT p_layout IS INITIAL.
Check Layout
wa_variant-report = sy-repid.
wa_variant-username = sy-uname.
wa_variant-variant = p_layout.
CALL FUNCTION 'LVC_VARIANT_EXISTENCE_CHECK'
EXPORTING
i_save = c_u
CHANGING
cs_variant = wa_variant
EXCEPTIONS
OTHERS = 01.
IF NOT sy-subrc IS INITIAL.
SET CURSOR FIELD 'P_LAYOUT'.
MESSAGE s001(00) WITH text-t06 p_layout.
STOP.
ENDIF.
ELSE.
clear wa_variant.
ENDIF.
ENDFORM. " validate_layout
*& Form validate_data
text
FORM validate_data .
PERFORM validate_layout.
ENDFORM. " validate_dataHi,
Before the call to method set_table_for_first_display, populate
wa_variant-report = sy-repid.
Best regards,
Prashant -
DB Table for Layout Variant in ALV report
Please help me by providing the table name which will get an entry when we save Layout Variant in ALV(OO ALV grid) output.
Hi,
I have seen the table LTDX which is giving me the Variant names for a particular program. Hope this will help you.
Database table is LTDX
Database view is V_LTDX.
Regards,
Venaktesh -
How can we use the saved alv grid layout in a report?
I have a requirement where I go to se16n transaction and select a few fields of a table and extract the data of the table. Again I re-arrange the columns in the report and save it as a variant along with this new layout. Now how to call this variant in a report wherein I want only the re arranged positions of the column(fields) of the field catalog? Is there any function module available?
hi,
you can have selection screen field : "parameters : p_disvar like disvariant-variant." and at event selection scree you can call the below function and select the variant create for the report.
"at selection-screen on value-request for p_disvar.
call function 'REUSE_ALV_VARIANT_F4'
exporting
is_variant = g_variant
I_TABNAME_HEADER =
I_TABNAME_ITEM =
IT_DEFAULT_FIELDCAT =
i_save = g_variant_save
importing
e_exit = h_exit
es_variant = gx_variant
exceptions
not_found = 1
program_error = 2
others = 3.
if sy-subrc is initial and h_exit is initial.
g_variant-variant = gx_variant-variant.
p_disvar = gx_variant-variant.
else.
message id sy-msgid type 'S'
number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
Atul -
Doubt in alv layout variant.
hi experts,
I have a requirement that my selection screen should have 'ALV LAYOUT' as one of my parameter. I am using PNPCE LDB , now my issue is I can get the layout option when f4 is press on the alv layout parameter but the respective layout is not displaying in my output.
ex: I have layout A and B .
A have only pernr and name
b have only pernr and address
my normal alv layout is pernr name and address. if i choose A in my ALV LAYOUT parameter also its displaying in default layout alv same is happening for while am choosing B. I not getting the alv output for respective layout I chosen.
{code}
FORM GET_VARIANT .
DATA: lw_variant TYPE disvariant,
l_exit TYPE char1.
lw_variant-report = sy-repid.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = lw_variant
i_save = 'A'
IMPORTING
e_exit = l_exit
es_variant = lw_variant
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.
IF l_exit EQ space.
p_layout = lw_variant-variant.
IF NOT p_layout IS INITIAL.
PERFORM get_w_variant.
ENDIF.
ENDIF.
ENDIF.
ENDFORM. " GET_VARIANT
*& Form GET_W_VARIANT
* text
* --> p1 text
* <-- p2 text
FORM GET_W_VARIANT .
DATA: lw_variant TYPE disvariant.
lw_variant-report = sy-repid.
lw_variant-handle = space.
lw_variant-log_group = space.
lw_variant-username = space.
lw_variant-variant = p_layout.
lw_variant-text = space.
lw_variant-dependvars = space.
ENDFORM. " GET_W_VARIANT
*& Form ALV_DISPLAY
* text
* --> p1 text
* <-- p2 text
FORM ALV_DISPLAY .
* DATA: l_table TYPE REF TO cl_salv_table.
* TRY.
* CALL METHOD CL_SALV_TABLE=>FACTORY
** EXPORTING
** LIST_DISPLAY = IF_SALV_C_BOOL_SAP=>FALSE
** R_CONTAINER =
** CONTAINER_NAME =
* IMPORTING
* R_SALV_TABLE = L_TABLE
* CHANGING
* T_TABLE = GT_ALV
* CATCH CX_SALV_MSG .
* ENDTRY.
* l_table->display( ).
DATA: lw_variant TYPE disvariant.
DATA:I_FIELD TYPE SLIS_T_FIELDCAT_ALV,
iWA TYPE SLIS_FIELDCAT_ALV.
IWA-FIELDNAME = 'PERNR'.
IWA-SELTEXT_L = 'EMPLOYEE ID'.
APPEND IWA TO i_FIELD.
IWA-FIELDNAME = 'NAME'.
IWA-SELTEXT_L = 'NAME'.
APPEND IWA TO I_FIELD.
IWA-FIELDNAME = 'DEPT'.
IWA-SELTEXT_L = 'DEPT'.
APPEND IWA TO I_FIELD.
IWA-FIELDNAME = 'UNION'.
IWA-SELTEXT_L = 'UNION'.
APPEND IWA TO I_FIELD.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = 'ZTESTPRGFOR20' "Program name
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = i_field
* it_sort = i_sort
i_save = 'X'
is_variant = Lw_variant
TABLES
t_outtab = GT_ALV
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.
ENDFORM. " ALV_DISPLAY
{code}hi Mohammed Quddus,
thanks for your reply . but if you look at my code the concept are same as same as that link code.
am getting all the things right.
i Can able to change the layout by the button on alv and
able to save that new layout
the saved layout are displaying in the my parameter if I press f4. the problem is if I choose the saved layout that layout is not coming in my alv output always its showing default layout.
if anything you find wrong in my code please let me know. -
How to find all the columns in an ALV Layout?
Hi all
Here's what I need to do. When I run a program (with ALV output in online mode) in the background mode, I need to save the data to a file. And this file is supposed to contain only those columns in a specified ALV Layout.
Any suggestion how to achieve this?
Thank you so much!!!hi,
u are appending to a field catlog.
eg:
int_fieldcatalog-fieldname = 'CHECT'.
int_fieldcatalog-seltext_m = 'Check No'.
int_fieldcatalog-col_pos = 0.
int_fieldcatalog-outputlen = 13.
int_fieldcatalog-emphasize = 'X'.
int_fieldcatalog-key = 'X'.
APPEND int_fieldcatalog TO int_fieldcatalog.
CLEAR int_fieldcatalog.
so chk this int_fieldcatalog internal table.
it will containthe field in the field in the ALV display.
rgds
anver -
How to display long text in SAP Query ALV layout? It only show 129 char now
I have a SAP Query which show a remark field(Max length more than 500 char), but it only show max length 129 char now. In fact, the lenght of remark field text is more than 300, and i had debug the source code, the field text value do is correct, its length do is 376.
Do anybody can help me solve the issue, let the query ALV layout can show the long text field value?
thanks very much in addvance.Hi,
ALV can show only a restrict value length around 128 characters, many experts said that we can not extend. many suggestions is split text into some column.
Regards,
Maybe you are looking for
-
MC.9 - spool is not getting generated
Hi Experts, When i execute MC.9 transaction in foreground i am able to view the report output. but when i execute it in background spool is not getting generated. Please provide me any solution for this issue. Thanks Pallavi
-
My itunes is in french!!
Yea this is a big problem cause it means itunes store doesnt work! I made an account on the website but the french login doesnt accept it.If anyone can tell me how to change the lanuage it would be a huge help. Thanks in advance.
-
SPB Weather Widget Stopped Working
Anyone else got SPB Weather installed on their C7 / N8, etc with the widget on one of their home screens? Mine was working fine up until the weekend but now the weather icons do not appear on the widget. When I launch the full application all seems t
-
hai, could anyone give the configuration steps required to configure ccm.does trex is mandatory in ccm.In srm we have maintianed twpurlsvr likethat does we have maintined any table in ccm?.is there any transaction like sicf in srm.how can we activate
-
What is going on with this phone!? The interface restarts several times a day, sometimes 4-5 times in under 15 minutes! If I run WebOS doctor it will be okay for a while, but eventually it will start crashing once in a while and return to this freque