F4 help in alv report ( after execution )
hi all,
i want f4 help in my alv report( after execute it) in a particular filed.
is this possible???
In Advance Thanks
Amit Singh
hi,
use ref_fieldname and ref_tabname
like below
wa_fieldcat-ref_fieldname= 'NAME1'.
wa_fieldcat-ref_tabname = 'KNA1'.
Hope this helps
Regards
Ritesh J
Similar Messages
-
Help,Webdynpro ALV report
Hello,
My Webdynpro ALV report display SFLIGHT all fields .
But I want to show only five fields,
how code?
CODE::
data:node_flights type ref to if_wd_context_node,
it_flights type sflight_tab1,
is_flights type sflight,
it_final type IF_MAIN=>elements_flights,
is_final type IF_MAIN=>element_flights.
select * from sflight into table it_flights up to 10 rows.
node_flights = wd_context->get_child_node( 'FLIGHTS' ).
data:l_ref_cmp_usage type ref to if_wd_component_usage.
l_ref_cmp_usage = wd_this->wd_cpuse_alv( ).
if l_ref_cmp_usage->has_active_component( ) is initial.
l_ref_cmp_usage->create_component( ).
endif.
data:l_ref_interfacecontroller type ref to iwci_salv_wd_table.
l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).
navigate from <CONTEXT> to <NODE_FLIGHT> via lead selection
node_flights = wd_context->get_child_node( name = `NODE_FLIGHT` ).
fill context node
node_flights ->bind_table( it_flight ).
endmethod.
thanksHI,
There is no need to change your code.
Do one thing.
Create a node SFLIGHT and do not add dictionary structure SFLIGHT.
Then create what are the required five attributes under it.
Make sure all these five refer to the dictionary data elements.
example: If you want carrid declare dectionary structure S_CARR_ID.
Like wise.
Now finally goto component usage->ALV->INTERFACECONTROLLER in the
left side tree of web dynpro component.
Then create component usage and drag SFLIGHT node to DATA of the context.
It is one of the way.
Second way is.
Create SFLIGHT node and mention SFLIGHT as stricture and select five required attributes that you need.
Now after creation of SFLIGHT NODE just delete the structure name present in the PROPERTIES of
SFLIGHT NODE.
Now finally goto component usage->ALV->INTERFACECONTROLLER in the
left side tree of web dynpro component.
Then create component usage and drag SFLIGHT node to DATA of the context.
I hope it helped you.
Regards and Best wishes. -
Edit a selected row in an alv report after pressing a push button ?
hi all ,
I want to edit a selected row in an alv report but that too after i press a push button . After pressing the push button , a pop up shud *** showing all the entries of the selected row which shud be editable and after editing it shud be saved into the database table.
How can i do this please help asap ???May this prog. of mine can solve your requirement.
REPORT z_demo_alv_jg.
TYPE-POOLS *
TYPE-POOLS: slis.
INTERNAL TABLES/WORK AREAS/VARIABLES *
DATA: i_fieldcat TYPE slis_t_fieldcat_alv,
i_index TYPE STANDARD TABLE OF i WITH HEADER LINE,
w_field TYPE slis_fieldcat_alv,
p_table LIKE dd02l-tabname,
dy_table TYPE REF TO data,
dy_tab TYPE REF TO data,
dy_line TYPE REF TO data.
FIELD-SYMBOLS *
FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
<dyn_wa> TYPE ANY,
<dyn_field> TYPE ANY,
<dyn_tab_temp> TYPE STANDARD TABLE.
SELECTION SCREEN *
PARAMETERS: tabname(30) TYPE c,
lines(5) TYPE n.
START-OF-SELECTION *
START-OF-SELECTION.
Storing table name
p_table = tabname.
Create internal table dynamically with the stucture of table name
entered in the selection screen
CREATE DATA dy_table TYPE STANDARD TABLE OF (p_table).
ASSIGN dy_table->* TO <dyn_table>.
IF sy-subrc <> 0.
MESSAGE i000(z_zzz_ca_messages) WITH ' No table found'.
LEAVE TO LIST-PROCESSING.
ENDIF.
Create workarea for the table
CREATE DATA dy_line LIKE LINE OF <dyn_table>.
ASSIGN dy_line->* TO <dyn_wa>.
Create another temp. table
CREATE DATA dy_tab TYPE STANDARD TABLE OF (p_table).
ASSIGN dy_tab->* TO <dyn_tab_temp>.
SORT i_fieldcat BY col_pos.
Select data from table
SELECT * FROM (p_table)
INTO TABLE <dyn_table>
UP TO lines ROWS.
REFRESH <dyn_tab_temp>.
Display report
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_structure_name = p_table
i_callback_user_command = 'USER_COMMAND'
i_callback_pf_status_set = 'SET_PF_STATUS'
TABLES
t_outtab = <dyn_table>
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
*& Form SET_PF_STATUS
Setting custom PF-Status
-->RT_EXTAB Excluding table
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'Z_STANDARD'.
ENDFORM. "SET_PF_STATUS
*& Form user_command
Handling custom function codes
-->R_UCOMM Function code value
-->RS_SELFIELD Info. of cursor position in ALV
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
Local data declaration
DATA: li_tab TYPE REF TO data,
l_line TYPE REF TO data.
Local field-symbols
FIELD-SYMBOLS:<l_tab> TYPE table,
<l_wa> TYPE ANY.
Create table
CREATE DATA li_tab TYPE STANDARD TABLE OF (p_table).
ASSIGN li_tab->* TO <l_tab>.
Create workarea
CREATE DATA l_line LIKE LINE OF <l_tab>.
ASSIGN l_line->* TO <l_wa>.
CASE r_ucomm.
When a record is selected
WHEN '&IC1'.
Read the selected record
READ TABLE <dyn_table> ASSIGNING <dyn_wa> INDEX
rs_selfield-tabindex.
IF sy-subrc = 0.
Store the record in an internal table
APPEND <dyn_wa> TO <l_tab>.
Fetch the field catalog info
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = 'Z_DEMO_PDF_JG'
i_structure_name = p_table
CHANGING
ct_fieldcat = i_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc = 0.
Make all the fields input enabled except key fields
w_field-input = 'X'.
MODIFY i_fieldcat FROM w_field TRANSPORTING input
WHERE key IS INITIAL.
ENDIF.
Display the record for editing purpose
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_structure_name = p_table
it_fieldcat = i_fieldcat
i_screen_start_column = 10
i_screen_start_line = 15
i_screen_end_column = 200
i_screen_end_line = 20
TABLES
t_outtab = <l_tab>
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc = 0.
Read the modified data
READ TABLE <l_tab> INDEX 1 INTO <l_wa>.
If the record is changed then track its index no.
and populate it in an internal table for future
action
IF sy-subrc = 0 AND <dyn_wa> <> <l_wa>.
<dyn_wa> = <l_wa>.
i_index = rs_selfield-tabindex.
APPEND i_index.
ENDIF.
ENDIF.
ENDIF.
When save button is pressed
WHEN 'SAVE'.
Sort the index table
SORT i_index.
Delete all duplicate records
DELETE ADJACENT DUPLICATES FROM i_index.
LOOP AT i_index.
Find out the changes in the internal table
and populate these changes in another internal table
READ TABLE <dyn_table> ASSIGNING <dyn_wa> INDEX i_index.
IF sy-subrc = 0.
APPEND <dyn_wa> TO <dyn_tab_temp>.
ENDIF.
ENDLOOP.
Lock the table
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
mode_rstable = 'E'
tabname = p_table
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc = 0.
Modify the database table with these changes
MODIFY (p_table) FROM TABLE <dyn_tab_temp>.
REFRESH <dyn_tab_temp>.
Unlock the table
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
mode_rstable = 'E'
tabname = p_table.
ENDIF.
ENDCASE.
rs_selfield-refresh = 'X'.
ENDFORM. "user_command
Regards,
Joy. -
F4 help in ALV report output (FM REUSE_ALV_GRID_DISPLAY)
Hello,
I have developed ALV report using the FM REUSE_ALV_GRID_DISPLAY.
My requirement is to have a customized search help on the output of ALV on one field.
I tried to find it on SDN but all the methods are using OO ALV.
How we can attaché customized search help in ALV developed using the FM REUSE_ALV_GRID_DISPLAY.
Kindly Help
Regards
SachinHii..
If you use OO then it is very easy to create a F4 help on the ALV..
try this sample code
<removed by moderator>
Hope this will help u..
Regards,
Jhings
Moderator message: please post only relevant code parts, your post must be less than 5000 characters to preserve formatting.
Edited by: Thomas Zloch on Mar 28, 2011 12:51 PM -
Nee help on ALV report for Total of BSEG-BUZEI & F1 document in FB03
Hi friends,
I need to diplay line items total & when double clicked on BELNR field it should open the F1 document in FB03.
Could anyone plz guide me on this.
Waiting for response.
below is my code,
Kindly needed help.
REPORT YALV_1.
TABLES : BKPF,BSEG.
Data for ALV display
TYPE-POOLS: SLIS.
data : int_fcat type SLIS_T_FIELDCAT_ALV,
fieldcatalog type slis_t_fieldcat_alv with header line.
DATA: wa_sortinfo TYPE slis_sortinfo_alv,
i_sortcat TYPE slis_t_sortinfo_alv.
TYPES : BEGIN OF T_BKPF,
BUKRS TYPE BKPF-BUKRS,
BELNR TYPE BKPF-BELNR,
GJAHR TYPE BKPF-GJAHR,
BLART TYPE BKPF-BLART,
BLDAT TYPE BKPF-BLDAT,
BUDAT TYPE BKPF-BUDAT,
END OF T_BKPF.
types: begin of t_bseg,
BUZEI TYPE BSEG-BUZEI,
end of t_bseg.
DATA : it_bkpf TYPE STANDARD TABLE OF t_bkpf with header line,
wa_bkpf TYPE t_bkpf,
it_bseg type standard table of t_bseg.
wa_bseg type t_bseg.
field to store report name
DATA : i_repid like sy-repid.
select bukrs belnr gjahr blart bldat budat from bkpf into table
it_bkpf where blart = 'AA'.
field to check table length
*data i_lines like sy-tabix.
*Start-of-selection.
START-OF-SELECTION.
perform data_retrieval.
perform build_fieldcatalog.
PERFORM sortcat_init CHANGING i_sortcat.
perform display_alv_report.
*& Form BUILD_FIELDCATALOG
Build Fieldcatalog for ALV Report
form build_fieldcatalog.
There are a number of ways to create a fieldcat.
For the purpose of this example i will build the fieldcatalog manualy
by populating the internal table fields individually and then
appending the rows. This method can be the most time consuming but
*can
also allow you more control of the final product.
Beware though, you need to ensure that all fields required are
populated. When using some of functionality available via ALV, such
*as
total. You may need to provide more information than if you were
simply displaying the result
I.e. Field type may be required in-order for
the 'TOTAL' function to work.
fieldcatalog-fieldname = 'BUKRS'.
fieldcatalog-seltext_m = 'Company Code'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 4.
fieldcatalog-do_sum = 'X'.
fieldcatalog-no_zero = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'BELNR'.
fieldcatalog-seltext_m = 'Doc No'.
fieldcatalog-col_pos = 1.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'GJAHR'.
fieldcatalog-seltext_m = 'Fiscal Year'.
fieldcatalog-col_pos = 2.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'BLART'.
fieldcatalog-seltext_m = 'DOC Type'.
fieldcatalog-col_pos = 3.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'BLDAT'.
fieldcatalog-seltext_m = 'Doc Date'.
fieldcatalog-col_pos = 4.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'BUDAT'.
fieldcatalog-seltext_m = 'Popsting Date'.
fieldcatalog-col_pos = 5.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'BUZEI'.
fieldcatalog-seltext_m = 'Line Items'.
fieldcatalog-col_pos = 6.
fieldcatalog-do_sum = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
endform. " BUILD_FIELDCATALOG
FORM sortcat_init CHANGING i_sortcat TYPE slis_t_sortinfo_alv.
CLEAR wa_sortinfo.
wa_sortinfo-fieldname = 'BUKRS'.
wa_sortinfo-tabname = 'T_BKPF'.
wa_sortinfo-spos = 1. " First sort by this field.
wa_sortinfo-up = 'X'. " Ascending
wa_sortinfo-subtot = 'X'. " Subtotal at Name1
APPEND wa_sortinfo TO i_sortcat.
CLEAR wa_sortinfo.
wa_sortinfo-fieldname = 'BELNR'.
wa_sortinfo-tabname = 'T_BKPF'.
wa_sortinfo-spos = 2. " Sec sort by this field.
wa_sortinfo-up = 'X'. " Ascending
wa_sortinfo-subtot = 'X'. " Subtotal at Name1
APPEND wa_sortinfo TO i_sortcat.
ENDFORM. " sortcat_init
*& Form DISPLAY_ALV_REPORT
Display report using ALV grid
form display_alv_report.
i_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = i_repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
i_callback_user_command = 'USER_COMMAND'
i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
it_sort = i_sortcat
it_special_groups = gd_tabgroup
IT_EVENTS = GT_XEVENTS
i_save = 'X'
is_variant = z_template
tables
t_outtab = IT_BKPF
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
form data_retrieval.
IF it_bkpf[] IS NOT INITIAL.
select buzei from bseg into
table it_bseg for all entries in it_bkpf
where bukrs = it_bkpf-bukrs
and belnr = it_bkpf-belnr
and gjahr = it_bkpf-gjahr.
endif.
endform. " DATA_RETRIEVAL.Hello
1.
form display_alv_report.
i_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = i_repid
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = fieldcatalog[]
i_save = 'X'
tables
t_outtab = IT_BKPF
exceptions
program_error = 1
others = 2.
2.
* FORM USER_COMMAND
FORM user_command USING u_com LIKE sy-ucomm sel_lin TYPE slis_selfield.
CASE u_com.
WHEN '&IC1'.
CASE sel_lin.
WHEN 'BELNR'.
read TABLE IT_BKPF INDEX sel_lin-tabindex.
SET PARAMETER ID 'BLN' FIELD IT_BKPF-BELNR.
SET PARAMETER ID 'BUK' FIELD IT_BKPF-BUKRS.
SET PARAMETER ID 'GJR' FIELD IT_BKPF-GJAHR.
CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
ENDCASE.
CLEAR u_com.
ENDCASE.
ENDFORM. "USER_COMMAND -
Execution of a report after execution of a transaction automatically
Dear All,
i want to execute one standard report after the completion of one transaction.
Can any body guide me in how to do this without executing the report separetly means the report should be called after the completion of the transaction automatically.
I dont want to use workflow also so is there any other way?
Warm Regards,
N.JainHello,
What i understood was that you need to run a standard transaction after another transaction to run automatically.....
it is possible if the program for the first t-code is that of a 'Zprogram'
so in the program for the first tcode..if it is performing an operation and does not need user interaction(like user inputs) then in the end of the code,You need to
do a call transaction and return <b>or</b> Submit program and return
wherein you need to pass all sufficient parameters to the second program
Reward if helpful
Regards
Byju -
i need to develop alv report which displays po and corresponding invoice receipt information.
what all fields can i include in invoice receipt information.please help on this.thanks in advance.credit will be given.Hi,
Check the following link:
http://www.sapbrain.com/TUTORIALS/TECHNICAL/ALV_tutorial.html
http://www.sapbrain.com/ARTICLES/TECHNICAL/ABAP/company%20logo%20in%20the%20top%20of%20alv%20report.html
Regards,
Bhaskar -
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 -
Hi All,
I am working on ALV report.I need one logic.
When Ever I executed report, The output should looks 'Selected Total data' like Yellow color. How can i do that.
The report out should show sthe ' All the data is selected'. Just like Ctrl+A.
regards,
AjayHi
if you wants to see the totals in separate color , you develop the I_SORT table with the respective fields and pass to the fun module
then that total field will be always displayed with yelloe color
or
See this sample code to color the ALV fields
and accordingly assign the color for your field
REPORT zsharad_test1.
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,
line_color(4) TYPE c, "Used to store row color attributes
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko.
*ALV data declarations
DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
gd_tab_group TYPE slis_t_sp_group_alv,
gd_layout TYPE slis_layout_alv,
gd_repid LIKE sy-repid.
*Start-of-selection.
START-OF-SELECTION.
PERFORM data_retrieval.
PERFORM build_fieldcatalog.
PERFORM build_layout.
PERFORM display_alv_report.
*& Form BUILD_FIELDCATALOG
Build Fieldcatalog for ALV Report
FORM build_fieldcatalog.
There are a number of ways to create a fieldcat.
For the purpose of this example i will build the fieldcatalog manualy
by populating the internal table fields individually and then
appending the rows. This method can be the most time consuming but can
also allow you more control of the final product.
Beware though, you need to ensure that all fields required are
populated. When using some of functionality available via ALV, such as
total. You may need to provide more information than if you were
simply displaying the result
I.e. Field type may be required in-order for
the 'TOTAL' function to work.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
fieldcatalog-do_sum = 'X'.
fieldcatalog-no_zero = 'X'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item'.
fieldcatalog-col_pos = 1.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'STATU'.
fieldcatalog-seltext_m = 'Status'.
fieldcatalog-col_pos = 2.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'Item change date'.
fieldcatalog-col_pos = 3.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material Number'.
fieldcatalog-col_pos = 4.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'PO quantity'.
fieldcatalog-col_pos = 5.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Order Unit'.
fieldcatalog-col_pos = 6.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-col_pos = 7.
fieldcatalog-outputlen = 15.
fieldcatalog-datatype = 'CURR'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'PEINH'.
fieldcatalog-seltext_m = 'Price Unit'.
fieldcatalog-col_pos = 8.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
ENDFORM. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
Build layout for ALV grid report
FORM build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
Set layout field for row attributes(i.e. color)
gd_layout-info_fieldname = 'LINE_COLOR'.
gd_layout-totals_only = 'X'.
gd_layout-f2code = 'DISP'. "Sets fcode for when double
"click(press f2)
gd_layout-zebra = 'X'.
gd_layout-group_change_edit = 'X'.
gd_layout-header_text = 'helllllo'.
ENDFORM. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
Display report using ALV grid
FORM display_alv_report.
gd_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
i_callback_user_command = 'USER_COMMAND'
i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
it_special_groups = gd_tabgroup
IT_EVENTS = GT_XEVENTS
i_save = 'X'
is_variant = z_template
TABLES
t_outtab = it_ekko
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " DISPLAY_ALV_REPORT
*& Form DATA_RETRIEVAL
Retrieve data form EKPO table and populate itab it_ekko
FORM data_retrieval.
DATA: ld_color(1) TYPE c.
SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
UP TO 10 ROWS
FROM ekpo
INTO TABLE it_ekko.
*Populate field with color attributes
LOOP AT it_ekko INTO wa_ekko.
Populate color variable with colour properties
Char 1 = C (This is a color property)
Char 2 = 3 (Color codes: 1 - 7)
Char 3 = Intensified on/off ( 1 or 0 )
Char 4 = Inverse display on/off ( 1 or 0 )
i.e. wa_ekko-line_color = 'C410'
ld_color = ld_color + 1.
Only 7 colours so need to reset color value
IF ld_color = 8.
ld_color = 1.
ENDIF.
CONCATENATE 'C' ld_color '10' INTO wa_ekko-line_color.
wa_ekko-line_color = 'C410'.
MODIFY it_ekko FROM wa_ekko.
ENDLOOP.
ENDFORM. " DATA_RETRIEVAL
Regards
Anji -
Clear the values in the ALV report after calculating Subtotals
Hi All,
In my ALV report, I am displaying subtotals by passing DO_SUM in the Field Catalog.
Now my problem is in the display I do not want the individual values to be displayed, I want to hide the values in the column(Not the whole column) but I want to display the subtotal of these values in the Subtotal Row.
Example:
Item1 10 20
Item2 20 30
Item3 10 50
40 100
As per our requirements, the output should be
Item1
Item2
Item3
40 100
How can this be done? Please suggest.Populate i_sort table for the fields for which u want subtotal as shown below:
*& Form sub_populate_sort
Populate ALV sort table
No Parameter
FORM sub_populate_sort .
Sort on material
wa_sort-spos = '01' .
wa_sort-fieldname = 'MATNR'.
wa_sort-tabname = 'I_EKPO'.
wa_sort-up = 'X'.
wa_sort-subtot = 'X'.
APPEND wa_sort TO i_sort .
CLEAR wa_sort.
Sort on plant
wa_sort-spos = '02'.
wa_sort-fieldname = 'WERKS'.
wa_sort-tabname = 'I_EKPO'.
wa_sort-up = 'X'.
wa_sort-subtot = 'X'.
APPEND wa_sort TO i_sort .
CLEAR wa_sort.
ENDFORM. " sub_populate_sort
Then when populating the field catalog tables use:
wa_lfl_fcat-no_out = 'X'. "No output
Then display ur data:
This function module for displaying the ALV report
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = l_repid
i_callback_top_of_page = 'SUB_ALV_TOP_OF_PAGE'
is_layout = wa_layout
it_fieldcat = i_fieldcat
it_sort = i_sort
it_events = i_event
i_default = 'X'
i_save = 'A'
TABLES
t_outtab = i_ekpo
EXCEPTIONS
program_error = 1
OTHERS = 2.
Regards,
Joy. -
Field should not display in the subtotal row in ALV report after sorting .
we have a requirement, after sorting and subtotaling, the output in ALV is -
vbeln amount1 amount2 amount3
123 11 12 13
123 12 13 14
123 23 25 27
133 11 12 13
133 12 13 14
133 23 25 27
Now the customer wants the ALV outpput in this fashion -
123 11 12 13
123 12 13 14
23 25 27 --->123 (vbeln) should not come in subtotaling row
133 11 12 13
133 12 13 14
23 25 27--->133(vbeln) should not come in subtotaling rowHi,
if it helps you could create a hierachy. In this way you can define the field catalog for the lines and for the subtotal columns. The only thing is that you would always show the subtotal rows.
You have references of hierachy alvs in
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c060fcb4-2c62-2b10-d2b2-f32407a5cc6f
ALV Hierarchy
alv hierarchy
In this case it also sorts
Sorting for ALV hierarchy
I hope it helps.
Edited by: Oscar Pecharroman on Aug 2, 2010 1:13 PM -
hi,
i am new to ALV programming,i awant to generate the report with three teable mseg,mkpf,mard.
i need selection screen also.
in the selection screen following is the field names.
Matdoc number-mseg-mblnr
mat number - mseg-matnr
plant - mseg-werks
sloc mseg-lgort
movtype- mseg-bwart.
batch number- mseg-charg.
ordernumber -mseg-aufnr.
costcenter- mseg-kostl.
reservation number- mseg-rsnum.
storage bin - mard-lgpbe.
i want to fetch the data from three tables
mseg,mard,mkpf.
after featch report should disply in alv grid following items.
Matdoc number-mseg-mblnr
mat number - mseg-matnr
plant - mseg-werks
sloc mseg-lgort
movtype- mseg-bwart.
batch number- mseg-charg.
ordernumber -mseg-aufnr.
costcenter- mseg-kostl.
reservation number- mseg-rsnum.
storage bin - mard-lgpbe.
posting date - mkpf-budat.
if any body have the code kindly send it as early as posible.
Thanks,
Rammohan.here is a sample program i think almost containing the same tables and fields
*& Report ZSD_R_ENHANCEMENT2 *
*& REPORT PROGRAMMING FOR THE FURTHER ENHANCEMENT OF THE PRE-GENERATED
*& MB51. REQUIREMENT IS TO ADD FIVE MORE FIELDS.
*& OLD MATERIAL ON THE TOP LEFT CORNER OF THE HEADER AND
*& Batch number the right of material document.
*& Serial number if found should be placed to the right of the batch number.
*& Handling unit/ storage unit to the right of serial number.
*& Transaction description at the last of the report.
REPORT ZSD_R_ENHANCEMENT2 MESSAGE-ID ZB6T2 .
*& STRUCTURE CREATION FOR INTERNAL TABLES *
*STRUCUTRE CREATION FOR HEADER MATERIAL DOCMENT AND DOCUMENT SEGEMNT MATERIAL
TYPES: BEGIN OF TY_MKPF_MSEG,
MBLNR TYPE MBLNR, " NUMBER OF MATERIAL DOC
MJAHR TYPE MJAHR, " MATERIAL DOCUMENT YEAR
VGART TYPE VGART, " TRANSACTION EVENT TYPE
BLART TYPE BLART, " DOCUMENT TYPE
BUDAT TYPE BUDAT, " POSTING DATE INT THE DOC
USNAM TYPE USNAM, " USERNAME
XBLNR TYPE XBLNR1, " REFERENCE DOCUMENT NUMBER
MATNR TYPE MATNR, " MATERIAL NUMBER
WERKS TYPE WERKS_D, " PLANT
LGORT TYPE LGORT_D, " STORAGE LOCATION
CHARG TYPE CHARG_D, " BATCH NUM
LIFNR TYPE ELIFN, " ACC OF VENDOR
KUNNR TYPE EKUNN, " CUSTOMER NUM
SOBKZ TYPE SOBKZ, " SPECIAL STOKING
BWART TYPE BWART, " MOVEMENT TYPE
ZEILE TYPE MBLPO, " ITEM IN MATERIAL DOCUMENT
ERFMG TYPE ERFMG, " QUANTITY IN UNIT OF ENTERY
ERFME TYPE ERFME, " UNIT OF ENTRY
END OF TY_MKPF_MSEG,
*STRUCTURE FOR MATERIAL MASTER DATA
BEGIN OF TY_MARA,
MATNR TYPE MATNR, " MATERIAL TYPE
BISMT TYPE BISMT, " OLD MATERIAL NUMBER
END OF TY_MARA,
*STRUCTURE DECLARATION FOR MATERIAL DESCRIPTION
BEGIN OF TY_MAKT,
MATNR TYPE MATNR, " MATERIAL NUM
SPRAS TYPE SPRAS, " LANGUAGE KEY
MAKTX TYPE MAKTX, " MATERIAL DESC
END OF TY_MAKT,
*STRUCTURE DECLARATION FOR MOVEMENT TYPE TEXT
BEGIN OF TY_T156T,
BWART TYPE BWART, " MOVEMENT TYPE
BTEXT TYPE BTEXT, " MOVEMENT TYPE TEXT
SPRAS TYPE SPRAS, " LANGUAGE KEY
END OF TY_T156T,
*STRUCTURE CREATION FOR DOCUMENT HEADER FOR SERIALNUMBERS FOR GOOD MOVEMENTS
BEGIN OF TY_SER03,
MBLNR TYPE MBLNR, " NUMBER OF MATERIAL DOC
MJAHR TYPE MJAHR, " MATERIAL DOCU YEAR
ZEILE TYPE MBLPO, " OUTPUT IN MATERIAL DOC
OBKNR TYPE OBJKNR, " OBJECT LIST NUMBER
END OF TY_SER03,
*STRUCUTRE DECLARATION FOR PLANTS MAINTANENCE OBKECT LIST
BEGIN OF TY_OBJK,
OBKNR TYPE OBJKNR, " OBJECT LIST NUMBER
OBZAE TYPE OBJZA, " OBLECT LIST COUNTERS
SERNR TYPE GERNR, " SERIAL NUMBER
END OF TY_OBJK,
*STRUCUTRE DECLARATION FOR PLANTS/BRANCHES
BEGIN OF TY_T001W,
WERKS TYPE WERKS_D, " PLANT
NAME1 TYPE NAME1, " NAME
END OF TY_T001W,
*STRUCUTRE DECLARATION FOR OUTPUT TABLE
BEGIN OF TY_OUTPUT,
MATNR TYPE MATNR, " MATERIAL NUMBER
BISMT TYPE BISMT, " OLD MATERIAL NUMBER
MAKTX TYPE MAKTX, " MATERIAL DESC
WERKS TYPE WERKS_D, " PLANT
NAME1 TYPE NAME1, " NAME
LGORT TYPE LGORT_D, " Storage Location
BWART TYPE BWART, " Movement Type
MBLNR TYPE MBLNR, " NUMBER OF MATERIAL DOC
CHARG TYPE CHARG_D, " BATCH NUM
SERNR TYPE GERNR, " SERIAL NUMBER
ZEILE TYPE MBLPO, " OUTPUT IN MATERIAL DOC
BUDAT TYPE BUDAT, " POSTING DOCU DATE
ERFMG TYPE ERFMG, " QUANTITY IN UNIT OF ENTRY
ERFME TYPE ERFME, " UNINT OF ENTRY
BTEXT TYPE BTEXT, " MOVEMENT TYPE TEXT
MJAHR TYPE MJAHR, " MATEREIAL DOC YEAR
VGART TYPE VGART, " TRANSACTION EVENT TYPE
BLART TYPE BLART, " DOCUMENT TYPE
USNAM TYPE USNAM, " USERNAME
XBLNR TYPE XBLNR1, " REFERENCE DOCUMENT NUM
SOBKZ TYPE SOBKZ, " SPECIAL STOCKING
LIFNR TYPE ELIFN, " ACC OF VENDOR
KUNNR TYPE EKUNN, " CUSTOMER
OBKNR TYPE OBJKNR, " OBJECT LIST NUMBER
END OF TY_OUTPUT.
*&INTERNAL TABLE DECLARATION FOR STRUCUTRES *
INTERNAL TABLE DECLARATION FOR HEADER MATERIAL DOCMENT AND DOCUMENT SEGEMNT MATERIAL
DATA : T_MKPF_MSEG TYPE STANDARD TABLE OF TY_MKPF_MSEG INITIAL SIZE 0,
*INTERNAL TABLE DECLARATION FOR MATERIAL MASTER DAT
T_MARA TYPE STANDARD TABLE OF TY_MARA INITIAL SIZE 0,
*INTERNAL TABLE DECLARATION FOR MATERIAL TYPE DESC
T_MAKT TYPE STANDARD TABLE OF TY_MAKT INITIAL SIZE 0,
*INTERNAL TABLE DECLARATION FOR MOVEMENT TYPE TEXT
T_T156T TYPE STANDARD TABLE OF TY_T156T INITIAL SIZE 0,
*INTERNAL TABLE DECLARATION FOR Document Header for Serial Numbers for Goods Movements
T_SER03 TYPE STANDARD TABLE OF TY_SER03 INITIAL SIZE 0,
*INTERNAL TABLE DECLARATION FOR Plant Maintenance Object List
T_OBJK TYPE STANDARD TABLE OF TY_OBJK INITIAL SIZE 0,
*INTERNAL TABLE DECLARATION FOR Plants/Branches
T_T001W TYPE STANDARD TABLE OF TY_T001W INITIAL SIZE 0,
*INTERNAL TABLE DECLARATION FOR OUTPUT
T_OUTPUT TYPE STANDARD TABLE OF TY_OUTPUT INITIAL SIZE 0,
*&WORK AREA DECLARATIONS FOR INTERNAL TABLES *
*WORK AREA DECLARATION HEADER MATERIAL DOCMENT AND DOCUMENT SEGEMNT MATERIAL
W_MKPF_MSEG TYPE TY_MKPF_MSEG,
*WORK AREA DECLARATION MATERIAL MASTER DATA
W_MARA TYPE TY_MARA,
*WORK AREA DECLARATION MATERIAL TYPE DESC
W_MAKT TYPE TY_MAKT,
*WORK AREA DECLARATION MOVEMENT TYPE TEXT\
W_T156T TYPE TY_T156T,
*WORK AREA DECLARATION Document Header for Serial Numbers for Goods Movements
W_SER03 TYPE TY_SER03,
*WORK AREA DECLARATION PLANT MAINTENANCE OBJECT LIST
W_OBJK TYPE TY_OBJK,
*WORK AREA DECLARATION PLANTS AND BRANCHES
W_T001W TYPE TY_T001W,
*WORK AREA DECLARATION FOR OUTPUT TABLE.
W_OUTPUT TYPE TY_OUTPUT,
*& GLOBAL VARIABLE DECLARATIONS *
G_MATNR TYPE MSEG-MATNR,
G_WERKS TYPE MSEG-WERKS,
G_LGORT TYPE MSEG-LGORT,
G_CHARG TYPE MSEG-CHARG,
G_LIFNR TYPE MSEG-LIFNR,
G_KUNNR TYPE MSEG-KUNNR,
G_BWART TYPE MSEG-BWART,
G_SOBKZ TYPE MSEG-SOBKZ,
G_BUDAT TYPE MKPF-BUDAT,
G_USNAM TYPE MKPF-USNAM,
G_VGART TYPE MKPF-VGART,
G_XBLNR TYPE MKPF-XBLNR.
*& SELECTION SCREEN EVENT *
*SELECT OPTIONS EVENTS FOR ITEM DETAILS
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
SELECT-OPTIONS: S_MATNR FOR G_MATNR,
S_WERKS FOR G_WERKS,
S_LGORT FOR G_LGORT,
S_CHARG FOR G_CHARG,
S_LIFNR FOR G_LIFNR,
S_KUNNR FOR G_KUNNR,
S_BWART FOR G_BWART,
S_SOBKZ FOR G_SOBKZ.
SELECTION-SCREEN END OF BLOCK B1.
*SELECT OPTIONS EVENTS FOR HEADER DETAILS
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME.
SELECT-OPTIONS: S_BUDAT FOR G_BUDAT,
S_USNAM FOR G_USNAM,
S_VGART FOR G_VGART,
S_XBLNR FOR G_XBLNR.
SELECTION-SCREEN END OF BLOCK B2.
*&INITIALIZATION EVENTS *
INITIALIZATION.
CLEAR: W_MKPF_MSEG,
W_MARA,
W_MAKT,
W_T156T,
W_SER03,
W_OBJK,
W_T001W,
W_OUTPUT.
REFRESH: T_MKPF_MSEG,
T_MARA,
T_MAKT,
T_T156T,
T_SER03,
T_OBJK,
T_T001W,
T_OUTPUT.
*& At Selection screen Event
AT SELECTION-SCREEN.
PERFORM SUB_VALID_MATNR.
PERFORM SUB_VALID_WERKS.
PERFORM SUB_VALID_LGORT.
PERFORM SUB_VALID_CHARG.
PERFORM SUB_VALID_LIFNR.
PERFORM SUB_VALID_KUNNR.
PERFORM SUB_VALID_BWART.
PERFORM SUB_VALID_SOBKZ.
PERFORM SUB_VALID_BUDAT.
PERFORM SUB_VALID_USNAM.
PERFORM SUB_VALID_VGART.
PERFORM SUB_VALID_XBLNR.
*& Start of selection event.
START-OF-SELECTION.
PERFORM SUB_GET_MKPF_MSEG.
PERFORM SUB_GET_MARA.
PERFORM SUB_GET_MAKT.
PERFORM SUB_GET_T156T.
PERFORM SUB_GET_SER03.
PERFORM SUB_GET_T001W.
PERFORM SUB_BSLIST_DISP.
*& Form SUB_VALID_MATNR
*VALIDATION FOR MATERIAL NUM
FORM SUB_VALID_MATNR .
DATA : L_MATNR TYPE MATNR.
SELECT SINGLE MATNR
FROM MARA
INTO L_MATNR
WHERE MATNR IN S_MATNR.
IF SY-SUBRC <> 0.
MESSAGE E001.
ENDIF.
ENDFORM. " SUB_VALID_MATNR
*& Form SUB_VALID_WERKS
text
FORM SUB_VALID_WERKS .
DATA L_WERKS TYPE WERKS_D.
SELECT SINGLE WERKS
FROM T001W
INTO L_WERKS
WHERE WERKS IN S_WERKS.
IF SY-SUBRC <> 0.
MESSAGE E002.
ENDIF.
ENDFORM. " SUB_VALID_WERKS
*& Form SUB_VALID_LGORT
text
FORM SUB_VALID_LGORT .
DATA L_LGORT TYPE LGORT_D.
SELECT SINGLE LGORT
FROM T001L
INTO L_LGORT
WHERE LGORT IN S_LGORT.
IF SY-SUBRC <> 0.
MESSAGE E003.
ENDIF.
ENDFORM. " SUB_VALID_LGORT
*& Form SUB_VALID_CHARG
text
FORM SUB_VALID_CHARG .
DATA L_CHARG TYPE CHARG_D.
SELECT SINGLE CHARG
FROM MCHA
INTO L_CHARG
WHERE CHARG IN S_CHARG.
IF SY-SUBRC <> 0.
MESSAGE E004.
ENDIF.
ENDFORM. " SUB_VALID_CHARG
*& Form SUB_VALID_LIFNR
text
FORM SUB_VALID_LIFNR .
DATA L_LIFNR TYPE LIFNR.
SELECT SINGLE LIFNR
FROM LFA1
INTO L_LIFNR
WHERE LIFNR IN S_LIFNR.
IF SY-SUBRC <> 0.
MESSAGE E005.
ENDIF.
ENDFORM. " SUB_VALID_LIFNR
*& Form SUB_VALID_KUNNR
text
FORM SUB_VALID_KUNNR .
DATA L_KUNNR TYPE KUNNR.
SELECT SINGLE KUNNR
FROM KNA1
INTO L_KUNNR
WHERE KUNNR IN S_KUNNR.
IF SY-SUBRC <> 0.
MESSAGE E006.
ENDIF.
ENDFORM. " SUB_VALID_KUNNR
*& Form SUB_VALID_BWART
text
FORM SUB_VALID_BWART .
DATA L_BWART TYPE BWART.
SELECT SINGLE BWART
FROM T156
INTO L_BWART
WHERE BWART IN S_BWART.
IF SY-SUBRC <> 0.
MESSAGE E007.
ENDIF.
ENDFORM. " SUB_VALID_BWART
*& Form SUB_VALID_SOBKZ
text
FORM SUB_VALID_SOBKZ .
DATA L_SOBKZ TYPE SOBKZ.
SELECT SINGLE SOBKZ
FROM T148
INTO L_SOBKZ
WHERE SOBKZ IN S_SOBKZ.
IF SY-SUBRC <> 0.
MESSAGE E008.
ENDIF.
ENDFORM. " SUB_VALID_SOBKZ
*& Form SUB_VALID_BUDAT
text
FORM SUB_VALID_BUDAT .
DATA L_BUDAT TYPE BUDAT.
SELECT SINGLE BUDAT
FROM MKPF
INTO L_BUDAT
WHERE BUDAT IN S_BUDAT.
IF SY-SUBRC <> 0.
MESSAGE E009.
ENDIF.
ENDFORM. " SUB_VALID_BUDAT
*& Form SUB_VALID_USNAM
text
FORM SUB_VALID_USNAM .
DATA L_USNAM TYPE USNAM.
SELECT SINGLE USNAM
FROM MKPF
INTO L_USNAM
WHERE USNAM IN S_USNAM.
IF SY-SUBRC <> 0.
MESSAGE E010.
ENDIF.
ENDFORM. " SUB_VALID_USNAM
*& Form SUB_VALID_VGART
text
FORM SUB_VALID_VGART .
DATA L_VGART TYPE VGART.
SELECT SINGLE VGART
FROM MKPF
INTO L_VGART
WHERE VGART IN S_VGART.
IF SY-SUBRC <> 0.
MESSAGE E011.
ENDIF.
ENDFORM. " SUB_VALID_VGART
*& Form SUB_VALID_XBLNR
text
FORM SUB_VALID_XBLNR .
DATA L_XBLNR TYPE XBLNR.
SELECT SINGLE XBLNR
FROM MKPF
INTO L_XBLNR
WHERE XBLNR IN S_XBLNR.
IF SY-SUBRC <> 0.
MESSAGE E012.
ENDIF.
ENDFORM. " SUB_VALID_XBLNR
*& Form SUB_GET_MKPF_MSEG
text
FORM SUB_GET_MKPF_MSEG .
REFRESH T_MKPF_MSEG.
SELECT KMBLNR KMJAHR K~VGART
KBLART KBUDAT K~USNAM
K~XBLNR
SMATNR SWERKS S~LGORT
SCHARG SLIFNR S~KUNNR
SSOBKZ SBWART S~ZEILE
SERFMG SERFME
INTO TABLE T_MKPF_MSEG
FROM MKPF AS K INNER JOIN MSEG AS S
ON KMBLNR = SMBLNR AND KMJAHR = SMJAHR
WHERE K~VGART IN S_VGART
AND K~BUDAT IN S_BUDAT
AND K~USNAM IN S_USNAM
AND K~XBLNR IN S_XBLNR
AND S~MATNR IN S_MATNR
AND S~WERKS IN S_WERKS
AND S~LGORT IN S_LGORT
AND S~CHARG IN S_CHARG
AND S~SOBKZ IN S_SOBKZ
AND S~LIFNR IN S_LIFNR
AND S~KUNNR IN S_KUNNR.
ENDFORM. " SUB_GET_MKPF_MSEG
*& Form SUB_GET_MARA
text
FORM SUB_GET_MARA .
IF T_MKPF_MSEG IS NOT INITIAL.
SORT T_MKPF_MSEG BY MATNR.
REFRESH T_MARA.
SELECT MATNR
BISMT
FROM MARA
INTO TABLE T_MARA
FOR ALL ENTRIES IN T_MKPF_MSEG
WHERE MATNR = T_MKPF_MSEG-MATNR.
ENDIF.
ENDFORM. " SUB_GET_MARA
*& Form SUB_GET_MAKT
text
FORM SUB_GET_MAKT .
REFRESH T_MAKT.
SELECT MATNR
SPRAS
MAKTX
FROM MAKT
INTO TABLE T_MAKT
FOR ALL ENTRIES IN T_MKPF_MSEG
WHERE SPRAS = SY-LANGU AND MATNR = T_MKPF_MSEG-MATNR.
ENDFORM. " SUB_GET_MAKT
*& Form SUB_GET_T156T
text
FORM SUB_GET_T156T .
SELECT BWART
BTEXT
SPRAS
FROM T156T
INTO TABLE T_T156T
FOR ALL ENTRIES IN T_MKPF_MSEG
WHERE SPRAS = SY-LANGU AND BWART = T_MKPF_MSEG-BWART.
ENDFORM. " SUB_GET_T156T
*& Form SUB_GET_SER03
text
FORM SUB_GET_SER03 .
SELECT MBLNR
MJAHR
ZEILE
OBKNR
FROM SER03
INTO TABLE T_SER03
FOR ALL ENTRIES IN T_MKPF_MSEG
WHERE MBLNR = T_MKPF_MSEG-MBLNR
AND MJAHR = T_MKPF_MSEG-MJAHR
AND ZEILE = T_MKPF_MSEG-ZEILE.
IF T_SER03 IS NOT INITIAL.
SELECT OBKNR
OBZAE
SERNR
FROM OBJK
INTO CORRESPONDING FIELDS OF TABLE T_OBJK
FOR ALL ENTRIES IN T_SER03
WHERE OBKNR = T_SER03-OBKNR.
ENDIF.
ENDFORM. " SUB_GET_SER03
*& Form SUB_GET_T001W
text
FORM SUB_GET_T001W .
SELECT WERKS
NAME1
FROM T001W
INTO TABLE T_T001W
FOR ALL ENTRIES IN T_MKPF_MSEG
WHERE WERKS = T_MKPF_MSEG-WERKS.
ENDFORM. " SUB_GET_T001W
*& Form SUB_BSLIST_DISP
FOR DISPLAY OUT
FORM SUB_BSLIST_DISP .
REFRESH T_OUTPUT.
CLEAR W_MKPF_MSEG.
SORT T_MKPF_MSEG BY MBLNR MJAHR ZEILE MATNR.
LOOP AT T_MKPF_MSEG INTO W_MKPF_MSEG.
W_OUTPUT-MBLNR = W_MKPF_MSEG-MBLNR .
W_OUTPUT-MJAHR = W_MKPF_MSEG-MJAHR.
W_OUTPUT-VGART = W_MKPF_MSEG-VGART.
W_OUTPUT-BLART = W_MKPF_MSEG-BLART.
W_OUTPUT-BUDAT = W_MKPF_MSEG-BUDAT.
W_OUTPUT-USNAM = W_MKPF_MSEG-USNAM.
W_OUTPUT-XBLNR = W_MKPF_MSEG-XBLNR.
W_OUTPUT-ZEILE = W_MKPF_MSEG-ZEILE.
W_OUTPUT-BWART = W_MKPF_MSEG-BWART.
W_OUTPUT-MATNR = W_MKPF_MSEG-MATNR.
W_OUTPUT-WERKS = W_MKPF_MSEG-WERKS.
W_OUTPUT-LGORT = W_MKPF_MSEG-LGORT.
W_OUTPUT-CHARG = W_MKPF_MSEG-CHARG.
W_OUTPUT-SOBKZ = W_MKPF_MSEG-SOBKZ.
W_OUTPUT-LIFNR = W_MKPF_MSEG-LIFNR.
W_OUTPUT-KUNNR = W_MKPF_MSEG-KUNNR.
W_OUTPUT-ERFMG = W_MKPF_MSEG-ERFMG.
W_OUTPUT-ERFME = W_MKPF_MSEG-ERFME.
CLEAR W_MARA.
READ TABLE T_MARA INTO W_MARA WITH KEY MATNR = W_OUTPUT-MATNR.
IF SY-SUBRC = 0.
W_OUTPUT-BISMT = W_MARA-BISMT.
ENDIF.
CLEAR W_MAKT.
READ TABLE T_MAKT INTO W_MAKT WITH KEY MATNR = W_OUTPUT-MATNR .
IF SY-SUBRC = 0.
W_OUTPUT-MAKTX = W_MAKT-MAKTX.
ENDIF.
CLEAR W_T156T.
READ TABLE T_T156T INTO W_T156T WITH KEY BWART = W_OUTPUT-BWART .
IF SY-SUBRC = 0.
W_OUTPUT-BTEXT = W_T156T-BTEXT.
ENDIF.
CLEAR W_T001W.
READ TABLE T_T001W INTO W_T001W WITH KEY WERKS = W_MKPF_MSEG-WERKS.
IF SY-SUBRC = 0.
W_OUTPUT-NAME1 = W_T001W-NAME1.
ENDIF.
CLEAR W_SER03.
READ TABLE T_SER03 INTO W_SER03 WITH KEY MBLNR = W_OUTPUT-MBLNR
MJAHR = W_OUTPUT-MJAHR
ZEILE = W_OUTPUT-ZEILE.
IF SY-SUBRC = 0.
W_OUTPUT-OBKNR = W_SER03-OBKNR.
ENDIF.
CLEAR W_OBJK.
READ TABLE T_OBJK INTO W_OBJK WITH KEY OBKNR = W_OUTPUT-OBKNR.
IF SY-SUBRC = 0.
W_OUTPUT-SERNR = W_OBJK-SERNR .
ENDIF.
APPEND W_OUTPUT TO T_OUTPUT.
CLEAR W_OUTPUT.
ENDLOOP.
PERFORM SUB_DISPLAY.
ENDFORM.
*& Form SUB_DISPLAY
HIERARICAL DISPLAY
FORM SUB_DISPLAY .
SORT T_OUTPUT BY MATNR BISMT MAKTX WERKS NAME1 LGORT BWART MBLNR CHARG SERNR ZEILE BUDAT ERFMG ERFME BTEXT.
CLEAR W_OUTPUT.
LOOP AT T_OUTPUT INTO W_OUTPUT.
AT NEW NAME1.
WRITE:/ W_OUTPUT-MATNR,
W_OUTPUT-BISMT,
W_OUTPUT-MAKTX,
W_OUTPUT-WERKS,
W_OUTPUT-NAME1.
ENDAT.
AT NEW BTEXT.
WRITE:/ W_OUTPUT-LGORT,
W_OUTPUT-BWART,
W_OUTPUT-MBLNR,
W_OUTPUT-CHARG,
W_OUTPUT-SERNR,
W_OUTPUT-ZEILE,
W_OUTPUT-BUDAT,
W_OUTPUT-ERFMG,
W_OUTPUT-ERFME,
W_OUTPUT-BTEXT.
ENDAT.
CLEAR W_OUTPUT.
ENDLOOP.
REFRESH T_OUTPUT.
ENDFORM. " SUB_DISPLAY -
Is there any help for ALV report development with funcation modules?
Hi,
please tell me any help or example to understand the ALV function module.Hi neha,
1. very simple alv
(with minimum code)
2. just copy paste
3.
report abc.
TYPE-POOLS : slis.
DATA : alvfc TYPE slis_t_fieldcat_alv.
DATA : alvfcwa TYPE slis_fieldcat_alv.
data : begin of itab occurs 0.
include structure usr02.
data : end of itab.
START-OF-SELECTION.
select * from usr02
into table itab.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'ITAB'
i_inclname = sy-repid
CHANGING
ct_fieldcat = alvfc
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
Display
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
it_fieldcat = alvfc
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
regards,
amit m. -
How to validate data in editable ALV report after making changes
Hi Folks,
My requirement is to display data in ALV format with quantity field is editable. Once we get the data in display mode only quantity field is enabled right. I am going to make changes to that quantity field and updating that modifed value to the database table. Before updating databse table i want to validate the data for perticluar field which I edidted(Quantity).
Can you guide me on this.
Currently I am using FM: GET_GLOBALS_FROM_SLVC_FULLSCR and calling the method CHECK_CHANGED_DATA.
I want to validate the quantity data.
If I entered negative value like -100 instead of 100. It should validate and show some popup screen or message.
Pls guide me on this or give some code to do that.
Thanks&Regards,
SurendraHey Surendra,
Check if this helps: Link:[Click here|Edit Field in Oops Alv;
There are many posts available for this requirement. Please look SDN/web for same.
Regards,
Santosh -
Help with credit report after texts!
Ahhhhh!!!
How do i stop my phone telling me my credit every single time i send a messege its getting rather annoying.
Thanks in advance :-)This is quite a common problem but easily solved.
All you have to do is give your network a call and ask them to disable the balance notification. It's a network feature so they are the only people who can stop it.
Maybe you are looking for
-
How does the TS_SeqFileSequenceNameExists() function work?
I am creating a TestStand Sequence file using CVI and would like to know the correct syntax for using the TS_SeqFileSequenceNameExists() function. Basically what I'm trying to do is add a sub sequence to my file and if the sequence name already exist
-
Different vendor during invoice verification
Hi All In my testing I came to know that the system is allowing any vendor as different payee in MIRO screen irrespective of PO vendor and even i am able to post the document without any error or block. I don't have any partner functionality. There i
-
What is standard PO smartforms program
please send me reply Reguards, Raji
-
Urgent help!!! My new website shows blank in Explorer
Hi Anyone My new website, http://www.mindjuicer.com, doesn't show up if you view it in Internet Explorer. It look all fine in Safari and Fireworks but it doesn't show anything with Explorer. Can anyone help???? Please, it's very urgent as I've been t
-
Database Export with DB2 Version 9.5
Folks, Has anybody ran a Database Export with ECC 6.0 or Solution Manager 7.0 etc ( AIX ) and DB2 Version 9.5 ? When we have run it, it runs successfully ( so it says ) in seconds but obviously produces no dump file. My gut feel is that the Installa