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

BAPI FOR CREATING MATERIAL CLASSIFICATION

Former Member
0 Likes
4,720

Dear All,

I am using BAP_OBJCL_CREATE for extending classification view/data for material master.I have entered the relevant data,system generates message 'assignment created',but on data is not getting updated in tables i.e data has not got extended.

3 REPLIES 3
Read only

Former Member
0 Likes
1,385

HI Stuti.

Did you call the BAPI_TRANSACTION_COMMIT after calling the BAPI (otherwise changes will not be committed to the database).

Regards,

John.

Read only

0 Likes
1,385

Hi John,

Based on your advise I called the other BAPI also,but it returns no message.

Normally,using a BAPi, entries are directly updated in the table.Plz help me.

Read only

1,385

Hi Stuti,

Your statement is not correct: using BAPIs entries will NEVER be updated in tables. Instead you should check the return-table for any errors and then call either BAPI_TRANSACTION_COMMIT or BAPI_TRANSACTION_ROLLBACK. I use the BAPI for object classification as well:

*-Change the object classification:

CALL FUNCTION 'BAPI_OBJCL_CHANGE'

EXPORTING

objectkey = iv_objectkey

objecttable = iv_objecttable

classnum = iv_class

classtype = iv_classtype

TABLES

allocvaluesnumnew = ct_nume_values

allocvaluescharnew = ct_char_values

allocvaluescurrnew = ct_curr_values

return = zlt_return.

*-Commit transaction in case no errors:

READ TABLE zlt_return INTO zls_return

WITH KEY type = 'E'.

IF syst-subrc = 0.

CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.

ev_error = zls_return-message.

ELSE.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

ENDIF.

Regards,

John.