Last 2 fields to be displayed in ALV
HI Experts,
I need your help once again.
My ALV using OOPS has 24 columns and the its is very long. Im not able to scroll to the last field in my ALV .WEven if i scroll only
22 fields are visible. Please let me know how to scroll to make all the fields visible.
Thanks in Advance
SS
Hi,
In Layout structure (lvc_s_layo) there is field CWIDTH_OPT, set it to 'X'.
This will optimize the Column Width.
Thanks & regards,
ShreeMohan,
Similar Messages
-
How to get which fields are currently displayed by ALV?
Hi ,
I have a program which displays list in the form of ALV . I have a parameter on the screen which takes the layout name from the user. At the same time I have the parameter which takes the filename from the user.
Now the program should write only those fields to the file which are displayed on the screen depending on the layout.
How can I get the names of the fields which are displayed on the ALV layout so that I can write only those fields to the file ?
[Here the requirement is such that we have to provide seperate download to file option even if we have the same functionality provided by the ALV]
Please suggest.
NainaYOu can use one these FMs before filling up your download table:
REUSE_ALV_GRID_LAYOUT_INFO_GET
REUSE_ALV_LIST_LAYOUT_INFO_GET
IF g_grid IS INITIAL.
CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_GET'
IMPORTING
es_layout = g_layout
et_fieldcat = g_fieldcat_tab[]
et_sort = g_sortfields_tab[]
et_filter = g_filter_tab[]
* ES_LIST_SCROLL = G_SCROLL
es_variant = g_variant
EXCEPTIONS
no_infos = 1
program_error = 2
OTHERS = 3.
ELSE.
CALL FUNCTION 'REUSE_ALV_LIST_LAYOUT_INFO_GET'
IMPORTING
es_layout = g_layout
et_fieldcat = g_fieldcat_tab[]
et_sort = g_sortfields_tab[]
et_filter = g_filter_tab[]
es_list_scroll = g_scroll
es_variant = g_variant
EXCEPTIONS
no_infos = 1
program_error = 2
OTHERS = 3.
ENDIF.
Regards,
Naimesh Patel -
Newly added field not getting displayed in ALV output
Hi All,
I'm adding one more field/column to be displayed in an old existing program that uses REUSE_ALV_FIELDCATALOG_MERGE to generate the ALV fieldcat.
DATA: BEGIN OF it_salary OCCURS 0,
pernr LIKE pa0000-pernr,
ename LIKE pa0001-ename,
rtext like lv_rtext, -
added field
waers LIKE pa0008-waers
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = driver
i_internal_tabname = 'IT_SALARY'
i_client_never_display = 'X'
i_inclname = driver
CHANGING
ct_fieldcat = lv_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = driver
it_fieldcat = lv_fieldcat[]
i_default = 'X'
i_save = 'A'
is_variant = lv_tmplt
is_layout = lv_ls_layout
i_callback_user_command = 'USER_COMMAND'
TABLES
t_outtab = it_salary
EXCEPTIONS
program_error = 1
OTHERS = 2.
The newly added field is not getting populated in the lv_fieldcat table. Tried running programs BALVBUFDEL,
BCALV_BUFFER_DEL_SHARED then logging off and logging in but of no help.
Please provide suggestion for this issue.
Regards,
Sridevi SHi,
Fieldcat is buffered - so use
I_BYPASSING_BUFFER = 'X'
Since a while CL_GUI_ALV_GRID is available which does NOT need any fieldcat (is determined internally using RTTI). It is worth playing around whith this class if you have some time. This class is recommended for ALV Output by SAP (but no edit is possible - was never supported officially).
A simple use would be:
data: gt_output type standard table of (adjust!).
*simple ALV output
data go_alv type ref to cl_salv_table.
data go_functions type ref to cl_salv_functions_list.
data go_columns type ref to cl_salv_columns_table.
data go_column type ref to cl_salv_column_table.
*Exceprion handlig
data: go_exception type ref to cx_root,
gv_errortext type string.
** fill table gt_output ...
** ALV output
if not gt_output is initial.
try.
call method cl_salv_table=>factory
importing
r_salv_table = go_alv
changing
t_table = gt_output.
catch cx_salv_msg into go_exception.
gv_errortext = go_exception->get_text( ).
message gv_errortext type 'A'.
endtry.
* enable all standard ALV functions
go_functions = go_alv->get_functions( ).
go_functions->set_all( ).
* hide MANDT
go_columns = go_alv->get_columns( ).
go_column ?= go_columns->get_column( columnname = 'MANDT' ).
go_column->set_technical( ).
go_alv->display( ).
Kind regards,
Holger -
Dynamic fields to be displayed in ALV
Hi All,
I've a requirement like this.
I have table type with 10 fields and I use this to display data in ALV. Now, I need to add few dynamic columns (based on customizing) and show in the same ALV. Since these fields are dynamic and new fields can also be added in the future, I can not enhance the structure I am using at present. So, the solution would be to add dynamic columns to the output table that is sent to ALV display.
Adding fields to field catalogue is not a big ask and I am already done with that. Moreover, I have tried enhancing the current structure with a field of type DATA and populated it.
But, technically, it is a single field and cannot be split into the different new fields at the time of output.
How is this possible? Please provide me with example code also, if you have.
Thanks in advance,
Srinath.Hi Srinath,
I for this purpose I use my own solution since a couple of years with success. It was originally developed for ALV functions module. In OO the field catalo has a slightly different structure, nut one can be easily converted into the other using function module (don't remember the name right now).
Recently I created a class with static functional methods for this:
METHOD fieldcat_alv .
TYPE-POOLS:
sydes.
DATA:
lv_desc TYPE sydes_desc,
ls_alv_fieldcat TYPE slis_fieldcat_alv,
lv_longfield TYPE dynfnam.
FIELD-SYMBOLS:
<typeinfo> TYPE sydes_typeinfo,
<nameinfo> TYPE sydes_nameinfo.
DESCRIBE FIELD it_table INTO lv_desc. "#EC *
LOOP AT lv_desc-types
ASSIGNING <typeinfo>
WHERE NOT idx_name IS INITIAL
AND table_kind IS INITIAL "no entries for deep table like color
AND back = 2. "top-level-entries only.
READ TABLE lv_desc-names INDEX <typeinfo>-idx_name
ASSIGNING <nameinfo>.
CHECK <nameinfo>-name <> 'INCLUDE'.
ls_alv_fieldcat-fieldname = <nameinfo>-name.
WHILE NOT <nameinfo>-continue IS INITIAL.
ADD 1 TO <typeinfo>-idx_name.
READ TABLE lv_desc-names INDEX <typeinfo>-idx_name
ASSIGNING <nameinfo>.
CONCATENATE
ls_alv_fieldcat-fieldname
<nameinfo>-name
INTO ls_alv_fieldcat-fieldname.
ENDWHILE." not <nameinfo>-continue IS INITIAL.
READ TABLE lv_desc-names INDEX <typeinfo>-idx_help_id
ASSIGNING <nameinfo>.
IF sy-subrc = 0.
* Caution: Help-ID may be Tablename-Fieldname and thus longer
* than 30 Chars; ls_alv_fieldcat-rollname is 30 Chars only
ls_alv_fieldcat-rollname = <nameinfo>-name.
lv_longfield = <nameinfo>-name.
WHILE NOT <nameinfo>-continue IS INITIAL.
ADD 1 TO <typeinfo>-idx_help_id.
READ TABLE lv_desc-names INDEX <typeinfo>-idx_help_id
ASSIGNING <nameinfo>.
CONCATENATE
lv_longfield
<nameinfo>-name
INTO lv_longfield.
ENDWHILE." not lv_desc-continue is initial.
* help id may be data element or <table>-<field>
IF lv_longfield CA '-'.
* get datatype for table field
CALL METHOD get_rollname_4_tabfield
EXPORTING
iv_fieldname = lv_longfield
CHANGING
cs_alv_fieldcat = ls_alv_fieldcat.
ENDIF." lv_longfield ca '-'.
ELSE.
* No Help-ID: Use Fieldname as text
ls_alv_fieldcat-seltext_s =
ls_alv_fieldcat-seltext_m =
ls_alv_fieldcat-seltext_l =
ls_alv_fieldcat-reptext_ddic =
<nameinfo>-name.
ENDIF." sy-subrc = 0.
* Starting 4.7: get edit mask
IF NOT <typeinfo>-idx_edit_mask IS INITIAL.
READ TABLE lv_desc-names INDEX <typeinfo>-idx_edit_mask
ASSIGNING <nameinfo>.
ls_alv_fieldcat-edit_mask = <nameinfo>-name.
IF NOT <nameinfo>-continue IS INITIAL.
ADD 1 TO <typeinfo>-idx_edit_mask.
READ TABLE lv_desc-names INDEX <typeinfo>-idx_edit_mask
ASSIGNING <nameinfo>.
CONCATENATE
ls_alv_fieldcat-edit_mask
<nameinfo>-name
INTO ls_alv_fieldcat-edit_mask.
ENDIF." not <nameinfo>-continue IS INITIAL.
ENDIF." not <typeinfo>-IDX_EDIT_MASK is initial.
* assign length, output length and decimals
ls_alv_fieldcat-intlen = <typeinfo>-length.
ls_alv_fieldcat-outputlen = <typeinfo>-output_length.
ls_alv_fieldcat-decimals_out = <typeinfo>-decimals.
ls_alv_fieldcat-inttype = <typeinfo>-type.
APPEND ls_alv_fieldcat TO rt_fieldcat.
CLEAR: "prevent anything 2 B taken for subsequent fields
ls_alv_fieldcat.
ENDLOOP." at lv_desc-types where not IDX_NAME is in initial.
ENDMETHOD.
Parameters required
importing
IT_TABLE type STANDARD TABLE
returning
value(RT_FIELDCAT) type SLIS_T_FIELDCAT_ALV .
and
method GET_ROLLNAME_4_TABFIELD .
FIELD-SYMBOLS:
<dfies> TYPE dfies.
DATA:
lv_tabname TYPE tabname,
lt_dfies TYPE TABLE OF dfies,
lv_fieldname TYPE fieldname.
SPLIT iv_fieldname AT '-'
INTO lv_tabname lv_fieldname.
CLEAR cs_alv_fieldcat-rollname.
CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
tabname = lv_tabname
fieldname = lv_fieldname
* LANGU = SY-LANGU
* LFIELDNAME = ' '
* ALL_TYPES = ' '
* IMPORTING
* X030L_WA =
* DDOBJTYPE =
* DFIES_WA =
* LINES_DESCR =
TABLES
dfies_tab = lt_dfies
* FIXED_VALUES =
EXCEPTIONS
not_found = 1
internal_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.
ELSE.
READ TABLE lt_dfies ASSIGNING <dfies> INDEX 1.
cs_alv_fieldcat-rollname = <dfies>-rollname.
* Und wenn keinerlei Twexte gepflegt sind?
IF <dfies>-reptext IS INITIAL AND
<dfies>-scrtext_s IS INITIAL AND
<dfies>-scrtext_m IS INITIAL AND
<dfies>-scrtext_l IS INITIAL.
* No Text: Use Fieldname as text
cs_alv_fieldcat-seltext_s =
cs_alv_fieldcat-seltext_m =
cs_alv_fieldcat-seltext_l =
cs_alv_fieldcat-reptext_ddic =
cs_alv_fieldcat-fieldname.
ENDIF." <dfies>-reptext IS INITIAL AND
ENDIF.
endmethod.
parameters required
importing
IV_FIELDNAME type DYNFNAM
changing
value(CS_ALV_FIELDCAT) type SLIS_FIELDCAT_ALV .
Put this into class Z_CL_UTIL using SE80 and generate field catalog dynamically using statement
lt_fieldcat = Z_CL_UTIL=>fieldcat_alv( itab ).
If you have any difficulties with implementation, let me know.
Regards,
Clemens Li -
New field category not display in ALV report
Hi,
Hi, I modifying an existing ALV report.
I have a problem to insert the new field into the ALV report.
The field and column title have been populated in alv field category correctly, but when FM 'REUSE_ALV_GRID_DISPLAY' executed, the new field and column didn't appear.
Anybody can help me.
Regards
Nislinahi
Add that new field in the fieldcatalog and populate the value in the value in the internal table.
loop at it_fieldcatalog into wa_fieldcatalog.
wa_fieldcatalog-fieldname = 'NEW_FIELD'.
wa_fieldcatalog-outputlen = '15'.
append wa_fieldcatalog to it_fieldcatalog.
clear wa_fieldcatalog,
endloop.
regards
ravish
<b>plz reward points if helpful</b> -
Field not displaying in ALV??
Hi Experts,
I am enhancing(just addition of one field to the existing alv display) the existing ALV report i.e. exisiting_alv
So, first, I copied the code by giving the target prog. name i.e. new_alv.
So, I started the follwoing changes in new_alv code,
I added one filed in the itab,
I added this filed in SELECT statement (its a JOIN SELECT),
I added it in the field catalog.
It worked well.
So, I want to do the same in existing_alv code, so, I did the same i.e.
I added one filed in the itab,
I added this filed in SELECT statement (its a JOIN SELECT),
I added it in the field catalog.
(In debug mode, I checked that, Weather the data is coming into ITAB or not? Its coming from DB into ITAB!)
But, here its not working, even though I tried with itab, alv field catalog order i.e. keeping my field in the first, in the last, in the middle of itab and alv filed catalog?
So,
1- What culd b the reason ie. Its working well in copied code new_alv and not working in the original existing_alv code?
2- Is it overlapping some where?
3-Bcoz of join conditions in the select statemtnt?
4-How to fix it?
If any of the reason, then Why its displaying/working well in copied prog. i.e. new_alv?
ThanQ.
Message was edited by:
Sridhar
Message was edited by:
Sridhar
Message was edited by:
SridharHello Sridhar
If the new field is added to the fieldcatalog and the itab then it should be displayed as additional column on the ALV list. If not then mostly likely there is a <b>layout </b>defined for the ALV list where this field is simply missing. Change the layout and add the missing column.
Regards
Uwe -
New ALV field is not displaying
Hi
I have added the currency field in the existing ALV report.
The final internal table having the currency field and it has value. Curreny field is not displaying in output. Pls help
Below is my ALV code for currency.
PERFORM FILL_FIELDCAT USING
'WAERS' SPACE SPACE 'CURRENCY' 'CURRENCY' 'CURRENCY'.
READ TABLE GIT_FIELDCAT INTO LX_FIELDCAT
WITH KEY FIELDNAME = 'WAERS' .
LX_FIELDCAT-OUTPUTLEN = 5.
LX_FIELDCAT-JUST = 'L'.
MODIFY GIT_FIELDCAT FROM LX_FIELDCAT INDEX SY-TABIX.
FORM FILL_FIELDCAT USING P_FIELDNAME
P_NO_OUT
P_DO_SUM
P_SELTEXT_S
P_SELTEXT_M
P_SELTEXT_L. "#EC *
DATA: LX_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
CLEAR LX_FIELDCAT.
LX_FIELDCAT-TABNAME = 'GIT_LIST'.
LX_FIELDCAT-FIELDNAME = P_FIELDNAME.
LX_FIELDCAT-NO_OUT = P_NO_OUT.
LX_FIELDCAT-DO_SUM = P_DO_SUM.
LX_FIELDCAT-SELTEXT_S = P_SELTEXT_S.
LX_FIELDCAT-SELTEXT_M = P_SELTEXT_M.
LX_FIELDCAT-SELTEXT_L = P_SELTEXT_L.
APPEND LX_FIELDCAT TO GIT_FIELDCAT.
ENDFORM. " FILL_FIELDCATYou have to [maintain maintenance dialog|http://help.sap.com/SAPHELP_NWPI71/helpdata/EN/a7/513484407a11d1893b0000e8323c4f/frameset.htm] as described in the link.
Regards,
Raymond -
Need to remove space for a field when displayed in ALV Report
Hi,
I have material field of length 18, but the content is only 10 char. I need to remove the extra space when it is displayed on ALV Report.
Is there any option in ALV field catalogueuse statement condense.
condense zmatnr.
also giv output lenth of alv column as 10. -
How to display the editable fields in output of an ALV report?
Hi all,
I have a requirement of displaying values in ALV Grid format and above this grid display i have to put some fields , that are editable.
I know making ALV grid fields as editable, but here requirement is to display some fields before displaying the ALV grid dispaly and to enable these fields editable to user and when printing this the values entered by user also has tobe printed.
Please help me on solving this problem? Is it possible to do this with ALV function modules?
Thanks,
Vamshi.Hi all,
Thanks for your replies.
But this is not my requirement. I mentioned in my question that i too know how to edit the fields in ALV grid report.
Here my requirement is .
name :_____________
amount:____________
alv grid display
Like above i need to display. after name the user can be enter value and after amount also the user can be enter some value at output . But this is not the header of ALV .
Is this possible in classical ALV or Classical report? If not please specify alternative?
Thanks,
Vamshi. -
Changing field catalog of ALV grid after first display (was: "ALV GRID")
Dear experts!
I am using CL_GUI_ALV_GRID to display an ALV, whose fieldcatalog has 5 fields (FIELD1, FIELD2, FIELD3, FIELD4 and FIELD5).
I am setting "NO_OUT = 'X' " to the fields FIELD3 and FIELD5 in the fieldcatalog before call the method SET_TABLE_FOR_FIRST_DISPLAY.
If a specific event occurs on the screen, I would like to set "NO_OUT = 'X'" to the fields FIELD2 and FIELD4 and I would like to set the "NO_OUT = ''" to the fields and FIELD3 FIELD5. This should happen at runtime after the method call "SET_TABLE_FOR_FIRST_DISPLAY".
I've tried using the method SET_FIELDCATALOG, but it is private.
Does anyone have any idea how to solve this problem?
Thank you very much!
Rubens
Edited by: Thomas Zloch on Aug 22, 2011 3:49 PM - subject correctedHi
Try to use the method SET_FRONTEND_FIELDCATALOG (it'll call private method SET_FIELDCATALOG)
Max -
Display concatenad fields under one column in alv.
How can I concatenate three or four fields(Taken from different tables) and can display under one column in ALV report?
I want to display:
final_column = production orderStatusmaterial type+maintenance status (concatenation of four fields).
production order: caufvd-aufnr
status: tj02t-txt04
material type: mara-mtart
maintenance status:mara-pstat
I want to display only final_column in my alv output screen.
Kindly guide.
Thanks and regards.
Thanks and regards.
Message was edited by:
cinthia nazneenPlease go through the below code and do the same for appearing the four fields of different table into One Field catalog at Display by Concatenating .
DATA :v_tmp type string .
Loop at itab1.
Read table itab2 key field1 = itab1-field1 .
Read table itab3 key field1 = itab1-field1 .
Read table itab4 key field1 = itab1-field1 .
Concatenate itab1-field1 itab2-field1 itab3-field1 itab4-field1 into v_tmp.
fieldcatalog-fieldname = 'V_TMP'.
fieldcatalog-seltext_m = 'Item change date'.
fieldcatalog-col_pos = 1.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
endloop.
Reward points if it is usefull .....
Girish -
Field of character length 255 not displaying in ALV output
Dear all,
i am trying to display a field of ztable with lenght 255 character, same is not displaying at ALV output.
it is displaying only upto 128 characters in ALV output.
table is Ztable-zfield with CHAR255 length.
please help me.
Regards,
Sam.Hi Sam Johny,
In ALV Grid the maximum characters can be displayed in one column is 128 Characters..
But for your solution you can press Print Preview Button to view more text(or Press Ctrl + Shift + F10 )...
Else try with ALV LIST
and pass FIELDCAT-OUTPUTLEN = '255' for field in fieldcatalog
Hope it will solve your problem..
Thanks & Regards
ilesh 24x7
ilesh Nandaniya -
New field not displaying in ALV
Hi all,
I have worked with ALV before, but currently I'm facing the problem of adding a new field to the ALV but it was not display on the screen. I have checked the fieldcatalog table and internal table right before the call of GRID-> SET_TABLE_FOR_FIRST_DISPLAY. All seems to be fine at this moment. Just that the new field was not displayed on the screen. Any idea?Hello Mil
If you are using the old-fashioned ALV you will find several push-buttons for changing the ALV layout.
If you are using OO-based ALV then you will have a single push-button in the ALV toolbar with dropdown menu to select the specific function.
In any case, choose function "Change layout...". Usually you will get a popup with two lists of fields:
- on the left side you see the currently displayed fields in the ALV list
- on the right side you see fields that can additionally displayed
For sure you will find your missing field there.
Regards
Uwe -
Field doesnu0092t display in alv , why ?
WHEN 'NETPR' .
LS_FCAT-COLTEXT = TEXT-031 .
LS_FCAT-COL_POS = 29.
LS_FCAT-OUTPUTLEN = 15 .
LS_FCAT-DATATYPE = 'CURR' . "'QUAN'.
LS_FCAT-rollname = 'NETPR'.
when the report is display , the field doesn't show up ?
also if i reduce the number of Columns ( in the field catalog )
for display there is no change
all the other fields are display except the "NETPR"
when i check the "layout change" he is there ,
also he is display if i reduce the number of columne for display ( by layout change)hi,
see this.
did u append the data to field catlog internal table also please check .
fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-col_pos = 7.
fieldcatalog-outputlen = 15.
fieldcatalog-do_sum = 'X' "Display column total
fieldcatalog-datatype = 'CURR'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
Regards
Anver -
Do not display field in report output using ALV
Hello friends,
I have a dilemma here. I sorted my report using a dummy field named asset_dum. now, this is my basis of sub totals but I do not need to show it in the display. Is there a way or an option to do this?Hi,
The problem with NO_OUT is that if the user changes the layout he can see the field and there is nothing in the system that would stop him from displaying the same.
However TECH field should be useful in your case.
TECH
If this field is set, the relevant field is not displayed on the list and cannot be shown interactively. The field is only known in the field catalog. (For example, it must not be specified as a sorting criterion).
Regards,
Ravi
Note : Please close the thread if the issue is resolved and mark all the helpful answers
Maybe you are looking for
-
I just bought my first Apple. Yeah! I am trying to set up the printer that is connected through a USB to my MAC mini to be able to share with my windows laptop. I have gone through the steps to share the printer as well as files. My laptop now recogn
-
My old MacBook pro died, got a new Mac can I use my cs4 with my new computer?
MMy old MacBook pro died, got a new Mac, can I use my cs4 with my new computer? Do I need to buy a new license?
-
System requirement for Business Object XI 3.1
Hi, I am wondering if someone can gives us some basic information regarding the system requirement to setup the Business Object 3.1 enterprise. We have tried 2CPU & 2GB memory in a VM environment, it ran very very slow and CPU went up 100% very easi
-
JAX-WS 2.1.1 RI on Sun App Server 8.1
I'm trying to deploy a JAX-WS 2.1.1 web service on Sun App Server 8.1 and I keep getting these "no such method" exceptions thrown: java.lang.NoSuchMethodError: javax.xml.soap.MessageFactory.newInstance(Ljava/lang/String;)Ljavax/xml/soap/MessageFactor
-
Can't run plugin with action. Please help....
Hi gang, for years I used Tiffen DFX plugin and would use it (and other plugins) in a custom action to batch process a folder of images. When I upgraded from CC to CC2014, I lost that ability with DFX. My other plugins work just fine using an action