Alv reports:blocked list diplay
can u brief about blocked list daisplay
thanks and regards
murali krishna
hi,
*& Report ZLAXMI_ALVEXER3 *
REPORT ZLAXMI_ALVEXER3 MESSAGE-ID ZZ .
*& TABLES DECLARATION *
TABLES: MARA, MAKT, MARC.
*& TYPE POOLS DECLARATION *
TYPE-POOLS: SLIS.
DATA DECLARATIONS *
DATA: V_FLAG TYPE C. "Flag to display the header
DATA: V_REPID TYPE SY-REPID.
*& INTERNAL TABLE DECLARATION *
DATA: BEGIN OF I_MARA OCCURS 0,
MATNR LIKE MARA-MATNR,
MTART LIKE MARA-MTART,
MATKL LIKE MARA-MATKL,
MEINS LIKE MARA-MEINS,
NTGEW LIKE MARA-NTGEW,
END OF I_MARA.
DATA: BEGIN OF I_MAKT OCCURS 0,
MATNR LIKE MAKT-MATNR,
SPRAS LIKE MAKT-SPRAS,
MAKTX LIKE MAKT-MAKTX,
MAKTG LIKE MAKT-MAKTG,
END OF I_MAKT.
DATA: BEGIN OF I_MARC OCCURS 0,
MATNR LIKE MARC-MATNR,
WERKS LIKE MARC-WERKS,
LADGR LIKE MARC-LADGR,
MTVFP LIKE MARC-MTVFP,
DISPR LIKE MARC-DISPR,
DISMM LIKE MARC-DISMM,
DISPO LIKE MARC-DISPO,
END OF I_MARC.
*- Fieldcatalog
DATA: IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
*- For Events
DATA:IT_EVENTS1 TYPE SLIS_T_EVENT,
IT_EVENTS2 TYPE SLIS_T_EVENT.
*- Fieldcatalog, Layout and Events
DATA:X_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
X_LAYOUT TYPE SLIS_LAYOUT_ALV,
X_EVENTS TYPE SLIS_ALV_EVENT.
Selection screen Declaration
*--BLOCK1
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: S_MATNR FOR MARA-MATNR,
S_MTART FOR MARA-MTART.
SELECTION-SCREEN END OF BLOCK B1.
AT SELECTION-SCREEN *
*- Validations
AT SELECTION-SCREEN.
PERFORM VALIDATE_SCREEN.
START OF SELECTION *
START-OF-SELECTION.
*- To get data from mara
PERFORM GET_DATA.
*to get data from makt
PERFORM GET_DATA_MAKT.
*to get data from marc
PERFORM GET_DATA_MARC.
*fieldcatalog
PERFORM FORM_FIELDCATALOG.
END OF SELECTION *
END-OF-SELECTION.
PERFORM DISPLAY_REPORT.
*& Form GET_DAta
text
--> p1 text
<-- p2 text
FORM GET_DATA .
*to get data from mara table.
SELECT MATNR
MTART
MATKL
MEINS
NTGEW FROM MARA
INTO TABLE I_MARA
WHERE MATNR IN S_MATNR
AND MTART IN S_MTART.
IF SY-SUBRC = 0.
SORT I_MARA BY MATNR.
ENDIF.
ENDFORM. " GET_DAta
*& Form get_data_makt
text
--> p1 text
<-- p2 text
FORM GET_DATA_MAKT .
SELECT MATNR
SPRAS
MAKTX
MAKTG FROM MAKT
INTO TABLE I_MAKT
FOR ALL ENTRIES IN I_MARA
WHERE
MATNR = I_MARA-MATNR.
IF SY-SUBRC = 0.
SORT I_MAKT BY MATNR SPRAS.
ENDIF.
ENDFORM. " get_data_makt
*& Form get_data_marc
text
--> p1 text
<-- p2 text
FORM GET_DATA_MARC .
SELECT MATNR
WERKS
LADGR
MTVFP
DISPR
DISMM
DISPO FROM MARC
INTO TABLE I_MARC
FOR ALL ENTRIES IN I_MARA
WHERE MATNR = I_MARA-MATNR.
IF SY-SUBRC = 0.
SORT I_MARC BY MATNR WERKS.
ENDIF.
ENDFORM. " get_data_marc
*& Form form_fieldcatalog
text
--> p1 text
<-- p2 text
FORM FORM_FIELDCATALOG .
DATA:L_POS TYPE I VALUE 1.
CLEAR: L_POS.
L_POS = L_POS + 1.
X_FIELDCAT-SELTEXT_M = 'MATERIAL NO'.
X_FIELDCAT-FIELDNAME = 'MATNR'.
X_FIELDCAT-TABNAME = 'I_MARA'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '15'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-SELTEXT_M = 'MATERIAL TYPE'.
X_FIELDCAT-FIELDNAME = 'MTART'.
X_FIELDCAT-TABNAME = 'I_MARA'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '5'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-SELTEXT_M = 'MATERIAL GRP'.
X_FIELDCAT-FIELDNAME = 'MATKL'.
X_FIELDCAT-TABNAME = 'I_MARA'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '9'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-SELTEXT_M = 'UOM'.
X_FIELDCAT-FIELDNAME = 'MEINS'.
X_FIELDCAT-TABNAME = 'I_MARA'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '3'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-SELTEXT_M = 'NET WEIGHT'.
X_FIELDCAT-FIELDNAME = 'NTGEW'.
X_FIELDCAT-TABNAME = 'I_MARA'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '13'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
L_POS = L_POS + 1.
X_LAYOUT-ZEBRA = 'X'.
REFRESH:IT_EVENTS1,IT_EVENTS2.
CLEAR:X_EVENTS,IT_EVENTS1,IT_EVENTS2.
ENDFORM. " form_fieldcatalog
*& Form DISPLAY_REPORT
text
--> p1 text
<-- p2 text
FORM DISPLAY_REPORT .
V_REPID = SY-REPID.
Set Default GUI status
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID.
*- To display quantity not in SAP
IF NOT I_MARA[] IS INITIAL.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = X_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
I_TABNAME = 'I_MARA'
IT_EVENTS = IT_EVENTS2
TABLES
T_OUTTAB = I_MARA
EXCEPTIONS
PROGRAM_ERROR = 1
MAXIMUM_OF_APPENDS_REACHED = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE I002 WITH 'Error in REUSE_ALV_BLOCK_LIST_APPEND'(002).
ENDIF.
ENDIF.
IF NOT I_MAKT[] IS INITIAL.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = X_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
I_TABNAME = 'I_MAKT'
IT_EVENTS = IT_EVENTS1
TABLES
T_OUTTAB = I_MAKT
EXCEPTIONS
PROGRAM_ERROR = 1
MAXIMUM_OF_APPENDS_REACHED = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE I002 WITH 'Error in REUSE_ALV_BLOCK_LIST_APPEND'(002).
ENDIF.
ENDIF.
IF NOT I_MARC[] IS INITIAL.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = X_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
I_TABNAME = 'I_MARC'
IT_EVENTS = IT_EVENTS1
TABLES
T_OUTTAB = I_MARC
EXCEPTIONS
PROGRAM_ERROR = 1
MAXIMUM_OF_APPENDS_REACHED = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE I002 WITH 'Error in REUSE_ALV_BLOCK_LIST_APPEND'(002).
ENDIF.
ENDIF.
IF NOT I_MARA[] IS INITIAL OR NOT I_MAKT[] IS INITIAL
OR I_MARC IS INITIAL.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE I002 WITH 'Error in REUSE_ALV_BLOCK_LIST_DISPLAY'(003).
ENDIF.
ENDIF.
ENDFORM. " DISPLAY_REPORT
*& Form VALIDATE_SCREEN
text
--> p1 text
<-- p2 text
FORM VALIDATE_SCREEN .
DATA: LV_MATNR LIKE MARA-MATNR,
LV_MTART LIKE MARA-MTART.
*MATERIAL VALIDATION.
IF NOT S_MATNR IS INITIAL.
SELECT MATNR
INTO LV_MATNR
UP TO 1 ROWS
FROM MARA
WHERE MATNR IN S_MATNR.
ENDSELECT.
IF SY-SUBRC <> 0.
MESSAGE E000 WITH 'INVALID MATERIAL'(004).
ENDIF.
ENDIF.
*MATERIAL TYPE VALIDATION
IF NOT S_MTART IS INITIAL.
SELECT MTART
INTO LV_MTART
UP TO 1 ROWS
FROM MARA
WHERE MTART IN S_MTART.
ENDSELECT.
IF SY-SUBRC <> 0.
MESSAGE E000 WITH 'INVALID MATERIAL TYPE'(005).
ENDIF.
ENDIF.
ENDFORM. " VALIDATE_SCREEN
block alv
when two or more DIFFERENT internal tables,
of different fields and size,
whose data may not at all be related to each other,
-- then block alv is used
Regards,
Laxmi.
Similar Messages
-
Why in ALV report, menu List- Export- Spreadsheet,must save in local file
Hello everyone .
in FBL3N (GL line item) that is ALV report.
i want to export data to excel.
but when i go to menu List->Export-> Spreadsheet
system want to save file in local drive.
when i use menu List->Export-> Spreadsheet
it's should show data in excel , not save file to local drive.
please advice.Hi,
Before savind into the system browse the location and rename the file for word format that means
After pressing spread sheet it show like this
Directory file:
File Name:
Encoding:
In the File name it will shows the default file name and you have change that document file>
Eg:- It shows .xls and you want as word format change as .doc
It shows .xls and you want as txt format change as .txt
It shows .txt format and you want as excel format change as ..xls
Hope this will understand
Regards,
Kanike -
Regarding ALV Report Otput List
Dear Friends,
I need to be edit the content of ALV output list,I am not using ABAP object oriented concepts. How can i perform this. Please suggest me to perform this, if possible please provide sample code on it.hi jotsona,
try this code
REPORT ZDEMO_ALVGRID_EDIT .
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,
field_style TYPE lvc_t_styl, "FOR DISABLE
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.
DATA: it_fieldcat TYPE lvc_t_fcat, "slis_t_fieldcat_alv WITH HEADER LINE,
wa_fieldcat TYPE lvc_s_fcat,
gd_tab_group TYPE slis_t_sp_group_alv,
gd_layout TYPE lvc_s_layo, "slis_layout_alv,
gd_repid LIKE sy-repid.
*Start-of-selection.
START-OF-SELECTION.
PERFORM data_retrieval.
PERFORM set_specific_field_attributes.
PERFORM build_fieldcatalog.
PERFORM build_layout.
PERFORM display_alv_report.
*& Form BUILD_FIELDCATALOG
Build Fieldcatalog for ALV Report
FORM build_fieldcatalog.
wa_fieldcat-fieldname = 'EBELN'.
wa_fieldcat-scrtext_m = 'Purchase Order'.
wa_fieldcat-col_pos = 0.
wa_fieldcat-outputlen = 10.
wa_fieldcat-emphasize = 'X'.
wa_fieldcat-key = 'X'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'EBELP'.
wa_fieldcat-scrtext_m = 'PO Item'.
wa_fieldcat-col_pos = 1.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'STATU'.
wa_fieldcat-scrtext_m = 'Status'.
wa_fieldcat-col_pos = 2.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'AEDAT'.
wa_fieldcat-scrtext_m = 'Item change date'.
wa_fieldcat-col_pos = 3.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-scrtext_m = 'Material Number'.
wa_fieldcat-col_pos = 4.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'MENGE'.
wa_fieldcat-scrtext_m = 'PO quantity'.
wa_fieldcat-col_pos = 5.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'MEINS'.
wa_fieldcat-scrtext_m = 'Order Unit'.
wa_fieldcat-col_pos = 6.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'NETPR'.
wa_fieldcat-scrtext_m = 'Net Price'.
wa_fieldcat-edit = 'X'. "sets whole column to be editable
wa_fieldcat-col_pos = 7.
wa_fieldcat-outputlen = 15.
wa_fieldcat-datatype = 'CURR'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'PEINH'.
wa_fieldcat-scrtext_m = 'Price Unit'.
wa_fieldcat-col_pos = 8.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
ENDFORM. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
Build layout for ALV grid report
FORM build_layout.
Set layout field for field attributes(i.e. input/output)
gd_layout-stylefname = 'FIELD_STYLE'.
gd_layout-zebra = 'X'.
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'
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
EXPORTING
i_callback_program = gd_repid
i_callback_user_command = 'USER_COMMAND'
is_layout_lvc = gd_layout
it_fieldcat_lvc = it_fieldcat
i_save = 'X'
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 CORRESPONDING FIELDS OF TABLE it_ekko.
ENDFORM. " DATA_RETRIEVAL
*& Form set_specific_field_attributes
populate FIELD_STYLE table with specific field attributes
form set_specific_field_attributes .
DATA ls_stylerow TYPE lvc_s_styl .
DATA lt_styletab TYPE lvc_t_styl .
Populate style variable (FIELD_STYLE) with style properties
The NETPR field/column has been set to editable in the fieldcatalog...
The following code sets it to be disabled(display only) if 'NETPR'
is gt than 10.
LOOP AT it_ekko INTO wa_ekko.
IF wa_ekko-netpr GT 10.
ls_stylerow-fieldname = 'NETPR' .
ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.
"set field to disabled
APPEND ls_stylerow TO wa_ekko-field_style.
MODIFY it_ekko FROM wa_ekko.
ENDIF.
ENDLOOP.
endform. " set_specific_field_attributes
thanks
anurag
Edited by: anurag srivastava on Dec 28, 2009 5:23 PM -
How to display the alv report blocks wise with out using the blocked alv
Hi
How to display the alv report with out using the blocked alv function module.
Thanks
Chinnusee this Standard Program
RPR_ABAP_SOURCE_SCAN -
How to calculate totals in Blocked ALV Report
Hi All,
Can any body tell how to calculate totals & sub totals in
Blocked ALV Report[Blocked List].
Thanks in advance
Thanks & Regards,
Rayeezuddin.read this it might help
Sums
15. No_sumchoice(1) TYPE c : This parameter allows the choice for summing up
Only by fieldcatalog.
Value set: SPACE, 'X'
'X' = fields which are to be summed, passed by the calling program (FIELDCAT-DO_SUM = 'X'). The user should not be able to change this value interactively.
16. No_totalline(1) TYPE c : Removes the option of having totals after sub-totals.
Value set: SPACE, 'X'
'X' = no total record is to be output. Subtotals can still be calculated and output. The fields in the subtotals are flagged DO_SUM = 'X' in the field list.
17. No_subchoice(1) TYPE c : Does not allow the user to interactively change the field chosen for subtotals.
Value set: SPACE, 'X'
'X' = value whose change triggers subtotals, provided by the calling program. The user should not be able to change this value interactively.
18. No_subtotals(1) TYPE c : No subtotals possible
Value set: SPACE, 'X'
'X' = no subtotals.
19. Numc_sum(1) TYPE c : Totals only possible for NUMC-Fields.
20. No_unit_splitting TYPE c: No separate total lines by inh.units
21.totals_before_items TYPE c: Display totals before the items
22. Totals_only(1) TYPE c : Show only totals
Value set: SPACE, 'X'
'X' = only total records are output.
23. Totals_text(60) TYPE c : Text for 1st col. in totals
Value set: SPACE, string (max.60)
' ' = The first column in the total record contains an appropriate number of '*'s to indicate the total by default. If the first column is wide enough, the string 'Total' is output after the asterisks.
'String = The string passed is output after the total indicated by '*', if the column is wide enough.
24. Subtotals_text(60) TYPE c : Texts for subtotals
Value set: SPACE, string (max.60)
' ' = In the first column of subtotal records, the subtotal is indicated by an appropriate number of '*' by default. If the first column is not a subtotal criterion, the string 'Total' is output after the asterisks, if the column is wide enough.
'String = the string passed is output after the subtotal indicated by '*', if the column is wide enough and the first column is not a subtotal criterion. If it is a subtotal criterion, its value is repeated after the total, if the column is wide enough.
ELSE TELL ME I WILL PASTE COMPLETE HELP
regards -
Alv reports sample example req..
can anybody help me out with a simple example regarding ALV Reports.(simple ALV Reports , Blocked ALV Reports & Hierarchy ALV Reports).
or pls send me a word document regarding the same ..to [email protected]
response is highly appreciated..
bye--
PradeepaFollowing document should get you started.
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907">An Easy Reference For ALV Grid Control.pdf</a>
tip : if you do a <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/advancedsearch?query=alv%20grid&cat=sdn_all">search for alv grid</a> on the sdn homepage, this is the first result.
Message was edited by:
Dries Horions -
Refresh ALV Report after return from dialog screen
Hi All,
I have developed an alv report which lists new products, when user clicks on a product it will take to custom dialog screen where user makes neccessary changes. Once the changes are done user clicks back the control comes back to the ALV report.
My question is when they come back to ALV report it should refresh and list the new products. Basically I want to know is it possible to refresh the report when control is coming back from dialog screen to ALV report.
Pls provide me a best way to handle this scenario.
Regards,
AnandHi Archna
This is the code I am using
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
i_callback_user_command = 'USER_COMMAND'
i_callback_top_of_page = 'TOP_OF_PAGE'
i_grid_title = i_title
it_fieldcat = it_fcat
it_events = v_events
i_save = 'A'
TABLES
t_outtab = it_alv_cvg.
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '&IC1'.
READ TABLE it_alv_map INTO wa_alv INDEX rs_selfield-tabindex.
IF sy-subrc = 0.
SET PARAMETER ID 'ZCR' FIELD wa_alv-product.
CALL TRANSACTION 'ZSD_PRODUCT_DIV' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDFORM.
After it goes to dialog when I clcik back it comes back to the alv report.
Now can you Pls tell me where to use the refresh.
Regards,
Anand -
How to download a Block List based ALV report to PDF file?
Hi Everyone,
I need to display a report in block list alv format using REUSE_ALV_BLOCK_LIST_DISPLAY... I have done this. But my problem comes next.
1. I need to download this report to a pdf file in the user given directory - in presentation server. How can I download this in PDF format.
2. My report has TOP_OF_LIST and END_OF_LIST events. The body of the report contains a table with some material data. There should be 1 table for each material no. There are around 50 records for each material no. So I am looping at the material no. and calling REUSE_ALV_BLOCK_LIST_APPEND.
Now my problem is that I should have only 20 records in each page. How can I determine this? How do I put a page-break?
Please anyone help me.Hi Anwesha
You can send the report output to spool using the IS_PRINT parameter of REUSE_ALV_BLOCK_LIST_DISPLAY FM. Then read the spool number generated and pass it to CONVERT_ABAPSPOOLJOB_2_PDF to get the pdf content which could be downloaded to presentation server.
The splitting of records on count could be done by calling above method with different internal table filtered as per your requirement.
Regards
Ranganath -
ALV Block list report FILTERING
Hello All,
I am Working on ALV Block List Report. In that report i am having two Blocks.
if i set a filter for one block it is filtering that block.
My requirment is like this if iam setting a filter for one block, in the second block also have the same field, then filter should be setted to the second block aslo.
Is this possible, Can any one Help me out form this issue.
Thanks,
Feroz.Hello All,
I am Working on ALV Block List Report. In that report i am having two Blocks.
if i set a filter for one block it is filtering that block.
My requirment is like this if iam setting a filter for one block, in the second block also have the same field, then filter should be setted to the second block aslo.
Is this possible, Can any one Help me out form this issue.
Thanks,
Feroz. -
Hi All,
I am trying to displaying BOM explosion for materials in ALV Block list.
I am taking the materials to be exploded from a local file. Taking the contents of the file in an internal table and then passing the parameters like material number bom application , alternative BOM to the function 'CS_BOM_EXPL_MAT_V2'
Then I am calling the functions for ALV Block display for each material.
But when I am displaying the data in the block display , only the BOM explosion for the last material is getting displayed.
I am pasting the code also for ur reference.
REPORT zcs13 .
TABLES:
mara,
stpo,
t001w,
stko.
TYPE-POOLS: slis.
DATA: BEGIN OF it_stb OCCURS 0.
INCLUDE STRUCTURE zstpox.
DATA:END OF it_stb.
DATA: BEGIN OF it_matmaster OCCURS 0,
matnr TYPE matnr,
werks TYPE werks,
stlal type stlal,
capid type capid,
emeng TYPE emeng,
END OF it_matmaster.
DATA : ievent TYPE slis_t_event.
DATA: it_stb2 LIKE stpox OCCURS 0 WITH HEADER LINE,
it_stb3 LIKE stpox OCCURS 0 WITH HEADER LINE,
temp_cat TYPE slis_fieldcat_alv,
sline TYPE slis_listheader,
gt_list_top_of_page TYPE slis_t_listheader,
gs_layout TYPE slis_layout_alv ,
gt_events TYPE slis_t_event,
gt_sort TYPE slis_t_sortinfo_alv,
w_msg(255) TYPE c,
int TYPE i VALUE 0.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-002.
PARAMETERS:p_file LIKE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1 .
CONSTANTS c_x VALUE 'X'.
DATA: w_topmat LIKE cstmat,
fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat TYPE slis_fieldcat_alv.
DATA:v_file TYPE string.
*SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = 'P_FILE'
IMPORTING
file_name = p_file.
START-OF-SELECTION.
v_file = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = v_file
filetype = 'ASC'
has_field_separator = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
data_tab = it_matmaster
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
LOOP AT it_matmaster.
PERFORM explode_assembly.
PERFORM f01_set_layo CHANGING gs_layout.
PERFORM eventtab_build USING ievent.
perform fldcat.
PERFORM display_grid.
ENDLOOP.
PERFORM display_grid.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
EXPORTING
i_interface_check = 'x_print_layout'
IS_PRINT =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
EXCEPTIONS
program_error = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*& Form EXPLODE_ASSEMBLY
text
FORM explode_assembly.
CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
EXPORTING
capid = 'BEST'
cuols = c_x
datuv = sy-datum
emeng = it_matmaster-emeng
knfba = c_x
ksbvo = c_x
mehrs = c_x
mbwls = c_x
mdmps = c_x
mktls = c_x
stlal = it_matmaster-stlal
stlan = p_bomap
mtnrv = it_matmaster-matnr
werks = it_matmaster-werks
svwvo = 'X'
vrsvo = 'X'
IMPORTING
topmat = w_topmat
TABLES
stb = it_stb
EXCEPTIONS
alt_not_found = 1
call_invalid = 2
material_not_found = 3
missing_authorization = 4
no_bom_found = 5
no_plant_data = 6
no_suitable_bom_found = 7
conversion_error = 8
OTHERS = 9.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
INTO w_msg.
WRITE: / w_msg.
EXIT.
ENDIF.
ENDFORM. "explode_assembly
*& Form display_grid
text
--> p1 text
<-- p2 text
form display_grid .
*CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZCS13'
i_callback_top_of_page = 'TOP_OF_PAGE_GRID'
is_layout = gs_layout
it_fieldcat = fieldcat
IT_SORT = GT_SORT[]
i_save = 'A'
it_events = gt_events[]
TABLES
t_outtab = it_stb
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.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = 'ZALVTOTAL'
I_CALLBACK_PF_STATUS_SET = PFSTATUS
i_callback_user_command = 'USER_COMMAND'(001)
IT_EXCLUDING =
*CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = gs_layout
it_fieldcat = i_fieldcat
i_tabname = 'IT_TAB[]'
it_events = gt_events
it_sort = gt_sort
I_TEXT = ' '
TABLES
t_outtab = it_tab[]
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 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.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = gs_layout
it_fieldcat = fieldcat
i_tabname = 'IT_STB[]'
it_events = gt_events
it_sort = gt_sort
I_TEXT = ' '
TABLES
t_outtab = it_stb[]
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 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.
clear it_stb[].
endform. " display_grid
*& Form fldcat
text
--> p1 text
<-- p2 text
form fldcat .
*DATA: wa_fieldcat TYPE slis_fieldcat_alv,
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = 'ZCS13'
I_INTERNAL_TABNAME = 'IT_STB'
i_structure_name = 'ZSTPOX'
I_CLIENT_NEVER_DISPLAY = 'X'
i_inclname = 'ZCS13'
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = 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.
Pls Suggest
Thanks.Hi All,
I am trying to displaying BOM explosion for materials in ALV Block list.
I am taking the materials to be exploded from a local file. Taking the contents of the file in an internal table and then passing the parameters like material number bom application , alternative BOM to the function 'CS_BOM_EXPL_MAT_V2'
Then I am calling the functions for ALV Block display for each material.
But when I am displaying the data in the block display , only the BOM explosion for the last material is getting displayed.
I am pasting the code also for ur reference.
REPORT zcs13 .
TABLES:
mara,
stpo,
t001w,
stko.
TYPE-POOLS: slis.
DATA: BEGIN OF it_stb OCCURS 0.
INCLUDE STRUCTURE zstpox.
DATA:END OF it_stb.
DATA: BEGIN OF it_matmaster OCCURS 0,
matnr TYPE matnr,
werks TYPE werks,
stlal type stlal,
capid type capid,
emeng TYPE emeng,
END OF it_matmaster.
DATA : ievent TYPE slis_t_event.
DATA: it_stb2 LIKE stpox OCCURS 0 WITH HEADER LINE,
it_stb3 LIKE stpox OCCURS 0 WITH HEADER LINE,
temp_cat TYPE slis_fieldcat_alv,
sline TYPE slis_listheader,
gt_list_top_of_page TYPE slis_t_listheader,
gs_layout TYPE slis_layout_alv ,
gt_events TYPE slis_t_event,
gt_sort TYPE slis_t_sortinfo_alv,
w_msg(255) TYPE c,
int TYPE i VALUE 0.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-002.
PARAMETERS:p_file LIKE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1 .
CONSTANTS c_x VALUE 'X'.
DATA: w_topmat LIKE cstmat,
fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat TYPE slis_fieldcat_alv.
DATA:v_file TYPE string.
*SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = 'P_FILE'
IMPORTING
file_name = p_file.
START-OF-SELECTION.
v_file = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = v_file
filetype = 'ASC'
has_field_separator = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
data_tab = it_matmaster
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
LOOP AT it_matmaster.
PERFORM explode_assembly.
PERFORM f01_set_layo CHANGING gs_layout.
PERFORM eventtab_build USING ievent.
perform fldcat.
PERFORM display_grid.
ENDLOOP.
PERFORM display_grid.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
EXPORTING
i_interface_check = 'x_print_layout'
IS_PRINT =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
EXCEPTIONS
program_error = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*& Form EXPLODE_ASSEMBLY
text
FORM explode_assembly.
CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
EXPORTING
capid = 'BEST'
cuols = c_x
datuv = sy-datum
emeng = it_matmaster-emeng
knfba = c_x
ksbvo = c_x
mehrs = c_x
mbwls = c_x
mdmps = c_x
mktls = c_x
stlal = it_matmaster-stlal
stlan = p_bomap
mtnrv = it_matmaster-matnr
werks = it_matmaster-werks
svwvo = 'X'
vrsvo = 'X'
IMPORTING
topmat = w_topmat
TABLES
stb = it_stb
EXCEPTIONS
alt_not_found = 1
call_invalid = 2
material_not_found = 3
missing_authorization = 4
no_bom_found = 5
no_plant_data = 6
no_suitable_bom_found = 7
conversion_error = 8
OTHERS = 9.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
INTO w_msg.
WRITE: / w_msg.
EXIT.
ENDIF.
ENDFORM. "explode_assembly
*& Form display_grid
text
--> p1 text
<-- p2 text
form display_grid .
*CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZCS13'
i_callback_top_of_page = 'TOP_OF_PAGE_GRID'
is_layout = gs_layout
it_fieldcat = fieldcat
IT_SORT = GT_SORT[]
i_save = 'A'
it_events = gt_events[]
TABLES
t_outtab = it_stb
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.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = 'ZALVTOTAL'
I_CALLBACK_PF_STATUS_SET = PFSTATUS
i_callback_user_command = 'USER_COMMAND'(001)
IT_EXCLUDING =
*CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = gs_layout
it_fieldcat = i_fieldcat
i_tabname = 'IT_TAB[]'
it_events = gt_events
it_sort = gt_sort
I_TEXT = ' '
TABLES
t_outtab = it_tab[]
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 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.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = gs_layout
it_fieldcat = fieldcat
i_tabname = 'IT_STB[]'
it_events = gt_events
it_sort = gt_sort
I_TEXT = ' '
TABLES
t_outtab = it_stb[]
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 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.
clear it_stb[].
endform. " display_grid
*& Form fldcat
text
--> p1 text
<-- p2 text
form fldcat .
*DATA: wa_fieldcat TYPE slis_fieldcat_alv,
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = 'ZCS13'
I_INTERNAL_TABNAME = 'IT_STB'
i_structure_name = 'ZSTPOX'
I_CLIENT_NEVER_DISPLAY = 'X'
i_inclname = 'ZCS13'
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = 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.
Pls Suggest
Thanks. -
Hi All,
I want output in below format
***************************Page Heading****************
List heading 1********************
LIST 1
List Footer 1**********************
List heading 2********************
LIST 2
List Footer 2**********************
List heading 3********************
LIST 3
List Footer 3**********************
I am trying with below code for two list but the order of Page heading and List heading 1 is interchanged. Please tell me whats the problem or please correct the part of code cuz of with the order is not coming correct.
<b>code :</b>
*& Report ZTEST_IZHAR
REPORT ZTEST_IZHAR.
Declarations for BLOCK ALV DISPLAY
*--type pools
TYPE-POOLS:slis.
DATA:x_layout TYPE slis_layout_alv,
t_field TYPE slis_t_fieldcat_alv,
*--field catalog
x_fldcat LIKE LINE OF t_field,
*--to hold all the events
t_events TYPE slis_t_event,
x_events TYPE slis_alv_event,
t_sort TYPE slis_t_sortinfo_alv,
x_sort LIKE LINE OF t_sort ,
*--Print Layout
x_print_layout TYPE slis_print_alv.
*----Macro to add field catalog.
*field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN
DEFINE add_catalog.
clear x_fldcat.
x_fldcat-fieldname = &1.
x_fldcat-seltext_m = &2.
x_fldcat-outputlen = &3.
x_fldcat-tech = &4.
x_fldcat-col_pos = &5.
x_fldcat-no_zero = 'X'.
x_fldcat-ddictxt = 'M'.
x_fldcat-datatype = &6.
x_fldcat-ddic_outputlen = &7.
if &6 = 'N'.
x_fldcat-lzero = 'X'.
endif.
*--build field catalog
append x_fldcat to t_field.
END-OF-DEFINITION.
*----- data declerations.
data: v_repid like sy-repid.
data: begin of itab occurs 0,
matnr like mara-matnr,
ernam like mara-ernam,
meins like mara-meins,
end of itab.
data: begin of jtab occurs 0,
matnr like makt-matnr,
maktx like makt-maktx,
end of jtab.
select matnr ernam meins
up to 20 rows
from mara
into table itab.
select matnr maktx
up to 20 rows
from makt
into table jtab.
v_repid = sy-repid.
*DISPLAY alv
Initialize Block
call function 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = v_repid.
*Block 1:
*INITIALIZE
refresh t_field. clear t_field.
refresh t_events.
*field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN
add_catalog:
'MATNR' 'Material' '18' '' '1' 'C' '18',
'ERNAM' 'Created By' '12' '' '2' 'C' '12',
'MEINS' 'Unit' '5' '' '3' 'C' '3'.
*--build table for events TOP OF PAGE.
x_events-form = 'TOP_OF_PAGE'.
x_events-name = slis_ev_top_of_page.
append x_events to t_events.
*--build table for events TOP OF LIST1.
x_events-form = 'TOP_OF_LIST1'.
x_events-name = slis_ev_top_of_list.
append x_events to t_events.
*--build table for events END OF LIST1.
x_events-form = 'END_OF_LIST1'.
x_events-name = slis_ev_end_of_list.
append x_events to t_events.
call function 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = x_layout
it_fieldcat = t_field
i_tabname = 'ITAB'
it_events = t_events
it_sort = t_sort
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 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.
*--BLOCK 2(SUMMARY REPORT)
*INITIALIZE
refresh t_field. clear t_field.
refresh t_events.
*field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN
add_catalog:
'MATNR' 'Material' '20' '' '1' 'C' '18',
'MAKTX' 'Description' '40' '' '2' 'C' '40'.
*--build table for events TOP OF LIST2.
x_events-form = 'TOP_OF_LIST2'.
x_events-name = slis_ev_top_of_list.
append x_events to t_events.
*--build table for events END OF LIST2.
x_events-form = 'END_OF_LIST2'.
x_events-name = slis_ev_end_of_list.
append x_events to t_events.
Append table block.
call function 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = x_layout
it_fieldcat = t_field
i_tabname = 'JTAB'
it_events = t_events
TABLES
t_outtab = jtab
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 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.
*--CALL FM TO DISPLAY THE BLOCK REPORT.
call function 'REUSE_ALV_BLOCK_LIST_DISPLAY'
exporting
is_print = x_print_layout
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
*& Form top_of_PAGE
text
form top_of_page.
skip 1.
WRITE: / '*******************************************'.
WRITE : /10 'TOP OF PAGE'.
WRITE: / '*******************************************'.
skip 1.
perform sub_display_heading.
format reset.
endform. "top_of_list2
*& Form top_of_list1
text
form top_of_list1.
skip 3.
write: /5 'TOP OF LIST 1'.
skip 1.
format reset.
endform. "top_of_list1
*& Form end_of_list2
text
form end_of_list1.
skip 1.
write: /5 'END OF LIST 1'.
skip 1.
format reset.
endform. "top_of_list2
*& Form top_of_list2
text
form top_of_list2.
skip 1.
write: /5 'TOP OF LIST 2'.
skip 1.
format reset.
endform. "top_of_list2
*& Form end_of_list2
text
form end_of_list2.
skip 1.
WRITE: /5 'END OF LIST 2'.
skip 1.
format reset.
endform. "top_of_list2
*& Form sub_display_heading
text
FORM sub_display_heading .
ENDFORM. " sub_display_headingHi ABAP related,
Why dont you debug and see the scene yourself?
Do not accumulate with this record.
Total Questions: 77 (37 unresolved)
Cheers -
Hi All,
iam Using ALV BLOCK list to print the output along with check boxes, iam able to print the output along with the check boxes but when i select any of the check box and click button on application tool bar it is going to dump and saying,
FIELD SYMBOL HAS NOT YET BEEN ASSIGNED.
i populated layout with following fields.
w_layout-box_fieldname = 'BOX'.
w_layout-box_tabname = 'T_FINAL2'.
Plz Help me out.
Thanks in Advance.
Neha*& Report BCALV_TEST_BLOCK_LIST
report bcalv_test_block_list.
types: g_ty_t_carrid type standard table of alv_tab,
g_ty_t_connid type standard table of alv_chck,
g_ty_t_curr type standard table of alv_cur,
g_ty_s_sflight type alv_t_t2,
g_ty_s_carrid type alv_tab,
g_ty_s_connid type alv_chck,
g_ty_s_curr type alv_cur.
constants: con_sflight type lvc_fname value 'ALV_T_T2',
con_scarr type lvc_fname value 'ALV_TAB',
con_spfli type lvc_fname value 'ALV_CHCK',
con_scurx type lvc_fname value 'ALV_CUR',
con_event_01 type lvc_fname value 'PF_STATUS_SET',
con_event_02 type lvc_fname value 'USER_COMMAND',
con_event_03 type lvc_fname value 'CALLER_EXIT',
con_event_04 type lvc_fname value 'LIST_MODIFY',
con_event_05 type lvc_fname value 'BEFORE_LINE_OUTPUT',
con_event_06 type lvc_fname value 'AFTER_LINE_OUTPUT',
con_event_07 type lvc_fname value 'SUBTOTAL_TEXT',
con_event_08 type lvc_fname value 'REPREP_MODIFY',
con_event_09 type lvc_fname value 'TOP_OF_PAGE',
con_event_10 type lvc_fname value 'END_OF_PAGE',
con_event_11 type lvc_fname value 'TOP_OF_LIST',
con_event_12 type lvc_fname value 'END_OF_LIST',
con_event_13 type lvc_fname value 'TOP_OF_COVERPAGE',
con_event_14 type lvc_fname value 'END_OF_COVERPAGE',
con_event_15 type lvc_fname value 'TOP_OF_FOREIGN_PAGE',
con_event_16 type lvc_fname value 'END_OF_FOREIGN_PAGE',
con_event_17 type lvc_fname value 'GROUPLEVEL_CHANGE'.
DATA *
tables: sscrfields. " for processing the FCODEs in Selektion screens
include <icon>.
include <symbol>.
type-pools: slis, kkblo.
types: g_ty_t_icon type standard table of icon,
g_ty_t_icont type standard table of icont,
begin of g_ty_s_plane,
carrid type g_ty_s_sflight-carrid,
connid type g_ty_s_sflight-connid,
planetype type g_ty_s_sflight-planetype,
seatsmax type g_ty_s_sflight-seatsmax,
end of g_ty_s_plane,
g_ty_t_plane type sorted table of g_ty_s_plane
with unique key carrid connid,
begin of g_ty_s_fcat_curr,
fieldname type lvc_fname,
cfieldname type lvc_fname,
currency type lvc_s_fcat-currency,
end of g_ty_s_fcat_curr,
g_ty_t_fcat_curr type sorted table of g_ty_s_fcat_curr
with unique key fieldname,
begin of g_ty_s_sort.
include type slis_sortinfo_alv.
types: end of g_ty_s_sort,
g_ty_t_sort type sorted table of g_ty_s_sort
with unique key spos fieldname,
begin of g_ty_s_test,
list_amount type num1,
select_amount type i,
only_db_info type char1,
db_short type char1,
excp_display type char1,
excp_condense type char1,
layo_title type lvc_s_layo-grid_title,
layo_zebra type char1,
layo_no_vert_lines type char1,
layo_no_horiz_lines type char1,
layo_cell_merge type char1,
layo_count type char1,
layo_box type char1,
layo_no_colhead type char1,
layo_column_optimize type char1,
layo_keys_hotspot type char1,
layo_no_keyfix type char1,
layo_no_hotspot type char1,
layo_hotspot_rows type i occurs 0,
layo_hotspot_columns type lvc_fname occurs 0,
layo_no_scrolling type char1,
layo_no_authcheck type char1,
layo_no_min_linesize type char1,
layo_min_linesize type sylinsz,
layo_max_linesize type sylinsz,
layo_group_change_edit type char1,
layo_get_selinfo type char1,
layo_confirmation_prompt type char1,
layo_f2code type syucomm,
layo_reprep type char1,
sum_before type char1,
sum_no_sumline type char1,
sum_no_sumchoice type char1,
sum_numc type char1,
sum_no_unitsplit type char1,
sum_totals_only type char1,
sum_totals_text type symsgli,
sum_no_subtotals type char1,
sum_no_subchoice type char1,
sum_subtotals_text type symsgli,
prnt_print type char1,
prnt_reserve_lines type lvc_s_prnt-reservelns,
prnt_no_listinfo type char1,
prnt_no_selinfo type char1,
prnt_with_title type char1,
prnt_footline type lvc_s_prnt-footline,
prnt_printinfo type char1,
prnt_no_coverpage type char1,
prnt_no_new_page type char1,
prnt_no_change_print_params type char1,
color_rows type i occurs 0,
color_fields_column type lvc_fname occurs 0,
color_fields_cell type lvc_fname occurs 0,
fcat_no_out_fields type lvc_fname occurs 0,
fcat_tech_fields type lvc_fname occurs 0,
fcat_fix_column_fields type lvc_fname occurs 0,
fcat_do_sum_fields type lvc_fname occurs 0,
fcat_no_sum_fields type lvc_fname occurs 0,
fcat_curr_fields type g_ty_t_fcat_curr,
curr_amount type i,
curr_space type char1,
t_sort type g_ty_t_sort,
no_info_popup type char1,
info_popup_once type char1,
events_info_popup type lvc_fname occurs 0,
events type lvc_fname occurs 0,
buffer_active type char1,
bypassing_buffer type char1,
end of g_ty_s_test,
begin of g_ty_s_outtab.
include type g_ty_s_sflight.
types: list type num1,
box type char1,
count type i,
lights type char1,
checkbox type char1,
hotspot type char1,
color(4) type c,
tabcolor type slis_t_specialcol_alv,
price2 type g_ty_s_sflight-price,
currency2 type g_ty_s_sflight-currency,
char(10) type c,
string type string,
int1 type int1,
int2 type int2,
int4 type int4,
numc(10) type n,
dec(10) type p decimals 2,
fltp type f,
dats type d,
tims type t,
icon type icon-id,
icon_qinfo type icon-name,
symbol type icon-id,
end of g_ty_s_outtab,
g_ty_t_outtab type table of g_ty_s_outtab.
constants: con_true type char1 value 'X',
con_ok type sy-ucomm value 'OK',
con_exit type sy-ucomm value 'EXIT',
con_canc type sy-ucomm value 'CANC',
con_back type sy-ucomm value 'BACK'.
data: gt_outtab1 type g_ty_t_outtab,
gt_outtab2 type g_ty_t_outtab,
gt_outtab3 type g_ty_t_outtab,
gt_outtab4 type g_ty_t_outtab,
gt_outtab5 type g_ty_t_outtab,
gt_outtab6 type g_ty_t_outtab,
gt_outtab7 type g_ty_t_outtab,
gt_outtab8 type g_ty_t_outtab,
gt_outtab9 type g_ty_t_outtab.
data: gt_outtab type g_ty_t_outtab with header line,
gs_test type g_ty_s_test.
data: g_repid type sy-repid.
data: g_field type lvc_s_fcat-fieldname,
g_int_field type i.
CLASS random DEFINITION
class random definition.
public section.
types:
value(16) type p decimals 0,
numcv(15) type n.
constants:
max type random=>value value 4294967295.
class-methods:
computes a random natural number from the set {0, ..., random=>max}.
number returning value(rval) type random=>value,
computes a random character from the set {A-Za-z0-9}
c returning value(rval) type char01,
computes a random string consisting of "len" random characters
string importing len type i
returning value(rval) type string,
computes a date
dats returning value(rval) type d,
computes a time
time returning value(rval) type t,
computes a random numc from the set {low, ..., high}
numc importing low type random=>numcv high type random=>numcv
returning value(rval) type random=>numcv,
computes a random integer from the set {low, ..., high}
i importing low type i high type i
returning value(rval) type i,
computes a random integer from the set {low, ..., high}
int2 importing low type int2 high type int2
returning value(rval) type int2,
computes a random integer from the set {low, ..., high}
int1 importing low type int1 high type int1
returning value(rval) type int1,
computes a random float from the interval [low ; high]
f importing low type f high type f
returning value(rval) type f,
computes a random character from the set {A-F0-9}
hex returning value(rval) type char01,
computes a random character from the set {0-1}
x returning value(rval) type char01,
method "random=>class_constructor"
class_constructor.
private section.
class-data:
precomputed maximal index (= string length - 1) of "random=>chars"
or of "random=>x_data".
charsmax type i,
xmax type i,
random number seed value.
(Used in method "random=>number".)
seed type random=>value.
constants:
characters for class-method "random=>hex"
hex_data(100) type c value 'ABCDEF' &
'0123456789',
characters for class-method "random=>x"
x_data(100) type c value '01',
characters for class-metshod "random=>c"
chars(100) type c value 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' &
'abcdefghijklmnopqrstuvwxyz' &
'0123456789'.
endclass. "random DEFINITION
CLASS random IMPLEMENTATION
class random implementation.
implementation of the methods for randomizing the values
method x.
data: ri type i.
ri = random=>i( low = 0 high = random=>xmax ).
move x_data+ri(1) to rval.
endmethod. "x
method hex.
data: ri type i.
ri = random=>i( low = 0 high = random=>charsmax ).
move hex_data+ri(1) to rval.
endmethod. "hex
method number.
constants:
a(3) type p value 67301, " Coefficient
c(1) type p value 1, " Increment
m(6) type p value 4294967296. " Modulus 2**32
random=>seed = ( a * random=>seed + c ) mod m.
rval = random=>seed.
endmethod. "number
method c.
data:
ri type i.
ri = random=>i( low = 0 high = random=>charsmax ).
move chars+ri(1) to rval.
endmethod. "c
method string.
data:
char(1) type c.
clear rval.
do len times.
char = random=>c( ).
concatenate rval char into rval.
enddo.
endmethod. "string
method dats.
data: l_date type sy-datum,
l_day(2) type n,
l_month(2) type n,
l_year(4) type n,
l_value type random=>numcv,
l_low type random=>numcv,
l_high type random=>numcv.
l_year = sy-datum+0(4).
l_low = l_year - 5.
l_high = l_year + 5.
l_value = random=>numc( low = l_low high = l_high ).
l_year = l_value+11(4).
l_value = random=>numc( low = 1 high = 12 ).
l_month = l_value+13(2).
case l_month.
when 2.
l_high = 28.
when 4 or 6 or 9 or 11.
l_high = 30.
when others.
l_high = 31.
endcase.
l_value = random=>numc( low = 1 high = l_high ).
l_day = l_value+13(2).
l_date+0(4) = l_year.
l_date+4(2) = l_month.
l_date+6(2) = l_day.
rval = l_date.
endmethod. "dats
method time.
data: l_time type t,
l_hour(2) type n,
l_min(2) type n,
l_sec(2) type n,
l_value type random=>numcv.
l_value = random=>numc( low = 0 high = 60 ).
l_sec = l_value+13(2).
l_value = random=>numc( low = 0 high = 60 ).
l_min = l_value+13(2).
l_value = random=>numc( low = 1 high = 24 ).
l_hour = l_value+13(2).
l_time+0(2) = l_hour.
l_time+2(2) = l_min.
l_time+4(2) = l_sec.
rval = l_time.
endmethod. "time
method numc.
Go from {0,...,random=>max} to {low,...,high} with ABAP rounding
data: l_dec(16) type p,
l_char(16) type c.
l_dec = ( ( high - low + 1 ) * random=>number( ) ) / random=>max
+ '0.5'.
subtract 1 from l_dec.
add low to l_dec.
data: lr_type_descr type ref to cl_abap_typedescr,
lr_elem_descr type ref to cl_abap_elemdescr.
lr_type_descr =
cl_abap_typedescr=>describe_by_data( rval ).
lr_elem_descr ?= lr_type_descr.
l_char = l_dec.
shift l_char left deleting leading space.
rval = l_char+0(lr_elem_descr->output_length).
endmethod. "i
method i.
Go from {0,...,random=>max} to {low,...,high} with ABAP rounding
data: l_dec(16) type p,
l_char(16) type c.
l_dec = ( ( high - low + 1 ) * random=>number( ) ) / random=>max
+ '0.5'.
subtract 1 from l_dec.
add low to l_dec.
data: lr_type_descr type ref to cl_abap_typedescr,
lr_elem_descr type ref to cl_abap_elemdescr.
lr_type_descr =
cl_abap_typedescr=>describe_by_data( rval ).
lr_elem_descr ?= lr_type_descr.
l_char = l_dec.
shift l_char left deleting leading space.
rval = l_char+0(lr_elem_descr->output_length).
endmethod. "i
method int2.
Go from {0,...,random=>max} to {low,...,high} with ABAP rounding
data: l_dec(16) type p,
l_char(16) type c.
l_dec = ( ( high - low + 1 ) * random=>number( ) ) / random=>max
+ '0.5'.
subtract 1 from l_dec.
add low to l_dec.
data: lr_type_descr type ref to cl_abap_typedescr,
lr_elem_descr type ref to cl_abap_elemdescr.
lr_type_descr =
cl_abap_typedescr=>describe_by_data( rval ).
lr_elem_descr ?= lr_type_descr.
l_char = l_dec.
shift l_char left deleting leading space.
rval = l_char+0(lr_elem_descr->output_length).
endmethod. "i
method int1.
Go from {0,...,random=>max} to {low,...,high} with ABAP rounding
data: l_dec(16) type p,
l_char(16) type c.
l_dec = ( ( high - low + 1 ) * random=>number( ) ) / random=>max
+ '0.5'.
subtract 1 from l_dec.
add low to l_dec.
data: lr_type_descr type ref to cl_abap_typedescr,
lr_elem_descr type ref to cl_abap_elemdescr.
lr_type_descr =
cl_abap_typedescr=>describe_by_data( rval ).
lr_elem_descr ?= lr_type_descr.
l_char = l_dec.
shift l_char left deleting leading space.
rval = l_char+0(lr_elem_descr->output_length).
endmethod. "i
method f.
Go from {0,...,random=>max} to [low;high]
rval = ( ( high - low ) * random=>number( ) ) / random=>max
+ low.
endmethod. "f
method class_constructor.
charsmax = strlen( chars ) - 1.
xmax = strlen( x_data ) - 1.
seed = 1.
endmethod. "class_constructor
endclass. "random IMPLEMENTATION
SELECTION-SCREEN *
selection-screen begin of block gen with frame.
parameters:
p_amount type i default 30,
p_dbinfo as checkbox,
p_dbshrt as checkbox.
selection-screen end of block gen.
parameters:
p_list type num1 default 3.
selection-screen begin of block tit with frame title text-tit.
parameters:
p_tit01 type lvc_s_layo-grid_title default text-p01. "TITLE
selection-screen end of block tit.
selection-screen begin of block lay with frame title text-lay.
parameters:
p_lay01 as checkbox. "ZEBRA
selection-screen skip.
parameters:
p_lay02 as checkbox, "NO HORIZONTAL LINES
p_lay03 as checkbox. "NO VERTICAL LINES
selection-screen skip.
parameters:
p_lay04 as checkbox. "NO SCROLLING
selection-screen skip.
parameters:
p_lay06 type syucomm, "F2CODE
p_lay07 as checkbox. "CONFIRMATION PROMPT
selection-screen end of block lay.
selection-screen begin of block spa with frame title text-spa.
parameters:
p_spa01 as checkbox, "BOX
p_spa02 as checkbox, "COUNT FELD
p_spa03 as checkbox, "NO COLUMN HEADERS
p_spa04 as checkbox. "COLUMN OPTIMIZE
selection-screen begin of block hot with frame title text-hot.
parameters:
p_hot01 as checkbox. "NO HOTSPOT
parameters:
p_hot02 as checkbox. "Hotspot auf Zeilenebene
select-options:
p_hotf02 for g_int_field no intervals default 1.
parameters:
p_hot03 as checkbox.
select-options:
p_hotf03 for g_field no intervals.
selection-screen end of block hot.
selection-screen begin of block mrg with frame title text-mrg.
parameters:
p_mrg01 radiobutton group mrge, "Default
p_mrg02 radiobutton group mrge, "kein Merge
p_mrg03 radiobutton group mrge. "Merge
selection-screen end of block mrg.
selection-screen begin of block out with frame title text-out.
parameters:
p_out01 as checkbox.
select-options:
p_outf01 for g_field no intervals.
selection-screen end of block out.
selection-screen begin of block tec with frame title text-tec.
parameters:
p_tec01 as checkbox.
select-options:
p_tecf01 for g_field no intervals.
selection-screen end of block tec.
selection-screen begin of block fix with frame title text-fix.
parameters:
p_fix01 as checkbox.
select-options:
p_fixf01 for g_field no intervals.
selection-screen end of block fix.
selection-screen begin of block txt with frame title text-txt.
selection-screen pushbutton /1(50) text-pb2 user-command pb02.
selection-screen end of block txt.
selection-screen begin of block cur with frame title text-cur.
parameters:
p_curanz type i,
p_curspc as checkbox default space.
selection-screen skip.
select-options:
p_curf00 for g_field no intervals.
parameters:
p_cur01 radiobutton group cur default 'X',
p_curf01 type lvc_s_fcat-fieldname.
parameters:
p_cur02 radiobutton group cur,
p_curf02 type g_ty_s_sflight-currency.
selection-screen end of block cur.
selection-screen begin of block sort with frame title text-srt.
selection-screen pushbutton /1(20) text-pb1 user-command pb01.
selection-screen end of block sort.
selection-screen end of block spa.
selection-screen begin of block key with frame title text-key.
parameters:
p_key01 as checkbox, "KEYFELDER ALS HOTSPOT
p_key02 as checkbox. "NO KEY FIXIERUNG
selection-screen end of block key.
selection-screen begin of block exp with frame title text-exp.
parameters:
p_excp01 as checkbox, "EXCEPTION
p_excp_c as checkbox. "EXCEPTION CONDENSE
selection-screen end of block exp.
selection-screen begin of block sum with frame title text-sum.
parameters:
p_sum01 as checkbox, "SUM BEFORE
p_sum02 as checkbox, "NUMC
p_sum03 as checkbox, "NO UNITSPLIT
p_sum04 as checkbox, "TOTALS ONLY
p_sum05 as checkbox, "NO SUMCHOICE
p_sum06 as checkbox, "NO SUMLINE
p_sum07 type sy-msgli, "TOTALS TEXT
p_sum08 as checkbox, "NO SUBCHOICE
p_sum09 as checkbox, "NO SUBTOTALS
p_sum10 type sy-msgli. "SUBTOTALS TEXT
selection-screen begin of block dos with frame title text-dos.
parameters:
p_dos01 as checkbox.
select-options:
p_dosf01 for g_field no intervals.
selection-screen end of block dos.
selection-screen begin of block nos with frame title text-nos.
parameters:
p_nos01 as checkbox.
select-options:
p_nosf01 for g_field no intervals.
selection-screen end of block nos.
selection-screen end of block sum.
selection-screen begin of block col with frame title text-col.
parameters:
p_col01 as checkbox.
select-options:
p_colf01 for g_int_field no intervals default 1.
parameters:
p_col02 as checkbox.
select-options:
p_colf02 for g_field no intervals.
parameters:
p_col03 as checkbox.
select-options:
p_colf03 for g_field no intervals.
selection-screen end of block col.
selection-screen begin of block prn with frame title text-prn.
parameters:
p_lpr01 as checkbox default 'X'. "GROUP CHANGE EDIT
selection-screen skip.
parameters:
p_lpr02 as checkbox. "GET SELINFO
selection-screen skip.
parameters:
p_lpr03 as checkbox, "NO MIN LINESIZE
p_lpr04 type sylinsz, "MIN LINESIZE
p_lpr05 type sylinsz. "MAX LINESIZE
selection-screen skip.
parameters:
p_prn01 as checkbox, "PRINT
p_prn02 type lvc_s_prnt-reservelns, "RESERVE LINES
p_prn03 as checkbox, "NO LISTINFO
p_prn04 as checkbox, "NO SELINFO
p_prn05 as checkbox, "TITEL
p_prn06 type lvc_s_prnt-footline, "FOOTLINE
p_prn07 as checkbox, "PRINT INFO
p_prn08 as checkbox, "NO COVERPAGE
p_prn09 as checkbox, "NO NEW PAGE
p_prn10 as checkbox. "NO CHANGE PRINT PARAMS
selection-screen end of block prn.
selection-screen begin of block evt with frame.
parameters:
p_evt01 as checkbox, "PF_STATUS_SET
p_evt02 as checkbox. "USER_COMMAND
selection-screen skip.
parameters:
p_evt03 as checkbox, "CALLER_EXIT
p_evt04 as checkbox, "LIST_MODIFY
p_evt05 as checkbox, "BEFORE_LINE_OUTPUT
p_evt06 as checkbox. "AFTER_LINE_OUTPUT
selection-screen skip.
parameters:
p_evt07 as checkbox, "SUBTOTAL_TEXT
p_evt08 as checkbox. "REPREP_SEL_MODIFY
selection-screen skip.
parameters:
p_evt09 as checkbox, "TOP_OF_PAGE
p_evt10 as checkbox, "END_OF_PAGE
p_evt11 as checkbox, "TOP_OF_LIST
p_evt12 as checkbox. "END_OF_LIST
selection-screen skip.
parameters:
p_evt13 as checkbox, "TOP_OF_COVERPAGE
p_evt14 as checkbox. "END_OF_COVERPAGE
selection-screen skip.
parameters:
p_evt15 as checkbox, "FOREIGN_TOP_OF_PAGE
p_evt16 as checkbox. "FOREIGN_END_OF_PAGE
selection-screen skip.
parameters:
p_evt17 as checkbox. "GROUPLEVEL_CHANGE
selection-screen end of block evt.
INITIALIZATION *
initialization.
perform f01_f4_field using 'SUM' space changing p_dosf01-low.
p_dosf01-option = 'EQ'.
p_dosf01-sign = 'I'.
append p_dosf01.
perform f01_f4_field using 'SUM' space changing p_nosf01-low.
p_nosf01-option = 'EQ'.
p_nosf01-sign = 'I'.
append p_nosf01.
perform f01_f4_field using 'KEY' space changing p_outf01-low.
p_outf01-option = 'EQ'.
p_outf01-sign = 'I'.
append p_outf01.
perform f01_f4_field using space space changing p_tecf01-low.
p_tecf01-option = 'EQ'.
p_tecf01-sign = 'I'.
append p_tecf01.
perform f01_f4_field using space space changing p_fixf01-low.
p_fixf01-option = 'EQ'.
p_fixf01-sign = 'I'.
append p_fixf01.
perform f01_f4_field using 'CURR' space changing p_curf00-low.
p_curf00-option = 'EQ'.
p_curf00-sign = 'I'.
append p_curf00.
perform f01_f4_field using 'CUKY' space changing p_curf01.
perform f01_f4_field using space space changing p_hotf03-low.
p_hotf03-option = 'EQ'.
p_hotf03-sign = 'I'.
append p_hotf03.
perform f01_f4_field using space space changing p_colf02-low.
p_colf02-option = 'EQ'.
p_colf02-sign = 'I'.
append p_colf02.
perform f01_f4_field using space space changing p_colf03-low.
p_colf03-option = 'EQ'.
p_colf03-sign = 'I'.
append p_colf03.
AT SELECTION-SCREEN *
at selection-screen.
case sscrfields-ucomm.
when 'PB01'.
call screen 1001 starting at 1 1 ending at 80 20.
when 'PB02'.
call screen 1002 starting at 1 1 ending at 80 20.
endcase.
AT SELECTION-SCREEN ON VALUE-REQUEST *
at selection-screen on value-request for p_dosf01-low.
perform f01_f4_field using 'SUM' 'X' changing p_dosf01-low.
at selection-screen on value-request for p_nosf01-low.
perform f01_f4_field using 'SUM' 'X' changing p_nosf01-low.
at selection-screen on value-request for p_outf01-low.
perform f01_f4_field using 'KEY' 'X' changing p_outf01-low.
at selection-screen on value-request for p_tecf01-low.
perform f01_f4_field using space 'X' changing p_tecf01-low.
at selection-screen on value-request for p_fixf01-low.
perform f01_f4_field using space 'X' changing p_fixf01-low.
at selection-screen on value-request for p_curf00-low.
perform f01_f4_field using 'CURR' 'X' changing p_curf00-low.
at selection-screen on value-request for p_curf01.
perform f01_f4_field using 'CUKY' 'X' changing p_curf01.
at selection-screen on value-request for p_hotf03-low.
perform f01_f4_field using space 'X' changing p_hotf03-low.
at selection-screen on value-request for p_colf02-low.
perform f01_f4_field using space 'X' changing p_colf02-low.
at selection-screen on value-request for p_colf03-low.
perform f01_f4_field using space 'X' changing p_colf03-low.
at selection-screen on value-request for p_lay06.
perform f01_f4_fcode using space
space
changing p_lay06.
START-OF-SELECTION *
start-of-selection.
g_repid = sy-repid.
gs_test-select_amount = p_amount.
gs_test-only_db_info = p_dbinfo.
gs_test-db_short = p_dbshrt.
gs_test-list_amount = p_list.
gs_test-layo_title = p_tit01.
gs_test-layo_zebra = p_lay01.
gs_test-layo_no_horiz_lines = p_lay02.
gs_test-layo_no_vert_lines = p_lay03.
gs_test-layo_no_scrolling = p_lay04.
gs_test-layo_f2code = p_lay06.
gs_test-layo_confirmation_prompt = p_lay07.
gs_test-layo_box = p_spa01.
gs_test-layo_count = p_spa02.
gs_test-layo_no_colhead = p_spa03.
gs_test-layo_column_optimize = p_spa04.
gs_test-layo_no_hotspot = p_hot01.
if p_hot02 eq con_true.
loop at p_hotf02.
if not p_hotf02-low is initial.
append p_hotf02-low to gs_test-layo_hotspot_rows.
endif.
endloop.
endif.
if p_hot03 eq con_true.
loop at p_hotf03.
if not p_hotf03-low is initial.
append p_hotf03-low to gs_test-layo_hotspot_columns.
endif.
endloop.
endif.
case con_true.
when p_mrg01.
gs_test-layo_cell_merge = space.
when p_mrg02.
gs_test-layo_cell_merge = 'N'.
when p_mrg03.
gs_test-layo_cell_merge = 'Y'.
endcase.
if p_out01 eq con_true.
loop at p_outf01.
if not p_outf01-low is initial.
append p_outf01-low to gs_test-fcat_no_out_fields.
endif.
endloop.
endif.
if p_tec01 eq con_true.
loop at p_tecf01.
if not p_tecf01-low is initial.
append p_tecf01-low to gs_test-fcat_tech_fields.
endif.
endloop.
endif.
if p_fix01 eq con_true.
loop at p_fixf01.
if not p_fixf01-low is initial.
append p_fixf01-low to gs_test-fcat_fix_column_fields.
endif.
endloop.
endif.
gs_test-curr_amount = p_curanz.
gs_test-curr_space = p_curspc.
if p_cur01 eq con_true or p_cur02 eq con_true.
data: ls_fcat_curr type g_ty_s_fcat_curr.
loop at p_curf00.
clear ls_fcat_curr.
if not p_curf00-low is initial.
ls_fcat_curr-fieldname = p_curf00-low.
case con_true.
when p_cur01.
ls_fcat_curr-cfieldname = p_curf01.
when p_cur02.
ls_fcat_curr-currency = p_curf02.
endcase.
append ls_fcat_curr to gs_test-fcat_curr_fields.
endif.
endloop.
endif.
gs_test-layo_keys_hotspot = p_key01.
gs_test-layo_no_keyfix = p_key02.
gs_test-excp_display = p_excp01.
gs_test-excp_condense = p_excp_c.
gs_test-sum_before = p_sum01.
gs_test-sum_numc = p_sum02.
gs_test-sum_no_unitsplit = p_sum03.
gs_test-sum_totals_only = p_sum04.
gs_test-sum_no_sumchoice = p_sum05.
gs_test-sum_no_sumline = p_sum06.
gs_test-sum_totals_text = p_sum07.
gs_test-sum_no_subchoice = p_sum08.
gs_test-sum_no_subtotals = p_sum09.
gs_test-sum_subtotals_text = p_sum10.
if p_dos01 eq con_true.
loop at p_dosf01.
if not p_dosf01-low is initial.
append p_dosf01-low to gs_test-fcat_do_sum_fields.
endif.
endloop.
endif.
if p_nos01 eq con_true.
loop at p_nosf01.
if not p_nosf01-low is initial.
append p_nosf01-low to gs_test-fcat_no_sum_fields.
endif.
endloop.
endif.
gs_test-layo_group_change_edit = p_lpr01.
gs_test-layo_get_selinfo = p_lpr02.
gs_test-layo_no_min_linesize = p_lpr03.
gs_test-layo_min_linesize = p_lpr04.
gs_test-layo_max_linesize = p_lpr05.
gs_test-prnt_print = p_prn01.
gs_test-prnt_reserve_lines = p_prn02.
gs_test-prnt_no_listinfo = p_prn03.
gs_test-prnt_no_selinfo = p_prn04.
gs_test-prnt_with_title = p_prn05.
gs_test-prnt_footline = p_prn06.
gs_test-prnt_printinfo = p_prn07.
gs_test-prnt_no_coverpage = p_prn08.
gs_test-prnt_no_new_page = p_prn09.
gs_test-prnt_no_change_print_params = p_prn10.
if p_col01 eq con_true.
loop at p_colf01.
if not p_colf01-low is initial.
append p_colf01-low to gs_test-color_rows.
endif.
endloop.
endif.
if p_col02 eq con_true.
loop at p_colf02.
if not p_colf02-low is initial.
append p_colf02-low to gs_test-color_fields_column.
endif.
endloop.
endif.
if p_col03 eq con_true.
loop at p_colf03.
if not p_colf03-low is initial.
append p_colf03-low to gs_test-color_fields_cell.
endif.
endloop.
endif.
if p_evt01 eq con_true.
append con_event_01 to gs_test-events.
endif.
if p_evt02 eq con_true.
append con_event_02 to gs_test-events.
endif.
if p_evt03 eq con_true.
append con_event_03 to gs_test-events.
endif.
if p_evt04 eq con_true.
append con_event_04 to gs_test-events.
endif.
if p_evt05 eq con_true.
append con_event_05 to gs_test-events.
endif.
if p_evt06 eq con_true.
append con_event_06 to gs_test-events.
endif.
if p_evt07 eq con_true.
append con_event_07 to gs_test-events.
endif.
if p_evt08 eq con_true.
append con_event_08 to gs_test-events.
endif.
if p_evt09 eq con_true.
append con_event_09 to gs_test-events.
endif.
if p_evt10 eq con_true.
append con_event_10 to gs_test-events.
endif.
if p_evt11 eq con_true.
append con_event_11 to gs_test-events.
endif.
if p_evt12 eq con_true.
append con_event_12 to gs_test-events.
endif.
if p_evt13 eq con_true.
append con_event_13 to gs_test-events.
endif.
if p_evt14 eq con_true.
append con_event_14 to gs_test-events.
endif.
if p_evt15 eq con_true.
append con_event_15 to gs_test-events.
endif.
if p_evt16 eq con_true.
append con_event_16 to gs_test-events.
endif.
if p_evt17 eq con_true.
append con_event_17 to gs_test-events.
endif.
gs_test-buffer_active = space.
gs_test-bypassing_buffer = space.
END-OF-SELECTION *
end-of-selection.
perform f01_call_list.
*& Form f01_call_list
text
form f01_call_list .
data: ls_prnt type slis_print_alv,
lt_excl type slis_t_extab,
l_exit type char1,
ls_exit type slis_exit_by_user,
l_list type num1.
call function 'REUSE_ALV_BLOCK_LIST_INIT'
exporting
i_callback_program = g_repid
i_callback_pf_status_set = ' '
i_callback_user_command = ' '
it_excluding = lt_excl.
do gs_test-list_amount times.
add 1 to l_list.
perform f01_append_list using l_list.
enddo.
perform f01_set_prnt changing ls_prnt.
call function 'REUSE_ALV_BLOCK_LIST_DISPLAY'
exporting
i_interface_check = ' '
is_print = ls_prnt
i_screen_start_column = 0
i_screen_start_line = 0
i_screen_end_column = 0
i_screen_end_line = 0
importing
e_exit_caused_by_caller = l_exit
es_exit_caused_by_user = ls_exit
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. " f01_call_list
*& Form f01_append_list
text
form f01_append_list using value(i_list) type num1.
data: ls_layo type slis_layout_alv,
lt_fcat type slis_t_fieldcat_alv,
lt_sort type slis_t_sortinfo_alv,
lt_evts type slis_t_event,
l_tabname type slis_tabname.
field-symbols: <l_table> type any.
perform f01_get_outtab using i_list.
case i_list.
when 1.
gt_outtab1 = gt_outtab[].
when 2.
gt_outtab2 = gt_outtab[].
when 3.
gt_outtab3 = gt_outtab[].
when 4.
gt_outtab4 = gt_outtab[].
when 5.
gt_outtab5 = gt_outtab[].
when 6.
gt_outtab6 = gt_outtab[].
when 7.
gt_outtab7 = gt_outtab[].
when 8.
gt_outtab8 = gt_outtab[].
when 9.
gt_outtab9 = gt_outtab[].
endcase.
perform f01_set_layo changing ls_layo.
perform f01_set_fcat changing lt_fcat.
perform f01_set_evts changing lt_evts.
concatenate 'LIST_' i_list into l_tabname.
case i_list.
when 1.
call function 'REUSE_ALV_BLOCK_LIST_APPEND'
exporting
is_layout = ls_layo
it_fieldcat = lt_fcat
i_tabname = l_tabname
it_events = lt_evts
it_sort = lt_sort
i_text = 'Hello' "#EC NOTEXT
tables
t_outtab = gt_outtab1
exceptions
program_error = 1
maximum_of_appends_reached = 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.
when 2.
call function 'REUSE_ALV_BLOCK_LIST_APPEND'
exporting
is_layout = ls_layo
it_fieldcat = lt_fcat
i_tabname = l_tabname
it_events = lt_evts
it_sort = lt_sort
i_text = 'Hello' "#EC NOTEXT
tables
t_outtab = gt_outtab2
exceptions
program_error = 1
maximum_of_appends_reached = 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.
when 3.
call function 'REUSE_ALV_BLOCK_LIST_APPEND'
exporting
is_layout = ls_layo
it_fieldcat = lt_fcat
i_tabname = l_tabname
it_events = lt_evts
it_sort = lt_sort
i_text = 'Hello' "#EC NOTEXT
tables
t_outtab = gt_outtab3
exceptions
program_error = 1
maximum_of_appends_reached = 2
others = 3.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-ms -
HI,
I have a Requirement where i have a Block list ALV . I have 4 blocks to be Displayed in the output and the output has to be transfered to the PDF.
I am able to get the 4 blocks in the output and the Top of Page for the Report in each page.
But the Problem is when i download the output containing the top of page of output with 4 blocks into a PDF.
I want the Top of page of Report to be the Top of Page of the PDf also.
In PDF the Top of page of Report is coming in the center of the PDF also in some other places also.
How to make sure the Top of page of Report comes in the top of the PDf
Can you kinldy help me in this.
Thanks,
GokulDuplicate post.
Reported. -
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. -
Block List ALV Output Send As Email Attachment
Hi, All The ABAP Gurus,
I have made a block ALV Report. I want that this output should be converted into .xls with HTML format and this should be send in email as attachment. This all will be made in a background job which will be scheduled daily.
How can I achieve this? I know that the output of classical report can be attached as pdf in email.But I want in Block ALV.
Thanks in Advance.
Regards,
Bharti Jain
Edited by: Bharti Jain on Jun 28, 2011 10:20 AMHi
Not 100 percent sure what you want to do here. I am confused by the .xls in html format. If you want the output in html you can submit the program and export the list to memory, Then retrieve the list and convert it to html. i have done this with the program 1sdbf12l/rv14akzy . see code below. This converts the output to html, you are left with a binary itab and size at the end of the routine and this can be attached to an email.
Submit Program and export the list to Memory
SUBMIT /1sdbf12l/rv14akzy USING SELECTION-SCREEN '1000'
WITH SELECTION-TABLE lt_params_new EXPORTING LIST TO MEMORY AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = lt_list
EXCEPTIONS
not_found = 1
OTHERS = 2.
Convert the List to html
IF sy-subrc = 0.
DATA: it_html TYPE TABLE OF bapihtml WITH HEADER LINE,
it_html_out TYPE TABLE OF bapihtml WITH HEADER LINE,
lt_html TYPE TABLE OF bapihtml WITH HEADER LINE,
lv_html LIKE LINE OF it_html,
lv_html_out TYPE string.
DATA: lv_html_tab_wide(50000) TYPE c.
DATA: lineno TYPE i, length TYPE i, size TYPE i.
DATA: gui_codepage(4) TYPE n, " added for message 500824
is_unicode TYPE rststype-sel_ok.
DATA: convert_output TYPE xstring,
convert_buffer TYPE xstring.
CALL FUNCTION 'LIST_FREE_MEMORY'
TABLES
listobject = lt_list.
CALL FUNCTION 'WWW_HTML_FROM_LISTOBJECT'
EXPORTING
REPORT_NAME =
template_name = 'WEBREPORTING_REPORT'
TABLES
html = it_html
listobject = lt_list.
DESCRIBE TABLE it_html LINES lineno .
DESCRIBE FIELD it_html LENGTH length IN BYTE MODE.
size = length * lineno.
CALL 'CUR_LCL' ID 'GUICP' FIELD gui_codepage.
CALL FUNCTION 'SCP_GET_CODEPAGE_PROPERTIES'
EXPORTING
codepage = gui_codepage
IMPORTING
can_unicode = is_unicode
EXCEPTIONS
codepage_unknown = 1.
IF sy-subrc <> 0.
CLEAR gui_codepage.
ENDIF.
IF is_unicode EQ 'X'. "in case of unicode, always use utf-8
gui_codepage = '4110'.
ENDIF.
CLEAR: convert_output, convert_buffer.
LOOP AT it_html INTO lv_html.
REPLACE ALL OCCURRENCES OF c_bg_def IN lv_html WITH c_bg_white.
CALL FUNCTION 'SCP_TRANSLATE_CHARS'
EXPORTING
inbuff = lv_html
outcode = gui_codepage
csubst = 'X'
substc_space = 'X'
IMPORTING
outbuff = convert_output
EXCEPTIONS
invalid_codepage = 1
internal_error = 2
cannot_convert = 3
fields_bad_type = 4
OTHERS = 5.
IF sy-subrc <> 0.
message i020 raising download_error.
ENDIF.
CONCATENATE convert_buffer convert_output INTO convert_buffer IN
BYTE MODE.
CONCATENATE lv_html_out lv_html INTO lv_html_out.
ENDLOOP.
ev_html_string = lv_html_out.
i = 0.
DESCRIBE FIELD html_tab_converted LENGTH tablength IN BYTE MODE.
WHILE i < XSTRLEN( convert_buffer ).
dummy = XSTRLEN( convert_buffer ) - i.
IF tablength > dummy.
html_tab_converted-line = convert_buffer+i(dummy).
ELSE.
html_tab_converted-line = convert_buffer+i(tablength).
ENDIF.
i = i + tablength.
APPEND html_tab_converted.
ENDWHILE.
et_bin[] = html_tab_converted[].
ev_bin_size = size.
Maybe you are looking for
-
Account determination error - in creation of invoice
Hello experts, i have an error in creation of invoice, after( pgi post goods issue) will you please help me out to solve this error. thanks & Regards, yogesh raina
-
I cannot download Lightroom CC because it does not show up on my Creative Cloud Application Manager. How do I fix this? I have Windows 8 and am currently using the entire Adobe Suite Package for my account.
-
Adobe LiveCycle Developer- URGENT NEED- Timonium, MD
I have the following position available. If you are interested or know anyone who is please forward resume and contact information to Lisa Green: [email protected] OVERVIEW: The LiveCycle Developer is responsible for providing administration, technic
-
Abap Objects generating List Trees and Grids
Hi Friends, Please provide me the Information for how to work with ABAP OBJECTS creating(and manipulating)the combination of List Trees and Grids. Regards, Sowjanya
-
How to set notification for latest patch updates from Oracle?
Is there a link to receive notification from Oracle about the latest patch updates on OBIEE or BI Apps?