XXX-TS-MM083-采購(gòu)訂單的交貨日期的批量修改_第1頁(yè)
XXX-TS-MM083-采購(gòu)訂單的交貨日期的批量修改_第2頁(yè)
XXX-TS-MM083-采購(gòu)訂單的交貨日期的批量修改_第3頁(yè)
XXX-TS-MM083-采購(gòu)訂單的交貨日期的批量修改_第4頁(yè)
XXX-TS-MM083-采購(gòu)訂單的交貨日期的批量修改_第5頁(yè)
已閱讀5頁(yè),還剩3頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

zhoXXXXXERP系統(tǒng)實(shí)施一期項(xiàng)目項(xiàng)目自定義開(kāi)發(fā)程序技術(shù)說(shuō)明書文件名:SEPC/ERP項(xiàng)目試點(diǎn)組/自定義開(kāi)發(fā)程序技術(shù)說(shuō)明書創(chuàng)建人:FM第8頁(yè),共8頁(yè) XXXXXERP系統(tǒng)實(shí)施一期項(xiàng)目系統(tǒng)實(shí)現(xiàn)階段文檔ERP系統(tǒng)實(shí)施一期項(xiàng)目技術(shù)設(shè)計(jì)說(shuō)明書開(kāi)發(fā)編號(hào):-TS-MM083功能名稱:采購(gòu)訂單交貨日期批量修改

第一部分:基本信息(生成新的版本后,以下內(nèi)容要相應(yīng)改動(dòng))開(kāi)發(fā)類型FORMCHECKBOX增強(qiáng)FORMCHECKBOX接口FORMCHECKBOX單據(jù)FORMCHECKBOX報(bào)表技術(shù)工具FORMCHECKBOXEnhancementFORMCHECKBOXUserExitFORMCHECKBOXBAdIFORMCHECKBOXDialogFORMCHECKBOXInteractivelistFORMCHECKBOXABAPOOFORMCHECKBOXFunctiongroupFORMCHECKBOXRFCFORMCHECKBOXBAPIfunctionFORMCHECKBOXExecutiveProgramFORMCHECKBOXBDCFORMCHECKBOXTableContentsModificationFORMCHECKBOXServerfileFORMCHECKBOXLocalfileFORMCHECKBOXSAPScriptFORMCHECKBOXSmartformsFORMCHECKBOXOutput-onlyList模塊MM開(kāi)發(fā)機(jī)及集團(tuán)DEV/110事務(wù)代碼程序IDZMM_DCI0083程序名稱采購(gòu)訂單交貨日期批量修改功能設(shè)計(jì)者技術(shù)設(shè)計(jì)者ABAP程序員第二部分:設(shè)計(jì)書維護(hù)記錄更新日期更新人員簡(jiǎn)要說(shuō)明2012-1創(chuàng)建第三部分:技術(shù)方案描述3.1業(yè)務(wù)需求描述根據(jù)采購(gòu)訂單號(hào)查詢出滿足要求的采購(gòu)訂單。并可以修改采購(gòu)訂單中行項(xiàng)目的交貨日期、統(tǒng)計(jì)交貨日期或交貨已完成狀態(tài)。3.2技術(shù)解決方案通過(guò)批處理實(shí)現(xiàn)3.3系統(tǒng)簡(jiǎn)單架構(gòu)圖3.4數(shù)據(jù)結(jié)構(gòu)第四部分:程序邏輯描述—將主要代碼功能描述清楚,通過(guò)BAPIBAPI_PO_CHANGE實(shí)現(xiàn)批量修改交貨日期和統(tǒng)計(jì)日期第五部分:源程序復(fù)雜性功能實(shí)現(xiàn)可貼主要功能代碼部分1.代碼如下:

根據(jù)選擇屏幕用戶輸入的條件獲取相關(guān)的采購(gòu)訂單信息抓取采購(gòu)信息抬頭信息

SELECT

ebeln

bsart

loekz

lifnr

frgke

INTO

TABLE

lt_ekko

FROM

ekko

WHERE

ebeln

IN

s_ebeln

AND

bstyp

=

'F'

"采購(gòu)訂單

AND

ernam

IN

s_ernam.

IF

sy-subrc

=

0.

DELETE

lt_ekko

WHERE

loekz

IS

NOT

INITIAL.

"刪除帶有刪除標(biāo)記的采購(gòu)訂單

ENDIF.

*抓取采購(gòu)信息行項(xiàng)目信息

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

"刪除帶有刪除標(biāo)記的采購(gòu)訂單行項(xiàng)目

OR

elikz

IS

NOT

INITIAL.

ENDIF.

*抓取計(jì)劃行數(shù)據(jù)

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.

*

合并所有數(shù)據(jù)

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.

"如果是選擇修改交貨狀態(tài),則行項(xiàng)目狀態(tài)為已完成的不顯示

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.

"默認(rèn)選擇屏幕上的新交貨日期

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形式顯示所有符合條件的采購(gòu)訂單

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.

"監(jiān)聽(tīng)雙擊事件

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.批量修改采購(gòu)訂單的交貨日期和統(tǒng)計(jì)日期

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.

*

按照采購(gòu)訂單順序來(lái)批量修改

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. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論