What is blocked alv
can any one explain me what is a blocked alv
Message was edited by:
ameen shaik
hi
This report is used if you have to display more than one report on the output. Technically speaking if you have multiple internal table with data to be displayed as separate blocks then we go for block report of ALV
This looks like a simple report but this report has the features of sorting
and filtering only.
The important functions used for creating this report are:
A. REUSE_ALV_BLOCK_LIST_INIT
B. REUSE_ALV_BLOCK_LIST_APPEND
C. REUSE_ALV_BLOCK_LIST_DISPLAY
check with this report
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.
x_events-form = 'TOP_OF_LIST1'.
x_events-name = slis_ev_top_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.
x_events-form = 'TOP_OF_LIST2'.
x_events-name = slis_ev_top_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_list1.
skip 1.
write: 10 'List 1',
/5 '----
skip 1.
format reset.
endform.
form top_of_list2.
skip 1.
write: 10 'List 2',
/5 '----
skip 1.
format reset.
endform.
and this link
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/abap-ProgramforALVBlocklist&
Hope this helps to solve ur problem....
do reward if useful....
regards
dinesh
Similar Messages
-
hi experts,
i have tried to subtotal in blocked alv. i used the coding for sorting in grid display. its working in FM reuse_alv_grid_display.
but its not working in blocked alv, i.e., in FM reuse_alv_block_list_append .
so what to do ?
kind regards,
debendrahi all,
yes my question has been answered.
as per below.
have to maintain this line : WA_SORT-TABNAME = 'IT_MUSTER'
where IT_MUSTER is the table name.
FORM APPEND USING FTAB TYPE C FDATA TYPE STANDARD TABLE.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = layout
IT_FIELDCAT = it_fcat
I_TABNAME = FTAB
IT_EVENTS = it_event
IT_SORT = IT_SORT
TABLES
T_OUTTAB = FDATA.
ENDFORM.
Form sort.
WA_SORT-TABNAME = 'IT_MUSTER'.
wa_sort-fieldname = 'MON'.
wa_sort-SUBTOT = 'X'.
append wa_sort to it_sort.
clear wa_sort.
Endform.
ragards,
debendra -
Save layout option for Block Alv
Hi,
Small Question,
Is there any way to enable Save layout(Ctrl+F10) option for Block ALV?As i cannot see any option to do so with Reuse_*Block like i_save in Grid and For list ALVs...FM.And its by default it is Disable.
Any Hints?
Cheers,
Amit.That's what i already investigated(Small).
wanted Just to confirm.Anyways thanks.
@Gautham:I already found that link([And this also |/message/702997#702997 [original link is broken];) but thought After 2 and
half yrs Vijay found any solution and would land with any solution as always
Anyways Thanks Vijay And Gautham.
Cheers,
Amit. -
END OF PAGE IN BLOCK ALV : PLZ HELP
Hi experts.
I have a requirement to display top-of-page end-of-page end-of-list in block alv but the problem is that end-of-page is not getting triggered instead top-of-page is getting triggered twice.
Below is the code for your reference :
REPORT zbhr_workers_comp_report
LINE-COUNT 60(4)
LINE-SIZE 999
NO STANDARD PAGE HEADING
MESSAGE-ID zmhr.
*//// This is how event table is getting populated:*
FORM events_get1 CHANGING t1_events TYPE slis_t_event.
DATA:ls1_events TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
IMPORTING
et_events = t1_events.
READ TABLE t1_events INTO ls1_events WITH KEY name = slis_ev_top_of_page.
IF sy-subrc = 0.
MOVE c_form_top_of_page TO ls1_events-form.
APPEND ls1_events TO t1_events.
modify t1_events FROM ls1_events INDEX sy-tabix TRANSPORTING form.
CLEAR ls1_events.
ENDIF.
READ TABLE t1_events INTO ls1_events WITH KEY name = slis_ev_end_of_page.
IF sy-subrc = 0.
MOVE c_form_end_of_page TO ls1_events-form.
APPEND ls1_events TO t1_events.
modify t1_events FROM ls1_events INDEX sy-tabix TRANSPORTING form.
CLEAR ls1_events.
ENDIF.
READ TABLE t1_events INTO ls1_events WITH KEY name = slis_ev_end_of_list.
IF sy-subrc = 0.
MOVE c_form_end_of_list TO ls1_events-form.
APPEND ls1_events TO t1_events.
modify t1_events FROM ls1_events INDEX sy-tabix TRANSPORTING form.
CLEAR ls1_events.
ENDIF.
ENDFORM. " EVENTS_GET1
FORM : TOP_OF_PAGE
FORM top_of_page.
WRITE : /45 text-020, 65(5) text-021 , 71(11) v_begda, 84(3) text-022 , 89(11) v_endda.
ENDFORM. "TOP_OF_PAGE
FORM : end_of_page
FORM end_of_page.
DATA: lv_process TYPE i.
CLEAR: lv_process.
LOOP AT t_final_temp INTO w_final_temp where customer = t_final-customer.
lv_process = lv_process + 1.
ENDLOOP.
*RESERVE 3 LINES.
WRITE: /4 'Number of read Record : '(023), v_total_read.
WRITE: /4 'Number of processed Record : '(024), lv_process.
ENDFORM. "end_of_page
FORM : end_of_list
FORM end_of_list .
v_total_process = LINES( t_final[] ).
WRITE: /4 'Total sum of all processed data: '(029), v_total_process.
ENDFORM. "end_of_list
*****Displaying the block alv.
FORM display_output .
To restrict the display of sel info and list info.
st_print-no_print_selinfos = 'X'.
st_print-no_print_listinfos = 'X'.
st_print-reserve_lines = 2. " Lines reserved for end of page
Initialize ALV Block List
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = sy-repid.
Append the ALV Block list with table t_final.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = w1_layout
it_fieldcat = t1_fieldcat
i_tabname = 'T_FINAL'
it_events = t1_events
it_sort = t_sort
TABLES
t_outtab = t_final
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.
Append the ALV Block list with table t_msg_display.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = w2_layout
it_fieldcat = t2_fieldcat
i_tabname = 'T_MSG_DISPLAY'
it_events = t2_events
TABLES
t_outtab = t_msg_display
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_DISPLAY'
EXPORTING
i_interface_check = ' '
is_print = st_print
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_OUTPUT
Above is the core logic which I have used for displaying top-of-page end-of-page and end-of-list in block alv.
Please Help
Regards
Arvind.Hi
MOVE 'TOP_OF_PAGE' TO ls1_events-form.
what is thie c_form_top_of_page instead write as above ,i hope it will work
Regards
Pavan -
hi,
I'm working with Blocked ALV. In my program, passed the Fieldcatlog-do_sum = 'X' . But then also i'm not getting totals. For that what i want to do in Blocked ALV.
Regards,
BabHi,
For ALV Totals you can try doing,
DATA : it_field TYPE slis_t_fieldcat_alv,
wa_field TYPE slis_fieldcat_alv.
DATA: itab_sort TYPE slis_t_sortinfo_alv,
wa_sort TYPE slis_sortinfo_alv.
wa_field-fieldname = 'MENGE'.
wa_field-tabname = 'IT_TAB'.
wa_field-outputlen = 20.
wa_field-seltext_l ='Quantity'.
wa_field-input = ' '.
wa_field-edit = ' '.
wa_field-col_pos = '4'.
wa_field-hotspot = 'X'.
wa_field-do_sum = 'X'. "For totalling
APPEND wa_field TO it_field.
CLEAR wa_field.
*Manintainig internal table for sorting
wa_sort-spos = 1.
wa_sort-fieldname = 'EBELP'.
wa_sort-tabname = 'IT_tab'.
wa_sort-up = 'X'.
wa_sort-subtot = 'X'. "For totalling
APPEND wa_sort TO itab_sort.
CLEAR wa_sort.
Then you can pass these two internal tables in Reuse ALV grid Function Module.
Hope it helps
Regards
Mansi -
hi,
in blocked alv list , i want add push button on application tool bar. any one please tell me what is the process.?
last time i added one push button on alv grid display, same process i followed now, but i did not get push button on application tool bar of , blocked alv list.I am able to add it , what is the problem you are facing.
Check the Program BALVBT01.
call function 'REUSE_ALV_BLOCK_LIST_INIT'
exporting
i_callback_program = repid
i_callback_user_command = 'USER_COMMAND'
i_callback_pf_status_set = 'STATUS'. "<------Status
form pf_status_set using extab type slis_t_extab.
BREAK-POINT.
set pf-status 'STANDARD' excluding extab.
endform.
Copy the status From standard program SAPLKKBL, and Status is STANDARD using SE41 transaction. -
Difference between blocked ALV and Hierarchical ALV
Hi All,
Can some body tell me what's the difference between hierarchical and blocked ALV Report Please telle me some body what's the type of ALV it's displaying for the standard Report V/LD this is pricing report I want to develop custom report exactly looks as V/LD but the problem is I am not able to identify what's the ALV format it's displaying either Hierarchical or blocked?
Thanks&Regards
MaheshHi Mahesh,
Blocked ALV displays the data in blocks together in output. e.g. suppose you want to dsplay the data of header & item level. Then you candisplay the data of header records in first block & Item level data in another block on same output screen.
For hierarchical ALV check the below link
http://help.sap.com/saphelp_nw2004s/helpdata/en/6e/4e2941fa918739e10000000a1550b0/frameset.htm
& check this link also:
/people/sap.user72/blog/2005/09/14/a-new-approach-to-alv-programming
Reward points if helpful answer.
Ashvender -
How to write Block ALV using Object-oriented methodology?
Hi all,
How to write a Block ALV without using 'Reuse_ALV.....' FMs? I want to use the CL_GUI....' methods. What is the procedure? Any sample block ALV?
Thanks,
Charles.Currently there is not an OO method of implementing the block ALV, it is only available using the REUSE function module.
Regards,
RIch Heilman -
hi experts,
i have created blocked ALV program.
in the o/p , it displays list of recors for open items,then list of records for cleared items.
now i want it to display sum of both open and cleared items of particular column.
in grid display it is displaying total for open and cleared items.
but in blocked alv it is not displaying total for open and closed items separately.
and also i need grand total of both.
if any body knows please tell me..Hi Sridevi
Refer this code as an example.
This code calculates the occupied column from sflight table.
TYPE-POOLS: slis.
DATA:it_fieldcat TYPE slis_t_fieldcat_alv,
is_layout TYPE slis_layout_alv,
it_events TYPE slis_t_event ,
it_sort TYPE slis_t_sortinfo_alv .
DATA: wa_fcat LIKE LINE OF it_fieldcat,
wa_sort LIKE LINE OF it_sort.
DATA: i_flight TYPE sflight_tab1.
SELECT * FROM sflight
INTO TABLE i_flight
UP TO 10 ROWS.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_structure_name = 'SFLIGHT'
CHANGING
ct_fieldcat = it_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2.
wa_fcat-do_sum = 'X'.
MODIFY it_fieldcat FROM wa_fcat
TRANSPORTING do_sum WHERE fieldname = 'SEATSOCC'.
wa_sort-up = 'X'.
wa_sort-fieldname = 'CARRID'.
wa_sort-subtot = 'X'.
APPEND wa_sort TO it_sort.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = sy-repid.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = is_layout
it_fieldcat = it_fieldcat
i_tabname = 'I_FLIGHT'
it_events = it_events
it_sort = it_sort
* I_TEXT = ' '
TABLES
t_outtab = i_flight
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 2
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = is_layout
it_fieldcat = it_fieldcat
i_tabname = 'I_FLGIHT'
it_events = it_events
it_sort = it_sort
* I_TEXT = ' '
TABLES
t_outtab = i_flight
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 2
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
Thanks and Regards -
Hi Experts,
Can i achieve sorting in Blocked ALV report as we can do in ALV Grid Display.???
If so, how can this be achieved????
For example, if there are 3 records with the same value for a field.....say thfreee rows with name 'Gaurav'.
I want to show 'Gaurav' only in the first row and the other two rows must be empty.
Gaurav 1 2 3
Gaurav 4 5 6
Gaurav 7 8 9
Should be seen as
Gaurav 1 2 3
4 5 6
7 8 9
Thanks and regards
Gaurav raghavHere is the code.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_structure_name = 'ZCRM_ACTIVITY_REPORT'
CHANGING
ct_fieldcat = gt_fieldcatalog[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc EQ 0.
CLEAR gs_sort.
gs_sort-fieldname = 'ORG'.
gs_sort-tabname = 'GT_ITAB'.
gs_sort-spos = '1'.
gs_sort-up = 'X'.
APPEND gs_sort TO gt_sort.
CLEAR gs_sort.
gs_sort-fieldname = 'EMPLOYEE'.
gs_sort-tabname = 'GT_ITAB'.
gs_sort-spos = '2'.
gs_sort-up = 'X'.
APPEND gs_sort TO gt_sort.
ENDIF.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = gt_layout
it_fieldcat = gt_fieldcatalog
i_tabname = 'GT_ITAB'
it_events = gt_events
it_sort = gt_sort
i_text = 'Report 1 '
TABLES
t_outtab = gt_itab
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 2
OTHERS = 3.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'. -
Hi to all,
Iam displaying out put in BLOCKEd ALV using 2 internal tables.
Each table has 10 fields.
When I double click on particular column entry, it should call Transaction iw33.
Other 9 columns should not call transacton if i select entry from the column.
But iam able to call transaction for all the other column entries.
Iam tried using this with slis_selfield structure.
In the run time this structure is not capturing the fieldname.
How can i capture field name.
kindly send yr valuable replys.Hi naveen,
1. I also tried the same thing, but its not returning the column name
on which we click.
2. One workaround can be
a) we get the VALUE in slis_selfield structure.
b) loop at the internal table where COLUMN1 = VALUE
c) if found, then we can somehow deduce that column1 has been clicked.
(It can happen that other columns can contain the same value,
then it can be confusing)
regards,
amit m. -
Hi All,
I am facing the problem in displaying the subtotal in Blocked ALV.
My requirement is, I need to display the subtotals in 3 lines like below.
for ex:
subtotal: 7 <above total>
(5)<coming from someother field>
2
from the above: 7 is total of that column.
5 is coming from some other field.
2 is substraction of above 2.
Could anyone please help me in the above.
Many thanks in advance.
Regards,
venkat.Hi Vaibhav,
Thanks for your response.
and one thing here in my above example is, the value 5 is neither total nor subtotal. its just a different value coming from some other field.
only the 7 is total of that column.
and if I write that logic manually, It may not able display as the position of that column is around 500. because write statment may display upto 252nd position in the output, I guess.
thank you very much.
Regards,
Venkat.
Edited by: venkat reddy on Jan 18, 2010 8:45 PM -
Page Number - Total Page number in Blocked ALV
Hi Gurus,
I need to print the page numbers like 1 of 5 in the ALV footer. Am able to print the current page number but am unable to print the total page number in the footer of the Blocked ALV. Can any one guide me how to display the total number of pages.
Points will be awarded
Thanks
RaviHi,
Please refer to the link below :
http://www.sapdev.co.uk/reporting/alv/alvgrid_events.htm
Thanks,
Sri. -
Seperate ALV Properties in Blocked ALV
Hi All,
I have created a blocked ALV. The standard ALV functionalities like Sort ,Filter etc is working only for the first list.
Is there any techniques to give seperate functionalities for each list?
Iam using reuse_alv_grid_display .
and LAYOUT-LIST_APPEND to show the blocked ALV.
thanks and regards,
Subeesh KannottilHi Yawa Ding,
I have 3 lists .The standard ALV unctionality works only for the first list.
I want all these properties to be applied to all lists
Thanks and Regards,
Subeesh Kannottil -
Header and Logo in Blocked ALV
Is It possible to put header and logo in Blocked ALV Report.
Is yes shall I go with the same way we put the Header and Logo in ALV Grid report.
Thanks in Advance.Hi,
You can put the haeder and logo same like we have used to do in classical ALV's....
sample code snippet..
REPORT ZALV_BLOCKEDALV .
*provide tables
TABLES: MARA, MAKT, MARD.
*provide type-pools
TYPE-POOLS: SLIS.
*provide select-options
SELECT-OPTIONS: S_MATNR FOR MARA-MATNR.
*provide data objects
DATA: V_REPID TYPE SY-REPID,
WA_MARA_FIELD TYPE SLIS_FIELDCAT_ALV, "it is for field catalog
WA_MAKT_FIELD TYPE SLIS_FIELDCAT_ALV,
WA_MARD_FIELD TYPE SLIS_FIELDCAT_ALV,
WA_MARA TYPE MARA,
WA_MAKT TYPE MAKT,
WA_MARD TYPE MARD, IT_MARA_FIELD TYPE SLIS_T_FIELDCAT_ALV,
IT_MAKT_FIELD TYPE SLIS_T_FIELDCAT_ALV,
IT_MARD_FIELD TYPE SLIS_T_FIELDCAT_ALV,
IT_MARA TYPE TABLE OF MARA,
IT_MAKT TYPE TABLE OF MAKT,
IT_MARD TYPE TABLE OF MARD, V_LAYOUT TYPE SLIS_LAYOUT_ALV,
IT_EVENTS TYPE SLIS_T_EVENT, "it is for events
WA_EVENTS TYPE SLIS_ALV_EVENT.V_REPID = SY-REPID.
*provide field catalog perform
PERFORM FIELD_CAT.
*call the initial function module
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
* IT_EXCLUDING =
*provide perform for select the data
PERFORM SELECT_DATA.
*call mara append list
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = V_LAYOUT
IT_FIELDCAT = IT_MARA_FIELD[]
I_TABNAME = 'MARA'
IT_EVENTS = IT_EVENTS[]
* IT_SORT =
* I_TEXT = ' '
TABLES
T_OUTTAB = IT_MARA
EXCEPTIONS
PROGRAM_ERROR = 1
MAXIMUM_OF_APPENDS_REACHED = 2
OTHERS = 3.
*call makt append list
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = V_LAYOUT
IT_FIELDCAT = IT_MAKT_FIELD
I_TABNAME = 'MAKT'
IT_EVENTS = IT_EVENTS
* IT_SORT =
* I_TEXT = ' '
TABLES
T_OUTTAB = IT_MAKT
EXCEPTIONS
PROGRAM_ERROR = 1
MAXIMUM_OF_APPENDS_REACHED = 2
OTHERS = 3.
*call mard append list
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = V_LAYOUT
IT_FIELDCAT = IT_MARD_FIELD
I_TABNAME = 'MARD'
IT_EVENTS = IT_EVENTS
* IT_SORT =
* I_TEXT = ' '
TABLES
T_OUTTAB = IT_MARD
EXCEPTIONS
PROGRAM_ERROR = 1
MAXIMUM_OF_APPENDS_REACHED = 2
OTHERS = 3.
*display the data
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
* EXPORTING
* I_INTERFACE_CHECK = ' '
* 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.
*& Form TOP_PAGE
* text
FORM TOP_PAGE. WRITE:/ 'THIS IS BLOCKED ALV REPORT PROGRAM BASED ON 3 BLOCKS' COLOR
5.ENDFORM. "TOP_PAGE
*& Form FIELD_CAT
* text
* --> p1 text
* <-- p2 text
FORM FIELD_CAT .WA_MARA_FIELD-COL_POS = 1.
WA_MARA_FIELD-FIELDNAME = 'MATNR'.
WA_MARA_FIELD-REF_TABNAME = 'MARA'.
APPEND WA_MARA_FIELD TO IT_MARA_FIELD.
CLEAR WA_MARA_FIELD.WA_MARA_FIELD-COL_POS = 2.
WA_MARA_FIELD-FIELDNAME = 'ERSDA'.
WA_MARA_FIELD-REF_TABNAME = 'MARA'.
APPEND WA_MARA_FIELD TO IT_MARA_FIELD.
CLEAR WA_MARA_FIELD.WA_MARA_FIELD-COL_POS = 3.
WA_MARA_FIELD-FIELDNAME = 'ERNAM'.
WA_MARA_FIELD-REF_TABNAME = 'MARA'.
APPEND WA_MARA_FIELD TO IT_MARA_FIELD.
CLEAR WA_MARA_FIELD.WA_MARA_FIELD-COL_POS = 4.
WA_MARA_FIELD-FIELDNAME = 'LAEDA'.
WA_MARA_FIELD-REF_TABNAME = 'MARA'.
APPEND WA_MARA_FIELD TO IT_MARA_FIELD.
CLEAR WA_MARA_FIELD.WA_MAKT_FIELD-COL_POS = '1'.
WA_MAKT_FIELD-FIELDNAME = 'MATNR'.
WA_MAKT_FIELD-REF_TABNAME = 'MAKT'.
APPEND WA_MAKT_FIELD TO IT_MAKT_FIELD.
CLEAR WA_MAKT_FIELD.WA_MAKT_FIELD-COL_POS = 2.
WA_MAKT_FIELD-FIELDNAME = 'MAKTX'.
WA_MAKT_FIELD-REF_TABNAME = 'MAKT'.
APPEND WA_MAKT_FIELD TO IT_MAKT_FIELD.
CLEAR WA_MAKT_FIELD.WA_MAKT_FIELD-COL_POS = 3.
WA_MAKT_FIELD-FIELDNAME = 'MAKTG'.
WA_MAKT_FIELD-REF_TABNAME = 'MAKT'.
APPEND WA_MAKT_FIELD TO IT_MAKT_FIELD.
CLEAR WA_MAKT_FIELD.WA_MARD_FIELD-COL_POS = 1.
WA_MARD_FIELD-FIELDNAME = 'MATNR'.
WA_MARD_FIELD-REF_TABNAME = 'MARD'.
APPEND WA_MARD_FIELD TO IT_MARD_FIELD.
CLEAR WA_MARD_FIELD.WA_MARD_FIELD-COL_POS = 2.
WA_MARD_FIELD-FIELDNAME = 'WERKS'.
WA_MARD_FIELD-REF_TABNAME = 'MARD'.
APPEND WA_MARD_FIELD TO IT_MARD_FIELD.
CLEAR WA_MARD_FIELD.WA_MARD_FIELD-COL_POS = 3.
WA_MARD_FIELD-FIELDNAME = 'LGORT'.
WA_MARD_FIELD-REF_TABNAME = 'MARD'.
APPEND WA_MARD_FIELD TO IT_MARD_FIELD.
CLEAR WA_MARD_FIELD.WA_EVENTS-FORM = 'TOP_PAGE'.
WA_EVENTS-NAME = 'TOP_OF_PAGE'.
APPEND WA_EVENTS TO IT_EVENTS.ENDFORM. " FIELD_CAT
*& Form SELECT_DATA
* text
* --> p1 text
* <-- p2 text
FORM SELECT_DATA .SELECT *
FROM MARA
INTO TABLE IT_MARA
WHERE MATNR IN S_MATNR.SELECT *
FROM MAKT
INTO TABLE IT_MAKT
WHERE MATNR IN S_MATNR.SELECT *
FROM MARD
INTO TABLE IT_MARD
WHERE MATNR IN S_MATNR.ENDFORM. " SELECT_DATA
hope this will help you
regards,
kiran
Edited by: kiran kumar on Aug 23, 2010 1:43 PM
Maybe you are looking for
-
Error while activating the Data in DSO
Hello, We moved huge amount of FI data from datasource to DSO. After moving all the data, we tried to activate the data. But the mistake we did is we activated all the requests at one go. (my assumption) It turned all the request to Red. The job log
-
Calling Web Service from Froms 10g
I was following the tutorial located here: http://www.oracle.com/technology/products/forms/htdocs/10gr2/howto/webservicefromforms/ws_10_1_3_from_forms.html but the link is no longer working. I have tried searching at the new Oracle Learning Library b
-
Someone else's thumbprint opens my iPad
SSomeone elses thumbprint opens my iPad
-
Condition types restriction at only certain combination like Country/Tax
Dear All In FV11/12, with object V_KONH_VKS we can restrict users accessing certain condition types (field - KSCHL). My query is that I have few condition types accessed by various Plants i.e. common across Plants/Company Codes. Hence would like to r
-
It's not seen available component in assignment block via UI Configuration
Hi, SAP Experts. I met a some problem in Webui Configuration (via Tcode : BSP_WD_CMPWB) I wanna diplay or undisplay particular component in UI Configuration. I move to left section (available assignment blocks) from right section(Displayed assignment