ME11 Creating an Informational record Function

Source: Internet
Author: User

Transfer from http://blog.csdn.net/zeewjj/article/details/7941530
call FUNCTION ' Me_direct_input_inforecord '

DATA: Wa_einaTYPE Eina,
Wa_eineTYPE EINE,
Wa_eina_newTYPE Eina,
Wa_eine_newTYPE EINE.


DATA: It_headTYPEStandardTABLEof Mestxh,
It_lineTYPEStandardTABLEof MESTXL.


DATA: It_einaTYPEStandardTABLEof EinaWithHEADERLine,
It_eineTYPEStandardTABLEof EINE.


DATA:RETURNTYPEStandardTABLEof BapireturnWithHEADERLine.
DATA: L_NETPRLike Ekpo-netpr.
DATA: L_KOMVTYPE KOMV,
L_ekpoTYPE 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 create ' into WA_EINA-IDNLF.

PagerFUNCTION' Me_initialize_inforecord '.


PagerFUNCTION' Me_direct_input_inforecord '
Exporting
ACTIVITY=V"V Modify, H create
I_eina= Wa_eina
I_eine= Wa_eine
I_no_suppose=‘‘
I_vorga=A
* i_no_suppose = ' X ' "important
* 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.
MESSAGEID SY-msgidTYPE SY-msgtyNumber SY-msgno
With SY-msgv1 SY-msgv2 SY-msgv3 SY-msgv4.
ENDIF.




PagerFUNCTION' 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.
PagerFUNCTION' 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 ' line ' , ' purchase information record created successfully, information record number: ' ,it_ Eina-infnr

ME11 Create information record Function

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.