Pull item code based on UDF
Wondering if something like this is possible...
We have a UDF in Item Master Data that contains our "web site item code" an alternate itemcode we use for sales on our web site.
Is it possible to add a UDF (call it WebCode) to the row level of a Sales Order and create a formatted search that will:
As I type a "WebCode" into the UDF field of Sales Order and then tab off, it will populate the Item No. field with the ItemCode associated with the UDF contents of an Items Master Data.
I might not be explaining the concept correctly. Please let me know if I should clarify anything.
Thanks,
-Steve
Hi Steve,
Since you already created a UDF (assuming your field name is WebCode) on item master, you can create another UDF under the row level of marketing documents (also called WebCode).
You don't need to type anything. Instead, you can create a FMS to link the item U_WebCode to this new UDF in the Marketing document and auto fresh will do the job.
The FMS for the new UDF looks like:
Select U_WebCode from oitm where itemcode = $[$38.1.0]
Thanks,
Gordon
Similar Messages
-
UDF For Retrieving the Tax Code based on PO
Hi all,
Mine is a file to Idoc scenario.
I wrote a FM to retrieve the Tax Code based on PO .
Created the udf which directly gets the Taxcode from the r/3 with out importing in to the imported objects,is this correct i never tried this before.
Find the UDF for the Same.
final String CHANNEL_NAME = "GeneratedReceiverChannel_RFC",
VALNOTFOUND = "VALUE_NOT_FOUND",
SAPRFCNS = "urn:sap-com:document:sap:rfc:functions",
TAG_FM = "Z_P_INT012_RFC_LOOKUP",
TAG_TAX_CODE = "T_TAX_CODE",
TAG_TAX_CODE_P = "TAX_CODE";
AbstractTrace trace = container.getTrace();
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = null;
factory.setNamespaceAware(false);
factory.setValidating(false);
try {
builder = factory.newDocumentBuilder();
} catch (Exception e) {
trace.addWarning("Error creating DocumentBuilder - " + e.getMessage());
Document docReq = null;
try {
// Building up RFC Request Document
docReq = builder.newDocument();
Node root = docReq.appendChild(docReq.createElementNS(SAPRFCNS, TAG_FM));
Node nodeTbOpt = root.appendChild(docReq.createElement(TAG_TAX_CODE));
for (int i = 0; i < pernr.length; i++) {
Node nodeTbOptItem = nodeTbOpt.appendChild(docReq.createElement("item"));
nodeTbOptItem.appendChild(docReq.createElement(TAG_TAX_CODE_P)).appendChild(docReq.createTextNode(TAX_CODE<i>));
} catch (Exception e) {
trace.addWarning("Error while building RFC Request - " + e);
trace.addInfo("RFC Request XML: " + docReq.toString());
//trace.addWarning("RFC Request XML: " + docReq.toString());
// Lookup
Payload load = null;
try {
Channel channel = LookupService.getChannel(receiver[0], CHANNEL_NAME);
RfcAccessor accessor = LookupService.getRfcAccessor(channel);
InputStream is = new ByteArrayInputStream(docReq.toString().getBytes());
XmlPayload payload = LookupService.getXmlPayload(is);
load = accessor.call(payload);
} catch (LookupException e) {
trace.addWarning("Error during lookup - " + e);
// Parsing RFC Response Document
Document docRsp = null;
try {
docRsp = builder.parse(load.getContent());
} catch (Exception e) {
trace.addWarning("Error when parsing RFC Response - " + e.getMessage());
trace.addInfo("RFC Response XML: " + docRsp.toString());
//trace.addWarning("RFC Response XML: " + docRsp.toString());
try {
NodeList res = docRsp.getElementsByTagName("item");
for(int i=0;i<res.getLength();i++){
NodeList itemNodes = res.item(i).getChildNodes();
Map itemMap = new HashMap();
for(int j=0;j<itemNodes.getLength();j++){
itemMap.put(itemNodes.item(j).getNodeName(), itemNodes.item(j).getFirstChild().getNodeValue());
rows.add(itemMap);
catch (Exception e) {
trace.addWarning("Result value not found in DOM - " + e);
result.addValue("true");
Error:
16:24:08 Start of test
Source code has syntax error: /usr/sap/XD1/DVEBMGS30/j2ee/cluster/server0/./temp/classpath_resolver/Map283041f0edf311dd960b0003bacd2461/source/com/sap/xi/tf/_MM_INT012_INVOICE_DET_.java:598: 'class' or 'interface' expected public void TaxValues$(String[] a,String[] b,ResultList result,Container container){ ^ /usr/sap/XD1/DVEBMGS30/j2ee/cluster/server0/./temp/classpath_resolver/Map283041f0edf311dd960b0003bacd2461/source/com/sap/xi/tf/_MM_INT012_INVOICE_DET_.java:618: 'class' or 'interface' expected } ^ /usr/sap/XD1/DVEBMGS30/j2ee/cluster/server0/./temp/classpath_resolver/Map283041f0edf311dd960b0003bacd2461/source/com/sap/xi/tf/_MM_INT012_INVOICE_DET_.java:619: 'class' or 'interface' expected ^ 3 errors Source code has syntax error: /usr/sap/XD1/DVEBMGS30/j2ee/cluster/server0/./temp/classpath_resolver/Map283041f0edf311dd960b0003bacd2461/source/com/sap/xi/tf/_MM_INT012_INVOICE_DET_.java:598: 'class' or 'interface' expected public void TaxValues$(String[] a,String[] b,ResultList result,Container container){ ^ /usr/sap/XD1/DVEBMGS30/j2ee/cluster/server0/./temp/classpath_resolver/Map283041f0edf311dd960b0003bacd2461/source/com/sap/xi/tf/_MM_INT012_INVOICE_DET_.java:618: 'class' or 'interface' expected } ^ /usr/sap/XD1/DVEBMGS30/j2ee/cluster/server0/./temp/classpath_resolver/Map283041f0edf311dd960b0003bacd2461/source/com/sap/xi/tf/_MM_INT012_INVOICE_DET_.java:619: 'class' or 'interface' expected ^ 3 errors
16:24:11 End of test.Hi Potharaju,
Why don't you try this, that really works:
If you are using PI 7.1:
http://help.sap.com/saphelp_nwpi71/helpdata/en/33/1ec6ced273493a993a80c2301c03da/frameset.htm
If you are using XI 3.0, PI 7.0
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a03e7b02-eea4-2910-089f-8214c6d1b439
Try with these.
Regards,
Juan -
Project code based Sales Order and Purchase Order - Item wise Report
Dear all,
Scenario:
We are doing business based on Projects. So, for every Sales , Project code is created and Sales order is booked with Project code and subsequently Purchase Order is booked with Project code. (Note:Some cases, few items might not be purchased since stock is available.)
We want report like
SO Project code
SO Posting date
SO Sales Employee
SO Customer Name
SO Item code
SO Quantity
SO Unit price
SO Row Total
PO Project code
PO Posting date
PO Sales Employee
PO Customer Name
PO Item code
PO Quantity
PO Unit price
PO Row Total
*SO line item and PO line item for same project should be parallel , that is important and challenge (certain cases, item in SO might not be in PO, for such cases Blank field should appear for PO Item code.)
Thanks in advance,
Regards,
Dwarak.Hi Dwarak.......
Your Report is right but a small change you have to make Left join RDR1 with POR1........
Try this.......
SELECT T0.PrjCode, T1.Project, T0.PrjName, T1.DocNum, T1.DocDate, T1.CardName, T2.ItemCode, T2.Dscription, T2.Quantity, T2.Price, T2.LineTotal, T3.Project, T4.ItemCode, T4.Dscription, T4.Quantity, T4.Price, T4.LineTotal FROM OPRJ T0 INNER JOIN ORDR T1 ON T0.PrjCode = T1.Project INNER JOIN RDR1 T2 ON T1.DocEntry = T2.DocEntry LEFT JOIN OPOR T3 ON T0.PrjCode = T3.Project LEFT OUTER JOIN POR1 T4 ON T3.DocEntry = T4.DocEntry AND T2.ITEMCODE = T4.ITEMCODE INNER JOIN OITM T5 ON T2.ItemCode = T5.ItemCode WHERE T0.PrjCode ='[%0]' AND
T5.ItmsGrpCod in ('108', '110') GROUP BY T0.PrjCode, T1.Project, T0.PrjName, T1.DocNum, T1.DocDate, T1.CardName, T2.ItemCode, T2.Dscription, T2.Quantity, T2.Price, T2.LineTotal, T3.Project, T4.ItemCode, T4.Dscription, T4.Quantity, T4.Price, T4.LineTotal
Regards,
Rahul -
Item Code Auto Generation Based on User defined Tables
I need the Item code like
PRODUCT TYPE-ITEMGROUP-ITEMCODE-SUBITEM-BRAND-COLOR e.g .FG-01-01-00-001-00.
I created the following User define Tables and link to Item Master data
U_PRO - FOR PRODUCT TYPE
U_GROUP - FOR ITEM GROUP
U_ITEMCODE - FOR ITEMCODE
U_SUBITEM - FOR SUB ITEM
U_BRD - FOR BRAND NAME
U_COLOR - FOR COLOR
i need a formatted search in Item code to fetch the codes from the user defined table
i tried with the following
SELECT T5.[Code]'-'T2.[Code]'-'T3.[Code]'-'T4.[Code]'-'T0.[Code]'-'T1.[Code] FROM [dbo].[@BRD] T0 , [dbo].[@COLOR] T1, [dbo].[@GROUP] T2, [dbo].[@ITEMCODE] T3, [dbo].[@SUBITEM] T4, [dbo].[@PRO] T5 INNER JOIN OITM T6 ON T5.Code = T6.U_PRO WHERE
T5.[Code] = T6.[$U_PRO] AND
T2.[Code] = T6.[$ U_GROUP] AND
T3.[Code] = T6.[$U_ITEMCODE] AND
T4.[Code] = T6.[$U_SUBITEM] AND
T0.[Code] = T6.[$U_BRD] AND
T1.[Code] = T6.[$U_COLOR]
showing errors. Can any one help me regarding this. I badly need the query for Auto generation of ItemcodeHi,
How can you assign those UDF value without ItemCode in the first place?
Thanks,
Gordon -
Change company code based on profit center at line item level in FB50
Hi All,
Following is my requirement, would be thankful if anyone can provide inputs on the same.
When posting documents through FB50, In line item table control company code column gets un-editable ones correct entries are entered for that line. But after this if we want to change the profit center which belongs to different company code system throws error and makes company code column un-editable. In this situation there is no option left for user to correct the values unless he deletes the current line and creates a new one.
Here can we make the company code field always editable?
If not can we update the company code based on the profit center entered on that line item?
I looked for exits but couldn't find any, validation and substitution are also not working because error message thrown by SAP is getting triggered before the substitution or validation code is executed.
Please drop in your comments/inputs.
Thanks in advance.
Lucky.Transaction Code - FB50 G/L Acct Pstg: Single Screen Trans.
Exit Name Description
RFAVIS01 Customer Exit for Changing Payment Advice Segment Text
RFEPOS00 Line item display: Checking of selection conditions
RFKORIEX Automatic correspondence
SAPLF051 Workflow for FI (pre-capture, release for payment)
F050S001 FIDCMT, FIDCC1, FIDCC2: Edit user-defined IDoc segment
F050S002 FIDCC1: Change IDoc/do not send
F050S003 FIDCC2: Change IDoc/do not send
F050S004 FIDCMT, FIDCC1, FIDCC2: Change outbound IDoc/do not send
F050S005 FIDCMT, FIDCC1, FIDCC2 Inbound IDoc: Change FI document
F050S006 FI Outgoing IDoc: Reset Clearing in FI Document
F050S007 FIDCCH Outbound: Influence on IDoc for Document Change
F180A001 Balance Sheet Adjustment
FARC0002 Additional Checks for Archiving MM Vendor Master Data
FEDI0001 Function Exits for EDI in FI
No of Exits: 14
USER EXIT
http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
http://www.sapgenie.com/abap/code/abap26.htm
http://www.sap-img.com/abap/what-is-user-exits.htm
http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction
http://www.easymarketplace.de/userexit.php
http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
http://www.sappoint.com/abap/userexit.pdfUser-Exit
http://www.sap-img.com/ab038.htm
http://help.sap.com/saphelp_46c/helpdata/en/64/72369adc56d11195100060b03c6b76/frameset.htm
USER EXIT
http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
http://www.sap-img.com/abap/what-is-user-exits.htm
http://expertanswercenter.techtarget.com/eac/knowledgebaseAnswer/0,295199,sid63_gci982756,00.html
Rewards if useful.........
Minal -
Item Code Auto generation in item master UDF field
Dear Expert,
I want to Generate automatic item code in the item master U_STY UDF field . the number start with 'SL' prefix
like this 'SL000001' and continue when i generate next item master.
for example 'SL000001' for X item . when add next item Y then item nuber will be 'SL000002'. kindly help me.
thanks.
sridharan
Edited by: Sridharan.R on Oct 28, 2011 10:02 AMHi!
Try this
declare @temp as char(15)
IF (Select max(Itemcode) from OITM ) IS Null
BEGIN
set @temp = 'SL000001'
select cast(@temp as char(15))
END
set @temp=(select max(right(ItemCode,6)) + 1 from OITM )
set @temp='SL'+isnull(replicate(0,6-len(@temp)),'')+@temp
select cast(@temp as char(15))
END
Regards,
[Thanga Raj K|Q3 Wrap-Up: What happened in the third quarter of 2009 in the SAP Business One Community] -
Account code (gl_code_combinations) for tax based on the item code
I would like to have invoice created (ra_customer_trx_all rcta, ra_customer_trx_lines_all) with the account code (gl_code_combinations) for tax depends on the item code (one of the segment in mtl_system_items).
example: we have 5 segments in item code
item A: 01-01-AAA-0001-01
item B: 01-01-BBB-0002-01
and when we do auto invoice(for sales order), system will create
TAX account code for item A: xx.xx.xxxxx.xxxxx.101.xx (for item with 3rd segment=AAA)
TAX account code for item B: xx.xx.xxxxx.xxxxx.303.xx (for item with 3rd segment=BBB)
can anyone give me some guides to set this up?
thanks.use autoaccounting
-
Get Item price based on Price List
Hi all,
anyone has some sample of how to get the price for an item based on a specified price list, selected by the user, following the SAP's rules for assigning item price?
I've used the GetItemPrice method, but it doesn't need a price list reference and i think it gives back the basic price of the item.
I'm able to get the price list and the item code. How can i get the correspondig price (unit price) for that item?
Thanks in advance.
NickThanks Rasmus,
i've done. I get the PriceList currently selected by the combo box and update the price list used by the BP, and after that i use the getitemprice.
So it should work now, i get the correct prices related to the pricelist selected and i think that using the getitemprice the price that i obtain follows the sap B1 logic in assigning prices.
After that i'm considering to set back the pricelist on the BP to the one that is originally stored in the BP.
Thanks for your help -
Item Codes-Automatic(urgent)
Hi All,
I want to define Item Code as Default i.e In SAP How we are getting the Default numbering for eg.1,2,3,4.........I want in the same way for the Item Code.IS IT POSSIBLE through Query based FMS or any other way??
Thanks in Advance.
monaDear Mona,
In order to resolve the issue, please do the following steps :-
1. Create a Initial Item code I0000 manually in the application.
2. Save the following query :-
Select max(Itemtype)
+ cast(substring( max(Itemcode), 2, len(max(Itemcode)))
+ 1 as nvarchar(10)) from OITM
Where Itemtype = $[OITM.Itemtype]
3. Create a formatted search based on the above query and assign it to the itemcode field. (Open Item master in add mode )
4. Then select refresh the formatted search regularly with the Item description change.
5. Then Go to item master data in add mode put something in item code field and then type the correct item description and click tab.
Now your Itemcode field will display as "I0001".
Regards,
Rakesh Pati
SAP Business One Forum Team -
Identical item codes in two different warehouses
We currently have several items that exist in two warehouses. We are using SAP Business One, 8.81 PL09, DTW 88.1.7. All of our items from warehouse A have pulled without any errors. We are using a ItemGroupCode of 100 (default) for both warehouses, and managing the items by warehouse. Attempting to use DTW to pull the identical items into B, we receive an error of Item code 'ABC1234' already exists error 65171. My guess is that we will need to use a separate ItemGroupCode for each warehouse. I'm sure that other people out there have had the same issue. Thank you.
Hello Friend,
You should check item in csv or txt file that is there any duplicate itemcode in for source file.
Because itemgrpcod can be same for all materials.
Thanks
Manvendra Sinhg Niranjan -
Dear All,
We have inventory settings as follows:
1. Group
Fruit
2. Name
Pineaple
3. Code
P001
4.Grade
value : 24 -> Grade A, Grade B, Grade C
5. Price List
Grade A, Grade B, Grade C
I am really confusing whether I have to create itemcode P00124A or just P001, but I create UDF contains grade value 24, price list grade A, B, C and warehouse code A, B, C.
But if the item have to downgrade because of quality decrease, I have to change its level to grade B or even C. If the quality is more and more decrease (not B or C), I have to change the item code.
Pls give advice. Thx
Rgd,
Edu
(Georgia will win)I am happy to hear your answer.
I suggest to use batch no. as lot number for the item. I create UDF in category : inventory --> batch number for items named grade and then I link it to a grade value table.
I agree with your idea :
lots
grade A
grade B
but lot number required by user is the date of the fruit receiving. So, it is important and it will be a main criteria to assess the grade value in making downgrade decision.
Anyway, in administration module --> general settings --> tab inventory --> unique serials number by field : I choose none. What will be I choose so that the above can be applied ?
However, what about the price list ? do you have the automation to make the unit price change automatically when the warehouse code change ?
Pls give advice.
Rgd,
Steve "Edu" -
Dear Friends
I want to generate a Item Code with the following method :
catgory - 1 digit
costcenter - 3 digit
equipment - 4 digit
srno - 4 digit
for ex
bearing 14" xxx then could sould be 1-100-1001-0001 (110010010001)
rightnow i had given the following code but i am unable to get the last 4 digit based on (category+costcenter+equipment + max(srno) of the perticular category+costcenter+equipment
t:=:catcode||:costcode||:equipcode;
sandyHello,
Assuming that last 4 digit are serial number and will get increase by one depend on three fields as you mentioned. Then try your code like this...
SELECT :catcode||:costcode||:equipcode||(LPAD(MAX(TO_NUMBER(SUBSTR(actual_field_name,9))+1),4,0))
INTO :form_field_name
FROM table_name
WHERE catcode=:catcode
AND costcode=:costcode
AND equipcode=:equipcode;Or if you don't want to generate code on basis of three field then remove the where clause and use only...
SELECT :catcode||:costcode||:equipcode||(LPAD(MAX(TO_NUMBER(SUBSTR(actual_field_name,9))+1),4,0))
INTO :form_field_name
FROM table_name;
actual_field_name this the name of field for which you will generate code.
-Ammad -
How to generate item codes automatically
Hi,
My customer wants that the inventory item code be generated automatically based on its description. The code should have:
- 3 first characters of the description
- A sequential increased number, to make the code unique.
e.g. the item called "Petrol" should have the code "pet004".
To achieve this, I have created a database procedure. So the user that works in "Item Master" form, will fill out "description" field and the "Item" field should be automatically populated based on the return value of this procedure.
Is there any way how to achieve this through personalization?
Or, is there any standard way that Oracle offers for automatic generation of item codes?
Thank youlHi,
You have to do it using forms personalization.
Thanks,
PS. -
How I can know which row is parent item code or child item in matrix?
Hi,
In marketing document, when insert a item into contents page, if it is a BOM then all child item will be inserted into matrix automatically. My question is when i view the rows in matrix how i can know which row is normal master item and which row is a child item row? From the UI, i can only see the child item code looks readonly but how i can know it in my add-on code? I tried to get the edittext box object from item No. cell, but i can't find any difference.
Thanks!
LanSorry, i found an issue when i try to retrieve the BOM Type column value. I am in adding mode, when i insert a BOM with components, the bom type will appears as "Component of a Sales BOM". But in the event, when I try to get the value from this cell (it is combobox), it gives another value which is not same with the one it appears in the matrix. Is anyone know how to solve my problem?
Thanks!
Lan -
Inventory account not defined in item code
Hi,
Iam trying to add A/p Credit memo from A/P invoice (Copy to method) and changing Unit price of one item (there 8 items) then it gives error of "Inventory account not defined item code" i check all accounts in Item group and Wh also.i also change item gr.of particular item and update it correct item gr.relogin but still problem occurs so pl suggest me solution.
Regards
Sudhir Pawar.HI
If ur using purchasing acc.System method u have to define the accounts for purchase acc., purchase offset acc. then ly it will allow to add. Also check the new item group which u have changed now, check whether all acc.s r there r not in that group.
Also Purchase Return acc.
Giri
Edited by: Giri dharan on Aug 18, 2009 11:15 AM
Maybe you are looking for
-
I am receiving a 102 error when trying to update to iTunes 11.1.0
I am trying to update to iTunes 11.1 and OSX 10.8.5 but continue to receive the following error message: "An error occurred while downloading the updates.(102)" Here is the activity recorded from my Console. Sep 18 14:14:10 kpl-kdileepan.kumc.edu Sof
-
S_ALR_87012357 - Tax report (G/L description)
Hi, Is it possible to add the G/L description in the line item of the tax report (S_ALR_87012357), I see there are some user defined fields available for selection in the line item layout, any idea how to define a new field?? Regards,
-
What has changed my P'E? I have used it for many years and now, all of a sudden, it will not respond and the tools while they show on the photo will to execute.
-
Allow other users to create subfolders in Public w/ correct permissions?
Hi, I have a Public sub-folder called "Shared" which is set with permissions Everyone: Read & Write. Everyone in my workgroup should be able to have full access control to content in this folder. This works great, except when someone else creates a s
-
Programatic way of updating jar files
Is there a programmatic way of updating jar files (efficiently)? What I am looking for is an equivalent of jar -u option available in JDK 1.3. The only way I have right now is to create a new jar file, add the new files into this file and then add th