Display data column wise in alv
my problem is i want to display data in column wise in alv grid display
for example it will display
Name1 Amount
GTS 12000
TSL 8970
MJB 4678
but i want like:
GTS TSL MJB
12000 8970 4678
Edited by: jadav_avani on Nov 15, 2010 8:33 AM
Moderator Message: Search for available information.
Edited by: kishan P on Nov 15, 2010 1:50 PM
my problem is i want to display data in column wise in alv grid display
for example it will display
Name1 Amount
GTS 12000
TSL 8970
MJB 4678
but i want like:
GTS TSL MJB
12000 8970 4678
Edited by: jadav_avani on Nov 15, 2010 8:33 AM
Moderator Message: Search for available information.
Edited by: kishan P on Nov 15, 2010 1:50 PM
Similar Messages
-
SQL Developer Not displaying Date columns
I installed SQL Developer on my machine today and when i query for data I don't find any value in the columns which are of DATE datatype.
For Eg if i says select * from dual; i get null as output.
Can anyone confirm if this is happening to you also or if there is some problem with my installation.Dates work fine for me.
What value do you get for your NLS_DATE_FORMAT parameter with the following query:
select parameter, value from nls_session_parameters where parameter = 'NLS_DATE_FORMAT';
You can change the NLS_DATE_FORMAT as in the following example:
alter session set nls_date_format = 'DD-Mon-YYYY';
Also, the column in the dual table is not actually in date format - try "select sysdate from dual;" instead. -
How to Fetch Data into internal table column wise?
The internal table contains huge set of data. Normally we fetch the data row wise using insert and select statements in work area.
But, the requirement is on fetching the data column wise for each field from the database.
So,can anyone help me on this issue for fetching the data column wise?Welcome to SDN.
What you want to do(if I understand correctly) is not possible with the statements available to us. You could do it, but I think it would be a lot of code and I don't think that its worth it. Why exactly do you want to do this?
Regards,
Rich Heilman -
BPS Planning Layout - Data Column issues
My basic question is: is it possible to configure a characteristic in the data column such that it contains a range of values, instead of just a single value. We have requirements to produce a series of comparison columns for things such as "Year-to-Date" (sum of a range of fiscal periods), "Prior 12 Months" (again, sum of a range of periods), and so forth. Unfortunately, the BPS layout configuration of data columns only allows you to specify a single characteristic value. If you configure it with a variable that contains the range, the system only uses the LOW value of the range, not the full range. The ability to provide such comparison columns is critical to our users' ability to see prior information and make a determination of new plan values for the plan year.
Any thoughts or suggestions on how I should approach this, or alternative approaches to take?John,
This has been an issue with BPS since you can only display data columns of the granularity you specify rather than a range such as YTD similar to what you can do in BW restricted key figures.
The work around is to create and store the numbers in
1) YTD key figure in say fiscal year current year fiscal period current period and/or
2) Prior 12 months Key figure and store the number against fiscal year current year fiscal period # or first period period of the year...
Hope this helps and assign points if you found it useful.
Mary -
Display data as rowwise (horizontally ) instead of column wise ( verticaly)
I am displaying the data from milti select prompt of BI Answers in BIP report.
The data from the table is displayed as
Table structure :
Company. Unit name f_company_._unit_e
output :
unit1
unit2
unit3
I want output as unit1, unit2, unit3
Thanks
Aj
Edited by: user9031011 on May 11, 2010 7:35 AM
Edited by: user9031011 on May 11, 2010 7:46 AMHi Aj,
First of all, correct me my previous solution.
1. If you want to print the units in column wise i.e. if the for loop is in a table and you want each unit to be displayed in a separate columns side by side then in one of the table cell (i.e. in the for-each field of the cell) keep below code,
<?for-each@column:ROW?> <?EMPNO?> <?end for-each?>
2. If you want to print as a normal text (with out table) then use
<?for-each@inlines:ROW?> <?EMPNO?> <?end for-each?>
Second, to modify the form field,
Select the for-each form field, go to to Add-Ins -> Tools -> Field Browser , then double click the for-each and in the edit box change the text according to your requirement, then click 'Update' button.
You can also place that for-each condition out side(i mean with out form field) -
Display schedule qty - Month wise in ALV Grid
Hi Experts,
I have a requirement to display the schedule line quantities month wise in ALV Grid. The columns sholud be dynamic columns based on the input date range. I got some idea about how to create dynamic ALV but it is not clear to implement in my requirement.
Please Guide me in achiving the same.
Example:
Jan 2011 Feb 2011 March 2011
100 2000 300
Thanks&Regards,
KarthikHi.,
Create field catalog dynamically as like this.,
select-options s_date for sy-datum.
data: n type i,
count type i,
cnt type string,
field type string,
descr type string.
DATA: m TYPE t247-mnr,
month_name type char10,
m1 type i.
n = s_date-high+4(2) - s_date-low+4(2) . " getting number of months
m1 = s_date-low+4(2).
m = m1.
n = n + 1.
DO n TIMES. " building field catalog dynamically
m = m + 1.
count = count + 1.
cnt = count.
concatenate 'FIELD' cnt into field.
CALL FUNCTION 'ISP_GET_MONTH_NAME' " FM to get month name
EXPORTING
LANGUAGE = sy-langu
MONTH_NUMBER = m
IMPORTING
* LANGU_BACK =
LONGTEXT = month_name .
concatenate month_name s_date-low+0(4) into descr separated by ''.
wa_fieldcat-col_pos = count.
wa_fieldcat-row_pos = '1'.
wa_fieldcat-fieldname = field.
wa_fieldcat-seltext_m = descr.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
ENDDO.
After this create dynamic table using,
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = t_fldcat
IMPORTING
ep_table = t_newtable.
then loop the internal table and assign the component to final internal table,.
like .,
CONCATENATE 'FIELD' index INTO fieldvalue. " do same like fieldcatalog
ASSIGN COMPONENT fieldvalue OF STRUCTURE <fs_dyntable> TO <fs_fldval>.
<fs_fldval> = wa-fieldvalue.
hope this helps u.,
Thanks & Regards,
Kiran -
Rows as columns and dynamic alv display
Hi everyone,
I need to build a intenal table dynamically as well as dispaly few rows as columns in alv output.
I have seen posts where internal table has been created dynamicaaly as well seen the posts where rows of the table are displayed as columns but, can we achieve both the functionalities at same time.
I have table as:
SO PO Date MAT QTY
1 A X Y1 10
K1 15
M2 11
2 B X1 Y2 5
M1 12
3 C 1x Z1 15
K1 6
L1 10
Now the ouput has to be :
SO PO Date MAT-Y1 MAT-K1 MAT-Y2 MAT-L1 Mat-Z1 MAT-M1 MAT-M2
1 A X 10 15 11
2 B X1 5 12
3 C 1X 6 10 15
I will not be knowing the number of materials untill runtime(dynamic) and as well the rows has to be displayed as columns. Is it possible to do that.
Regards
Edited by: Madhu Posanipalli on Jun 6, 2011 4:51 PMHi,
Check below code. It will work definitly.
*& Report YTEST_PROG_RP
REPORT YTEST_PROG_RP.
type-POOLs slis.
TYPES: BEGIN OF ty_tab,
so TYPE i,
po TYPE c,
date(2) TYPE c,
mat(2) TYPE c,
qty TYPE i,
END OF ty_tab.
DATA: itab TYPE STANDARD TABLE OF ty_tab INITIAL SIZE 0,
jtab TYPE STANDARD TABLE OF ty_tab INITIAL SIZE 0,
ktab TYPE STANDARD TABLE OF ty_tab INITIAL SIZE 0,
wa_tab TYPE ty_tab, wa_j TYPE ty_tab, wa_k TYPE ty_tab.
FIELD-SYMBOLS: <t_dyntable> TYPE STANDARD TABLE,
<fs_dyntable>,
<fs_fldval> type any.
*ALV data declarations
data: fieldcatalog type LVC_T_FCAT, " with header line, "slis_t_fieldcat_alv with header line,
fieldcatalog1 TYPE LVC_s_FCAT,
fieldcatalog2 type slis_t_fieldcat_alv with header line,
gd_tab_group type slis_t_sp_group_alv,
gd_layout type slis_layout_alv,
gd_repid like sy-repid,
gt_events type slis_t_event,
gd_prntparams type slis_print_alv.
DATA t_newtable TYPE REF TO data.
DATA t_newline TYPE REF TO data.
DATA wa_flname TYPE string.
*Start-of-selection.
START-OF-SELECTION.
perform data_retrieval.
perform build_fieldcatalog.
perform dynamic_table.
perform build_layout.
perform build_events.
perform build_print_params.
perform display_alv_report.
*& Form BUILD_FIELDCATALOG
Build Fieldcatalog for ALV Report
form build_fieldcatalog.
DATA: lv_field1 TYPE string, lv_cnt LIKE sy-tabix VALUE 3, itab_lines TYPE i.
DATA: fieldname(20) TYPE c.
DATA: fieldvalue(10) TYPE c.
DATA: index(3) TYPE c.
DATA: wa_cat LIKE LINE OF fieldcatalog2,
wa_colno(2) TYPE n,
wa_flname(5) TYPE c. .
fieldcatalog1-fieldname = 'SO'.
fieldcatalog1-seltext = 'SO'.
fieldcatalog1-col_pos = 1.
fieldcatalog1-outputlen = 2.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
fieldcatalog-do_sum = 'X'.
fieldcatalog-no_zero = 'X'.
append fieldcatalog1 to fieldcatalog.
clear fieldcatalog1.
fieldcatalog1-fieldname = 'PO'.
fieldcatalog1-seltext = 'PO'.
fieldcatalog1-col_pos = 2.
fieldcatalog1-outputlen = 2.
append fieldcatalog1 to fieldcatalog.
clear fieldcatalog1.
fieldcatalog1-fieldname = 'DATE'.
fieldcatalog1-seltext = 'Date'.
fieldcatalog1-col_pos = 3.
fieldcatalog1-outputlen = 2.
append fieldcatalog1 to fieldcatalog.
clear fieldcatalog1.
LOOP AT itab INTO wa_tab.
lv_cnt = lv_cnt + 1.
CONCATENATE 'MAT-' wa_tab-mat into lv_field1.
TRANSLATE lv_field1 TO UPPER CASE.
fieldcatalog1-fieldname = lv_field1.
fieldcatalog1-seltext = lv_field1.
fieldcatalog1-col_pos = lv_cnt.
fieldcatalog1-outputlen = 6.
append fieldcatalog1 to fieldcatalog.
clear fieldcatalog1.
CLEAR: lv_field1, wa_tab.
ENDLOOP.
CLEAR lv_cnt.
Create dynamic internal table and assign to FS
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = fieldcatalog
IMPORTING
ep_table = t_newtable.
ASSIGN t_newtable->* TO <t_dyntable>.
CREATE DATA t_newline LIKE LINE OF <t_dyntable>.
ASSIGN t_newline->* TO <fs_dyntable>.
DESCRIBE TABLE fieldcatalog LINES itab_lines.
loop at fieldcatalog INTO fieldcatalog1.
CLEAR wa_cat.
wa_cat-fieldname = fieldcatalog1-fieldname.
wa_cat-seltext_s = fieldcatalog1-fieldname.
wa_cat-outputlen = fieldcatalog1-outputlen.
APPEND wa_cat TO fieldcatalog2.
CLEAR fieldcatalog1.
ENDLOOP.
endform. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
Build layout for ALV grid report
form build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
gd_layout-totals_only = 'X'.
gd_layout-f2code = 'DISP'. "Sets fcode for when double
"click(press f2)
gd_layout-zebra = 'X'.
gd_layout-group_change_edit = 'X'.
gd_layout-header_text = 'helllllo'.
endform. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
Display report using ALV grid
form display_alv_report.
gd_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
i_callback_user_command = 'USER_COMMAND'
i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog2[]
it_special_groups = gd_tabgroup
it_events = gt_events
is_print = gd_prntparams
i_save = 'X'
is_variant = z_template
tables
t_outtab = <t_dyntable>
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. " DISPLAY_ALV_REPORT
*& Form DATA_RETRIEVAL
Retrieve data form EKPO table and populate itab it_ekko
form data_retrieval.
DATA: lv_index LIKE sy-tabix.
wa_tab-so = 1.
wa_tab-po = 'A'.
wa_tab-date = 'X'.
wa_tab-mat = 'Y1'.
wa_tab-qty = 10.
append wa_tab to itab.
clear wa_tab.
wa_tab-mat = 'K1'.
wa_tab-qty = 15.
append wa_tab to itab.
CLEAR wa_tab.
wa_tab-mat = 'M2'.
wa_tab-qty = 11.
append wa_tab to itab.
CLEAR wa_tab.
wa_tab-so = 2.
wa_tab-po = 'B'.
wa_tab-date = 'X1'.
wa_tab-mat = 'Y2'.
wa_tab-qty = 5.
append wa_tab to itab.
CLEAR wa_tab.
wa_tab-mat = 'M1'.
wa_tab-qty = 12.
append wa_tab to itab.
CLEAR wa_tab.
wa_tab-so = 3.
wa_tab-po = 'C'.
wa_tab-date = '1x1'.
wa_tab-mat = 'Z1'.
wa_tab-qty = 15.
append wa_tab to itab.
CLEAR wa_tab.
wa_tab-mat = 'K1'.
wa_tab-qty = 6.
append wa_tab to itab.
CLEAR wa_tab.
wa_tab-mat = 'L1'.
wa_tab-qty = 10.
append wa_tab to itab.
CLEAR wa_tab.
LOOP AT itab INTO wa_tab.
if wa_tab-so is NOT INITIAL AND wa_tab-po is NOT INITIAL AND wa_tab-date is NOT INITIAL.
wa_j-so = wa_tab-so.
wa_j-po = wa_tab-po.
wa_j-date = wa_tab-date.
lv_index = wa_tab-so.
else.
READ TABLE itab INTO wa_j WITH KEY so = lv_index.
ENDIF.
wa_j-mat = wa_tab-mat.
wa_j-qty = wa_tab-qty.
APPEND wa_j to jtab.
CLEAR: wa_tab, wa_j.
ENDLOOP.
endform. " DATA_RETRIEVAL
Form TOP-OF-PAGE *
ALV Report Header *
Form top-of-page.
**ALV Header declarations
*data: t_header type slis_t_listheader,
wa_header type slis_listheader,
t_line like wa_header-info,
ld_lines type i,
ld_linesc(10) type c.
Title
wa_header-typ = 'H'.
wa_header-info = 'EKKO Table Report'.
append wa_header to t_header.
clear wa_header.
Date
wa_header-typ = 'S'.
wa_header-key = 'Date: '.
CONCATENATE sy-datum+6(2) '.'
sy-datum+4(2) '.'
sy-datum(4) INTO wa_header-info. "todays date
append wa_header to t_header.
clear: wa_header.
Total No. of Records Selected
describe table it_ekko lines ld_lines.
ld_linesc = ld_lines.
concatenate 'Total No. of Records Selected: ' ld_linesc
into t_line separated by space.
wa_header-typ = 'A'.
wa_header-info = t_line.
append wa_header to t_header.
clear: wa_header, t_line.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = t_header.
i_logo = 'Z_LOGO'.
endform. "top-of-page
FORM USER_COMMAND *
--> R_UCOMM *
--> RS_SELFIELD *
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
Check function code
CASE r_ucomm.
WHEN '&IC1'.
Check field clicked on within ALVgrid report
IF rs_selfield-fieldname = 'EBELN'.
Read data table, using index of row user clicked on
READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
Set parameter ID for transaction screen field
SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
Sxecute transaction ME23N, and skip initial data entry screen
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDFORM. "user_command
*& Form BUILD_EVENTS
Build events table
form build_events.
data: ls_event type slis_alv_event.
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = gt_events[].
read table gt_events with key name = slis_ev_end_of_page
into ls_event.
if sy-subrc = 0.
move 'END_OF_PAGE' to ls_event-form.
append ls_event to gt_events.
endif.
read table gt_events with key name = slis_ev_end_of_list
into ls_event.
if sy-subrc = 0.
move 'END_OF_LIST' to ls_event-form.
append ls_event to gt_events.
endif.
endform. " BUILD_EVENTS
*& Form BUILD_PRINT_PARAMS
Setup print parameters
form build_print_params.
gd_prntparams-reserve_lines = '3'. "Lines reserved for footer
gd_prntparams-no_coverpage = 'X'.
endform. " BUILD_PRINT_PARAMS
*& Form END_OF_PAGE
form END_OF_PAGE.
data: listwidth type i,
ld_pagepos(10) type c,
ld_page(10) type c.
write: sy-uline(50).
skip.
write:/40 'Page:', sy-pagno .
endform. "END_OF_PAGE
*& Form END_OF_LIST
form END_OF_LIST.
data: listwidth type i,
ld_pagepos(10) type c,
ld_page(10) type c.
skip.
write:/40 'Page:', sy-pagno .
endform. "END_OF_LIST
*& Form dynamic_table
text
--> p1 text
<-- p2 text
FORM dynamic_table .
DATA: lv_s1 TYPE string, lv_s2 TYPE string.
DATA lv_mat TYPE string.
DATA: fieldvalue(10) TYPE c.
ktab[] = jtab[].
delete ADJACENT DUPLICATES FROM ktab COMPARING so.
loop at ktab INTO wa_tab.
Field1
wa_flname = 'SO'.
fieldvalue = wa_tab-so.
CONDENSE fieldvalue NO-GAPS.
ASSIGN COMPONENT wa_flname
OF STRUCTURE <fs_dyntable> TO <fs_fldval>.
<fs_fldval> = fieldvalue.
CLEAR fieldvalue.
Field2
wa_flname = 'PO'.
fieldvalue = wa_tab-po.
CONDENSE fieldvalue NO-GAPS.
ASSIGN COMPONENT wa_flname
OF STRUCTURE <fs_dyntable> TO <fs_fldval>.
<fs_fldval> = fieldvalue.
CLEAR fieldvalue.
Field3
wa_flname = 'DATE'.
fieldvalue = wa_tab-date.
CONDENSE fieldvalue NO-GAPS.
ASSIGN COMPONENT wa_flname
OF STRUCTURE <fs_dyntable> TO <fs_fldval>.
<fs_fldval> = fieldvalue.
CLEAR fieldvalue.
loop at jtab INTO wa_j WHERE so = wa_tab-so.
CONCATENATE 'MAT-' wa_j-mat INTO lv_mat.
wa_flname = lv_mat.
fieldvalue = wa_j-qty.
CONDENSE fieldvalue NO-GAPS.
ASSIGN COMPONENT wa_flname
OF STRUCTURE <fs_dyntable> TO <fs_fldval>.
<fs_fldval> = fieldvalue.
CLEAR: wa_j, fieldvalue.
ENDLOOP.
APPEND <fs_dyntable> TO <t_dyntable>.
CLEAR wa_tab.
FREE <fs_dyntable>.
ENDLOOP.
ENDFORM. " dynamic_table
Ram. -
Colors in ALV report - column wise
Hi,
I have a ALV report. I want color in my report like Column Wise.
ex.
Document No........Date.........Amount......Document No......Date........Amount........Document Nov........Date.............Amount....
2008000123...10.07.2009....2000.00......2008000133....10.07.2009....2000.00.....2008000143.......10.07.2009.......2000.00
2008000124...10.07.2009....2000.00......2008000134....10.07.2009....2000.00.....2008000144.......10.07.2009.......2000.00
2008000125...10.07.2009....2000.00......2008000135....10.07.2009....2000.00.....2008000145.......10.07.2009.......2000.00
Please see, there is 3 times Document No, Date and Amount. I want that there should come diff. colors for diff. document numbers.
It is possible or not. If yes, then how...
Thanks...Hi,
go though this link....
i hope this will help u
TABLES:
SPFLI.
TYPE-POOLS:
SLIS.
PARAMETERS:
P_COL TYPE I ,
P_ROW TYPE I,
P_COLOR(4) TYPE C .
DATA:
T_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
FS_FIELDCAT LIKE LINE OF T_FIELDCAT,
FS_LAYOUT TYPE SLIS_LAYOUT_ALV ,
W_COLOR(4) ,
W_ROW TYPE I,
W_FIELDNAME(20),
W_PROG TYPE SY-REPID.
DATA:
BEGIN OF T_SPFLI OCCURS 0,
COLOR(4),
CHECKBOX ,
CELL TYPE SLIS_T_SPECIALCOL_ALV,
CARRID TYPE SPFLI-CARRID,
CONNID TYPE SPFLI-CONNID,
CITYFROM TYPE SPFLI-CITYFROM,
CITYTO TYPE SPFLI-CITYTO,
DISTANCE TYPE SPFLI-DISTANCE,
END OF T_SPFLI.
DATA:
FS_CELL LIKE LINE OF T_SPFLI-CELL.
SELECT *
FROM SPFLI
INTO CORRESPONDING FIELDS OF TABLE T_SPFLI.
W_COLOR = P_COLOR.
T_SPFLI-COLOR = P_COLOR.
IF P_COL IS INITIAL AND P_ROW GT 0.
MODIFY T_SPFLI INDEX P_ROW TRANSPORTING COLOR.
ENDIF.
FS_FIELDCAT-FIELDNAME = 'CARRID'.
FS_FIELDCAT-REF_TABNAME = 'SPFLI'.
FS_FIELDCAT-COL_POS = 1.
FS_FIELDCAT-KEY = 'X'.
FS_FIELDCAT-HOTSPOT = 'X'.
APPEND FS_FIELDCAT TO T_FIELDCAT.
CLEAR FS_FIELDCAT .
FS_FIELDCAT-FIELDNAME = 'CONNID'.
FS_FIELDCAT-REF_TABNAME = 'SPFLI'.
FS_FIELDCAT-COL_POS = 2.
FS_FIELDCAT-KEY = 'X'.
FS_FIELDCAT-HOTSPOT = 'X'.
APPEND FS_FIELDCAT TO T_FIELDCAT.
CLEAR FS_FIELDCAT .
FS_FIELDCAT-FIELDNAME = 'DISTANCE'.
FS_FIELDCAT-REF_TABNAME = 'SPFLI'.
FS_FIELDCAT-COL_POS = 3.
FS_FIELDCAT-KEY = ' '.
FS_FIELDCAT-EDIT = 'X'.
APPEND FS_FIELDCAT TO T_FIELDCAT.
CLEAR FS_FIELDCAT.
FS_FIELDCAT-FIELDNAME = 'CITYFROM'.
FS_FIELDCAT-REF_TABNAME = 'SPFLI'.
FS_FIELDCAT-COL_POS = 4.
FS_FIELDCAT-KEY = ' '.
APPEND FS_FIELDCAT TO T_FIELDCAT.
LOOP AT T_FIELDCAT INTO FS_FIELDCAT.
IF FS_FIELDCAT-COL_POS EQ P_COL.
FS_FIELDCAT-EMPHASIZE = P_COLOR.
W_FIELDNAME = FS_FIELDCAT-FIELDNAME.
IF P_ROW IS INITIAL AND P_COL GT 0.
MODIFY T_FIELDCAT FROM FS_FIELDCAT TRANSPORTING EMPHASIZE.
ENDIF.
ENDIF.
ENDLOOP.
FS_CELL-FIELDNAME = W_FIELDNAME .
FS_CELL-COLOR-COL = 6.
FS_CELL-NOKEYCOL = 'X'.
APPEND FS_CELL TO T_SPFLI-CELL.
IF P_ROW IS NOT INITIAL AND P_COL IS NOT INITIAL.
MODIFY T_SPFLI INDEX P_ROW TRANSPORTING CELL.
ENDIF.
FS_LAYOUT-INFO_FIELDNAME = 'COLOR'.
FS_LAYOUT-BOX_FIELDNAME = 'CHECKBOX'.
FS_LAYOUT-COLTAB_FIELDNAME = 'CELL'.
FS_LAYOUT-F2CODE = '&ETA'.
W_PROG = SY-REPID.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = W_PROG
IS_LAYOUT = FS_LAYOUT
IT_FIELDCAT = T_FIELDCAT
TABLES
T_OUTTAB = T_SPFLI
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.
NOTE
Column and Row are colored with a coded color u2018Cxyzu2019.
Where C: Color (coding must begin with C)
X: Color Number
Y: Bold
Z: Inverse.
Thanks
Ashu -
Display dynamic columns in ALV
Hi All,
I have a requirement in which I have develop a report displaying material master basic data and classification data. The basic data I am getting from MARA and MAKT tables. And for classification data I am getting the class maintained from each material from tables INOB,KSSK and from KLAH, then I am getting the characteristics and its values by calling BAPI u2018BAPI_OBJCL_GETDETAILu2019 for each material .
Now I have to prepare ALV having column name for basic data (would be static) and characteristic name (would be dynamic, and I have to display characteristics values under it, for each material ).
For example: if material u2018CHWOJA4u2019 has 2 characteristics as u2018country (value u2018Franceu2019)u2019 and u2018creation season(value u2018Decu2019)u2019 and second material u2018E50480u2019 has 3 characteristics as u2018Abacus (value u2018yesu2019)u2019 ,u2018country (value u2018Indiau2019)u2019 and u2018 season(value Jank)u2019 , the ALV output would be :
Material Number; Material description; Base Unit of Measure;Material Group; Abacus; Country;season
CHWOJA4; JACKET;PC;Z05; ; France;Dec
E50480;BRAZIL REAL;PC;Z06; yes; India;Jan
In short, my last column of the ALV would be the characteristic name and the content would be the char. value.
Can you please suggest some ways to achieve this? A quick reply would be highly appreciated!
Thanks,
VanithaIdea here is to have many fields for characterstic values in your output internal table.
For eg.
types : Begin of ty_mara,
matnr type matnr_d,
mtext type mktxt,
char1 type string,
char2 type string,
char20 type string.
Check for all the materials which has the maximum characterstic values. So, say for a material, there are 12 characterstics values and that is the maximum compared to anyother materials. Then in the field catalog hide the columns related to charactertics CHAR13 onwards till CHAR20.
Note : I have assumed char20 as the max., which you can alter based on your scenario.
Regards
Ranganath -
How to change font while displaying data through an ALV table in WDA?
Hi all,
I am displaying data through and ALV table. Now I want to change the FONT only for few rows. Is this possible?
If so then do the needful to me..
Thanks & Regards,
Yugesh A.I believe as you have found 'LVC_FIELDCATALOG_MERGE' would only work with the classic dynpro (SAPGUI based) version of the ALV.
You won't be able to control the font the same way in the WDA version of the ALV. You will need to create a custom cell editor for the column(s) in question. You can then bind context attributes to the properties of the cell editor. You will need extra attributes in your bound context to control these settings on the row level. Also you will be restricted by the changing the DESIGN property. This means only the values allowed for the DESIGN of the particluar UI element. For a TextView that wouldn't be the font directly (the font of course comes from the Theme).
DATA l_salv_wd_table TYPE REF TO iwci_salv_wd_table.
l_salv_wd_table = wd_this->wd_cpifc_alv_adv( ).
DATA l_table TYPE REF TO cl_salv_wd_config_table.
l_table = l_salv_wd_table->get_model( ).
data textview type ref to CL_SALV_WD_UIE_TEXT_VIEW.
l_column = l_table->if_salv_wd_column_settings~get_column( 'ADD_PARTICIPANTS' ).
create object textview.
textview->SET_TEXT_FIELDNAME( 'ADD_PARTICIPANTS' ).
textview->set_design_fieldname( 'ADD_DESIGN' ).
textview->set_wrapping( abap_true ).
l_column->set_cell_editor( textview ).
DESIGN supports the following options:
Value
Visual Display
Description
emphasized
Text is highlighted in default size
groupTitle
Header for forms
This enumeration value is deprecated. Instead, use SectionHeader.
header1
Text is highlighted with font size +4 in relation to the default font size.
header2
Text is highlighted with font size +5.08 cm relation to the default font size.
header3
Text is highlighted in default size
header4
Text is highlighted in font size -1 (small) in relation to the default font size (like the legend but highlighted)
label
Text is display in the default font type. A space is always inserted after the text.
label_small
Text is displayed in default font type, as with label, onyl that font size is -1 (like the font size for header4).
legend
Text is displayed with default font type in size -1.
reference
Text is in italics and in default font size.
standard
Text is displayed in default font size. No text attributes are defined for this value.
monospace
Text is displayed in no-proportional font type. Each letter takes up the same space. -
Need Suggestion in displaying data in ALV.
Hi All Experts,
I have a scepic scenario for which I need your inputs. I am preparing a report which will display data foe entries made in time sheet. The entries in time sheet can be made for anything like a change request on an incident etc. It will have various output fields
And also dates for which entries are made. So it can have date from 1 to 31. This all is
to be displayed in ALV. Now the report can be displayed in two Summarised ways.
One summary can be for a user and another for the object type(incident, change request).
Now if the user wants to see this report for a period more than a month then I have to summarise it against a month too. So am not sure how to handle this. Which type of ALV function module to be used to display this?
Regards,
Sakethello,
I would suggest to go for GRID display - for that you can use either function module or class.
Tips:
If it also need to be summarised by month then add an extra field in fieldcatalog as monthid / monthname.
also it's better to have an extra field for object tyoe (Incident/ change)...
Thanks. -
Not able to display data in different columns using Unicode encoding
Hi,
Iam using Unicode encoding in my Java appln to support Japanese characters while downloading CSV report. But using the Unicode encoding displays all data in the first column of Excel sheet.
Please let me know how to display data in different columns using Unicode encoding in Excel sheet.Hi Venkat,
After extracting data into DSO check the request whether active or not.
Check data in DSO in contents.
If is there any restrictions on info providers in Queries.
Let us know status clearly.......
Reg
Pra -
Not able to display data in separate columns using Unicode encoding
Hi,
Iam using Unicode encoding in my Java appln to support Japanese characters while downloading CSV report. But using the Unicode encoding displays all data in the first column of Excel sheet.
Please let me know how to display data in different columns using Unicode encoding in Excel sheet.
This is an urgent need. Please help me out.Hi,
I have no problem with item :P15_EV_LCL this is having a value my probem here is i am using java script to display the value in different color based on the condtion case
eg:
select
case
TRUNC((
( (NVL(Z."AEWP",0) - NVL(Z."BEWP_Final",0) ) / DECODE(Z."BEWP_Final",0,NULL,Z."BEWP_Final") ) * 100
),2)
= :P15_EV_LCL
then
span style="background-color:lightgreen"
|| TRUNC((
( (NVL(Z."AEWP",0) - NVL(Z."BEWP_Final",0) ) / DECODE(Z."BEWP_Final",0,NULL,Z."BEWP_Final") ) * 100
),2) || '%' || /span
else
span style="background-color:yellow"
|| TRUNC(
( (NVL(Z."AEWP",0) - NVL(Z."BEWP_Final",0) ) / DECODE(Z."BEWP_Final",0,NULL,Z."BEWP_Final") ) * 100
),2) || '%' || /span
end "Effort"
from actuals Z
If i dont use this <Span style="Background-color:color"> i am able to generate data in excel sheet if i use this color coding i am not able to get data in spread sheet.
Please suggest
Thanks
Sudhir
Edited by: Sudhir_N on Mar 23, 2009 10:00 PM -
Display data from BLOB column.
Hi All,
I want to display data from blob datatype field, which contains HTML and GIF both files.
If I set it's property from file format IMAGE then i get data only gif.
if anybody have answer plz revert back...
awaiting...
JunedHi Juned
What I suggest is that you may have overlapping fields. One to show HTML and other to show GIF. You need to add one more column to your table in order identify if the BLOB is GIF or HTML.
In the Format Trigger of each of these two fields, inspect the value of flag column and hide one field if the datatype is not its type.
For instance, if flag field is 0 then hide Image field and show HTML field. If flag field is 1 then show Image field and hide HTML field.
Regards
Sripathy -
How do I select a date column and display the millesecond along with it.
I am trying to select a date column from database and want to
display millesecond with it. How do I do this. I am aware of
the "alter session set NLS_DATE_FORMAT = 'MM/DD/YY HH:MI:SS'"
command. However, I do not know how to display this with the
millesecond.
Thanks for all the help.Example:
SQL> CREATE OR REPLACE JAVA SOURCE
2 NAMED "MyTimestamp"
3 AS
4 import java.lang.String;
5 import java.sql.Timestamp;
6
7 public class MyTimestamp
8 {
9 public static String getTimestamp()
10 {
11 return (new
12 Timestamp(System.currentTimeMillis())).toString();
13 }
14 };
15 /
Java created.
SQL> CREATE OR REPLACE FUNCTION my_timestamp
2 RETURN VARCHAR2
3 AS LANGUAGE JAVA
4 NAME 'MyTimestamp.getTimestamp() return java.lang.String';
5 /
Function created.
SQL> CREATE TABLE test_time
2 (date_col VARCHAR2 (23))
3 /
Table created.
SQL> INSERT INTO test_time (date_col)
2 SELECT my_timestamp
3 FROM dual
4 /
1 row created.
SQL> SELECT date_col
2 FROM test_time
3 /
DATE_COL
2001-11-02 14:58:51.766
Maybe you are looking for
-
I have a new desktop and re-installed my identity from my airtime back up and on the log in page my picture comes up with my usual password hint, but it is not accepting my password and I do not have the option to reset using my apple id - that parti
-
Safari crashes on MAC OS 10.4.11
hello!! i would like to ask some help. my safari has been crashing when i open certain websites, most especially if its youtube. it has also been crashing on gmail and even apple support at times. i cannot reinstall flash player because as soon as
-
I have set up Photoshop Elements11 as the External Editor in iPhoto just as Terence Devlin said. However when I save the edited photo it does not appear in iPhoto. A drop down menu asks where I want to save the photo and I do not know what to choose.
-
App store got a updates for me, but its not my Apple ID
I bought a second hand MacBook Pro from a colleague of mine at work, he erased all the things he wanted to save to himself and I deleted is user name and created my own user name and became the new Admin. ive updated to the new operating system "Yose
-
Error in SAP APO Inbound: capacity requirement is invalid
Hi Experts I am getting an error in APO Inbound in APO queue manager. The error text reads " Capacity requirement is invalid". I checked for all the resources whether they have validity and also checked for mismatching control key. But these fields a