Eyl 24 2016
SAP ABAP yemek sipariş program kodu.
SAP SE Abap Yemek sipariş kodu. Yıllar önce yazılan bir kodu arşivimi kurcalarken buldum 🙂 şaka gibi zaman ne çabuk geçmiş.
*&———————————————————————*
*& Report ZYEMEKSIP
*& Date : 09.07.2009
*&———————————————————————*
*& Reseon : IT yemek sipariş takip programı
*& Abap Writer : Burhan KARADERE
*& Copyleft ® 2009 by Burhan KARADERE
*&———————————————————————*REPORT zyemeksip.
TABLES : zit_calisan , zyemeksiparis .
TYPE-POOLS : slis . ” KUTUPHANE
TYPE-POOLS: vrm. ” LISTBOX ICIN
” LISTBOX ICIN DEGISKENLER
DATA: name TYPE vrm_id,
list TYPE vrm_values,
value LIKE LINE OF list.
” LISTBOX ICIN DEGISKENLER*&———————————————————————*
*& GLOBAL DEGISKENLER
*&———————————————————————*
DATA : siparis(50) TYPE c .
DATA : lokanta(30) TYPE c . ” lokanta
DATA : siptoplayan(10) TYPE c . “sip toplayan
DATA : ysipveren(10) TYPE c . ” sip veren
DATA : ylokanta(15) TYPE c . “lokanta
DATA : ysiparis(50) TYPE c . ” sipariş
DATA : otur(10) TYPE c . ” ödeme türü
DATA : sid(10) TYPE c . ” siparis id
DATA : ssid LIKE zyemeksiparis-id . ” siparis detay idDATA : FIYAT(10) TYPE c . ” ödeme türü
*&———————————————————————*
*& GLOBAL DEGISKENLER
*&———————————————————————*
DATA : gt_fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE ,
” fieldcat
gs_layo TYPE slis_layout_alv .” itab
DATA : BEGIN OF sip_itab OCCURS 100 ,
sec TYPE c,
id LIKE zyemeksip-id ,
siptoplayan LIKE zyemeksip-siptoplayan ,
tarih LIKE zyemeksip-tarih ,
saat LIKE zyemeksip-saat ,
endsaat LIKE zyemeksip-endsaat ,
lokanta LIKE zyemeksip-lokanta ,
siparis LIKE zyemeksip-siparis ,
durum LIKE zyemeksip-durum ,
END OF sip_itab .” SIPARISLER ITAB
DATA : gt_fcatsip TYPE slis_t_fieldcat_alv WITH HEADER LINE ,
” fieldcat
gs_layosip TYPE slis_layout_alv .DATA : BEGIN OF sipler_itab OCCURS 0 ,
secsip TYPE c,
id LIKE zyemeksiparis-id ,
sipveren LIKE zyemeksiparis-sipveren ,
sipisteyen LIKE zyemeksiparis-sipisteyen ,
siparis LIKE zyemeksiparis-siparis ,
fiyat LIKE zyemeksiparis-fiyat ,
odemeturu LIKE zyemeksiparis-odemeturu,
sid LIKE zyemeksiparis-sid,END OF sipler_itab .
*&———————————————————————*
*& HELP MENU ICIN IT CALISANLAR
*&———————————————————————*
DATA : BEGIN OF zit_itab OCCURS 0 ,
xubname LIKE zit_calisan-xubname ,
partner_txt LIKE zit_calisan-partner_txt,
END OF zit_itab .DATA: gv_it LIKE zit_calisan-xubname . ” GV_PIL IL_ID DONUYOR
SELECTION-SCREEN BEGIN OF BLOCK b0 WITH FRAME TITLE text–001 .
PARAMETERS:m1 RADIOBUTTON GROUP r1 USER-COMMAND radio1 DEFAULT ‘X’,
m2 RADIOBUTTON GROUP r1.
SELECTION-SCREEN : END OF BLOCK b0 .SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text–002 .
DATA starih TYPE abhod . ” SISTEM DEN GELEN TARIH FORMATI
SELECT-OPTIONS btarih FOR starih MODIF ID sc1 OBLIGATORY
DEFAULT sy-datum .
SELECTION-SCREEN : END OF BLOCK b1 .SELECTION-SCREEN : BEGIN OF BLOCK b2 WITH FRAME TITLE text–003 .
PARAMETERS spveren(10) TYPE c MODIF ID sc2 .
SELECTION-SCREEN : END OF BLOCK b2 .AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF m1 = ‘X’ AND screen-group1 = ‘SC1’ .
screen-active = 0.
MODIFY SCREEN.
ENDIF.
IF m1 = ‘X’ AND screen-group1 = ‘SC2’ .
screen-active = 0.
MODIFY SCREEN.
ENDIF.IF m2 = ‘X’ AND screen-group1 = ‘SC1’ .
screen-active = 1.
MODIFY SCREEN.
ENDIF.
IF m2 = ‘X’ AND screen-group1 = ‘SC2’ .
screen-active = 1.
MODIFY SCREEN.
ENDIF.ENDLOOP.
*&———————————————————————*
*& LISTBOX ICIN
*&———————————————————————*
CLEAR : list[]. “TEMIZLIYOZ”
name = ‘OTUR’.
value–key = ‘MULTINET’.
value–text = ‘MULTINET’.
APPEND value TO list.
value–key = ‘SELECTA’.
value–text = ‘SELECTA’.
APPEND value TO list.
value–key = ‘NAKIT’.
value–text = ‘NAKIT’.
APPEND value TO list.
value–key = ‘KREDI KARTI’.
value–text = ‘KREDI KARTI’.APPEND value TO list.
CALL FUNCTION ‘VRM_SET_VALUES’
EXPORTING
id = name
values = list.
*&———————————————————————*
*& LISTBOX ICIN
*&———————————————————————*
*&———————————————————————*
*& HELP MENU ICIN IT CALISANLAR
*&———————————————————————*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR spveren .
PERFORM it_calisanlari_getir .*&———————————————————————*
*& HELP MENU ICIN IT CALISANLAR
*&———————————————————————*
START-OF-SELECTION . ” programın başladıgı kısımIF m1 = ‘X’ .
PERFORM data_cek.
ENDIF.
IF m2 = ‘X’ .
PERFORM data_cek_bugunku .
ENDIF.
*&———————————————————————*
*& Form DATA_CEK
*&———————————————————————*
FORM data_cek .SELECT * FROM zyemeksip INTO CORRESPONDING FIELDS OF TABLE sip_itab
WHERE tarih = sy-datum ORDER BY id DESCENDING .* IF sy-subrc NE 0 .
* MESSAGE ‘Aradığınız kırıterlerde kayıt bulunamadı… ‘
* & ‘Lütfen kriterlerinizi kontrol edip tekrar deneyiniz’ TYPE ‘I’ .
* ELSE.
PERFORM fieldcat_belirle .
PERFORM fielcat_duzenle .
PERFORM layout_duzenle .
PERFORM alv_goster .
* ENDIF.ENDFORM. ” DATA_CEK
*&———————————————————————*
*& Form DATA_CEK_BUGUNKU
*&———————————————————————*
* text
*———————————————————————-*
FORM data_cek_bugunku .SELECT * FROM zyemeksip INTO CORRESPONDING FIELDS OF TABLE sip_itab
WHERE tarih IN btarih AND siptoplayan = spveren
ORDER BY id DESCENDING .IF sy-subrc NE 0 .
MESSAGE ‘Aradığınız kırıterlerde kayıt bulunamadı… ‘
& ‘Lütfen kriterlerinizi kontrol edip tekrar deneyiniz’ TYPE ‘I’ .
ELSE.
PERFORM fieldcat_belirle .
PERFORM fielcat_duzenle .
PERFORM layout_duzenle .
PERFORM alv_goster .
ENDIF.
ENDFORM. “DATA_CEK_BUGUNKU*&———————————————————————*
*& Form DATA_CEKSIP
*&———————————————————————*
* text
*———————————————————————-*
FORM data_ceksip USING sid TYPE c . “burhan
SELECT * FROM zyemeksiparis
INTO CORRESPONDING FIELDS OF TABLe sipler_itab
WHERE sid = sid ORDER BY id DESCENDING .ENDFORM. ” DATA_CEK
*&———————————————————————*
*& Form FIELDCAT_BELIRLE
*&———————————————————————*
FORM fieldcat_belirle .
CALL FUNCTION ‘REUSE_ALV_FIELDCATALOG_MERGE’
EXPORTING
i_program_name = sy-repid
i_internal_tabname = ‘SIP_ITAB’
i_inclname = sy-repid
i_client_never_display = ‘X’
i_bypassing_buffer = ‘X’
CHANGING
ct_fieldcat = gt_fcat[]
EXCEPTIONS
OTHERS = 3.
IF sy-subrc NE 0.
EXIT.
ENDIF .
ENDFORM. ” FIELDCAT_BELIRLE
*&———————————————————————*
*& Form FIELDCAT_BELIRLE
*&———————————————————————*
FORM fieldcat_belirle_siparis .
CALL FUNCTION ‘REUSE_ALV_FIELDCATALOG_MERGE’
EXPORTING
i_program_name = sy-repid
i_internal_tabname = ‘SIPLER_ITAB’
i_inclname = sy-repid
i_client_never_display = ‘X’
i_bypassing_buffer = ‘X’
CHANGING
ct_fieldcat = gt_fcatsip[]
EXCEPTIONS
OTHERS = 3.
IF sy-subrc NE 0.
EXIT.
ENDIF .
ENDFORM. ” FIELDCAT_BELIRLE*&———————————————————————*
*& Form ALV_GOSTER
*&———————————————————————*
*———————————————————————-*
FORM alv_goster .
CALL FUNCTION ‘REUSE_ALV_GRID_DISPLAY’
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = ‘BUTONLAR’
i_callback_user_command = ‘ALVMENUKOMUTU’
is_layout = gs_layo
it_fieldcat = gt_fcat[]
TABLES
t_outtab = sip_itab
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. ” ALV_GOSTER
*&———————————————————————*
*& Form ALV_GOSTER SIPARIS
*&———————————————————————*
*———————————————————————-*
FORM alv_goster_sipler .
CALL FUNCTION ‘REUSE_ALV_GRID_DISPLAY’
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = ‘BUTONLAR’
i_callback_user_command = ‘ALVMENUKOMUTUSIP’
is_layout = gs_layosip “gs_layo
it_fieldcat = gt_fcatsip[]
TABLES
t_outtab = sipler_itab
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. ” ALV_GOSTER
*&———————————————————————*
*& Form GUI
*&———————————————————————
FORM butonlar USING g_xpa.
SET PF-STATUS ‘BUTONGIRIS’.
ENDFORM. “GUI
*&———————————————————————*
*& ALV Form COMMAND
*&———————————————————————*
FORM alvmenukomutu USING islem LIKE sy-ucomm alvkontrol TYPE
slis_selfield.CASE islem .
WHEN ‘SIPVER’.ysipveren = sy-uname .
CALL SCREEN 0100.
” MESSAGE ‘Arama işlemi başladı’ TYPE ‘S’ .* WHEN ‘SEPETIM’ .
* “PERFORM data_ceksip USING sid .
* PERFORM fieldcat_belirle_siparis .
* PERFORM fielcat_duzenle_sip .
* PERFORM layout_duzenle_sip .
* PERFORM alv_goster_sipler .WHEN ‘SIPARISPAK’ .
PERFORM data_cek.
PERFORM fieldcat_belirle .
PERFORM fielcat_duzenle .
PERFORM layout_duzenle .
PERFORM alv_goster .
LEAVE TO SCREEN 0 .
” MESSAGE ‘denem sipler’ TYPE ‘I’ .WHEN ‘&IC1’.
IF sip_itab-sec = ‘X’ .
“MESSAGE ‘SECILDI’ TYPE ‘I’ .READ TABLE sip_itab WITH KEY sec = ‘X’.
IF sy-subrc = 0 .
sid = sip_itab-id.
CONDENSE sid NO-GAPS.
ENDIF.PERFORM data_ceksip USING sid .
PERFORM fieldcat_belirle_siparis .
PERFORM fielcat_duzenle_sip .
PERFORM layout_duzenle_sip .
PERFORM alv_goster_sipler .ENDIF.
IF alvkontrol-sel_tab_field = ‘SIP_ITAB-ID’ .
READ TABLE sip_itab INDEX alvkontrol-tabindex .
IF sy-subrc = 0 .
IF sip_itab-endsaat <= sy-uzeit .
MESSAGE ‘Bu sipariş kapandı.’
& ‘Süresi dolmuştur…. ‘
&‘Lütfen açık siparişleri deneyiniz…’ TYPE ‘I’ .ELSE.
siptoplayan = sip_itab-siptoplayan .
lokanta = sip_itab-lokanta .
CONDENSE sip_itab-id NO-GAPS.
sid = sip_itab-id .CALL SCREEN 0101 .
ENDIF.ENDIF.
ENDIF.
ENDCASE.“alvkontrol-refresh = ‘X’.
ENDFORM . “command
*&———————————————————————*
*& Form alvmenukomutusip
*&———————————————————————*
* text
*———————————————————————-*
* –>ISLEM2 text
* –>ALVKONTROLSIP text
*———————————————————————-*
FORM alvmenukomutusip USING islem2 LIKE sy-ucomm alvkontrolsip TYPE
slis_selfield.IF sipler_itab-secsip = ‘X’ .
IF sip_itab-siptoplayan = sy-uname .
READ TABLE sipler_itab WITH KEY secsip = ‘X’.
IF sy-subrc = 0 .
ssid = sipler_itab-id.
CONDENSE ssid NO-GAPS.
ENDIF.READ TABLE sipler_itab INDEX alvkontrolsip-tabindex .
siptoplayan = sip_itab-siptoplayan .
lokanta = sip_itab-lokanta .
siparis = sip_itab-siparis .
ysipveren = sipler_itab-sipisteyen .
CALL SCREEN 0500 STARTING AT 10 10 .else.
MESSAGE ‘Bu siparişi, Sepeti oluşturan kişi düzenliyebilir’ TYPE ‘I’ .
ENDIF.
ENDIF.
ENDFORM. “alvmenukomutusip
*&———————————————————————*
*& Form FIELCAT_DUZENLE
*&———————————————————————*
FORM fielcat_duzenle_sip .
LOOP AT gt_fcatsip.CASE gt_fcatsip-fieldname .
WHEN ‘ID’ .
gt_fcatsip-seltext_s = ‘S.NO’ .
gt_fcatsip-seltext_m = ‘SİP.NO’ .
gt_fcatsip-seltext_l = ‘SİPARİŞ NO’ .
gt_fcatsip-just = ‘L’ .
” gt_fcatsip-hotspot = ‘X’ .
WHEN ‘SIPVEREN’.
gt_fcatsip-seltext_s = ‘S.’.
gt_fcatsip-seltext_m = ‘SIP.VER.’.
gt_fcatsip-seltext_l = ‘SIPARIS VEREN’.
gt_fcatsip-just = ‘L’ .
WHEN ‘SIPISTEYEN’.
gt_fcatsip-seltext_s = ‘S.’.
gt_fcatsip-seltext_m = ‘SIP.IST.’.
gt_fcatsip-seltext_l = ‘SIPARIS ISTEYEN’.
gt_fcatsip-just = ‘L’ .
WHEN ‘SIPARIS’.
gt_fcatsip-seltext_s = ‘S.’.
gt_fcatsip-seltext_m = ‘SIP.’.
gt_fcatsip-seltext_l = ‘SIPARIS’.
gt_fcatsip-just = ‘L’ .
WHEN ‘FIYAT’.
gt_fcatsip-seltext_s = ‘F.’.
gt_fcatsip-seltext_m = ‘FIY.’.
gt_fcatsip-seltext_l = ‘FIYAT’.
gt_fcatsip-just = ‘L’ .
WHEN ‘ODEMETURU’.
gt_fcatsip-seltext_s = ‘O.’.
gt_fcatsip-seltext_m = ‘OD.’.
gt_fcatsip-seltext_l = ‘ODEME’.
gt_fcatsip-just = ‘L’ .
WHEN ‘SID’ .
gt_fcatsip-no_out = ‘X’ .ENDCASE.
MODIFY gt_fcatsip.
ENDLOOP.
ENDFORM. ” FIELCAT_DUZENLE
*&———————————————————————*
*& Form LAYOUT_DUZENLE
*&———————————————————————*
FORM fielcat_duzenle .
LOOP AT gt_fcat.CASE gt_fcat-fieldname .
WHEN ‘ID’ .
gt_fcat-seltext_s = ‘S.NO’ .
gt_fcat-seltext_m = ‘SİP.NO’ .
gt_fcat-seltext_l = ‘SİPARİŞ NO’ .
gt_fcat-just = ‘L’ .
gt_fcat-hotspot = ‘X’ .
WHEN ‘SIPTOPLAYAN’.
gt_fcat-seltext_s = ‘S.TOP’ .
gt_fcat-seltext_m = ‘SIP.TOP.’ .
gt_fcat-seltext_l = ‘SIPARIS TOPLAYAN’ .
gt_fcat-just = ‘L’ .
“gt_fcat-hotspot = ‘X’ .
WHEN ‘TARIH’.
gt_fcat-seltext_s = ‘T.’ .
gt_fcat-seltext_m = ‘TAR.’ .
gt_fcat-seltext_l = ‘TARIH’ .
gt_fcat-just = ‘L’ .
WHEN ‘Pick up dt’.
gt_fcat-seltext_s = ‘T.’ .
gt_fcat-seltext_m = ‘TAR.’ .
gt_fcat-seltext_l = ‘TARIH’ .
gt_fcat-just = ‘L’ .
WHEN ‘SAAT’.
gt_fcat-seltext_s = ‘S.’ .
gt_fcat-seltext_m = ‘SA.’ .
gt_fcat-seltext_l = ‘SAAT’ .
gt_fcat-just = ‘L’ .
WHEN ‘ENDSAAT’.
gt_fcat-seltext_s = ‘B.S.’ .
gt_fcat-seltext_m = ‘BIT.SA.’ .
gt_fcat-seltext_l = ‘BITIS SAAT’ .
gt_fcat-just = ‘L’ .
WHEN ‘LOKANTA’.
gt_fcat-seltext_s = ‘L.’.
gt_fcat-seltext_m = ‘LOK.’.
gt_fcat-seltext_l = ‘LOKANTA’.
gt_fcat-just = ‘L’ .WHEN ‘SIPARIS’.
gt_fcat-seltext_s = ‘S.’.
gt_fcat-seltext_m = ‘SIP.’.
gt_fcat-seltext_l = ‘SIPARIS’.
gt_fcat-just = ‘L’ .* WHEN ‘DURUM’.
* gt_fcat-seltext_s = ‘S.D.’.
* gt_fcat-seltext_m = ‘SİP.DUR.’.
* gt_fcat-seltext_l = ‘SİPARİŞ DURUM’.
* gt_fcat-just = ‘L’ .WHEN ‘DURUM’ .
gt_fcat-no_out = ‘X’ .ENDCASE.
MODIFY gt_fcat.
ENDLOOP.
ENDFORM. ” FIELCAT_DUZENLE
*&———————————————————————*
*& Form LAYOUT_DUZENLE
*&———————————————————————*
FORM layout_duzenle .
gs_layo-zebra = ‘X’ .
gs_layo-box_fieldname = ‘SEC’.
ENDFORM. ” LAYOUT_DUZENLE*&———————————————————————*
*& Form layout_duzenle_sip
*&———————————————————————*
* text
*———————————————————————-*
FORM layout_duzenle_sip .
gs_layosip-zebra = ‘X’ .
gs_layosip-box_fieldname = ‘SECSIP’.ENDFORM. ” LAYOUT_DUZENLE
*&———————————————————————*
*& Module STATUS_0101 OUTPUT
*&———————————————————————*
* text
*———————————————————————-*
MODULE status_0101 OUTPUT.
SET PF-STATUS ‘BUTONGIRIS’.
” SET TITLEBAR ‘GUI2’.
“GUIENDMODULE. ” STATUS_0101 OUTPUT
*&———————————————————————*
*& Module USER_COMMAND_0101 INPUT
*&———————————————————————*
MODULE user_command_0101 INPUT.CASE sy-ucomm .
WHEN ‘BACK’ OR ‘&F03’ .LEAVE TO SCREEN 0 .
WHEN ‘SIPLER’ .
LEAVE TO SCREEN 0 .
WHEN ‘SIPKAYDET’ .
PERFORM sipariskaydet .
ENDCASE .
ENDMODULE. ” USER_COMMAND_0101 INPUT
*&———————————————————————*
*& Form SIPARISKAYDET
*&———————————————————————*
* SIPARIS KAYDETME FONKSIYONU
*———————————————————————-*
FORM sipariskaydet .DATA : gt_siparis LIKE zyemeksiparis OCCURS 0.
DATA : gs_siparis LIKE zyemeksiparis .
*&———————————————————————*
*& SON ID ALIYORUZ
*&———————————————————————*DATA : BEGIN OF itab_sip OCCURS 0 ,
id LIKE zyemeksiparis-id ,
END OF itab_sip .
DATA : lv_id LIKE zyemeksiparis-id .SELECT MAX( id ) FROM zyemeksiparis INTO lv_id .
lv_id = lv_id + 1 .
CONDENSE lv_id NO-GAPS.gs_siparis-id = lv_id.
gs_siparis-sipveren = siptoplayan .
gs_siparis-sipisteyen = sy-uname .
gs_siparis-siparis = siparis .
gs_siparis-odemeturu = otur .CONDENSE sid NO-GAPS.
gs_siparis-sid = sid . ” sid
APPEND gs_siparis TO gt_siparis.
MODIFY zyemeksiparis FROM TABLE gt_siparis.
COMMIT WORK AND WAIT. ” biraz bekleMESSAGE ‘Sipariş Bilgileri Başarı İle Kaydedildi… ‘ TYPE ‘I’ .
* PERFORM data_ceksip USING sid .
* PERFORM fieldcat_belirle_siparis .
* PERFORM fielcat_duzenle_sip .
* PERFORM layout_duzenle_sip .
* PERFORM alv_goster_sipler .ENDFORM. ” SIPARISKAYDET
*&———————————————————————*
*& Module STATUS_0100 OUTPUT
*&———————————————————————*
MODULE status_0100 OUTPUT.
SET PF-STATUS ‘BUTONGIRIS’.
“SET PF-STATUS ‘GUISIP’.
* SET TITLEBAR ‘xxx’.ENDMODULE. ” STATUS_0100 OUTPUT
*&———————————————————————*
*& Module USER_COMMAND_0100 INPUT
*&———————————————————————*MODULE user_command_0100 INPUT.
CASE sy-ucomm .
WHEN ‘BACK’ OR ‘&F03’ .
LEAVE TO SCREEN 0 .
WHEN ‘YSIPKAYDET’ .
PERFORM siparispaketinikaydet.
ENDCASE .ENDMODULE. ” USER_COMMAND_0100 INPUT
*&———————————————————————*
*& Form SIPARISPAKETINIKAYDET
*&———————————————————————*
FORM siparispaketinikaydet .DATA : gt_ysiparis LIKE zyemeksip OCCURS 0.
DATA : gs_ysiparis LIKE zyemeksip .
*&———————————————————————*
*& SON ID ALIYORUZ
*&———————————————————————*DATA : BEGIN OF itab_ysip OCCURS 0 ,
id LIKE zyemeksip-id ,
END OF itab_ysip .
DATA : lv_yid LIKE zyemeksip-id .SELECT MAX( id ) FROM zyemeksip INTO lv_yid .
lv_yid = lv_yid + 1 .
CONDENSE lv_yid NO-GAPS.gs_ysiparis-id = lv_yid .
gs_ysiparis-siptoplayan = ysipveren .
gs_ysiparis-siparis = ysiparis .
gs_ysiparis-lokanta = ylokanta .
gs_ysiparis-tarih = sy-datum .
gs_ysiparis-saat = sy-uzeit .gs_ysiparis-endsaat = sy-uzeit + 900 . ” 15 dakika ekliyoz
gs_ysiparis-durum = ‘ACIK’ .APPEND gs_ysiparis TO gt_ysiparis.
MODIFY zyemeksip FROM TABLE gt_ysiparis.COMMIT WORK AND WAIT. ” biraz bekle
MESSAGE ‘Sipariş Bilgileri Başarı İle Kaydedildi… ‘ TYPE ‘I’ .
PERFORM data_cek. ” YENILEMEK ICIN
ENDFORM. ” SIPARISPAKETINIKAYDET
*&———————————————————————*
*& Form IT_CALISANLAR HELP
*&———————————————————————*
FORM it_calisanlari_getir .
DATA: ihelp_fields LIKE help_value OCCURS
0 WITH
HEADER LINE.
DATA: BEGIN OF helptab OCCURS 100,
feld(80),
END OF helptab. “STANDARTLAR”SELECT * FROM zit_calisan INTO CORRESPONDING FIELDS OF TABLE zit_itab .
FREE : ihelp_fields, helptab.ihelp_fields-tabname = ‘ZIT_CALISAN’. ” Tablonun ismi
ihelp_fields-fieldname = ‘XUBNAME’. ” Tablonun alanı
ihelp_fields-selectflag = ‘X’. ” Secili gelmesi
APPEND ihelp_fields.ihelp_fields-tabname = ‘ZIT_CALISAN’. ” Tablonun ismi
ihelp_fields-fieldname = ‘PARTNER_TXT’. ” Tablonun alanı
ihelp_fields-selectflag = ”. ” Secili gelmesi
APPEND ihelp_fields.LOOP AT zit_itab .
MOVE zit_itab-xubname TO helptab-feld. APPEND helptab.
MOVE zit_itab-partner_txt TO helptab-feld. APPEND helptab.
ENDLOOP .CALL FUNCTION ‘HELP_VALUES_GET_WITH_TABLE’
EXPORTING
fieldname = ‘XUBNAME’
tabname = ‘ZIT_CALISAN’
IMPORTING
select_value = spveren “gv_it
TABLES
fields = ihelp_fields
valuetab = helptab
EXCEPTIONS
field_not_in_ddic = 01
more_then_one_selectfield = 02
no_selectfield = 03.
” ITELEMAN = gv_iteleman.ENDFORM. ” F4_P_ADI
*&———————————————————————*
*& Form IT_CALISANLAR HELP
*&———————————————————————*
*&———————————————————————*
*& Module USER_COMMAND_0500 INPUT
*&———————————————————————*MODULE user_command_0500 INPUT.
CASE sy-ucomm .
WHEN ‘BACK’ OR ‘&F03’ .
LEAVE TO SCREEN 0 .
WHEN ‘FGUNCEL’ .PERFORM fiyatguncelle .
PERFORM data_ceksip USING sid .
PERFORM fieldcat_belirle_siparis .
PERFORM fielcat_duzenle_sip .
PERFORM layout_duzenle_sip .
PERFORM alv_goster_sipler .LEAVE TO SCREEN 0 .
WHEN ‘FKAPAT’ .
LEAVE TO SCREEN 0 .
ENDCASE .
ENDMODULE. ” USER_COMMAND_0500 INPUT
*&———————————————————————*
*& Module STATUS_0500 OUTPUT
*&———————————————————————*
MODULE status_0500 OUTPUT.
SET PF-STATUS ‘GUIFIYATDUZENLE’.
SET TITLEBAR ‘FIYAT DUZENLE’.ENDMODULE. ” STATUS_0500 OUTPUT
*&———————————————————————*
*& Form FIYATGUNCELLE
*&———————————————————————*
FORM fiyatguncelle .data : ls_sipler_itab type zyemeksiparis,
lt_sipler_itab LIKE zyemeksiparis OCCURS 0 WITH HEADER LINE.LOOP AT sipler_itab WHERE id = SSID .
MOVE-CORRESPONDING sipler_itab to ls_sipler_itab .
ls_sipler_itab-FIYAT = FIYAT .
APPEND ls_sipler_itab to lt_sipler_itab .ENDLOOP .
MODIFY zyemeksiparis from table lt_sipler_itab .
ENDFORM. ” FIYATGUNCELLE
SAP ABAP yemek sipariş program kodu.,
Burhan KARADERE
24 Eylül 2016 @ 13:50
*&———————————————————————*
*& Report ZYEMEKSIP
*& Date : 09.07.2009
*&———————————————————————*
*& Reseon : IT yemek sipariş takip programı
*& Abap Developer : Burhan KARADERE
*& Copyleft ® 2009 by Burhan KARADERE
*& Contact E-mail : burhan@karadere.com
*&———————————————————————*
REPORT zyemeksip.
TABLES : zit_calisan , zyemeksiparis .
TYPE-POOLS : slis . ” KUTUPHANE
TYPE-POOLS: vrm. ” LISTBOX ICIN
” LISTBOX ICIN DEGISKENLER
DATA: name TYPE vrm_id,
list TYPE vrm_values,
value LIKE LINE OF list.
” LISTBOX ICIN DEGISKENLER
*&———————————————————————*
*& GLOBAL DEGISKENLER by Burhan KARADERE 01.07.2009
*&———————————————————————*
DATA : siparis(50) TYPE c .
DATA : lokanta(30) TYPE c . ” lokanta
DATA : siptoplayan(10) TYPE c . “sip toplayan
DATA : ysipveren(10) TYPE c . ” sip veren
DATA : ylokanta(15) TYPE c . “lokanta
DATA : ysiparis(50) TYPE c . ” sipariş
DATA : otur(10) TYPE c . ” ödeme türü
DATA : sid(10) TYPE c . ” siparis id
DATA : ssid LIKE zyemeksiparis-id . ” siparis detay id
DATA : fiyat(10) TYPE c . ” ödeme türü
DATA : silid(10) TYPE c . ” silme id si ..
*&———————————————————————*
*& GLOBAL DEGISKENLER by Burhan KARADERE 01.07.2009
*&———————————————————————*
DATA : gt_fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE ,
” fieldcat
gs_layo TYPE slis_layout_alv .
” SIPARIS PAKETLERI ITABI
DATA : BEGIN OF sip_itab OCCURS 100 ,
sec TYPE c,
id LIKE zyemeksip-id ,
sver(10) TYPE c,
siptoplayan LIKE zyemeksip-siptoplayan ,
tarih LIKE zyemeksip-tarih ,
saat LIKE zyemeksip-saat ,
endsaat LIKE zyemeksip-endsaat ,
lokanta LIKE zyemeksip-lokanta ,
siparis LIKE zyemeksip-siparis ,
durum LIKE zyemeksip-durum ,
sipsil(5) TYPE c,
sdetay(5) TYPE c,
END OF sip_itab .
” SIPARISLER ITAB
DATA : gt_fcatsip TYPE slis_t_fieldcat_alv WITH HEADER LINE ,
” fieldcat
gs_layosip TYPE slis_layout_alv .
DATA : BEGIN OF sipler_itab OCCURS 0 ,
secsip TYPE c,
id LIKE zyemeksiparis-id ,
sipveren LIKE zyemeksiparis-sipveren ,
sipisteyen LIKE zyemeksiparis-sipisteyen ,
siparis LIKE zyemeksiparis-siparis ,
fiyat LIKE zyemeksiparis-fiyat ,
” fiyat TYPE NETWR_AK ,
fiyatturu(10) TYPE c ,
odemeturu LIKE zyemeksiparis-odemeturu,
sid LIKE zyemeksiparis-sid,
fduzenle(10) TYPE c,
END OF sipler_itab .
*&———————————————————————*
*& HELP MENU ICIN IT CALISANLAR by Burhan KARADERE 01.07.2009
*&———————————————————————*
DATA : BEGIN OF zit_itab OCCURS 0 ,
xubname LIKE zit_calisan-xubname ,
partner_txt LIKE zit_calisan-partner_txt,
END OF zit_itab .
DATA: gv_it LIKE zit_calisan-xubname . ” GV_PIL IL_ID DONUYOR
SELECTION-SCREEN BEGIN OF BLOCK b0 WITH FRAME TITLE text-001 .
PARAMETERS:m1 RADIOBUTTON GROUP r1 USER-COMMAND radio1 DEFAULT ‘X’,
m2 RADIOBUTTON GROUP r1.
SELECTION-SCREEN : END OF BLOCK b0 .
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-002 .
DATA starih TYPE abhod . ” SISTEM DEN GELEN TARIH FORMATI
SELECT-OPTIONS btarih FOR starih MODIF ID sc1 OBLIGATORY
DEFAULT sy-datum .
SELECTION-SCREEN : END OF BLOCK b1 .
SELECTION-SCREEN : BEGIN OF BLOCK b2 WITH FRAME TITLE text-003 .
PARAMETERS spveren(10) TYPE c MODIF ID sc2 .
SELECTION-SCREEN : END OF BLOCK b2 .
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF m1 = ‘X’ AND screen-group1 = ‘SC1’ .
screen-active = 0.
MODIFY SCREEN.
ENDIF.
IF m1 = ‘X’ AND screen-group1 = ‘SC2’ .
screen-active = 0.
MODIFY SCREEN.
ENDIF.
IF m2 = ‘X’ AND screen-group1 = ‘SC1’ .
screen-active = 1.
MODIFY SCREEN.
ENDIF.
IF m2 = ‘X’ AND screen-group1 = ‘SC2’ .
screen-active = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
*&———————————————————————*
*& LISTBOX ICIN by Burhan KARADERE 15.07.2009
*&———————————————————————*
CLEAR : list[]. “TEMIZLIYOZ”
name = ‘OTUR’.
value-key = ‘MULTINET’.
value-text = ‘MULTINET’.
APPEND value TO list.
value-key = ‘SELECTA’.
value-text = ‘SELECTA’.
APPEND value TO list.
value-key = ‘NAKIT’.
value-text = ‘NAKIT’.
APPEND value TO list.
value-key = ‘K. KARTI’.
value-text = ‘K. KARTI’.
APPEND value TO list.
CALL FUNCTION ‘VRM_SET_VALUES’
EXPORTING
id = name
values = list.
*&———————————————————————*
*& LISTBOX ICIN by Burhan KARADERE 15.07.2009
*&———————————————————————*
*&———————————————————————*
*& HELP MENU ICIN IT CALISANLAR by Burhan KARADERE 10.07.2009
*&———————————————————————*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR spveren .
PERFORM it_calisanlari_getir .
*&———————————————————————*
*& HELP MENU ICIN IT CALISANLAR by Burhan KARADERE 10.07.2009
*&———————————————————————*
START-OF-SELECTION . ” programın başladıgı kısım
IF m1 = ‘X’ .
PERFORM data_cek.
ENDIF.
IF m2 = ‘X’ .
PERFORM data_cek_bugunku .
ENDIF.
*&———————————————————————*
*& Form DATA_CEK by Burhan KARADERE 03.07.2009
*&———————————————————————*
FORM data_cek .
SELECT * FROM zyemeksip INTO CORRESPONDING FIELDS OF TABLE sip_itab
WHERE tarih = sy-datum ORDER BY id DESCENDING .
LOOP AT sip_itab .
sip_itab-sver = ‘Sip.Ver.’ .
sip_itab-sipsil = ‘X’ .
sip_itab-sdetay = ‘Detay’ .
MODIFY sip_itab.
ENDLOOP.
PERFORM fieldcat_belirle .
PERFORM fielcat_duzenle .
PERFORM layout_duzenle .
PERFORM alv_goster .
ENDFORM. ” DATA_CEK
*&———————————————————————*
*& Form DATA_CEK_BUGUNKU
*&———————————————————————*
* bugun ku icin data cek by Burhan KARADERE 03.07.2009
*———————————————————————-*
FORM data_cek_bugunku .
SELECT * FROM zyemeksip INTO CORRESPONDING FIELDS OF TABLE sip_itab
WHERE tarih IN btarih AND siptoplayan = spveren
ORDER BY id DESCENDING .
LOOP AT sip_itab .
sip_itab-sver = ‘Sip.Ver.’ .
sip_itab-sipsil = ‘X’ .
sip_itab-sdetay = ‘Detay’ .
MODIFY sip_itab.
ENDLOOP.
IF sy-subrc NE 0 .
MESSAGE ‘Aradığınız kırıterlerde kayıt bulunamadı… ‘
& ‘Lütfen kriterlerinizi kontrol edip tekrar deneyiniz’ TYPE ‘I’ .
ELSE.
PERFORM fieldcat_belirle .
PERFORM fielcat_duzenle .
PERFORM layout_duzenle .
PERFORM alv_goster .
ENDIF.
ENDFORM. “DATA_CEK_BUGUNKU
*&———————————————————————*
*& Form DATA_CEKSIP
*&———————————————————————*
* text
*———————————————————————-*
FORM data_ceksip USING sid TYPE c . “burhan
SELECT * FROM zyemeksiparis
INTO CORRESPONDING FIELDS OF TABLE sipler_itab
WHERE sid = sid ORDER BY id DESCENDING .
LOOP AT sipler_itab .
sipler_itab-fiyatturu = ‘TL’ .
sipler_itab-fduzenle = ‘Duzenle’ .
MODIFY sipler_itab.
ENDLOOP.
ENDFORM. ” DATA_CEK
*&———————————————————————*
*& Form FIELDCAT_BELIRLE
*&———————————————————————*
FORM fieldcat_belirle .
CALL FUNCTION ‘REUSE_ALV_FIELDCATALOG_MERGE’
EXPORTING
i_program_name = sy-repid
i_internal_tabname = ‘SIP_ITAB’
i_inclname = sy-repid
i_client_never_display = ‘X’
i_bypassing_buffer = ‘X’
CHANGING
ct_fieldcat = gt_fcat[]
EXCEPTIONS
OTHERS = 3.
IF sy-subrc NE 0.
EXIT.
ENDIF .
ENDFORM. ” FIELDCAT_BELIRLE
*&———————————————————————*
*& Form FIELDCAT_BELIRLE
*&———————————————————————*
FORM fieldcat_belirle_siparis .
CALL FUNCTION ‘REUSE_ALV_FIELDCATALOG_MERGE’
EXPORTING
i_program_name = sy-repid
i_internal_tabname = ‘SIPLER_ITAB’
i_inclname = sy-repid
i_client_never_display = ‘X’
i_bypassing_buffer = ‘X’
CHANGING
ct_fieldcat = gt_fcatsip[]
EXCEPTIONS
OTHERS = 3.
IF sy-subrc NE 0.
EXIT.
ENDIF .
ENDFORM. ” FIELDCAT_BELIRLE
*&———————————————————————*
*& Form ALV_GOSTER
*&———————————————————————*
*———————————————————————-*
FORM alv_goster .
CALL FUNCTION ‘REUSE_ALV_GRID_DISPLAY’
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = ‘GUIPAKETEKRANI’
i_callback_user_command = ‘ALVMENUKOMUTU’
is_layout = gs_layo
it_fieldcat = gt_fcat[]
i_grid_title = ‘SİPARİŞ PAKETLERİ’
TABLES
t_outtab = sip_itab
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. ” ALV_GOSTER
*&———————————————————————*
*& Form ALV_GOSTER SIPARIS
*&———————————————————————*
*———————————————————————-*
FORM alv_goster_sipler .
CALL FUNCTION ‘REUSE_ALV_GRID_DISPLAY’
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = ‘GUISIPARISLER’
i_callback_user_command = ‘ALVMENUKOMUTUSIP’
is_layout = gs_layosip “gs_layo
it_fieldcat = gt_fcatsip[]
i_grid_title = ‘SİPARİŞ DETAYLARI’
TABLES
t_outtab = sipler_itab
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. ” ALV_GOSTER
*&———————————————————————*
*& Form GUI
*&———————————————————————
FORM guipaketekrani USING g_xpa.
SET PF-STATUS ‘GUIPAKETEKRANI’.
ENDFORM. “GUI
*&———————————————————————*
*& Form GUISIPARISLER
*&———————————————————————*
* text
*———————————————————————-*
* –>G_XPA text
*———————————————————————-*
FORM guisiparisler USING g_xpa.
SET PF-STATUS ‘GUISIPARISLER’.
ENDFORM. “GUI
*&———————————————————————*
*& ALV Form COMMAND
*&———————————————————————*
FORM alvmenukomutu USING islem LIKE sy-ucomm alvkontrol TYPE
slis_selfield.
CASE islem .
WHEN ‘SIPVER’.
ysipveren = sy-uname .
CLEAR ylokanta .
CLEAR ysiparis .
CALL SCREEN 0100.
WHEN ‘&IC1’.
*&———————————————————————*
*& silme işlemi by Burhan KARADERE 22.07.2009
*&———————————————————————*
IF alvkontrol-sel_tab_field = ‘SIP_ITAB-SIPSIL’ .
READ TABLE sip_itab INDEX alvkontrol-tabindex .
silid = sip_itab-id .
CONDENSE silid NO-GAPS.
PERFORM paketsil USING silid .
ENDIF.
*&———————————————————————*
*& siparişler detay LİNKİ için yakalıyoz by Burhan KARADERE
*& 22.07.2009
*&———————————————————————*
IF alvkontrol-sel_tab_field =’SIP_ITAB-SDETAY’ .
READ TABLE sip_itab INDEX alvkontrol-tabindex .
IF sy-subrc = 0 .
sid = sip_itab-id.
CONDENSE sid NO-GAPS.
ENDIF.
PERFORM data_ceksip USING sid .
PERFORM fieldcat_belirle_siparis .
PERFORM fielcat_duzenle_sip .
PERFORM layout_duzenle_sip .
PERFORM alv_goster_sipler .
ENDIF.
*&———————————————————————*
*& siparişler detay için yakalıyoz by Burhan KARADERE 22.07.2009
*&———————————————————————*
IF sip_itab-sec = ‘X’ .
“MESSAGE ‘SECILDI’ TYPE ‘I’ .
READ TABLE sip_itab WITH KEY sec = ‘X’.
IF sy-subrc = 0 .
sid = sip_itab-id.
CONDENSE sid NO-GAPS.
ENDIF.
PERFORM data_ceksip USING sid .
PERFORM fieldcat_belirle_siparis .
PERFORM fielcat_duzenle_sip .
PERFORM layout_duzenle_sip .
PERFORM alv_goster_sipler .
ENDIF.
IF alvkontrol-sel_tab_field = ‘SIP_ITAB-ID’
OR alvkontrol-sel_tab_field = ‘SIP_ITAB-SIPTOPLAYAN’
OR alvkontrol-sel_tab_field = ‘SIP_ITAB-SVER’ .
READ TABLE sip_itab INDEX alvkontrol-tabindex .
IF sy-subrc = 0 .
IF sip_itab-endsaat <= sy-uzeit . MESSAGE 'Bu sipariş kapandı.' & 'Süresi dolmuştur.... ' &'Lütfen açık siparişleri deneyiniz...' TYPE 'I' . ELSE. siptoplayan = sip_itab-siptoplayan . lokanta = sip_itab-lokanta . ysiparis = sip_itab-siparis . sid = sip_itab-id . CONDENSE sid NO-GAPS. CLEAR siparis . CLEAR otur . CALL SCREEN 0101 . ENDIF. ENDIF. ENDIF. ENDCASE. alvkontrol-refresh = 'X'. ENDFORM . "command *&---------------------------------------------------------------------* *& Form alvmenukomutusip *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * -->ISLEM2 text
* –>ALVKONTROLSIP text
*———————————————————————-*
FORM alvmenukomutusip USING islem2 LIKE sy-ucomm alvkontrolsip TYPE
slis_selfield.
CASE islem2 .
* WHEN ‘SIPVER’
*
* ysipveren = sy-uname .
* CALL SCREEN 0100.
WHEN ‘TUMUNEDON’ .
LEAVE TO SCREEN 0 .
” MESSAGE ‘denem sipler’ TYPE ‘I’ .
ENDCASE.
*&———————————————————————*
*& DUZENLE LINK TIKLA by Burhan KARADERE 23.07.2008
*&———————————————————————*
IF alvkontrolsip-sel_tab_field =’SIPLER_ITAB-FDUZENLE’ .
IF sip_itab-siptoplayan = sy-uname .
READ TABLE sipler_itab INDEX alvkontrolsip-tabindex .
IF sy-subrc = 0 .
ssid = sipler_itab-id.
“CONDENSE ssid NO-GAPS.
ENDIF.
siptoplayan = sip_itab-siptoplayan .
ylokanta = sip_itab-lokanta .
ysiparis = sip_itab-siparis .
siparis = sipler_itab-siparis .
ysipveren = sipler_itab-sipisteyen .
fiyat = sipler_itab-fiyat .
sid = sipler_itab-sid .
CALL SCREEN 0500 STARTING AT 10 10 .
ELSE.
MESSAGE ‘Bu siparişi, Sepeti oluşturan kişi düzenliyebilir’ TYPE ‘I’ .
ENDIF.
ENDIF.
*&———————————————————————*
*& DUZENLE LINK TIKLA by Burhan KARADERE 23.07.2008
*&———————————————————————*
IF sipler_itab-secsip = ‘X’ .
IF sip_itab-siptoplayan = sy-uname .
READ TABLE sipler_itab WITH KEY secsip = ‘X’.
IF sy-subrc = 0 .
ssid = sipler_itab-id.
“CONDENSE ssid NO-GAPS.
ENDIF.
READ TABLE sipler_itab INDEX alvkontrolsip-tabindex .
siptoplayan = sip_itab-siptoplayan .
ylokanta = sip_itab-lokanta .
ysiparis = sip_itab-siparis .
siparis = sipler_itab-siparis .
ysipveren = sipler_itab-sipisteyen .
fiyat = sipler_itab-fiyat .
sid = sipler_itab-sid .
CALL SCREEN 0500 STARTING AT 10 10 .
ELSE.
MESSAGE ‘Bu siparişi, Sepeti oluşturan kişi düzenliyebilir’ TYPE ‘I’ .
ENDIF.
ENDIF.
alvkontrolsip-refresh = ‘X’.
ENDFORM. “alvmenukomutusip
*&———————————————————————*
*& Form FIELCAT_DUZENLE
*&———————————————————————*
FORM fielcat_duzenle_sip .
LOOP AT gt_fcatsip.
CASE gt_fcatsip-fieldname .
* WHEN ‘ID’ .
* gt_fcatsip-seltext_s = ‘S.NO’ .
* gt_fcatsip-seltext_m = ‘SİP.NO’ .
* gt_fcatsip-seltext_l = ‘SİPARİŞ NO’ .
* gt_fcatsip-just = ‘L’ .
* ” gt_fcatsip-hotspot = ‘X’ .
WHEN ‘SIPVEREN’.
gt_fcatsip-seltext_s = ‘S.’.
gt_fcatsip-seltext_m = ‘SIP.VER.’.
gt_fcatsip-seltext_l = ‘SIPARIS VEREN’.
gt_fcatsip-just = ‘L’ .
WHEN ‘SIPISTEYEN’.
gt_fcatsip-seltext_s = ‘S.’.
gt_fcatsip-seltext_m = ‘SIP.IST.’.
gt_fcatsip-seltext_l = ‘SIPARIS ISTEYEN’.
gt_fcatsip-just = ‘L’ .
WHEN ‘SIPARIS’.
gt_fcatsip-seltext_s = ‘S.’.
gt_fcatsip-seltext_m = ‘SIP.’.
gt_fcatsip-seltext_l = ‘SIPARIS’.
gt_fcatsip-just = ‘L’ .
WHEN ‘FIYAT’.
CLEAR : gt_fcatsip .
gt_fcatsip-fieldname = ‘FIYAT’.
gt_fcatsip-tabname = ‘SIPLER_ITAB’.
gt_fcatsip-do_sum = ‘X’.
gt_fcatsip-datatype = ‘CURR’.
gt_fcatsip-col_pos = ‘5’.
gt_fcatsip-seltext_s = ‘F.’.
gt_fcatsip-seltext_m = ‘FIY.’.
gt_fcatsip-seltext_l = ‘FIYAT’.
gt_fcatsip-just = ‘L’ .
WHEN ‘FIYATTURU’.
gt_fcatsip-seltext_s = ‘F.’.
gt_fcatsip-seltext_m = ‘F.TUR.’.
gt_fcatsip-seltext_l = ‘FIYAT TURU’.
gt_fcatsip-just = ‘L’ .
WHEN ‘ODEMETURU’.
gt_fcatsip-seltext_s = ‘O.’.
gt_fcatsip-seltext_m = ‘OD.’.
gt_fcatsip-seltext_l = ‘ODEME’.
gt_fcatsip-just = ‘L’ .
WHEN ‘FDUZENLE’.
* gt_fcatsip-seltext_s = ‘O.’.
* gt_fcatsip-seltext_m = ‘OD.’.
gt_fcatsip-seltext_l = ‘Düzenle’.
gt_fcatsip-just = ‘L’ .
gt_fcatsip-hotspot = ‘X’ .
WHEN ‘ID’ .
gt_fcatsip-no_out = ‘X’ .
WHEN ‘SID’ .
gt_fcatsip-no_out = ‘X’ .
WHEN ‘SECSIP’ .
gt_fcatsip-no_out = ‘X’ .
ENDCASE.
MODIFY gt_fcatsip.
ENDLOOP.
ENDFORM. ” FIELCAT_DUZENLE
*&———————————————————————*
*& Form LAYOUT_DUZENLE
*&———————————————————————*
FORM fielcat_duzenle .
LOOP AT gt_fcat.
CASE gt_fcat-fieldname .
WHEN ‘ID’ .
gt_fcat-seltext_s = ‘S.NO’ .
gt_fcat-seltext_m = ‘SİP.NO’ .
gt_fcat-seltext_l = ‘SİPARİŞ NO’ .
gt_fcat-just = ‘L’ .
gt_fcat-hotspot = ‘X’ .
WHEN ‘SVER’ .
gt_fcat-seltext_s = ‘S.V.’ .
gt_fcat-seltext_m = ‘SİP.VER.’ .
gt_fcat-seltext_l = ‘SİPARİŞ VER’ .
gt_fcat-just = ‘L’ .
gt_fcat-hotspot = ‘X’ .
WHEN ‘SIPTOPLAYAN’.
gt_fcat-seltext_s = ‘S.TOP’ .
gt_fcat-seltext_m = ‘SIP.TOP.’ .
gt_fcat-seltext_l = ‘SIPARIS TOPLAYAN’ .
gt_fcat-just = ‘L’ .
gt_fcat-hotspot = ‘X’ .
WHEN ‘TARIH’.
gt_fcat-seltext_s = ‘T.’ .
gt_fcat-seltext_m = ‘TAR.’ .
gt_fcat-seltext_l = ‘TARIH’ .
gt_fcat-just = ‘L’ .
WHEN ‘Pick up dt’.
gt_fcat-seltext_s = ‘T.’ .
gt_fcat-seltext_m = ‘TAR.’ .
gt_fcat-seltext_l = ‘TARIH’ .
gt_fcat-just = ‘L’ .
WHEN ‘SAAT’.
gt_fcat-seltext_s = ‘S.’ .
gt_fcat-seltext_m = ‘SA.’ .
gt_fcat-seltext_l = ‘SAAT’ .
gt_fcat-just = ‘L’ .
WHEN ‘ENDSAAT’.
gt_fcat-seltext_s = ‘B.S.’ .
gt_fcat-seltext_m = ‘BIT.SA.’ .
gt_fcat-seltext_l = ‘BITIS SAAT’ .
gt_fcat-just = ‘L’ .
WHEN ‘LOKANTA’.
gt_fcat-seltext_s = ‘L.’.
gt_fcat-seltext_m = ‘LOK.’.
gt_fcat-seltext_l = ‘LOKANTA’.
gt_fcat-just = ‘L’ .
WHEN ‘SIPARIS’.
gt_fcat-seltext_s = ‘S.’.
gt_fcat-seltext_m = ‘SIP.’.
gt_fcat-seltext_l = ‘SIPARIS’.
gt_fcat-just = ‘L’ .
WHEN ‘SIPSIL’.
“gt_fcat-seltext_s = ‘SIL.’.
“gt_fcat-seltext_m = ‘SIL.’.
gt_fcat-seltext_l = ‘SIL’.
gt_fcat-just = ‘L’ .
gt_fcat-hotspot = ‘X’ .
WHEN ‘SDETAY’.
“gt_fcat-seltext_s = ‘SIL.’.
“gt_fcat-seltext_m = ‘SIL.’.
gt_fcat-seltext_l = ‘Detay’.
gt_fcat-just = ‘L’ .
gt_fcat-hotspot = ‘X’ .
* WHEN ‘DURUM’.
* gt_fcat-seltext_s = ‘S.D.’.
* gt_fcat-seltext_m = ‘SİP.DUR.’.
* gt_fcat-seltext_l = ‘SİPARİŞ DURUM’.
* gt_fcat-just = ‘L’ .
WHEN ‘DURUM’ .
gt_fcat-no_out = ‘X’ .
WHEN ‘SEC’ .
gt_fcat-no_out = ‘X’ .
ENDCASE.
MODIFY gt_fcat.
ENDLOOP.
ENDFORM. ” FIELCAT_DUZENLE
*&———————————————————————*
*& Form LAYOUT_DUZENLE
*&———————————————————————*
FORM layout_duzenle .
gs_layo-zebra = ‘X’ .
gs_layo-box_fieldname = ‘SEC’.
“gs_layo-cell_merge = ‘X’.
“gs_layo-colwidth_optimize = ‘ ‘ .
ENDFORM. ” LAYOUT_DUZENLE
*&———————————————————————*
*& Form layout_duzenle_sip
*&———————————————————————*
* text
*———————————————————————-*
FORM layout_duzenle_sip .
gs_layosip-zebra = ‘X’ .
gs_layosip-box_fieldname = ‘SECSIP’.
“gs_layosip-NUMC_SUM = ‘X’ .
“gs_layosip-cell_merge = ‘X’.
“gs_layosip-colwidth_optimize = ‘ ‘ .
ENDFORM. ” LAYOUT_DUZENLE
*&———————————————————————*
*& Module STATUS_0101 OUTPUT
*&———————————————————————*
* text
*———————————————————————-*
MODULE status_0101 OUTPUT.
SET PF-STATUS ‘GUISIPARISLER’.
SET TITLEBAR ‘GUISIPARISLER’.
“GUI
ENDMODULE. ” STATUS_0101 OUTPUT
*&———————————————————————*
*& Module USER_COMMAND_0101 INPUT
*&———————————————————————*
MODULE user_command_0101 INPUT.
CASE sy-ucomm .
WHEN ‘BACK’ OR ‘&F03’ .
LEAVE TO SCREEN 0 .
WHEN ‘SIPKAYDET’ .
PERFORM sipariskaydet .
WHEN ‘TUMUNEDON’ .
*
** PERFORM data_cek.
** PERFORM fieldcat_belirle .
** PERFORM fielcat_duzenle .
** PERFORM layout_duzenle .
** PERFORM alv_goster .
LEAVE TO SCREEN 0 .
ENDCASE .
ENDMODULE. ” USER_COMMAND_0101 INPUT
*&———————————————————————*
*& Form SIPARISKAYDET
*&———————————————————————*
* SIPARIS KAYDETME FONKSIYONU
*———————————————————————-*
FORM sipariskaydet .
DATA : gt_siparis LIKE zyemeksiparis OCCURS 0.
DATA : gs_siparis LIKE zyemeksiparis .
*&———————————————————————*
*& SON ID ALIYORUZ
*&———————————————————————*
DATA : BEGIN OF itab_sip OCCURS 0 ,
“id LIKE zyemeksiparis-id ,
id TYPE i ,
END OF itab_sip .
DATA : lv_id LIKE zyemeksiparis-id .
SELECT MAX( id ) FROM zyemeksiparis INTO lv_id .
gs_siparis-id = lv_id + 1 .
gs_siparis-sipveren = siptoplayan .
gs_siparis-sipisteyen = sy-uname .
gs_siparis-siparis = siparis .
gs_siparis-odemeturu = otur .
CONDENSE sid NO-GAPS.
gs_siparis-sid = sid . ” sid
APPEND gs_siparis TO gt_siparis.
MODIFY zyemeksiparis FROM TABLE gt_siparis.
COMMIT WORK AND WAIT. ” biraz bekle
MESSAGE ‘Sipariş Bilgileri Başarı İle Kaydedildi… ‘ TYPE ‘I’ .
LEAVE TO SCREEN 0 .
* PERFORM data_ceksip USING sid .
* PERFORM fieldcat_belirle_siparis .
* PERFORM fielcat_duzenle_sip .
* PERFORM layout_duzenle_sip .
* PERFORM alv_goster_sipler .
ENDFORM. ” SIPARISKAYDET
*&———————————————————————*
*& Module STATUS_0100 OUTPUT
*&———————————————————————*
MODULE status_0100 OUTPUT.
SET PF-STATUS ‘GUIPAKETEKRANI’.
SET PF-STATUS ‘GUIPAKETEKRANI’.
* SET TITLEBAR ‘xxx’.
ENDMODULE. ” STATUS_0100 OUTPUT
*&———————————————————————*
*& Module USER_COMMAND_0100 INPUT
*&———————————————————————*
MODULE user_command_0100 INPUT.
CASE sy-ucomm .
WHEN ‘BACK’ OR ‘&F03’ .
LEAVE TO SCREEN 0 .
WHEN ‘YSIPKAYDET’ .
PERFORM siparispaketinikaydet.
WHEN ‘SIPARISPAK’ .
PERFORM data_cek.
PERFORM fieldcat_belirle .
PERFORM fielcat_duzenle .
PERFORM layout_duzenle .
PERFORM alv_goster .
LEAVE TO SCREEN 0 .
ENDCASE .
ENDMODULE. ” USER_COMMAND_0100 INPUT
*&———————————————————————*
*& Form SIPARISPAKETINIKAYDET
*&———————————————————————*
FORM siparispaketinikaydet .
DATA : gt_ysiparis LIKE zyemeksip OCCURS 0.
DATA : gs_ysiparis LIKE zyemeksip .
*&———————————————————————*
*& SON ID ALIYORUZ
*&———————————————————————*
DATA : BEGIN OF itab_ysip OCCURS 0 ,
id LIKE zyemeksip-id ,
END OF itab_ysip .
DATA : lv_yid LIKE zyemeksip-id .
SELECT MAX( id ) FROM zyemeksip INTO lv_yid .
gs_ysiparis-id = lv_yid + 1 .
gs_ysiparis-siptoplayan = ysipveren .
gs_ysiparis-siparis = ysiparis .
gs_ysiparis-lokanta = ylokanta .
gs_ysiparis-tarih = sy-datum .
gs_ysiparis-saat = sy-uzeit .
gs_ysiparis-endsaat = sy-uzeit + 900 . ” 15 dakika ekliyoz
gs_ysiparis-durum = ‘ACIK’ .
APPEND gs_ysiparis TO gt_ysiparis.
MODIFY zyemeksip FROM TABLE gt_ysiparis.
COMMIT WORK AND WAIT. ” biraz bekle
MESSAGE ‘Sipariş Bilgileri Başarı İle Kaydedildi… ‘ TYPE ‘I’ .
PERFORM data_cek. ” YENILEMEK ICIN
ENDFORM. ” SIPARISPAKETINIKAYDET
*&———————————————————————*
*& Form IT_CALISANLAR HELP
*&———————————————————————*
FORM it_calisanlari_getir .
DATA: ihelp_fields LIKE help_value OCCURS
0 WITH
HEADER LINE.
DATA: BEGIN OF helptab OCCURS 100,
feld(80),
END OF helptab. “STANDARTLAR”
SELECT * FROM zit_calisan INTO CORRESPONDING FIELDS OF TABLE zit_itab .
FREE : ihelp_fields, helptab.
ihelp_fields-tabname = ‘ZIT_CALISAN’. ” Tablonun ismi
ihelp_fields-fieldname = ‘XUBNAME’. ” Tablonun alanı
ihelp_fields-selectflag = ‘X’. ” Secili gelmesi
APPEND ihelp_fields.
ihelp_fields-tabname = ‘ZIT_CALISAN’. ” Tablonun ismi
ihelp_fields-fieldname = ‘PARTNER_TXT’. ” Tablonun alanı
ihelp_fields-selectflag = ”. ” Secili gelmesi
APPEND ihelp_fields.
LOOP AT zit_itab .
MOVE zit_itab-xubname TO helptab-feld. APPEND helptab.
MOVE zit_itab-partner_txt TO helptab-feld. APPEND helptab.
ENDLOOP .
CALL FUNCTION ‘HELP_VALUES_GET_WITH_TABLE’
EXPORTING
fieldname = ‘XUBNAME’
tabname = ‘ZIT_CALISAN’
IMPORTING
select_value = spveren “gv_it
TABLES
fields = ihelp_fields
valuetab = helptab
EXCEPTIONS
field_not_in_ddic = 01
more_then_one_selectfield = 02
no_selectfield = 03.
” ITELEMAN = gv_iteleman.
ENDFORM. ” F4_P_ADI
*&———————————————————————*
*& Form IT_CALISANLAR HELP
*&———————————————————————*
*&———————————————————————*
*& Module USER_COMMAND_0500 INPUT
*&———————————————————————*
MODULE user_command_0500 INPUT.
CASE sy-ucomm .
WHEN ‘BACK’ OR ‘&F03’ .
LEAVE TO SCREEN 0 .
WHEN ‘FGUNCEL’ .
PERFORM fiyatguncelle .
* PERFORM data_ceksip USING sid .
* PERFORM fieldcat_belirle_siparis .
* PERFORM fielcat_duzenle_sip .
* PERFORM layout_duzenle_sip .
* PERFORM alv_goster_sipler .
LEAVE TO SCREEN 0 .
WHEN ‘FKAPAT’ .
LEAVE TO SCREEN 0 .
ENDCASE .
ENDMODULE. ” USER_COMMAND_0500 INPUT
*&———————————————————————*
*& Module STATUS_0500 OUTPUT
*&———————————————————————*
MODULE status_0500 OUTPUT.
SET PF-STATUS ‘GUIFIYATDUZENLE’.
SET TITLEBAR ‘GUIFIYATDUZENLE’.
ENDMODULE. ” STATUS_0500 OUTPUT
*&———————————————————————*
*& Form FIYATGUNCELLE
*&———————————————————————*
FORM fiyatguncelle .
*& VİRGÜL icin by Burhan KARADERE 23.07.2009
REPLACE ‘,’ WITH ‘.’ INTO fiyat.
*& VİRGÜL icin by Burhan KARADERE 23.07.2009
DATA : ls_sipler_itab TYPE zyemeksiparis,
lt_sipler_itab LIKE zyemeksiparis OCCURS 0 WITH HEADER LINE.
LOOP AT sipler_itab WHERE id = ssid .
MOVE-CORRESPONDING sipler_itab TO ls_sipler_itab .
ls_sipler_itab-fiyat = fiyat .
APPEND ls_sipler_itab TO lt_sipler_itab .
*&———————————————————————*
*& itab guncelliyoz alv refresh icin by Burhan KARADERE 23.07.2009
*&———————————————————————*
sipler_itab-fiyat = fiyat .
MODIFY sipler_itab . ” burhankaradere
*&———————————————————————*
*& itab guncelliyoz alv refresh icin by Burhan KARADERE 23.07.2009
*&———————————————————————*
ENDLOOP .
MODIFY zyemeksiparis FROM TABLE lt_sipler_itab .
*LOOP AT sipler_itab WHERE id = ssid .
*
*sipler_itab-fiyat = fiyat .
*MODIFY sipler_itab . ” burhankaradere
*
*ENDLOOP.
ENDFORM. ” FIYATGUNCELLE
*&———————————————————————*
*& Form PAKETSIL
*&———————————————————————*
* sipariş paketi siliyoruz by Burhan KARADERE 22.07.2008
*———————————————————————-*
FORM paketsil USING silid .
READ TABLE sip_itab WITH KEY id = silid . ” burhankaradere
IF sip_itab-siptoplayan = SY-UNAME . ” SILME HAKKI KONTROLU
*&———————————————————————*
* confirm function by Burhan KARADERE 23.07.2008
*———————————————————————-*
DATA : paket_silinsinmi type c.
CALL FUNCTION ‘POPUP_TO_CONFIRM’
EXPORTING
TITLEBAR = ‘[ SİPARİŞ PAKETİ SİL ]’
TEXT_QUESTION = ‘Bu Sipariş paketini silmek istediğinize eminmisiniz ?’
IMPORTING ANSWER = paket_silinsinmi .
*&———————————————————————*
* confirm function by Burhan KARADERE 23.07.2008
*———————————————————————-*
IF paket_silinsinmi = ‘1’.
DELETE FROM zyemeksip WHERE id = silid .
DELETE sip_itab WHERE id = silid .
IF sy-subrc = 0.
MESSAGE ‘Sipariş Paketi Başarı İle Silindi’ TYPE ‘I’ .
ELSE.
MESSAGE ‘Silinecek Sipariş paketi Bulunamadı. ‘ TYPE ‘I’ .
ENDIF.
DELETE FROM zyemeksiparis WHERE sid = silid .
IF sy-subrc = 0.
MESSAGE ‘Sipariş Paketi Alt Siparişleri Başarı İle Silindi’ TYPE
‘I’ .
ELSE.
MESSAGE ‘Silinecek Sipariş paketi Alt Siparişleri bulunamadı ‘
TYPE ‘I’ .
ENDIF.
ELSEIF paket_silinsinmi = ‘2’.
MESSAGE ‘Sipariş silme işlemi iptal edildi.’ TYPE ‘I’ .
ELSEIF paket_silinsinmi = ‘3’.
“MESSAGE ‘İPTAL EDİLDİ’ TYPE ‘I’ .
ENDIF.
*&———————————————————————*
* confirm function by Burhan KARADERE 23.07.2008
*———————————————————————-*
ELSE.
MESSAGE ‘Sipariş Paketini Silmeye Yetkiniz Yok.’ &
‘Sipariş Paketini Oluşturan Kişi Silebilir.’ TYPE ‘I’ .
ENDIF.
ENDFORM. ” PAKETSIL
*&———————————————————————*
* PROGRAM sONU bY Burhan KARADERE 23.07.2008
*———————————————————————-*
Burhan KARADERE
24 Eylül 2016 @ 13:51
bu son versiyon sanırım 🙂 denemek lazım .