BILLING REPORT

report zrsd_pce_0165 no standard page heading message-id zs001.

include zrsd_pce_0165_top.
include zrsd_pce_0165_fm.

at selection-screen on value-request for filename.
  perform. choose_input_file .


*---------------------------------------------------------------------*
*                     START-OF-SELECTION                              *
*---------------------------------------------------------------------*
start-of-selection.
  repid = sy-repid.
  perform. extract_document_data.
  describe table out_tab_list_1 lines listline .
  if listline > 0.
    perform  build_field.
    perform  display_data.
  else.
    message s003 with 'NO DATA FOUND!'. "No data found.
  endif.

*----------------------------------------------------------------------*
*   INCLUDE ZRSD_PCE_0165_FM                                           *
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*&      Form  extract_document_data
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&gt  p1        text
*  *----------------------------------------------------------------------*
form. extract_document_data .

  select vbrk~vbeln vbrp~aubel as vbelna vbrp~vgbel as vbelnl
  vbrk~fkart vbrk~kunag vbrk~vkorg vbrk~vtweg vbrk~spart vbrk~erdat
  vbak~bstnk
  into corresponding fields of table out_tab_list
  from vbrk inner join vbrp
  on vbrk~vbeln = vbrp~vbeln
  inner join vbak
  on vbak~vbeln = vbrp~aubel
  where vbrk~vbeln in vbeln
    and vbrp~aubel in vbelna
    and vbrp~vgbel in vbelnl
    and vbak~bstnk in bstnk
    and vbrk~kunag in kunnr
    and vbrk~vkorg in vkorg
    and vbrk~vtweg in vtweg
    and vbrk~spart in spart
    and vbrk~fkart in fkart
    and vbrk~erdat in erdat
    and vbrk~vbeln not like '28%'.
**" 28 is cancel billing

  sort out_tab_list by  vbeln bstnk.
  loop at out_tab_list.
    clear:out_tab_list_1.
    move-corresponding out_tab_list to out_tab_list_1.
***get cancell billing number
    select single vbeln into out_tab_list_1-sfakn
    from vbrk where sfakn = out_tab_list-vbeln.
***check DN if exist.
    select single * from likp where vbeln = out_tab_list-vbelnl.
    if sy-subrc <> 0.
      if  ( out_tab_list-fkart = 'ZPLA')
         or ( out_tab_list-fkart = 'ZPLB')
         or ( out_tab_list-fkart = 'ZPLC')
         or ( out_tab_list-fkart = 'ZPLD')
         or ( out_tab_list-fkart = 'ZPLE').
        continue.
      endif.
    endif.

    append out_tab_list_1.
  endloop.
  delete adjacent duplicates from out_tab_list_1 comparing all fields.

endform.                    " extract_document_data
*&---------------------------------------------------------------------*
*&      Form  build_field
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&gt  p1        text
*  *----------------------------------------------------------------------*
form. build_field.
  perform. append_alv using:
    'SELID' 'Selid'  'X' 'X',
    'VBELN' 'Billing Document' '' '',
    'BSTNK' 'Customer PO' '' '',
    'VBELNA' 'Sales Order' '' '',
    'VBELNL' 'Delivery Notes' '' '',
    'SFAKN'  'Cancel Billing Number' '' '',
    'FKART' 'Billing type' '' '',
    'KUNAG' 'Sold to party' '' '',
    'VKORG' 'Sales Org'  '' '',
    'VTWEG' 'Sales Channel'  '' '',
    'SPART' 'Divison'  '' '',
    'ERDAT' 'Billing Create Date' '' ''.
endform.                    " build_field
*&---------------------------------------------------------------------*
*&      Form  display_data
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&gt  p1        text
*  *----------------------------------------------------------------------*
form. display_data.
  wa_layout-zebra = 'X'.
  wa_layout-colwidth_optimize = 'X'.
  call function 'REUSE_ALV_GRID_DISPLAY'
       exporting
            i_callback_program       = repid
            i_callback_pf_status_set = 'ZSD_165_1000'
            i_callback_user_command  = 'USER_COMMAND'
            i_grid_title             = 'EMC invoice For EPDIII'
            is_layout                = wa_layout
            it_fieldcat              = fieldcat[]
       tables
            t_outtab                 = out_tab_list_1[].

