ALV GRID print problem
Hi guys,
When I execute my report I can see all fields ok, but when I decide to print it the columns and fields are been displaced. I tried to fix with the fielcatalog but it isn't possible. Can anybody help me?
Thanks a lot
Best regards.
Ana
Hi Menegazzo Marco ,
I call the alv :
***fieldcatalog***
LS_FCAT-COL_POS = '1'.
LS_FCAT-FIELDNAME = 'BUKRS' .
LS_FCAT-TABNAME = 'BKPF'.
LS_FCAT-INTTYPE = 'C' .
LS_FCAT-OUTPUTLEN = '4' .
LS_FCAT-COLTEXT = 'Sociedad ' .
LS_FCAT-SELTEXT = 'Sociedad ' .
LS_FCAT-JUST = 'X'.
LS_FCAT-COL_OPT = ' '.
APPEND LS_FCAT TO PGT_FIELDCAT .
CLEAR LS_FCAT.
LS_FCAT-COL_POS = '2'.
LS_FCAT-FIELDNAME = 'BELNR' .
LS_FCAT-TABNAME = 'BKPF'.
LS_FCAT-INTTYPE = 'C' .
LS_FCAT-OUTPUTLEN = '10' .
LS_FCAT-DD_OUTLEN = '10'.
LS_FCAT-COLTEXT = 'Nº doc. Contable' .
LS_FCAT-SELTEXT = 'Nº doc. Contable' .
LS_FCAT-JUST = 'X'.
LS_FCAT-COL_OPT = ''.
APPEND LS_FCAT TO PGT_FIELDCAT .
CLEAR LS_FCAT.
LS_FCAT-COL_POS = '3'.
LS_FCAT-FIELDNAME = 'GJAHR' .
LS_FCAT-TABNAME = 'BKPF'.
LS_FCAT-INTTYPE = 'N' .
LS_FCAT-OUTPUTLEN = '4' .
LS_FCAT-COLTEXT = 'Ejercicio' .
LS_FCAT-SELTEXT = 'Ejercicio' .
LS_FCAT-JUST = 'X'.
LS_FCAT-COL_OPT = ' '.
APPEND LS_FCAT TO PGT_FIELDCAT .
CLEAR LS_FCAT.
**end fieldcatalog**
*layout**
PGS_LAYOUT-CWIDTH_OPT = 'X'.
PGS_LAYOUT-COL_OPT = 'X'.
*end layout**
*print*
GS_PRINT-NO_COLWOPT = 'X'.
*end print*
CALL METHOD GR_ALVGRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_STRUCTURE_NAME = 'S_ALV'
IS_LAYOUT = GS_LAYOUT
IS_PRINT = GS_PRINT
CHANGING
IT_OUTTAB = LT_ALV[]
IT_FIELDCATALOG = GT_FIELDCAT
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
*--Exception handling
ENDIF.
Thanks a lot.
Similar Messages
-
Text above an ALV-Grid print-out
It is possible to set a Text above an ALV-Grid print-out?
hii
yes you can print header in ALV & it will come in print out.use following code
DATA: i_listheader TYPE slis_t_listheader WITH HEADER LINE,
w_date like sy-datum.
move:
'H' TO i_listheader-typ,
TO i_listheader-info.
* text-021 TO i_listheader-info.
APPEND i_listheader.
WRITE sy-datum TO w_date.
move:
'S' TO i_listheader-typ,
'Execution date' TO i_listheader-key,
w_date TO i_listheader-info.
APPEND i_listheader.
MOVE:
'S' TO i_listheader-typ,
'Execution user' TO i_listheader-key,
sy-uname TO i_listheader-info.
APPEND i_listheader.
Move:
'Discription' to i_listheader-key,
'Tolling Production Variance' to i_listheader-info.
APPEND i_listheader.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = i_listheader[].
<REMOVED BY MODERATOR>
thx
twinkal
Edited by: twinkal patel on Jun 12, 2008 2:51 PM
Edited by: Alvaro Tejada Galindo on Jun 12, 2008 1:33 PM -
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 -
Hi all
I have a problem when i print my alv grid report it first prints the title page then the revelent pages can i remove that title page.
thankshave you checked with your windows administrator??
-
Issue with ALV grid print preview/spool
Hello everyone,
I am working on a report and I am having some issues with ALV grid. Currently in our DEV and QA environments the user can run the report, view the ALV grid, and print the grid without any issues.
However this isn't the case in the Prod environment. The user is able to run the report and view the grid without any issues. But when they click print preview or click print, the spool is incorrect. It shows the proper values from the grid, but the first field is reduced in length. Rather than showing a numeric field of length 10 it shows 99999999# or 99999999...
The programs are identical through every environment, including user parameters, formats, and spool settings. I have been told printing grids may have some issues, does anyone have any advice or dealt with this issue before?
I appreciate the help.
Thanks,
CI was waiting to hear from the functional team on the matter and no one has mentioned any more issues. I am assuming the problem is solved. I just noticed the thread was still un-answered and wanted to give an update.
Thank you for you help Vijay.
Regards
C -
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 -
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> -
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 -
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 -
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,
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
Maybe you are looking for
-
I'm new to iTunes, and I'm usings Windows XP PRO SR3. I ripped some CDs to FLAC format (one folder per CD). Then converted FLAC to MP3 in a new folder tree (F:\Music\MP3\"one folder per CD") When I imported the sub-folders in the MP3 folder (my iTune
-
Pbm with document name while generating URL for created document
Hi Gurus,<br> <br> When we upload a document and generate the URL for that document, and then while we paste the same in the explorer window to access it, I was able to see the dialog asking me whether to save or open the document with the <B>actual
-
Work flow (sap-abap)
Hi Friends, Can anybody tell me how to search exact user exit to write code to trigger workflow ? Thx and Regds, bapi bobby
-
How can I change the ToolTip bg and fg colors?
hi, I have a JTree, and I want to display a textual description for each node as a tooltip. I want the tooltip to appear with a certain bgcolor, and fgcolor. I have a CustomCellRenderer extending DefaultTreeCellRenderer with getTreeCellRendererCompon
-
Why is my trash automatically deleting when I don't want it to
I went into the settings and i have NEVER selected for "premanatley erase messages" under mailbox behaviours. It has deleted my messages in the trash and now i am unable to find an invoice that I was looking for any help appreiated.