初步对BAPI_PO_CREATE1有了一点了解,下面对这个bapi做一些我的体会讲解:
下面先将程式上传, 在程式中我只简单的对poheader和poitem做了一些输入,产生了一张po,并且po中只可以有一个项被采购,其实其中还有其他可以加入,例如: schedule,account,一起其他一些东西,,在这个程式中我就不在做介绍了,我将在后续的文章中说出我对这个bapi的其他体会,希望大家关注我的博克,谢!
REPORT ZCREATPOBAPI .
TABLES BAPIMEPOHEADER.
CONSTANTS : C_X VALUE 'X'.
DATA WA_POHEADER TYPE BAPIMEPOHEADER. "所要增加的内容
DATA WA_POHEADERX TYPE BAPIMEPOHEADERX. "针对要增加的内容做一个标记,其实标记过了才可以被修改的
DATA WA_POITEM TYPE BAPIMEPOITEM. "po中item的内容,工作区
DATA ITAB_POITEM LIKE TABLE OF WA_POITEM. po中item的内容,内表
DATA WA_POITEMX TYPE BAPIMEPOITEMX. "po中item增加内容的标记 工作区
DATA ITAB_POITEMX LIKE TABLE OF WA_POITEMX."po中item增加内容的标记 内表
DATA WA_RETURN TYPE BAPIRET2. "消息 返回 ,工作区
DATA ITAB_RETURN LIKE TABLE OF WA_RETURN. "消息返回, 内表
*HEADER.
PARAMETERS: P_NUMBER LIKE BAPIMEPOHEADER-PO_NUMBER,
P_COCODE LIKE BAPIMEPOHEADER-COMP_CODE DEFAULT 'CN01',
P_DOTYPE LIKE BAPIMEPOHEADER-DOC_TYPE DEFAULT 'ZST3',
P_STATUS LIKE BAPIMEPOHEADER-STATUS DEFAULT 'I',
P_CRDATE LIKE BAPIMEPOHEADER-CREAT_DATE ,
P_CRDABY LIKE BAPIMEPOHEADER-CREATED_BY DEFAULT SY-UNAME,
P_ITEMIN LIKE BAPIMEPOHEADER-ITEM_INTVL DEFAULT '1',
P_VENDOR LIKE BAPIMEPOHEADER-VENDOR DEFAULT 'TWM4',
P_LANGU LIKE BAPIMEPOHEADER-LANGU,
P_PMNTTR LIKE BAPIMEPOHEADER-PMNTTRMS DEFAULT 'COD',
P_PURCH LIKE BAPIMEPOHEADER-PURCH_ORG DEFAULT 'CN01',
P_PURGR LIKE BAPIMEPOHEADER-PUR_GROUP DEFAULT 'KXX',
P_DOCDAT LIKE BAPIMEPOHEADER-DOC_DATE,
P_VATCN LIKE BAPIMEPOHEADER-VAT_CNTRY DEFAULT 'CNY'.
*ITEM
SELECTION-SCREEN SKIP.
PARAMETERS: P_POITEM LIKE BAPIMEPOITEM-PO_ITEM DEFAULT '1',
P_MATNER LIKE BAPIMEPOITEM-MATERIAL,
P_PLANT LIKE BAPIMEPOITEM-PLANT DEFAULT 'CKH1',
P_LOCT LIKE BAPIMEPOITEM-STGE_LOC DEFAULT '0000',
P_QUANTI LIKE BAPIMEPOITEM-QUANTITY ,