标签:
转自 http://blog.csdn.net/zeewjj/article/details/7941530
CALL FUNCTION ‘ME_DIRECT_INPUT_INFORECORD‘
DATA: WA_EINA TYPE EINA,
WA_EINE TYPE EINE,
WA_EINA_NEW TYPE EINA,
WA_EINE_NEW TYPE EINE.
DATA: IT_HEAD TYPE STANDARD TABLE OF MESTXH,
IT_LINE TYPE STANDARD TABLE OF MESTXL.
DATA: IT_EINA TYPE STANDARD TABLE OF EINA WITH HEADER LINE,
IT_EINE TYPE STANDARD TABLE OF EINE.
DATA: RETURN TYPE STANDARD TABLE OF BAPIRETURN WITH HEADER LINE.
DATA: L_NETPR LIKE EKPO-NETPR.
DATA: L_KOMV TYPE KOMV,
L_EKPO TYPE EKPO.
CLEAR :WA_EINA,WA_EINE,WA_EINA_NEW,WA_EINE_NEW,IT_HEAD,IT_LINE,IT_EINA,IT_EINE,RETURN,L_NETPR,L_KOMV,L_EKPO.
WA_EINA-MATNR = GS_PRINFO-MATNR.
WA_EINA-LIFNR = GS_PRINFO-LIFNR.
WA_EINE-EKORG = GS_PRINFO-VKORG.
WA_EINE-WERKS = GS_PRINFO-VKORG.
WA_EINE-NETPR = GS_PRINFO-ABMPR.
*wa_eine-ekgrp = ‘D01‘.
WA_EINE-NORBM = ‘1‘.
WA_EINE-APLFZ = ‘1‘.
WA_EINE-EFFPR = GS_PRINFO-ABMPR.
WA_EINE-MWSKZ = ‘J1‘.
WA_EINE-PEINH = GS_PRINFO-PEINH.
* CONCATENATE ‘ZSDP201创建‘ INTO WA_EINA-IDNLF.
CALL FUNCTION ‘ME_INITIALIZE_INFORECORD‘.
CALL FUNCTION ‘ME_DIRECT_INPUT_INFORECORD‘
EXPORTING
ACTIVITY = ‘V‘"V 修改,H创建
I_EINA = WA_EINA
I_EINE = WA_EINE
I_NO_SUPPOSE = ‘‘
I_VORGA = ‘A‘
* I_NO_SUPPOSE = ‘X‘"重要
* I_VORGA = ‘B‘
* i_skip_nr_check = ‘1‘
IMPORTING
E_EINA = WA_EINA_NEW
E_EINE = WA_EINE_NEW
TABLES
T_HEAD = IT_HEAD
T_LINE = IT_LINE
EXCEPTIONS
TEXTNAME_INVALID = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION ‘ME_POST_INFORECORD‘
EXPORTING
I_MATNR = WA_EINA-MATNR
O_MATNR = WA_EINA-MATNR
TABLES
T_EINA_I = IT_EINA.
*APPEND wa_eine_new to it_eine.
CALL FUNCTION ‘ME_UPDATE_INFORECORD_COND‘
TABLES
REINE = IT_EINE.
CALL FUNCTION ‘BAPI_TRANSACTION_COMMIT‘.
READ TABLE IT_EINA INDEX 1.
WRITE:/ ICON_GREEN_LIGHT AS ICON, L_TABIX,‘行‘,‘采购信息记录创建成功,信息记录号:‘,IT_EINA-INFNR.
标签:
原文地址:http://www.cnblogs.com/rainysblog/p/4215265.html