IPC: How to read the Condition Rate(KBETR) in Java checkRequirement method.
Hi Experts,
As part of an IPC development, we need to read the Condition Type Rate (KBETR) in a Requirement Formula. The condition rate is the rate for the current record of the pricing procedure, e.g. Condition Type ZAB1.
I can successfully read the condition rate in a Value formula using this piece of code:
public BigDecimal overwriteConditionValue(IPricingItemUserExit pricingItem,IPricingConditionUserExit pricingCondition) {
BigDecimal ZConditionRate = pricingCondition.getConditionRate().getValue();
In a Value Formula "IPricingConditionUserExit pricingCondition" is a input parameter of the overwriteConditionValue() method. However in a Requirement formula the standard method checkRequirement(IConditionFindingManagerUserExit item, IStep step, IAccess access) does not have any parameter which can give me the rate.
I wrote the following logic in the requirement class, but line 2 is not executed.
1. public boolean checkRequirement(IConditionFindingManagerUserExit item, IStep step, IAccess access) {
2. IPricingConditionUserExit pricingHeader = (IPricingConditionUserExit) item;
3. BigDecimal ZConditionRate = pricingHeader.getConditionRate().getValue();
Please suggest how we can retrieve the condition rate in a requirement formula class using teh standard methods & classes.
Hi,
I have to set the condition rate as percentage in one of my codition value formula routine which i am developing based on java.
I have overwritten the method overwriteConditionValue() in my pricing routine which is 927. My logic is below.
When I open my quotation using crmd_order, condition rate is not being displayed with % for unit condition rate coulmn in my pricing conditions.
If I try to change my quotation for ex: Agrred price: xworke, then 927 formula is called and condition rate is displayed as %.
So condition rate value is displayed perfectly , but when my quotation is in display mode condition rate value is coming as USA, but it should be % irrespective of my quotation is in display mode or change mode. I have attached the two screen shots for quotation display mode and change mode.
Can some body throw insight what is wrong in my pricing routine logic in setting % condition rate rather than USD for the Condition rate value.
public BigDecimal overwriteConditionValue(IPricingItemUserExit pricingItem,
IPricingConditionUserExit pricingCondition) {
BigDecimal condValue = null;
BigDecimal discountValue = null;
try{
BigDecimal xworkg = pricingItem.getSubtotal(PricingCustomizingConstants.ConditionSubtotal.SUBTOTAL_G).getValue();
userexitlogger.writeLogDebug(" 927 formula, Date=["+new Date()+"] , xworkg=["+xworkg+"]");
BigDecimal xworke = pricingItem.getSubtotal(PricingCustomizingConstants.ConditionSubtotal.SUBTOTAL_E).getValue();
userexitlogger.writeLogDebug(" 927 formula, Date=["+new Date()+"], xworke=["+xworke+"]");
pricingCondition.setCalculationType(PricingCustomizingConstants.CalculationType.PERCENTAGE);
if (xworkg.compareTo(PricingTransactiondataConstants.ZERO) != 0) {
condValue = xworkg.subtract(xworke);
pricingCondition.setConditionValue(condValue);
// Calculate percentage with 3-decimal-precision (as does ABAP-Version by multiplying with 100.000 instead of 100)
pricingCondition.setConditionRate(condValue.multiply(PricingTransactiondataConstants.HUNDRED).divide(xworkg,
3, BigDecimal.ROUND_HALF_UP), "%");
pricingCondition.setPricingUnit(new BigDecimal(0), null);
else {
pricingCondition.setConditionRate(PricingTransactiondataConstants.ZERO, "%");
pricingCondition.setPricingUnit(new BigDecimal(0), null);
catch (Exception ex) {
//pricingCondition.setInactive(PricingCustomizingConstants.InactiveFlag.INACTIVE_DUE_TO_ERROR);
userexitlogger.writeLogError("Error Occured in 927 formula, reason code=["+ex.getMessage()+"]");
return null;
//return condValue;
return null;
Thanks
Srikar
Similar Messages
-
How to read the current value of hyperlink java bean in multiple record,
I have used a java bean for a multi-record block item. On When-new form-instance I m using fbean package as follows
FBean.Register_Bean(hHyperlink,1,'oracle.forms.demos.beans.Hyperlink');
FBean.Invoke(hHyperlink,1,'setURL','Abc_Entry');
FBean.Invoke(hHyperlink,1,'setLabel','Abc Document');
FBean.Enable_Event(hHyperlink,1,'actionListener',true);
You can see that I am using the number 1 which is hardcoded,for which I will replace with a incremental loop and remove it. Now when I m using the When-Custom-Item-Event, I want to read the URL for the current instance.
I m using
vcEventData := Fbean.Invoke_Char('CONTROL.HYPERLINK',2,'getURL');
to get the second record value , where in I want to avoid the hardcoded 2 or 1
Thank youI recommend you these forums for your question:
Forums Home » Oracle Technology Network (OTN) » Products » Database » JVM
Java in the Oracle Database
Forums Home » Oracle Technology Network (OTN) » Technologies » Java » Java Server Pages (JSP)
Java Server Pages (JSP)
Forums Home » Oracle Technology Network (OTN) » Technologies » Java
http://forums.oracle.com/forums/index.jsp?cat=24
Joel Pérez -
Condition Rates(KBETR) from Subtotals KZWI2/KZWI6
Hello All
Base : I am implementing Condition Value Formula Routines in VOFM in order to Price Material.
In a Pricing Procedure, they are two step numbers defined that displays the Subtotals( one with field 2 and other with 6).
In a dummy condition type, I want to copy the subTotals and Condition Rates.
For this dummy condition Type, I have implemented the CalType rountine and able to get the Subtotal as follows :
xkwert = komp-kzwi6. (for first dummy condition type)
xkwert = komp-kzwi2. (for 2nd dummy condition type)
But I do not know how to find the Condition Rates associated separately for these subtotals and save it into the dummy conditions types.(both Condition Rates and Subtotal).
Please guide to achive this !
Cheers
RJFound myself!
-
When line item materials are same add the condition rate.
HI!
Im my smartform I am trying to get the unit price for the line items. There are are certain scenerions where my code faisl because the billing doc is prepared with multiple sales order which has several materials eneterd twice or thrice . SO as per my code the net value is getting added up for the identical materials but the condition rate is not adding up so when I do teh calculation to get the unit price it gives me wrong values. Like if theer are 3 materials in the billing doc with net price as 5000 each with eachs condition value for the tax is 500 then my code calucltes teh total for 3 items (identical ) as 150000 which is right but I have to substeract the condition value from this as teh condtion value is a tax and that is alreday included in teh net price so we substarct, hence in this case it should do 15000 - 3*500 but unfortunately it does only 15000 - 500 , I beleive it takes the condition rate only for the last item found and substract that but i need to include all teh three items value so I get correct unit price.
Following is teh code I used. I need to add functionality such that the gs_it_kond_w-kwert gets added up each time the material number is same. so that i get the correct unit price.
loop at is_bil_invoice-it_kond into gs_it_kond_w where
bil_number = wa_it_gen-bil_number and
itm_number = wa_it_gen-itm_number .
if gs_it_kond_w-kntyp = 'D'.
gs_unit_price = ( gs_it_cont-netwr - gs_it_kond_w-kwert ) / gs_it_cont-fkimg.
gs_it_cont-netwr = gs_unit_price * gs_it_cont-fkimg.
is_bil_invoice-hd_gen-bil_netwr = is_bil_invoice-hd_gen-bil_netwr - gs_it_kond_w-kwert .
else.
gs_unit_price = gs_it_cont-netwr / gs_it_cont-fkimg.
is_bil_invoice-hd_gen-bil_netwr = is_bil_invoice-hd_gen-bil_netwr.
endif.
endloop.
endif.
ThanksHi Aarav,
I am not sure how your code behaves but, you can try following ways:
1. To ensure that if material for different line item is same, you can put a join on KONV, VBAK and VBAP as KONV-KNUMV = VBAK-KNUMV and VBAK-VBELN = VBAP-VBELN and KONV-KPOSN = VBAP-POSNR. After this, you can loop through the data extracted, sort it with material number and check for repeated materials and from KONV, you can get condition value and condition type etc.
2. To ensure that you are considering tax deductions each time a certain material is repeating, you can calculate net value at each material using its calculation type (KONV-KRECH) (percentage or fixed value) and condition value (KONV-KBETR or KONV-KWERT) without checking whether it is repeated or not. So, in the end, you will have exact net value and you will not miss any deduction.
Let me know if this helps and also, for any clarifications.
Gouri. -
How to Delete the condition record in CRM
HI,
Can you please help me how to delete the condition record from condition table in CRM.
Please explain the usage of FM CRMXIF_CONDITION_SEL_DELETE with examples.
I have also read the documention of the function module. How to use this FM for custom defined condition table.
(this is the code given in Documentation)
DATA-OBJECT_REPRESENTATION = 'E'
DATA-SEL_OPT-CT_APPLICATION = 'CRM'
DATA-SEL_OPT-OBJECT_TASK = 'D'
DATA-SEL_OPT-RANGE-FIELDNAME = 'PRODUCT_ID'
DATA-SEL_OPT-RANGE-R_SIGN = 'I' (Including)
DATA-SEL_OPT-RANGE-R_OPTION = 'EQ'
DATA-SEL_OPT-RANGE-R_VALUE_LOW = 'PROD_1'
Thanks
ShankarHi Shankar,
I am using the same CRMXIF_CONDITION_SEL_DELETE function module to delete condition record present in CRM.
But it is giving me below error in the return table of the FM after i run the program. Can you please correct me if I am doing any thing wrong?
Error in lt_return: SMW3 CND_MAST_SEL_DEL_EXT_VALIDATE CND_M_SD
code:
ls_range-fieldname = 'PRODUCT_ID''.
ls_range-R_SIGN = 'I'.
ls_range-R_OPTION = 'EQ'.
ls_range-R_VALUE_LOW = '123456'.
APPEND ls_range TO lt_range.
MOVE lt_range TO ls_entry-SEL_OPT-range.
ls_data-SEL_OPT-object_task = 'D'.
ls_data-SEL_OPT-ct_application = 'CRM'.
ls_data-object_representation = 'E'.
CALL FUNCTION 'CRMXIF_CONDITION_SEL_DELETE'
EXPORTING
DATA = ls_date
IMPORTING
RETURN = lt_return
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
IMPORTING
return = lt_ret.
Edited by: Saravanaprasad Nadar on Jul 7, 2010 1:27 AM -
How to make the condition type active
hi,
how to make the condition type active when its in inactive stage and its showing yellow triangle and y in the control features of it.
and
how to solve if is showing a statement as "INITAILISED".
regards,
balajitDear Balaji,
Yes it will come as Inactive mode.....If you make the 2 condition Class is same in single Pricing procedure ,In Standard system will display like this only..
For Example:PR00-Condition class is Price
EX00-Condition class is Price
Then first Condition type will become Inactive.. change the Class of the Second Condition Type.
Best Regards
raj. -
How to fetch the condition value per line item in PO o/p
Dear Experts ,
I need to fetch the value of the all valid condition types in the PO item , for its o/p .
For this i should know
1.what all are the condition types involved in the item .
2.what is the condition rate
3. what is the condition value .
Pleas etell me how do i fetch this data ??
Thanks in advance
Regards
AnisHi Anis,
At first collect the doc.condition-KNUMV from EKKO table.
Later enter the above doc.condition no in KONV and KONP to get the details.
Regards
Ramesh Ch -
How to read the multipart/realted mime type message.
hello, sir
please tell me,
how to read the multipart/realted message.
which are the subpart are included in the "multipart/related" message
i know only "multipart/mixed" and i know how to read ,it contain the subpart ,
1)text / plain
2)text / html
3)multipart/alternative
a)text / plain
but i don't know which are the subpart included in the "multipart/related " please tell me.
thanksToday we rely on Simulink to perform parameterization of your designs in two ways:
Parameterizable Subsystems and Blocks : Parameters themselves can be MATLAB expressions that need to be evaluated for which we need the MATLAB interpreter
The very useful Rate and Type propagation or Simulink compilation that allows us to specify types & rates in one location that gets systematically propagated to all.
To truly make the HDL Netlist that is generated from SysGen parameterizable, we would have to implement some of this capability in the HDL netlist itself by:
Using Generics(VHDL) or Parameters(Verilog) - We would have to capture the bit width(type) propagation through levels of hierarchies and finally parameterize the IP itself based on this value
Since IP itself does not have this capability through generics, we would have to package a separate tcl script that updates the IP parameterization appropriately in response to top level parameters(or GUI parameters)
Interpreting MATLAB expressions and translating them into VHDL/Verilog expressions (alternatively tcl expressions of IP). In simulink, mask parameters can be passed from one level to the next. Also parameterization of a block can be composed of Matlab expressions using variables from ancestor masks & the MATLAB interpreter – so we will need to somehow capture that as well.
-
how to get the Benefits Rate multiplier value in HCM extract ? used Extract rule type Fastfomula, but returns null.
Formula:
DEFAULT FOR BEN_ABR_NAME IS 'NA'
DEFAULT FOR l_rate_multiplier IS 'X'
L_BG_ID = GET_CONTEXT(BUSINESS_GROUP_ID, 1)
L_EFF_DATE = GET_CONTEXT(EFFECTIVE_DATE, to_date('1951/01/01 00:00:00'))
L_ABRT_ID = GET_CONTEXT(ACTY_BASE_RT_ID, 9999)
CHANGE_CONTEXTS(EFFECTIVE_DATE = L_EFF_DATE, BUSINESS_GROUP_ID = L_BG_ID, ACTY_BASE_RT_ID = L_ABRT_ID )
l_rate_multiplier = BEN_ABR_NAME
RETURN l_rate_multiplierI used DBI - BEN_ABR_NAME.
What is back end query ? can we use query to extract the value in Extracts ? -
How to read the content in one node of XML in Java? Pls help
My dear brothers,
I am a newbie of XML, I have a exercise which is creating a Tree View from XML file. But the trouble is I do not know how to read the content in one node of XML file. I decide to use the algorithm as following:
1. Create a GUI form which gives the ability for user to choose a XML file (ok)
2. Load XML and return the file (ok)
3. Read the file from node to node to create the node in Tree View (?!)
Please help me, and if you are enough kind, please give me an small example to easy understand. Thanks in advance.
Hoang Yen BinhI hope this one helps you.
<ABC Type="ProductBased" ProdName="One" Location="India">
<CEO>Raj</CEO>
<Finance>Vikram</Finance>
<HR>Karthik</HR>
<Technical>Satish</Technical>
</ABC>
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Attr;
import org.w3c.dom.NodeList;
import org.w3c.dom.Node;
import org.w3c.dom.DOMException;
import javax.xml.parsers.ParserConfigurationException;
import org.xml.sax.SAXException;
import java.io.File;
import java.io.IOException;
public class XmlReading {
Document doc;
Element element;
public static void main(String[] args) throws Exception{
XmlReading xr = new XmlReading();
xr.getXmlParser(args);
public void getXmlParser(String[] args) {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
if(args.length != 1) {
System.err.println("Argument Required");
try {
DocumentBuilder builder = factory.newDocumentBuilder();
doc = builder.parse(new File(args[0]));
}catch(ParserConfigurationException e1) {
}catch(SAXException e2) {
}catch(IOException e3) {
getAttributes();
public void getAttributes() {
// Retrive the entire Document from the Dom Tree
element = doc.getDocumentElement();
// System.out.println(element);
NamedNodeMap attrs = element.getAttributes();
// Get number of attributes in the element
int numAttrs = attrs.getLength();
// Process each attribute
for (int i=0; i<numAttrs; i++) {
Node node = attrs.item(i);
// Get attribute name and value
String attrName = node.getNodeName();
String attrValue = node.getNodeValue();
System.out.println(attrName + ": " + attrValue);
String s1 = element.getTagName();
System.out.println(s1);
// To get all the elements in a DOM Tree
NodeList nl1 = element.getElementsByTagName("*");
int i2 = nl1.getLength();
System.out.println(i2);
for(int i=0; i<i2; i++) {
System.out.println(nl1.item(i) + "\n");
} -
How to read the data in excel sheet
Dear sir,
How to read the data in excel sheet when i recieve a data serial communication... ie i have store a data in excel such that
Cell A Cell B
A Apple
B Ball
C Cat
D Doll
when i recieve A from serial communication i have to display Apple, and when i recieve B i have to display Ball and so on..Hi,
I would recommend you to have a look at the VI attached. It makes use of a VI named 'Read from Spreadsheet' to read the row and column data from the tab delimited excel file. The read data is then searched for the Alphabet specified and finally returns you the corresponding string. The test file used to validate the operation of the VI is also attached.
Trust this would help you solve the issue.
Regards,
Sagar G Yadav | Application Engineer | National Instruments
Attachments:
read_from_excel.vi 10 KB
Book1.txt 1 KB -
How to read the file from a folder.
Hi All,
How to read the file from a folder or directory from the non sap server / remote server.
Regards
Sathisopen dataset filename for input in text mode
encoding default.
filename is character type variable with the destination filename.
Edited by: Jino Augustine on Apr 19, 2010 1:31 PM -
How to update the condition price in the sales order for all the items
Hi,
How to update the condition price for all the itmes in the sales order to carry out the new price automatically through a stand alone program, for all the orders in the billing due list table?
Thanks,
BalaramHi,
There is a change in the requirement.
Scenario:
I have created a sales order with some 4 condition types, in that 2 condition types are of class A & B and the other two is of class C. Here I need to update the condition price of class A & B only and the remaining condition types should not get update even though there is an updated price is available.
For the above scenario, I need to write a standalone program. Do we have any function modules to update the price of the single condition in the sales order? Please tell me how we can update the sales order at item condition level.
Thanks.
Balaram -
How to update the condition price in sales order while creating the invoice
Hi,
How to update the condition price in the sales order to carry out the new price while creating the invoice?
While creating the invoice it should update the condition price in sales order.
Thanks,
BalaramNo, pricing is not there in delivery.
I found an exit for VF01transaction where we can update the price in order.
Can you please tell me how to update the price if I have the order, material numbers and conditions number?
Thanks,
Balaram -
How to read the check box value in alv report
hi experts,
i m working on one alv report where i m using the check box for field selection in alv display.
but i don't know how to read the only selected fields.
wa_fieldcat-fieldname = 'BOX'.
wa_fieldcat-tabname = 'IT_HEADER'.
wa_fieldcat-seltext_m = 'Box'.
wa_fieldcat-checkbox = 'X'.
wa_fieldcat-input = 'X'.
wa_fieldcat-edit = 'X'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'AUFNR'.
wa_fieldcat-tabname = 'IT_HEADER'.
wa_fieldcat-seltext_m = 'Sales Doc'.
wa_fieldcat-hotspot = 'X'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
i_callback_top_of_page = 'TOP_OF_PAGE'
it_fieldcat = i_fieldcat[]
i_save = 'A'
it_events = v_events
TABLES
t_outtab = it_header
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
*& Form USER_COMMAND
text
-->R_UCOMM text
-->, text
-->RS_SLEFIELDtext
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
when '&RELEAS'.
endcase
endform.
i gone through some already posted que for same problem i tried options like
loop at it_header.
endloop.
but i m getting box field empty.
is there i missed something? plz sugeest.. if u have any other solution plz post...Have this code in your user command fm:
* For capturing changed data
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = w_grid.
CALL METHOD w_grid->check_changed_data
IMPORTING
e_valid = w_valid.
IF w_valid = 'X'.
loop at itab where mark = 'X'.
endloop.
ENDIF.
Regards,
Ravi
Maybe you are looking for
-
Custom Report for Asset Intelligence including Collection selection
Dear all, I'm struggling with an custom report for doing the following thing. I have labeled software with the custom label 3 in the Asset Intelligence. I like to create a Report where i can Choose my Collection and then the Label that should be disp
-
(1) My iBooks Author help resources are in a foreign language. How do I change it to English? (2) Is there an iBooks Author pdf manual I can download?
-
How to configure payment terms thru cheque
hi, good mrng sap gurus, how to configure payment transactions/terms in the form of cheque. plz throw some light on this. regards, balaji.t 09990019711
-
Finder has colors all messed up.
My problem is that when I log into the administrator account on my Aluminum iMac, all of the colors are messed up, and the screens looks like it was drawn from a comic book. This only affects the administrator account, when I log into the other accou
-
Hi, there was 2 things that I had to ignore during installing for being able to install and now my Iphone cannot be connected to my computer with Itune ???