XXX-TS-MM083-采购订单的交货日期的批量修改_第1页
XXX-TS-MM083-采购订单的交货日期的批量修改_第2页
XXX-TS-MM083-采购订单的交货日期的批量修改_第3页
XXX-TS-MM083-采购订单的交货日期的批量修改_第4页
XXX-TS-MM083-采购订单的交货日期的批量修改_第5页
已阅读5页,还剩3页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

zhoXXXXXERP系统实施一期项目项目自定义开发程序技术说明书文件名:SEPC/ERP项目试点组/自定义开发程序技术说明书创建人:FM第8页,共8页 XXXXXERP系统实施一期项目系统实现阶段文档ERP系统实施一期项目技术设计说明书开发编号:-TS-MM083功能名称:采购订单交货日期批量修改

第一部分:基本信息(生成新的版本后,以下内容要相应改动)开发类型FORMCHECKBOX增强FORMCHECKBOX接口FORMCHECKBOX单据FORMCHECKBOX报表技术工具FORMCHECKBOXEnhancementFORMCHECKBOXUserExitFORMCHECKBOXBAdIFORMCHECKBOXDialogFORMCHECKBOXInteractivelistFORMCHECKBOXABAPOOFORMCHECKBOXFunctiongroupFORMCHECKBOXRFCFORMCHECKBOXBAPIfunctionFORMCHECKBOXExecutiveProgramFORMCHECKBOXBDCFORMCHECKBOXTableContentsModificationFORMCHECKBOXServerfileFORMCHECKBOXLocalfileFORMCHECKBOXSAPScriptFORMCHECKBOXSmartformsFORMCHECKBOXOutput-onlyList模块MM开发机及集团DEV/110事务代码程序IDZMM_DCI0083程序名称采购订单交货日期批量修改功能设计者技术设计者ABAP程序员第二部分:设计书维护记录更新日期更新人员简要说明2012-1创建第三部分:技术方案描述3.1业务需求描述根据采购订单号查询出满足要求的采购订单。并可以修改采购订单中行项目的交货日期、统计交货日期或交货已完成状态。3.2技术解决方案通过批处理实现3.3系统简单架构图3.4数据结构第四部分:程序逻辑描述—将主要代码功能描述清楚,通过BAPIBAPI_PO_CHANGE实现批量修改交货日期和统计日期第五部分:源程序复杂性功能实现可贴主要功能代码部分1.代码如下:

根据选择屏幕用户输入的条件获取相关的采购订单信息抓取采购信息抬头信息

SELECT

ebeln

bsart

loekz

lifnr

frgke

INTO

TABLE

lt_ekko

FROM

ekko

WHERE

ebeln

IN

s_ebeln

AND

bstyp

=

'F'

"采购订单

AND

ernam

IN

s_ernam.

IF

sy-subrc

=

0.

DELETE

lt_ekko

WHERE

loekz

IS

NOT

INITIAL.

"删除带有删除标记的采购订单

ENDIF.

*抓取采购信息行项目信息

SELECT

ebeln

ebelp

loekz

txz01

matnr

werks

menge

meins

elikz

retpo

INTO

TABLE

lt_ekpo

FROM

ekpo

WHERE

ebeln

IN

s_ebeln.

IF

sy-subrc

=

0.

DELETE

lt_ekpo

WHERE

loekz

IS

NOT

INITIAL

"删除带有删除标记的采购订单行项目

OR

elikz

IS

NOT

INITIAL.

ENDIF.

*抓取计划行数据

SELECT

ebeln

ebelp

etenr

eindt

slfdt

wemng

INTO

TABLE

lt_eket

FROM

eket

WHERE

ebeln

IN

s_ebeln.

IF

lt_ekko

IS

NOT

INITIAL.

SELECT

lifnr

name1

INTO

TABLE

lt_lfa1

FROM

lfa1

FOR

ALL

ENTRIES

IN

lt_ekko

WHERE

lifnr

=

lt_ekko-lifnr.

ENDIF.

*

合并所有数据

SORT:

lt_ekko

BY

ebeln,

lt_lfa1

BY

lifnr,

lt_eket

BY

ebeln

ebelp.

LOOP

AT

lt_ekpo

INTO

ls_ekpo.

AUTHORITY-CHECK

