How to delete component of BOM (bill of material) in SAP - sap

I want to delete the component (raw material) of a BOM without making any changes in ABAP coding.
Please tell me know if we have any transaction for it.

I think you need to use transaction 'CS02'.
CS02 – Change Material BOM
SAP transaction CS02 (Change Material BOM) is classified in the Logistics – General module under application component Bills of Material and runs R/3 Application development: PP Bills of Material program SAPMC29S upon execution
Check this link.
Hope it helps.

You can use CS02 (Change BOM) T-code to delete the Component of the BOM (Bill Of Material), if you required to delete the multiple BOM Component use LSMW Script.

Related

Reload a new BoM in a manufacturing order

In odoo V13, we need to "update" the BoM in a manufacturing order. We use the PLM application to make changes to BoMs, and a change was made after the manufacturing order was created. We would prefer to not delete and re-create the manufacturing order.
I came across this post but there are no instructions for Odoo V13. I tried to figure it out by trial and error but I don't know odoo enough to be certain the result is correct.
This is the code for V14 with functions unavailable in V13 identified:
for record in records:
record._compute_allowed_product_ids() <- Not in V13
record._onchange_bom_id()
record._onchange_move_raw()
record._onchange_move_finished() <- Not in V13
record._onchange_location
I planned on adapting it to work with a wizard to allow selecting a specific BoM version.
How can I create a server action to "update/change" the BoM of a manufacturing order?
I haven't tested it fully but played around with it on an odoo 13 runbot instance.
# only change draft manufacturing orders
for record in records.filtered(lambda r: r.state == 'draft'):
# trigger changing to the same product
record.onchange_product_id()
# trigger bom change from product onchange
record._onchange_bom_id()
# trigger raw materials moves change after bom change
record._onchange_move_raw()
# trigger some other changes which usually are done anyways
record.onchange_picking_type()
record._onchange_date_planned_start()
record._onchange_location()
# finally set procurement group again, which is usually done in create()
record.move_raw_ids.write({
'group_id': record.procurement_group_id.id,
'reference': record.name,
})
It will be much more difficult to change BoMs on confirmed manufacturing orders, so this solution only works for draft orders.

How to find the required tables of a BAPI function?

I'm new to SAP and studying calling some predefined BAPI function using JAVA. I have a question. I open the function BAPI_QUOTATION_CREATEFROMDATA2 in SE37. In it, I found import and tables. The import is the parameters I need when calling this function, but in tables, there are about 12 tables and structures, how do I know which is the minimum requirement to call the function? Can anyone help? Thanks.
Please see the optional column, highlighted in the image below. The tables that are optional are checked. Tables that do not have 'Optional' checked are required. You can see from the image that 'QUOTATION_PARTNERS' is the required table.
Since this is a BAPI, it is a generally released function module by SAP and therefore better documented than just any other function module. Most BAPI's have good documentation that you can access in SE37 by clicking on Function Module Documentation.
Unfortunately for BAPI_QUOTATION_CREATEFROMDATA2 is looks like the developer was lazy and copy pasted it from an order creation BAPI since it mentions:
Notes
1. Required entries: ORDER_HEADER_IN : DOC_TYPE Sales document type
SALES_ORG Sales organization
DISTR_CHAN Distribution channel
DIVISION Division ORDER_PARTNERS..: PARTN_ROLE Partner role, Sold.to party
PARTN_NUMB Customer number ORDER_ITEMS_IN..: MATERIAL Material number
Luckily the documentation for the parameter itself is a bit betterL
The minimum requirement is that the sold-to party is entered at header level. Additional partner functions can then be automatically determined.

BAPI for adding descriptions to Master Changes?

I have a program that will automatically change or creates the BOM using the BAPI.
When you change, you enter the change number (AEOI-AENNR), but add a description of the change (AEOI-OITXT) there is no possibility. Now I prescribe them manually using transaction CC02. Who knows any function modules or BAPI to automatic change of data in the Master Changes to automatic after I change the specifications could automatically add a description.
EDIT (from OP comment): "The specification used CSAP_BOM_ITEM_MAINTAIN, BAPI_MATERIAL_BOM_GROUP_CREATE. They serve a number of changes, but the description for the field AEOI-OITXT have not seen."
'BAPI_ISMCHANGENUMBER_CREATE' should work to create the change number, validity date, and description.
Then simply assign that number (given in return data) to the BOM bapi call.

How can I delete Stock Move in 'Done' state, from command line in Odoo/ OpenERP?

I want to delete All Quotation, Sales Orders and Invoices from my database for this i have to delete all stock moves which are 'validated' and in 'done' state, how can i delete stock moves from command line ? OR How can I change status from 'Done' to 'Draft' ?
ODOO was designed so that all non-draft documents should be stored in database (as I understand, in some countries ERP should do this by law restrictions).
Nevertheless, in some cases one should completely remove already existing documents: for example, I created test invoice and confirmed it, but I don't want to preserve it in my actual system.
All next steps can be done ONLY by your own risk! You can spoil something or even break your database if you're not completely sure of what you're doing! I STRONGLY recommend to make backup of your database before doing something like this!
Generally odoo database structure is very clean and simple. You can connect to your database (I prefer some GUI tool like pgadmin3) and manually adjust necessary tables.
Here's small description of related tables (just remove unnecessary items):
sale_order: all your quotations;
sale_order_line: items in quotations;
account_invoice: all your invoices;
account_invoice_line: items in all your invoices;
account_move: journal entries;
account_move_line: items in journal entries.
I don't recommend using this method if you have alternative solution made from odoo interface!
Note: I wouldn't recommend this method unless your absolutely sure of what you are doing.
You can do this using SQL statements directly.
If you want to delete all stock moves in done state:
DELETE FROM stock_move WHERE state='done'
If you want to change stock moves from done (or any other state) to draft state:
UPDATE stock_move SET state='draft' WHERE state='done'
There are two way
1) GUI Editor(Pgadmin3 is widely using...)
Help: https://doc.odoo.com/install/linux/postgres/
2) Via Terminal , fire these commands one by one,
sudo su postgres THEN
psql database_name THEN
fire_your_query
Note : i agree with César if you sure then and then only go with it.
Thanks
Tidyway Team

SAP Business One I Query inventory base on user defined field

I am running a query on a product. I need a field that will look at the user defined field which contains another product and check that stock level. Any help would be great.
What is the main objective?
Are you trying to check on that item because that item is the material/component? or act like a substitution?
Using UDF is quite not feasible as you have to get the link to the Item Master Data, and I have not figured out yet how to do that.
But if you are using it as substitution, why don't you use Alternative Item in Inventory > Item Management > Alternative Items? It will show on Sales Quotation for you to display it to customer. Or during Sales Order, you can get it displayed for alternative should your main item is shortage.
If you are using those item as a component, I suggest you use Bill of Material. During Production Order you will be able to see those component's availability in qty, and also you can have more than one, unlike UDF.
Hope this helps.
I think the key part you're missing here is the naming convention which SAP adpots for user defined fields.
Correct me if I'm wrong, but it seems that you're capable of querying these fields from a SQL point of view.
UDFs by defuault, will have their column name prefixed with "U_".
For example, the UDF 'AnotherProduct' will be referred to in SQL as 'U_AnotherProduct'.
Hope this helps, if not, please explain your problem in some more detail.