‎2006 Oct 03 2:56 PM
Hi, I have a detail basic list and a 2nd list that appears when the user selects a line on the basic list.
When the user selects or maintains an entry on the 2nd list and exits the 2nd list I would like to refresh the basic list so I can display the fact that the line has been updated.
Any way to do this? Sounds like I need to reexecute start-of-selection?
Thanks!
Ken Murray
‎2006 Oct 03 3:10 PM
Hi,
You have to call the same subroutine, which you are using to display the basic list after settiong SY-LSIND = 0.
START-OF-SELECTION.
PERFORM GET_DATA.
PERFORM DISPLAY_DATA.
END-OF-SELECTION.
AT LINE-SELECTION.
PERFORM GET_DATAILED_DATA.
PERFORM SHOW_DETAILED_DATA.
PERFORM UPDATE_DATA_INBASIC_LIST.
*Now if you want show basic list with the update data, use this logic.
<b>sy-lsind = 0.</b>
PERFORM DISPLAY_DATA.
Thanks,
ramakrishna
‎2006 Oct 03 3:07 PM
‎2006 Oct 03 3:10 PM
Hi,
You have to call the same subroutine, which you are using to display the basic list after settiong SY-LSIND = 0.
START-OF-SELECTION.
PERFORM GET_DATA.
PERFORM DISPLAY_DATA.
END-OF-SELECTION.
AT LINE-SELECTION.
PERFORM GET_DATAILED_DATA.
PERFORM SHOW_DETAILED_DATA.
PERFORM UPDATE_DATA_INBASIC_LIST.
*Now if you want show basic list with the update data, use this logic.
<b>sy-lsind = 0.</b>
PERFORM DISPLAY_DATA.
Thanks,
ramakrishna
‎2006 Oct 03 3:13 PM
Hi kenneth,
1. we have to make use of the
selfield-REFRESH = 'X'.
2. just copy paste
3. It will show all companies.
Select any company by double-clicking
It will again show secondary alv (just 1 record)
When u go back, it will show 'ALREADY SELECTED'
4.
REPORT abc.
TYPE-POOLS : slis.
*----
Data
DATA : ITAB LIKE T001 OCCURS 0 WITH HEADER LINE.
DATA : PTAB LIKE T001 OCCURS 0 WITH HEADER LINE.
DATA : alvfc TYPE slis_t_fieldcat_alv.
*----
Select Data
SELECT * FROM t001 INTO TABLE itab.
*------- Field Catalogue
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
i_callback_program = sy-repid "<-------Important
i_callback_user_command = 'ITAB_USER_COMMAND' "<------ Important
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
*----
CALL BACK FORM
*----
FORM itab_user_command USING whatcomm TYPE sy-ucomm whatrow TYPE
slis_selfield.
DATA : TABINDEX.
TABINDEX = whatrow-tabindex.
READ TABLE itab INDEX TABINDEX.
ITAB-BUTXT = 'ALREADY SELECTED'.
MODIFY ITAB INDEX TABINDEX.
SELECT * FROM t001 INTO TABLE Ptab
WHERE BUKRS = ITAB-BUKRS.
CLEAR ALVFC.
REFRESH ALVFC.
*------- Field Catalogue
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'PTAB'
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 = Ptab
EXCEPTIONS
program_error = 1
OTHERS = 2.
WHATROW-REFRESH = 'X'.
ENDFORM. "ITAB_user_command
regards,
amit m.
‎2006 Oct 03 3:18 PM
You could have two buttons on the secondary list: REFRESH and APPLY. If the user presses the REFRESH button, execute from the START-OF-SELECTION. If the APPLY button is pressed, you could just apply the changes to the internal table used for the report and re-list the report only.
The second button would produe the list more quickly, while the first one would show any other changes in the base tables.
Rob
‎2006 Oct 03 3:54 PM
Hi,
try using modify current line syntax for your
requirement
DATA I TYPE I VALUE 2.
WRITE: / 'Intensified' INTENSIFIED,
'Input' INPUT,
'color 1' COLOR 1,
'intensified off' INTENSIFIED OFF.
Line selection
AT LINE-SELECTION.
MODIFY CURRENT LINE
LINE FORMAT INVERSE
INPUT OFF
COLOR = I.
When you have selected the output list line (by
double-clicking), the whole line is set to COLOR 2 and INVERSE
and all INPUT fields are set to INPUT OFF. The fields with the
attribute INTENSIFIED or INTENSIFIED OFF retain this because
the attribute is not addressed here.
Regards
amole