OO ALV grid refresh problem on sort
I have an editable OO ALV where I over ride the standard functionality for append, insert, Delete etc to handle condition that when a new row is inserted/appended its status which is in a non-editable cell is defaulted to some value. Now the logic is as follows
1.User clicks on append button(which we have overridden) I capture it in user command and append a blank row at end with default status in itab and do a grid->refresh_table_display()
2.User enters values in all cells and presses ENTER , control goes to handle_data_changed method I validate and check the modified rows from ER_DATA_CHANGED->MOD_ROWS or ER_DATA_CHANGED->MOD_CELLS and update my itab with the values entered on screen and again do a grid->refresh_table_display() so the values are displayed again on the screen.
Problem is when I give a SORT criteria or press sort say according to Year (descending) if grid already contains 2 rows and we add 3rd row with year 2009 at bottom
Amount Year Status
100 2007 Old
200 2006 Old
300 2009 New
Then on ENTER the 3rd row goes to 1st place as it should but the values on the 3rd row do not change!!! eg see below
Amount Year Status
300 2009 New
100 2007 Old
300 2009 New
The problem is only when the ALV is sorted & I have a unique row index in my itab to keep track of records. I feel this is a mismatch in the frontend and backend update. Any body else have a clue why is this happening only on sort ?
Don't do your refresh_table_display( ) until the data_changed_finished event.
Cheers,
Phil
Similar Messages
-
hi,
I have 2 views, input and output these two included in a MAIN views.
when user key in their input values in INPUT view and the search results will be displayed in OUTPUT view using ALV grid.
the problem i'm facing here is, when user changes search criteria once after search results displayed.. it is not displaying with new search results. every time i have to give F5(Refresh) it is certainly not comfortable to deliver it as it is.
i have tried same scenario with simple query in our local server.. where it is working very well.
i really clueless what would be the cause.. is there any with SAP patch issues.
i have tried with refresh method of ALV component.
please help me out of this, i cannot use TABLE control every time to avoid this.
thanks,
gupta.Hi Gupta,
Could you please let us know how you are filling the context node which is mapped to ALV table?
After the search criteria is changed, if you are doing it inside handler of the button or something like that, it should work.
Refer to the tutorial in the following link which shows an example similar to your scenario:
SAP List Viewer in Web Dynpro - Simple Example for Using ALV
please post the code also which you are using to fill the node in case if you still face the issue after referring to the above tutorial.
Hope this helps!
Regards.
Srilatha
Edited by: Srilatha M on Jul 19, 2010 7:57 AM -
ALV grid refresh problem when I return from list-processing
hi,
I have made alv grid with f4 help features and i'm using row select feature.
When i click on a button in Application toolbar, the program leaves to list processing and then return to alv gridscreen.
Now the problem arises.
(1)Even if i select rows and press F8, the program does not identify the rows selected and does not give me desired output.
(2)Also, when i press F4, the selected value does not appear in the text field.
Both the cases are working fine, if i dont press button and go to list processing.
Please help!!You can use the function module as stated below -
FORM user_command USING r_ucomm TYPE sy-ucomm
rs_selfield TYPE slis_selfield.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
ET_EXCLUDING =
E_FLG_NO_HTML =
E_CALLBACK_PROGRAM =
E_REPID =
e_grid = ref1
ES_LAYOUT_KKBLO =
ES_SEL_HIDE =
CALL METHOD ref1->check_changed_data.
This helps to get the data in the internal table refreshed as well as that on the screen so that both are in sync.
this is generally used on some event, you can also use it otherwise.
<b>
Reward if useful.</b>
Regards,
Pritha -
ALV grid refresh problem - Icons briefly flashed on screen
Hi ,
I have an editable OO ALV grid which has a "New Entries" option. When the user clicks on that button a new blank row is appended at the bottom. The problem is on some monitors /screens when the user clicks on the button the ALV grid flashes for a brief moment and every cell has an image icon.
You can see this problem by going to Tcode SE16N choose a large table like VBAP and display 500 records or more. On the next screen press the page down button, you would see those icons.(the problem is as described above, except that the se16n ALV is not editable ).
Is this a buffering problem of ALV ? Or is there a way to avoid / fix this ?
Thanksyou will find a beginning of explanation here in [sap library - Using the ALV Grid Control in WANs|http://help.sap.com/saphelp_nw2004s/helpdata/en/32/d3e962f7fb11d2b48c006094192fe3/frameset.htm]
-
ALV grid Refresh problem for one user
Have an ALV with editable columns. Validation and save works for all columns for one user but not for the other. The user with the issue is able to modify the values and save to the database fine.The problem is it doesn't display in the ALV once refreshed. Please suggest any ideas of how to look into this issue as it works for one and not other user.
Strange work for one user not for other.
Once you save the data, rebind the data to table. so that new data will display. ( that use set_initial_elements as true, so that old values not display ).
Regards
Srinivas -
Problems with ALV grid refresh
Hello,
I am writing a relatively simple wd application, I enter a few values in the select-options and display the data in an ALV grid. My problem seems to be that the grid values do not refresh if I change the selection conditions.
On going through the forum I saw a few posts which ask me to call the Node->Invalidate( ) method, but on using that my grid refreshes completely and data does not appear again, even on changing the input values.
I have pasted the ALV portion of the code from my onAction method - could you suggest what I could do to correct this? I realise this is a relatively stupid question, but I am very new to this technology and am trying to learn. Thanks in advance.
***Database selection (this works fine, tested in debug)
Bind the data to the context
dyn_node = wd_context->get_child_node( name = 'TIME_ENTRY' ).
dyn_node->bind_table( icatsdb ).
Connect to the component Usage of the ALV
l_ref_cmp_usage = wd_this->wd_cpuse_display_alv( ).
IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
l_ref_cmp_usage->create_component( ).
ENDIF.
Through the interface controller of the ALV Component set the DATA node dynamically
l_ref_interfacecontroller = wd_this->wd_cpifc_display_alv( ).
l_ref_interfacecontroller->set_data( r_node_data = dyn_node ).
SudhaHi,
Did you change the statement <b>SET PF-STATUS 'ZIMP'</b> to <b>SET PF-STATUS 'ZLIQ'</b> ? If not, please do that, and run the program after activation.
Reward points if the asnwer is helpful.
Regards,
Mukul -
I am using ALV Grid Control ABAP Objects concept.
I am facing problem in it , if i click on any record it will display me the output , but when i click on any other report it is still
displaying me the 1st record output.
for eq. i clicked on 000002121 it will display me internal table related to this document but when i click on
000002122 it is showing IT of previous document only.
How to refresh the display in gui with new recordHi
Check your double click method implementation. How you are retrieving the value of the selected item.
sample code for hotspot click
CALL METHOD grid1->get_current_cell
IMPORTING
e_row = w_row
e_value = w_value
e_col = w_col -
Hi,
i've a problem:
i call the ALV GRID , after, i double click on a record calling an other screen......
when i back to the alv i want to keep selected the record that before i had clicked.
All this keeping the refresh active.
Is it possible???
'cause when i back the alv is on the first paga with the first record on the top.
Without refresh i have the record selected ma the table is not re-generated.
THXXXXXX
IgorYes....
if i make a double click on a record on ALV grid calling an other screen, when i move back to alv
the record i have selected in the last page of ALV is not selected and the alv is on the first page.
I want that alv remain on the record that i have selected with double click.
Thxxxx -
ALV grid display problem...
can you please help me tell what is missing in this program....
its giving run time error NO_FIELDCATALOG_AVAILABLE.
Also if possible give a good example for ALV grid program
TABLES: bsak.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-010.
PARAMETERS : p_bukrs TYPE bsak-bukrs,
p_augdt type bsak-augdt.
thanks!!
points willl be awarded
SELECTION-SCREEN END OF BLOCK B1.
TYPES : BEGIN OF st_bsak ,
bukrs type bsak-bukrs,
lifnr type bsak-lifnr,
augdt type bsak-augdt,
augbl type bsak-augbl,
gjahr type bsak-gjahr,
belnr type bsak-belnr,
budat type bsak-budat,
bldat type bsak-bldat,
hkont type bsak-hkont,
saknr type bsak-saknr,
zlsch type bsak-zlsch,
zlspr type bsak-zlspr,
hbkid type bsak-hbkid,
END OF st_bsak.
DATA it_bsak LIKE bsak OCCURS 0 WITH HEADER LINE.
SELECT bukrs
lifnr
augdt
augbl
gjahr
belnr
budat
bldat
hkont
saknr
zlsch
zlspr
hbkid
FROM bsak
INTO (it_bsak-bukrs,
it_bsak-lifnr,
it_bsak-augdt,
it_bsak-augbl,
it_bsak-gjahr,
it_bsak-belnr,
it_bsak-budat,
it_bsak-bldat,
it_bsak-hkont,
it_bsak-saknr,
it_bsak-zlsch,
it_bsak-zlspr,
it_bsak-hbkid) UP TO 10 ROWS "need to change it to 65000 rows
WHERE bukrs = p_bukrs.
endselect.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_STRUCTURE_NAME = 'st_bsak'
I_GRID_TITLE = 'SALES ORDER INFO'
TABLES
T_OUTTAB = it_bsak
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.hi,
try this.
*& Report ZALV_DS
REPORT zalv_ds.
TYPE-POOLS:slis.
TABLES:mara,
makt,
marc.
DATA:BEGIN OF itab OCCURS 0,
matnr LIKE mara-matnr,
maktx LIKE makt-maktx,
werks LIKE marc-werks,
rowcolor(4) TYPE c,
cellcolors TYPE lvc_t_scol,
END OF itab.
DATA:t_fcat TYPE slis_t_fieldcat_alv,
t_eve TYPE slis_t_event.
DATA : st_layout TYPE slis_layout_alv.
SELECTION-SCREEN:BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
SELECT-OPTIONS:mat FOR mara-matnr.
SELECTION-SCREEN:END OF BLOCK blk1.
INITIALIZATION.
PERFORM build_cata USING t_fcat.
PERFORM build_event.
START-OF-SELECTION.
PERFORM data_retrieval.
PERFORM display_data.
*& Form build_cata
text
-->TEMP_FCAT text
FORM build_cata USING temp_fcat TYPE slis_t_fieldcat_alv.
DATA:wa_fcat TYPE slis_fieldcat_alv.
wa_fcat-tabname = 'ITAB'.
wa_fcat-fieldname = 'MATNR'.
wa_fcat-seltext_m = 'Material'.
wa_fcat-key = 'X'.
APPEND wa_fcat TO temp_fcat.
wa_fcat-tabname = 'ITAB'.
wa_fcat-fieldname = 'MAKTX'.
wa_fcat-seltext_m = 'Description'.
wa_fcat-key = ''.
APPEND wa_fcat TO temp_fcat.
wa_fcat-tabname = 'ITAB'.
wa_fcat-fieldname = 'WERKS'.
wa_fcat-seltext_m = 'Plant'.
APPEND wa_fcat TO temp_fcat.
ENDFORM. "build_cata
*& Form build_event
text
FORM build_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = t_eve
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.
ENDFORM. "build_event
*& Form data_retrieval
text
FORM data_retrieval.
SELECT maramatnr maktmaktx marc~werks INTO CORRESPONDING FIELDS OF TABLE itab
FROM mara INNER JOIN makt ON
maramatnr = maktmatnr
INNER JOIN marc ON
maramatnr = marcmatnr
WHERE mara~matnr IN mat.
SORT itab BY matnr.
DELETE ADJACENT DUPLICATES FROM itab.
ENDFORM. "data_retrieval
*& Form display_data
text
FORM display_data.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZALV_DS'
it_fieldcat = t_fcat
it_events = t_eve
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.
ENDFORM. "display_data -
ALV GRID DISPLAY -Problem with Layout
Hi,
I'm using ALV GRID DISPLAY. I ran the program and in the output i created a layout Test1.Later i created a layout Test2. Now when i run the report, when i select layout Test1, the display is not as selected for the layout. but when i manualy select the layout throu change layout-->Test1, the display is working good. Can someone tell me what the problem can be?
Thanks
Challahi,
in the FM have you filled the structure IS_VARIANT.
is_variant-report = sy-repid.
is_variant-variant = <variant name>.
Regards,
Leo -
ALV GRID OUTPUT PROBLEM.
here i m sending code for u r reviews.
i have two tables: pa0002, zfm_handy
i have to display alv grid by using these tables, i m getting output but the fields in the table pa0002(nachn,vorna) r not populated i m getting output for the fields those which r in the table zfm_handy only.
plz modify this code and suggest according to my requirement...
*& Report ZFM_MOBLIST *
REPORT ZFM_MOBLIST.
TABLES: ZFM_HANDY , PA0002.
TYPE-POOLS : SLIS.
DATA: G_REPID LIKE SY-REPID,
GS_PRINT TYPE SLIS_PRINT_ALV,
GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
GT_LIST_END_OF_PAGE TYPE SLIS_T_LISTHEADER,
GT_EVENTS TYPE SLIS_T_EVENT,
GT_SORT TYPE SLIS_T_SORTINFO_ALV,
GS_LAYOUT TYPE SLIS_LAYOUT_ALV,
GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
FIELDCAT_LN LIKE LINE OF GT_FIELDCAT,
COL_POS TYPE I.
*DATA:
t_HANDY LIKE TABLE OF ZFM_HANDY,
t_pa0002 like table of PA0002,
f_handy like line of t_handy.
*DATA : BEGIN OF I_ZFM OCCURS 0.
*INCLUDE STRUCTURE ZFM_HANDY.
*DATA : NACHN LIKE PA0002-NACHN,
VORNA LIKE PA0002-VORNA,
END OF I_ZFM.
DATA : BEGIN OF ty_MOBLIST.
include structure zfm_handy.
data: NACHN like pa0002-nachn,
VORNA like pa0002-vorna,
END OF ty_MOBLIST.
DATA : BEGIN OF ty_zfm_handy.
include structure zfm_handy.
data : END OF ty_zfm_handy.
DATA : BEGIN OF ty_pa0002,
NACHN type pa0002-nachn,
VORNA type pa0002-vorna,
pernr type pa0002-pernr,
END OF ty_pa0002.
data : it_MOBLIST LIKE table of ty_MOBLIST,
wa_MOBLIST LIKE ty_MOBLIST ,
it_zfm_handy LIKE table of ty_zfm_handy,
wa_zfm_handy LIKE ty_zfm_handy ,
it_pa0002 LIKE table of ty_pa0002,
wa_pa0002 LIKE ty_pa0002 .
*DATA : BEGIN OF IT_ZFM_MOBLIST OCCURS 0.
include structure zfm_handy.
data: NACHN like pa0002-nachn,
VORNA like pa0002-vorna,
END OF IT_ZFM_MOBLIST.
DATA : BEGIN OF IT_ZFM_HANDY OCCURS 0.
include structure zfm_handy.
END OF IT_ZFM_HANDY.
*DATA : BEGIN OF IT_ZFM_PA0002 OCCURS 0,
NACHN type pa0002-nachn,
VORNA type pa0002-vorna,
pernr type pa0002-pernr,
END OF IT_ZFM_PA0002.
INITIALIZATION.
G_REPID = SY-REPID.
PERFORM PRINT_BUILD USING GS_PRINT. "Print PARAMETERS
START-OF-SELECTION.
SELECT * from
zfm_handy
into corresponding fields of table it_zfm_handy.
if not it_zfm_handy[] is initial.
select NACHN
VORNA
from pa0002
into table it_pa0002
for all entries in it_zfm_handy
where pernr = it_zfm_handy-pernr.
endif. " not it_zfm_handy
loop at it_zfm_handy into wa_zfm_handy.
read table it_pa0002 into wa_pa0002 with key pernr = ty_zfm_handy-pernr.
if sy-subrc = 0.
clear wa_MOBLIST.
move wa_zfm_handy to wa_MOBLIST.
move wa_pa0002 to wa_MOBLIST.
append wa_MOBLIST to it_MOBLIST .
endif. " sy-subrc
endloop.
*SELECT * from
zfm_handy
into corresponding fields of table it_zfm_handy.
if not it_zfm_handy[] is initial.
select NACHN
VORNA
from pa0002
into table it_pa0002
for all entries in it_zfm_handy
where pernr = it_zfm_handy-pernr.
endif. " not it_zfm_handy
loop at it_zfm_handy.
read table it_pa0002 FROM PA0002 with key pernr = ty_zfm_handy-pernr.
if sy-subrc = 0.
clear wa_MOBLIST.
move wa_zfm_handy to wa_MOBLIST.
move wa_pa0002 to wa_MOBLIST.
append wa_MOBLIST to it_MOBLIST .
APPEND IT_ZFM_MOBLIST.
endif. " sy-subrc
endloop.
SELECT *
FROM zfm_handy
INTO TABLE t_handy.
*SELECT ZFM_HANDY~TELNUM ZFM_HANDY~KARTNR ZFM_HANDY~ZUTART ZFM_HANDY~PERNR
ZFM_HANDYZDATE ZFM_HANDYPINNR ZFM_HANDYPUKNR ZFM_HANDYTARIF1
ZFM_HANDYTARIF2 ZFM_HANDYTARIF3 ZFM_HANDYGTYPE ZFM_HANDYIMEI ZFM_HANDY~TWINCARD
ZFM_HANDYTWINBILL ZFM_HANDYEINBAU ZFM_HANDYBESCHR ZFM_HANDYTEXT1 ZFM_HANDY~TEXT2
ZFM_HANDYTEXT3 PA0002NACHN PA0002~VORNA INTO TABLE I_ZFM FROM ZFM_HANDY INNER JOIN PA0002
ON ZFM_HANDYPERNR = PA0002PERNR.
select atelnum akartnr azutart apernr azdate apinnr apuknr atarif1 atarif2 atarif3 agtype aimei a~twincard
atwinbill aeinbau abeschr atext1 atext2 atext3 bnachn bvorna into table i_zfm from zfm_handy as a inner join pa0002
as b on apernr = bpernr where apernr = bpernr.
*telnum , kartnr , zutart , pernr , zdate , pinnr , puknr ,
tarif1 , tarif2 , tarif3 , gtye , imei , twincard , twinbill , einbau , beschr , text1 , text2 , text3 , nachn , vorna) from
zfm_handy as a inner join pa0002 as b on apernr = bpernr where apernr = bpernr.
PERFORM BUILD.
PERFORM EVENTTAB_BUILD CHANGING GT_EVENTS.
PERFORM COMMENT_BUILD CHANGING GT_LIST_TOP_OF_PAGE.
PERFORM CALL_ALV.
*& Form BUILD
FORM BUILD.
DATA FIELD CATALOG
Explain Field Description to ALV
DATA: FIELDCAT_IN TYPE SLIS_FIELDCAT_ALV.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'TELNUM'.
FIELDCAT_LN-TABNAME = 'IT_MOBLIST'.
FIELDCAT_LN-NO_OUT = ' '.
FIELDCAT_LN-SELTEXT_L = 'TELNUM'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'KARTNR'.
FIELDCAT_LN-TABNAME = 'IT_MOBLIST'.
FIELDCAT_LN-NO_OUT = ' '.
FIELDCAT_LN-SELTEXT_L = 'KARTNR'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'ZUTART'.
FIELDCAT_LN-TABNAME = 'IT_MOBLIST'.
FIELDCAT_LN-NO_OUT = ' '.
FIELDCAT_LN-SELTEXT_L = 'ZUTART'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'PERNR'.
FIELDCAT_LN-TABNAME = 'IT_MOBLIST'.
FIELDCAT_LN-NO_OUT = ' '.
FIELDCAT_LN-SELTEXT_L = 'PERNR'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'ZDATE'.
FIELDCAT_LN-TABNAME = 'IT_MOBLIST'.
FIELDCAT_LN-NO_OUT = ' '.
FIELDCAT_LN-SELTEXT_L = 'ZDATE'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'PINNR'.
FIELDCAT_LN-TABNAME = 'IT_MOBLIST'.
FIELDCAT_LN-NO_OUT = ' '.
FIELDCAT_LN-SELTEXT_L = 'PINNR'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'PUKNR'.
FIELDCAT_LN-TABNAME = 'IT_MOBLIST'.
FIELDCAT_LN-NO_OUT = ' '.
FIELDCAT_LN-SELTEXT_L = 'PUKNR'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'TARIF1'.
FIELDCAT_LN-TABNAME = 'IT_MOBLIST'.
FIELDCAT_LN-NO_OUT = ' '.
FIELDCAT_LN-SELTEXT_L = 'TARIF1'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'TARIF2'.
FIELDCAT_LN-TABNAME = 'IT_MOBLIST'.
FIELDCAT_LN-NO_OUT = ' '.
FIELDCAT_LN-SELTEXT_L = 'TARIF2'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'TARIF3'.
FIELDCAT_LN-TABNAME = 'IT_MOBLIST'.
FIELDCAT_LN-NO_OUT = ' '.
FIELDCAT_LN-SELTEXT_L = 'TARIF3'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'GTYPE'.
FIELDCAT_LN-TABNAME = 'IT_MOBLIST'.
FIELDCAT_LN-NO_OUT = ' '.
FIELDCAT_LN-SELTEXT_L = 'GTYPE'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'IMEI'.
FIELDCAT_LN-TABNAME = 'IT_MOBLIST'.
FIELDCAT_LN-NO_OUT = ' '.
FIELDCAT_LN-SELTEXT_L = 'IMEI'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'TWINCARD'.
FIELDCAT_LN-TABNAME = 'IT_MOBLIST'.
FIELDCAT_LN-NO_OUT = ' '.
FIELDCAT_LN-SELTEXT_L = 'TWINCARD'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'TWINBILL'.
FIELDCAT_LN-TABNAME = 'IT_MOBLIST'.
FIELDCAT_LN-NO_OUT = ' '.
FIELDCAT_LN-SELTEXT_L = 'TWINBILL'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'EINBAU'.
FIELDCAT_LN-TABNAME = 'IT_MOBLIST'.
FIELDCAT_LN-NO_OUT = ' '.
FIELDCAT_LN-SELTEXT_L = 'EINBAU'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'BESCHAR'.
FIELDCAT_LN-TABNAME = 'IT_MOBLIST'.
FIELDCAT_LN-NO_OUT = ' '.
FIELDCAT_LN-SELTEXT_L = 'BESCHR'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'TEXT1'.
FIELDCAT_LN-TABNAME = 'IT_MOBLIST'.
FIELDCAT_LN-NO_OUT = ' '.
FIELDCAT_LN-SELTEXT_L = 'TEXT1'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'TEXT2'.
FIELDCAT_LN-TABNAME = 'IT_MOBLIST'.
FIELDCAT_LN-NO_OUT = ' '.
FIELDCAT_LN-SELTEXT_L = 'TEXT2'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'TEXT3'.
FIELDCAT_LN-TABNAME = 'IT_MOBLIST'.
FIELDCAT_LN-NO_OUT = ' '.
FIELDCAT_LN-SELTEXT_L = 'TEXT3'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'NACHN'.
FIELDCAT_LN-TABNAME = 'IT_MOBLIST'.
FIELDCAT_LN-NO_OUT = ' '.
FIELDCAT_LN-SELTEXT_L = 'NACHN'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'VORNA'.
FIELDCAT_LN-TABNAME = 'IT_MOBLIST'.
FIELDCAT_LN-NO_OUT = ' '.
FIELDCAT_LN-SELTEXT_L = 'VORNA'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
DATA SORTING
DATA: GS_SORT TYPE SLIS_SORTINFO_ALV.
CLEAR GS_SORT.
GS_SORT-FIELDNAME = 'TELNUM'.
GS_SORT-SPOS = 1.
GS_SORT-UP = 'X'.
GS_SORT-SUBTOT = 'X'.
APPEND GS_SORT TO GT_SORT.
CLEAR GS_SORT.
GS_SORT-FIELDNAME = 'KARTNR'.
GS_SORT-SPOS = 2.
GS_SORT-UP = 'X'.
*GS_SORT-SUBTOT = 'X'.
APPEND GS_SORT TO GT_SORT.
ENDFORM. "BUILD
*& Form CALL_ALV
FORM CALL_ALV.
ABAP List Viewer
CALL FUNCTION 'REUSE_ALV_GRID_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
IT_HYPERLINK =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_ZFM_HANDY[]
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
ENDFORM. "CALL_ALV
HEADER FORM
FORM EVENTTAB_BUILD CHANGING LT_EVENTS TYPE SLIS_T_EVENT.
CONSTANTS:
GC_FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',
GC_FORMNAME_END_OF_PAGE TYPE SLIS_FORMNAME VALUE 'END_OF_PAGE'.
DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = LT_EVENTS.
READ TABLE LT_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE
INTO LS_EVENT.
IF SY-SUBRC = 0.
MOVE GC_FORMNAME_TOP_OF_PAGE TO LS_EVENT-FORM.
APPEND LS_EVENT TO LT_EVENTS.
ENDIF.
define END_OF_PAGE event
READ TABLE LT_EVENTS WITH KEY NAME = SLIS_EV_END_OF_PAGE
INTO LS_EVENT.
IF SY-SUBRC = 0.
MOVE GC_FORMNAME_END_OF_PAGE TO LS_EVENT-FORM.
APPEND LS_EVENT TO LT_EVENTS.
ENDIF.
ENDFORM. "EVENTTAB_BUILD
*& Form COMMENT_BUILD
FORM COMMENT_BUILD CHANGING GT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
DATA: GS_LINE TYPE SLIS_LISTHEADER.
data: today_date(10) type c.
concatenate
sy-datum+6(2) '.'
sy-datum+4(2) '.'
sy-datum(4) into today_date.
CLEAR GS_LINE.
GS_LINE-TYP = 'H'.
GS_LINE-INFO = 'MOBLIST DETAILS'.
APPEND GS_LINE TO GT_TOP_OF_PAGE.
CLEAR GS_LINE.
GS_LINE-TYP = 'S'.
GS_LINE-KEY = 'Date:'.
GS_LINE-INFO = today_date.
APPEND GS_LINE TO GT_TOP_OF_PAGE.
GS_LINE-KEY = 'User:'.
GS_LINE-INFO = sy-uname.
APPEND GS_LINE TO GT_TOP_OF_PAGE.
CLEAR GS_LINE.
GS_LINE-TYP = 'A'.
GS_LINE-INFO = 'ACTION'.
APPEND GS_LINE TO GT_TOP_OF_PAGE.
ENDFORM. "COMMENT_BUILD
*& Form TOP_OF_PAGE
FORM TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.
WRITE: SY-DATUM, 'Page No', SY-PAGNO RIGHT-JUSTIFIED.
ENDFORM. "TOP_OF_PAGE
*& Form END_OF_PAGE
FORM END_OF_PAGE.
WRITE: /.
WRITE at (sy-linsz) sy-pagno CENTERED.
ENDFORM. "END_OF_PAGE
### PRINT SETTINGS
FORM PRINT_BUILD USING LS_PRINT TYPE SLIS_PRINT_ALV.
LS_PRINT-PRINT = ' '. "PRINT IMMEDIATE
LS_PRINT-NO_PRINT_SELINFOS = 'X'. "NO SELECTION INFO
LS_PRINT-NO_COVERPAGE = ' '. "NO COVER PAGE
LS_PRINT-NO_NEW_PAGE = ' '. "NO NEW PAGE
LS_PRINT-NO_PRINT_LISTINFOS = 'X'. "NO PRINT LIST INFO
LS_PRINT-RESERVE_LINES = 2. " FOOTERLINE
ENDFORM. "PRINT_BUILDHi narendra,
loop at it_zfm_handy into wa_zfm_handy.
<b>read table it_pa0002 into wa_pa0002 with key pernr = ty_zfm_handy-pernr.</b>
if sy-subrc = 0.
clear wa_MOBLIST.
move wa_zfm_handy to wa_MOBLIST.
move wa_pa0002 to wa_MOBLIST.
append wa_MOBLIST to it_MOBLIST .
endif. " sy-subrc
endloop.
<b>read table it_pa0002 into wa_pa0002 with key pernr = ty_zfm_handy-pernr.</b>
replace the above statement with
<b>read table it_pa0002 into wa_pa0002 with key pernr = it_zfm_handy-pernr.</b> -
Reg : ALV Grid Refresh - Output not appearing
Hi All ,
Am calling a screen 100 at 3 different places.
Though i use refresh_table_display , The value in the output table, say i_final changes, but while displaying the output , the whole screen is blank , even the container is not appearing in the output .
Can you please help me with your inputs .
Regards,
Chitrayes it is good ...see the example...for your requirement..
REPORT yztest .
TYPE-POOLS: slis.
Tables
TABLES: mara.
TYPES: BEGIN OF ty_name,
name TYPE char10,
age TYPE i,
END OF ty_name.
TYPES: BEGIN OF ty_marks,
sub1 TYPE i,
sub2 TYPE i,
total TYPE i,
END OF ty_marks.
TYPES: BEGIN OF ty_phone,
phnum TYPE char10,
END OF ty_phone.
TYPES: BEGIN OF ty_addr,
address TYPE char20,
END OF ty_addr .
Output internal table
DATA: itab TYPE TABLE OF ty_name,
wa TYPE ty_name,
itab1 TYPE TABLE OF ty_marks,
wa1 TYPE ty_marks,
itab2 TYPE TABLE OF ty_phone,
wa2 TYPE ty_phone,
itab3 TYPE TABLE OF ty_addr,
wa3 TYPE ty_addr.
ALV Grid
DATA: r_grid TYPE REF TO cl_gui_alv_grid,
r_grid1 TYPE REF TO cl_gui_alv_grid,
r_grid2 TYPE REF TO cl_gui_alv_grid,
r_grid3 TYPE REF TO cl_gui_alv_grid,
g_dock TYPE REF TO cl_gui_docking_container,
g_dock1 TYPE REF TO cl_gui_docking_container,
g_dock2 TYPE REF TO cl_gui_docking_container,
g_dock3 TYPE REF TO cl_gui_docking_container,
g_dock4 TYPE REF TO cl_gui_docking_container,
it_fieldcat TYPE lvc_t_fcat,
it_fieldcat1 TYPE lvc_t_fcat,
it_fieldcat2 TYPE lvc_t_fcat,
it_fieldcat3 TYPE lvc_t_fcat,
wa_fieldcat TYPE lvc_s_fcat.
DATA picture TYPE REF TO cl_gui_picture.
DATA url(255).
CLEAR url.
DATA init.
START-OF-SELECTION.
wa-name = 'test01'.
wa-age = '1'.
APPEND wa TO itab.
wa-name = 'test02'.
wa-age = '2'.
APPEND wa TO itab.
wa-name = 'test03'.
wa-age = '3'.
APPEND wa TO itab.
wa1-sub1 = '11'.
wa1-sub2 = '22'.
wa1-total = wa1-sub1 + wa1-sub2.
APPEND wa1 TO itab1.
wa1-sub1 = '22'.
wa1-sub2 = '33'.
wa1-total = wa1-sub1 + wa1-sub2.
APPEND wa1 TO itab1.
wa2-phnum = '99999999999'.
APPEND wa2 TO itab2.
wa2-phnum = '888888888888'.
APPEND wa2 TO itab2.
wa2-phnum = '777777777777'.
APPEND wa2 TO itab2.
wa3-address = 'HItech City'.
APPEND wa3 TO itab3.
wa3-address = 'Secunderabad'.
APPEND wa3 TO itab3.
wa3-address = 'Hyderabad'.
APPEND wa3 TO itab3.
PERFORM display_image.
CALL SCREEN 100.
*& Module STATUS_0100 OUTPUT
text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'LISTOUT1'.
SET TITLEBAR 'LIST1'.
wa_fieldcat-fieldname = 'NAME'.
wa_fieldcat-seltext = 'NAME OF THE STUDENT'.
wa_fieldcat-coltext = 'NAME OF THE STUDENT'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'AGE'.
wa_fieldcat-seltext = 'AGE OF THE STUDENT'.
wa_fieldcat-coltext = 'AGE OF THE STUDENT'.
APPEND wa_fieldcat TO it_fieldcat.
wa_fieldcat-fieldname = 'SUB1'.
wa_fieldcat-seltext = 'SUBJECT1'.
wa_fieldcat-coltext = 'SUBJECT1'.
APPEND wa_fieldcat TO it_fieldcat1.
wa_fieldcat-fieldname = 'SUB2'.
wa_fieldcat-seltext = 'SUBJECT2'.
wa_fieldcat-coltext = 'SUBJECT2'.
APPEND wa_fieldcat TO it_fieldcat1.
wa_fieldcat-fieldname = 'TOTAL'.
wa_fieldcat-seltext = 'TOTAL'.
wa_fieldcat-coltext = 'TOTAL'.
APPEND wa_fieldcat TO it_fieldcat1.
wa_fieldcat-fieldname = 'PHNUM'.
wa_fieldcat-seltext = 'PHONE NO'.
wa_fieldcat-coltext = 'PHONE NO'.
APPEND wa_fieldcat TO it_fieldcat2.
wa_fieldcat-fieldname = 'ADDRESS'.
wa_fieldcat-seltext = 'ADDRESS'.
wa_fieldcat-coltext = 'ADDRESS'.
APPEND wa_fieldcat TO it_fieldcat3.
IF g_dock IS INITIAL.
CREATE OBJECT g_dock
EXPORTING
repid = sy-repid
dynnr = sy-dynnr
side = g_dock->dock_at_left
extension = 300.
CREATE OBJECT r_grid
EXPORTING
i_parent = g_dock.
ENDIF.
IF g_dock1 IS INITIAL.
CREATE OBJECT g_dock1
EXPORTING
repid = sy-repid
dynnr = sy-dynnr
side = g_dock1->dock_at_right
extension = 300.
CREATE OBJECT r_grid1
EXPORTING
i_parent = g_dock1.
ENDIF.
IF g_dock2 IS INITIAL.
CREATE OBJECT g_dock2
EXPORTING
repid = sy-repid
dynnr = sy-dynnr
side = g_dock2->dock_at_top
extension = 100.
CREATE OBJECT r_grid2
EXPORTING
i_parent = g_dock2.
IF g_dock3 IS INITIAL.
CREATE OBJECT g_dock3
EXPORTING
repid = sy-repid
dynnr = sy-dynnr
side = g_dock3->dock_at_top
extension = 100.
CREATE OBJECT r_grid3
EXPORTING
i_parent = g_dock3.
ENDIF.
IF NOT itab[] IS INITIAL.
CALL METHOD r_grid->set_table_for_first_display
CHANGING
it_outtab = itab
it_fieldcatalog = it_fieldcat.
ENDIF.
IF NOT itab1[] IS INITIAL.
CALL METHOD r_grid1->set_table_for_first_display
CHANGING
it_outtab = itab1
it_fieldcatalog = it_fieldcat1.
ENDIF.
IF NOT itab2[] IS INITIAL.
CALL METHOD r_grid2->set_table_for_first_display
CHANGING
it_outtab = itab2
it_fieldcatalog = it_fieldcat2.
ENDIF.
IF NOT itab3[] IS INITIAL.
CALL METHOD r_grid3->set_table_for_first_display
CHANGING
it_outtab = itab3
it_fieldcatalog = it_fieldcat3.
ENDIF.
if g_dock4 is initial.
CREATE OBJECT g_dock4
EXPORTING
repid = sy-repid
dynnr = sy-dynnr
side = g_dock4->dock_at_bottom
extension = 100.
CREATE OBJECT picture
EXPORTING parent = g_dock4.
CALL METHOD picture->load_picture_from_url
EXPORTING
url = url.
init = 'X'.
endif.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'BACK'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form display_image
FORM display_image .
DATA query_table LIKE w3query OCCURS 1 WITH HEADER LINE.
DATA html_table LIKE w3html OCCURS 1.
DATA return_code LIKE w3param-ret_code.
DATA content_type LIKE w3param-cont_type.
DATA content_length LIKE w3param-cont_len.
DATA pic_data LIKE w3mime OCCURS 0.
DATA pic_size TYPE i.
REFRESH query_table.
query_table-name = '_OBJECT_ID'.
query_table-value = 'ENJOYSAP_LOGO'.
APPEND query_table.
CALL FUNCTION 'WWW_GET_MIME_OBJECT'
TABLES
query_string = query_table
html = html_table
mime = pic_data
CHANGING
return_code = return_code
content_type = content_type
content_length = content_length
EXCEPTIONS
object_not_found = 1
parameter_not_found = 2
OTHERS = 3.
IF sy-subrc = 0.
pic_size = content_length.
ENDIF.
CALL FUNCTION 'DP_CREATE_URL'
EXPORTING
type = 'image'
subtype = cndp_sap_tab_unknown
size = pic_size
lifetime = cndp_lifetime_transaction
TABLES
data = pic_data
CHANGING
url = url
EXCEPTIONS
OTHERS = 1.
ENDFORM. " display_image
*& Module EXIT INPUT
text
MODULE exit INPUT.
CALL METHOD g_dock->free.
CALL METHOD g_dock1->free.
CALL METHOD g_dock2->free.
CALL METHOD g_dock3->free.
ENDMODULE. " EXIT INPUT -
Hi,
I have created an alv grid in a basic program which runs fine.
But when I try to create a transaction for this program I run into problems. What type of transaction should I create? I have tried dialog and selection screen transaction but for some reason when I run these transaction codes the alv grid does not contain the content I am looking for from internal table. Where as when I run the program directly, there is not any problems at all.
Any help would be great, thanks.Hi,
Since it is a report transaction, Choose option 2
Program and selection screen (report transaction).
Put screen number 1000.
Regards,
Jovito -
Hi expert,
I got problem while downloading ALV GRID ouput to any local file. The output contains two records. but while downloading no records will be downloaded. only field headings are downloaded. What is the problem.
Pls help me to do.
Thanks
Murugan ArumugamI would suggest you add an additional button to the ALV grid toolbar. When the user clicks on this button you call in your event handler method for USER_COMMAND the method CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD with the entire itab.
Or
Set the NO_OUT as 'X' in your fieldcatalog for the particular field.
Reward points if useful -
ALV grid refresh while fcat and internal table change
Hi,
I am displaying an ALV output using OOPS ALV grid. It is displaying data from internal table t1.
Later I am changing fieldcat table content and I want to display with internal table t2. how can I do this.
It is not refreshing the fieldcat values in the ALV.
Which method I should call to refresh the ALV.
Thanks and regards,
Venkat.hi,
to refresh the alv display.
you can use the method refresh_table_display
of the class cl_gui_alv_grid.
regards.
Maybe you are looking for
-
Problem While using CLOB/BLOB datatype: We have created a directory in E drive and created a directory alias in oracle. to read the data from CLOB data type we have to write a PL/SQL code. But i am getting an errorin the block .ie non existent direct
-
*.pages and *.key cannot be shown on the web page
I upload an a.KEYNOTE file which is quite alright on my local computer to the server (3.1.2). After successfully uploading, the web page keeps trying to display the file, but no stopping, just trying. Strangely, the name could be correctly displayed
-
Change Oranization at Line item
Currently at the header level I am able to change the service/sales Org, however at the line item level it is a read only field. I figured this setting would be under organizational determination since under partner determination Entry Changeable fi
-
I used to have my music on a shared computer. That computer has since moved on with the music. My library link is looking still to that location for the music. It can't find it so naturally I can't play it. I put all my new music in the user/musi
-
Is Aiport Extreme Hard To Set Up With Macbook pro?
hi, my name is Matthew and I am A new user to the mac family ... Now i know wireless connections are hard to set up with windows but i was wondering is it easy to set up with the macbook pro??? Thanks, matthew Mac OS X (10.4.5)