List Display After ALV Display.
Hi,
i want to use write statement after display of the GRID ALV report. I User-command is getting dynamically called up when i presses the button.
FORM user_command USING p_ucomm LIKE sy-ucomm
p_selfield TYPE slis_selfield.
CASE p_ucomm.
WHEN '&GENERAL'.
READ TABLE i_general INTO wa_general INDEX p_selfield-tabindex.
IF sy-subrc = 0.
LEAVE TO LIST-PROCESSING.
WRITE : sy-uline(90).
write: / 'Serial: ', wa_general-serial.
ENDIF.
ENDFORM.
the problem is i m not able to use back button in the dynamic list display. Use pf-status as well but not working. Pressing BACK button does nothing.
Want to activate print and back button in the dynamic list display. (used pf-status which has back and print fucntion code but not working.)
Reward points sure for right answers.
Kartavya
Hi..
Try this.....
FORM user_command USING p_ucomm LIKE sy-ucomm
p_selfield TYPE slis_selfield.
CASE p_ucomm.
WHEN '&GENERAL'.
READ TABLE i_general INTO wa_general INDEX p_selfield-tabindex.
IF sy-subrc = 0.
<b>SET PF-STATUS SPACE.</b> "this will call the Standard GUI
LEAVE TO LIST-PROCESSING.
WRITE : sy-uline(90).
write: / 'Serial: ', wa_general-serial.
ENDIF.
ENDFORM.
<b>Reward if Helpful.</b>
Similar Messages
-
Write statement after alv display
Hi Experts,
My requirement is that i am displaying an output of ALV List display, in the List display i have a button which undergoes updation of records in Ztable.After pressing the button now i have to display Total no of records in write statement in which i should not have ALV display(i need 2 screens ).
Regards,
Vikram Sukumar<li>I don't know how you are doing but I am able to display. try this sample program for double click event.
REPORT ztest_notepad.
DATA: BEGIN OF it_t001 OCCURS 0,
bukrs TYPE t001-bukrs,
butxt TYPE t001-butxt,
adrnr TYPE t001-adrnr,
END OF it_t001.
TYPE-POOLS:slis.
DATA:it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat LIKE LINE OF it_fieldcat.
DEFINE fieldcat.
wa_fieldcat-fieldname = &1.
wa_fieldcat-tabname = &2.
wa_fieldcat-seltext_m = &3.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
END-OF-DEFINITION.
START-OF-SELECTION.
SELECT * FROM t001 INTO CORRESPONDING FIELDS OF TABLE it_t001 UP TO 10 ROWS.
fieldcat: 'BUKRS' 'IT_T001' 'BUKRS',
'BUTXT' 'IT_T001' 'BUTXT',
'ADRNR' 'IT_T001' 'ADRNR'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = it_fieldcat
TABLES
t_outtab = it_t001.
*& Form USER_COMMAND
FORM user_command USING r_ucomm LIKE sy-ucomm rs_selfield TYPE slis_selfield.
IF r_ucomm = '&IC1'.
WRITE 'Venkat'.
ENDIF.
ENDFORM. "USER_COMMAND
Thanks
Venkat.O -
DIfference between Reusable FM for ALV display and ALV display using class
Hi,
Is there any difference between alv display using Resuable FM and ALV display using classes except the later one uses OO concept.??
One mere thing i want to clarify is that is there any difference exist between REUSE_ALV_GRID_DISPLAY and REUSE_ALV_LIST_DISPLAY? If so, then let me know.
It could be easier to understand me if yuo give scenario where these FM comes into picture
Regards,
ParagHi,
(1) REUSE_ALV_LIST_DISPLAY
Display an ALV list as per parameters defined in the function call
(2) REUSE_ALV_GRID_DISPLAY
Display an ALV grid as per parameters defined in the function call
(3) REUSE_ALV_COMMENTARY_WRITE
List header information is output according to its type. The output information is put in an internal table. Output attributes are assigned to each line via the TYP field.This module outputs formatted simple header information at TOP-OF-PAGE.
(4) REUSE_ALV_HIERSEQ_LIST_DISPLAY
This module outputs two internal tables as a formated hierarchical-sequential list.
(5) REUSE_ALV_VARIANT_F4
Display variant selection dialog box.
(6) REUSE_ALV_VARIANT_EXISTENCE
Checks whether a display variant exists.
Other Useful Link :
Customize ALV grid layout at run time
Download ALV grid Control Tutorial
Understand ALV report ( Just Copy and paste )
Dynamic selection on ALV at run time
Dynamic selection on ALV at run time
Regards
Kiran -
Data lost when download data after ALV display in background
Hi, everyone, first i display the data in ALV Grid, then I upload the data into sap application sever, it is ok in foreground. But when i run the program at background and the data is more then one page in spool list, the file on application server will lost and only has data in last page of spool list. Is this SAP standard behavior? please advice, thanks.
There is a simple logic.
First i get all data and keep the data in interal table T_LIST.
Then call function REUSE_ALV_GRID_DISPLAY to display data in T_LIST.
Third, Using statement OPEN DATASTET and TRANSFER to upload data in T_LIST into application server.
In fact, it will be ok if run the program foreground. it will also be ok if upload data into appllication server before display data with ALV grid. But i just want to know the root cause why data lost in my current design. thanks. -
Documentaion for the report in the ALV display
Hi
I am using the function module 'REUSE_ALV_LIST_DISPLAY
' to display the list. I want some options which can display the documentation of the report after ALV displays the list.
Now i am using the documentation (se38) for the report which we can see pressing a button 'i' on the selection screen.
RameshHi Ramesh,
i use it like this:
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = PROGNAME
I_CALLBACK_PF_STATUS_SET = 'MAIN'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IS_VARIANT = VARIANT
IS_LAYOUT = LAYOUT
IT_FIELDCAT = FIELDCAT
IT_SORT = SORT
IT_FILTER = FILTER
I_SAVE = 'A'
IT_EVENTS = EVENTS
IT_EVENT_EXIT = EVENT_EXIT
IS_PRINT = PRINT
I_TABNAME_HEADER = 'HEADER'
I_TABNAME_ITEM = 'BESTAND'
IS_KEYINFO = KEYINFO
TABLES
T_OUTTAB_HEADER = HEADER
T_OUTTAB_ITEM = BESTAND
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
And this:
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
aktueller Satz beider Tabellen lesen, da hierarchisch
READ TABLE HEADER INDEX RS_SELFIELD-TABINDEX.
READ TABLE BESTAND INDEX RS_SELFIELD-TABINDEX.
IF R_UCOMM EQ '&IC1' AND RS_SELFIELD-TABNAME = 'HEADER'.
IF RS_SELFIELD-FIELDNAME = 'QMNUM'.
PERFORM IW53 USING HEADER-QMNUM.
ENDIF.
IF RS_SELFIELD-FIELDNAME = 'AUFNR' AND HEADER-AUFNR <> SPACE.
PERFORM CS_AUFTRAG USING HEADER-AUFNR.
ENDIF.
IF RS_SELFIELD-FIELDNAME = 'EQUNR'.
PERFORM PM_HIER USING HEADER-EQUNR.
ENDIF.
IF RS_SELFIELD-FIELDNAME = 'MATNR'.
PERFORM MM03 USING HEADER-MATNR.
ENDIF.
IF RS_SELFIELD-FIELDNAME = 'SERIALNR'.
PERFORM IQ03 USING HEADER-MATNR HEADER-SERIALNR.
ENDIF.
ELSEIF R_UCOMM = '&IC1' AND RS_SELFIELD-TABNAME = 'BESTAND'.
IF RS_SELFIELD-FIELDNAME = 'OTGRP'.
PERFORM EXCEL_OBJEKT.
ENDIF.
ELSEIF R_UCOMM = 'REFR'.
Ausgabe neu einlesen
RS_SELFIELD-REFRESH = 'X'.
PERFORM DATEN_EINLESEN.
Programmdokumentation.
ELSEIF R_UCOMM = 'DOKU'.
CALL FUNCTION 'DSYS_SHOW_FOR_F1HELP'
EXPORTING
DOKCLASS = 'RE'
DOKNAME = PROGNAME
SHORT_TEXT = 'X'
EXCEPTIONS
CLASS_UNKNOWN = 1
OBJECT_NOT_FOUND = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE I010 WITH 'Keine Dokumentation vorhanden!'.
ENDIF.
ELSEIF R_UCOMM = 'GRAPH'.
PERFORM GRAPHIK.
ELSE.
MESSAGE I010 WITH 'Bitte markieren sie eine gültige Tabellenzeile!'.
ENDIF.
ENDFORM.
And it works in the Output-List correct.
Regards, Dieter -
Multiple ALV display in one screen using SALV(Factory method)...
Hello Experts,
I tried using the old 'REUSE_ALV_BLOCK_LIST_APPEND' but it does not suit my
requirement. So will it be possible to display multiple ALV display(block) using
SALV?check the sample code..
REPORT zsalv_demo_multiple.
DATA: salv1 TYPE REF TO cl_salv_table,
salv2 TYPE REF TO cl_salv_table,
salv3 TYPE REF TO cl_salv_table.
DATA: g_custom TYPE REF TO cl_gui_custom_container,
o_splitter TYPE REF TO cl_gui_splitter_container,
o_grid1 TYPE REF TO cl_gui_container,
o_grid2 TYPE REF TO cl_gui_container,
o_grid3 TYPE REF TO cl_gui_container.
DATA: it_flight TYPE STANDARD TABLE OF sflight,
it_carr TYPE TABLE OF scarr,
it_book TYPE TABLE OF sbook.
START-OF-SELECTION.
SELECT * FROM sflight
INTO TABLE it_flight
UP TO 20 ROWS.
SELECT * FROM scarr
INTO TABLE it_carr
UP TO 20 ROWS.
SELECT * FROM sbook
INTO TABLE it_book
UP TO 20 ROWS.
CALL SCREEN 100.
*& Module STATUS_0100 OUTPUT
* text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'ABC'.
CREATE OBJECT g_custom
EXPORTING container_name = 'CONT'.
CREATE OBJECT o_splitter
EXPORTING parent = g_custom
rows = 3
columns = 1.
CALL METHOD o_splitter->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = o_grid1.
CALL METHOD o_splitter->get_container
EXPORTING
row = 2
column = 1
RECEIVING
container = o_grid2.
CALL METHOD o_splitter->get_container
EXPORTING
row = 3
column = 1
RECEIVING
container = o_grid3.
cl_salv_table=>factory(
EXPORTING
r_container = o_grid1
IMPORTING
r_salv_table = salv1
CHANGING
t_table = it_flight
cl_salv_table=>factory(
EXPORTING
r_container = o_grid2
IMPORTING
r_salv_table = salv2
CHANGING
t_table = it_carr
cl_salv_table=>factory(
EXPORTING
r_container = o_grid3
IMPORTING
r_salv_table = salv3
CHANGING
t_table = it_book
CALL METHOD salv1->display.
CALL METHOD salv2->display.
CALL METHOD salv3->display.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
Flow Logic..
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
in the Screen i placed a custom control and named it as CONT -
ALV display column and row wise
hi experts,
Is it possible to display in ALV display as 6 fields in column and some ranges in row display so how to display that using alv grid any sample report please do send me.
e.g.display format.
PO Type Shipping Date Invoice Num PCS # Po No. Cust Name Terms Open Balance
Current
Total Current
1 - 15
Total 1 - 15
16-30
Total 16-30
31 - 60
Total 31 - 60
61 - 90
Total 61 - 90
> 90
Total > 90
TOTALhi Lakshman,
i want report for customer open invoices that is aging report,
so depens on due days as per ranges shown in my question like 1--15 days,
15-16 days these are due days ranges , and i have display these related ranges records horizontally , just understand my display format u will get what i mean to say,
please send me any proper solution.
Thanks and Regards,
Yogesh -
Multiple ALV display using SALV(Factory method)...
Hello Experts,
Please provide me any examples on how to display multiple ALV
displays in a screen using SALV(Factory method).
Hope you can help me guys.
Thank you and take care!Hi Viraylab,
Kindly check the program below, this will help you..
*& Report Z101754_REPORT
REPORT z101754_report.
TABLES: zvbak_101754,zvbap_101754,mara.
TYPE-POOLS: slis.
DATA : i_fieldcat TYPE slis_t_fieldcat_alv.
DATA: FLDNAME(24).
DATA : BEGIN OF itab_zvbap OCCURS 0,
zvbeln LIKE zvbap_101754-zvbeln,
zposnr LIKE zvbap_101754-zposnr,
zmatnr LIKE zvbap_101754-zmatnr,
zbrgew LIKE zvbap_101754-zbrgew,
zgi_qty LIKE zvbap_101754-zgi_qty,
zinv_qty LIKE zvbap_101754-zinv_qty,
END OF itab_zvbap.
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-t01.
SELECT-OPTIONS : s_zvbeln FOR zvbak_101754-zvbeln,
s_zkunwe FOR zvbak_101754-zkunwe,
s_zerdat FOR zvbak_101754-zerdat,
s_zmatnr FOR zvbap_101754-zmatnr.
SELECTION-SCREEN END OF BLOCK block1.
SELECTION-SCREEN: BEGIN OF BLOCK block2 WITH FRAME TITLE t02.
PARAMETERS : invoiced AS CHECKBOX,
s_gi AS CHECKBOX .
SELECTION-SCREEN: END OF BLOCK block2.
SELECTION-SCREEN: BEGIN OF BLOCK block3 WITH FRAME TITLE t03.
PARAMETERS : alv_list RADIOBUTTON GROUP g1,
alv_grid RADIOBUTTON GROUP g1,
s_class RADIOBUTTON GROUP g1.
SELECTION-SCREEN: END OF BLOCK block3.
Screen Field Validation event
AT SELECTION-SCREEN ON s_zvbeln.
SELECT SINGLE *
FROM zvbak_101754 WHERE zvbeln IN s_zvbeln.
IF sy-subrc NE 0.
MESSAGE e000(z754).
ENDIF.
AT SELECTION-SCREEN ON s_zkunwe.
SELECT SINGLE *
FROM zvbak_101754 WHERE zkunwe IN s_zkunwe.
IF sy-subrc NE 0.
MESSAGE e001(z754).
ENDIF.
AT SELECTION-SCREEN ON s_zerdat.
SELECT SINGLE *
FROM zvbak_101754 WHERE zerdat IN s_zerdat.
IF sy-subrc NE 0.
MESSAGE e002(z754).
ENDIF.
AT SELECTION-SCREEN ON s_zmatnr.
SELECT SINGLE *
FROM zvbap_101754 WHERE zmatnr IN s_zmatnr.
IF sy-subrc NE 0.
MESSAGE e003(z754).
ENDIF.
Start-Of-Selection Event
START-OF-SELECTION.
PERFORM select-data.
End-Of-Selection Event
END-OF-SELECTION.
PERFORM display.
*& Form select-data
text
--> p1 text
<-- p2 text
FORM select-data .
SELECT zvbeln zposnr zmatnr zbrgew zgi_qty zinv_qty
INTO CORRESPONDING FIELDS OF TABLE itab_zvbap
FROM zvbap_101754
WHERE zvbeln IN s_zvbeln.
ENDFORM. " select-data3
TOP-OF-PAGE.
AT LINE-SELECTION.
FORMAT HOTSPOT.
*GET THE FIELD NAME ON LINE SELECTION
GET CURSOR FIELD FLDNAME . "value field_value.
IF FLDNAME = 'itab_zvbap-zvbeln'.
SET PARAMETER ID 'BES' FIELD itab_zvbap-zvbeln.
CALL TRANSACTION 'ZVA01_101754'.
ENDIF.
*& Form DISPLAY
text
--> p1 text
<-- p2 text
FORM display .
IF s_class ='X'.
PERFORM display_header.
LOOP AT itab_zvbap.
WRITE : / sy-vline,
itab_zvbap-zvbeln ,
13 sy-vline,
itab_zvbap-zposnr ,
30 sy-vline,
itab_zvbap-zmatnr ,
45 sy-vline,
itab_zvbap-zbrgew UNIT mara-meins ,
65 sy-vline,
itab_zvbap-zgi_qty UNIT mara-meins,
85 sy-vline,
itab_zvbap-zinv_qty UNIT mara-meins,
105 sy-vline,
/ sy-uline(105).
ENDLOOP.
ENDIF.
*& Creating the fieldcatalog.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'ITAB_ZVBAP'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
i_inclname = sy-repid
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = i_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
IF alv_list = 'X'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
i_callback_program = sy-repid
i_callback_pf_status_set = ' '
i_callback_user_command = 'USER_COMMAND '
I_STRUCTURE_NAME =
IS_LAYOUT =
it_fieldcat = i_fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IR_SALV_LIST_ADAPTER =
IT_EXCEPT_QINFO =
I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = itab_zvbap[]
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.
ENDIF.
IF alv_grid = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = sy-repid
i_callback_pf_status_set = ' '
i_callback_user_command = 'USER_COMMAND '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
it_fieldcat = i_fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = itab_zvbap[]
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.
ENDIF.
ENDFORM. " DISPLAY
*& Form display_header
text
--> p1 text
<-- p2 text
FORM display_header .
WRITE : / sy-vline,
'ORDER NO',
13 sy-vline,
'ITEM NO',
30 sy-vline,
'MATERIAL NO',
45 sy-vline,
'ORDER QTY',
65 sy-vline,
'GI QTY',
85 sy-vline,
'INVOICED QTY',
105 sy-vline,
/ sy-uline(105).
ENDFORM. " display_header
Please let me know if you have any doubt.
Regards,
Amit. -
Hello,
I have a requirement where I am displaying the ALV using grid.
Have a button on top.
After ALV display, I select the row and press the button.
The processing takes place like (Delivery creation).
After this delivery creation, I have to display the log output.
But the log has to be using the normal Write Statement.
Like : Write: 'Delivery created : 1001;.
I am trying this but my write is not working.
The code isgetting executed when seen in debug but nothing displayed on screen.
Any idea??
PranuHi,
add the below command in the ALV exporting..
... user_command = 'USER_COMMAND'..
and paste the code at the last ..
FORM user_command USING r_ucomm TYPE sy-ucomm
ls_selfield TYPE slis_selfield.
IF sy-ucomm = 'YOur button'.
LEAVE TO SCREEN 0.
endif.
ENDFORM. "USER_COMMAND
Regards,
Prabhudas -
hi
I need to create spool after ALV display. I used this fn module RSPO_OPEN_SPOOLREQUEST and pass only the destination parameter - 'LP01'.
Spool erquest is created but no pages.. Pages 0.. Pls advise if there is any other parameter I need to fill for this fn module or any other way to achieve this.
Thanks
Arunachala.GHello Arunachala,
Please use the below steps :
1.>
form build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
gd_layout-box_fieldname = 'CHK'.
gd_layout-box_tabname = 'IT_SPOOL'.
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.
2.> call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_interface_check = ' '
i_callback_program = gd_repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_top_of_page = ''
i_callback_user_command = 'USER_COMMAND'
i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
it_special_groups =
IT_EVENTS =
i_save = 'X'
is_variant =
tables
t_outtab = it_spool[].
3. >Function :RSPO_OUTPUT_SPOOL_REQUEST
exporting
spool_request_id = ls_spool_id-id.
NB: data : ls_spool_id type sp01r_id,
Please try to do like this...
Any problem you have then please ask me...and tell me your task in details...and program also...what you have done..
Regards,
sujeet -
After ALV Report i need to display the text below that
Hi Experts,
I need a help.
I want to display a write statment after alv report is generated.pls help me.
Please Urgent.here is an example
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE'
i_callback_html_end_of_list = 'END_OF_LIST_HTML'
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
i_save = 'X'
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
*& Form end_of_list_html
output at the end of the list - not in printed output *
FORM end_of_list_html USING end TYPE REF TO cl_dd_document.
DATA: ls_text TYPE sdydo_text_element,
l_grid TYPE REF TO cl_gui_alv_grid,
f(14) TYPE c VALUE 'SET_ROW_HEIGHT'.
ls_text = 'Footer title'.
adds and icon (red triangle)
CALL METHOD end->add_icon
EXPORTING
sap_icon = 'ICON_MESSAGE_ERROR_SMALL'.
adds test (via variable)
CALL METHOD end->add_text
EXPORTING
text = ls_text
sap_emphasis = 'strong'.
adds new line (start new line)
CALL METHOD end->new_line.
display text(bold)
CALL METHOD end->add_text
EXPORTING
text = 'Bold text'
sap_emphasis = 'strong'.
adds new line (start new line)
CALL METHOD end->new_line.
display text(normal)
CALL METHOD end->add_text
EXPORTING
text = 'Normal text'.
adds new line (start new line)
CALL METHOD end->new_line.
display text(bold)
CALL METHOD end->add_text
EXPORTING
text = 'Yellow triangle'
sap_emphasis = 'strong'.
adds and icon (yellow triangle)
CALL METHOD end->add_icon
EXPORTING
sap_icon = 'ICON_LED_YELLOW'.
display text(normal)
CALL METHOD end->add_text
EXPORTING
text = 'More text'.
*set height of this section
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = l_grid.
CALL METHOD l_grid->parent->parent->(f)
EXPORTING
id = 3
height = 14.
ENDFORM. "end_of_list_html. -
Moderator message: Please do not use ALL CAPITALS in your message subjects
I am facing a peculiar situation with respect to a report with 2 block lists.
STEP 1:
I first use REUSE_ALV_BLOCK_LIST_INIT with EXPORTING parameter as
i_callback_program = SY-REPID.
This works fine with return code of sy-subrc = 0.
STEP 2:
I build the field catalog and internal table - in debug I also check the sequence of fields of both the internal tables and field calatogs - perfect - no issues.
Then I call REUSE_ALV_BLOCK_LIST_APPEND with exporting parameters as layout, field catalog, table name & event and tables parameter as internal table and exception handling, I repeat this call for the two internal tables.
This works fine with return code of sy-subrc = 0
STEP 3:
I use REUSE_ALV_BLOCK_LIST_DISPLAY to display the two lists one after the other, and I have coded for error message if sy-subrc is non zero.
This works fine with return code of sy-subrc = 0
ISSUE :
Internal table 1 and internal table 2 both have say 4 records, then I see the two lists with heading(s) perfec and col width also optimized and zebra (alternate steipes also in place), and 4 rows for each internal table on output, however the rows are BLANK - NO DATA, whereas I have checked both internal tables before the call and they seem to have the data perfectly and in the same sequence as the field catalog - however the rows are BLANK.
I checked in debugging but was just not able to find out why if the internal tables and field catalog is perfect, no data is passed to output.
Please help !!
Edited by: M N on Nov 14, 2008 5:22 AM
Edited by: Matt on Nov 14, 2008 10:23 AM*& Report Y_ALV_BLOCKLIST_
REPORT Y_ALV_BLOCKLIST_16131.
TYPE-POOLS : SLIS.
DATA: X_LAYOUT TYPE SLIS_LAYOUT_ALV.
Events
DATA: GT_XEVENTS TYPE SLIS_T_EVENT.
DATA: GT_YEVENTS TYPE SLIS_T_EVENT.
data : XS_EVENT TYPE SLIS_ALV_EVENT.
DATA: XFIELD TYPE SLIS_T_FIELDCAT_ALV.
DATA: YFIELD TYPE SLIS_T_FIELDCAT_ALV.
DATA: AFIELD TYPE SLIS_FIELDCAT_ALV.
DATA: GT_PRINT TYPE SLIS_PRINT_ALV.
TYPES : BEGIN OF TY_MARA ,
MATNR TYPE MATNR,
MTART TYPE MTART,
END OF TY_MARA.
TYPES: BEGIN OF TY_MAKT ,
MATNR TYPE MATNR,
MAKTX TYPE MAKTX,
END OF TY_MAKT.
DATA : ITAB TYPE TABLE OF TY_MARA,
PTAB TYPE TABLE OF TY_MAKT.
START-OF-SELECTION.
SELECT DATA
SELECT MATNR MAKTX FROM MAKT INTO TABLE PTAB UP TO 10 ROWS.
SELECT MATNR MTART FROM MARA INTO TABLE ITAB UP TO 10 ROWS.
*eVENT FOR Heading
PERFORM F_EVENTS.
FIELD CATALOG
PERFORM F_FIELDCAT.
INIT BLOCK ALV
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID.
ADD INTERNAL TABLE ITAB
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = X_LAYOUT
IT_FIELDCAT = XFIELD "ALVFC
I_TABNAME = 'ITAB'
IT_EVENTS = GT_XEVENTS
TABLES
T_OUTTAB = ITAB
EXCEPTIONS
PROGRAM_ERROR = 1
MAXIMUM_OF_APPENDS_REACHED = 2
OTHERS = 3.
ADD INTERNAL TABLE PTAB
REFRESH ALVFC[].
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = X_LAYOUT
IT_FIELDCAT = YFIELD "ALVFC
I_TABNAME = 'PTAB'
IT_EVENTS = GT_YEVENTS
TABLES
T_OUTTAB = PTAB
EXCEPTIONS
PROGRAM_ERROR = 1
MAXIMUM_OF_APPENDS_REACHED = 2
OTHERS = 3.
DISPLAY
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
*GT_PRINT-RESERVE_LINES = 2.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
EXPORTING
IS_PRINT = GT_PRINT.
*& Form F_FIELDCAT
text
--> p1 text
<-- p2 text
FORM F_FIELDCAT .
DATA: L_COUNT TYPE I.
CLEAR AFIELD.
L_COUNT = L_COUNT + 1.
AFIELD-COL_POS = L_COUNT.
AFIELD-FIELDNAME = 'MATNR'.
AFIELD-REF_TABNAME = 'MARA'.
AFIELD-KEY = 'X'. "define field as key
AFIELD-DO_SUM = 'X'.
APPEND AFIELD TO XFIELD.
CLEAR AFIELD.
L_COUNT = L_COUNT + 1.
AFIELD-COL_POS = L_COUNT.
AFIELD-FIELDNAME = 'MTART'.
AFIELD-REF_TABNAME = 'MARA'.
AFIELD-KEY = 'X'. "define field as key
APPEND AFIELD TO XFIELD.
L_COUNT = 0.
CLEAR AFIELD.
L_COUNT = L_COUNT + 1.
AFIELD-COL_POS = L_COUNT.
AFIELD-FIELDNAME = 'MATNR'.
AFIELD-REF_TABNAME = 'MAKT'.
AFIELD-KEY = 'X'. "define field as key
APPEND AFIELD TO YFIELD.
CLEAR AFIELD.
L_COUNT = L_COUNT + 1.
AFIELD-COL_POS = L_COUNT.
AFIELD-FIELDNAME = 'MAKTX'.
AFIELD-REF_TABNAME = 'MAKT'.
AFIELD-KEY = 'X'. "define field as key
APPEND AFIELD TO YFIELD.
ENDFORM. " F_FIELDCAT
*& Form F_EVENTS
text
--> p1 text
<-- p2 text
FORM F_EVENTS .
CLEAR XS_EVENT.
XS_EVENT-NAME = SLIS_EV_TOP_OF_PAGE.
XS_EVENT-FORM = 'TOP1'.
APPEND XS_EVENT TO GT_XEVENTS.
CLEAR XS_EVENT.
XS_EVENT-NAME = SLIS_EV_TOP_OF_PAGE.
XS_EVENT-FORM = 'TOP2'.
APPEND XS_EVENT TO GT_YEVENTS.
ENDFORM. " F_EVENTS
FORM TOP1.
WRITE : 'MARA TABLE'.
ENDFORM.
FORM TOP2.
WRITE : 'MAKT TABLE'.
ENDFORM. -
What is the difference between list display and grid display in alv report
Hai genious
i am a new of the abap, i dont know the alv report, i have a small doubt, can u please tell me what is the main difference between list display and grid display in alv report
thanks®ards
chinnuHi ,
1. For all practical purposes, they are the same.
2. Some differences:
a) from abap coding point of view,
alv list is done with Function modules,
alv gris can also be done with FM,
but can also be done using OO concepts.
b) Alv grid (using oo concept) requires
designing the screen layout .
Hence, in one screen, we can show more
then one alv grid
(we cannot show more than
one alv list on one screen)
c) ALV grid uses ActiveX controls
present on the Presentation Server.
Hence, it consumes More Memory
on the presentation server.
d) ALV LIST is Display Only.
Whereas
ALV Grid Can Be made EDITABLE for entry purpose.
e) In alv grid, these options are possible,
but not in alv list.
without horizontal lines
without vertical lines
without cell merging during sorts
display total lines above the entries
I hope it helps.
Regards,
Mamta
Edited by: Mamta Verma on Nov 27, 2008 6:41 AM -
Issue with Secondary list display in ALV BLocked List
Hi all,
I am using ALV Blocked List consissting of 3 blocks.
For my requirement, in the 1st block, I need to make a colum clickable, for which I have used the User_Command Event.
But this is not working. The second list is not gettin displayed.
Here'z my code:
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = v_repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IT_EXCLUDING =
REFRESH: it_events[].
wa_events-name = slis_ev_top_of_list.
wa_events-form = 'FIRST_HEADING'.
APPEND wa_events TO it_events.
wa_events-name = slis_ev_user_command.
wa_events-form = 'USER_COMMAND'.
APPEND wa_events TO it_events.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = v_layout
it_fieldcat = it_disptab_field[]
i_tabname = 'DISPTAB'
it_events = it_events[] " Call 1st BLOCK TO BE APPENDED For SALES ANALYSIS
IT_SORT =
I_TEXT = ' '
TABLES
t_outtab = it_disptab
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 2
OTHERS = 3.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '&IC1'.
READ TABLE it_disptab INTO w_disptab INDEX rs_selfield-tabindex.
IF rs_selfield-fieldname = 'KUNAG'.
WRITE:/1 'invoice',
10 'Quantity in Base Unit',
20 'Base Unit',
30 'Qty in KL',
40 'Price'.
ENDIF.
ENDCASE.
ENDFORM. " USER_COMMAND
Please Help..Hi Ganesh,
Thanks for your reply. I have already used hotspot on the fieldcat of the clickable field. But it seems that except for the hand cursor appearing only on that field, the other columns are also clickable.
Moreover, only the fiirst block should be clickable but all the blocks are applying the user_command.
This might be due to the REUSE_ALV_BLOCK_LIST_INIT Function Module, which applies to all the blocks.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = v_repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
I_CALLBACK_PF_STATUS_SET = ' '
i_callback_user_command = 'USER_COMMAND'
IT_EXCLUDING =
In orser to avoid this, I am using the following code, which can be a temporary solution to the problem.
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
DATA: row_count TYPE sy-lilli.
CASE r_ucomm.
WHEN '&IC1'.
DESCRIBE TABLE it_disptab LINES row_count.
READ TABLE it_disptab INTO w_disptab INDEX rs_selfield-tabindex.
IF rs_selfield-tabindex LE row_count AND rs_selfield-tabindex ne 0 AND rs_selfield-tabname = 'DISPTAB'.
PERFORM get_data.
PERFORM build_fieldcat.
PERFORM display_second_list.
ELSE.
EXIT.
ENDIF.
ENDCASE.
ENDFORM. " USER_COMMAND -
Update SAP tables after ALV report is displayed
Hi All,
I have to display a ALV report using function module REUSE_ALV_GRID_DISPLAY.
After the report is displayed, user can edit some of the flds in the report, and the fields need to updated in the table. How do I proceed to accomplish this.
Is it possible to use FM 'REUSE_ALV_DRID_DISPLAY' to do this or we need to use OOPS ALV to do this.
I searched for this in this forum, but couldnt get.
Thanks in advance,
AnanthYou can use the REUSE_ALV_GRID_DISPLAY. and can make it a changable. You can specify the column to be changable. Once the user enters data into that coloumn the interna table automatically gets populated with the values.
I have done a similar program. However you might need to copy some standard GUI status based on your requirements.
Whats ur mail ID. I can send you the program I have developed.
Shreekant
Maybe you are looking for
-
Since an iphone battery lasts for 300-500 cycles before losing its juice, can I just continuously connect my iphone to the power supply to avoid using the battery, like how I use my macbook.
-
I bought the Freestyle 750 a couple of days ago and i have this fault on it. When someone rings me and trys to leave a message I get the answer phone saying, please replace the handset and try again she repeats this for about 8 times then stops, the
-
2 Adobe flash site issues..
Questions1: I have a script error message of. scene=scene1, layer=actions, frame=2, line=9. Error opening including file gs/datatransfer/xmlfunctions.as File not found. how do I fix this, I won't load my site when I hit publish preview. Have been fig
-
In KM how to set the size of the folder,in order to Restrict the user in entering the large amount of the data?
-
Sap Interface Issues - SM58- the following errors were found
Hi Experts, Could you please tell me...why are the following errors coming in SAP EDI . Caller Function Module Target System Date Time Status Text Transaction ID C10IBBITSN IDOC_INBOUND_ASYNCHRONOUS SAPBC4X-LOG_L 16.09.2011 08:14:28 com.wm.lang.flow.