Display Row number in ALV List
Hi All,
I have 50 records in Internal table . I am displaying this internal table data in ALV List display. I want to print row number in ALV . Could you please help me how to print.
Thanks,
PRSN.
HI,
take one more field in the internal table and fill it up with the number when you are filling it with data .
loop at itab.
it_final-seqno = sy-tabix.
append it_final.
endloop.
Similar Messages
-
Display Page number in ALV List.
Dear Friends,
I want to display page numbers in ALV list print output. But I dont know how to do that without using objects.
Please suggest.
Regards,
Madan.TRY LIKE THIS
data : ifieldcat type slis_t_fieldcat_alv,
wfieldcat type slis_fieldcat_alv,
IEVENT TYPE SLIS_T_EVENT,
WEVENT TYPE SLIS_ALV_EVENT..
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = IEVENT
EXCEPTIONS
LIST_TYPE_WRONG = 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.
READ TABLE IEVENT INTO WEVENT WITH KEY NAME = 'TOP_OF_PAGE'.
IF SY-SUBRC EQ 0.
WEVENT-FORM = 'TOP_OF_PAGE'.
MODIFY IEVENT FROM WEVENT INDEX SY-TABIX.
ENDIF.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'TOPOFPAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = IFIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = IEVENT
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IT_ALV_GRAPHICS =
IT_ADD_FIELDCAT =
IT_HYPERLINK =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IT_EXCEPT_QINFO =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = ITAB
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.
FORM TOP_OF_PAGE.
WRITE : /10 'HeadinG OF ALV'.
WRITE : 100 SY-PAGNO.
ENDFORM.
ONE THING IS THERE YOU CAN USE WRITE FOR ONLY LIST DISPLAY NOT FOR GRID DISPALY.
REGARDS
SHIBA DUTTA -
Is it possible to display LOGO in simple ALV list?
Hi Guys,
Is it possible to display LOGO in simple ALV list. If yes plz explain in details.
Thanks
SharatYes it is possible to display logo at the top of the page.
TYPE-POOLS: slis.
* Data Decalaration
DATA: it_vbak TYPE TABLE OF vbak.
DATA: g_repid TYPE sy-repid.
DATA: it_listheader TYPE slis_t_listheader,
wa_listheader TYPE slis_listheader.
* START-OF-SELECTION
START-OF-SELECTION.
g_repid = sy-repid.
SELECT * FROM vbak INTO TABLE it_vbak.
PERFORM build_alv_header.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = g_repid
i_callback_top_of_page = 'TOP_OF_PAGE'
i_structure_name = 'vbak'
TABLES
t_outtab = it_vbak.
*& Form BUILD_ALV_HEADER
FORM build_alv_header .
* Type H is used to display headers i.e. big font
wa_listheader-typ = 'H'.
wa_listheader-info ='Flight Details'.
APPEND wa_listheader TO it_listheader.
CLEAR wa_listheader.
* Type S is used to display key and value pairs
wa_listheader-typ = 'S'.
APPEND wa_listheader TO it_listheader.
CLEAR wa_listheader.
* Type A is used to display italic font
wa_listheader-typ = 'A'.
wa_listheader-key = 'Date :' .
wa_listheader-info ='SAP ALV Report'.
APPEND wa_listheader TO it_listheader.
CLEAR wa_listheader.
ENDFORM. " BUILD_ALV_HEADER
*& Form top_of_page
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_listheader
i_logo = 'PARI'.
ENDFORM. "top_of_page -
Displaying a header on alv list
hi there,
i want to display a header on alv list.
i have already used
call method alvgrid->set_table_for_first_display
regradsHi,
use the TOP_OF_PAGE event and add the event to the IT_EVENTS internal table..
In the subroutine that is assigned to the event..
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = heading.
ENDFORM.
Thanks,
Naren -
How to display row number in form?
Hi guys,
First I fll you in on the story so far..
I have a database data block named :V_PAYUPLOADHEADER_HP, in the property palette I set order by facility and warehouse.
I want to display row number for each fetched record, so I make :V_PAYUPLOADHEADER_HP.NUMB, which will contain the row number.
The following is some methods that I already tried:
- First I tried to make this field a database item=Y , column name = ROWNUM.
The result is the number jump around (3, 1, 2, 5, 4 etc. instead of 1, 2, 3, 4, 5) I think it is because of the order by that I set.
I have to keep this order by setting, so I look for another way to display the rownum.
- Next I tried to set database item = N, column name = null, calculation mode = formula, formula = :system.trigger_record.
When I run it all the value of :V_PAYUPLOADHEADER_HP.NUMB is 1. For all the records fetched is 1, 1, 1, 1 instead of 1, 2, 3, 4.
- I also tried using POST-QUERY trigger attached to the block.
In the trigger I have this code:
:V_PAYUPLOADHEADER_HP.NUMB := :system.cursor_record;
When I run it all the value of :V_PAYUPLOADHEADER_HP.NUMB is 1. For all the records fetched is 1, 1, 1, 1 instead of 1, 2, 3, 4..
Is there something that I missed?
What can I do to display the rownum?Hi
You can achieve this by adding new item named 'ROWNUM'. in the Data Block you are working on.
And it's 'BASE TABLE ITEM' property needs to be set as TRUE'. IN the property ,IN the post-query Trigger use...
SELECT ROWNUM
INTO :ROWNUM
FROM TABLE
WHERE EMP_ID =EMP_ID;Hope this helps...
Regards,
Abdetu... -
How to display header for secondrary alv list
HI ALL,
WHEN I RAN THIS REPORT HEADER IS COMING FOR FIRST ALV.WHEN I DOUBLE CLICK ON SALES ORDER NUMBER IT SHOWS SECONDARY LIST. FOR THIS SECONDARY LIST HEADER IS NOT COMING.ANY BODY CAN SUGGEST HOW TO FIXZ THIS PROBLEM
REPORT ZMAHI1 LINE-SIZE 30.
TYPE-POOLS : SLIS.
*TYPES : BEGIN OF I_VBAK,
VBELN TYPE VBAK-VBELN,
ERDAT TYPE VBAK-ERDAT,
ERNAM TYPE VBAK-ERNAM,
ERZET TYPE VBAK-ERZET,
VTWEG TYPE VBAK-VTWEG,
VKORG TYPE VBAK-VKORG,
END OF I_VBAK.
DATA : BEGIN OF IT_VBAK OCCURS 0,
VBELN TYPE VBAK-VBELN,
ERDAT TYPE VBAK-ERDAT,
ERNAM TYPE VBAK-ERNAM,
ERZET TYPE VBAK-ERZET,
VTWEG TYPE VBAK-VTWEG,
VKORG TYPE VBAK-VKORG,
END OF IT_VBAK.
*DATA : IT_VBAK TYPE STANDARD TABLE OF I_VBAK INITIAL SIZE 0,
WA_VBAK TYPE I_VBAK.
*TYPES : BEGIN OF I_VBAP,
VBELN TYPE VBAP-VBELN,
MATNR TYPE VBAP-MATNR,
ERZET TYPE VBAP-ERZET,
POSNR TYPE VBAP-POSNR,
END OF I_VBAP.
DATA : BEGIN OF IT_VBAP OCCURS 0,
VBELN TYPE VBAP-VBELN,
MATNR TYPE VBAP-MATNR,
ERZET TYPE VBAP-ERZET,
POSNR TYPE VBAP-POSNR,
LINE_COLOR(4) TYPE C, "Used to store row color attributes
END OF IT_VBAP.
*DATA : IT_VBAP TYPE STANDARD TABLE OF I_VBAP INITIAL SIZE 0,
WA_VBAP TYPE I_VBAP.
DATA : EVENTCAT TYPE SLIS_T_EVENT.
DATA: I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA: FIELDCATALOG 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.
DATA: I_TITLE_VBAK TYPE LVC_TITLE VALUE 'ALV LIST FIRST'.
DATA: I_TITLE_VBAP TYPE LVC_TITLE VALUE 'ALV LIST SECOND'.
DATA: V_REPID LIKE SY-REPID .
DATA : HEADING TYPE SLIS_T_LISTHEADER.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-T01.
PARAMETERS : P_VBELN TYPE VBAK-VBELN.
SELECTION-SCREEN END OF BLOCK B1.
INITIALIZATION.
V_REPID = SY-REPID.
START-OF-SELECTION.
PERFORM GET_DATA.
PERFORM BUILT_FIELDCATALOG.
PERFORM E03_EVENTTAB_BUILD USING EVENTCAT[].
PERFORM COMMENT_BUILD USING HEADING[].
PERFORM GRID_DISPLAY.
*& Form GET_DATA
text
--> p1 text
<-- p2 text
FORM GET_DATA.
SELECT VBELN
ERDAT
ERNAM
ERZET
VTWEG
VKORG
FROM VBAK
INTO TABLE IT_VBAK
WHERE VBELN EQ P_VBELN.
ENDFORM. " GET_DATA
*& Form BUILT_FIELDCATALOG
text
--> p1 text
<-- p2 text
FORM BUILT_FIELDCATALOG.
CLEAR I_FIELDCAT.
REFRESH : I_FIELDCAT[].
WA_FIELDCAT-TABNAME = 'IT_VBAK'.
WA_FIELDCAT-FIELDNAME = 'VBELN'.
WA_FIELDCAT-SELTEXT_M = 'SALES DOC NO'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_VBAK'.
WA_FIELDCAT-FIELDNAME = 'ERDAT'.
WA_FIELDCAT-SELTEXT_M = 'Creation Date'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_VBAK'.
WA_FIELDCAT-FIELDNAME = 'ERNAM'.
WA_FIELDCAT-SELTEXT_M = 'NAME'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_VBAK'.
WA_FIELDCAT-FIELDNAME = 'ERZET'.
WA_FIELDCAT-SELTEXT_M = 'TIME'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_VBAK'.
WA_FIELDCAT-FIELDNAME = 'VTWEG'.
WA_FIELDCAT-SELTEXT_M = 'DIS CHANNEL'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_VBAK'.
WA_FIELDCAT-FIELDNAME = 'VKORG'.
WA_FIELDCAT-SELTEXT_M = 'SALES ORG'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
ENDFORM. " BUILT_FIELDCATALOG
*& Form GRID_DISPLAY
text
--> p1 text
<-- p2 text
FORM GRID_DISPLAY.
V_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'
IT_FIELDCAT = I_FIELDCAT[]
I_SAVE = 'A'
IT_EVENTS = EVENTCAT[]
TABLES
T_OUTTAB = IT_VBAK
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. " GRID_DISPLAY
for header
*& Form HEADER
FORM TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = HEADING.
ENDFORM. " HEADER
*& Form E03_EVENTTAB_BUILD
FORM E03_EVENTTAB_BUILD USING E03_LT_EVENTS TYPE SLIS_T_EVENT.
DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 3
IMPORTING
ET_EVENTS = E03_LT_EVENTS.
READ TABLE E03_LT_EVENTS
WITH KEY NAME = SLIS_EV_TOP_OF_PAGE INTO LS_EVENT.
IF SY-SUBRC = 0.
MOVE 'TOP_OF_PAGE' TO LS_EVENT-FORM.
APPEND LS_EVENT TO E03_LT_EVENTS.
ENDIF.
DELETE E03_LT_EVENTS WHERE FORM IS INITIAL.
ENDFORM. " E03_EVENTTAB_BUILD
*& Form COMMENT_BUILD
FORM COMMENT_BUILD USING LT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
DATA: W_HEADING TYPE SLIS_LISTHEADER.
DATA: W_HEADING1 TYPE SLIS_LISTHEADER.
CLEAR : W_HEADING, LT_TOP_OF_PAGE.
REFRESH : LT_TOP_OF_PAGE.
W_HEADING-INFO = 'Synopsys World' .
W_HEADING-TYP = 'H'.
APPEND W_HEADING TO LT_TOP_OF_PAGE .
CLEAR W_HEADING .
ENDFORM. " COMMENT_BUILD
end of header portion.
*& Form USER_COMMAND
text
-->R_UCOMM text
-->, text
-->RS_SLEFIELDtext
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&IC1'.
IF RS_SELFIELD-FIELDNAME = 'VBELN'.
PERFORM GETDATA_FROM_VBAP.
PERFORM BUILD_FIELDCATLOG_IT_VBAP.
PERFORM BUILD_LAYOUT.
PERFORM E03_EVENTTAB_BUILD USING EVENTCAT[].
PERFORM COMMENT_BUILD USING HEADING[].
PERFORM GRID_DISPLAY1.
ENDIF.
ENDCASE.
ENDFORM. "user_command
*& Form GETDATA_FROM_VBAP
text
--> p1 text
<-- p2 text
FORM GETDATA_FROM_VBAP.
DATA: LD_COLOR(1) TYPE C.
SELECT VBELN
MATNR
ERZET
POSNR
FROM VBAP
INTO TABLE IT_VBAP
FOR ALL ENTRIES IN IT_VBAK
WHERE VBELN = IT_VBAK-VBELN.
LOOP AT IT_VBAP .
LD_COLOR = LD_COLOR + 1.
IF LD_COLOR = 8.
LD_COLOR = 1.
ENDIF.
CONCATENATE 'C' LD_COLOR '10' INTO IT_VBAP-LINE_COLOR.
MODIFY IT_VBAP TRANSPORTING LINE_COLOR.
ENDLOOP.
ENDFORM. " GETDATA_FROM_VBAP
*& Form BUILD_FIELDCATLOG_IT_VBAP
text
--> p1 text
<-- p2 text
FORM BUILD_FIELDCATLOG_IT_VBAP.
CLEAR FIELDCATALOG.
REFRESH : FIELDCATALOG[].
FIELDCATALOG-FIELDNAME = 'VBELN'.
FIELDCATALOG-SELTEXT_M = 'SALES DOC NO'.
FIELDCATALOG-COL_POS = 0.
FIELDCATALOG-OUTPUTLEN = 10.
FIELDCATALOG-EMPHASIZE = 'X'.
FIELDCATALOG-KEY = 'X'.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'POSNR'.
FIELDCATALOG-SELTEXT_M = 'PO Item'.
FIELDCATALOG-COL_POS = 1.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'MATNR'.
FIELDCATALOG-SELTEXT_M = 'MAT NO'.
FIELDCATALOG-COL_POS = 2.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'ERZET'.
FIELDCATALOG-SELTEXT_M = 'TIME'.
FIELDCATALOG-COL_POS = 3.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
ENDFORM. " BUILD_FIELDCATLOG_IT_VBAP
*& Form GRID_DISPLAY1
text
--> p1 text
<-- p2 text
FORM GRID_DISPLAY1.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = GD_REPID
I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'
IS_LAYOUT = GD_LAYOUT
IT_FIELDCAT = FIELDCATALOG[]
I_SAVE = 'A'
IT_EVENTS = EVENTCAT[]
TABLES
T_OUTTAB = IT_VBAP
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. " GRID_DISPLAY1
*& Form BUILD_LAYOUT
text
--> p1 text
<-- p2 text
FORM BUILD_LAYOUT.
GD_LAYOUT-NO_INPUT = 'X'.
GD_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
GD_LAYOUT-TOTALS_TEXT = 'Totals'(201).
GD_LAYOUT-INFO_FIELDNAME = 'LINE_COLOR'.
ENDFORM. " BUILD_LAYOUTIn ur report,
in the rountine <b>GRID_DISPLAY1</b>.
<b> GD_REPID = SY-REPID.</b>
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = GD_REPID
I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'
IS_LAYOUT = GD_LAYOUT
IT_FIELDCAT = FIELDCATALOG[]
I_SAVE = 'A'
IT_EVENTS = EVENTCAT[]
TABLES
T_OUTTAB = IT_VBAP
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. -
Show row number in Collapsed List
We created one collapsed list, then we use icommond to deploy this view to different enviroment.
But after import this view, we found it will show row number in list.
For example, if list is empty, it shows "0 rows", if has 3 rows it show "3 rows" and then the 3 rows data
I can not find how to hide this row numberUsually, this happens when your report is open and you import data through icommand so that this data gets appeared as real time data in the view. We use this number to let user know how many transactions/rows have got applied after he opened the report.
Are you seeing this in design time also (like when you open the report in activestudio in edit mode) or only in view mode? Does closing the report and reopening it help this number go away?
Thanks,
Vishal
BAM Development -
Displaying page number in ALV grid display
Hi,
Is it possible to display page number in an ALV grid display?
If yes, how?
I tried it in top of page event, but it didnt work.
Harmeet.hi,
check out the sample code....
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_user_command = 'F00007_USER_COMMAND'
i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE'
it_fieldcat = g_t_fieldcat[]
it_events = gt_events[]
i_save = 'A'
TABLES
t_outtab = g_t_final_report[]
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.
FORM TOP_OF_PAGE *
FORM top_of_page.
write : sy-pagno.
ENDFORM. "top_of_page
Reward Appropriate points.
Regards,
Mansi. -
How to display page-no in alv list
Hi All,
I am trying to display pag number using events 'top-of-page'.
when i write sy-pagno in top-of-page form its printing only 1, if i press page down i need to change the page number. it should display current pag number. How to achieve this. thanks.
regards
vishalwe can print the pageno .I was also trying for the same finally succeded
It can be done in the following manner
DATA SORTING AND SUBTOTAL
DATA: GS_SORT TYPE SLIS_SORTINFO_ALV.
CLEAR GS_SORT.
GS_SORT-FIELDNAME = 'FIELD1'.
GS_SORT-SPOS = 1.
GS_SORT-UP = 'X'.
GS_SORT-SUBTOT = 'X'.
<b>gs_sort-group = '* '. "<<<new page</b>
APPEND GS_SORT TO GT_SORT.
CLEAR GS_SORT.
GS_SORT-FIELDNAME = 'FIELD2'.
GS_SORT-SPOS = 2.
GS_SORT-UP = 'X'.
gs_sort-group = ' '. "<<<new page
*GS_SORT-SUBTOT = 'X'.
APPEND GS_SORT TO GT_SORT.
ABAP List Viewer
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = G_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME = 'ITAB1'
IS_LAYOUT = GS_LAYOUT
IT_FIELDCAT = GT_FIELDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT = GT_SORT[]
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = GT_EVENTS[]
IT_EVENT_EXIT =
IS_PRINT = GS_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 = ITAB1
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2. -
Hi...
How do we give Serial numbers to the records displayed in an ALV list? I can create a column(Sr. No) in the internal table, but this wont work if the user sorts the list.
Regards,
Anoophi.
you can try this out..
the statment WA_A2-SELTEXT_L = 'S_NO' is necessary for display of the numbers in the column in alv..
for example..
WA_A2-COL_POS = 1.
WA_A2-FIELDNAME = 'S_NO'.
<b>WA_A2-SELTEXT_L = 'S_NO'.</b>WA_A2-TABNAME = 'IT_A1'.
WA_A2-HOTSPOT = 'X'.
APPEND WA_A2 TO IT_A2.
CLEAR WA_A2. -
Displaying Row Number in DataGrid
Hi,
Is there an easy way to display a Row Number (in the very first column) in DataGrid or AdvancedDataGrid ?
I am trying to emulate Excel kind of functionality in DataGrid,
so need to Open/Load & Save to file.
I do understand that it is not difficult to do,
but do not want to Load & Save these Row Numbers to file.
Is there any easy standard solution for that ?
Any code samples ?
TIA,
Oleg.Yes, I am getting column with all "0".
I took labelFunction from the link in one of the previous posts as-is:
// labelFunction for Row Number of the DataGrid
private function lfRowNum(oItem:Object, iCol:int):String {
var iIndex:int = gridData.getItemIndex(oItem) + 1;Alert.show(
"lfRowNum() i="+iCol+", rowNum="+String(iIndex)+", item='"+oItem.toString()+"'");
return String(iIndex);}
grid.dataProvider = null; // reset
var dgc:DataGridColumn;
var aColumnsNew:Array = new Array();
for (var i:int=0; i <= aColumnDef.length; i++) { //loop over the column definition array (& add 0-th column - row num)
dgc = new DataGridColumn(); //instantiate a new DataGridColumn
if (i > 0) {oColumnDef = aColumnDef[i-1];
dgc.dataField = oColumnDef.dataField;
else { // add 0-th column (row num)
dgc.dataField = "";
...dgc.labelFunction = lfRowNum;
aColumnsNew.push(dgc);
Sorry, I could not format that code ptoperly, would not let me remove spaces and blank lines. -
Display Row Number with JTable
Hi everybody,
I try to build a spreadsheet with Java and Swing. I use Jdk1.2.2 and I looking for display the row Number on the left (Excel - like). I can't fiugre out how to implement this.
Anyone can give me some help?
Bye
MirkoHi Sciak!
This is what you are looking for ('Row Header' sample, including source code):
http://www2.gol.com/users/tame/swing/examples/JTableExamples1.html
Home page:
http://www2.gol.com/users/tame/swing/examples/SwingExamples.html
CU,
Jan -
Display Row number - in Advanced Table
Hi All,
How to show the row number (like in SpreadSheet) for a Table?
The user can have search, and sort abilities on table data. I have tried getting ROWNUM in VO Query, but when we use sort or search then the ROWNUM is not coming in order. It showing initial row numbers, not new one.
How to achieve this?
Thanks in Advance.user10164183 wrote:
If we write query like that, when we search for some records, or doing sorting on columns row numbers are changing, but it shouldn't change. it must be constant and other columns data may be changed according to action done by user.What if you put your ROWNUM clause as deep into your query as possible?
SELECT *
FROM ( SELECT f.*
, ROWNUM rn
FROM per_all_people_f
WHERE <conditions>
ORDER BY <columns>If you need a an initial order you could do something like this:
SELECT *
FROM ( SELECT a.*
, ROWNUM rn
FROM ( SELECT f.*
FROM per_all_people_f
ORDER BY 1
WHERE <conditions>
ORDER BY <columns>Hope this helps! -
Call transaction 'VL33N' on click of Inbound delivery number in ALV List.
Hi,
My ALV output is having Inbound delivery number.
If user clicks on one of the Inbound delivery it has to call transaction VL33N and display the user selected document.
Code:
WHEN '&IC1'.
IF rs_selfield-fieldname = 'VBELN'.
READ TABLE gt_final INTO wa_final INDEX rs_selfield-tabindex.
if wa_final-vbeln is not initial.
FREE MEMORY ID 'VL'.
SET PARAMETER ID 'VL' FIELD WA_FINAL-VBELN.
CALL TRANSACTION 'VL33N' AND SKIP FIRST SCREEN.
ENDIF.
ENDIF.
I am setting the parameter id 'VL' by passing Inbound Delivery number.After that it is calling VL33N Screen but the Inbound delivery number is blank.In debugging i can see the SAP memory for 'VL' as the selected document number.
Why VL value is not transferred to Inbound Delivery number field in VL33 Eventhough Parameter id having value.
VL (10) <0180000057>
Thanks
Bhuvana
Edited by: Pulibhuvana on Nov 22, 2010 8:20 AMHi,
Removed Free statement.
IF rs_selfield-fieldname = 'VBELN'.
READ TABLE gt_final INTO wa_final INDEX rs_selfield-tabindex.
if wa_final-vbeln is not initial.
SET PARAMETER ID 'VL' FIELD rs_selfield-value.
CALL TRANSACTION 'VL33N' AND SKIP FIRST SCREEN.
ENDIF.
ENDIF.
In background VL is passing to VL03N Transaction instead of VL33N.
Outbound delivery and Inbound Delivery both are assigned to same paramer id.
Don't undestand if i'm calling VL33N Why the paramer value is passed to Outbound delivery transaction VL03N.
Please suggest me.
Thanks
Bhuvana -
HOW TO DISPLAY MY OWN PF STATUS IN ALV LIST DISPLAY
Hi All,
i am developing one program in this program i am displaying output by using alv list display. after displaying the out SAP predefined pf status is coming. here i need my own pf status. any body can send me the sample code ir modify my code if possible.
i am sending my code below.
report zmahi6.
type-pools : slis.
tables : zuser_secobjects.
data : it_secobjects like zuser_secobjects occurs 0 with header line.
data : i_field type slis_t_fieldcat_alv with header line.
data : w_field like line of i_field.
data : i_sort type slis_t_sortinfo_alv.
data : w_sort like line of i_sort.
data : it_filt1 type slis_t_filter_alv with header line.
data:
i_tabname type tabname,
i_repid like sy-repid,
is_lout type slis_layout_alv.
data : chk_box type slis_fieldname.
selection-screen: begin of block b1 with frame title text-t01.
parameters : p_appln type zuser_secobjects-appln.
parameters : p_user type usr02-bname, "zuser_secobjects-appln_user,
p_partnr type zuser_secobjects-appln_partner,
p_ptype type zuser_secobjects-partner_type default '02',
p_upostn type zuser_secobjects-user_position,
p_sdate like likp-erdat default sy-datum,
"type zuser_secobjects-start_date
p_edate(10) default '12/31/9999',
type zuser_secobjects-end_date,
p_revnum type zuser_secobjects-revnum,
p_cted type zuser_secobjects-created_by,
p_cdate type zuser_secobjects-creation_date,
p_ctime type zuser_secobjects-creation_time,
p_chnby type zuser_secobjects-changed_by,
p_cdate1 type zuser_secobjects-changed_date,
p_ctime1 type zuser_secobjects-changed_time.
selection-screen: end of block b1.
start-of-selection.
perform get_data.
check sy-subrc eq 0.
set pf-status 'ZMAHEE'.
perform prepare_fieldcatalog.
perform alv_list_display.
*& Form PREPARE_FIELDCATALOG
text
--> p1 text
<-- p2 text
form prepare_fieldcatalog.
clear: w_field,i_field.
refresh:i_field.
i_field-key = 'X'.
i_field-col_pos = 1.
i_field-ddictxt = 'S'.
i_field-seltext_s = '@11@'.
i_field-checkbox = 'X'.
i_field-input = 'X'.
i_field-fieldname = 'HEADER'.
i_field-outputlen = 0.
append i_field.
clear i_field.
w_field-fieldname = 'APPLN'.
w_field-tabname = 'IT_SECOBJECTS'.
w_field-seltext_l = text-m01.
w_field-outputlen = '10'.
w_field-col_pos = 1.
append w_field to i_field.
clear w_field.
w_field-fieldname = 'APPLN_USER'.
w_field-tabname = 'IT_SECOBJECTS'.
w_field-just = 'C'.
w_field-seltext_l = text-m02.
w_field-outputlen = '7'.
w_field-col_pos = 2.
append w_field to i_field.
clear w_field.
endform. " PREPARE_FIELDCATALOG
*form pf_status_set using rt_extab type slis_t_extab.
set pf-status '0001'.
*endform.
*& Form ALV_LIST_DISPLAY
text
--> p1 text
<-- p2 text
form alv_list_display.
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = i_repid
i_callback_pf_status_set = 'PF_STATUS_SET'
i_callback_user_comomand = 'USER_COMMAND'
is_layout = is_lout
it_fieldcat = i_field[]
it_sort = i_sort
it_events = it_evts[]
tables
t_outtab = it_secobjects.
endform. " ALV_LIST_DISPLAY
*& Form GET_DATA
text
--> p1 text
<-- p2 text
form get_data.
select * from zuser_secobjects
into table it_secobjects.
endform. " GET_DATA
thanks,
maheedhar.tFollow this steps.
I ahve done it once and hope wuld work for you as well.
Go to SE80. Open a a standard ABAP program - SAPLKKBL. diasplay object.
This program has many standard GUI status. Copy the one which suits you the best. May be any one standars status. Right click it and copy to your custom report. Now open your Z-Program in SE80. You will see the GUI status and when you open it you see the name of the status that you have copied from.
Now you can go and do any modifications in the screen.
Remember you have to use the same status in the program as well.
Please check this piece of code.
call the ABAP list viewer *
FORM list_display TABLES a_output.
pgm = disvariant-report = sy-repid.
disvariant-variant = variant.
call list viewer
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = pgm
i_callback_pf_status_set = 'SET_PF_STATUS'
it_fieldcat = fieldcat
is_variant = disvariant
is_layout = layout
is_print = print
i_save = 'A'
it_events = eventcat
it_sort = sortcat
i_callback_user_command = 'USER_COMMAND'
TABLES
t_outtab = a_output
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDFORM. "LIST_DISPLAY
FORM SET_PF_STATUS *
FORM set_pf_status USING extab TYPE slis_t_extab.
SET PF-STATUS 'STATUS1'.
ENDFORM. "set_pf_status
FORM USER_COMMAND *
FORM user_command USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
DATA t_difference TYPE i.
CASE ucomm.
WHEN 'ENT1'.<----Function code
D0 your processing.
ENDCASE.
selfield-refresh = 'X'.
ENDFORM. "user_command
HOpe this helps.
Shreekant
Maybe you are looking for
-
HELP ME i need to pass String variables from one Frame to another
I need help with some code. i need to pass a set of string values from one frame to another. from the mainscreen i need to pass what type of seats the user has requested this is done by radio buttons. i need this information to then be passed onto th
-
Is there ANY way to install windows (for parallels) WITHOUT a superdrive?
I have Parallels (build 5600) and Win XP running fine on my iMac. I want to run it on my MBA, too. I have successfully installed Parallels (on a new trial license for now), and when I went to install Windows, learned that it can't be done via Remote
-
Getting M300 to use external monitor before internal LCD
Hi there, I have an M300 which is plugged in to a port replicator which has an external monitor attached. If you remove the M300 from the replicator before shutting down, the next time you put the M300 in the replicator and boot up the image is only
-
On Tab function does not set the value in ADF
Hi, I have a table with a columns as 'unit price',quantity and 'Extended amount'. The last field is a calculated field (unit price * quantity). I am trying to set this field when I tab from unit price field to some other field. But the value is not a
-
Audition 1.5 or 2.0 with Presonus FireStudio Project
I'm trying to connect a new FireStudio to my HP PC (WinXP Home +1G ram) I cannot see any of the audio channels except for channel 1. Any suggestions to make this work?