selectionscreen-buton

Abap Selection Screen ekranında statüs bar buton ekleme

 

selectionscreen-buton

SELECTION-SCREEN BEGIN OF BLOCK parametreler WITH FRAME TITLE
text001.
SELECT-OPTIONS:
  sdmid FOR zcd_dnsmn_kmlkdmid,
  svorna  FOR zcd_dnsmn_kmlkvorna,
  snachn  FOR zcd_dnsmn_kmlknachn,
  sulke FOR zcd_dnsmn_kmlkulke,
  sfirma FOR  zcd_dnsmn_kmlkfirma,
  syaratan FOR zcd_dnsmn_kmlkyaratan,
  serdat FOR zcd_dnsmn_kmlkerdat.
SELECTION-SCREEN END OF BLOCK parametreler.

SELECTION-SCREEN FUNCTION KEY 1.

 

START-OF-SELECTION.
INITIALIZATION.
CONCATENATE icon_create ‘Yeni’
INTO sscrfieldsfunctxt_01.

AT SELECTION-SCREEN.
IF sscrfieldsucomm EQ ‘FC01’.
SET SCREEN 0.
CLEAR ztablo.
CALL SCREEN 0100.
ENDIF.

Bu yazı toplam 0 defa okundu.

Abap , Ağdaki Dosyalara Erişim

*PARAMETERS:p_dir(50) TYPE c.
*
*DATA : file_table LIKE TABLE OF sdokpath WITH HEADER LINE .
*DATA : dir_table LIKE TABLE OF sdokpath WITH HEADER LINE .
*
*DATA : file_count TYPE i ,
*       dircount   TYPE i .
*
*CALL FUNCTION ‘TMP_GUI_DIRECTORY_LIST_FILES’
*  EXPORTING
*    directory  = p_dir
*    filter     = ‘*.CSV’
*  IMPORTING
*    file_count = file_count
*    dir_count  = dircount
*  TABLES
*    file_table = file_table
*    dir_table  = dir_table
*  EXCEPTIONS
*    cntl_error = 1
*    OTHERS     = 2.
*WRITE:/ ‘toplam dosya sayısı : ‘, file_count .
*
*LOOP AT file_table .
**  IF sy-tabix eq son_iki.
**    write:/  file_table-pathname.
**  ENDIF.
*
*  IF sy-tabix EQ file_count – 1.
*    WRITE:/ ‘Sondan İkinci Dosya ‘ ,  file_table-pathname.
*  ENDIF.
*
*ENDLOOP.

Bu yazı toplam 0 defa okundu.

Alv , standart rapor

*&———————————————————————*
*& Report ZSTANDART
*&
*&———————————————————————*
*&
*&
*&———————————————————————*

REPORT ZSTANDART.

TABLES : ztest.

DATA: er_layout TYPE slis_layout_alv,
er_fieldcat TYPE slis_t_fieldcat_alv,
er_sp_group TYPE slis_t_sp_group_alv,
e_save(1) TYPE c,
e_variant LIKE disvariant,
er_events TYPE slis_t_event,
ex_fieldcat TYPE slis_t_fieldcat_alv,
ex_sp_group TYPE slis_t_sp_group_alv,
ex_layout TYPE slis_layout_alv,
ex_events TYPE slis_t_event.
DATA: gt_list_top_of_page TYPE slis_t_listheader.
DATA: t_sort TYPE slis_t_sortinfo_alv WITH HEADER LINE ,
is_print TYPE slis_print_alv ,answer.
*
*
DATA: BEGIN OF itab_alv OCCURS 0,
chk.
INCLUDE STRUCTURE ztest.
DATA: END OF itab_alv.
*
*
SELECTION-SCREEN BEGIN OF BLOCK islemtipi WITH FRAME TITLE
text-002.

PARAMETERS:
rbtnyeni RADIOBUTTON GROUP sec,
rbtnlist RADIOBUTTON GROUP sec.
SELECTION-SCREEN END OF BLOCK islemtipi.
*
*
SELECTION-SCREEN BEGIN OF BLOCK iadetipi WITH FRAME TITLE
text-001.

PARAMETERS:
rbtnseh RADIOBUTTON GROUP isl,
rbtnfin RADIOBUTTON GROUP isl.
SELECTION-SCREEN END OF BLOCK iadetipi.
*
SELECTION-SCREEN BEGIN OF BLOCK sorgu WITH FRAME TITLE
text-003.
SELECT-OPTIONS:
sno FOR ztest-no,
starih FOR ztest-tarih.
SELECTION-SCREEN END OF BLOCK sorgu.
*

START-OF-SELECTION.

IF rbtnyeni EQ ‘X’.
DO 10 TIMES.
append itab_alv.
ENDDO.
ELSEIF rbtnlist EQ ‘X’.


ENDIF.

FORM display_data.
DATA list_function TYPE rs38l-name.
PERFORM e03_eventtab_build USING er_events[].
PERFORM e04_comment_build USING gt_list_top_of_page[].
PERFORM get_format.
PERFORM alv_alv.
ENDFORM.

