DAILY RECORD

欢迎来到DAILY RECORD>>   | 首页 资源中心 | 翻译 | 配置点滴 | 日常问题 | ABAP开发 | 阅读文章 | HR知识 | 生活 | basis | ITPUB论坛

CO02工单维护里面批量更改其组件工厂和仓位的功能

发表人:chateasy | 发表时间: 2008年七月02日, 17:57

*&---------------------------------------------------------------------*
*& Report ZPP_CO02 *
*& *
*&---------------------------------------------------------------------*
*& 问题描述:工厂间带物料外发时需要使用计划工厂和生产工厂来控制,但组件
* 的需求是根据生产工厂产生的,无法满足带物料外发至生产的需求
*业务需求:需要在CO02工单维护里面批量更改其组件工厂和仓位的功能,
*更改的数据源于计划工厂的物料主数据
*
*&---------------------------------------------------------------------*

REPORT zpp_co02 .


TABLES: mard. "物料的仓储位置数据.
TABLES: marc. "物料的工厂数据.
TABLES: afpo. "订单项.
TABLES: afko. "订单表头数据 PP 订单.
TABLES: resb. "预定/相关需求 为生产订单 所预留的物料、数量、地点、等
DATA : w_aufnr TYPE resb-aufnr. "生产订单号
DATA : p_werk TYPE afpo-pwerk. "生产订单计划工厂
DATA:BEGIN OF i_bdc OCCURS 0,
rspos LIKE resb-rspos,
posnr LIKE resb-posnr,
matnr LIKE resb-matnr,
END OF i_bdc.

* marc-LGPRO 生产仓储地点
* AFPO-PWERK 订单的计划工厂
* AFPO-DWERK 工厂
* AFPO-PLNUM 计划订单号
*AFKO-STLTY BOM 类别
*AFKO-STLNR 物料单
*AFKO-STLST BOM 状态
*AFKO-SDATV 开始生效日期
*AFKO-STLAL 可选的BOM
*AFKO-STLAN BOM用途
*AFKO-AUFLD BOM展开/工艺路线转换的日期
DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
DATA: messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
PARAMETERS: p_aufnr LIKE afpo-aufnr OBLIGATORY.

AT SELECTION-SCREEN.
w_aufnr = p_aufnr.
PERFORM check_input.

START-OF-SELECTION.

PERFORM prd_modify .
*&---------------------------------------------------------------------*
*& Form check_input
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM check_input.

*给生产订单号补零
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = w_aufnr
IMPORTING
output = w_aufnr.

*取生产订单的计划工厂
SELECT SINGLE pwerk
INTO p_werk
FROM afpo
WHERE aufnr = w_aufnr.
IF p_werk IS INITIAL.
WRITE :/ w_aufnr , '的计划工厂不存在'.
ENDIF.
*取要更改的物料和项目号
SELECT rspos posnr matnr
INTO CORRESPONDING FIELDS OF TABLE i_bdc
FROM resb
WHERE aufnr = w_aufnr.

SORT I_BDC BY POSNR.
DATA : w_mestxt TYPE string.
IF i_bdc[] IS INITIAL.
CONCATENATE p_aufnr '不存在或没有BOM物料' INTO w_mestxt.
MESSAGE e368(00) WITH w_mestxt.
STOP.
ENDIF.
ENDFORM. "CHECK_INPUT
*&---------------------------------------------------------------------*
*& Form prd_modify
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM prd_modify.
WRITE:/ '成功与否请看系统左下角的提示,没有绿色成功标志,请重新执行本操作(可能当前有人在修改本生产订单)' COLOR COL_NEGATIVE.
ULINE.
DATA: w_sumi TYPE i VALUE 0 .
DATA: w_sumit TYPE string.
DATA: w_tmp TYPE string.

DATA : w_lgpro TYPE marc-lgpro.
DATA : firstitem TYPE c VALUE 'X'.
REFRESH bdcdata.
CLEAR bdcdata.

PERFORM bdc_dynpro USING 'SAPLCOKO1' '0110'.
PERFORM bdc_field USING 'BDC_CURSOR'
'CAUFVD-AUFNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=KPU2'.
PERFORM bdc_field USING 'CAUFVD-AUFNR'
w_aufnr.
PERFORM bdc_field USING 'R62CLORD-FLG_OVIEW'
'X'.


LOOP AT i_bdc.

w_sumi = w_sumi + 1.
w_sumit = w_sumi.
CONCATENATE '0' w_sumit ')' INTO w_sumit.
CONDENSE w_sumit NO-GAPS.


CLEAR w_lgpro.
* 取物料在计划工厂的生产仓储地点
SELECT SINGLE lgpro
INTO w_lgpro
FROM marc
WHERE werks = p_werk
AND matnr = i_bdc-matnr.
IF w_lgpro IS INITIAL.
WRITE :/ i_bdc-matnr , '生产仓储地点为空'.
ENDIF.

PERFORM bdc_dynpro USING 'SAPLCOMK' '0120'.
CLEAR w_tmp.
CONCATENATE 'RESBD-WERKS(' w_sumit INTO w_tmp.
PERFORM bdc_field USING 'BDC_CURSOR'
w_tmp.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'FILTER_BOX'
'NO_FIL'.
PERFORM bdc_field USING 'SORT_BOX'
'ST_STA'.
PERFORM bdc_field USING w_tmp
p_werk.
CLEAR w_tmp.
CONCATENATE 'RESBD-LGORT(' w_sumit INTO w_tmp.
PERFORM bdc_field USING w_tmp
w_lgpro.

PERFORM bdc_dynpro USING 'SAPLCOMD' '0110'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RESBD-MATNR'.
PERFORM bdc_field USING 'RESBD-MATNR'
i_bdc-matnr.
PERFORM bdc_field USING 'RESBD-POSNR'
i_bdc-posnr.
PERFORM bdc_field USING 'RESBD-LGORT'
w_lgpro.
PERFORM bdc_field USING 'RESBD-WERKS'
p_werk.

* firstitem = 'Y'.
* ENDIF.


IF sy-subrc = 0.
WRITE:/ '修改物料:' ,i_bdc-matnr, '行项目:' , i_bdc-posnr .
ENDIF.

ENDLOOP.

