Displaying data in Grid Format?
Hello Developers,
How to display data in a grid format using BSP in mobiles(Supporting all handheld devices)?
I have read that we can use HTMLB to display data in a Tableview.But will it supported by all mobile devices?
What's the solution to achieve above challenge?
Thanks
I suggest you ask that question in the ABAP forum.
Markus
Similar Messages
-
How to display data of yuv format without converting rgb in OpenGL ES?
I have being study about OpenGL ES for iOS.
I wonder that data of YUV format is can display without converting RGB.
In most, the yuv data have to convert RGB for display. But, converting process is very slow, Then, that is not display smoothly.
So, I would like to try to dispaly YUV data without convert to RGB.
Is it possible? If possible, what can I do?
Please, let me give a advice.Hi Morgan,
I think you have at least two choices:
1 - Replace the colons with ', ' (comma and space) - sort of reasonable on screen and in an export
2 - Create a second page that has the same report but uses the "export: csv" template. Create a manual link to this page to replace the standard Export link. When such report pages are requested, they download immediately instead of displaying. You can, therefore, use commas in this one and <br> tags in the on-screen report version
Andy
ps - To display tags in a post, use &lt; for < and &gt; for > -
Displaying data in readable format
select *from user_tables;
TABLE_NAME TABLESPACE_NAME CLUSTER_NAME IOT_NAME STATUS PCT_FREE PCT_USED INI_TRANS MAX_TRANS INITIAL_EXTENT NEXT_EXTENT MIN_EXTENTS MAX_EXTENTS PCT_INCREASE FREELISTS
FREELIST_GROUPS LOG B NUM_ROWS BLOCKS EMPTY_BLOCKS AVG_SPACE CHAIN_CNT AVG_ROW_LEN AVG_SPACE_FREELIST_BLOCKS NUM_FREELIST_BLOCKS DEGREE INSTANCES CACHE TABLE_LO SAMPLE_SIZE LAST_ANAL PAR IOT_TYPE T S NES BUFFER_ ROW_MOVE GLO USE
DURATION SKIP_COR MON CLUSTER_OWNER DEPENDEN COMPRESS DRO
JOB_GRADES USERS VALID 10 1 255 65536 1 2147483645
YES N 6 5 0 0 0 9 0 0 1 1 N ENABLED 6 03-SEP-12 NO N N NO DEFAULT DISABLED YES NO
DISABLED YES DISABLED DISABLED NO
ERROR USERS VALID 10 1 255 65536 1 2147483645
YES N 1 5 0 0 0 84 0 0 1 1 N ENABLED 1 03-SEP-12 NO N N NO DEFAULT DISABLED YES NO
DISABLED YES DISABLED DISABLED NO
TABLE_NAME TABLESPACE_NAME CLUSTER_NAME IOT_NAME STATUS PCT_FREE PCT_USED INI_TRANS MAX_TRANS INITIAL_EXTENT NEXT_EXTENT MIN_EXTENTS MAX_EXTENTS PCT_INCREASE FREELISTS
FREELIST_GROUPS LOG B NUM_ROWS BLOCKS EMPTY_BLOCKS AVG_SPACE CHAIN_CNT AVG_ROW_LEN AVG_SPACE_FREELIST_BLOCKS NUM_FREELIST_BLOCKS DEGREE INSTANCES CACHE TABLE_LO SAMPLE_SIZE LAST_ANAL PAR IOT_TYPE T S NES BUFFER_ ROW_MOVE GLO USE
DURATION SKIP_COR MON CLUSTER_OWNER DEPENDEN COMPRESS DRO
TEST_A USERS VALID 10 1 255 65536 1 2147483645
YES N 3 5 0 0 0 16 0 0 1 1 N ENABLED 3 03-SEP-12 NO N N NO DEFAULT DISABLED YES NO
DISABLED YES DISABLED DISABLED NO
COLLECTIONS_EG USERS VALID 10 1 255 65536 1 2147483645
YES N 1 1 N ENABLED NO N N NO DEFAULT DISABLED NO NO
TABLE_NAME TABLESPACE_NAME CLUSTER_NAME IOT_NAME STATUS PCT_FREE PCT_USED INI_TRANS MAX_TRANS INITIAL_EXTENT NEXT_EXTENT MIN_EXTENTS MAX_EXTENTS PCT_INCREASE FREELISTS
FREELIST_GROUPS LOG B NUM_ROWS BLOCKS EMPTY_BLOCKS AVG_SPACE CHAIN_CNT AVG_ROW_LEN AVG_SPACE_FREELIST_BLOCKS NUM_FREELIST_BLOCKS DEGREE INSTANCES CACHE TABLE_LO SAMPLE_SIZE LAST_ANAL PAR IOT_TYPE T S NES BUFFER_ ROW_MOVE GLO USE
DURATION SKIP_COR MON CLUSTER_OWNER DEPENDEN COMPRESS DRO
DISABLED YES DISABLED DISABLED NO
COUNTRIES VALID 0 0 0 0
N 4 0 19 0 1 1 N ENABLED 4 03-SEP-12 NO IOT N N NO DISABLED YES NO
DISABLED YES DISABLED DISABLED NO
DEPARTMENTS EXAMPLE VALID 10 1 255 65536 1 2147483645
TABLE_NAME TABLESPACE_NAME CLUSTER_NAME IOT_NAME STATUS PCT_FREE PCT_USED INI_TRANS MAX_TRANS INITIAL_EXTENT NEXT_EXTENT MIN_EXTENTS MAX_EXTENTS PCT_INCREASE FREELISTS
FREELIST_GROUPS LOG B NUM_ROWS BLOCKS EMPTY_BLOCKS AVG_SPACE CHAIN_CNT AVG_ROW_LEN AVG_SPACE_FREELIST_BLOCKS NUM_FREELIST_BLOCKS DEGREE INSTANCES CACHE TABLE_LO SAMPLE_SIZE LAST_ANAL PAR IOT_TYPE T S NES BUFFER_ ROW_MOVE GLO USE
DURATION SKIP_COR MON CLUSTER_OWNER DEPENDEN COMPRESS DRO
NO N 8 5 0 0 0 19 0 0 1 1 N ENABLED 8 03-SEP-12 NO N N NO DEFAULT DISABLED YES NO
DISABLED YES DISABLED DISABLED NO
EMPLOYEES EXAMPLE VALID 10 1 255 65536 1 2147483645
NO N 20 5 0 0 0 66 0 0 1 1 N ENABLED 20 03-SEP-12 NO N N NO DEFAULT DISABLED YES NO
DISABLED YES DISABLED DISABLED NOi want to display the data in readable format
10g oracle.Hi,
Rahul_India wrote:
i want to display the data in readable formatHow to do that depends on what you consider "readable".
SET PAGESIZE higher, to get fewer header rows.
SET LINESIZE higher, if appropriate
Look up the COLUMN command in the SQL*Plus manual The
FORMAT
FOLD_AFTER, FOLD_BEFORE
TRUNCATED, WRAPPED, WORD_WRAPPED
options are especially useful.
Do you really need to see all the columns? If not, don't use SELECT *.
Consider explicitly listing the columns in a different order. The output may be more readable if related columns are listed together, or one directly above the other. At any rate, you can probably pack multi-line output more tightly if you specify the order.
Do you have a text editor where reading long lines is easier than it is in the SQL*Plus window? If so, SPOOL the output, and read the file it creates in your editor. -
Displaying a form in an iView & displaying data in .pdf format in an iView
Hi,
1)We want to show some details in an iView pertaining to the person who has logged into the portal. We are calling a function module (when a user clicks on a workset in the portal) and passing some parameters to it. The function module pulls the data from the tables and generates a sap script which displays the data in a SAP Script Form.
Now our problem is how do we display the form in the iView?
2) We want to show some details in an iView pertaining to the person who has logged into the portal. We are calling a function module (when a user clicks on a workset in the portal) and passing some parameters to it. The function module pulls the data from the tables and converts the data into a pdf file.
How do we display the data in the .pdf format in the iView.Hi,
displaying a PDF in an iView I receive the following errormessage:
Access denied:.....
security zone:.....
The portalapp.xml is like
<property name="SecurityZone" value="epp/NO_SAFETY"/>
<property name="ResourceBundleName" value="epp_lang"/>
<property name="AuthRequirement" value="none"/>
Any ideas?
Thanks
Walter -
Display data in pivot format in ALV
Hi Experts,
I got some problem with data display in ALV. I had my internal table full of data, but I want it to be displayed in ALV in a special way. For example, I had the internal table of 3 fields: A,B, Ca & Cb with data like A1, B1....
A
B
Ca
Cb
A1
B1
C1
Cat
A1
B1
C2
Cry
A2
B2
C1
Cat
A2
B2
C2
Cry
A3
B3
C3
Car
Can they be displayed in ALV in a pivotal form like below
A
B
Cat
Cry
Car
A1
B1
C1
C2
A2
B2
C1
C2
A3
B3
C3
Appreciate any kind of help provided. Many thanks in advance.HI,
PERFORM change_headings
USING
*.. Table name
'?' "put your table name i here!!
*.. Fieldname
'M112005'
*.. Short...
'NOV 2005'
*.. Long
'November 2005'
*.. Medium
'November 2005'
*.. Dictionary Heading
'November 2005'.
*& Form change_headings
Changes the short, long, medium and and dictionary heading
fields for a given output field.
-->us_fieldname name of field to deal with
-->us_short text for short heading
-->us_long text for long heading
-->us_medium text for medium heading
-->us_heading text for dictionary heading
FORM change_headings
USING
us_tabname TYPE tabname
us_fieldname TYPE fieldname
us_short TYPE scrtext_s
us_long TYPE scrtext_l
us_medium TYPE scrtext_m
us_heading TYPE reptext.
*.. Short...
PERFORM set_fieldcat_attribute
USING
us_tabname
us_fieldname
'seltext_S'
us_short
t_fieldcat.
*.. Long
PERFORM set_fieldcat_attribute
USING
us_tabname
us_fieldname
'seltext_L'
us_long
t_fieldcat.
*.. Medium
PERFORM set_fieldcat_attribute
USING
us_tabname
us_fieldname
'seltext_M'
us_medium
t_fieldcat.
*.. Dictionary Heading
PERFORM set_fieldcat_attribute
USING
us_tabname
us_fieldname
'reptext_ddic'
us_heading
t_fieldcat.
ENDFORM. " change_headings
*& Form SET_fieldCAT_attribute
sets a fieldcat attribute,
e.g. can hide a field in ALV output, change title, etc
-->pv_table table name
-->pv_field field name
-->pv_attrib name of attribute to be changed
-->pv_newval new value to be put in attribute
-->pt_fieldcat field catlog
FORM set_fieldcat_attribute
USING pv_table TYPE tabname
pv_field TYPE fieldname
pv_attrib TYPE fieldname
pv_newval TYPE any
pt_fieldcat TYPE slis_t_fieldcat_alv
FIELD-SYMBOLS: <attrib>,
<fieldcat> TYPE slis_fieldcat_alv.
ensure working in upper case
TRANSLATE pv_table TO UPPER CASE.
ensure working in upper case
TRANSLATE pv_field TO UPPER CASE.
find the entry matching the input fieldname
READ TABLE pt_fieldcat ASSIGNING <fieldcat>
WITH KEY fieldname = pv_field tabname = pv_table.
if found..
IF sy-subrc = 0.
*.. set up the full name of field
CONCATENATE '<FIELDCAT>-' pv_attrib INTO w_field_name.
*.. point a field-symbol to it
ASSIGN (w_field_name) TO <attrib>.
*.. fill it with the input new value
<attrib> = pv_newval.
ENDIF.
ENDFORM. " set_fieldcat_attribute
assume itab-date1 = M112005
assume itab-date2 = M112004
assume itab-date3 = M122005
assume itab-date4 = M112004
data : begin of itab1 occurs 0,
mon(2) type c, " example 11
mon_desc(15) type c, "example november
end of itab1.
loop at itab.
l_mon1 = itab-date1+1(2).
l_year1 = itab-date1+3(4).
itab1-mon = l_mon1.
append itab1.
clear itab1.
l_mon2 = itab-date2+1(2).
l_year2 = itab-date2+3(4).
itab1-mon = l_mon2.
append itab1.
clear itab1.
l_mon3 = itab-date3+1(2).
l_year3 = itab-date3+3(4).
itab1-mon = l_mon3.
append itab1.
clear itab1.
l_mon4 = itab-date4+1(2).
l_year4 = itab-date4+3(4).
itab1-mon = l_mon3.
append itab1.
clear itab1.
delete adjacent duplicates from itab1 comparing mon.
write one perform here to get month description for given month using CASE statement and store in itab1-mon_desc.
loop at itab1.
if l_mon_desc1 is initial.
l_mon_desc1 = itab1-mon_desc.
else.
l_mon_desc2 = itab1-mon_desc.
endif.
endloop.
write : 'material description' ,l_mon_desc1 , l_mon_desc2.
write : l_year1 ,l_year2 ,l_year3 ,l_year4 .
just assuming the layout what u had given
PLS: AWARD POINTS .
SRI -
Displaying data in HTML format
This has probably been answered before but when I try to display information from a table column in HTML it loses some formatting capabilities such as carriage returns. What causes this? Does it have to do with DOCTYPE?
Displaying where?
Success
Cor -
Change display to avl grid in standard program
Hi,
My requirment is to modify the standard report for Creditors outstanding (monthly ageing - S_ALR_87012085), the output of this report is in hierarchical ALV, but I want to display it in Grid format. In the standard program there is call to subroutine to display in alv grid, but when I call the subroutine the it shows no records.
Pleace help me on this issue.
Thanks,
Sai.HI,
1. check your internal table data, wheather they are present or not.
2. check wheather the technical setting of the columns of the grid are compateble to the corresponding data or not.
Regards,
Anirban -
How to display data horizontally
Hi,
I have to display data the following format.
sales order item description 01/09/2010 02/09/2010 03/09/2010
100 1 test 3 4 6
in currently i am displaying the following format.
sales order date1 date2 date3
item
description
1.how to fill field catelog.
2. i have written code like below,
wa_lvc_cat-fieldname = 'COLUMNTEXT'.
wa_lvc_cat-ref_table = 'LVC_S_DETA'.
APPEND wa_lvc_cat TO lt_lvc_cat.
wa_fieldcat-fieldname = 'COLUMNTEXT'.
wa_fieldcat-ref_tabname = 'LVC_S_DETA'.
wa_fieldcat-key = 'X'.
APPEND wa_fieldcat TO lt_fieldcat.
DESCRIBE TABLE i_final.
DO sy-tfill TIMES.
For each line, a column 'VALUEx' is created in the fieldcatalog
Build Fieldcatalog
WRITE sy-index TO wa_lvc_cat-fieldname LEFT-JUSTIFIED.
CONCATENATE 'VALUE' wa_lvc_cat-fieldname
INTO wa_lvc_cat-fieldname.
wa_lvc_cat-ref_field = 'VALUE'.
wa_lvc_cat-ref_table = 'LVC_S_DETA'.
APPEND wa_lvc_cat TO lt_lvc_cat.
Build Fieldcatalog
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = wa_lvc_cat-fieldname.
wa_fieldcat-ref_fieldname = 'VALUE'.
wa_fieldcat-ref_tabname = 'LVC_S_DETA'.
APPEND wa_fieldcat TO lt_fieldcat.
ENDDO.
create dynamic internal table
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = lt_lvc_cat
IMPORTING
ep_table = l_dyntable.
ASSIGN l_dyntable->* TO <dynamictable>.
create structure as structure of the internal table
CREATE DATA l_structure LIKE LINE OF <dynamictable>.
ASSIGN l_structure->* TO <header>.
create structure = structure of the internal table
CREATE DATA l_structure LIKE i_final.
ASSIGN l_structure->* TO <ls_table>.
create field catalog from our table structure
wa_fieldcat-fieldname = 'DATE'.
wa_fieldcat-tabname = 'I_FINAL'.
APPEND wa_fieldcat TO lt_fieldcatalogue.
wa_fieldcat-fieldname = 'CNT'.
wa_fieldcat-tabname = 'I_FINAL'.
APPEND wa_fieldcat TO lt_fieldcatalogue.
wa_fieldcat-fieldname = 'FUNCT'.
wa_fieldcat-tabname = 'I_FINAL'.
APPEND wa_fieldcat TO lt_fieldcatalogue.
wa_fieldcat-fieldname = 'ITEM'.
wa_fieldcat-tabname = 'I_FINAL'.
APPEND wa_fieldcat TO lt_fieldcatalogue.
wa_fieldcat-fieldname = 'TRANS'.
wa_fieldcat-tabname = 'I_FINAL'.
APPEND wa_fieldcat TO lt_fieldcatalogue.
*call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_structure_name = <LS_TABLE>
changing
ct_fieldcat = lt_fieldcatalogue
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.
DESCRIBE TABLE lt_fieldcatalogue.
fill the internal to display <dynamictable>
DO sy-tfill TIMES.
IF sy-index = 1.
READ TABLE lt_fieldcatalogue INTO wa_fieldcat INDEX 1.
ENDIF.
For each field of it_table
ASSIGN COMPONENT 1 OF STRUCTURE <header> TO <dynheader>.
IF sy-subrc NE 0. EXIT .ENDIF.
READ TABLE lt_fieldcatalogue INTO wa_fieldcat INDEX sy-index.
Fill 1st column
<dynheader> = wa_fieldcat-seltext_m.
IF <dynheader> IS INITIAL.
<dynheader> = wa_fieldcat-fieldname.
ENDIF.
*filling the other columns
LOOP AT i_final INTO <ls_table>.
l_col = sy-tabix + 1.
ASSIGN COMPONENT sy-index OF STRUCTURE <ls_table> TO <dyndata>.
IF sy-subrc NE 0. EXIT .ENDIF.
ASSIGN COMPONENT l_col OF STRUCTURE <header> TO
<dynheader>.
IF sy-subrc NE 0. EXIT .ENDIF.
WRITE <dyndata> TO <dynheader> LEFT-JUSTIFIED.
ENDLOOP.
APPEND <header> TO <dynamictable>.
ENDDO.
*layout for alv output
lt_layout-zebra = 'X'.
lt_layout-no_colhead = 'X'..
lt_layout-colwidth_optimize ='X'.
lt_layout-window_titlebar = 'ALV GRID TRANSPOSED'.
*alv grid output for display
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
is_layout = lt_layout
it_fieldcat = lt_fieldcat
TABLES
t_outtab = <dynamictable>.
Plz correct me code.here's a sample to prepare a alv-fieldcatalog with many similar value-fields:
*get metadata of itab
DESCRIBE FIELD itab INTO td.
LOOP AT td-types INTO watypes.
READ TABLE td-names INTO wanames INDEX watypes-idx_name.
CHECK sy-subrc = 0.
MOVE wanames-name TO fld-name.
READ TABLE td-names INTO wanames INDEX watypes-idx_help_id .
MOVE wanames-name TO fld-def.
WHILE wanames-continue = '*'.
hindex = watypes-idx_help_id + 1.
READ TABLE td-names INTO wanames INDEX hindex.
CONCATENATE fld-def wanames-name INTO fld-def.
ENDWHILE.
APPEND fld.
ENDLOOP.
*build fieldcatalog
LOOP AT fld.
CLEAR katalog.
katalog-fieldname = fld-name.
IF fld-name = 'RCOMP'
OR fld-name ='GSBER'
OR fld-name ='ITEM'
OR fld-name ='FUNKTION'.
katalog-key = 'X'.
ENDIF.
SPLIT fld-def AT '-' INTO t f.
SELECT SINGLE scrtext_m leng
FROM dd03m INTO: (katalog-reptext_ddic, katalog-outputlen)
WHERE tabname = t
AND fieldname = f
AND ddlanguage = sy-langu.
IF sy-subrc <> 0.
katalog-reptext_ddic = fld-name.
ENDIF.
IF fld-name = 'TXT'.
katalog-outputlen = 30.
ELSEIF fld-name = 'GSBER'.
katalog-outputlen = 4.
ELSE.
katalog-tabname = t.
ENDIF.
*here: different value-fields
IF fld-name BETWEEN 'KSL00' AND 'KSL99'.
IF fld-name <> 'KSL99'.
CONCATENATE 'Periode' fld-name+3(2) '/' jahr INTO
katalog-reptext_ddic SEPARATED BY space.
*hide fields
IF NOT fld-name+3(2) IN buper.
katalog-no_out = 'X'.
ENDIF.
ELSE.
katalog-outputlen = 19.
IF ohnevj = 'X'.
katalog-reptext_ddic = 'Summe'.
ELSE.
*previous year
CONCATENATE 'Periode' buper-low '/' vorjahr INTO
katalog-reptext_ddic SEPARATED BY space.
ENDIF.
ENDIF.
katalog-currency = 'EUR'.
katalog-do_sum = 'X'.
katalog-inttype = 'P'.
katalog-datatype = 'CURR'.
ENDIF.
*hide more fields
CASE fld-name.
WHEN 'GSBER'.
MOVE x_gebe TO katalog-no_out.
katalog-reptext_ddic = 'Gsbr'.
WHEN 'ITEM'.
MOVE x_item TO katalog-no_out.
WHEN 'FUNKTION'.
MOVE x_func TO katalog-no_out.
WHEN 'TXT'.
MOVE x_text TO katalog-no_out.
ENDCASE.
APPEND katalog TO cat.
ENDLOOP.
grx
A. -
ALV grid display in a particular format
Hi,
Could you please tell me how do i display the alv grid in this particular format :
col1 | col2 | col3 | col4 |
abc1 | def1 | -
|----
|
abc1 | def2 | -
|----
|
abc1 |-----| ghi1 |-----|
abc1 |-----| ghi2 |-----|
abc2 | def3 | -
|----
|
abc2 | def4 | -
|----
|
abc2 |-----| ghi3 |-----|
abc2 |-----| ghi4 |-----|
1. For a single site (col1), there are multiple values in col2 and col3.
2. col2 and col3 are not related.
3. col2 and col3 individually is rlated to col1.
Any help would be highly appreciated.Hi,
All you need to do is to sort the records while displaying in ALV Grid.
Refer the below code snippet:-
*SORTING
DATA : it_sort TYPE slis_t_sortinfo_alv,
wa_sort TYPE slis_sortinfo_alv.
* SORT INFO
wa_sort-spos = 1. "<--sort preference
wa_sort-fieldname = 'COL1'. "<--column which needs to be sorted
wa_sort-tabname = 'IT_FINAL'. "<--internal table
wa_sort-up = 'X'. "<--ascending order
APPEND wa_sort TO it_sort.
CLEAR wa_sort.
wa_sort-spos = 2. "<--sort preference
wa_sort-fieldname = 'COL3'. "<--column which needs to be sorted
wa_sort-tabname = 'IT_FINAL'. "<--internal table
wa_sort-up = 'X'. "<--ascending order
APPEND wa_sort TO it_sort.
CLEAR wa_sort.
wa_sort-spos = 3. "<--sort preference
wa_sort-fieldname = 'COL2'. "<--column which needs to be sorted
wa_sort-tabname = 'IT_FINAL'. "<--internal table
wa_sort-up = 'X'. "<--ascending order
APPEND wa_sort TO it_sort.
CLEAR wa_sort.
* DISPLAY RECORDS IN ALV GRID
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = it_field
it_sort = it_sort "<--sort info
TABLES
t_outtab = it_final
Hope this helps you.
Regards,
Tarun -
Displaying Date types in the grid control
I have a grid control and one of the column is displaying
'Date' type data. I am able to see the Date values in the grid, if
I define the return type of the getter function as String format.
But the problem with this is, when I click on the Date column
header, the grid is sorting the rows while treating the Date values
as String values. And when I change the return type of the getter
method as Date type (java.util.Date), I don't see any Date values
in the grid. Do I need to do any additional coding to display the
date values as Date types to display the data and then to be able
to sort the grid on Date types.
Please help.You should return Date values to the Flex application and
store them in the dataProvider associated with that DataGrid. For
Date-values you have a couple of choices:
1. Actually store the time (a long Number - milliseconds
since Jan 1970) and use a labelFunction on the column to format
that values as a Date. This way sorting will treat the value as a
number, but it will appear as a Date.
2. Write your own Sort compare method for that column. Check
the docs on Sort and SortField. -
To Display Report in a ALV GRID Format
Hi All,
I want to display dome information in ALV Grid format.
Can anybody give example for displaying data in ALV Grid Format.
Thanks in advance.
Thanks & Regards,
Rayeez.Hi ,
1.FOR ALV Lists..
REPORT Y_DEMO_ALV NO STANDARD PAGE HEADING.
Data to be displayed
DATA: I_SFLIGHT TYPE TABLE OF SFLIGHT.
Selection
SELECT * FROM SFLIGHT INTO TABLE I_SFLIGHT.
Call ABAP List Viewer (ALV)
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_STRUCTURE_NAME = 'SFLIGHT'
TABLES
T_OUTTAB = I_SFLIGHT.
2.Using Grids..
REPORT Y_DEMO_ALV_1.
Data to be displayed
DATA: I_SFLIGHT TYPE TABLE OF SFLIGHT.
Selection
SELECT * FROM SFLIGHT INTO TABLE I_SFLIGHT.
Call ABAP List Viewer (ALV)
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_STRUCTURE_NAME = 'SFLIGHT'
TABLES
T_OUTTAB = I_SFLIGHT.
3.Demo Using most of the ALv Functionalities..
REPORT ZSATTRIAL4.
TYPE-POOLS: slis.
DB-Table
TABLES sflight.
Includes
INCLUDE <icon>.
INCLUDE <symbol>.
CONSTANTS:
c_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
DATA: i_fieldcat TYPE slis_t_fieldcat_alv,
i_layout TYPE slis_layout_alv,
i_sp_group TYPE slis_t_sp_group_alv,
i_events TYPE slis_t_event,
i_print TYPE slis_print_alv,
i_sort TYPE slis_t_sortinfo_alv.
*internal table for data to be displayed
DATA: BEGIN OF i_sflight OCCURS 0.
INCLUDE STRUCTURE sflight.
DATA: box,
lights.
DATA: END OF i_sflight.
DATA: w_repid LIKE sy-repid.
DATA: i_list_top_of_page TYPE slis_t_listheader.
Report Selections
SELECT-OPTIONS s_carrid FOR sflight-carrid.
SELECT-OPTIONS s_connid FOR sflight-connid.
SELECT-OPTIONS s_fldate FOR sflight-fldate.
*SELECTION-SCREEN SKIP 1.
Parameters
PARAMETERS: p_maxrow TYPE i DEFAULT 30."to limit the selection
SELECTION-SCREEN SKIP 1.
Variant for ALV display
SELECTION-SCREEN BEGIN OF BLOCK 0 WITH FRAME TITLE text-000.
PARAMETERS: p_varnt LIKE disvariant-variant.
SELECTION-SCREEN END OF BLOCK 0.
Layout of the report display
SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001.
PARAMETERS: p_zebra AS CHECKBOX DEFAULT ' ', "Striped pattern
p_nocolh AS CHECKBOX DEFAULT ' ', "No column heading
p_novlin AS CHECKBOX DEFAULT ' ', "No vertical lines
p_colopt AS CHECKBOX DEFAULT ' ', "Optimizes col. wd
p_keyhot AS CHECKBOX DEFAULT ' ', "Key fields hot
p_noinpt AS CHECKBOX DEFAULT ' '. "No field for input
SELECTION-SCREEN END OF BLOCK a.
SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-002.
PARAMETERS: p_lights AS CHECKBOX DEFAULT 'X',
p_lightc AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN END OF BLOCK b.
SELECTION-SCREEN BEGIN OF BLOCK c WITH FRAME TITLE text-003.
PARAMETERS: p_totonl AS CHECKBOX DEFAULT ' ',
p_totext(60),
p_sttext(60).
SELECTION-SCREEN END OF BLOCK c.
SELECTION-SCREEN BEGIN OF BLOCK d WITH FRAME TITLE text-004.
PARAMETERS: p_chkbox AS CHECKBOX DEFAULT 'X',
p_detpop AS CHECKBOX DEFAULT 'X',
p_groupb AS CHECKBOX DEFAULT ' ',
p_groups AS CHECKBOX DEFAULT ' '.
SELECTION-SCREEN END OF BLOCK d.
SELECTION-SCREEN BEGIN OF BLOCK e WITH FRAME TITLE text-005.
PARAMETERS: p_print AS CHECKBOX DEFAULT ' ',
p_nosinf AS CHECKBOX DEFAULT ' ',
p_nocove AS CHECKBOX DEFAULT ' ',
p_nonewp AS CHECKBOX DEFAULT ' ',
p_nolinf AS CHECKBOX DEFAULT ' ',
p_reserv TYPE i.
SELECTION-SCREEN END OF BLOCK e.
DATA: w_boxnam TYPE slis_fieldname VALUE 'BOX',
w_f2code LIKE sy-ucomm VALUE '&ETA',
w_lignam TYPE slis_fieldname VALUE 'LIGHTS',
w_save(1) TYPE c,
w_default(1) TYPE c,
w_exit(1) TYPE c,
i_variant LIKE disvariant,
i_variant1 LIKE disvariant.
INITIALIZATION.
w_repid = sy-repid.
PERFORM fieldcat_init USING i_fieldcat.
PERFORM eventtab_build USING i_events.
PERFORM comment_build USING i_list_top_of_page.
PERFORM sp_group_build USING i_sp_group.
PERFORM t_sort_build USING i_sort.
Set Options: save variant userspecific or general
'A or 'U' are for user-specific variants list
'X' or 'space' for general
w_save = 'A'.
PERFORM variant_init.
Get default variant
i_variant1 = i_variant.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
i_save = w_save
CHANGING
cs_variant = i_variant1
EXCEPTIONS
not_found = 2.
IF sy-subrc = 0.
p_varnt = i_variant1-variant.
ENDIF.
Process on value request (list of possible variants)
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_varnt.
PERFORM f4_for_variant.
PAI
AT SELECTION-SCREEN.
PERFORM pai_of_selection_screen.
START-OF-SELECTION.
PERFORM selection.
END-OF-SELECTION.
PERFORM layout_build USING i_layout. "wg. Parameters
PERFORM print_build USING i_print. "wg. Parameters
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = w_repid
i_internal_tabname = 'I_SFLIGHT'
i_structure_name = 'SFLIGHT'
i_client_never_display = 'X'
i_inclname = w_repid
CHANGING
ct_fieldcat = i_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Call ABAP/4 List Viewer
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
i_callback_program = w_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
i_structure_name = 'SFLIGHT'
i_background_id = 'ALV_BACKGROUND'
I_GRID_TITLE =
I_GRID_SETTINGS =
is_layout = i_layout
it_fieldcat = i_fieldcat[]
IT_EXCLUDING =
it_special_groups = i_sp_group[]
it_sort = i_sort[]
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
i_save = w_save
is_variant = i_variant
it_events = i_events[]
IT_EVENT_EXIT =
is_print = i_print
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = i_sflight
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.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = w_repid
i_structure_name = 'SFLIGHT'
is_layout = i_layout
it_fieldcat = i_fieldcat[]
IT_EXCLUDING =
it_special_groups = i_sp_group[]
it_sort = i_sort[]
IT_FILTER =
IS_SEL_HIDE =
i_default = W_DEFAULT
i_save = w_save
is_variant = i_variant
it_events = i_events[]
IT_EVENT_EXIT =
is_print = i_print
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
TABLES
t_outtab = i_sflight.
FORM FIELDCAT_INIT *
--> L_FIELDCAT *
FORM fieldcat_init USING l_fieldcat TYPE slis_t_fieldcat_alv.
DATA: ls_fieldcat TYPE slis_fieldcat_alv.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'SEATSOCC'.
*The field is not displayed in the initial output, can be interactively
chosen for display
ls_fieldcat-no_out = 'X'.
*This field is assigned to a special group with tech. key 'A' and can be
*displayed using the special group buttons
ls_fieldcat-sp_group = 'A'.
*The field cannot be summed irrespective of its data type
ls_fieldcat-no_sum = 'X'.
APPEND ls_fieldcat TO l_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'SEATSMAX'.
ls_fieldcat-no_out = 'X'.
ls_fieldcat-sp_group = 'A'.
APPEND ls_fieldcat TO l_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'PRICE'.
ls_fieldcat-no_out = 'X'.
ls_fieldcat-sp_group = 'B'.
APPEND ls_fieldcat TO l_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'CARRID'.
ls_fieldcat-outputlen = 7.
APPEND ls_fieldcat TO l_fieldcat.
ENDFORM.
FORM DATA_ADD *
--> L_SFLIGHT
FORM data_add TABLES l_sflight STRUCTURE i_sflight.
LOOP AT l_sflight.
IF sy-tabix > 10.
l_sflight-box = 'X'.
l_sflight-lights = '3'.
ELSE.
IF sy-tabix = 1.
l_sflight-lights = '2'.
ELSE.
l_sflight-lights = '1'.
ENDIF.
ENDIF.
MODIFY l_sflight.
ENDLOOP.
ENDFORM.
FORM EVENTTAB_BUILD *
--> l_EVENTS *
FORM eventtab_build USING l_events TYPE slis_t_event.
DATA: ls_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = l_events.
READ TABLE l_events WITH KEY name = slis_ev_top_of_page INTO ls_event.
IF sy-subrc = 0.
MOVE c_formname_top_of_page TO ls_event-form.
APPEND ls_event TO l_events.
ENDIF.
ENDFORM.
FORM COMMENT_BUILD *
--> L_TOP_OF_PAGE *
FORM comment_build USING l_top_of_page TYPE slis_t_listheader.
DATA: ls_line TYPE slis_listheader.
***Header
CLEAR ls_line.
ls_line-typ = 'H'.
LS_LINE-KEY: not used for this type
ls_line-info = 'Heading list'.
APPEND ls_line TO l_top_of_page.
***Selection
CLEAR ls_line.
ls_line-typ = 'S'.
ls_line-key = 'Key 1'.
ls_line-info = 'Information'.
APPEND ls_line TO l_top_of_page.
ls_line-key = 'Key 2'.
APPEND ls_line TO l_top_of_page.
***Action
CLEAR ls_line.
ls_line-typ = 'A'.
LS_LINE-KEY: not used for this type
Ls_line-info = 'Status list'.
APPEND ls_line TO l_top_of_page.
ENDFORM.
FORM LAYOUT_BUILD *
<-> LS_LAYOUT *
FORM layout_build USING ls_layout TYPE slis_layout_alv.
ls_layout-f2code = w_f2code.
ls_layout-zebra = p_zebra.
ls_layout-colwidth_optimize = p_colopt.
IF p_chkbox = 'X'.
*Fieldname for check box on the report output
ls_layout-box_fieldname = w_boxnam.
ELSE.
ls_layout-box_fieldname = space.
ENDIF.
ls_layout-no_input = p_noinpt.
ls_layout-no_vline = p_novlin.
ls_layout-no_colhead = p_nocolh.
IF p_lights = 'X' OR p_lightc = 'X'.
**Fieldname for lights on the report output
ls_layout-lights_fieldname = w_lignam.
ELSE.
CLEAR ls_layout-lights_fieldname.
ENDIF.
ls_layout-lights_condense = p_lightc.
ls_layout-totals_text = p_totext.
ls_layout-subtotals_text = p_sttext.
ls_layout-totals_only = p_totonl.
ls_layout-key_hotspot = p_keyhot.
ls_layout-detail_popup = p_detpop.
ls_layout-group_change_edit = p_groups.
E05_LS_LAYOUT-GROUP_BUTTONS = P_GROUPB.
ls_layout-group_buttons = 'X'.
ENDFORM.
FORM SP_GROUP_BUILD *
--> L_SP_GROUP *
FORM sp_group_build USING l_sp_group TYPE slis_t_sp_group_alv.
DATA: ls_sp_group TYPE slis_sp_group_alv.
*Fields are assigned to the special group
CLEAR ls_sp_group.
ls_sp_group-sp_group = 'A'.
ls_sp_group-text = 'Reservation status'.
APPEND ls_sp_group TO l_sp_group.
CLEAR ls_sp_group.
ls_sp_group-sp_group = 'B'.
ls_sp_group-text = 'Flight charges'.
APPEND ls_sp_group TO l_sp_group.
ENDFORM.
FORM SELECTION *
FORM selection.
SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE i_sflight
UP TO p_maxrow ROWS WHERE carrid IN s_carrid
AND connid IN s_connid AND fldate IN s_fldate.
PERFORM data_add TABLES i_sflight.
ENDFORM.
FORM TOP_OF_PAGE *
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
i_logo = 'ENJOYSAP_LOGO'
it_list_commentary = i_list_top_of_page.
ENDFORM.
FORM F4_FOR_VARIANT *
FORM f4_for_variant.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = i_variant
i_save = w_save
it_default_fieldcat =
IMPORTING
e_exit = w_exit
es_variant = i_variant1
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 w_exit = space.
p_varnt = i_variant1-variant.
ENDIF.
ENDIF.
ENDFORM.
*& Form PAI_OF_SELECTION_SCREEN
to check whether right variant is entered on the selection scr
FORM pai_of_selection_screen.
IF NOT p_varnt IS INITIAL.
MOVE i_variant TO i_variant1.
MOVE p_varnt TO i_variant1-variant.
CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
EXPORTING
i_save = w_save
CHANGING
cs_variant = i_variant1.
i_variant = i_variant1.
ELSE.
PERFORM variant_init.
ENDIF.
ENDFORM. " PAI_OF_SELECTION_SCREEN
*& Form VARIANT_INIT
FORM variant_init.
CLEAR i_variant.
i_variant-report = w_repid.
ENDFORM. " VARIANT_INIT
FORM PRINT_BUILD *
FORM print_build USING l_print TYPE slis_print_alv.
l_print-print = p_print.
l_print-no_print_selinfos = p_nosinf.
l_print-no_coverpage = p_nocove.
l_print-no_new_page = p_nonewp.
l_print-no_print_listinfos = p_nolinf.
l_print-reserve_lines = p_reserv.
l_print-print = p_print.
ENDFORM.
FORM T_SORT_BUILD *
FORM t_sort_build USING l_sort TYPE slis_t_sortinfo_alv.
DATA: ls_sort TYPE slis_sortinfo_alv.
ls_sort-fieldname = 'CARRID'.
ls_sort-spos = 1.
ls_sort-up = 'X'.
ls_sort-subtot = 'X'.
APPEND ls_sort TO l_sort.
ps : reward points for helpful answers and mark the post as closed.. -
Date not being displayed in the custom format
Hi ,
I have a problem wherein i am unable to change the format of the date.
I need the date to be in the format 'January 10,2010.' however the date is being displayed as '1/10/10'. I have tried all options for the date formatting. I specified the custom format as 'MMMM D,YYYY' as mentioned in the SAP Library. I am trying to use the std custom options like YYYY-MM-DD, the date is not being dispalyed in the custom format provided by SAP either.
I have binded date from the context, used the Current Date field provided by SAP. Nothing works.
Its not working on the new form. However the old forms have the same kind of formatting and are being displayed as desired.
Please suggest as to what the issue could be.
Thanks,
Soumya.Hi All,
Even I'm encountering the same issue. I'm trying to control the outputted date format programmatically.Please have a look.
data: v_int_date like sy-datum,
v_ext_date(10).
v_int_date = '20110201'
write v_int_date to v_ext_date MM/DD/YYYY.
Here I've tried to convert the date to external format using a fixed format(MM/DD/YYYY). But still it's getting outputted in the format DD/MM/YYYY only as that's the way its defined in the User Master!
Is there any solution for this? How can I 'override' defaults in the SAP User Master?
Thanks,
Mahesh -
Data not getting displayed in ALV grid when run in background
Hello experts!
Could anyone help me out please?
I need to display an ALV grid in the background. My requirements are as follows:
I first display an ALV grid in the foreground based on some input parameters. The user selects a few records for updating it and clicks on the "update" button. On the click of this button another report must be called and here the ALV report is displayed in the background.I am using "reuse_alv_grid_display" to display the grid.
I am using Import/Export to get the selected rows in my called report. When i execute this report in the foreground i get the ALV grid along with the data. But when i execute it in the background, i get only the grid with the fieldnames and not the data when i check in SP01.
Thanks in advance!
SmithaHi Smitha,
If you are able to see in SP01 and only see the output layout or "List contains no data" shows clealry that the data is not getting passed in the called program or the data is not being used correctly in the called program.
Cheers
VJ -
Hi iam getting the alv grid data in excel format but iam facing one problem
hi iam getting the alv grid data in excel format but iam facing one problem ,
i.e., i want it read only but iam getting it in edit mode i use layout default in excel iam getting in xl directly but in edit mode but i need it in read only mode
what i have to do for that and bdy knows reply me i need it urgently.there's always edit-mode if you choose excel-inplace - but noone can modify/rewrite the data
A. -
Displaying date in dd/MM/yyyy format
Hi all,
I am having one date field .To display the date in correct format, I created a dictionary simple type of type date and entered dd/MM/yyyy in representation tab.
I was using 2004 and it was working properly. Now I am using 2004s for the same application. The problem is when I am selecting a date , it is showing the date in MM/dd/yyyy format in first time. If I selects the date again, then it will be in dd/MM/yyyy format. How can I make the selection in dd/MM/yyyy in first time itself
Thanks
Fahad HamsaHi,
Try this:
1. Create a simple type in the local dictionary. Call it say, CustomDateType.
2. Set the built-in type as date.
3. Go to the representation tab and under "External Representation" set the format to "dd/MM/yyyy".
4. Create a context value attribute day, CustomDate and set its type to CustomDateType.
5. Create an inputfield with id say, "DateField" and bind its value property to CustomDate.
6. Now in your wdDoModifyView() write the following code:
if(firstTime){
IWDViewElement e = view.getElement("DateField");
e.requestFocus();
Regards,
Satyajit.
Maybe you are looking for
-
Can't get NVIDIA/Intel Optimus (Dell XPS 15) to work, startx fails.
I have an up to date Arch and am working from a clean install. I'm trying to run X using NVIDIA only, as outlined here: https://wiki.archlinux.org/index.php/NV … ing_nvidia . I don't want to use bumblebee unless this just can't work. The text that co
-
Eulapi error while creating EUL for APPS12
Dear Guru please help to resolve the following error, we need to create the EUL for disoverer 10.1.2.3 integration with APPS12. here is the error ============================= $ORACLE_HOME/bin/eulapi \ -CREATE_EUL \ -APPS_MODE \ -CONNECT system/passw
-
Dynamic Table in Tableview Download Problem
Hello, I've got a Problem with a dynamic displayed table in a field-symbol. Table is displayed and all that works fine, but when I try download this table into Excel (via Button), the field symbol in the Processing event is initial and data reference
-
EDI: IDoc ' IDOC No ' is already open in process mode
Hi, I have a File to IDOC scenario. Everything is fine in PI. But in R/3, (WE05) there is an error. Please suggest what might be the problem. IDoc: <IDOC No> Status: Application document not posted EDI: IDoc <IDOC No>' is already open in process mode
-
What happened to Photoshop CC's keyword and info memory?
Since a very early version of Photoshop, when using the File Info section, (Document Title, Description, Keywords... pretty much every field), photoshop would remember generally speaking the last 20 entries in each field. This made it quite quick to