ALV Grid Transaction Problem
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
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 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 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 -
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 -
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 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]
-
Hi All
I have a requirment form client side, when i print my customized alv grid report first of all it prints LIST STATUS (CtrlShiftF5) then the report is printed is it possible to remove that LIST STATUS so that only the report is printed.
thanksDear radha
I discussed the problem with ABAP team and the problem was solved thanks for your hint.
regars
asim -
Hi,
I have a dialog that contains an ALV grid and three buttons. When the ALV grid is created, it's parent is specified as a custom container.
Container
data : g_custom_container type ref to cl_gui_custom_container.
ALV Grid
data : g_grid type ref to cl_gui_alv_grid.
create object g_custom_container
exporting container_name = p_cont_name.
create object g_grid
exporting i_parent = g_custom_container
I_APPL_EVENTS = 'X'.
I would like the user to be able to just hit enter to accept the values displayed in the ALV. My problem is that when the dialog is created, the ALV has focus so the event isn't getting to the PAI of the dialog. If I click the mouse outside of the ALV to take focus away from the ALV, hitting the enter key does trigger the correct event in the dialog PAI. How can I either set the focus outside of the ALV when the dialog loads, or make the ALV forward the event to the dialog.
Thank you very much for any isight you can lend!
John RichasonHi John, are you working with an editable ALV grid? If so, the code below will allow an event to be fired when the user hits enter after the data has been changed.
call method alv_grid->register_edit_event
exporting
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
You then need to create an event handler to handle the event being fired when the data is changed.
* create Event Receiver
create object event_receiver.
* handler for ALV grid
set handler event_receiver->handle_data_changed for alv_grid.
REgards,
Rich Heilman -
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 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> -
Web Dynpro ALV grid navigation problems when entry is selected
Hi,
We have implemented support packs 19 and 20 and following this, we are having the following side effect :
When you click on an entry within an alv grid, it does not navigate to the next screen. It worked fine before the service packs, please advise if you have any suggestions as to how we can get it to work again!? Thanks in advance.
When I click, the debug does not event go to the ON_LEAD_SELECT event.
Edited by: James Wilson on Dec 10, 2009 3:52 PMHi Samir,
I think possibly you have other code which is relying on a lead selection being set in the context that you have provided to the ALV grid?
And it is that code that is falling over?
In this case I think you need to handle in that other code the possibility that the user/ALV grid will unselect all entries in the table.
Or am I misunderstanding your issue? Please do let us know,
Thanks,
Chris -
ALV Grid Header Problem.
Hi All,
I want to display the header of the ALV Grid as:
Material 111/11823
Plant/Usage/Alt 2845/3/5
Description ABI CAB
Base Qty. 23.000
The values are to be taken from variables
Please suggest how to do this.
Thanks*& Report ZDEMO_ALVGRID *
*& Example of a simple ALV Grid Report with grand total *
*& The basic requirement for this demo is to display a number of *
*& fields from the EKKO table. *
REPORT zdemo_alvgrid .
TABLES: ekko.
type-pools: slis. "ALV Declarations
*Data Declaration
TYPES: BEGIN OF t_ekko,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko.
*ALV data declarations
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.
*Start-of-selection.
START-OF-SELECTION.
perform data_retrieval.
perform build_fieldcatalog.
perform build_layout.
perform display_alv_report.
perform top-of-page.
*& Form BUILD_FIELDCATALOG
Build Fieldcatalog for ALV Report
form build_fieldcatalog.
There are a number of ways to create a fieldcat.
For the purpose of this example i will build the fieldcatalog manualy
by populating the internal table fields individually and then
appending the rows. This method can be the most time consuming but can
also allow you more control of the final product.
Beware though, you need to ensure that all fields required are
populated. When using some of functionality available via ALV, such as
total. You may need to provide more information than if you were
simply displaying the result
I.e. Field type may be required in-order for
the 'TOTAL' function to work.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
fieldcatalog-do_sum = 'X'.
fieldcatalog-no_zero = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item'.
fieldcatalog-col_pos = 1.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'STATU'.
fieldcatalog-seltext_m = 'Status'.
fieldcatalog-col_pos = 2.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'Item change date'.
fieldcatalog-col_pos = 3.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material Number'.
fieldcatalog-col_pos = 4.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'PO quantity'.
fieldcatalog-col_pos = 5.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Order Unit'.
fieldcatalog-col_pos = 6.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-col_pos = 7.
fieldcatalog-outputlen = 15.
fieldcatalog-do_sum = 'X'. "Display column total
fieldcatalog-datatype = 'CURR'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'PEINH'.
fieldcatalog-seltext_m = 'Price Unit'.
fieldcatalog-col_pos = 8.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
endform. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
Build layout for ALV grid report
form build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
gd_layout-totals_only = 'X'.
gd_layout-f2code = 'DISP'. "Sets fcode for when double
"click(press f2)
gd_layout-zebra = 'X'.
gd_layout-group_change_edit = 'X'.
gd_layout-header_text = 'helllllo'.
endform. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
Display report using ALV grid
form display_alv_report.
gd_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
i_callback_user_command = 'USER_COMMAND'
i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
it_special_groups = gd_tabgroup
IT_EVENTS = GT_XEVENTS
i_save = 'X'
is_variant = z_template
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endform. " DISPLAY_ALV_REPORT
*& Form DATA_RETRIEVAL
Retrieve data form EKPO table and populate itab it_ekko
form data_retrieval.
select ebeln ebelp statu aedat matnr menge meins netpr peinh
up to 10 rows
from ekpo
into table it_ekko.
endform. " DATA_RETRIEVAL
Form TOP-OF-PAGE *
ALV Report Header *
Form top-of-page.
*ALV Header declarations
data: t_header type slis_t_listheader,
wa_header type slis_listheader,
t_line like wa_header-info,
ld_lines type i,
ld_linesc(10) type c.
Title
wa_header-typ = 'H'.
wa_header-info = 'EKKO Table Report'.
append wa_header to t_header.
clear wa_header.
Date
wa_header-typ = 'S'.
wa_header-key = 'Date: '.
CONCATENATE sy-datum+6(2) '.'
sy-datum+4(2) '.'
sy-datum(4) INTO wa_header-info. "todays date
append wa_header to t_header.
clear: wa_header.
Total No. of Records Selected
describe table it_ekko lines ld_lines.
ld_linesc = ld_lines.
concatenate 'Total No. of Records Selected: ' ld_linesc
into t_line separated by space.
wa_header-typ = 'A'.
wa_header-info = t_line.
append wa_header to t_header.
clear: wa_header, t_line.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = t_header.
i_logo = 'ideas'.
endform. -
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
Maybe you are looking for
-
Hi, I am trying to use a ViewSonic Monitor (1680X1050, dynamic contrast 4000:1) with my MBP (leapord 10.5.2). I cannot get the colors to look normal - any suggestions?
-
Adding Customer-specific Fields: Master Data Objects
Hi, Somebody already obtain to include new fields in SAP MIC( Management Internal Controls) version 2.0? Att. Anderson Almeida
-
Everytime I try to purchase any thing from App Store using my apple ID, a message appear in my Ipad saying" your purchase could not be completed"
-
I downloaded Photoshop CS3, although whenever I try to run the setup it says: Adobe Photoshop cannot be installed because it conflicts with: - Adobe Photoshop CS3 I tried searching around to see if I had photoshop laying around on my computer and I c
-
TS2776 My new ipad is not showing as a device when i log into itunes why is this?
Just bought a new ipad when plugging into my laptop and opening itunes it is not showing as a device why is this?