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_COSTCENTER_CREATEMULTIPLE



 
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: 1640

PostPosted: Sun May 25, 2008 1:33 pm    Post subject: BAPI_COSTCENTER_CREATEMULTIPLE Reply with quote

BAPI_COSTCENTER_CREATEMULTIPLE - Create One or More Cost Centers

Code:
*&---------------------------------------------------------------------
*& Form CREATE_data
*&---------------------------------------------------------------------
FORM CREATE_DATA .
DATA: lv_tabix TYPE sy-tabix,
lv_tot_records TYPE i.

*For BAPI
DATA : lt_data TYPE TABLE OF BAPI0012_CCINPUTLIST,
lT_return TYPE TABLE OF bapiret2,
lv_test TYPE bapi2017_gm_gen-testrun,
LWA_DATA TYPE BAPI0012_CCINPUTLIST,
LV_HEADER TYPE BAPI0012_GEN-CO_AREA.

IF p_test IS INITIAL.
  CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    EXPORTING
      text = 'Posting data'(t02).
ELSE.
  CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    EXPORTING
      text = 'Simulate posting'(t03).
ENDIF.

lv_test = p_test.

LOOP AT T_DATA INTO WA_DATA.

  LWA_DATA-COSTCENTER = WA_DATA-KOSTL.
  LWA_DATA-VALID_FROM = WA_DATA-VALID_FROM.
  LWA_DATA-COMP_CODE = WA_DATA-COMP_CODE.
  LWA_DATA-VALID_TO = WA_DATA-VALID_TO.

  LWA_DATA-PERSON_IN_CHARGE = WA_DATA-PERSON_IN_CHARGE.
  LWA_DATA-DEPARTMENT = WA_DATA-DEPARTMENT.
  LWA_DATA-COSTCENTER_TYPE = WA_DATA-COSTCENTER_TYPE.
  LWA_DATA-COSTCTR_HIER_GRP = WA_DATA-COSTCTR_HIER_GRP.

  LWA_DATA-BUS_AREA = WA_DATA-BUS_AREA.
  LWA_DATA-PROFIT_CTR = WA_DATA-PROFIT_CTR.
  LWA_DATA-LOCK_IND_COMMITMENT_UPDATE = WA_DATA-LOCK_UPDATE.
  LWA_DATA-CSTG_SHEET = WA_DATA-CSTG_SHEET.

  LWA_DATA-ADDR_TITLE = WA_DATA-TITLE.
  LWA_DATA-TELCO_LANGU = WA_DATA-TELCO_LANGU.
  LWA_DATA-NAME = WA_DATA-NAME.
  LWA_DATA-DESCRIPT = WA_DATA-DESC.

  APPEND: LWA_DATA TO LT_DATA.
  CLEAR: LWA_DATA,WA_DATA.

ENDLOOP.

LV_HEADER = 'SG01'.
CALL FUNCTION 'BAPI_COSTCENTER_CREATEMULTIPLE'
  EXPORTING
    CONTROLLINGAREA = LV_HEADER
    TESTRUN = ' '
    MASTER_DATA_INACTIVE = ' '
  TABLES
    COSTCENTERLIST = LT_DATA
    RETURN = LT_RETURN

IF SY-SUBRC EQ 0.
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      WAIT = 'X'.
ELSE.
  CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ENDIF.

ENDFORM. " CREATE_data
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.