OBJECT

'M_BEST_WRK'

ID

'ACTVT'

FIELD

'03'

ID

'WERKS'

FIELD

ls_ekpo-werks.

CHECK

sy-subrc

=

0.

READ

TABLE

lt_ekko

INTO

ls_ekko

WITH

KEY

ebeln

=

ls_ekpo-ebeln

BINARY

SEARCH.

IF

sy-subrc

=

0.

IF

p_cstat

IS

NOT

INITIAL

AND

ls_ekpo-elikz

IS

NOT

INITIAL.

CONTINUE.

"如果是选择修改交货状态,则行项目状态为已完成的不显示

ENDIF.

AUTHORITY-CHECK

OBJECT

'M_MATE_BUK'

ID

'ACTVT'

FIELD

'03'

ID

'BUKRS'

FIELD

ls_ekko-bukrs.

CHECK

sy-subrc

=

0.

AUTHORITY-CHECK

OBJECT

'M_BEST_EKO'

ID

'ACTVT'

FIELD

'03'

ID

'EKORG'

FIELD

ls_ekko-ekorg.

CHECK

sy-subrc

=

0.

AUTHORITY-CHECK

OBJECT

'M_BEST_EKG'

ID

'ACTVT'

FIELD

'03'

ID

'EKGRP'

FIELD

ls_ekko-ekgrp.

CHECK

sy-subrc

=

0.

AUTHORITY-CHECK

OBJECT

'M_BEST_BSA'

ID

'ACTVT'

FIELD

'03'

ID

'BSART'

FIELD

ls_ekko-bsart.

CHECK

sy-subrc

=

0.

CLEAR

ls_lfa1.

READ

TABLE

lt_lfa1

INTO

ls_lfa1

WITH

KEY

lifnr

=

ls_ekko-lifnr

BINARY

SEARCH.

CLEAR

ls_eket.

READ

TABLE

lt_eket

INTO

ls_eket

WITH

KEY

ebeln

=

ls_ekpo-ebeln

ebelp

=

ls_ekpo-ebelp

BINARY

SEARCH.

ls_zsmm083-ebeln

=

ls_ekpo-ebeln.

ls_zsmm083-bsart

=

ls_ekko-bsart.

ls_zsmm083-lifnr

=

ls_ekko-lifnr.

ls_zsmm083-name1

=

ls_lfa1-name1.

ls_zsmm083-ebelp

=

ls_ekpo-ebelp.

ls_zsmm083-matnr

=

ls_ekpo-matnr.

ls_zsmm083-txz01

=

ls_ekpo-txz01.

ls_zsmm083-menge

=

ls_ekpo-menge.

ls_zsmm083-meins

=

ls_ekpo-meins.

ls_zsmm083-werks

=

ls_ekpo-werks.

ls_zsmm083-eindt

=

ls_eket-eindt.

ls_zsmm083-elikz

=

ls_ekpo-elikz.

ls_zsmm083-slfdt

=

ls_eket-slfdt.

ls_zsmm083-frgke

=

ls_ekko-frgke.

ls_zsmm083-wemng

=

ls_eket-wemng.

ls_zsmm083-obmng

=

ls_ekpo-menge

-

ls_eket-wemng.

ls_zsmm083-new_slfdt

=

ls_eket-slfdt.

IF

ls_ekpo-retpo

IS

NOT

INITIAL.

ls_zsmm083-wemng

=

ls_zsmm083-wemng

*

-1.

ENDIF.

ls_zsmm083-new_eindt

=

p_eindt.

"默认选择屏幕上的新交货日期

IF

ls_zsmm083-elikz

IS

NOT

INITIAL.

ls_zsmm083-po_status

=

'已完成'(004).

ELSE.

ls_zsmm083-po_status

=

'未完成'(005).

ENDIF.

APPEND

ls_zsmm083

TO

lt_zsmm083.

ENDIF.

ENDLOOP.

gt_zsmm083

=

lt_zsmm083.以ALV形式显示所有符合条件的采购订单

IF

gl_container

IS

INITIAL.

CREATE

OBJECT

gl_container

EXPORTING

container_name

=

gl_mycontainer

lifetime

=

cntl_lifetime_dynpro.

CREATE

OBJECT

gl_grid

EXPORTING