PERFORM bdc_dynpro USING 'SAPLCOMK' '0120'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RESBD-MATNR(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
PERFORM bdc_field USING 'FILTER_BOX'
'NO_FIL'.
PERFORM bdc_field USING 'SORT_BOX'
'ST_STA'.

CALL TRANSACTION 'CO02' USING bdcdata
MODE 'A'
UPDATE 'S'
MESSAGES INTO messtab.

ENDFORM. "prd_modify
*----------------------------------------------------------------------*
* Start new screen *
*----------------------------------------------------------------------*
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM. "BDC_DYNPRO

*----------------------------------------------------------------------*
* Insert field *
*----------------------------------------------------------------------*
FORM bdc_field USING fnam fval.
* IF FVAL <> NODATA.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
* ENDIF.
ENDFORM. "BDC_FIELD


* IF firstitem = 'Y' .
* PERFORM bdc_dynpro USING 'SAPLCOMK' '0120'.
* PERFORM bdc_field USING 'BDC_CURSOR'
* 'RESBD-WERKS(02)'.
* PERFORM bdc_field USING 'BDC_OKCODE'
* '/00'.
* PERFORM bdc_field USING 'FILTER_BOX'
* 'NO_FIL'.
* PERFORM bdc_field USING 'SORT_BOX'
* 'ST_STA'.
* PERFORM bdc_field USING 'RESBD-WERKS(02)'
* p_werk.
* PERFORM bdc_field USING 'RESBD-LGORT(02)'
* w_lgpro.
*
*
* PERFORM bdc_dynpro USING 'SAPLCOMD' '0110'.
* PERFORM bdc_field USING 'BDC_OKCODE'
* '/00'.
* PERFORM bdc_field USING 'BDC_CURSOR'
* 'RESBD-MATNR'.
* PERFORM bdc_field USING 'RESBD-MATNR'
* i_bdc-matnr.
* PERFORM bdc_field USING 'RESBD-POSNR'
* i_bdc-posnr.
* PERFORM bdc_field USING 'RESBD-LGORT'
* w_lgpro.
* PERFORM bdc_field USING 'RESBD-WERKS'
* p_werk.
* ENDIF.
*
* IF firstitem = 'X'.


订单BOM复制到物料BOM

发表人:chateasy | 发表时间: 2008年七月02日, 17:46

report ZPP_ORDBOM_BOM
no standard page heading line-size 255.
INCLUDE ZPPINC_BDC_CS01.
SELECTION-SCREEN BEGIN OF BLOCK radio
WITH FRAME title TEXT-001.
PARAMETERS: P_VBELN LIKE VBAP-VBELN OBLIGATORY,
P_POSNR LIKE VBAP-POSNR OBLIGATORY,
* P_WERKS LIKE VBAP-WERKS OBLIGATORY,
P_STLAN LIKE KDST-STLAN OBLIGATORY DEFAULT '1'.
SELECTION-SCREEN END OF BLOCK radio.

SELECTION-SCREEN BEGIN OF BLOCK radio1
WITH FRAME title TEXT-002.
PARAMETERS: P_WERKS1 LIKE VBAP-WERKS OBLIGATORY,
P_STLAN1 LIKE KDST-STLAN OBLIGATORY DEFAULT '1'.
SELECTION-SCREEN END OF BLOCK radio1.

at selection-screen.
PERFORM CHECK_INPUT.
START-OF-SELECTION.
LOOP AT I_VBAP.
REFRESH: T_GEN , LT_SUB_ITEM.
CLEAR: T_GEN , LT_SUB_ITEM.
PERFORM BOM_EXPLOSION.
perform BOM_CREATE USING P_WERKS1.
ENDLOOP.
*---------------------------------------------------------------------*
* FORM CHECK_INPUT *
*---------------------------------------------------------------------*
* CHECK THE INPUT *
*---------------------------------------------------------------------*
FORM CHECK_INPUT.
SELECT vbeln vbpos matnr werks STLAN
INTO CORRESPONDING FIELDS OF TABLE i_vbap
FROM kdst
WHERE vbeln = p_vbeln
AND vbpos = p_posnr
* AND werks = p_werks
AND STLAN = p_stlan.
IF I_VBAP[] IS INITIAL.
MESSAGE E368(00) WITH '该销售订单/行项目不存在!'.
STOP.
ENDIF.
ENDFORM. "CHECK_INPUT

*&---------------------------------------------------------------------*
*& Include ZPPINC_BDC_CS01 *
*&---------------------------------------------------------------------*


DATA: firstitem(1) TYPE c VALUE 'X'.

DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
DATA: messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
DATA: lt_sub_item LIKE bicsu OCCURS 0 WITH HEADER LINE.
DATA w_temp TYPE string.
DATA: BEGIN OF t_gen OCCURS 0 .
INCLUDE STRUCTURE csxgen .
DATA END OF t_gen.
DATA:BEGIN OF i_vbap OCCURS 0,
vbeln LIKE kdst-vbeln,
vbpos LIKE kdst-vbpos,
matnr LIKE kdst-matnr,
werks LIKE kdst-werks,
STLAN like kdst-STLAN,
END OF i_vbap.
DATA: BEGIN OF t_doc OCCURS 0 .
INCLUDE STRUCTURE csxdoc .
DATA END OF t_doc.
DATA: BEGIN OF t_equi OCCURS 0 .
INCLUDE STRUCTURE csxequi .
DATA END OF t_equi.
DATA: BEGIN OF t_kla OCCURS 0 .
INCLUDE STRUCTURE csxkla.
DATA END OF t_kla.
DATA: BEGIN OF t_mat OCCURS 0 .
INCLUDE STRUCTURE csxmat .
DATA END OF t_mat.

DATA: BEGIN OF t_tpl OCCURS 0 .
INCLUDE STRUCTURE csxtpl .
DATA END OF t_tpl.

DATA: BEGIN OF i_tab OCCURS 0,
matnr LIKE mara-matnr,
mngko LIKE mseg-menge,
END OF i_tab.

*&---------------------------------------------------------------------*
*& Form BOM_CREATE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM bom_create USING P_WERKS.

firstitem = 'X'.
LOOP AT t_gen.
DATA : w_bmeng TYPE stko-bmeng,
w_bmein TYPE stko-bmein.
SELECT SINGLE bmeng bmein INTO
(w_bmeng,w_bmein)
FROM stko CLIENT SPECIFIED
WHERE stlty = t_gen-stlty
AND stlnr = t_gen-stlkn.


IF sy-subrc = 0.
IF firstitem ='X'.


PERFORM bdc_dynpro USING 'SAPLCSDI' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29N-STLAN'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RC29N-MATNR' "物料
i_vbap-matnr.
PERFORM bdc_field USING 'RC29N-WERKS' "工厂
P_WERKS.
PERFORM bdc_field USING 'RC29N-STLAN' "BOM用途
'1'.
PERFORM bdc_field USING 'RC29N-DATUV' "有效期始于
sy-datum.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0110'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29K-BMENG'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
CLEAR w_temp.
w_temp = w_bmeng.
* concatenate '''' w_temp '''' into w_temp.
PERFORM bdc_field USING 'RC29K-BMENG' "基本数量
w_temp.
PERFORM bdc_field USING 'RC29K-STLST' "BOM 状态
'1'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29K-EXSTL'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0111'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29K-LABOR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
ENDIF.

IF firstitem <>'X'.
*新增加一行项目
PERFORM bdc_dynpro USING 'SAPLCSDI' '0191'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29U-EBORT(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=FCPU'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0150'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-POSNR(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=FCNP'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0140'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-AUSKZ(02)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=FCUH'.
PERFORM bdc_field USING 'RC29P-AUSKZ(02)'
'X'.
PERFORM bdc_field USING 'RC29P-IDNRK(02)' "组件
t_gen-objnr.

CLEAR w_temp.
w_temp = t_gen-menge / w_bmeng.
PERFORM bdc_field USING 'RC29P-MENGE(02)' "数量
w_temp.
PERFORM bdc_field USING 'RC29P-MEINS(02)' "Un
t_gen-meins.
PERFORM bdc_field USING 'RC29P-POSTP(02)' "L
'L'.
ENDIF.


IF firstitem ='X'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0140'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-AUSKZ(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=FCUH'.
PERFORM bdc_field USING 'RC29P-AUSKZ(01)'
'X'.
PERFORM bdc_field USING 'RC29P-IDNRK(01)' "组件
t_gen-objnr.

CLEAR w_temp.
w_temp = t_gen-menge.
PERFORM bdc_field USING 'RC29P-MENGE(01)' "数量
w_temp.
PERFORM bdc_field USING 'RC29P-MEINS(01)' "Un
t_gen-meins.
PERFORM bdc_field USING 'RC29P-POSTP(01)' "L
'L'.
ENDIF.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0130'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-ALPGR'.
PERFORM bdc_field USING 'RC29P-POSNR'
t_gen-posnr. "项目编号
PERFORM bdc_field USING 'RC29P-IDNRK'
t_gen-objnr. "组件
firstitem ='Y'.

CLEAR w_temp.
w_temp = t_gen-menge.
PERFORM bdc_field USING 'RC29P-MENGE' "组件数量
w_temp.
PERFORM bdc_field USING 'RC29P-MEINS' "Un
t_gen-meins.
CLEAR w_temp.
w_temp = t_gen-fmeng.
PERFORM bdc_field USING 'RC29P-FMENG' "固定数量
w_temp.
CLEAR w_temp.
w_temp = t_gen-avoau.
PERFORM bdc_field USING 'RC29P-AVOAU' "工序废品按 %
w_temp.
CLEAR w_temp.
w_temp = t_gen-ALPGR.
PERFORM bdc_field USING 'RC29P-ALPGR' "替代项目组 %
w_temp.

CLEAR w_temp.
w_temp = t_gen-netau.
PERFORM bdc_field USING 'RC29P-NETAU' "净ID
w_temp.
CLEAR w_temp.
w_temp = t_gen-AUSCH.
PERFORM bdc_field USING 'RC29P-AUSCH'
w_temp.

if strlen( t_gen-ALPGR ) > 0.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0716'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-EWAHR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RC29P-EWAHR'
'CLWI'.
CLEAR w_temp.
w_temp = t_gen-ALPGR.
PERFORM bdc_field USING 'RC29P-ALPGR'
w_temp.
CLEAR w_temp.
w_temp = t_gen-ALPRF.
PERFORM bdc_field USING 'RC29P-ALPRF'
w_temp.
CLEAR w_temp.
w_temp = t_gen-ALPST.
PERFORM bdc_field USING 'RC29P-ALPST'
w_temp.
CLEAR w_temp.
w_temp = t_gen-EWAHR.
* w_temp = w_temp+0(3).
PERFORM bdc_field USING 'RC29P-EWAHR'
w_temp.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
endif.

*SAPLCSDI 0716 X
*
* BDC_CURSOR RC29P-EWAHR
* BDC_OKCODE =CLWI
* RC29P-ALPGR 10
* RC29P-ALPRF 1
* RC29P-ALPST 1
* RC29P-EWAHR 111

PERFORM bdc_dynpro USING 'SAPLCSDI' '0131'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-LGORT'.
PERFORM bdc_field USING 'RC29P-LGORT' "生产仓储地
t_gen-lgort.
PERFORM bdc_field USING 'RC29P-SANKA' "成本核算标识相
'X'.

PERFORM BOM_CREATE_SUBITEM.

ENDIF.
ENDLOOP.

PERFORM bdc_dynpro USING 'SAPLCSDI' '0191'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29U-EBORT(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=FCBU'.


CALL TRANSACTION 'CS01' USING bdcdata
MODE 'E'
UPDATE 'A'
MESSAGES INTO messtab.
REFRESH bdcdata.

WRITE messtab .
WRITE:/ messtab-TCODE,messtab-DYNAME, messtab-MSGID,messtab-MSGNR,messtab-MSGV1,messtab-MSGV2,messtab-MSGV3,messtab-MSGV4,messtab-FLDNAME.

IF sy-subrc = 0.
WRITE:/ '复制内容:''订单号:',I_VBAP-VBELN , '行项目:' , I_VBAP-VBPOS , '工厂', I_VBAP-WERKS , '物料' , I_VBAP-MATNR .
WRITE:/ '成功与否看系统本身的红色或绿色提示,该物料如有红色提示为失败,否则就为成功!' COLOR COL_NEGATIVE.
uline.


endif.
ENDFORM. "BOM_CREATE

FORM BOM_CREATE_SUBITEM.
DATA w_upmng TYPE stpu-upmng.
DATA w_subfirt TYPE c.
w_subfirt = 'X'.
SELECT stlkn ebort upmng uposz uptxt
INTO (lt_sub_item-xline , lt_sub_item-ebort, w_upmng, lt_sub_item-uposz, lt_sub_item-uptxt)
FROM stpu
WHERE stlnr = t_gen-stlnr
AND stlkn = t_gen-stlkn
AND stpoz = t_gen-stpoz
AND stlty = 'K'.
IF sy-subrc = 0.
lt_sub_item-upmng = w_upmng.

IF w_subfirt = 'Y'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0191'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29U-UPMNG(02)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=FCUH'.
PERFORM bdc_field USING 'RC29U-EBORT(02)' "安装地点2
lt_sub_item-ebort.
CLEAR w_temp.
w_temp = lt_sub_item-upmng.
PERFORM bdc_field USING 'RC29U-UPMNG(02)' "子项目数量
w_temp.
PERFORM bdc_field USING 'RC29U-UPTXT(02)' "BOM 子项目文本2
lt_sub_item-uptxt.
ENDIF.
IF w_subfirt = 'X'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0191'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29U-UPMNG(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=FCUH'.
PERFORM bdc_field USING 'RC29U-EBORT(01)' "安装地点
lt_sub_item-ebort.
CLEAR w_temp.
w_temp = lt_sub_item-upmng.
PERFORM bdc_field USING 'RC29U-UPMNG(01)' "子项目数量
w_temp.
PERFORM bdc_field USING 'RC29U-UPTXT(01)' "BOM 子项目文本
lt_sub_item-uptxt.
w_subfirt = 'Y'.
ENDIF.
CLEAR lt_sub_item.
ENDIF.
ENDSELECT.
ENDFORM.
*
*----------------------------------------------------------------------*
* Start new screen *
*----------------------------------------------------------------------*
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM. "BDC_DYNPRO

*----------------------------------------------------------------------*
* Insert field *
*----------------------------------------------------------------------*
FORM bdc_field USING fnam fval.
* IF FVAL <> NODATA.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
* ENDIF.
ENDFORM. "BDC_FIELD
*---------------------------------------------------------------------*
* FORM BOM_EXPLOSION *
*---------------------------------------------------------------------*
* BOM EXPLOSION *
*---------------------------------------------------------------------*
FORM bom_explosion.
CALL FUNCTION 'CS_BOM_EXPLOSION'
EXPORTING
capid = 'PP01'
datuv = sy-datum
mktls = space
mehrs = ''
mmory = '1'
stpst = '0'
stlan = i_vbap-stlan
mtnrv = i_vbap-matnr
werks = i_vbap-werks
vbeln = i_vbap-vbeln
vbpos = i_vbap-vbpos
TABLES
stbd = t_doc
stbe = t_equi
stbk = t_kla
stbm = t_mat
stbp = t_gen
stbt = t_tpl
EXCEPTIONS
alt_not_found = 1
missing_authorization = 3
no_bom_found = 4
no_plant_data = 5
no_suitable_bom_found = 6
object_not_found = 7.

IF t_gen[] IS INITIAL.
MESSAGE e368(00) WITH 'BOM展开时出错!'.
STOP.
ENDIF.
ENDFORM. "BOM_EXPLOSION


生产订单关连的表.

发表人:chateasy | 发表时间: 2008年七月01日, 11:45

TABLES: MARD. "物料的仓储位置数据.
TABLES: MARC. "物料的工厂数据.
TABLES: AFPO. "订单项.
TABLES: AFKO. "订单表头数据 PP 订单.
TABLES: RESB. "预定/相关需求 为生产订单 所预留的物料、数量、地点、等

TABLES: AUFK,."订单主数据

* marc-LGPRO 生产仓储地点
* AFPO-PWERK 订单的计划工厂
* AFPO-DWERK 工厂
* AFPO-PLNUM 计划订单号
*AFKO-STLTY BOM 类别
*AFKO-STLNR 物料单
*AFKO-STLST BOM 状态
*AFKO-SDATV 开始生效日期
*AFKO-STLAL 可选的BOM
*AFKO-STLAN BOM用途
*AFKO-AUFLD BOM展开/工艺路线转换的日期


配置人事事件类型时,报"仅当更新0302=‘x’时,才允许更新0000=‘x’"错误

发表人:chateasy | 发表时间: 2008年六月18日, 21:53

在配置人事事件类型时,对于000信息类型和0302信息类型出现以下提示: 仅当更新0302=x’时,才允许更新0000=x
解决办法:

tc-sm30, t77s0是Table

t77s0
ADMIN EVSUP,你试着把这个开关关了.

ADMIN EVSUP的解释.

Semantic abbreviation EVSUP enables you to determine whether infotype
0302 'Additional Actions' is used. You can enter the following values:

o ' ': Infotype 0302 'Additional Actions' is deactivated (standard
setting).

o '1': Infotype 0302 'Additional Actions' is activated.


SAP修改消息内容和报错内型

发表人:chateasy | 发表时间: 2008年六月13日, 17:39

版本号 应用区域 消息号 消息文本

BOM 29 82 计量单位 & 不支持十进制小数


流程文件,你往往美丽而虚假

发表人:chateasy | 发表时间: 2008年六月11日, 20:55

到一些企业去,企业管理部门的经理会把他们的一厚本流程文件拿出来,请我以及其他的AMT咨询顾问看看,请我们提些意见。

每当这种场合,我都会表达:不仅要看流程文件,最好能去流程的现场、看真实的流程。

为什么呢?流程文件里至少缺失三个东西:

一、一步步流程在真实流转时,往往有出错、失误、返工,但这些在流程文件里往往不会描述,流程图里也往往不画出来。比如:给同事打电话的时候打错、发文件的时候发错、把表单中的数据填错,不胜枚举。

二、一步步流程在真实流转时,往往有反复、兜圈子、多次往复。比如,找领导签字找了3趟;录入一个数据做了4次才成功;研发的预算方案在研发部和财务部之间多次往复了5次修订调整才搞定通过。而这些在流程文件中往往一笔带过,流程图里也是画一个兜圈子的反向箭头了事,通过看流程图其实你并不能知道实际现场到底兜了几次圈子。

三、一步步流程在真实流传时,一些往往不增值的活动或者说可疑活动,比如,“检查/等待/传递/存贮”,在流程文件中往往没有被完全描述出来。比如,如果有一个表单是一式四联单,那么实际就发生了四个传递,这四个传递是否都有价值呢?就很值得去跟踪分析,但在流程图的描述里往往这个表单只出现一次而不是四次。再比如,一位下属做了一件事情以后,他不是直接流转给下一个工序,因为他要先给他的经理报告一下,让他的领导知道,领导知情、授权同意以后,这个事情才可以流转到下一道工序。但在流程图里,这个报告也即经理的“check 检查”,有时候也是被忽略不画的。

而我们要说的是,我们要去梳理和优化流程,不就是要去优化这些三类(出错、反复、可疑)活动吗?我们总抱怨流程冗长低效,其实流程的时间不就是耗费在这三类出错、反复、可疑活动上吗?

从这些意义上说,流程文件美化了真实的流程,掩盖了真实流程中的三类活动。

因此,如果对着流程文件去优化流程,那么你的对象就是虚假、不实事求是的。

从这个意义上,我们曾经发文说,做管理优化的人,我们提倡要多做“黑手党”和“狗仔队”。即:不能总在办公室对着电脑中的制度文件做研究,那样的纸上谈兵往往导致缘木求鱼,业务部门抱怨这些内部优化人员解决不了实际问题也就可以理解了。

那么,为什么流程文件会有一定程度甚至相当程度的美丽而虚假呢?

原因也可以理解:这些文件写了是为了放在档案室整整齐齐好看用的、是一个目前还实际做不到的规范但可以用来要求员工的、是写给领导和上级检查机关看的、是写给ISO等认证机构看以得到认证证书用的。

ANYWAY,如果你的目的是优化流程、真正要去解决问题,那么,现有的流程文件顶多是帮助你了解企业现状的一种信息来源,而不是全部的信息来源,而且,对这种信息来源,要保持100%的怀疑心理。


信息类型的改变对最0003中PDC重计算.

发表人:chateasy | 发表时间: 2008年五月12日, 23:32

有下面三中情况

空 关于PDC返计核算的信息类别是无关的
R 在PDC 时间评估中返计核算变更触发器
T 根据T588F,PDC 回溯核算是与字段相关的

T 根据T588F,PDC 回溯核算是与字段相关的,这种情况是指信息类型的特定字段更改了,才会影响到PDC重计算时间.

这个配置在.V_T588G

. Personnel Administration Customize Procedures Infotypes Set Up Infotypes

. Personnel Administration Customize Procedures Infotypes Define Fields Relevant for Retroactive Accounting


earliest recalculation date(最早重算时间)

发表人:chateasy | 发表时间: 2008年五月12日, 23:16

. For individual employees:(PU03)

Using the Personal earliest recalculation date field in the Payroll Status infotype (0003)

. For multiple employees:

You define the date in Customizing. For more information, see the Implementation Guide for Personnel Time Management and choose:

Time Evaluation General Settings Set Modifier for Earliest Recalculation Date

Time Evaluation General Settings Set Earliest Recalculation Date for Pair Formation/Time Evaluation


获取人员考勤评估结果的FUNCTION

发表人:chateasy | 发表时间: 2008年五月12日, 22:55

FUNCTION zhrrfc004_lx.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" VALUE(S_BEGDA) LIKE SY-DATUM DEFAULT SY-DATUM
*" VALUE(S_ENDDA) LIKE SY-DATUM DEFAULT SY-DATUM
*" VALUE(S_SPRSL) LIKE SY-LANGU DEFAULT SY-LANGU
*" VALUE(S_PERNR) LIKE PERNR-PERNR
*" EXPORTING
*" VALUE(RETURN_A) TYPE CHAR200
*" VALUE(E_BEGDA) LIKE SY-DATUM
*" VALUE(E_ENDDA) LIKE SY-DATUM
*" VALUE(E_SPRSL) LIKE SY-LANGU
*" TABLES
*" ITABA STRUCTURE ZHRS003
*"----------------------------------------------------------------------
* INCLUDE rpc2b200.
* DATA: time_results TYPE STANDARD TABLE OF ptm_time_results.
* DATA: time_results_wa LIKE LINE OF time_results.

DATA: BEGIN OF itab_pernr OCCURS 0,
pernr LIKE pa0003-pernr,
END OF itab_pernr.
DATA: BEGIN OF itab_t555f OCCURS 0,
errty LIKE t555f-errty,
error LIKE t555f-error,
etext LIKE t555f-etext,
END OF itab_t555f.

DATA: BEGIN OF fehler_uebergabe OCCURS 10.
INCLUDE STRUCTURE pc2b8.
DATA: END OF fehler_uebergabe.

data flach_fausg like table of t555f with header line.

e_begda = s_begda.
e_endda = s_endda.
e_sprsl = s_sprsl.

CALL FUNCTION 'BKK_GET_MONTH_LASTDAY'
EXPORTING
i_date = s_endda
IMPORTING
e_date = s_endda.

*取工资发放期间(主要是根据时间范围获取所在的年月)
SELECT * INTO CORRESPONDING FIELDS OF TABLE error_periods
FROM t549q WHERE
permo = '01'
AND
begda GE s_begda
AND endda LE s_endda
.


IF s_pernr IS INITIAL .

SELECT DISTINCT pa0003~pernr
INTO CORRESPONDING FIELDS OF TABLE itab_pernr
FROM pa0003
WHERE pa0003~mandt EQ sy-mandt.
ELSE.
APPEND s_pernr TO itab_pernr.
ENDIF.

rp-init-buffer.
rp-def-time-period.
* 获取错误的长文本
select * from t555f
into corresponding fields of table flach_fausg
where mobde = 1
and sprsl = sy-langu.
* and errty = fehler-errty
* and error = fehler-error.
*

FREE itaba.
LOOP AT itab_pernr.

PERFORM fehlertabelle_bauen TABLES fehler_uebergabe
error_periods
* using '00902075'.
USING itab_pernr-pernr.
*
fehler[] = fehler_uebergabe[].

* APPEND LINES OF fehler TO itaba.
LOOP AT fehler.
itaba-pernr = itab_pernr .
itaba-ldate = fehler-ldate.
itaba-ltime = fehler-ltime.
itaba-errty = fehler-errty.
itaba-error = fehler-error.
read table flach_fausg with key errty = itaba-errty error = itaba-error BINARY SEARCH.

itaba-etext = flach_fausg-etext.
itaba-aedtm = fehler-aedtm.
itaba-uname = fehler-uname.
APPEND ITABA TO ITABA.

ENDLOOP.

ENDLOOP.
ENDFUNCTION.
*&---------------------------------------------------------------------*
*& Form fehlertabelle_bauen
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->HAJW_FEHLER text
* -->ERROR_PERIODS text
* -->PERSON text
*----------------------------------------------------------------------*
FORM fehlertabelle_bauen
TABLES hajw_fehler STRUCTURE pc2b8
error_periods STRUCTURE ep_str
USING person TYPE p_pernr.


DATA: BEGIN OF a_error_periods OCCURS 0,
srtfd LIKE pcl2-srtfd,
END OF a_error_periods.
DATA: BEGIN OF b_error_periods OCCURS 0,
relid LIKE pcl2-relid,
srtfd LIKE pcl2-srtfd,
srtf2 LIKE pcl2-srtf2,
END OF b_error_periods.

CLEAR a_error_periods[].
LOOP AT error_periods.
CONCATENATE person
error_periods-pabrj
error_periods-pabrp
'1'
INTO a_error_periods-srtfd.
APPEND a_error_periods.
ENDLOOP.

SELECT * INTO CORRESPONDING FIELDS OF TABLE b_error_periods
FROM pcl2 FOR ALL ENTRIES IN a_error_periods
WHERE srtfd = a_error_periods-srtfd
AND relid = 'B2'
AND srtf2 = 0.

CLEAR hajw_fehler[].
LOOP AT b_error_periods.
b2-key = b_error_periods-srtfd.
rp-imp-c2-b2.
APPEND LINES OF fehler TO hajw_fehler.
ENDLOOP.

fehler[] = hajw_fehler[].

ENDFORM. "fehlertabelle_bauen


时间评估结果存储

发表人:chateasy | 发表时间: 2008年五月12日, 22:34

The results are stored in file PCL2 in Cluster B2 according to the day .

PCL2表中的数据是按每个人的某一个月时间评估结果作为一条记录存储的,所以读取需要特别处理.


物料长文本的写入

发表人:chateasy | 发表时间: 2008年四月21日, 11:22

*&---------------------------------------------------------------------*
*& Report ZRMMDA001 *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*

REPORT zrmmda001 MESSAGE-ID zc."NO STANDARD PAGE HEADING
"LINE-SIZE 80 LINE-COUNT 65

DATA BEGIN OF w_rawdata.
INCLUDE STRUCTURE soli.
DATA END OF w_rawdata.

DATA t_rawdata LIKE w_rawdata OCCURS 0.

DATA t_header LIKE thead OCCURS 0 WITH HEADER LINE.
DATA t_lines LIKE tline OCCURS 0 WITH HEADER LINE.

DATA BEGIN OF t_fields1 occurs 0.
DATA lines(10000).
DATA END OF t_fields1.

DATA BEGIN OF w_fields.
DATA matnr(18).
DATA td(2).
DATA lines(10000).
DATA END OF w_fields.

DATA BEGIN OF w_raw_fields.
DATA matnr(18).
DATA td(2).
DATA lines(10000).
DATA END OF w_raw_fields.

data: w_matnr(70) type c.
data:l type i.
data:l1 type i.
DATA t_fields LIKE w_fields OCCURS 0 WITH HEADER LINE.
FIELD-SYMBOLS <fs_field>.
CONSTANTS c_delimiter TYPE x VALUE '09'.
CONSTANTS c_mask(2) TYPE c VALUE ',.'.
CONSTANTS c_field_amount TYPE i VALUE 3.
*****************************************************************
SELECTION-SCREEN BEGIN OF BLOCK b01 WITH FRAME TITLE text-b01.
PARAMETERS p_file LIKE rlgrap-filename OBLIGATORY.
PARAMETERS p_errlog LIKE rlgrap-filename.
SELECTION-SCREEN END OF BLOCK b01.
*****************************************************************
START-OF-SELECTION.

*AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
** call file selector to get a file name for read-only.
* PERFORM call_file_selector USING c_mask
* 'O'
* 'Open File'(001)
* p_file.
*
*AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_errlog.
** call file selector to get a file name for over-write.
* PERFORM call_file_selector USING c_mask
* 'S'
* 'New File'(002)
* p_errlog.

PERFORM upload_file TABLES t_fields
USING p_file
'DAT'.

IF sy-subrc <> 0.
MESSAGE s001 WITH p_file.
LEAVE.
ENDIF.

* PERFORM upload_data.

PERFORM insert_data.
*&---------------------------------------------------------------------*
*& Form UPLOAD_FILE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_T_RAWDATA text
* -->P_P_FILE text
* -->P_0093 text
*----------------------------------------------------------------------*
FORM upload_file TABLES t_fields
USING p_file
'DAT'.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
* CODEPAGE = ' '
filename = 'C:Documents and Settings902450桌面123.txt'
filetype = 'DAT'
* HEADLEN = ' '
* LINE_EXIT = ' '
* TRUNCLEN = ' '
* USER_FORM = ' '
* USER_PROG = ' '
* DAT_D_FORMAT = ' '
* IMPORTING
* FILELENGTH =
TABLES
data_tab = t_fields
EXCEPTIONS
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
no_authority = 10
OTHERS = 11
.
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. " UPLOAD_FILE
*&---------------------------------------------------------------------*
*& Form UPLOAD_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM upload_data .
CLEAR sy-tabix.
LOOP AT t_rawdata INTO w_rawdata.
CLEAR w_fields.
CLEAR w_raw_fields.
DO.
ASSIGN COMPONENT sy-index OF STRUCTURE w_raw_fields TO <fs_field>.
IF sy-subrc <> 0.
EXIT.
ENDIF.
SPLIT w_rawdata AT c_delimiter INTO <fs_field> w_rawdata.
ENDDO.
* APPEND W_RAW_FIELDS TO T_RAW_FIELDS.
MOVE-CORRESPONDING w_raw_fields TO w_fields.
APPEND w_fields TO t_fields.
ENDLOOP.

ENDFORM. " UPLOAD_DATA
*&---------------------------------------------------------------------*
*& Form CALL_FILE_SELECTOR
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_C_MASK text
* -->P_0157 text
* -->P_0158 text
* -->P_P_ERRLOG text
*----------------------------------------------------------------------*
FORM call_file_selector USING p_c_mask TYPE c
value(p_mode)
value(p_title)
p_file.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
* DEF_FILENAME = ' '
* DEF_PATH = ' '
mask = p_c_mask
mode = p_mode
title = p_title
IMPORTING
filename = p_file
* RC =
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 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.

ENDFORM. " CALL_FILE_SELECTOR
*&---------------------------------------------------------------------*
*& Form insert_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM insert_data .
LOOP AT t_fields.
* at new matnr.
t_header-tdname = t_fields-matnr.
t_header-tdobject = 'MATERIAL'.
t_header-tdid = 'GRUN'.
t_header-tdspras = 1.
APPEND t_header.
* endat.
*

t_fields1-lines = t_fields-lines.
* t_lines-TDFORMAT = t_fields-td.
APPEND t_fields1.
write : t_fields-lines.
l = strlen( t_fields-lines ).
write : l.
CALL FUNCTION 'CONVERT_STREAM_TO_ITF_TEXT'
EXPORTING
LANGUAGE = SY-LANGU
TABLES
text_stream = t_fields1
itf_text = t_lines
.


ENDLOOP.

CALL FUNCTION 'SAVE_TEXT'
EXPORTING
client = sy-mandt
header = t_header
* INSERT = ' '
savemode_direct = 'X'
* OWNER_SPECIFIED = ' '
* LOCAL_CAT = ' '
* IMPORTING
* FUNCTION =
* NEWHEADER =
TABLES
lines = t_lines
EXCEPTIONS
id = 1
language = 2
name = 3
object = 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.

ENDFORM. " insert_DATA


HR中删除员工(及批量删除员工)

发表人:chateasy | 发表时间: 2008年三月31日, 11:59

1、删除一个人PU00。

2、批量删除。RPUREOPN程序。


定义缺勤类型(V_T554S)

发表人:chateasy | 发表时间: 2008年三月31日, 10:22

SPRO-------->时间管理-------->时间数据记录和管理------------>缺席---------->缺勤目录--------->定义缺勤类型(V_T554S)

配置中注意:1.最大最小天数;

2、单位:按“日历天数”还是“出勤/缺勤天数”或"工资发放天数"

3、对是节假日或公休日时,是报警/信息/错误信息。


PA Personnel Administration Tables

发表人:chateasy | 发表时间: 2008年二月04日, 16:59

TABLE DESCRIPTION
PA0000HR Master Record: Infotype 0000 (Actions)
PA0001 HR Master Record: Infotype 0001 (Org. Assignment)
PA0002 HR Master Record: Infotype 0002 (Personal Data)
PA0003 HR Master Record: Infotype 0003 (Payroll Status)
PA0004 HR Master Record: Infotype 0004 (Challenge)
PA0005 HR Master Record: Infotype 0005 (Leave Entitlement)
PA0006 HR Master Record: Infotype 0006 (Addresses)
PA0007 HR Master Record: Infotype 0007 (Planned Working Time)
PA0008 HR Master Record: Infotype 0008 (Basic Pay)
PA0009 HR Master Record: Infotype 0009 (Bank Details)
PA0010 HR Master Record: Infotype 0010 (Capital Formation)
PA0011 HR Master Record: Infotype 0011 (Ext.Bank Transfers)
PA0012 HR Master Record: Infotype 0012 (Fiscal Data - Germany)
PA0013 Infotype Social Insurance - Germany
PA0014 HR Master Record: Infotype 0014 (Recurr. Bens/Deducs)
PA0015 HR Master Record: Infotype 0015 (Additional Payments)
PA0016 HR Master Record: Infotype 0016 (Contract Elements)
PA0017 HR master record: Infotype 0017 (Travel Privileges)
PA0019 HR Master Record: Infotype 0019 (Monitoring of Dates)
PA0020 HR Master Record: Infotype 0020 (DUEVO)
PA0021 HR Master Record: Infotype 0021 (Family)
PA0022 HR Master Record: Infotype 0022 (Education)
PA0023 HR Master Record: Infotype 0023 (Previous Employment)
PA0024 HR Master Record: Infotype 0024 (Qualifications)
PA0025 HR Master Record: Infotype 0025 (Personal Appraisals)
PA0026 HR Master Record: Infotype 0026 (Company Pension Plan)
PA0027 HR Master Record: Infotype 0027 (Cost Distribution)
PA0028 HR Master Record: Infotype 0028 (Int. Medical Service)
PA0029 HR Master Record: Infotype 0029 (Workers' Compensation)
PA0030 HR Master Record: Infotype 0030 (Powers of Attorney)
PA0031 HR Master Record: Infotype 0031 (Reference Pers.Nos.)
PA0032 HR Master Record: Infotype 0032 (Internal Control)
PA0033 International Infotype 0033: Statistics Exceptions
PA0034 HR Master Record: Infotype 0034 (Corporate Functions)
PA0035 HR Master Record: Infotype 0035 (Comp.Instr.)
PA0036 HR Master Record: Infotype 0036 (Social Insurance CH)
PA0037 HR Master Record: Infotype 0037 (Insurance)
PA0038 HR Master Record: Infotype 0038 (Tax - CH)
PA0039 HR Master Record: Infotype 0039 (Add. Org. Assign. CH)
PA0040 HR Master Record: Infotype 0040 (Objects on Loan)
PA0041 HR Master Record: Infotype 0041 (Date Specifications)
PA0042 HR Master Record: Infotype 0042 (Tax - Austria)
PA0043 HR Master Record: Infotype 0043 (Family Allowance - A)
PA0044 HR Master Record: Infotype 0044 (Social Insurance - A)
PA0045 HR Master Record: Infotype 0045 (Company Loans)
PA0046 HR Master Record: Infotype 0046 (Pension Fund - CH)
PA0048 HR Master Record: Infotype 0048 (Residence Status - CH)
PA0049 HR Master Record: Infotype 0049 (Red.Hrs./Bad Weather)
PA0050 HR Master Record: Infotype 0050 (Time Recording)
PA0051HR Master Record: Infotype 0051 (ASB/SPI Data)
PA0052 HR Master Record: Infotype 0052 (Wage Maintenance)
PA0053 HR Master Record: Infotype 0053 (Pension Reserves)
PA0054 HR Master Record: Infotype 0054 (Works Council Pay)
PA0055 HR Master Record: Infotype 0055 (Previous Employer - A)
PA0056 HR Master Record: Infotype 0056 (Sick Certificates-A)
PA0057 HR Master Record: Infotype 0057 (Membership Fees)
PA0058 HR Master Record: Infotype 0058 (Commuter Lump Sum A)
PA0059 HR Master Record: Infotype 0059 (Social Insurance - NL)
PA0060 HR Master Record: Infotype 0060 (Fiscal Data - Netherlands)
PA0061 HR Master Record: Infotype 0061 (Social Insurance - E)
PA0062 HR Master Record: Infotype 0062 (Tax - E)
PA0063 HR Master Record: Infotype 0063 (Social Ins. Funds NL)
PA0064 HR Master Record: Infotype 0064 (Social Insurance - F)
PA0065 HR Master Record: Infotype 0065 (Tax - GB)
PA0066 HR Master data infotype 0066 - Canadian garnishment: order
PA0067 HR master data infotype 0067 - Canadian garnishment: debt
PA0068 HR master data infotype 0068 - Canadian garnishment: adjust
PA0069 HR Master Record: Infotype 0069 (Nat. Insurance - GB)
PA0070 HR Master Record: Infotype 0070 (Court Orders - GB)
PA0071 HR Master Record: Infotype 0071 (Pension Funds - GB)
PA0072 HR Master Record: Infotype 0072 (Tax - DK)
PA0073 HR Master Record: Infotype 0073 (Private Pensions - DK)
PA0074 HR Master Record: Infotype 0074 (Vacation/SH DK)
PA0075 HR Master Record: Infotype 0075 (ATP Pension - DK)
PA0076 HR Master Record: Infotype 0076 (Workers Compensation NA)
PA0077 HR Master Record: Infotype 0077 (Additional Personal Data)
PA0078 HR Master Record: Infotype 0078 (Loan Payments)
PA0079 Infotype SI Additional Insurance - D
PA0080 HR Master Record: Infotype 0080 (Maternity Protection)
PA0081 HR Master Record: Infotype 0081 (Military Service)
PA0082 HR Master Record: Infotype 0082 (Additional Absence Data)
PA0083 HR Master Record: Infotype 0083 (Leave Compensation)
PA0084 HR Master Record: Infotype 0084 (Sickness Pay Control - GB)
PA0085 HR Master Record: Infotpye 0085 (Work Incapacity Periods GB)
PA0086 HR Master Record: Infotype 0086 (SSP/SMP Exclusions GB)
PA0088 HR Master Record: Infotype 0088 (SMP Record - GB)
PA0090 HR Master Record: Infotype 0090 (Various Payee Keys)
PA0092 HR Master Record: Infotype 0092 (Seniority - E)
PA0093 HR Master Record: Infotype 0093 (Previous Employer - D)
PA0094 HR Master Record: Infotype 0094 (Residence Status - NA)
PA0095 HR Master Record: Infotype 0095 (Tax Canada)
PA0096 HR Master Record: Infotype 0096 (Tax - USA)
PA0097 No longer used - will be deleted
PA0098 HR Master Record: Infotype 0098 (Profit Sharing - F)
PA0099 No longer used - will be deleted
PA0100 HR Master Record: Infotype 0100 (SI B)
PA0101 HR Master Record: Infotype 0101 (Tax B)
PA0102 HR Master Record: Infotype 0102 (Grievances NA)
PA0103 HR Master Record: Infotype 0103 (Bond Purchases NA)
PA0104 HR Master Record: Infotype 0104 (Bond Denominations NA)
PA0105 HR Master Record: Infotype 0105 (Communications)
PA0106 HR Master Record: Infotype 0106 (Related Persons NA)
PA0107 HR Master Record: Infotype 0107 (Work Schedule B)
PA0108 HR Master Record: Infotype 0108 (Personal Data B)
PA0109 HR Master Record: Infotype 0109 (Contract Elements B)
PA0110 HR Master Record: Infotype 0110 (Pensions NL)
PA0111 HR Master Record: Infotype 0111 (Garnishment Admin. D)
PA0112 HR Master Record: Infotype 0112 (Garn.Repaym. D)
PA0113 HR Master Record: Infotype 0113 (Garnishment Int. D)
PA0114 HR Master Record: Infotype 0114 (Garnishable Amount D)
PA0115 HR Master Record: Infotpye 0115 (Garnishment Wages D )
PA0116 HR Master Record: Infotpye 0116 (Garn.Transfer D)
PA0117 HR Master Record: Infotype 0117 (Garnishment Comp.)
PA0118 HR Master Record: Infotype 0118 (Child Allowance D)
PA0119 HR Master Record: Infotype 0119 (Annual Income CA D)
PA0120 HR Master Record: Infotype 0120 (Pension Fund Trans. CH)
PA0121 HR Master Record: Infotype 0121 (RefPerNo Priority)
PA0122 HR Master Record: Infotype 0122 (Child Allowance Bonus D)
PA0123 No longer used - will be deleted
PA0124 No longer used - will be deleted
PA0125 HR Master Record: Infotype 0125 (Garnishment B)
PA0126 Infotype: Supplementary Pension Germany
PA0127 HR Master Record: Infotype 0127 (Commuting NL)
PA0128 HR Master Record: Infotype 0128 (Notifications)
PA0129 HR Master Record: Infotype 0129 (Text Number Assign.)
PA0130 HR Master Record: Infotpye 0130 (Checking Procedures)
PA0131 HR Master Record: Infotype 0131 (Garn.Mgmt.Data A)
PA0132 HR Master Record: Infotpye 0132 (Garnishment A)
PA0133 HR Master Record: Infotype 0133 (Garnsh.Interest A)
PA0134 HR Master Record: Infotype 0134 (Garnishable Amount A)
PA0135 HR Master Record: Infotpye 0135 (Garn.Spec.Cond. A)
PA0136 HR Master Record: Infotype 0136 (Garnish.Trans A)
PA0137 HR Master Record: Infotype 0137 (Garnish.Comp. A)
PA0138 HR Master Record: Infotype 0138 (Family/Ref.Pers B)
PA0139 HR Master Record: Infotype 0139 (Employees Appl.No)
PA0140 HR Master Record: Infotype 0140 (SI Basic Data JP)
PA0141 HR Master Record: Infotype 0141 (SI Premium Data JP)
PA0142 HR Master Record: Infotype 0142 (Residence Tax JP)
PA0143 HR Master Record: Infotype 0143 (Life Insurance JP)
PA0144 HR Master Record: Infotype 0144 (Property Accum. JP)
PA0145 HR Master Record: Infotype 0145 (Personnel Tax Status JP)
PA0146 HR Master Record: Infotype 0146 (Y.E.A. Data JP)
PA0147 HR Master Record: Infotype 0147
PA0148 HR Master Record: Infotype 0148 (Family JP)
PA0149 HR Master Record Infotype 0149 (Tax Data South Africa)
PA0150 HR Master Record Infotype 0150 (Social Insurance SA)
PA0151 HR Master Record Infotype 0151 (Ext.Insurance South Africa)
PA0161 HR Master Record: Infotype 0161 (Limits IRS)
PA0162 HR Master Record: Infotype 0162 (Ins. Y.E.T.A Data JP)
PA0165 HR Master Record: Infotype 0165 (Limits Deductions)
PA0167 HR Master Record: Infotype 0167 (Health Care Plans)
PA0168 HR Master Record: Infotype 0168 (Insurance Plans)
PA0169 HR Master Record: Infotype 0169 (Savings Plans)
PA0170 HR Master Record: Infotype 0170 (Spending Accounts)
PA0171 HR Master Record: Infotype 0171 (General Benefits Data)
PA0172 HR Master Record: Infotype 0172 (Pension Insurance)
PA0177 HR Master Record: Infotype 0177 [Wet Allochtonenreg.] (NL)
PA0179 HR Master Record: Infotype 0179 (Tax SG)
PA0181 HR Master Record: Infotype 0181 [Add. Funds] (SG)
PA0182 HR Master Record: Infotype 0182 [Alternative Names] (SG)
PA0183 HR Master Record: Infotype 0183 [Awards] (SG)
PA0184 HR Master Record: Infotype 0184 [Resume text] (SG)
PA0185 HR Master Record: Infotype 0185 [Identification] (SG)
PA0186 HR Master Record: Infotype 0186 [Social Insurance] (SG)
PA0188 Tax (Australia)
PA0189 HR Master Record Infotype 0189 (Construction Industry Wages)
PA0190 HR Master Data Record Infotype 0190 (BuildingTradePrevERDat)
PA0191 HR Master Record Infotype 0191 (BuildingTradeReimbursExpens)
PA0192 Personnel Master Record Infotype 0192 (BuildingTrade Attrib)
PA0194 HR Master Record Infotype 0194 (Garnishment Document)
PA0195 HR Master Record Infotype 0195 (Garnishment Order)
PA0196 HR Master Record:Infotype 0196 (Employee Provident Fund MY)
PA0197 HR Master Record:Infotype 0197 (SOCSO Contributions MY)
PA0198 Sheduled Tax Deductuion Malaysia
PA0199 Tax deduction CP38 / Additional amt / Bonus - Malaysia
PA0200 HR Master Record, Infotype 0200 (Garnishments DK)
PA0201 Personnel master record infotype 0201 (basic pension amnts)
PA0204 HR Master Record, Infotype 0204 (DA/DS Statistics DK)
PA0207 HR Master Record: Infotype 0207 (Residence Tax Area)
PA0208 HR Master Record: Infotype 0208 (Work Tax Area - USA)
PA0209 HR Master Record: Infotype 0209 (Unemployment Insurance USA)
PA0210 HR Master Record: Infotype 0210 (W4 USA)
PA0211 HR Master Record: Infotype 0211 (COBRA Qual. Beneficiaries)
PA0212 HR Master Record: Infotpye 0212 (COBRA Health Plans)
PA0213 Additional family information - Malaysia
PA0215 Building Trade Transaction Data
PA0216 Garnishment Adjustment
PA0217 Infotype 0217 (INSEE code)
PA0218 Infotype 0218 (number of pension fund)
PA0219 HR Master Record: Infotype 0219 (External organisations)
PA0220 Superannuation (Australia)
PA0221 HR Master Record: Infotype 0221 (Manual Checks)
PA0222 HR Master Record for Infotype 0222 (Company Cars GB)
PA0224 Tax information - inf. 0224 - Canada
PA0225 HR Master Record for Infotype 0225 (Company Cars GB 2)
PA0227 Tax file number (Australia)
PA0230 HR Master Record: Infotype 0230 / View 0008 (PSG)
PA0231 HR Master Record: Infotype 0231 / View 0001 (PSG)
PA0232 Personal-master record infotype 0232 (Child Allowance) (D)
PA0233 HR-F master record infotype 0233 ('Bilan Social')
PA0234 HR Master Record Infotype 0234 (Add. Withh. Inform. - USA)
PA0235 HR Master Record: Infotype 0235 (Other Taxes - USA)
PA0236 HR Master Record: Infotype 0236 (Credit Plans)
PA0237 HR Master Record: Infotype 0237 / View for 0052 (PSG)
PA0241 Indonesian Tax Data
PA0242 JAMSOSTEK Details, Indonesia
PA0261 Leave Accrual Australia
PA0264
PA0265 HR Master Record: Infotype 0265 / Special Regulations (PSG)
PA0266HR Master Record: Infotype 0266 / View 0027 (PSG)
PA0267 HR Master Record: Infotype 0267 (One time Payment off-cycle)
PA0268 HR Master Record Infortype view 0045 and 0268 (Loan JPN)
PA0269 HR Master Record: Infotype 0269 (ADP Information USA)
PA0270 HR Master Data Record: Infotype 0270 (COBRA Payments)
PA0272 HR master record - infotype 0272 (Garnishment F)
PA0273 HR Master Record: Infotype 0273 (Tax - SE)
PA0274 HR Master Record: Infotype 0274 (Insurance - SE)
PA0275 HR Master Record: Infotype 0275 (Garnishment - SE)
PA0276 HR Master Record: Infotype 0276 (OPIS - SE)
PA0277 HR Master Record: Infotype 0277 (Exceptions - SE)
PA0278 HR master record infotype 0278 (PF basic data [CH])
PA0279 HR master record infotype 0279 (Indiv.values for PF [CH])
PA0280 HR Master Record Infotype 0280/View for 0016
PA0281 HR Master Record Infotype 0281/View for 0045
PA0283 HR Master Record for Infotype 0283 (Archiving)
PA0288 HR CH: HR Master Record Infotype 0021 (Suppl. Switzerland)
PA0302 HR Master Record: Infotype 0302 (Additional Actions)
PA0303
PA0304 Basic pay - additional information
PA0309 IRD Number Infotype NZ
PA0310 Superannuation NZ
PA0311 Leave Adjustments - NZ
PA0312 Leave History Adjustments NZ
PA0313 Employee Taxation Detail Infotype NZ
PA0314I0314: Days for Vacation Allow. and Sal.Deducs (DK/N)
PA0315 CATS: Sender Information
PA0317
PA0318HR Master Record: Infotype Family data for Indonesia (0318)
PA0319 Indonesia Private Insurances
PA0341 HR - master record infotype 341 (DUEVO start)
PA0352 NHI for Family member (TW)
PA0353Income Tax Taiwan
PA0354Labor Insurance Taiwan
PA0355 National Health Insurance Taiwan
PA0356 Employment Stabilization Fund (TW)
PA0357 Saving Plan (TW)
PA0358 Employee Welfare Fund (TW)
PA0362 HR Master Record: Infotype Membership for Indonesia (0362)
PA0367 HR Master Record: Infotype 0367 (SI-Addit.Notif.Data A)
PA0369
PA0370
PA0371 HR Master Record: Infotype 0371 (Previous Job Tax)
PA0373 HR loan repayment plan JP(P0268)
PA0374 Infortype 0374: General Eligibility
PA0375 HR Master Data Record: Infotype 0375 (Add. Benefits Data)
PA0376 HR Master Data Record: Infotype 0376 (Medical Benefits Data)
PA0377 HR Master Data Record: Infotype 0377 (Misc. Plans)
PA0378 HR Master Data Record: Infotype 0378 (Benefits Events)
PA0380 Compensation History
PA0381 HR Master Record Infotype 0381
PA0382 HR Master Data Record Infotype 0382
PA0388 HR Master Record: Infotype 0388 (Union JP)
PA0395 HR Master Record: Infotype 0395 (External Org.Assignment)
PA0396 HR Master Record: Infotype 0396 (Expatriate Attributes)
PA0402 Accounting infotype
PA0403 HR Master Record for Infotype 0403
PA0404 HR Master Record: Infotype 0404 (Military Service Taiwan)
PA0405 Personnel master record infotype 0405 (absence events)
PA0408
PA0409
PA0467 Personnel master data Infotype 0467 (SI addit.notif. pl.c.A)
PA0900 HR Master Record: Infotype 0900 (Sales Data)
PA0901 HR master record info category 0901 (purch. data)
PA2001 HR Time Record: Infotype 2001 (Absences)
PA2002 HR Time Record: Infotype 2002 (Attendances)
PA2003 HR Time Record: Infotype 2003 (Substitutions)
PA2004 HR Time Record: Infotype 2004 (Availability)
PA2005 HR Time Record: Infotype 2005 (Overtime)
PA2006 HR Time Record: Infotype 2006 (Absence Quotas)
PA2007 HR Time Record: Infotype 2007 (Attendance Quotas)
PA2010 HR Time Record: Infotype 2010 (Employee Remuneration Info.)
PA2012 HR Time Record: Infotype 2012 (Time Transfer Specifications)
PA2013 HR Time Record: Infotype 2013 (Quota Corrections)
PAHI History of system, DB and SAP parameter
PANNNN HR Master Record: Infotype NNNN
PAPL Applicant master data
PARAMVALUE Run-time variables for platform-independent file names
PARCT Receipt log table (Japan)
PAT00 Patch steps
PAT01 Patch status
PAT03 Patch directory
PAT04 Patch add-on ID (PAOID)
PAT05 SAP Patch Manager settings
PAT06 Component-specific patches
PATH Definition of physical file paths for each syntax
PATHTEXT Logical file path names
PATN Partner number/organizational unit
PAYR Payment transfer medium file
PAYRQ Payment Requests
PA_SSTRCV1 Generated table for view PA_SSTRCV1
PA_SSTRCV2 Generated table for view PA_SSTRCV2
PA_SSTRCV3 Generated table for view PA_SSTRCV3
PA_SSTRCV4 Generated table for view PA_SSTRCV4

IDEAS系统起不动,SYSLOG报以下错误(Operating system call getservbyname failed )

发表人:chateasy | 发表时间: 2007年十一月02日, 17:44

1、 系统起不动,SYSLOG报以下错误。

R/3 Basis System: Operating system call getservbyname failed (error no. 0 )

R/3 Basis System: Failed to send a request to the message server

按条件“Operating system call getservbyname failed 查到NOTES896973

问题可能是安装生产机的客户端,导致C:WINDOWSsystem32driversetc下的文件services中的MSGSERVER配置sapmsC11 3600/tcp改成了sapmsPRD 3600/tcp,导致消息服务启动不了。

Summary

Symptom

A service name is unknown, in this example sapmsOSS. The trace file contains the following entry:

***LOG Q0I=> NiPGetServByName: service 'sapmsOSS' not found: getservbyname [niuxi.c 1669]


or

***LOG Q0I=> NiPGetServByName: 'sapmsOSS' not found: getaddrinfo [niuxi.c 1617]

*** ERROR => GwIAsyncConn: GwBufConnect to oss001 / sapmsOSS failed (rc=NIESERV_UNKNOWN) [gwxx.c 1113]


or

****************************************************************

*

* LOCATION SAP-Gateway on host ld0168 / sapgw53

* ERROR service 'sapmsOSS' unknown

*

* TIME Wed Jan 11 13:22:35 2006

* RELEASE 710

* COMPONENT NI (network interface)

* VERSION 39

* RC -3

* MODULE nixxhsl.cpp

* LINE 643

* DETAIL NiHsLGetServNo: service name cached as unknown

* COUNTER 293

*

****************************************************************


Or the following SAP GUI error message occurs:

service 'sapmsOSS' unknown

Other terms

service unknown, sapms, sapgw, sapdp, getservbyname, getservbyname_r, getservbyport, getservbyport_r, getaddrinfo, getnameinfo, NiPServToNo, NiPNoToServ, NiPGetServByName, NiPGetServByName2, NiPGetServByPort, NiPGetServByPort2, NIESERV_UNKNOWN

Reason and Prerequisites

A lookup for the specified service name is not possible for the corresponding port number. In most cases the error occurs during the connection to a server (for example, message server, dispatcher, gateway, SAProuter , and so on) in which a service name is specified instead of a port number. Since the service name is unknown, the connection cannot be established.

You can use the 'niping' program to reproduce the error. Call the program as follows:

niping -v -S


For sapmsOSS, the program displays the following:

:/> niping -v -S sapmsOSS

...

Servicename/Serviceport verification:

=======================================

Lookup of service: sapmsOSS (NiServToNo)

Wed Jan 11 13:44:35 2006

***LOG Q0I=> NiPGetServByName: service 'sapmsOS2' not found: getservbyname [niuxi.c 1669]

--> **** FAILED ****

...


In case of a successful lookup (in this example, port number 3616 is assigned to the sapmsOSS service name), the program displays the following:

:/> niping -v -S sapmsOSS

...

Servicename/Serviceport verification:

=======================================

Lookup of service: sapmsOSS (NiServToNo)

--> Number: 3616

...


You can choose any assignment of a service name to a port number. The default values for the SAP service names are usually within the following port number ranges:

Dispatcher:

sapdp range from 3200 to 3298

Gateway: