*---------------------------------------------------------------------* * FORM POPUP_POSITIONIEREN * *---------------------------------------------------------------------* * ........ * *---------------------------------------------------------------------* FORM popup_positionieren. DATA: pp_program LIKE sy-repid, hf1 TYPE i, hf2 TYPE i, dummy type xfeld. IF status-action NE anzeigen AND status-action NE transportieren AND status-mode NE list_bild. PERFORM update_tab. ENDIF. pp_program = sy-repid. = . CALL FUNCTION 'TABLE_GET_KEY_TO_SET_CUR_ROW' EXPORTING table = x_header-maintview "Subviews f4_programname = pp_program f4_formname = 'F4_POSITIONIEREN' IMPORTING table_key = dummy TABLES sellist = exclude_fields = excl_pos_tab CHANGING table_key_new = EXCEPTIONS cancelled_by_user = 01 table_not_found = 02. CHECK sy-subrc EQ 0000. IF x_header-frm_h_flds NE space. PERFORM (x_header-frm_h_flds) IN PROGRAM. ENDIF. IF x_header-frm_rp_pos NE space. PERFORM (x_header-frm_rp_pos) IN PROGRAM. ELSEIF status-action EQ hinzufuegen AND status-mode EQ list_bild. nextline = 0. LOOP AT extract. IF EQ leer. EXIT. ENDIF. * CHECK LE . CHECK LE . hf1 = sy-tabix. CHECK EQ . nextline = sy-tabix. EXIT. ENDLOOP. IF nextline EQ 0. IF hf1 EQ maxlines. nextline = hf1. ELSE. nextline = hf1 + 1. ENDIF. ENDIF. ELSE. * READ TABLE extract WITH KEY BINARY SEARCH * TRANSPORTING NO FIELDS. READ TABLE extract WITH KEY BINARY SEARCH TRANSPORTING NO FIELDS. nextline = sy-tabix. IF sy-subrc = 8 AND nextline GT 1. nextline = nextline - 1. "last entry ENDIF. ENDIF. IF status-mode EQ detail_bild. READ TABLE extract INDEX nextline. "ufdetailb IF <> markiert. CLEAR -mark_only. ENDIF. "ufdetaile hf2 = firstline + looplines - 1. IF looplines EQ 0. l = 1. MOVE: l TO -cur_line, nextline TO -firstline. hf1 = 0. ELSEIF nextline GE firstline AND nextline LE hf2. * nothing to scroll. ELSEIF nextline LT firstline. "xb2002 int405493/99 *if the nextline less than firstline, move the nextline to firstline. firstline = nextline. ELSE. "xb2002 int405493/99 * if the nextline larger than firstline, move the nextline to firstline. firstline = nextline. ENDIF. l = nextline - firstline + 1. MOVE: firstline TO -firstline, l TO -cur_line. ELSE. MOVE 1 TO l. ENDIF. ENDFORM.