Multiple level headers in column of an ALV report
Hi All,
I have a requirement . I need to display a two level coloumn in alv grid display .
Example :
| Cust no | Address |
| |------------------|
| | city | code |
Kindly please help how can i achieve this in alv report .
Regards.
Moderator message: not available, flat structures only, see online documentation of class or function module.
Edited by: Thomas Zloch on May 24, 2011 4:47 PM
Hi Ricky,
Kindly go through the link below:
http://help.sap.com/saphelp_erp2004/helpdata/EN/85/ce25c2d7ae11d3b56d006094192fe3/content.htm
Hope it helps you
Regrds
Mansi
Similar Messages
-
Change Column Heading in ALV Report
Hi,
I have developed a ALV Report, showing correct output.
Problem is that Column Heading is not showing correct...means it is showing as per field name. But We want to change as per our understand. i.e. One column heading is like Unrestricted Stock but we want Unrestricted Stock...(BILF is an indicator)..
We have write in the code..
FORM build_fieldcat10.
CLEAR fieldcat_ln.
ADD 1 TO col_pos.
fieldcat_ln-ref_tabname = 'MARD'.
fieldcat_ln-fieldname = 'LABST'.
fieldcat_ln-seltext_m = 'BILF Unrest.Stock'.
fieldcat_ln-key = space.
fieldcat_ln-do_sum = space.
fieldcat_ln-col_pos = col_pos.
fieldcat_ln-no_out = space.
fieldcat_ln-qfieldname = space.
fieldcat_ln-hotspot = space.
APPEND fieldcat_ln TO fieldcat.
ENDFORM. " BUILD_FIELDCAT1
But after change the selection text...not showing correct text..How can i change Column heading???
Please help me..Thanks a lot dear..
My problem resolved by using SCRTEXT_L. -
Change Column Headings in ALV Report Using OO
Hi Friends,
I am using OO to display a report with ALV Grid
I tried to change the column names but it still takes the column names from the DDIC.
My declaration is as follows
Data: num type dmbtr.
TRY.
lr_column ?= lr_columns->get_column( columnname = 'NUM' ).
lr_column->set_output_length('7').
lr_column->set_long_text( ' Value' ).
lr_column->set_short_text( ''() ).
lr_column->set_medium_text( 'Value' ).
CATCH cx_salv_not_found INTO gr_error.
gr_msg = gr_error->get_text( ).
MESSAGE gr_msg TYPE 'I'.
ENDTRY.
*--- display report
gr_table->display( ).
CATCH cx_salv_msg.
WRITE: 'Error displaying grid! - cx_salv_msg'(044).
CATCH cx_salv_not_found.
WRITE: 'Error displaying grid! - cx_salv_not_found'(004).
CATCH cx_salv_data_error.
WRITE: 'Error displaying grid! - cx_salv_data_error'(005).
CATCH cx_salv_existing.
WRITE: 'Error displaying grid! - cx_salv_existing'(006).
I need the column name as VALUE but it displays as Amount LC in the alv report.
Thanks
chaithanyaHey hello,
you have to change short medium and log text
look at this:
gr_columns = (Table got from factory)->get_columns( ).
gr_column = gr_columns->get_column('NAme').
gr_column->set_long_text('new name long').
gr_column->set_medium_text('new name medium').
gr_column->set_short_text('new name short ).
it will help
thanks
Edited by: Alfito on Nov 28, 2011 9:31 AM -
How to extract the column width in ALv report if its executed in background
I am executing an ALV report in background , in front end i am getting data properly, in back end for some columns some of the digits are missing.For example if PO no is of 10 digits it will display only 8 becos column size is like that , how to extract coulmns in back ground.
I have executed in background and checked the spool and for some of the columns width is not sufficient to display comeplete data so please suggest how to extract the columns sizes if executed inj background for an ALVHi Deepthi,
you can try with the above mentioned suggestions ,if its worked its fine ,
If not use Docking container instead of custom container, For ALV in back ground jobs, its suggest to use docking container instead of custom container , below you can find the declaration for docking container and code to use docking and custom container in your program for fore and back ground.
or you can use docking container alone for both operations.
Data : G_DOCK1 TYPE REF TO CL_GUI_DOCKING_CONTAINER,
IF CCON IS INITIAL. (ccon is container name )
*Check whether the program is run in batch or foreground
IF CL_GUI_ALV_GRID=>OFFLINE( ) IS INITIAL.
*Run in foreground
CREATE OBJECT CCON
EXPORTING
CONTAINER_NAME = 'CON1'.
CREATE OBJECT GRID1
EXPORTING
I_PARENT = parent_1.
ELSE.
*Run in background
CREATE OBJECT GRID1
EXPORTING
I_PARENT = G_DOCK1.
ENDIF.
ENDIF.
B&R,
Saravana.S -
Two line column heading in ALV Report
Hi Experts,
My requirement is that I have to create an ALV report with columns having two lines of headings. Like a main heading called Consultants under which 5 to 10 columns of departments(Dept Num, Num of Ppl , Manager etc. ) and then Contractors(Name, Address Etc ) underwhich there would be 5 to 10 departments. Right now my report has the depts of...
How can i do that . If u would suggest by CL_SALV_TABLE then it would be great.
Thanks a lot !
Saui don't think you can do it using cl_gui_alv_grid or cl_salv_table.
-
Two column header in ALV Report
Hi Experts,
Can I have 2 headers in ALV report kind of one header and one sub header below that.
like i have to display a report having the same information for 3 systems so in header I can have the system name and below that
usual headers.
Thanks
Yogesh Guptait is is not possible using the ALV GRID function, ALV OO.
it is possible with ALV List function. you might loose some functionalities layout etc.
check this sample..
cehck this image..
http://img100.imageshack.us/img100/3846/output6ef.th.gif
REPORT ZTEST_ALV message-id zz .
TYPE-POOLS: SLIS.
DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
L_LAYOUT type slis_layout_alv,
x_events type slis_alv_event,
it_events type SLIS_T_EVENT.
DATA: BEGIN OF ITAB OCCURS 0,
VBELN LIKE VBAK-VBELN,
POSNR LIKE VBAP-POSNR,
MALE type i,
female type i,
END OF ITAB.
SELECT VBELN
POSNR
FROM VBAP
UP TO 20 ROWS
INTO TABLE ITAB.
X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-SELTEXT_L = 'VBELN'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 1.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-SELTEXT_L = 'POSNR'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 2.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'MALE'.
X_FIELDCAT-SELTEXT_L = 'MALE'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 3.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'FEMALE'.
X_FIELDCAT-SELTEXT_L = 'FEMALE'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 3.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
x_events-NAME = SLIS_EV_TOP_OF_PAGE.
x_events-FORM = 'TOP_OF_PAGE'.
APPEND x_events TO iT_EVENTS.
CLEAR x_events .
L_LAYOUT-NO_COLHEAD = 'X'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT = L_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
it_events = it_events
TABLES
T_OUTTAB = ITAB
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC ne 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
FORM TOP_OF_PAGE.
*-To display the headers for main list
FORMAT COLOR COL_HEADING.
WRITE: / SY-ULINE(103).
WRITE: / SY-VLINE,
(8) ' ' ,
SY-VLINE,
(8) ' ' ,
SY-VLINE,
(19) '***'(015) centered,
sy-vline.
WRITE: / SY-VLINE,
(8) 'VBELN'(013) ,
SY-VLINE,
(8) 'POSNR'(014) ,
SY-VLINE,
(8) 'MALE'(016) ,
sy-vline,
(8) 'FMALE'(017) ,
sy-vline.
FORMAT COLOR OFF.
ENDFORM. -
Hyperlink Field in column of 2D ALV Report
Hi,
I have to display a ALV Report in which one of column reprsent a field which have hyperlink.
How to acheive this?Can anybody tell me approach?
-RickHi Ricky,
Kindly go through the link below:
http://help.sap.com/saphelp_erp2004/helpdata/EN/85/ce25c2d7ae11d3b56d006094192fe3/content.htm
Hope it helps you
Regrds
Mansi -
How to split a single column row in alv report
Hi All,
I need to split a row of the particular coolumn in alv report.
for example row size is 10 that should be split into 5 & 5.
Thanks
RamHi Ram,
You can add one more column for that..
while processing your internal table you can split the value for that column using offset..
DATA : FIELD_STR(10) TYPE C.
VAR1 = FIELD_STR+0(5) .
VAR2 = FIELD_STR+5(5) .
Now you can print this both VAR1 and VAR2 in seperate column.
Please search on SCN before posting any question..
Hope it will solve your problem..
Thanks & Regards
ilesh 24x7
ilesh Nandaniya -
Variable Columns Dispaying in ALV Report
Hi ,
I am working on ALV report . I am displaying 40 static fields and variable fields . Those varaible fields dependent on internal table . In the internal table 3 fields are available
if it contains 1 row then in report variable fields are 3 OR
if it contains 2 rows then in report variable fields are 6 OR
if it contains 3 rows then in report variable fields are 9 OR
if it contains n rows then in report variable fields are 3n.
Example : 1) Internal table have 3 fields sd_active , sd_close , sd_term .
Internal table is i_a936 , Work area w _a936 .
w_a936-sd_active = 'A1'.
w_a936-sd_close = 'B1'.
w_a936-sd_term = 'C1'.
append w_a936 to i_a936.
w_a936-sd_active = 'A2'.
w_a936-sd_close = 'B2'.
w_a936-sd_term = 'C2'.
append w_a936 to i_a936.
Then in final internal table it should display 6 columns like w_final-sd_Active1 ,w_final-sd_close1,w_final-sd_term1 , w_final-sd_Active2 ,w_final-sd_close2,w_final-sd_term2 . Columns in Internal table varies from i_a936 rows .
I am trying to use Dynamic internal table .
Regards
Srihari NerellaHi,
I think this may help you . Use CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
see the link
Dynamic fields to be displayed in ALV
Dynamic column change in Alv
Dynamic Number of Columns in ALV -
How to make single column scrollable in ALV report (for long Text)
I have a 20 columns which we need to display in ALV grid, including one column for long text. In long text column currently it showing 40 character. I tried to change output length of field catalog but it's not working.
Can any one help me ....
Thanks
Guru
Message was edited by:
gurusharan mandalhi,
pls remeove if u give like this in the layout.
gd_layout-colwidth_optimize = 'X'.
rgds
Anver -
Avoid splitting of columns ALV report while download output to Excel sheet
Hi friends,
I have 170 columns in my ALV report
while downloading the report to Excel sheet
the column descriptions and values are splitting in two lines.
How can i avoid the problem.
before calling REUSE_ALV_GRID_DISPLAY function module in my code
for the Layout i assigned LS_LAYOUT-MAX_SIZE = 1023.
but still the problem is not solved.
Please help me in this Issue.
Thanks in Advance,
GaneshHi friends,
I dont want to use and Keyboard shiftcntrl....
or dont want to change any code in ALV report
by simply assigning some value to any of the export parameter in ALV function module
can we achieve the functionality
Thanks in Advance,
Ganesh -
No column heading in second page in alv report when save in excel file
Hi Expert,
How can i remove the column header from Alv report when program execute in background and save in excel file right now
its comming column header in each page. Client dont want header column in excel from second page. is this possible?
with regards
chandan_vijiHi Ravi,
thanks for reply i have solved this problm throug line count and NEW-PAGE LINE COUNT 10000 bcoz client want output in excel file only one page header.
with regards
chandan_viji -
Setting the column labels in webdynpro abap alv report
Hello,
Right now I have programmed an ALV report. The selection criterion and the display of the report all work.
However, there is an issue with the labels of columns in the ALV report. The report takes the field names of the structure I am using in the ALV report as the labels of the report. I have been trying to play around with the ALV class model to see if something will change the labels of the fields but to no avail. Would you guys know of some code or way to change the labels of the columns in the ALV report.
Thank you for your help in advance.
Sumit.
Here is some of the code I tried but does no work in the wdInit() method. It does not change the label. Any suggestions???
METHOD wddoinit .
* instantiate used component from wizard
DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
lo_cmp_usage = wd_this->wd_cpuse_alv( ).
IF lo_cmp_usage->has_active_component( ) IS INITIAL.
lo_cmp_usage->create_component( ).
ENDIF.
* call a method in the used component from wizard
DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
lo_interfacecontroller = wd_this->wd_cpifc_alv( ).
DATA lo_value TYPE REF TO cl_salv_wd_config_table.
lo_value = lo_interfacecontroller->get_model(
DATA: lr_field TYPE REF TO cl_salv_wd_field.
lr_field = lo_value->if_salv_wd_field_settings~get_field( 'CUSTOMER_NUMBER' ).
* change the label of the report.
DATA: lr_CUSTOMER_NUMBER TYPE REF TO cl_salv_wd_column.
CALL METHOD lo_value->if_salv_wd_column_settings~get_column
EXPORTING
id = 'CUSTOMER_NUMBER' receiving value = LR_CUSTOMER_NUMBER.
* SET THE LABEL OF THE COLUMN
DATA: HR_CUSTOMER_NUMBER TYPE REF TO CL_SALV_WD_COLUMN_HEADER.
CALL METHOD lr_customer_number->get_header
receiving
value = HR_CUSTOMER_NUMBER.
***** set the text of the column
CALL METHOD hr_customer_number->set_text
EXPORTING
value = 'Customer1 Number1'.
ENDMETHOD.You have to disable the DDic binding on the column before your override text will show up:
data: l_ref_cmp_usage type ref to if_wd_component_usage.
l_ref_cmp_usage = wd_this->wd_cpuse_alv( ).
if l_ref_cmp_usage->has_active_component( ) is initial.
l_ref_cmp_usage->create_component( ).
endif.
data l_salv_wd_table type ref to iwci_salv_wd_table.
l_salv_wd_table = wd_this->wd_cpifc_alv( ).
data l_table type ref to cl_salv_wd_config_table.
l_table = l_salv_wd_table->get_model( ).
data l_column type ref to cl_salv_wd_column.
l_column = l_table->if_salv_wd_column_settings~get_column( 'POSTING_DATE' ).
data l_header type ref to cl_salv_wd_column_header.
l_header = l_column->get_header( ).
l_header->set_prop_ddic_binding_field(
property = if_salv_wd_c_ddic_binding=>bind_prop_text
value = if_salv_wd_c_ddic_binding=>ddic_bind_none ).
l_header->set_text( `Posting Date` ). -
Hi Experts,
How to hide some columns in some ALV report.
Regards,
Kali PramodBasically what you need to do is to set your field catalog field <b>'NO_OUT' to 'X'.</b>
Please check these threads
https://forums.sdn.sap.com/click.jspa?searchID=221365&messageID=1106206
https://forums.sdn.sap.com/click.jspa?searchID=221365&messageID=1900603
https://forums.sdn.sap.com/click.jspa?searchID=221365&messageID=2355206
https://forums.sdn.sap.com/click.jspa?searchID=221365&messageID=2775950
Message was edited by:
Dominic Pappaly -
Sub-Script Value in ALV Report Output
Hi,
Let us take an example Hydrogen - H2, If we print it in this way it won't be meaning full, So i want to display this like H Subscript 2.
I have a requirement for a column in an ALV Report.
Is it Possible? Please give me an example.
Thanks,
Sekhar.JHi Sekhar
One thing you could do would be to make the number of atoms ( ! ) bold.
Have a lok at the FM REUSE_ALV_GRID_DISPLAY_LVC.
Pushpraj
Maybe you are looking for
-
HP won't boot up after Windows 8.1 update
I downloaded Windows 8.1 on Friday night, finally was able to install it on Sunday afternoon, don't know why it took so long. Regardless, the computer installed 8.1 and restarted itself. After booting back up, the computer would be at the desktop (no
-
I get a blue screen; tried the single boot and get "audit space low"; how to I get the computer to start again?
-
Web link to PDF loads as gibberish
Link works fine on PC's. With a Mac the link shows as gibberish when the page loads. However clicking anywhere in the address field of Safari and reloading the page (pressing enter) loads the pdf just fine. Verified that the latest AdobePDFViewer.plu
-
Spry dataset problem. Image dimensions with css
Hey guys. I'm new to spry, and not an experienced web designer with beginner knowledge in programming. I am using a spry data set to make a blog kind of interface. I'm using a master/detail layout from the Dreamweaver presets. I am using html, not xh
-
Updating MetaData from Original Masters Possible?
Hi, I spend hours (well, most of a day) importing my 13k+ stock library into Aperture after switching to Mac. I used to use Extensis Portfolio on Windows to catalogue my finished files. Well, it's my own fault for not checking as i was going through