Cuma , 21 Temmuz 2017

İthalat Siparişi Çekilen miktar karşılaştırma raporu

Home Forumlar SAP ABAP Forum ABAP Genel İthalat Siparişi Çekilen miktar karşılaştırma raporu

Bu konu 0 yanıt ve 1 izleyen içeriyor ve en son Sinan Dilaver’in profil fotoğrafı Sinan Dilaver tarafından 2 yıl önce tarihinde güncellendi.

1 yazı görüntüleniyor (toplam 1)
  • Yazar
    Yazılar
  • #4216
    Sinan Dilaver’in profil fotoğrafı
    Sinan Dilaver
    Yönetici

    ************************************************************************
    * İthalatı Tamamlanmış Mallar Raporu ***********************************
    ************************************************************************
    report zisisrp014
    no standard page heading
    line-size 255
    message-id zisis.

    tables : t001,
    t001w,
    ekko,
    ekpo,
    rbkp,
    rseg,
    t052u,
    t023t,
    tvtyt,
    lfa1,
    zmis8004,
    zmis5003,
    zmis5004,
    zmis5006,
    zmis5016.

    type-pools: slis.
    data: begin of itab occurs 0.
    include structure zmis9012.
    data: dabmg like ekes-dabmg.
    data: end of itab.
    *data : itab like zmis9012 occurs 1 with header line,
    data: it023t like t023t occurs 1 with header line.

    data: b2_selection value ‘X’,
    gt_fieldcat type slis_fieldcat_alv occurs 1 with header line,
    ls_layout type slis_layout_alv,
    lt_events type slis_t_event,
    alv_title(70) type c,
    i_repid like sy-repid.

    constants:
    c_pf_status_set TYPE slis_formname VALUE ‘PF_STATUS_SET’ .

    data: begin of pt001w occurs 1 ,
    werks like t001w-werks ,
    end of pt001w.

    selection-screen begin of block b1 with frame title text-001.
    select-options :
    s_bukrs for t001-bukrs,
    s_werks for t001w-werks,
    s_gcfis for zmis5003-gcfis,
    s_gcpos for zmis5003-gcpos,
    s_ckfis for zmis5006-ckfis,
    s_ckpos for zmis5006-ckpos,
    s_ebeln for zmis5003-ebeln matchcode object mekk,
    s_vbeln for zmis5003-vbeln,
    s_matnr for ekpo-matnr,
    s_matkl for ekpo-matkl,
    s_fitar for zmis5006-fitar,
    s_lifnr for ekko-lifnr matchcode object kred,
    s_gbeyn for zmis5006-gbeyn,
    s_gbdat for zmis5006-gbdat,
    s_fbeyn for zmis5003-fbeyn,
    s_beytr for zmis5003-beytr,
    s_zterm for zmis5004-zterm.
    selection-screen skip 1.
    selection-screen begin of block b2 with frame title text-002.
    select-options :
    p_lifnr for zmis5004-lifnr matchcode object kred
    no-extension no intervals,
    p_isfat for zmis5004-isfat matchcode object zfat
    no-extension no intervals,
    p_isftt for zmis5004-isftt
    no-extension no intervals.
    selection-screen end of block b2.
    selection-screen end of block b1.

    at selection-screen on block b2.
    if p_lifnr[] is initial and
    p_isfat[] is initial and
    p_isftt[] is initial.
    clear b2_selection.
    else.
    b2_selection = ‘X’.
    endif.

    start-of-selection.
    perform select_data.
    perform get_bukrs_werks.
    perform get_other_data.
    perform write_list.

    *
    *&———————————————————————*
    *& Form select_data
    *&———————————————————————*
    * text
    *———————————————————————-*
    * –> p1 text
    * < -- p2 text *----------------------------------------------------------------------* form select_data. select * into corresponding fields of table itab from zmis8004 where ebeln in s_ebeln and vbeln in s_vbeln and matnr in s_matnr and lifnr in s_lifnr and werks in s_werks and gcfis in s_gcfis and gcpos in s_gcpos and ckfis in s_ckfis and ckpos in s_ckpos and reverse eq space and fbeyn in s_fbeyn and beytr in s_beytr and gbeyn in s_gbeyn and gbdat in s_gbdat and fitar in s_fitar and statu eq 'C'. endform. " select_data *&---------------------------------------------------------------------* *& Form get_other_data *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text
    * < -- p2 text *----------------------------------------------------------------------* form get_other_data. select * into table it023t from t023t where spras = sy-langu and matkl in s_matkl . loop at itab. if itab-ebeln ne ekpo-ebeln. select single * from ekko where ebeln = itab-ebeln. endif. if itab-ebeln ne ekpo-ebeln or itab-ebelp ne ekpo-ebelp. select single * from ekpo where ebeln eq itab-ebeln and ebelp eq itab-ebelp and matkl in s_matkl . if sy-subrc ne 0. delete itab. continue. endif. read table it023t with key matkl = ekpo-matkl . endif. clear zmis5003. select single * from zmis5003 where gcfis eq itab-gcfis and gcpos eq itab-gcpos. clear zmis5004. select single * from zmis5004 where faref eq zmis5003-faref. if b2_selection = 'X'. if not ( zmis5004-isfat in p_isfat and zmis5004-isftt in p_isftt and zmis5004-lifnr in p_lifnr ). delete itab. continue. endif. endif. if not zmis5004-zterm in s_zterm . delete itab. continue. endif. clear zmis5016. select single * from zmis5016 where is_belnr eq itab-ckfis and is_posnr eq itab-ckpos and blg_type eq 'C'. itab-txz01 = ekpo-txz01. itab-stawn = zmis5003-stawn. itab-inco1 = ekko-inco1. itab-inco2 = ekko-inco2. itab-tesno = zmis5016-tesno. itab-lifnr = ekko-lifnr. itab-ftlif = zmis5003-lifnr. itab-isfat = zmis5004-isfat. itab-isftt = zmis5004-isftt. itab-zterm = zmis5004-zterm. itab-belnr = zmis5004-belnr. itab-gjahr = zmis5004-gjahr. itab-matkl = ekpo-matkl. itab-wgbez = it023t-wgbez. clear rseg. select single * from rseg where belnr eq zmis5004-belnr and gjahr eq zmis5004-gjahr and ebeln eq zmis5003-ebeln and ebelp eq zmis5003-ebelp. if sy-subrc eq 0. if rseg-bpmng ne 0. itab-ckwrb = rseg-wrbtr * itab-ckmng / rseg-bpmng. else. itab-ckwrb = rseg-wrbtr * itab-ckmng / rseg-menge. endif. select single * from rbkp where belnr eq rseg-belnr and gjahr eq rseg-gjahr. itab-rwaer = rbkp-waers. endif. if zmis5003-isfik eq space. itab-gumno = zmis5003-isgum. else. itab-gumno = zmis5003-isfik. endif. if itab-zterm ne t052u-zterm. clear t052u. select single * from t052u where spras eq sy-langu and zterm eq itab-zterm. endif. itab-text1 = t052u-text1. if itab-traty ne tvtyt-traty. clear tvtyt. select single * from tvtyt where spras eq sy-langu and traty eq itab-traty. endif. itab-vtext = tvtyt-vtext. perform get_lifnr_name using itab-lifnr itab-lifnr_name. perform get_lifnr_name using itab-ftlif itab-ftlif_name. perform get_lifnr_name using itab-gumru itab-gumru_name. perform get_lifnr_name using itab-nakli itab-nakli_name. perform get_ekalanlar. modify itab. endloop. sort itab by vbeln vbelp. loop at itab. on change of itab-vbeln or itab-vbelp. perform get_azaltilan_miktar. modify itab. endon. endloop. endform. " get_other_data *&---------------------------------------------------------------------* *& Form write_list *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text
    * < -- p2 text *----------------------------------------------------------------------* form write_list. i_repid = sy-repid. call function 'REUSE_ALV_FIELDCATALOG_MERGE' exporting i_program_name = i_repid i_internal_tabname = 'ITAB' i_inclname = i_repid changing ct_fieldcat = gt_fieldcat[]. read table gt_fieldcat with key fieldname = 'CKWRB'. if sy-subrc eq 0. gt_fieldcat-do_sum = 'X'. modify gt_fieldcat index sy-tabix. endif. loop at gt_fieldcat. if gt_fieldcat-fieldname = 'GCFIS' or gt_fieldcat-fieldname = 'GCPOS' or gt_fieldcat-fieldname = 'CKFIS' or gt_fieldcat-fieldname = 'CKPOS'. gt_fieldcat-fix_column = 'X'. gt_fieldcat-key = 'X'. else. gt_fieldcat-reptext_ddic = gt_fieldcat-seltext_m. endif. if gt_fieldcat-fieldname = 'CKWRB'. delete gt_fieldcat. endif. if gt_fieldcat-fieldname = 'RWAER'. delete gt_fieldcat. endif. modify gt_fieldcat. endloop. alv_title = text-003. call function 'REUSE_ALV_GRID_DISPLAY' exporting i_grid_title = alv_title i_callback_program = i_repid i_callback_pf_status_set = c_pf_status_set I_CALLBACK_USER_COMMAND = 'USER_COMMAND' is_layout = ls_layout it_fieldcat = gt_fieldcat[] it_events = lt_events tables t_outtab = itab. endform. " write_list *&---------------------------------------------------------------------* *& Form get_lifnr_name *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* form get_lifnr_name using px_lifnr px_lifnr_name. if px_lifnr ne lfa1-lifnr. clear lfa1. select single * from lfa1 where lifnr = px_lifnr. endif. px_lifnr_name = lfa1-name1. endform. " get_lifnr_name *&---------------------------------------------------------------------* *& Form get_bukrs_werks *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text
    * < -- p2 text *----------------------------------------------------------------------* form get_bukrs_werks. data : xt001 like t001 occurs 1 with header line. data : xt001w like t001w occurs 1 with header line. if not s_bukrs is initial. select * into table xt001 from t001 where bukrs in s_bukrs. loop at xt001. refresh xt001w. clear xt001w. call function 'K_WERKS_OF_BUKRS_FIND' exporting bukrs = xt001-bukrs tables itab_001w = xt001w exceptions no_entry_in_t001k = 1 no_entry_in_t001w = 2 others = 3. loop at xt001w. pt001w-werks = xt001w-werks. collect pt001w. endloop. endloop. loop at itab. read table pt001w with key werks = itab-werks. if sy-subrc ne 0. delete itab. continue. endif. endloop. endif. endform. " get_bukrs_werks *---------------------------------------------------------------------* * FORM PF_STATUS_SET * *---------------------------------------------------------------------* * Liste gui status * *---------------------------------------------------------------------* FORM pf_status_set USING rt_extab TYPE slis_t_extab. SET PF-STATUS '0100' . ENDFORM. *&---------------------------------------------------------------------* *& Form get_ekalanlar *&---------------------------------------------------------------------* form get_ekalanlar . select single fgirt ordtrh into corresponding fields of itab from zmis5002 where gcfis = itab-gcfis. select single bolnr traid into corresponding fields of itab from likp where VBELN = itab-VBELN . select single Z_FFGTAR Z_OZET_BEYANNO into (itab-atwrt,itab-beyanno) from zMIS5003 inner join zmis5038 on zmis5038~GCFIS = zMIS5003~gcfis where zMIS5003~gcfis = itab-gcfis and zMIS5003~gcpos = itab-gcpos . endform. " get_ekalanlar *---------------------------------------------------------------------* * FORM USER_COMMAND * * Interactiv functions * *---------------------------------------------------------------------* * --> r_ucomm – from user called function *
    * –> rs_selfield – structur of the selected list line *
    *———————————————————————*
    FORM user_command USING r_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield.
    data: pbukrs like ekko-bukrs.
    CASE r_ucomm.
    WHEN ‘&IC1’.
    READ TABLE ITAB INDEX rs_selfield-tabindex.
    select single bukrs into pbukrs
    from ekko
    where
    ebeln = itab-ebeln.
    SET PARAMETER ID ‘BUK’ FIELD pbukrs.

    SET PARAMETER ID ‘LIF’ FIELD ITAB-ftlif.
    SET PARAMETER ID ‘ISFAT’ FIELD ITAB-ISFAT.
    CALL TRANSACTION ‘ZISIS65’
    AND SKIP FIRST SCREEN.
    ENDCASE.
    ENDFORM.
    *&———————————————————————*
    *& Form get_azaltilan_miktar
    *&———————————————————————*
    form get_azaltilan_miktar .
    select single dabmg into itab-dabmg
    from ekes
    where
    vbeln = itab-vbeln and
    vbelp = itab-vbelp.
    endform. ” get_azaltilan_miktar

1 yazı görüntüleniyor (toplam 1)

Bu konuyu yanıtlamak için giriş yapmış olmalısınız.