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 or FM for deleting a record from the table

Former Member
0 Kudos
2,444

Hi Experts,

I have a scenario wherein my end user is fetching the records from the database on a screen one by one and then there is a "DELETE" button on the same screen with which he can delete the displayed record from the underlying table.

I would like to know if there are any BAPIs or FM available to do that. I know we can do this just by useing the DELETE stmt but that would be my last option.

Also, when we delete a record from the database do we need to do COMMIT (if yes, then how?) in order to make the changes permanent?

Thanks,

Sid

"Max points are guarenteed"

1 ACCEPTED SOLUTION
Read only

Simha_
Advisor
Advisor
0 Kudos
1,526

Hi,

There is no specific BAPI/FM to delete entry from all tables on giving the table name.

If u name the table from which u want to delete the entry,

there is a possibility of BAPI existing based on the table name..

Give us the table name, may be we can tey to help u..

Cheers,

Simha.

6 REPLIES 6
Read only

Simha_
Advisor
Advisor
0 Kudos
1,527

Hi,

There is no specific BAPI/FM to delete entry from all tables on giving the table name.

If u name the table from which u want to delete the entry,

there is a possibility of BAPI existing based on the table name..

Give us the table name, may be we can tey to help u..

Cheers,

Simha.

Read only

Former Member
0 Kudos
1,526

Hi,

We are display the sales order and the record should be deleted for the displayed sales order.

Can we create any such FM in which we can implement this?

Thanks!

~Sid

Read only

0 Kudos
1,526

Hi,

U mean to say the displayed sales orders have to be deleted from the standard table?

If u want to delete the sales order...

Try this BAPI

BAPI_SALESORDER_CHANGE, try to set D as value of flag for deletion:

Go through the documentation , it will give u a better idea..

A) Delete the Sales Order

SALESDOCUMENT = <doc. number>.

ORDER_HEADER_INX-UPDATEFLAG = 'D'.

B) Delete an item of Sales Order

SALESDOCUMENT = <doc. number>.

ORDER_ITEM_IN-ITM_NUMBER = <item number>.

ORDER_ITEM_INX-ITM_NUMBER = <item number>.

ORDER_ITEM_INX-UPDATEFLAG = 'D'.

Cheers,

Simha.

Message was edited by:

Narasimha Rao Bandla

Read only

Former Member
0 Kudos
1,526

Hi,

Yes for std table...actually we are not to delete the records parmanently, even i also got this Flag with which we can mark it for deletion so that next time the marked record is not fetched.

I was finding a FM just becose we follow the standard procedure however we can do that just be an sql stmt DELETE, but MARK FOR DELETION is what solves the purpose.

Thanks for the help.

~Sid

Read only

0 Kudos
1,114

Hi Simha 

Is there any BAPI for delete (STMDT) and (STMTI) fields in Table BSET 

Read only

0 Kudos
1,094

This thread is 17 years old and marked as solved. Please open a new thread for your question.