FORM e03_eventtab_build USING e03_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 = e03_lt_events.
READ TABLE e03_lt_events WITH KEY name = slis_ev_top_of_page INTO
ls_event.
IF sy-subrc = 0.
MOVE ‘SAYFA_BASI’ TO ls_event-form.
APPEND ls_event TO e03_lt_events.
ENDIF.
ENDFORM. “e03_eventtab_build

FORM sayfa_basi.
CALL FUNCTION ‘REUSE_ALV_COMMENTARY_WRITE’
EXPORTING
it_list_commentary = gt_list_top_of_page.
ENDFORM. “sayfa_basi

FORM e04_comment_build USING e04_lt_top_of_page TYPE
slis_t_listheader.
DATA: ls_line TYPE slis_listheader.
FREE: e04_lt_top_of_page.
CLEAR ls_line.
ls_line-typ = ‘H’.
ls_line-info = sy-title.
APPEND ls_line TO e04_lt_top_of_page.
CLEAR ls_line.
ENDFORM. ” e04_comment_build

FORM get_format.
DATA: lv_itab TYPE slis_tabname.
REFRESH er_fieldcat[].
lv_itab = ‘ITAB_ALV’.

CALL FUNCTION ‘REUSE_ALV_FIELDCATALOG_MERGE’
EXPORTING
i_program_name = sy-repid
i_internal_tabname = lv_itab
i_inclname = sy-repid
CHANGING
ct_fieldcat = er_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
PERFORM fieldcat_modify USING er_fieldcat[].
ENDFORM. “get_format

FORM fieldcat_modify USING u_er_fieldcat TYPE slis_t_fieldcat_alv.
DATA: xs_fieldcat TYPE slis_fieldcat_alv.
LOOP AT u_er_fieldcat INTO xs_fieldcat.
CASE xs_fieldcat-fieldname.
xs_fieldcat-edit = ‘X’.

xs_fieldcat-seltext_l = ‘Açıklama’.
xs_fieldcat-seltext_m = ‘Açıklama’.
xs_fieldcat-seltext_s = ‘Açıkl’.
xs_fieldcat-outputlen = 100.
WHEN OTHERS.
*

ENDCASE.
xs_fieldcat-reptext_ddic = xs_fieldcat-seltext_l.
xs_fieldcat-seltext_m = xs_fieldcat-seltext_l.
xs_fieldcat-seltext_s = xs_fieldcat-seltext_l.
MODIFY u_er_fieldcat FROM xs_fieldcat.
ENDLOOP.
ENDFORM. “fieldcat_modify

FORM alv_alv.
* e_variant-variant = p_vari.
* er_layout-zebra = ‘X’.
er_layout-box_fieldname = ‘CHK’.
* er_layout-info_fieldname = ‘COLOR’.
* er_layout-colwidth_optimize = ‘X’.
CALL FUNCTION ‘REUSE_ALV_GRID_DISPLAY’
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = ‘STATUS’
i_callback_user_command = ‘USER_COMMAND’
it_fieldcat = er_fieldcat[]
it_events = er_events[]
is_layout = er_layout
is_print = is_print
it_special_groups = er_sp_group
i_default = ‘X’
i_save = ‘A’
TABLES
t_outtab = itab_alv
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDFORM. “alv_alv

FORM user_command USING r_ucomm TYPE sy-ucomm
rs_selfield TYPE slis_selfield .
DATA: l_ucomm TYPE sy-ucomm.
DATA: l_grid TYPE REF TO cl_gui_alv_grid.
DATA: ans.
DATA: lt_ret LIKE TABLE OF bapireturn WITH HEADER LINE.
DATA: lt_item LIKE TABLE OF bapiebanc WITH HEADER LINE,
lv_banfn TYPE banfn.
RANGES:
sel_obj FOR objs-objectname,
sel_type FOR objs-objecttype.

CALL FUNCTION ‘GET_GLOBALS_FROM_SLVC_FULLSCR’
IMPORTING
e_grid = l_grid.
rs_selfield-refresh = ‘X’.
l_ucomm = r_ucomm .
r_ucomm = ‘&REFRESH’.
CALL METHOD l_grid->set_function_code
CHANGING
c_ucomm = r_ucomm.

r_ucomm = ‘&REFRESH’.
CALL METHOD l_grid->set_function_code
CHANGING
c_ucomm = r_ucomm.

ENDFORM. ” user_command

FORM status USING extab TYPE slis_t_extab.
SET PF-STATUS ‘STATUS’.
ENDFORM. “status

Bu yazı toplam 1 defa okundu.

Abap , kullanıcı adına göre bilgileri bulan fonksiyon

call function ‘SUSR_USER_ADDRESS_READ’
exporting
user_name                    = gv_pr_name
*     READ_DB_DIRECTLY             = ‘ ‘
*     CACHE_RESULTS                = ‘X’
importing
*     USER_ADDRESS                 =
user_usr03                   = gs_usr03
*   EXCEPTIONS
*     USER_ADDRESS_NOT_FOUND       = 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.

 

 

kaynak : https://sapnotlarim.wordpress.com/

Bu yazı toplam 3 defa okundu.