How to know which field from a table receives a variable? - sapb1

I'm starting with SAPB1 and when I'm trying to set my file to import products to the inventory I've a field (select list) that's need to be filled, but I can't find what and where it is stored since on system information shows "form=150 pane=6 variable=82".
I still have no access to the development tools. How can I find where's stored, and what data is in the variable depending on the selected choice?
Thanks.

If you are referring to the Batch number / Serial number combo box?
I could not find the actual variable in the OITM table.
But you can see that:
If the item is managed by Batch number, the field OITM.ManBtchNum = Y.
If it is Serial number managed, the field OITM.ManSerNum = Y.
Hope it helps.

Related

Odoo - Bulk Update Product Variant Internal ID

I am working with odoo community edition 11 and have been looking for the correct way to bulk import internal reference numbers for product variants.
I have attempted to export the data in a usable format however each time I am able to get the necessary fields, the product variants are duplicated in the export. In the image below you can see that each product in this case is shown twice.
With approximately 1800 variant products currently, this issue isn't something that's a simple workaround. And this number is expected to increase dramatically over the next few weeks.
I'm looking for guidance on how to get the initial export of all product variants with no assigned internal reference to function properly.
The fields I need to be able to bring down is the product ID (reference for import) the internal reference (or blank) and the variant attributes assigned to that particular product variant.
Any assistance in pushing me in the right direction would be greatly appreciated.
** Output from first answer below:
Go to Inventory > Master data > Product variants, select a product and got to action>export, select radio button Export all Data. Select columns 'Display name, Internal Reference, ID', then choose save export and save the export with any name. Now cancel the export, select all product variants, go to export again and this time keep 'Import compatible' selected, choose that saved export from earlier.
You will have exported list of product variants with column Full name which contains 'variant attributes' in it. and you can import this modifying the Internal reference column.
For example, check this from a new demo database in odoo:

MS Access manual Auto incrementing field

Im building a system for my company to keep track of internal orders, inbetween our warehouses, we have material that goes out warehouse 1 to warehouse 2 and we kind of lose track of how much of "x" is in warehouse 1 and how much in warehouse 2, so i want to implement this access db where a user fills a form and says: order 1: 500 of "x" order 2: 300 of "y". then another user fills an exit form where he says 1 of "x" going out, so i would need the program to keep track of total order and how much as gone out to fill order 1 and so on...
My idea here is to have both an order number and an id number for each of "x" everytime someoneone assembles 1 "x" they fill the form and print a label directly from the access (i have this part working already) while keeping a record of when it was assembled, who verified and what was verified (it will work as a quality control also).
What i dont know is how to program the db so when it reaches 500 of "x", the id number for "x" starts again from 1
This is the one major issue with my program right now, i'm not experienced in access db's or vba, but im getting there with a tip and a trick from here and there, so, no need to be careful with the technical language, i will google it if i have to :p
EDIT:
The table structure goes as follows:
1 table as the main table where I record the check that is made for every product, where I include the model of the product, the said ID that I want to reset after a number of products checked, and a concatenated field that includes most of this information to generate a qr code.
Then there is a table for the Order Number, which is connected to a form to record each new order with a date/time field, the order number itself and the number of products. This number of products must then be called from the code that will count how many products have been checked to date and keep the order number field updated so we can keep track of the order.
Then there is another minor table just to get values for the form, the product models
Thank you for your answers ;)
See this MSDN Documentation
Unfortunately in Access, you cannot 'reset' an ID field, unless you move the records to a newly created table and use that table for every 500 records.
As for the user control and login form, I'm afraid those are separate questions that must be asked in a different thread.
To get you started:
You can set the RecordSource of a form to a table, and when users make entries, the data will be saved to the table. You can also use a form with controls (text boxes, comboboxes, etc.) and create a button that runs a query to insert these records into a table.
The login piece - you can encrypt the database with a password. That may/may not be sufficient.
I would suggest you change your schema, if possible. Something like the following:
Orders
OrderID (Autonumber)
ProductID (link to your Products table)
QuantityRequested
Deliverables
DeliverableID (Autonumber)
OrderID (link to your Orders table)
SequenceNumber: in the BeforeInsert event set this value equal to:
DCount("*", "Deliverables", "OrderID=" & Me.OrderID) + 1
I'm assuming that your form has a control named OrderID that is bound to the OrderID field of the Deliverables table.
The code uses the DCount() function to get the count of all the other deliverables that have already been created for this order. If this is the first deliverable, DCount() will return 0. It then adds 1 to this count to get the sequence number of the next deliverable.
If the new SequenceNumber is greater than the quantity requested, you could display a message saying that the order has been filled and cancel the creation of the Deliverable record.
This is just one approach and it is not a complete solution. I'm assuming that once assigned a sequence number a deliverable cannot be deleted. You might need to make allowances for deliverables that get lost or damaged. You could incorporate a status field to the Deliverable table to deal with this, but you would still need to make a decision about what to do with the SequenceNumber.

SQL Server: Remove substrings from field data by iterating through a table of city names

