SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

BAPI_BATCH_CHANGE



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Interfaces | Интерфейсы -> BAPI
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1639

PostPosted: Sat Apr 26, 2008 3:49 pm    Post subject: BAPI_BATCH_CHANGE Reply with quote

BAPI_BATCH_CHANGE - Change Batch

Code:
REPORT ZUPDATE_TEST2.

Data:
T_BATCHATTRIBUTES type standard table of BAPIBATCHATT,
TE_BATCHATTRIBUTES type BAPIBATCHATT,

*EXPIRYDATE is a component of BAPIBATCHATT Structure.
TE_BATCHATTRIBUTES-EXPIRYDATE = ‘11/03/2005’.
append TE_BATCHATTRIBUTES to T_BATCHATTRIBUTES.

T_BATCHATTRIBUTESX type standard table of BAPIBATCHATTX,
TE_BATCHATTRIBUTESX type BAPIBATCHATTX.

*EXPIRYDATE is a component of BAPIBATCHATTX Structure.
TE_BATCHATTRIBUTESX-EXPIRYDATE = 'X'.
append TE_BATCHATTRIBUTESX to T_BATCHATTRIBUTESX.

CALL FUNCTION 'BAPI_BATCH_CHANGE'
EXPORTING
MATERIAL = 'AF126-2_DEMO'
BATCH = '0000000147'
PLANT = '2010'
BATCHATTRIBUTES = T_BATCHATTRIBUTES
BATCHATTRIBUTESX = T_BATCHATTRIBUTESX.
*BATCHCONTROLFIELDS =
*INTERNALNUMBERCOM =
*EXTENSION1 =
*MATERIAL_EVG =
*IMPORTING
*BATCHATTRIBUTES =
*TABLES


Code:
REPORT yff_pruebas.

DATA: t_batchattributes TYPE STANDARD TABLE OF bapibatchatt,
te_batchattributes TYPE bapibatchatt,
t_batchattributesx TYPE STANDARD TABLE OF bapibatchattx,
te_batchattributesx TYPE bapibatchattx.
DATA: wt_ret TYPE bapiret2 OCCURS 0 WITH HEADER LINE,
w_lines TYPE i,
w_bapibatchatt TYPE bapibatchatt,
wa_bapibatchatt TYPE bapibatchatt,
w_matnr TYPE matnr,
w_charg LIKE lqua-charg,
w_fecha type vfdat.

w_fecha = sy-datum.

te_batchattributes-expirydate = w_fecha.
APPEND te_batchattributes TO t_batchattributes.

te_batchattributesx-expirydate = 'X'.
APPEND te_batchattributesx TO t_batchattributesx.

CALL FUNCTION 'BAPI_BATCH_CHANGE'
EXPORTING
material = w_matnr
batch = w_charg
batchattributes = t_batchattributes
batchattributesx = t_batchattributesx
IMPORTING
batchattributes = wa_bapibatchatt.
Back to top
View user's profile Send private message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1639

PostPosted: Sat Mar 05, 2011 5:33 pm    Post subject: Reply with quote

Code:
FUNCTION zerul_batch_change.
*"----------------------------------------------------------------------
*"*"Update Function Module:
*"
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(MATNR) TYPE  MATNR
*"     VALUE(WERKS) TYPE  WERKS_D
*"     VALUE(CHARG) TYPE  CHARG
*"     VALUE(LIFNR) TYPE  ELIFN
*"     VALUE(LICHA) TYPE  LICHN
*"  EXCEPTIONS
*"      ERROR
*"----------------------------------------------------------------------

  DATA: ls_batchattributes TYPE bapibatchatt,
        ls_batchattributes_new TYPE bapibatchatt,
        ls_batchattributesx TYPE bapibatchattx,
        ls_bapibatchkey     TYPE bapibatchkey.

  DATA: l_return_tab LIKE bapiret2 OCCURS 10 WITH HEADER LINE.

  ls_bapibatchkey-material = matnr.
  ls_bapibatchkey-batch = charg.
  ls_bapibatchkey-plant = werks.

  ls_batchattributes-vendrbatch = licha.
  ls_batchattributesx-vendrbatch = 'X'.

  ls_batchattributes-vendor_no = lifnr.
  ls_batchattributesx-vendor_no = 'X'.


  CALL FUNCTION 'BAPI_BATCH_CHANGE'
    EXPORTING
      material         = ls_bapibatchkey-material
      batch            = ls_bapibatchkey-batch
      plant            = ls_bapibatchkey-plant
      batchattributes  = ls_batchattributes
      batchattributesx = ls_batchattributesx
    IMPORTING
      batchattributes  = ls_batchattributes_new
    TABLES
      return           = l_return_tab.

  IF ( ls_batchattributes-vendrbatch NE
       ls_batchattributes_new-vendrbatch ) OR
     ( ls_batchattributes-vendor_no NE
       ls_batchattributes_new-vendor_no ).

    RAISE error.

  ENDIF.

ENDFUNCTION.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Interfaces | Интерфейсы -> BAPI All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.