endform.                    " display_data
*&---------------------------------------------------------------------*
*&      Form  append_alv
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      --&gtP_1805   text
*      --&gtP_1806   text
*      --&gtP_1807   text
*      --&gtP_1808   text
*----------------------------------------------------------------------*
form. append_alv using   fieldname fieldtext checkbox edit.
  move:
      fieldname to fieldcat-fieldname,
      fieldtext to fieldcat-seltext_l,
      checkbox  to fieldcat-checkbox,
      edit      to fieldcat-edit.
  append fieldcat to fieldcat.
  clear fieldcat.
endform.                    " append_alv


*&---------------------------------------------------------------------*
*&      Form  Z165_1000
*&---------------------------------------------------------------------*
form. zsd_165_1000 using rt_extab type slis_t_extab.
  set pf-status '1000'.
endform.
*&---------------------------------------------------------------------*
*&      Form  USER_COMMAND
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&gt  p1        text
*  *----------------------------------------------------------------------*
form. user_command using r_ucomm type sy-ucomm
                         rs_selfield type slis_selfield.

  call function 'GET_GLOBALS_FROM_SLVC_FULLSCR'
       importing
            e_grid = gv_grid.
  call method gv_grid->check_changed_data.
  call method gv_grid->refresh_table_display.

  case r_ucomm.
    when 'BACK'.
      leave to  screen 0.
    when 'EXIT'.
      leave program.
    when 'OUTPUT' .
      perform. list_document .
    when 'EXCEL'.
      perform. excel_document .
    when 'SELALL'.
      perform  mark_all using 'X' .
    when 'DESELALL'.
      perform. mark_all using 'N' .
  endcase.
endform.
*&---------------------------------------------------------------------*
*&      Form  list_document
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&gt  p1        text
*  *----------------------------------------------------------------------*
form. list_document.
  describe table out_tab_list_1 lines listline.
  do listline times.
    out_tab_list_1-selid = space.
    clear:  out_tab_list_1 .
    read line sy-index field
         value  out_tab_list_1-selid  out_tab_list_1-vbeln.
    check sy-subrc eq 0.
    if out_tab_list_1-selid ='X'.
      modify out_tab_list_1 transporting selid
            where vbeln = out_tab_list_1-vbeln.
    elseif out_tab_list_1-selid eq ''.
      modify out_tab_list_1 transporting selid
            where vbeln = out_tab_list_1-vbeln.
    endif.

    read table out_tab_list_1 with key selid  = 'X'.
    if  out_tab_list_1-selid ='X'.
      modify  out_tab_list_1 transporting selid
            where vbeln =  out_tab_list_1-vbeln.
    elseif  out_tab_list_1-selid eq ''.
      modify  out_tab_list_1 transporting selid
            where vbeln = out_tab_list_1-vbeln.
    endif.
  enddo.
  read table  out_tab_list_1  with key selid  = 'X'.
  if sy-subrc ne 0.
    message i000 with 'Please First Choose ItemNO.'.
    exit.
  else.
    perform. output_pdf.
    perform. call_smartforms.
  endif.

endform.                    " list_document

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/14397246/viewspace-666220/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/14397246/viewspace-666220/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
提供的源码资源涵盖了安卓应用、小程序、Python应用和Java应用等多个领域,每个领域都包含了丰富的实例和项目。这些源码都是基于各自平台的最新技术和标准编写,确保了在对应环境下能够无缝运行。同时,源码中配备了详细的注释和文档,帮助用户快速理解代码结构和实现逻辑。 适用人群: 这些源码资源特别适合大学生群体。无论你是计算机相关专业的学生,还是对其他领域编程感兴趣的学生,这些资源都能为你提供宝贵的学习和实践机会。通过学习和运行这些源码,你可以掌握各平台开发的基础知识,提升编程能力和项目实战经验。 使用场景及目标: 在学习阶段,你可以利用这些源码资源进行课程实践、课外项目或毕业设计。通过分析和运行源码,你将深入了解各平台开发的技术细节和最佳实践,逐步培养起自己的项目开发和问题解决能力。此外,在求职或创业过程中,具备跨平台开发能力的大学生将更具竞争力。 其他说明: 为了确保源码资源的可运行性和易用性,特别注意了以下几点:首先,每份源码都提供了详细的运行环境和依赖说明,确保用户能够轻松搭建起开发环境;其次,源码中的注释和文档都非常完善,方便用户快速上手和理解代码;最后,我会定期更新这些源码资源,以适应各平台技术的最新发展和市场需求。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值