Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Create Equipment with the Function 'BAPI_EQUI_CREATE'

Former Member
0 Likes
5,197

Hello all,

I want to create an equipment with the Function. When I start it I don't get errors, but nevertheless the equipment is created.

I can 't see an equipment number ( see last line ) and the transaktion ie02 says 'this equipment is not exist

please help me. thank you in advance.

  • Export (Eingabe-)Parameter

DATA:

external_number1 LIKE bapi_itob_parms-equipment, " Nummer des anzulegenden Equipments (initial => interne Vergabe)

data_general1 LIKE bapi_itob, " Allgemeine Daten Technische Objekte

data_specific1 LIKE bapi_itob_eq_only, " Equipmentspezifische Daten

data_fleet1 LIKE bapi_fleet, " Fahrzeugspezifische Daten

valid_date1 LIKE bapi_itob_parms-inst_date, " Gültig-Ab-Datum für anzulegendes Equipment

data_install1 LIKE bapi_itob_eq_install. " Einbaudaten des Equipments

external_number1 = '140001' .

data_general1-obj_size = '123 x 123' .

data_general1-acqdate = '19781127' .

data_general1-acquisval = '1234.33' .

data_general1-manfacture = 'Simons' .

data_general1-manserno = '12345678900987654321' .

data_general1-manmodel = 'Supermega' .

data_general1-constyear = '1978' .

data_general1-constmonth = '11' .

data_general1-start_from = '19781127' .

data_general1-costcenter = 'tuv133' .

data_general1-comp_code = 'Hack' .

data_general1-read_crdat = '19781127' .

data_general1-read_crnam = 'testuser' .

data_general1-read_chdat = '19781127' .

data_general1-read_chnam = 'testuser' .

data_specific1-serialno = '152727278327717' .

data_specific1-material = '15272727812377' .

  • Import (Ausgabe-)Parameter

DATA:

equipment1 LIKE bapi_itob_parms-equipment, " Nummer des angelegten Equipments

data_general_exp1 LIKE bapi_itob, " Allgemeine Daten Technische Objekte

data_specific_exp1 LIKE bapi_itob_eq_only, " Equipmentspezifische Daten

data_fleet_exp1 LIKE bapi_fleet, " Fahrzeugspezifische Daten

return1 LIKE bapiret2. " Returnparameter

CALL FUNCTION 'BAPI_EQUI_CREATE'

EXPORTING

EXTERNAL_NUMBER = external_number1

DATA_GENERAL = data_general1

DATA_SPECIFIC = data_specific1

  • DATA_FLEET = data_fleet1

  • VALID_DATE = valid_date1

DATA_INSTALL = data_install1

IMPORTING

equipment = equipment1

data_general_exp = data_general_exp1

data_specific_exp = data_specific_exp1

  • data_fleet_exp = data_fleet_exp1

return = return1

.

write: / 'Output:' , equipment1 .

3 REPLIES 3
Read only

Former Member
0 Likes
2,475

Wall of text...

3 words for you: BAPI, TRANSACTION and COMMIT. Find the right combination to see the magic work.

Read only

Former Member
0 Likes
2,475

IE02 is a CHANGE transaction. You want IE01 (or IE08? fast create?? forgot the transaction code). IE02 should give you an error if this is a new EQUI number.

Read only

Former Member
0 Likes
2,475

Thank you very much for the helpful answers.

The problem is solved.

'BAPI_EQUI_CREATE' needs a commit to make an entry in the Database.

CALL FUNCTION 'BAPI_EQUI_CREATE'

EXPORTING

external_number = equipmentnummer

data_general = data_general1

data_specific = data_specific1

  • DATA_FLEET = data_fleet1

  • VALID_DATE = valid_date1

data_install = data_install1

IMPORTING

equipment = equipment1

data_general_exp = data_general_exp1

  • data_specific_exp = data_specific_exp1

  • data_fleet_exp = data_fleet_exp1

return = return1 .

DATA: ld_wait LIKE bapita-wait.

ld_wait = 'X' .

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = ld_wait.