i_parent

=

gl_container

EXCEPTIONS

error_cntl_create

=

1

error_cntl_init

=

2

error_cntl_link

=

3

error_dp_create

=

4

OTHERS

=

5.

IF

sy-subrc

<>

0.

MESSAGE

ID

sy-msgid

TYPE

sy-msgty

NUMBER

sy-msgno

WITH

sy-msgv1

sy-msgv2

sy-msgv3

sy-msgv4.

ENDIF.

CREATE

OBJECT

gr_event_handler.

SET

HANDLER

gr_event_handler->handle_double_click

FOR

gl_grid.

"监听双击事件

PERFORM

frm_init_fieldcatalog

USING

lt_fieldcat

p_cdate

p_cstat.

PERFORM

frm_init_layout

USING

ls_layout.

gs_layout

=

ls_layout.

CALL

METHOD

gl_grid->set_table_for_first_display

EXPORTING

is_layout

=

ls_layout

CHANGING

it_outtab

=

gt_zsmm083

it_fieldcatalog

=

lt_fieldcat.

ENDIF.批量修改采购订单的交货日期和统计日期

LOOP

AT

gt_zsmm083

INTO

ls_zsmm083

WHERE

checkbox

IS

NOT

INITIAL

OR

new_status

IS

NOT

INITIAL.

APPEND

ls_zsmm083

TO

lt_zsmm083.

p_subrc

=

4.

ENDLOOP.

CHECK

p_subrc

IS

NOT

INITIAL.

DESCRIBE

TABLE

lt_zsmm083

LINES

lv_total_lines.

*

按照采购订单顺序来批量修改

SORT

lt_zsmm083

BY

ebeln

ebelp.

LOOP

AT

lt_zsmm083

INTO

ls_zsmm083.

ADD

1

TO

lv_current_line.

lv_percentage

=

lv_current_line

*

100

/

lv_total_lines.

lv_text

=

lv_percentage.

CONCATENATE

lv_text

'%'

INTO

lv_text.

CONDENSE

lv_text

NO-GAPS.

CALL

FUNCTION

'SAPGUI_PROGRESS_INDICATOR'

EXPORTING

percentage

=

lv_percentage

text

=

lv_text.

CASE

'X'.

WHEN

p_cdate.

ls_items_schedule-po_item

=

ls_zsmm083-ebelp.

ls_items_schedule-sched_line

=

'0001'.

ls_items_schedule-delivery_date

=

ls_zsmm083-new_eindt.

ls_items_schedule-stat_date

=

ls_zsmm083-new_slfdt.

APPEND

ls_items_schedule

TO

lt_items_schedule.

ls_items_schedulex-po_item

=

ls_zsmm083-ebelp.

ls_items_schedulex-sched_line

=

'0001'.

ls_items_schedulex-delivery_date

=

'X'.

ls_items_schedulex-stat_date

=

'X'.

APPEND

ls_items_schedulex

TO

lt_items_schedulex.

WHEN

p_cstat.

ls_items-po_item

=

ls_zsmm083-ebelp.

ls_items-no_more_gr

=

'X'.

ls_items-delete_ind

=

'S'.

APPEND

ls_items

TO

lt_items.

ls_itemsx-po_item

=

ls_zsmm083-ebelp.

ls_itemsx-no_more_gr

=

'X'.

ls_itemsx-delete_ind

=

'X'.

APPEND

ls_itemsx

TO

lt_itemsx.

ENDCASE.

AT

END

OF

ebeln.

CALL

FUNCTION

'BAPI_PO_CHANGE'

EXPORTING

purchaseorder

=

ls_zsmm083-ebeln

TABLES

return

=

lt_return

poitem

=

lt_items

poitemx

=

lt_itemsx

poschedule

=

lt_items_schedule

poschedulex

=

lt_items_schedulex.

LOOP

AT

lt_return

INTO

ls_return

WHERE

type

=

'E'.

ENDLOOP.

IF

ls_return

IS

NOT

INITIAL.

MESSAGE

ID

ls_return-id

TYPE

ls_return-type

NUMBER

ls_return-number

WITH

ls_return-message_v1

ls_return-message_v2

ls_return-message_v3

ls_return-message_v4

INTO

ls_zsmm083-message.

C

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论