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_BUPA_CREATE_FROM_DATA



 
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: Sat Apr 26, 2008 5:03 pm    Post subject: BAPI_BUPA_CREATE_FROM_DATA Reply with quote

BAPI_BUPA_CREATE_FROM_DATA - Create a Business Partner

Code:
DATA:
gs_centraldata TYPE bapibus1006_central,
gs_centraldataorganization TYPE bapibus1006_central_organ,
gs_addressdata TYPE bapibus1006_address.
it_return TYPE TABLE OF bapiret2.
lv_customer TYPE bu_partner.

MOVE:
'Siva B Kumar' TO gs_centraldataorganization-name1,
'XYZ' TO gs_centraldataorganization-name2,
'X' TO gs_addressdata-standardaddress,
'3000' TO gs_addressdata-postl_cod1,
'Melbourne' TO gs_addressdata-city,
'Street' TO gs_addressdata-street,
'246' TO gs_addressdata-house_no,
'GB' TO gs_addressdata-country,
'VIC' TO gs_addressdata-region,
'EN' TO gs_addressdata-langu.

CALL FUNCTION 'BAPI_BUPA_CREATE_FROM_DATA'
  EXPORTING
    partnercategory = '2'
    partnergroup = '0001'
    centraldata = gs_centraldata
    centraldataorganization = gs_centraldataorganization
    addressdata = gs_addressdata
  IMPORTING
    businesspartner = lv_customer
  TABLES
    return = it_return.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
  EXPORTING
    wait = 'X'.

REFRESH it_return.

CALL FUNCTION 'BAPI_BUPA_ROLE_ADD_2'
  EXPORTING
    businesspartner = lv_customer
    businesspartnerrole = 'CRM000'
  TABLES
    return = it_return.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
 EXPORTING
   wait = 'X'.

WRITE:/ lv_customer.


Code:
DATA : PARTNER_CATEGORY TYPE BAPIBUS1006_HEAD-PARTN_CAT,
CENTRALDATA TYPE BAPIBUS1006_CENTRAL,
PERSON_DATA TYPE BAPIBUS1006_CENTRAL_PERSON,
ADDRESS_DATA TYPE BAPIBUS1006_ADDRESS,
TELEFONDATA TYPE TABLE OF BAPIADTEL WITH HEADER LINE,
FAXDATA TYPE TABLE OF BAPIADFAX WITH HEADER LINE,
E_MAILDATA TYPE TABLE OF BAPIADSMTP WITH HEADER LINE,
WA_RETURN TYPE BAPIRET2,
PARTNER_GRP TYPE BAPIBUS1006_HEAD-PARTN_GRP,
TITLE_KEY TYPE AD_TITLE.

PARTNER_CATEGORY = '1'. "Person

PARTNER_GRP = '0002'.

CENTRALDATA-SEARCHTERM1 = SEARCHTERM1.
CENTRALDATA-SEARCHTERM2 = SEARCHTERM2.

TRANSLATE TITLE TO UPPER CASE.
IF TITLE = 'MR.'.
TITLE_KEY = '0002'.
ELSEIF TITLE = 'MS.'.
TITLE_KEY = '0001'.
ENDIF.
CENTRALDATA-TITLE_KEY = TITLE_KEY.

PERSON_DATA-FIRSTNAME = FIRSTNAME.
PERSON_DATA-LASTNAME = LASTNAME.
PERSON_DATA-TITLE_ACA1 = TITLE_ACA1.
PERSON_DATA-TITLE_SPPL = TITLE_SPPL.
PERSON_DATA-NAMEFORMAT = NAMEFORMAT.
PERSON_DATA-BIRTHDATE = BIRTHDATE.
PERSON_DATA-CORRESPONDLANGUAGE = CORRESPONDLANGUAGE.
PERSON_DATA-SEX = SEX.
PERSON_DATA-MARITALSTATUS = MARITALSTATUS.
PERSON_DATA-NATIONALITY = NATIONALITY.

ADDRESS_DATA-STANDARDADDRESS = 'X'.
ADDRESS_DATA-HOUSE_NO = HOUSE_NO.
ADDRESS_DATA-STREET = STREET.
ADDRESS_DATA-PO_BOX = PO_BOX.
ADDRESS_DATA-POSTL_COD1 = POSTL_COD1.
ADDRESS_DATA-CITY = CITY.
ADDRESS_DATA-REGION = REGION.
ADDRESS_DATA-COUNTRY = COUNTRY.
ADDRESS_DATA-LANGU = LANGUAGE.

TELEFONDATA-TELEPHONE = TELEPHONE.
APPEND TELEFONDATA.
FAXDATA-FAX = FAX.
APPEND FAXDATA.
E_MAILDATA-E_MAIL = EMAIL.
APPEND E_MAILDATA.


CALL FUNCTION 'BAPI_BUPA_CREATE_FROM_DATA'
EXPORTING
BUSINESSPARTNEREXTERN = BP_NO
PARTNERCATEGORY = PARTNER_CATEGORY
PARTNERGROUP = PARTNER_GRP
CENTRALDATA = CENTRALDATA
CENTRALDATAPERSON = PERSON_DATA
ADDRESSDATA = ADDRESS_DATA
IMPORTING
BUSINESSPARTNER = BP
TABLES
TELEFONDATA = TELEFONDATA
FAXDATA = FAXDATA
E_MAILDATA = E_MAILDATA
RETURN = RETURN
.
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.