Splitter Problem - ALV Grid not refreshed when selected another item
Hi Experts!!
I have a container on screen 100 which has to be split into 3 areas. Left area ->tree, Right top area -alv grid and bottom also alv grid. I created the program without splitter and it was working fine. After I added this splitter, I see that in ALV grid, the data is not being refreshed. When double clicked on an item in tree struct, ALV grid (CL_SALV_TABLE) to be shown.. Firstly it's fine but when I double click on another item, it's not refreshing the data but is showing the same previous data.
I have searched existing posts and implemented, but no luck.
PFB my code:
* In PBO of screen 100
CREATE OBJECT go_cc_area1
EXPORTING
container_name = 'CC_AREA1'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
IF sy-subrc <> 0.
MESSAGE e025 WITH sy-subrc.
ENDIF.
CREATE OBJECT go_splitter
EXPORTING
parent = go_cc_area1
orientation = 1 "Vertical split
sash_position = 40
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
ENDIF.
go_container_tree = go_splitter->top_left_container.
go_container_2 = go_splitter->bottom_right_container.
CREATE OBJECT go_splitter_2
EXPORTING
parent = go_container_2
orientation = 0 "Horizontal split
sash_position = 40
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
ENDIF.
go_cc_area2 = go_splitter_2->top_left_container.
go_cc_area3 = go_splitter_2->bottom_right_container.
CREATE OBJECT go_tree
EXPORTING
i_parent = go_container_tree
i_node_selection_mode = cl_gui_column_tree=>node_sel_mode_single
i_item_selection = gc_x
i_no_html_header = gc_x
i_no_toolbar = space
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
illegal_node_selection_mode = 5
failed = 6
illegal_column_name = 7.
CALL METHOD go_tree->set_table_for_first_display
EXPORTING
i_background_id = space
is_layout = gs_layout
CHANGING
it_sort = gt_sort
it_outtab = gt_tree_output
it_fieldcatalog = gt_fieldcat_tree.
CALL METHOD go_tree->expand_tree
EXPORTING
i_level = 2.
* End - PBO 100
* CLASS lcl_tree_event_receiver DEFINITION
CLASS lcl_tree_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS: handle_item_double_click
FOR EVENT item_double_click OF cl_gui_alv_tree_simple
IMPORTING fieldname
index_outtab
grouplevel.
ENDCLASS. "lcl_tree_event_receiver DEFINITION
* CLASS lcl_tree_event_receiver IMPLEMENTATION
CLASS lcl_tree_event_receiver IMPLEMENTATION.
METHOD handle_item_double_click.
IF go_alv_area2 IS BOUND.
go_alv_area2->refresh( ).
ENDIF.
cl_salv_table=>factory(
EXPORTING
list_display = space
r_container = go_cc_area2
IMPORTING
r_salv_table = go_alv_area2
CHANGING
t_table = gt_table ).
go_alv_area2->display( ).
ENDMETHOD. "handle_item_double_click
ENDCLASS. "lcl_tree_event_receiver IMPLEMENTATION
I am facing the same problem with area 3 as well. Can somebody please help me out.
Thanks a lot!!
Edited by: Srinivas Kalluri on Jan 28, 2012 1:39 PM
Hi All,
I am still facing this problem. Can somebody please help me out?
I created a test program wth sflight and spfli tables. Can somebody look into this and tell me where I am going wrong?
On screen 100 i have one cust container named CC.
When I test it, it's showing the same refresh problem. But in this test program refresh is atleast happening once.
REPORT ztest.
PARAMETERS: p_carrid TYPE sflight-carrid.
CLASS lcl_tree_event_receiver DEFINITION DEFERRED.
CONSTANTS: gc_x VALUE 'X'.
DATA: go_cc_area1 TYPE REF TO cl_gui_custom_container,
go_tree TYPE REF TO cl_gui_alv_tree_simple,
go_tree_event_receiver TYPE REF TO lcl_tree_event_receiver,
go_cc_area2 TYPE REF TO cl_gui_container,
go_alv_area2 TYPE REF TO cl_salv_table,
go_cc_area3 TYPE REF TO cl_gui_container,
go_columns TYPE REF TO cl_salv_columns_table,
go_cc_editor TYPE REF TO cl_gui_custom_container,
go_editor TYPE REF TO cl_gui_textedit,
go_content TYPE REF TO cl_salv_form_element,
go_container_tree TYPE REF TO cl_gui_container,
go_container_2 TYPE REF TO cl_gui_container,
go_splitter TYPE REF TO cl_gui_easy_splitter_container,
go_splitter_2 TYPE REF TO cl_gui_easy_splitter_container,
go_cc_comp TYPE REF TO cl_gui_custom_container,
go_alv_comp TYPE REF TO cl_salv_table.
DATA: gt_sflight TYPE TABLE OF sflight,
gt_data TYPE TABLE OF spfli,
gt_fieldcat TYPE lvc_t_fcat,
gt_sort TYPE lvc_t_sort,
gs_sflight TYPE sflight,
gs_layout TYPE lvc_s_layo.
* CLASS lcl_tree_event_receiver DEFINITION
CLASS lcl_tree_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS: handle_item_double_click
FOR EVENT item_double_click OF cl_gui_alv_tree_simple
IMPORTING fieldname
index_outtab
grouplevel.
ENDCLASS. "lcl_tree_event_receiver DEFINITION
* CLASS lcl_tree_event_receiver IMPLEMENTATION
CLASS lcl_tree_event_receiver IMPLEMENTATION.
METHOD handle_item_double_click.
READ TABLE gt_sflight INTO gs_sflight INDEX index_outtab.
IF sy-subrc EQ 0.
SELECT * FROM spfli INTO TABLE gt_data WHERE connid = gs_sflight-connid.
IF go_alv_area2 IS BOUND.
go_alv_area2->refresh( ).
cl_gui_cfw=>flush( ).
ENDIF.
cl_salv_table=>factory(
EXPORTING
r_container = go_cc_area2
IMPORTING
r_salv_table = go_alv_area2
CHANGING
t_table = gt_data ).
go_alv_area2->display( ).
ENDIF.
ENDMETHOD. "handle_item_double_click
ENDCLASS. "lcl_tree_event_receiver IMPLEMENTATION
START-OF-SELECTION.
CALL SCREEN 100.
*& Module STATUS_0100 OUTPUT
* text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'MAIN'.
* SET TITLEBAR 'xxx'.
CREATE OBJECT go_cc_area1
EXPORTING
container_name = 'CC'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
IF sy-subrc <> 0.
* MESSAGE e025 WITH sy-subrc text-e01.
ENDIF.
CREATE OBJECT go_splitter
EXPORTING
parent = go_cc_area1
orientation = 1 "Vertical split
sash_position = 25
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
* MESSAGE e025 WITH sy-subrc text-e02.
ENDIF.
go_container_tree = go_splitter->top_left_container.
go_container_2 = go_splitter->bottom_right_container.
CREATE OBJECT go_splitter_2
EXPORTING
parent = go_container_2
orientation = 0 "Horizontal split
sash_position = 40
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
* MESSAGE e025 WITH sy-subrc text-e02.
ENDIF.
go_cc_area2 = go_splitter_2->top_left_container.
CREATE OBJECT go_tree
EXPORTING
i_parent = go_container_tree
i_node_selection_mode = cl_gui_column_tree=>node_sel_mode_single
i_item_selection = gc_x
i_no_html_header = gc_x
i_no_toolbar = space
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
illegal_node_selection_mode = 5
failed = 6
illegal_column_name = 7.
IF sy-subrc <> 0.
* MESSAGE e025 WITH sy-subrc text-e03.
ENDIF.
SELECT * FROM sflight INTO TABLE gt_sflight WHERE carrid EQ p_carrid.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'SFLIGHT'
i_bypassing_buffer = gc_x
CHANGING
ct_fieldcat = gt_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
* MESSAGE e025 WITH sy-subrc text-e05.
ENDIF.
DATA: ls_fieldcatalog TYPE lvc_s_fcat.
LOOP AT gt_fieldcat INTO ls_fieldcatalog.
ls_fieldcatalog-col_opt = gc_x.
CASE ls_fieldcatalog-fieldname.
WHEN 'CARRID'.
ls_fieldcatalog-no_out = gc_x.
WHEN 'CONNID'.
ls_fieldcatalog-no_out = gc_x.
ENDCASE.
MODIFY gt_fieldcat FROM ls_fieldcatalog.
CLEAR ls_fieldcatalog.
ENDLOOP.
DATA: ls_sort TYPE lvc_s_sort.
ls_sort-spos = 1.
ls_sort-fieldname = 'CARRID'.
ls_sort-up = gc_x.
APPEND ls_sort TO gt_sort.
ls_sort-spos = 2.
ls_sort-fieldname = 'CONNID'.
ls_sort-up = gc_x.
APPEND ls_sort TO gt_sort.
DATA: lt_events TYPE cntl_simple_events,
lo_l_event TYPE cntl_simple_event.
lo_l_event-eventid = cl_gui_column_tree=>eventid_node_context_menu_req.
APPEND lo_l_event TO lt_events.
lo_l_event-eventid = cl_gui_column_tree=>eventid_item_context_menu_req.
APPEND lo_l_event TO lt_events.
lo_l_event-eventid = cl_gui_column_tree=>eventid_header_context_men_req.
APPEND lo_l_event TO lt_events.
lo_l_event-eventid = cl_gui_column_tree=>eventid_expand_no_children.
APPEND lo_l_event TO lt_events.
lo_l_event-eventid = cl_gui_column_tree=>eventid_item_double_click.
APPEND lo_l_event TO lt_events.
lo_l_event-eventid = cl_gui_column_tree=>eventid_button_click.
APPEND lo_l_event TO lt_events.
lo_l_event-eventid = cl_gui_column_tree=>eventid_node_double_click.
APPEND lo_l_event TO lt_events.
CALL METHOD go_tree->set_registered_events
EXPORTING
events = lt_events
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
illegal_event_combination = 3.
* Set Handler
CREATE OBJECT go_tree_event_receiver.
SET HANDLER go_tree_event_receiver->handle_item_double_click FOR go_tree.
CALL METHOD go_tree->set_table_for_first_display
EXPORTING
i_background_id = space
is_layout = gs_layout
CHANGING
it_sort = gt_sort
it_outtab = gt_sflight
it_fieldcatalog = gt_fieldcat.
CALL METHOD go_tree->expand_tree
EXPORTING
i_level = 2.
IF NOT gt_sflight[] IS INITIAL.
CALL METHOD go_tree->set_top_node
EXPORTING
i_index_outtab = 0.
ENDIF.
* Send data to frontend.
CALL METHOD go_tree->frontend_update.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'BACK'.
SET SCREEN 0.
LEAVE SCREEN.
WHEN OTHERS.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
Edited by: Srinivas Kalluri on Jan 31, 2012 4:49 PM
Similar Messages
-
ALV grid list report when selected from selection screen
Hi folks,
I need to get ALV grid display in my list report when selected the interval values from the selection screen. If I change the values in list of ALV grid it needs to be updated when I press UPDATE pushbutton. The output of list should be in ALV grid display.I need sorting ,flitering,totaling functionality in the list output.
For example if I selected BUKRS = 100 and 200 in the selection screen ,I need to display the ALV grid list in below the selection screen as ALV grid display...
Its urgent as I am new to ALV grid functionality...
Thanks in advance..hi raja,
check with the folllowing code.
REPORT zca0m_zca0fcstftop NO STANDARD PAGE HEADING
MESSAGE-ID zcsv_usrtbl_maintain.
Type pools *
TYPE-POOLS : slis. " Used for ALV display
Tables
TABLES: zca0fcstftop,
dd04t, "R/3 DD: Data element texts
tactt. "Activities that can be protected
internal tables
DATA: BEGIN OF wa_zca0fcstftop .
INCLUDE STRUCTURE zca0fcstftop.
DATA: END OF wa_zca0fcstftop.
DATA: t_zca0fcstftop LIKE STANDARD TABLE OF wa_zca0fcstftop.
DATA: BEGIN OF i_fcode OCCURS 0,
fcode LIKE sy-ucomm,
END OF i_fcode.
*Record for variant selection
DATA : BEGIN OF ws_variant,
selected TYPE c,
variant LIKE ltdx-variant, "Variant name
text LIKE ltdxt-text, "Variant description
END OF ws_variant.
*Table for variant selection
data : itab_variant LIKE STANDARD TABLE OF ws_variant WITH HEADER LINE.
Variant selection pop-up global variables
DECLARATION OF TABLECONTROL 'VARIANT_CNTL' ITSELF
CONTROLS: variant_cntl TYPE TABLEVIEW USING SCREEN 0200.
LINES OF TABLECONTROL 'VARIANT_CNTL'
DATA: g_variant_cntl_lines LIKE sy-loopc.
DATA:grid1 TYPE REF TO cl_gui_alv_grid ,
g_custom_container TYPE REF TO cl_gui_custom_container.
Work fields
DATA: table_name LIKE dd02l-tabname, "To store table name
field_name LIKE dd03l-fieldname, "To Store Field Name
act_auth LIKE tactz-actvt, "To pass Activity ID
tab_maint LIKE dd02l-tabname, "To pass Table Name to be Maintd.
wg_confirm_ind, "To trap User responses
flag, "To trap changes made to an entry
f_copy, "To Identify 'COPY' Command Use
f_select, "To decide between Select-options
" and Internal Table
l_transaction_code LIKE tstc-tcode,
v_langu LIKE sy-langu,
v_repid LIKE sy-repid,
s_variant TYPE disvariant.
DATA: ok_code LIKE sy-ucomm.
DATA:selected_rows TYPE lvc_t_row ,
sel_rows TYPE lvc_t_row WITH HEADER LINE.
DATA:t_lines TYPE i.
Constants *
CONSTANTS :
c_x TYPE c VALUE 'X', " Constant 'X'.
c_f TYPE c VALUE 'F'. " Constant 'F'.
Parameters and Selection Options
*Selection Screen for table maintenance
*Selection option for Plant
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-b01.
PARAMETERS: p_werks LIKE zca0fcstftop-werks OBLIGATORY.
SELECT-OPTIONS: s_prdfml FOR zca0fcstftop-product_family,
s_bmach FOR zca0fcstftop-base_machine,
s_factop FOR zca0fcstftop-factory_top,
s_optval FOR zca0fcstftop-option_value,
s_week FOR zca0fcstftop-week.
SELECTION-SCREEN END OF BLOCK block1.
SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME TITLE text-b02.
PARAMETERS : p_varant LIKE ltdx-variant. " ALV variant
SELECTION-SCREEN END OF BLOCK block2.
At selection screen *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_varant.
PERFORM alv_variant_f4 CHANGING p_varant.
AT SELECTION-SCREEN ON p_werks .
Validating Plant on the selection screen
PERFORM validate_plant.
Initialization
INITIALIZATION.
Check Authorization for the Transaction
Authorization Check For T Code
SELECT tcode
INTO l_transaction_code
FROM tstc UP TO 1 ROWS
WHERE pgmna = sy-repid.
ENDSELECT.
AUTHORITY-CHECK OBJECT 'S_TCODE'
ID 'TCD' FIELD l_transaction_code.
IF sy-subrc NE 0.
MESSAGE e001 WITH l_transaction_code.
ENDIF.
v_langu = sy-langu. " language
v_repid = sy-repid . " abap Program name
Start Of Selection
START-OF-SELECTION.
CALL SCREEN 0050.
*& Form validate_plant *
Validating Plant on the selection screen *
FORM validate_plant .
DATA : l_werks LIKE t001w-werks. " Plant
IF p_werks IS NOT INITIAL.
SELECT SINGLE werks
FROM t001w
INTO l_werks
WHERE werks EQ p_werks.
IF sy-subrc NE 0.
MESSAGE e100(ra) WITH text-001 .
ENDIF.
ENDIF.
AUTHORITY-CHECK OBJECT 'Z_PP_PLANT'
ID 'ACTVT' FIELD '03'
ID 'WERKS' FIELD p_werks
ID 'TCD' FIELD l_transaction_code.
IF sy-subrc NE 0.
MESSAGE e000(oo) WITH 'No authorization for plant:'(e80) p_werks.
ENDIF.
ENDFORM. " validate_plant
*& Form get_data *
Get data *
FORM get_data .
SELECT * FROM zca0fcstftop
INTO TABLE t_zca0fcstftop
WHERE werks = p_werks
AND product_family IN s_prdfml
AND base_machine IN s_bmach
AND factory_top IN s_factop
AND option_value IN s_optval
AND week IN s_week.
ENDFORM. " get_data
*& Form fill_fcode
FORM fill_fcode USING value(p_0029).
i_fcode-fcode = p_0029.
APPEND i_fcode.
CLEAR i_fcode.
ENDFORM. " fill_fcode
*& Module STATUS_0100 OUTPUT
MODULE status_0100 OUTPUT.
SET PF-STATUS 'UPDATE'.
CLEAR flag.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module MODIFY_0100 OUTPUT
MODULE modify_0100 OUTPUT.
IF sy-ucomm = 'CHNG' OR
sy-ucomm = 'PICK'.
LOOP AT SCREEN.
CHECK screen-group1 = 'CHG'.
screen-required = '0'.
screen-output = '1'.
screen-input = '0'.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
Check if you are in create mode & if yes then set the screen elements
as mandatory
IF ok_code = 'CREA'.
LOOP AT SCREEN.
CHECK screen-group1 = 'CHG'.
screen-required = '1'.
screen-output = '1'.
screen-input = '1'.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
ENDMODULE. " MODIFY_0100 OUTPUT
*& Module Check_Exit INPUT
text
MODULE check_exit INPUT.
IF ( sy-ucomm = 'BACK' OR sy-ucomm = 'CANC' OR sy-ucomm = 'EXIT' ) AND
( flag = 'Y' ).
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING
defaultoption = 'Y'
textline1 = text-008
textline2 = text-009
titel = text-004
cancel_display = ' '
IMPORTING
answer = wg_confirm_ind.
CASE wg_confirm_ind.
WHEN 'J'. "Yes
sy-ucomm = 'SAVE'.
CLEAR flag.
WHEN 'N'. "No
sy-ucomm = 'BACK'.
CLEAR flag.
ENDCASE.
ENDIF.
ENDMODULE. " Check_Exit INPUT
*& Module Exit_0100 INPUT
text
MODULE exit_0100 INPUT.
SET SCREEN 0. LEAVE SCREEN.
ENDMODULE. " Exit_0100 INPUT
*& Module USER_COMMAND_0100 INPUT
text
MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'SAVE'. "Save
Check to see if the user has the appropriate authorization
IF p_werks NE zca0fcstftop-werks.
could not update - not in selection
MESSAGE e000(oo) WITH 'Entry not within selection'.
SET SCREEN 0. LEAVE SCREEN.
PERFORM get_data.
ENDIF.
IF f_copy = 'X'.
INSERT zca0fcstftop.
IF sy-subrc = 0.
MESSAGE s004.
PERFORM initialize.
SET SCREEN 0. LEAVE SCREEN.
PERFORM get_data.
ELSE.
MESSAGE w005.
ENDIF.
ELSE.
MODIFY zca0fcstftop.
IF sy-subrc = 0.
MESSAGE s004.
PERFORM initialize.
SET SCREEN 0. LEAVE SCREEN.
PERFORM get_data.
ELSE.
MESSAGE w005.
ENDIF.
ENDIF.
PERFORM get_data.
WHEN 'BACK'. "Back
SET SCREEN 0. LEAVE SCREEN.
WHEN 'CANC'. "Cancel
SET SCREEN 0. LEAVE SCREEN.
WHEN OTHERS.
ENDCASE.
COMMIT WORK.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form Initialize
FORM initialize.
CLEAR : table_name,
field_name,
wg_confirm_ind,
f_copy,
flag,
t_zca0fcstftop,
zca0fcstftop,
wa_zca0fcstftop,
i_fcode.
REFRESH: t_zca0fcstftop.
ENDFORM. " Initialize
*& Form alv_variant_f4
text
<--P_VARIANT text
FORM alv_variant_f4 CHANGING variant.
DATA: rs_variant LIKE disvariant.
DATA nof4 TYPE c.
CLEAR nof4.
LOOP AT SCREEN.
IF screen-name = 'VARIANT'.
IF screen-input = 0.
nof4 = 'X'.
ENDIF.
ENDIF.
ENDLOOP.
rs_variant-report = sy-repid.
rs_variant-username = sy-uname.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = rs_variant
i_save = 'A'
IMPORTING
es_variant = rs_variant
EXCEPTIONS
OTHERS = 1.
IF sy-subrc = 0 AND nof4 EQ space.
variant = rs_variant-variant.
ENDIF.
ENDFORM. " ALV_VARIANT_F4
*& Module STATUS_0050 OUTPUT
text
MODULE status_0050 OUTPUT.
In this module Initialize the container and put the grid in it
DATA:grid_layout TYPE lvc_s_layo,
fieldcat TYPE lvc_t_fcat,
wa_fieldcat LIKE LINE OF fieldcat.
PERFORM set_auth.
SET PF-STATUS 'UPD_0050' EXCLUDING i_fcode.
SET TITLEBAR 'UPD_0050'.
IF g_custom_container IS INITIAL .
CREATE OBJECT g_custom_container
EXPORTING
container_name = 'FTDATA'.
CREATE OBJECT grid1
EXPORTING
i_parent = g_custom_container.
ELSE.
CALL METHOD grid1->free.
CALL METHOD g_custom_container->free.
CREATE OBJECT g_custom_container
EXPORTING
container_name = 'FTDATA'.
CREATE OBJECT grid1
EXPORTING
i_parent = g_custom_container.
ENDIF.
Every time refresh The variables
PERFORM initialize.
PERFORM get_data.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'ZCA0FCSTFTOP'
CHANGING
ct_fieldcat = fieldcat.
grid_layout-grid_title = text-t01.
grid_layout-sel_mode = 'A'.
grid_layout-stylefname = 'CT'.
s_variant-report = sy-repid.
s_variant-username = sy-uname.
s_variant-variant = p_varant.
CALL METHOD grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'ZCA0FCSTFTOP'
is_layout = grid_layout
is_variant = s_variant
i_save = 'A'
CHANGING
it_outtab = t_zca0fcstftop
it_fieldcatalog = fieldcat.
Create Object to receive events and link them to handler methods.
When the ALV Control raises the event for the specified instance
the corresponding method is automatically called.
CREATE OBJECT event_receiver.
SET HANDLER event_receiver->handle_button_click FOR grid1.
ENDMODULE. " STATUS_0050 OUTPUT
*& Module USER_COMMAND_0050 INPUT
MODULE user_command_0050 INPUT.
CALL METHOD grid1->get_selected_rows
IMPORTING
et_index_rows = selected_rows.
DESCRIBE TABLE selected_rows LINES t_lines.
IF t_lines > 1 .
MESSAGE e048(zcsv_sfdr).
ENDIF.
Clear Header
CLEAR wa_zca0fcstftop.
sel_rows[] = selected_rows .
READ TABLE sel_rows INDEX 1.
READ TABLE t_zca0fcstftop INTO wa_zca0fcstftop INDEX sel_rows-index.
CASE ok_code.
WHEN 'EXIT'.
PERFORM exit_program.
WHEN 'CREA'.
CLEAR zca0fcstftop.
ok_code = sy-ucomm.
zca0fcstftop-werks = p_werks.
CALL SCREEN 100.
WHEN 'COPY'.
MOVE wa_zca0fcstftop TO zca0fcstftop .
CLEAR wa_zca0fcstftop.
f_copy = 'X'.
CALL SCREEN 100.
WHEN 'CHNG'.
CHECK NOT wa_zca0fcstftop IS INITIAL.
MOVE wa_zca0fcstftop TO zca0fcstftop .
CLEAR wa_zca0fcstftop.
ok_code = sy-ucomm.
CALL SCREEN 100.
WHEN 'DELE'.
CHECK NOT wa_zca0fcstftop IS INITIAL.
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING
defaultoption = 'N'
textline1 = text-005
textline2 = text-006
titel = text-007
cancel_display = ' '
IMPORTING
answer = wg_confirm_ind.
IF wg_confirm_ind EQ 'J'.
DELETE zca0fcstftop FROM wa_zca0fcstftop .
IF sy-subrc EQ 0.
MESSAGE s004.
ELSE.
MESSAGE e005.
ENDIF.
ELSEIF wg_confirm_ind EQ 'N'.
ENDIF.
ENDCASE.
CLEAR ok_code.
ENDMODULE. " USER_COMMAND_0050 INPUT
*& Form exit_program
FORM exit_program .
CALL METHOD g_custom_container->free.
CALL METHOD cl_gui_cfw=>flush.
SET SCREEN 0.
LEAVE SCREEN.
ENDFORM. " exit_program
*& Form set_auth
FORM set_auth.
REFRESH: i_fcode.
Check authorization for change
MOVE '02' TO act_auth. "02 --> Change
MOVE 'ZCA0FCSTFTOP' TO tab_maint.
AUTHORITY-CHECK OBJECT 'ZZ:TABLMNP'
ID 'ACTVT' FIELD act_auth
ID 'TABLE' FIELD tab_maint.
IF sy-subrc NE 0.
PERFORM fill_fcode USING 'CHNG'.
ENDIF.
Check for authorization for create
MOVE '01' TO act_auth. "01 --> Create
MOVE 'ZCA0FCSTFTOP' TO tab_maint.
AUTHORITY-CHECK OBJECT 'ZZ:TABLMNP'
ID 'ACTVT' FIELD act_auth
ID 'TABLE' FIELD tab_maint.
IF sy-subrc NE 0.
PERFORM fill_fcode USING 'CREA'.
PERFORM fill_fcode USING 'COPY'.
ENDIF.
Check for authorization for delete
MOVE '06' TO act_auth. "06 --> Delete
MOVE 'ZCA0FCSTFTOP' TO tab_maint.
AUTHORITY-CHECK OBJECT 'ZZ:TABLMNP'
ID 'ACTVT' FIELD act_auth
ID 'TABLE' FIELD tab_maint.
IF sy-subrc NE 0.
PERFORM fill_fcode USING 'DELE'.
ENDIF.
ENDFORM. " set_auth
*& Module check_change INPUT
MODULE check_change INPUT.
flag = 'Y'.
ENDMODULE. " check_change INPUT
regards,
vikas.
plz reward if helpful -
Double click in alv grid not refreshing until I click elsewhere
Hello,
I'm very new to abap and just managed to partly implement double click in an alv grid.
I also created a button that calls the exact same function as double click (selects the row and fills in the data areas on the page). When I use the button, everything works fine, but when I double click, nothing changes until I click on a tab or other form of input button on the page.
I have followed the process in debugging and can't find the fault anywhere.
My double click is implemented by:
create object lcl_event_receiver.
set handler lcl_event_receiver->double_click
for search_alv_grid.
endif.
CLASS lcl_event_handler DEFINITION.
public section.
methods:
double_click for event double_click
of cl_gui_alv_grid.
ENDCLASS. "lcl_event_handler
CLASS lcl_event_handler IMPLEMENTATION.
* METHOD double_click *
method double_click.
perform select_search_result.
endmethod. "double_click
ENDCLASS.
Any help would be much appreciatedHello,
Try using the template code given below. Let me know if you have any questions.
data : GT_EVENTS TYPE SLIS_T_EVENT.
get event
PERFORM BUILD_EVENT_TOPOFPAGE USING GT_EVENTS[].
display alv data
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = W_xxxxx
IT_FIELDCAT = GT_xxxx
IT_EVENTS = GT_EVENTS[]
TABLES
T_OUTTAB = T_xxxx
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
get event perform
FORM BUILD_EVENT_TOPOFPAGE USING LT_EVENTS TYPE SLIS_T_EVENT.
DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = LT_EVENTS.
Read double click event using the below statement
READ TABLE LT_EVENTS WITH KEY NAME = SLIS_EV_USER_COMMAND
INTO LS_EVENT.
IF SY-SUBRC = 0.
ENDIF.
ENDFORM. " BUILD_EVENT_TOPOFPAGE
FORM USER_COMMAND USING L_UCOMM LIKE SY-UCOMM
LS_SELFIELD TYPE SLIS_SELFIELD.
CASE L_UCOMM.
WHEN <double click>
Perform do_something.
ENDCASE.
ENDFORM. " USER_COMMAND
Best Regards,
Krishna -
Detail region does not refresh when selecting from a drop-down list in master region
I am using DW CS3 and have updated to version 1.6.1 of Spry. Using an XML dataset, I am able to create a Spry table as the master region that links to a detail region that displays a small JPG graphic. It works fine in this format (clicking on a row displays the correct graphic). However, my table has 80 rows and requires the user to do too much scrolling. So I changed the master region to a drop-down repeat list, but the graphic does not change when a new selection is made in the drop down list. Listed below is the code produced when I used the insert Spry Repeat List. I got the same results when adding a spry:setrow="dsChartNurse". I also tried -- onclick="dsChartNurse.setCurrentRow('{ds_RowID}');" -- which again made no difference.
When I removed children from the spry:repeat, the master region displayed as a two column list of all 80 items in a drop-down list format.
<div spry:region="dsChartNurse">
<select name="select" spry:repeatchildren="dsChartNurse">
<option value="{name}">{name}</option>
</select>
</div>
<div id="image" spry:detailregion="dsChartNurse">
<img src="{dataimage}" align="center" style="margin:50px 0 0 0"width="320" height="164" />
</div>
Thanks so much to anyone who can help correct my code in order to have a drop-down list display information correctly in the detail region.Thanks for the quick reply. I did solve the problem I was having by changing from onclick to onchange in the master region. But, now I have another problem with, of course, IE. I just put in online at http://www.minursemap.org/ageDistNurse.html. When opened in IE, the drop down list displays the last entry, but the image is for the first in the list. Thanks again for your help.
-
Swing problem: table is not refreshed when i open it from jdialog
Hi , my situation is this one :
1. i have a swing form.
2. i have created a panel form where i have a drop down list and a table. wich are depndend with each other. When i choose an item to the drop down list the value in the table is changed.
3. i invoke this panel into the form with drag and drop, with invoke jDialog from button option.
4. First time i run the form and open the panel from button the drop down list and the table are working correctly.
5. i close the panel and open it again: And at this time when i choose an item from drop down list the table is not refreshed anymore. I have to run the form again if i want that this panel to work correctly.
Am i doing smth wrong? I dont have too much experience in swing , and the documentation for adf-swign are really poor .
Ps: Maybe i should explain the way i have created the drop down list and table in the panel . i am not using smth like execute with parameters for the view in the table. I have created a link between the view in the drop down list and the view in the table. It seems they work correcly if i run the panel for the first time.
Thanks in advance !To answer your question, Restore the iPhone with current iTunes on your computer. If fixed, it was software. If still problem, most likely hardware, and then make Genius reservation or set up Service and take or send to Apple for resolution under Warranty.
-
ALV OO data is not refreshing when selection changes on previous screen
Hi All,
I have a module pool with 2 screens. First screen has plant and 1 button. When button is pressed in screen 1 the 2nd screen shows some data as per the plant selection in screen 1. The output of screen 2 is coded in OO ALV.
Now the problem is first time when plant is input and button is pressed the data is fine in screen 2. However 2nd time onwards the data is not getting updated on ALV when plant selection is changed! It gets stuck to the data it produced the very first time.
I've debugged the program and table which passes to method "set_table_for_first_display" is fine i.e. it selects new data everytime as per plant and fills this table. I've also tried GUI FLUSH, calling method "refresh_table_display", FREE, clear, unassign etc. etc. at diff. points but nothing seems to work
<b>I'll be generously giving away points with any help.</b>
Thanks.Hi,
1. Please refresh the output table before the select query which you are passing to set_table_for_first_display.
2. The ALV container needs to be freed & again generated everytime you call the screen.
so on the BACK button of Screen 2 in PAI, release & clear the container
In the PBO of Screen 2, Assign grid to container.
Here is the sample program:
PROGRAM TEST.
DATA: OK_CODE LIKE SY-UCOMM,
GT_SFLIGHT TYPE TABLE OF SFLIGHT,
G_CONTAINER TYPE SCRFNAME VALUE 'BCALV_GRID_DEMO_0100_CONT1',
GRID1 TYPE REF TO CL_GUI_ALV_GRID,
G_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
* MAIN *
SELECT * FROM SFLIGHT INTO TABLE GT_SFLIGHT.
CALL SCREEN 100.
* MODULE PBO OUTPUT *
MODULE PBO OUTPUT.
SET PF-STATUS 'MAIN100'.
IF G_CUSTOM_CONTAINER IS INITIAL. " Check this
CREATE OBJECT G_CUSTOM_CONTAINER " DO this
EXPORTING CONTAINER_NAME = G_CONTAINER.
CREATE OBJECT GRID1 "DO this
EXPORTING I_PARENT = G_CUSTOM_CONTAINER.
CALL METHOD GRID1->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING I_STRUCTURE_NAME = 'SFLIGHT'
CHANGING IT_OUTTAB = GT_SFLIGHT.
ENDIF.
ENDMODULE.
* MODULE PAI INPUT *
MODULE PAI INPUT.
* to react on oi_custom_events:
call method cl_gui_cfw=>dispatch.
CASE OK_CODE.
WHEN 'EXIT'.
PERFORM EXIT_PROGRAM.
WHEN OTHERS.
* do nothing
ENDCASE.
CLEAR OK_CODE.
ENDMODULE.
* FORM EXIT_PROGRAM *
FORM EXIT_PROGRAM.
CALL METHOD G_CUSTOM_CONTAINER->FREE. " Do under BACK button
CALL METHOD CL_GUI_CFW=>FLUSH. "Do under back button
LEAVE PROGRAM.
ENDFORM. -
Issue with events not propagating when selecting toolbar items
Hey All,
I'm on OS X Lion using CS6 beta and observing events in Photoshop form an outside application using Cocoa's NSEvent#addGlobalMonitorForEventsMatchingMask.
It seems Photoshop is stoping the propogation of some events coming out of selection of toolbar items. Here's the issue:
There are two ways to select the Pencil tool from the toolbar. (Method A) I can click the Paintbrush, holding down for a second and releasing, then mouse move to the Pencil and click, OR (Method B) I can mouse down the on the Paintbrush and drag the mouse to the Pencil.
If I use Method A I get what seems to be every event associated with the interaction, BUT If I use Method B Photoshop seems to stop the propogation of a lot of drag events.
Are there any experts out there that have an knowledge of why this is, or if there are any known work arounds?
Regards,
Ned
ps This is also an isue in Photoshop 5Ned, this is a bit over my head, but FYI (and your troubleshooting research), there are other methods to get alternate tools: ALT+click to cycle them, CMD/right-click to get the flyout, and Shift+Tool shortcut (unless you changed the setting in preferences)
BTW, method B is not the same as A? The only difference is that in A, there is a release, then a move to target area, then another click, while in B, we have a hold, then a move to the target area, then release. -
Set cursor alv grid (not using objects)
I got a question on ALV GRID (not using objects), please let me know if you have pointers. Thanks.
Output has 2 screens both has different contents. The output is generated using internal table1 and 2 and using FM 'REUSE_ALV_GRID_DISPLAY_LVC' (both screen use same FM).
First screen has multiple pages of output (say 10 pages). User scrolled page 5 and line 10 of first screen and then double clicked it takes to screen #2. After completion of screen #2, the back arrow should get back to page 5 and line 10 of screen #1. Currently the back arrow gets to screen#1 page 1 and line 1. How to remember the cursor position in alv grid and instruct the cursor to go there?
Appreciate the input.
Note: I tried "set cursor line n" with "Scroll" command but no luck. http://help.sap.com/saphelp_nw70/helpdata/EN/9f/dba47e35c111d1829f0000e829fbfe/content.htmThanks for the inputs.
FYI, I got it implemented using method CALL METHOD <ref.var. to CL_GUI_ALV_GRID > ->set_current_cell_via_id
The method is called by 'REUSE_ALV_GRID_DISPLAY_LVC' form 'PF_STATUS_SET' when the ALV grid output is presented each time.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
EXPORTING
i_bypassing_buffer = 'X'
i_callback_program = gc_repid
i_callback_pf_status_set = 'PF_STATUS_SET'
i_callback_user_command = 'USER_COMMAND'
is_layout_lvc = lwa_layout
it_fieldcat_lvc = git_fc_lvc
i_default = ' '
TABLES
t_outtab = git_data
EXCEPTIONS
program_error = 1
OTHERS = 2.
FORM alv_event_pf_status_set USING rt_extab
TYPE slis_t_extab.
DATA lo_ref1 TYPE REF TO cl_gui_alv_grid.
*Get the reference to class "lo_ref1" for the ALV report
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = lo_ref1.
*set the focus of cursor in ALV
CALL METHOD lo_ref1->set_current_cell_via_id
EXPORTING
is_row_no = gv_row. "row number where you want to focus the cursor
ENDFORM. -
Image does not refresh when I undo
This seems only to happen when using my Wacom. A lot of friends have the same problem.
The viewport/canvas does not refresh when undoing a paint stroke done with my Wacom Intuos4 Wireless. But when I make a new paint stroke or zoom in or something else that requires the viewport to refresh it looks correct. I am using Photoshop CS5.1 (Production Premium CS5.5). I am running Mac OS X Lion on a MacBook Pro 13" 2011.
Anyone else having this issue? It seems like a nasty bug to me.OK, I have done some testing and this happens on three friends computers. What we have in common is Wacom Tablets (different kinds, intous3, intuos4, bamboo and intuos4wl), Photoshop CS5.5, OS X Lion and Macbook 13" 2011.
However, another friend just bought a new intuos4wl for his Macbook Pro 15" late 2008 (MacBook Pro5,1) thats running Snow Leopard. So far this seems to only happen with wacoms + cs5.5 + lion. And another friend is running CS5 on a MacBook Pro 13" 2011 without problems.
I would say that the problem is PS CS5.1 in conjunction with Lion and Wacom tablets. Scratch what I said earlier about external monitors. -
After installing Exchange 2010 SP3 RU3, I had an issue in Public Folders, once having group by categories in Outlook, the Group of "(None)" categories is not refreshing when changing flag... I also installed RU4 but nothing changed, any reason
ThxHi,
From your description, the group with none categories won’t fresh when changing flag in Category view. If I misunderstood, please point it out.
As you can in the View tab as below, there is Category as well as Flag: Start date or Due Date. It means that grouping per color categories is more or less different from that
grouping by flag.
Should you need more assistance, feel free to tell me.
Regards,
Rebecca Tu
TechNet Community Support -
My hp4530s wifi switch does not enable when selected
hp4530s with windows 7 prof. The wifi switch does not enable when selected in mobility manager in the control panel. The option is shown, however is grayed out and does not enable the wifi
Hi,
When was the last time that WIFI worked on the HP4530s? If you aer using a dock, then remove the laptop from the dock.
You can check the status of the WIFI adapter in Device Manager. You should have something similar to the below image if your model is equipped with WIFI.
The HP Support Assistant and also be used to troubleshoot network issues.
Look under the Internet and Security topics in HPSA for the adapter.
Try diagnostics under the My computer tab in HPSA
HP DV9700, t9300, Nvidia 8600, 4GB, Crucial C300 128GB SSD
HP Photosmart Premium C309G, HP Photosmart 6520
HP Touchpad, HP Chromebook 11
Custom i7-4770k,Z-87, 8GB, Vertex 3 SSD, Samsung EVO SSD, Corsair HX650,GTX 760
Custom i7-4790k,Z-97, 16GB, Vertex 3 SSD, Plextor M.2 SSD, Samsung EVO SSD, Corsair HX650, GTX 660TI
Windows 7/8 UEFI/Legacy mode, MBR/GPT -
Hello,
Suddenly the working CRM is being stopped for some group of users.
I drilled down to the issue and have checked that the users from Domain in which CRM is installed are having CRM access.
But for other domain user having problem to access CRM.
I tried to add a user from a domain which is not of CRM domain then it gives following error.
"Business Management Error: You are attempting to create a user with a domain logon that does not exist. Select another domain logon and try again.
<Message>LookupAccountNameW failed with error</Message> "
The change is made - AD group have upgraded Activer Directory server to 2012 R2
Please help as the Production CRM is not working for other domain user.We have Activer Directory Structure like below.
One Root Domain says A
and there are multiple child domain like B,C,D etc...
B,C and D are all in same level,they are child of A domain.
There are two way transitive trusts between A and all the child Domain.
But there is no trust in between B and C and so on.
Our CRM server is in B domain and B domain's user can access CRM but users of Domain C,D and so on can not access CRM.
If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful" -
Problem with ALV Grid Not Displaying Data
Hi Gurus,
I have a report program, when i run it I display an output summary on ALV Grid, and when i click on each of the row in the output summary, I'm suppose to see the item detail of each record.
This item detail is showing for some record and is not showing for some other records (when i use different selections). I debugged it and observed that the table populating the ALV grid actually has records in it. The ALV grid is not just displaying the records.
I debugged the 2 examples (one showing record and the other not showing), I found out that nothing is different in the way they run till they populate the final internal record to passed to the ALV Grid.
Please any suggestions on this:
This is the function code for the ALV grid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = g_program_id
i_callback_pf_status_set = c_detail_status
i_callback_user_command = c_detail_user_comm
i_grid_title = lv_grid_title
is_layout = w_detail_layout
it_fieldcat = i_detail_fieldcat
it_sort = i_detail_sort
TABLES
t_outtab = i_faglflexa[] "NEM - detail
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE e064
WITH sy-subrc.
Function REUSE_ALV_GRID_DISPLAY failed on detail view SY-SUBRC = &
ENDIF.This is the full code:
***INCLUDE ZFIGL_HYPERION_F01.
*& Form open_files
Open files used by the program.
FORM open_files.
OPEN DATASET p_fileot FOR OUTPUT IN TEXT MODE ENCODING DEFAULT
MESSAGE g_message.
IF sy-subrc <> 0.
MESSAGE e056
WITH g_message.
Unable to open output file &
ENDIF.
ENDFORM. " open_files
*& Form close_files
Close files used by the program.
FORM close_files.
CLOSE DATASET p_fileot.
ENDFORM. " close_files
*& Form extract_data
Extract data from database needed to generate output file and report.
FORM extract_data.
Get the required general ledger totals records.
PERFORM get_faglflext_data.
Derive any other necessary fields for I_FAGLFLEXT.
PERFORM derive_add_fields_faglflext.
Split records by fiscal period.
PERFORM split_records_by_period.
Summarize the detail records to allow for creation of the file and
reporting.
PERFORM summarize_records_by_period.
Get the required general ledger actual line items records.
PERFORM get_faglflexa_data.
Derive any other necessary fields for I_FAGLFLEXA.
PERFORM derive_add_fields_faglflexa.
Sort the detail and summary output tables into key sequence.
PERFORM sort_output_tables.
ENDFORM. " extract_data
*& Form process_data
Create the requested file and report.
FORM process_data.
Create the local file if requested by the user or the month-end file
at month-end.
IF cb_test = c_not_selected.
PERFORM create_pc_file.
ELSEIF sy-uname = c_user_batch_admin.
PERFORM create_output_file.
ENDIF.
Create the necessary tables for summary ALV report.
PERFORM build_summary_layout.
PERFORM build_summary_field_catalog.
PERFORM build_summary_sort_table.
Check to see that there is data in the summary output table. If yes,
generate report, if not, then give a message to the user.
READ TABLE i_output_summary INDEX 1 TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
MESSAGE s062.
STOP.
No data extracted for selection criteria entered
ENDIF.
Generate the summary ALV report view.
PERFORM generate_summary_alv_report.
ENDFORM. " process_data
*& Form verify_user_selections
Verify data input by the user.
FORM verify_user_selections.
IF NOT p_ryear IS INITIAL.
IF p_ryear < 2006 OR
p_ryear > 2100.
MESSAGE e057.
Fiscal year is invalid
ENDIF.
ENDIF.
If program is being run in a non-test mode and the user has left the
fiscal year selection blank, display a error message.
IF cb_test IS INITIAL AND
p_ryear IS INITIAL.
MESSAGE e058.
A fiscal year must be entered when generating the file
ENDIF.
If program is being run in a non-test mode and the user has left the
period selection blank, display a error message.
IF cb_test IS INITIAL AND
s_rpmax IS INITIAL.
MESSAGE e132.
A period must be entered when generating the file
ENDIF.
IF cb_test IS INITIAL AND
p_lfile IS INITIAL.
MESSAGE e071.
Local filename is required when generating the file
ENDIF.
****Basil Balogun's addition to include the hyperion acct in selection. (10/03/2007)***
IF s_rhype IS NOT INITIAL.
LOOP AT s_rhype.
CLEAR r_hyper.
r_hyper-sign = 'I'.
r_hyper-option = 'CP'.
CONCATENATE '' s_rhype-low '' INTO r_hyper-low.
APPEND r_hyper.
ENDLOOP.
SELECT bukrs saknr hyper
FROM zall_gl_hype INTO TABLE i_zall_gl
WHERE hyper IN r_hyper.
LOOP AT i_zall_gl INTO w_zall_gl.
w_zall_gl1-saknr = w_zall_gl-saknr.
w_zall_gl2-bukrs = w_zall_gl-bukrs.
APPEND w_zall_gl1-saknr TO i_zall_gl1.
APPEND w_zall_gl2-bukrs TO i_zall_gl2.
CLEAR: w_zall_gl, w_zall_gl1, w_zall_gl2.
ENDLOOP.
SORT i_zall_gl1 BY saknr.
SORT i_zall_gl2 BY bukrs.
DELETE ADJACENT DUPLICATES FROM i_zall_gl1 COMPARING saknr.
DELETE ADJACENT DUPLICATES FROM i_zall_gl2 COMPARING bukrs.
IF s_racct IS INITIAL.
LOOP AT i_zall_gl1 INTO w_zall_gl1.
r_saknr-sign = 'I'.
r_saknr-option = 'EQ'.
r_saknr-low = w_zall_gl1.
APPEND r_saknr.
CLEAR r_saknr.
CLEAR w_zall_gl1.
ENDLOOP.
ELSE.
r_saknr[] = s_racct[].
ENDIF.
IF s_rbukrs IS INITIAL.
LOOP AT i_zall_gl2 INTO w_zall_gl2.
r_bukrs-sign = 'I'.
r_bukrs-option = 'EQ'.
r_bukrs-low = w_zall_gl2-bukrs.
APPEND r_bukrs.
CLEAR r_bukrs.
CLEAR w_zall_gl2.
ENDLOOP.
ELSE.
r_bukrs[] = s_rbukrs[].
ENDIF.
ELSE.
r_saknr[] = s_racct[].
r_bukrs[] = s_rbukrs[].
SELECT bukrs saknr hyper
FROM zall_gl_hype INTO TABLE i_zall_gl.
ENDIF.
****Basil Balogun's addition to include the hyperion acct in selection. (10/03/2007)***
ENDFORM. " verify_user_selections
*& Form get_faglflext_data
Get FAGLFLEXT (General Ledger: Totals) data from the database.
FORM get_faglflext_data .
Use the fiscal year for the selection, if it was populated by the
user.
IF NOT p_ryear IS INITIAL.
SELECT ryear rldnr rvers racct rbukrs prctr rfarea kokrs segment
zzsarea zzsareaim rassc hsl01 hsl02 hsl03 hsl04 hsl05 hsl06
hsl07 hsl08 hsl09 hsl10 hsl11 hsl12 hsl13 hsl14 hsl15 hsl16
hslvt
INTO TABLE i_faglflext
FROM faglflext
WHERE rldnr = c_run_ledger AND
rbukrs IN r_bukrs AND
racct IN r_saknr AND
rfarea IN s_rfarea AND
prctr IN s_prctr AND
ryear = p_ryear AND
rvers = c_run_version.
ELSE.
SELECT ryear rldnr rvers racct rbukrs prctr rfarea kokrs segment
zzsarea zzsareaim rassc hsl01 hsl02 hsl03 hsl04 hsl05 hsl06
hsl07 hsl08 hsl09 hsl10 hsl11 hsl12 hsl13 hsl14 hsl15 hsl16
hslvt
INTO TABLE i_faglflext
FROM faglflext
WHERE rldnr = c_run_ledger AND
rbukrs IN r_bukrs AND
racct IN r_saknr AND
rfarea IN s_rfarea AND
prctr IN s_prctr AND
rvers = c_run_version.
ENDIF.
ENDFORM. " get_faglflext_data
*& Form derive_add_fields_faglflext
Derive additional fields needed for the I_FAGLFLEXT.
FORM derive_add_fields_faglflext.
Get needed company code and profit center data from the database.
PERFORM get_t001_data.
PERFORM get_t880_data.
READ TABLE i_faglflext INDEX 1 TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
PERFORM get_cepc_data.
ENDIF.
SORT i_zall_gl BY bukrs saknr.
LOOP AT i_faglflext INTO w_faglflext.
Get necessary company code data.
READ TABLE i_t001 INTO w_t001
WITH KEY bukrs = w_faglflext-rbukrs
BINARY SEARCH.
IF sy-subrc <> 0.
MESSAGE e059
WITH w_faglflext-rbukrs.
Company code & not found on table T001
ENDIF.
Determine the entity.
PERFORM derive_entity USING w_t001-rcomp
CHANGING w_faglflext-entity.
Determine the strategic segment.
PERFORM derive_strategic_segment USING w_faglflext-rassc
w_faglflext-prctr
CHANGING w_faglflext-strat_seg
w_faglflext-zzsareaim
w_faglflext-zzsarea.
Determine the strategic segment channel.
PERFORM derive_strat_seg_chnl USING w_faglflext-rassc
w_faglflext-prctr
CHANGING w_faglflext-strat_seg_chnl.
Determine the all item ID and all products.
PERFORM derive_all_item_id USING w_t001-waers
CHANGING w_faglflext-all_item_id
w_faglflext-all_products.
Determine the all customers and all customers channel.
PERFORM derive_all_customers_fields USING w_faglflext-strat_seg
*w_faglflext-strat_seg_chnl
CHANGING w_faglflext-all_cust
*w_faglflext-all_cust_chnl.
Determine the sub account using the company ID of the trading partner.
PERFORM derive_sub_account USING w_faglflext-rassc
CHANGING w_faglflext-sub_acct.
PERFORM derive_sub_account USING w_t001-rcomp
w_faglflext-rassc
CHANGING w_faglflext-sub_acct.
****Begin Basil changes to include hyperion acct in selection (10/03/2007).
READ TABLE i_zall_gl INTO w_zall_gl
WITH KEY bukrs = w_faglflext-rbukrs
saknr = w_faglflext-racct
BINARY SEARCH.
IF sy-subrc = 0.
****End Basil changes to include hyperion acct in selection (10/03/2007).
Determine the Hyperion account number from G/L account long text.
PERFORM derive_hyperion_account USING w_faglflext-racct
w_faglflext-rfarea
"KMK5/22/06 ITR: 20592
w_faglflext-sub_acct
w_faglflext-rassc
w_faglflext-prctr
CHANGING w_faglflext-hyperion_acct
w_faglflext-reverse_sign "NEM8/21/06 ITR: 24286
w_faglflext-balance_sheet "NEM8/21/06 ITR: 24286
w_faglflext-zzsarea
w_faglflext-zzsareaim
w_faglflext-strat_seg.
ENDIF.
Determine the all customers and all customers channel.
PERFORM derive_all_customers_fields USING w_faglflext-strat_seg
w_faglflext-strat_seg_chnl
CHANGING w_faglflext-all_cust
w_faglflext-all_cust_chnl.
Update i_FAGLFLEXT with the newly derive fields.
MODIFY i_faglflext FROM w_faglflext
TRANSPORTING entity
strat_seg
strat_seg_chnl
all_item_id
all_products
all_cust
all_cust_chnl
hyperion_acct
sub_acct
fiscal_period
zzsarea
zzsareaim
reverse_sign "NEM8/21/06 ITR: 24286
balance_sheet. "NEM8/21/06 ITR: 24286
ENDLOOP.
CHECK s_rhype IS NOT INITIAL.
SORT s_rhype BY low.
LOOP AT i_faglflext INTO w_faglflext.
READ TABLE s_rhype WITH KEY low = w_faglflext-hyperion_acct.
IF sy-subrc NE 0.
CLEAR w_faglflext-hyperion_acct.
MODIFY i_faglflext FROM w_faglflext.
ENDIF.
ENDLOOP.
DELETE i_faglflext WHERE hyperion_acct IS INITIAL.
ENDFORM. " derive_add_fields_faglflext
*& Form derive_entity
Derive the entity using the company code.
-->RCOMP - Company code.
<--ENTITY - Entity
FORM derive_entity USING rcomp TYPE t_t001-rcomp
CHANGING entity TYPE t_faglflext-entity.
CLEAR:
entity.
Get necessary global company code data.
READ TABLE i_t880 INTO w_t880
WITH KEY rcomp = rcomp
BINARY SEARCH.
IF sy-subrc = 0.
entity = w_t880-name2+0(3).
TRANSLATE entity TO UPPER CASE.
ELSE.
MESSAGE e060
WITH w_t001-rcomp.
Company code & not found on table T880
ENDIF.
ENDFORM. " derive_entity
*& Form get_t001_data
Get T001 (Company Codes) data from the database.
FORM get_t001_data.
SELECT bukrs waers rcomp
INTO TABLE i_t001
FROM t001
CLIENT SPECIFIED
WHERE mandt = sy-mandt.
SORT i_t001 BY bukrs.
ENDFORM. " get_t001_data
*& Form get_t880_data
Get T880 (Global Company Data (for KONS Ledger)) data from the
database.
FORM get_t880_data.
SELECT rcomp name2
INTO TABLE i_t880
FROM t880
CLIENT SPECIFIED
WHERE mandt = sy-mandt.
SORT i_t880 BY rcomp.
ENDFORM. " get_t880_data
*& Form derive_all_item_id
Derive the all item ID from the company code currency key.
-->WAERS - Currency key.
<--ALL_ITEM_ID - All item ID.
<--ALL_ITEM_ID - All item ID.
FORM derive_all_item_id USING waers TYPE t_t001-waers
CHANGING all_item_id TYPE t_faglflext-all_item_id
all_products TYPE t_faglflext-all_products
CLEAR:
all_item_id.
Populate all item ID.
all_item_id = c_all_item_id.
IF waers = c_us_dollars.
REPLACE '*' WITH c_united_states INTO all_item_id.
ELSE.
REPLACE '*' WITH c_local INTO all_item_id.
ENDIF.
Populate all products.
all_products = c_all_products.
TRANSLATE all_products TO UPPER CASE.
ENDFORM. " derive_all_item_id
*& Form derive_all_customers_fields
Derive the all customers and all customer channel fields from
the strategic segment and strategic segment channel respectively.
-->STRAT_SEG - Strategic segment.
-->STRAT_SEG_CHNL - Strategic segment channel.
<--ALL_CUST - All customers.
<--ALL_CUST_CHNL - All customers channel.
FORM derive_all_customers_fields USING strat_seg TYPE
t_faglflext-strat_seg
strat_seg_chnl TYPE
t_faglflext-strat_seg_chnl
CHANGING all_cust TYPE
t_faglflext-all_cust
all_cust_chnl TYPE
t_faglflext-all_cust_chnl.
CLEAR:
all_cust,
all_cust_chnl.
all_cust = strat_seg.
all_cust+2(1) = c_all_customers.
TRANSLATE all_cust TO UPPER CASE.
all_cust_chnl = strat_seg_chnl.
TRANSLATE all_cust_chnl TO UPPER CASE.
ENDFORM. " derive_all_customers_fields
*& Form derive_hyperion_account
Read G/L account long text to get the Hyperion account number.
-->RACCT - SAP G/L account number.
<--HYPERION_ACCT - Hyperion account number.
FORM derive_hyperion_account USING racct TYPE t_faglflext-racct
farea TYPE t_faglflext-rfarea
"KMK5/22/06 ITR 20592
sub_account TYPE
t_faglflext-sub_acct
rassc TYPE t_faglflext-rassc
prctr TYPE t_faglflext-prctr
CHANGING hyperion_acct TYPE t_faglflext-hyperion_acct
reverse_sign TYPE t_faglflext-reverse_sign "NEM8/21/06 ITR: 24286
balance_sheet TYPE t_faglflext-balance_sheet "NEM8/21/06 ITR: 24286
zzsarea TYPE t_faglflext-zzsarea
zzsareaim TYPE t_faglflext-zzsareaim
strat_seg TYPE t_faglflext-strat_seg.
DATA:
lv_text_name TYPE thead-tdname,
l_strl TYPE i VALUE 0,
l_hyperion_acct(10), "KMK5/20/06 ITR 20527
l_farea(10) VALUE '0000000000', "KMK5/22/06 ITR 20592
l_balance_sheet(1), "NEM8/17/06 ITR 25792
l_string TYPE tline-tdline. "NEM8/17/06 ITR 25792
DATA: l_hyp_account_1 TYPE tline-tdline,
l_hyp_account_2 TYPE tline-tdline,
l_hyp_account_3 TYPE tline-tdline.
reverse_sign = '1'.
SELECT SINGLE bilkt xbilk
FROM ska1
INTO (l_hyperion_acct,l_balance_sheet)
WHERE ktopl = c_global_tcoa
AND saknr = racct.
balance_sheet = l_balance_sheet.
l_string = w_zall_gl-hyper.
SEARCH l_string FOR '-'.
IF sy-subrc = '0'.
reverse_sign = -1.
ELSE.
reverse_sign = 1.
ENDIF.
CHECK w_zall_gl-hyper IS NOT INITIAL.
CLEAR: l_hyp_account_1, l_hyp_account_2, l_hyp_account_3.
SPLIT w_zall_gl-hyper
AT ';'
INTO l_hyp_account_1 l_hyp_account_2 l_hyp_account_3.
IF l_hyp_account_2 IS INITIAL. " Only one hyperion account
hyperion_acct = l_hyp_account_1+0(7).
l_strl = STRLEN( hyperion_acct ) - 1.
IF hyperion_acct+l_strl(1) EQ '1'.
CLEAR sub_account.
PERFORM repopulate_strategic_segment
USING rassc prctr
CHANGING strat_seg.
zzsareaim = g_hold_sales_type.
zzsarea = g_hold_sales_area.
ENDIF.
ELSE. " Two or more hyperion accounts
IF sub_account > ''.
hyperion_acct = l_hyp_account_2+0(7).
ELSE.
hyperion_acct = l_hyp_account_1+0(7).
ENDIF.
ENDIF.
CLEAR: w_hyperion.
w_hyperion-racct = racct.
w_hyperion-hyperion_acct = hyperion_acct.
w_hyperion-reverse_sign = reverse_sign.
ENDFORM. " derive_hyperion_account
*& Form derive_sub_account
Determine the sub account based on the company ID of the trading
partner.
-->RASSC - Company ID of trading partner.
<--SUB_ACCT - Sub account.
*FORM derive_sub_account USING rassc TYPE t_faglflext-rassc
CHANGING sub_acct TYPE t_faglflext-sub_acct.
IF rassc IS INITIAL.
CLEAR: sub_acct.
ELSE.
sub_acct = rassc.
TRANSLATE sub_acct TO UPPER CASE.
ENDIF.
*ENDFORM. " derive_sub_account
FORM derive_sub_account USING rcomp TYPE t_t001-rcomp
rassc TYPE t_faglflext-rassc
CHANGING sub_acct TYPE t_faglflext-sub_acct.
IF rassc IS INITIAL.
CLEAR: sub_acct.
ELSE.
READ TABLE i_t880 INTO w_t880
WITH KEY rcomp = rassc
BINARY SEARCH.
IF sy-subrc = 0.
sub_acct = w_t880-name2.
TRANSLATE sub_acct TO UPPER CASE.
ELSE.
MESSAGE e060
WITH w_t001-rcomp.
Company code & not found on table T880
ENDIF.
ENDIF.
ENDFORM. " derive_sub_account
*& Form repopulate_strategic_segment
Derive the strategic segment based on the company ID of the trading
partner or the profit center.
-->RASSC - Company ID of trading partner.
-->PRCTR - Profit center.
<--STRAT_SEG - Strategic segment.
FORM repopulate_strategic_segment USING rassc TYPE t_faglflext-rassc
prctr TYPE t_faglflext-prctr
CHANGING strat_seg TYPE t_faglflext-strat_seg
DATA:
lv_segment TYPE cepc-segment.
CLEAR:
strat_seg.
Find the valid profit center record.
LOOP AT i_cepc INTO w_cepc
WHERE prctr = prctr AND
datab <= sy-datum AND
datbi >= sy-datum.
Pad segment with leading zeros if necessary.
lv_segment = w_cepc-segment.
SHIFT lv_segment RIGHT DELETING TRAILING ' '.
TRANSLATE lv_segment USING ' 0'.
Get the segment name from FAGL_SEGMT (Master Data for Segments).
SELECT SINGLE *
FROM fagl_segmt
WHERE langu = sy-langu AND
segment = lv_segment.
IF sy-subrc = 0.
strat_seg = fagl_segmt-name+0(3).
TRANSLATE strat_seg TO UPPER CASE.
ENDIF.
ENDLOOP.
ENDFORM. "repopulate_strategic_segment
" repopulate_strategic_segment&----
*& Form derive_strategic_segment
Derive the strategic segment based on the company ID of the trading
partner or the profit center.
-->RASSC - Company ID of trading partner.
-->PRCTR - Profit center.
<--STRAT_SEG - Strategic segment.
FORM derive_strategic_segment USING rassc TYPE t_faglflext-rassc
prctr TYPE t_faglflext-prctr
CHANGING strat_seg TYPE t_faglflext-strat_seg
sales_type TYPE t_faglflext-zzsareaim
sales_area TYPE t_faglflext-zzsarea.
DATA:
lv_segment TYPE cepc-segment.
CLEAR:
strat_seg.
*Hold values in Sales Type and Sales area before setting to default
*values
In case need to use them later
g_hold_sales_type = sales_type.
g_hold_sales_area = sales_area.
If the company ID of the trading partner is populated, then set the
strategic segment to a default value.
And set Sales Type and Sales area to default values **NEM 07/13/06
IF NOT rassc IS INITIAL.
strat_seg = c_def_strat_seg.
sales_type = c_sales_type.
sales_area = c_sales_area.
TRANSLATE strat_seg TO UPPER CASE.
TRANSLATE sales_type TO UPPER CASE.
TRANSLATE sales_area TO UPPER CASE.
EXIT.
ENDIF.
Find the valid profit center record.
LOOP AT i_cepc INTO w_cepc
WHERE prctr = prctr AND
datab <= sy-datum AND
datbi >= sy-datum.
Pad segment with leading zeros if necessary.
lv_segment = w_cepc-segment.
SHIFT lv_segment RIGHT DELETING TRAILING ' '.
TRANSLATE lv_segment USING ' 0'.
Get the segment name from FAGL_SEGMT (Master Data for Segments).
SELECT SINGLE *
FROM fagl_segmt
WHERE langu = sy-langu AND
segment = lv_segment.
IF sy-subrc = 0.
strat_seg = fagl_segmt-name+0(3).
TRANSLATE strat_seg TO UPPER CASE.
ENDIF.
ENDLOOP.
ENDFORM. " derive_strategic_segment
*& Form get_cepc_data
Get CEPC (Profit Center Master Data Table) data from the database.
FORM get_cepc_data.
SELECT prctr datbi kokrs datab khinr segment
INTO TABLE i_cepc
FROM cepc
FOR ALL ENTRIES IN i_faglflext
WHERE prctr = i_faglflext-prctr.
SORT i_cepc BY prctr datab.
ENDFORM. " get_cepc_data
*& Form derive_strat_seg_chnl
Derive the strategic segment channel based on the company ID of the
trading partner or the profit center area.
-->RASSC - Company ID of trading partner.
-->PRCTR - Profit center.
<--STRAT_SEG_CHNL - Strategic segment channel.
FORM derive_strat_seg_chnl USING rassc TYPE t_faglflext-rassc
prctr TYPE t_faglflext-prctr
CHANGING strat_seg_chnl TYPE
t_faglflext-strat_seg_chnl.
CLEAR:
g_setclass,
g_subclass,
g_setname,
strat_seg_chnl.
If the company ID of the trading partner is populated, then set the
strategic segment to a default value.
IF NOT rassc IS INITIAL.
strat_seg_chnl = c_def_strat_seg_chnl.
TRANSLATE strat_seg_chnl TO UPPER CASE.
EXIT.
ENDIF.
Check for SETNAME = 2*** in setleaf table.
PERFORM get_setleaf_data USING c_prctr_group
prctr
CHANGING g_subrc.
IF g_subrc NE c_no_record.
PERFORM find_setleaf_record CHANGING g_subrc.
SELECT SINGLE *
FROM setheadert
WHERE setclass = g_setclass AND
subclass = g_subclass AND
setname = g_setname AND
langu = sy-langu.
IF sy-subrc = 0.
strat_seg_chnl = setheadert-descript+0(2).
TRANSLATE strat_seg_chnl TO UPPER CASE.
ENDIF.
ELSE.
Find the valid profit center record.
LOOP AT i_cepc INTO w_cepc
WHERE prctr = prctr AND
datab <= sy-datum AND
datbi >= sy-datum.
Get the correct SETNODE (Lower-level sets in sets) record.
PERFORM get_setnode_data USING c_prctr_group
w_cepc-khinr
CHANGING g_subrc.
PERFORM find_setnode_record CHANGING g_subrc.
IF g_subrc = c_no_record.
EXIT.
ENDIF.
If an appropriate SETNODE record still has not been found, then
keep looking.
IF g_subrc = c_wrong_record.
DO.
PERFORM get_setnode_data USING c_prctr_group
w_setnode-setname
CHANGING g_subrc.
PERFORM find_setnode_record CHANGING g_subrc.
IF g_subrc = c_no_record OR
g_subrc = c_correct_record.
EXIT.
ENDIF.
ENDDO.
ENDIF.
In the end, there was no SETNODE record to find.
IF g_subrc = c_no_record.
EXIT.
ENDIF.
SELECT SINGLE *
FROM setheadert
WHERE setclass = g_setclass AND
subclass = g_subclass AND
setname = g_setname AND
langu = sy-langu.
IF sy-subrc = 0.
strat_seg_chnl = setheadert-descript+0(2).
TRANSLATE strat_seg_chnl TO UPPER CASE.
ENDIF.
ENDLOOP.
ENDIF.
ENDFORM. " derive_strat_seg_chnl
*& Form get_setnode_data
Get SETNODE (Lower-level sets in sets) data from the database.
-->SETCLASS - Set class.
-->SUBSETNAME - Subordinate set ID.
<--SUBRC - Return code.
FORM get_setnode_data USING setclass TYPE c
subsetname TYPE c
CHANGING subrc TYPE sy-subrc.
SELECT setclass subclass setname
INTO TABLE i_setnode
FROM setnode
WHERE setclass = c_prctr_group AND
subsetname = subsetname.
subrc = sy-subrc.
ENDFORM. " get_setnode_data
*& Form get_setleaf_data
Get SETLEAF (Values in Sets) data from the database.
-->SETCLASS - Set class.
-->VALFROM - Subordinate set ID.
<--SUBRC - Return code.
FORM get_setleaf_data USING setclass TYPE c
valfrom TYPE c
CHANGING subrc TYPE sy-subrc.
subrc = c_correct_record.
SELECT setclass setname valfrom subclass
INTO TABLE i_setleaf
FROM setleaf
WHERE setclass = c_prctr_group AND
valfrom = valfrom AND
setname GE '2000' AND
setname LE '2999'.
IF sy-subrc <> 0.
subrc = c_no_record.
EXIT.
ENDIF.
ENDFORM. " get_setleaf_data
*& Form find_setleaf_record
Find the appropriate SETLEAF record.
<--SUBRC - Return code.
FORM find_setleaf_record CHANGING subrc TYPE sy-subrc.
subrc = c_wrong_record.
If no records were found during selection, then exit the routine.
READ TABLE i_setleaf INDEX 1 TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
subrc = c_no_record.
EXIT.
ENDIF.
Check to see if one of the records has a setname in the 2000 series of
numbers.
LOOP AT i_setleaf INTO w_setleaf.
g_setclass = w_setleaf-setclass.
g_subclass = w_setleaf-subclass.
g_setname = w_setleaf-setname.
subrc = c_correct_record.
ENDLOOP.
ENDFORM. " find_setleaf_record
*& Form find_setnode_record
Find the appropriate SETNODE record.
<--SUBRC - Return code.
FORM find_setnode_record CHANGING subrc TYPE sy-subrc.
subrc = c_wrong_record.
If no records were found during selection, then exit the routine.
READ TABLE i_setnode INDEX 1 TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
subrc = c_no_record.
EXIT.
ENDIF.
Check to see if one of the records has a setname in the 2000 series of
numbers.
LOOP AT i_setnode INTO w_setnode.
IF w_setnode-setname+0(1) = c_valid_number.
g_setclass = w_setnode-setclass.
g_subclass = w_setnode-subclass.
g_setname = w_setnode-setname.
subrc = c_correct_record.
EXIT.
ENDIF.
ENDLOOP.
ENDFORM. " find_setnode_record
*& Form split_records_by_period
Split the i_FAGLFLEXT records by fiscal period. This is necessary
because all (16) fiscal periods are on one record.
FORM split_records_by_period .
REFRESH:
i_output_detail.
LOOP AT i_faglflext INTO w_faglflext.
START OF CHANGES BY BAYAPV on 07/07/2007**********************
*SELECT SINGLE BUKRS
SAKNR
XOPVW
into w_skb1
from skb1
FOR ALL ENTRIES IN I_FAGLFLEXT
where bukrs = w_faglflext-rbukrs
and SAKNR = w_faglflext-racct.
*IF w_skb1-XOPVW = 'X'.
*SELECT BUKRS
HKONT -
ALV Grid not displying properly when spool is generated by print button
Hi All,
When print button is used to genarate spool of the ALV Grid, then in the spool the end of page content is getting over lapped on the main lines. Please let me know how to display end of page content without geting overlapped on the lines.
Below is the code which I have written.
<cut>
Edit: Please see next post.
Thanks in Advance!
Regards,
Preethi G
Edited by: Julius Bussche on Feb 14, 2010 9:15 AMHi All,
Sorry. Please ignore my first post. When print button is used to generate spool then in the spool file the end of page content is getting overlapped on the main lines. Please let me know to solve this.
Thanks in Advance!
Below is the code written
ALV Grid display
alv_layout-colwidth_optimize = 'X'.
alv_layout-zebra = 'X'.
wa_print_info-no_print_listinfos = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_grid_title = ''
i_callback_pf_status_set = 'FRM_SET_STATUS'
i_callback_user_command = 'FRM_USER_COMMAND'
is_layout = alv_layout
it_events = i_events
it_fieldcat = alv_fieldcat
is_print = wa_print_info
TABLES
t_outtab = it_payroll
EXCEPTIONS
program_error = 1
OTHERS = 2.
End of Page and End of list
IF sy-pagno = 0.
s_pageno = 1.
ELSE.
s_pageno = sy-pagno.
ENDIF.
CLEAR: i_list_comments[].
SKIP.
SKIP.
CONCATENATE 'u85AAu8D44u4E13u5458' '________' 'HRSu7ECFu7406' '________' 'u4EBAu529Bu8D44u6E90u603Bu76D1'
'________' 'u7EE9u6548u8D22u52A1u603Bu76D1' '________' 'u603Bu7ECFu7406' '________'''INTO s_out
SEPARATED BY space.
NEW-LINE.
WRITE AT (sy-linsz) s_out CENTERED.
SKIP.
CONCATENATE s_pageno '-' v_pagsum 'u9875' INTO
w_list_comments-info SEPARATED BY space.
NEW-LINE.
WRITE AT (sy-linsz) w_list_comments-info CENTERED.
Edited by: Julius Bussche on Feb 14, 2010 9:16 AM
Tried to fix formatting a bit. -
ALV Grid and return to selection screen
Hello
I have an ALV Grid and when I push a buttom that I program appears another ALV Grid. In this second ALV I try to program different buttoms. When I program the BACK buttom I want to go to selection screen.
I try with CALL SELECTION SCREEN but when I stay in selection screen and push the execute buttom the ALV that I see is the second, not the first. It seems that we don't catch the news selections.
I put rs_selfied-refresh = 'X' after the CALL SELECTION SCREEN but is wrong again.
What can I do????Hello Silvia
There is a simple trick to return from the second ALV list directly back to the selection screen:
*& Report ZUS_SDN_REUSE_ALV_GRID_DISPLAY
REPORT zus_sdn_reuse_alv_grid_display.
TYPE-POOLS: slis.
DATA:
gt_t001 TYPE STANDARD TABLE OF t001,
gt_knb1 TYPE STANDARD TABLE OF knb1.
DATA:
gs_fcat TYPE slis_fieldcat_alv,
gt_fcat_t001 TYPE slis_t_fieldcat_alv,
gt_fcat_knb1 TYPE slis_t_fieldcat_alv.
PARAMETERS:
p_bukrs TYPE bukrs DEFAULT '1000'.
START-OF-SELECTION.
SELECT * FROM t001 INTO TABLE gt_t001.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
* I_PROGRAM_NAME =
* I_INTERNAL_TABNAME =
i_structure_name = 'T001'
* I_CLIENT_NEVER_DISPLAY = 'X'
* I_INCLNAME =
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = gt_fcat_t001
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.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
i_callback_program = syst-cprog
i_callback_pf_status_set = 'ALV_SET_PF_STATUS'
i_callback_user_command = 'ALV_USER_COMMAND'
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME = ' '
* I_BACKGROUND_ID = ' '
* I_GRID_TITLE =
* I_GRID_SETTINGS =
* IS_LAYOUT =
it_fieldcat = gt_fcat_t001
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = gt_t001
* 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.
END-OF-SELECTION.
*& Form set_pf_status
* text
* -->RT_EXTAB text
FORM alv_set_pf_status USING rt_extab TYPE slis_t_extab.
* NOTE: identical to STANDARD_FULLSCREEN with additional button
* for detail list ('DETAILLIST')
SET PF-STATUS 'STANDARD_FULLSCREEN'.
ENDFORM. "set_pf_status
*& Form alv_user_command
* text
* -->R_UCOMM text
* -->RS_SELFIELDtext
FORM alv_user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
* Display detail list: all customers for selected company code
WHEN 'DETAILLIST'.
IF ( rs_selfield-fieldname = 'BUKRS' ).
SELECT * FROM knb1 INTO TABLE gt_knb1
WHERE bukrs = rs_selfield-value.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
i_callback_program = syst-cprog
i_callback_pf_status_set = 'ALV_SET_PF_STATUS'
i_callback_user_command = 'ALV_USER_COMMAND'
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
i_structure_name = 'KNB1'
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = gt_knb1
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.
<b>* NOTE: when the program logic returns from the 2nd ALV list
* and exit = 'X' then the program leaves the
* 1st ALV list, too, and returns to the selection screen.</b>
rs_selfield-exit = 'X'.
ENDIF.
WHEN OTHERS.
ENDCASE.
ENDFORM. "alv_user_command
Regards
Uwe
Maybe you are looking for
-
I have two pages that call a shared "edit" page. When page 1 calls the edit page and the Update button is pressed I want to branch back to page1. When page 2 calls the edit page I want to branch back to page 2. I am using an edit button with the edit
-
Can I make text orientation of a field in ALV 90 degree to horizontal
Hi I have to make text orientation of a field in ALV 90 degree to horizontal, just like we can do in excel sheet. Is it possible to do so. If yes, then how can we do it? I can not attach the illustration but you can type in some text in excel field a
-
Can't See 5 GHz Net with EA6500 and Intel Dual Band Wireless-AC 7260 on Windows 8.1
I can't see the 5 GHz side of the router so I can't do 802.11ac. I can see 2.4. Any help? Thanks...
-
Weird issue with to dos and notifications
I am running iCal 2.0.3, on 10.4.3, on my 12" PowerBook 1.5 GHz, with 768 MB of RAM. I use iCal quite a bit, and am currently running two calendar groups with three sub-calendars each. Lately, I am having to quit and re-start iCal a lot. Here's why:
-
Is it possible to embed new aspect ratios into your quicktime movies?
Well my subject line explains it all really. I was wondering if there was a way to embed the aspect ratio in my quicktime movies instead of manually resizing them whenever i open them to a ratio that suits the content better. thanks