I have two databases, Database A and Database B.
Database A contains some data which needs to be placed in a table in Database B. However, before that can happen, some of that data must be “cleaned up” in the following way:
The table in Database A which contains the data to be placed in Database B has a field called “Desc.” Every now and then the users of the system put city names in with the data they enter into the “Desc” field. For example: a user may type in “Move furniture to new cubicle. New York. Add electric.”
Before that data can be imported into Database B the word “New York” needs to be removed from that data so that it only reads “Move furniture to new cubicle. Add electric.” However—and this is important—the original data in Database A must remain untouched. In other words, Database A’s data will still read “Move furniture to new cubicle. New York. Add electric,” while the data in Database B will read “Move furniture to new cubicle. Add electric.”
Database B contains a table which has a list of the city names which need to be removed from the “Desc” field data from Database A before being placed in Database B.
How do I construct a stored procedure or function which will grab the data from Database A, then iterate through the Cities table in Database B and if it finds a city name in the “Desc” field will remove it while keeping the rest of the information in that field thus creating a recordset which I can then use to populate the appropriate table in Database B?
I have tried several things but still haven’t cracked it. Yet I’m sure this is probably fairly easy. Any help is greatly appreciated!
Thanks.
EDIT:
The latest thing I have tried to solve this problem is this:
DECLARE #cityName VarChar(50)
While (Select COUNT(*) From ABCScanSQL.dbo.tblDiscardCitiesList) > 0
Begin
Select #cityName = ABCScanSQL.dbo.tblDiscardCitiesList.CityName FROM ABCScanSQL.dbo.tblDiscardCitiesList
SELECT JOB_NO, LTRIM(RTRIM(SUBSTRING(JOB_NO, (LEN(job_no) -2), 5))) AS LOCATION
,JOB_DESC, [Date_End] , REPLACE(Job_Desc,#cityName,' ') AS NoCity
FROM fmcs_tables.dbo.Jobt WHERE Job_No like '%loc%'
End
"Job_Desc" is the field which needs to have the city names removed.
This is a data quality issue. You can always make a copy of the [description] in Database A and call it [cleaned_desc].
One simple solution is to write a function that does the following.
1 - Read data from [tbl_remove_these_words]. These are the phrases you want removed.
2 - Compare the input - #var_description, to the rows in the table.
3 - Upon a match, replace with a empty string.
This solution depends upon a cleansing table that you maintain and update.
Run a update query that uses the input from [description] with a call to [fn_remove_these_words] and sets [cleaned_desc] to the output.
Another solution is to look at products like Melisa Data (DQ) product for SSIS or data quality services in the SQL server stack to give you a application frame work to solve the problem.

Nested Lookup Functions? Need to match up two things

So I'm working in microsoft sql server report builder and here is essentially what I'm trying to do in code:
(Under report variables)
vChargeStatusID = Lookup(Fields!CREDIT_CARD_TRANSACTION_ID.Value, Parameters!CREDIT_CARD_TRANSACTION_ID.Value, Fields!CHARGE_STATUS_ID.Value, "DataSet1")
(As an expression for a filter)
Lookup(Variables!vChargeStatusID.Value, Fields!CHARGE_STATUS_FK.Value, Fields!CONTRACT_NUMBER.Value, "DataSet1")
I've tried using the variable and the expression for the variable to try to create another calculated field, but no luck. I keep getting the error that I can't use nested lookup functions.
Basically what I'm trying to do is, first, find two things that are equal to each other to retrieve a number. Then I need to take that number and match it to something else to finally return the contract number.
I cannot figure this out.
Any help would be great.
So, a very simple way to accomplish this is to place a field on your report (TextBox1.value) that will hold your first lookup value.
For example, your first look up will return a vendor ID (DataSet2) from a customer order (DataSet1).
TextBox1.expression = Lookup(Fields!CustOrderID.Value,Fields!CustOrder_ID2.Value,Fields!VendorID.Value,"DataSet2")
But now you need to find the vendor name from a Vendor Master table (DataSet3). You can do another look up to the Vendor Master table using the ReportItems!TextBox1.value as the first value of the look up. That way you do not get the scope issue.
TextBox2.expression = Lookup(ReportItems!Textbox1.value,Fields!VendorID.Value,Fields!VendorName.Value,"DataSet3")
All credit goes to my boss who figured this out!
Step one: Create another dataset, which is embedded. This dataset then has a filter that takes a field, in this case it's CREDIT_CARD_TRANSACTION_ID, and evaluated it be true to the parameter, pCreditCardTransactionID. This makes sure that the second dataset is ONLY going to display to me the Contract number, which is the very last thing I needed from the Lookup Function.
Step two: Create an internal parameter that the default value is set to the field CONTRACT_NUMBER from the second dataset (ContractNumberLookup).
Step three: Create a filter on the table. The CONTRACT_NUMBER from the original dataset is set to equal the internal parameter.
Tada!
I hope this helps. If any clarification is needed, let me know!

Database Design: Line Items & Additional Items

I am looking for a solution or to be told it simply is not possible/good practice.
I currently have a database whereby I can create new orders and select from a lookup table of products that I offer. This works great for the most part but i would also like to be able to add random miscellaneous items to the order. For instance one invoice may read "End of Tenancy Clean" and the listed product but then have also an entry for "2x Lightbulb" or something to that effect.
I have tried creating another lookup table for these items but the problem is i don't want to have to pre-define every conceivable item before I can make orders. I would much prefer to be able to simply type in the Item and price when it is needed.
Is there any database design or workaround that can achieve this? Any help is greatly appreciated. FYI I am using Lightswitch 2012 if that helps.
One option I've seen in the past is a record in your normal items table labeled something like "Additional Service", and the application code will recognize this item and also require you to enter or edit a description to print with the invoice.
In the ERP system which we have at work, there is a flag in the parts table which allows one to change the description of the part in orders; in other words, one lists the part number in the order and then changes the description. This one off description is stored in a special table (called NONSTANDARD) which basically has two fields - an id field and the description. There is a field in the 'orderlines' table which stores the id of the record in the special table. Normally the value of this field will be 0, which means that the normal description of the part be displayed, but if it's greater than 0, then the description is taken from the appropriate row in the nonstandard table.
You mean something like this?
(only key attributes included, for brevity)