on 08-05-2009 7:25 AM
Hi all.
I am basically an ABAP developer. My recent assignment needs some java coding.
It will be very helpful if we anybody helps me in finding the corresponding pricing fields in java.
The abap code is as follows
check : xkomv - kgrpe = ' '.
check: xkomv - xkbetr ne 0.
check : komp - kpein ne 0.
if komp - netwr < 0.
komp - netpr = 0 - komp - netpr.
endif.
xkwert = ( ( ( komp - netpr * ( 100000 + xkomv - xkbetr)) / 100000)
komp-mglme / komp-kumza * komp - kumne / 1000 / komp - kpein )
- komp-netwr.
Please help in converting this abap code to its corresponding java code.
Thanks and Regards
Deepika
hi deepika,
in abap check is simillar to the if-edif or nested if in java
look this thread for abap
http://help.sap.com/saphelp_nw04/helpdata/EN/9f/db9afe35c111d1829f0000e829fbfe/content.htm
mean whle i wll send the java code for this
ravindra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is the code I have developed: Please check and let me know if there are any changes
import java.math.BigDecimal;
import com.sap.spe.pricing.customizing.PricingCustomizingConstants;
import com.sap.spe.pricing.transactiondata.PricingTransactiondataConstants;
import com.sap.spe.pricing.transactiondata.userexit.IPricingConditionUserExit;
import com.sap.spe.pricing.transactiondata.userexit.IPricingItemUserExit;
import com.sap.spe.pricing.transactiondata.userexit.ValueFormulaAdapter;
public class ZS2S_IPC_ZDCP extends ValueFormulaAdapter {
public BigDecimal overwriteConditionValue(
IPricingItemUserExit item,
IPricingConditionUserExit condition) {
BigDecimal kompKumza = new BigDecimal(String.valueOf(condition.getFraction().getNumerator()));
BigDecimal kompKumne = new BigDecimal(String.valueOf(condition.getFraction().getDenominator()));
boolean xkomvKgrpe = condition.isGroupCondition();
BigDecimal kompKpein = condition.getPricingUnit().getValue();
BigDecimal kompNetwr = item.getNetValue().getValue();
BigDecimal kompNetpr = item.getNetPrice().getValue();
BigDecimal xkomvKbetr = condition.getConditionRate().getValue();
BigDecimal kompMglme = item.getBaseQuantity().getValue();
if ( xkomvKgrpe = true )
return PricingTransactiondataConstants.ZERO;
if ( kompKumza != PricingTransactiondataConstants.ZERO )
return PricingTransactiondataConstants.ZERO;
if ( kompKumne != PricingTransactiondataConstants.ZERO )
return PricingTransactiondataConstants.ZERO;
if ( kompKpein != PricingTransactiondataConstants.ZERO )
return PricingTransactiondataConstants.ZERO;
if (kompNetwr.compareTo(PricingTransactiondataConstants.ZERO) < 0 )
kompNetpr = (PricingTransactiondataConstants.ZERO).subtract(kompNetwr);
BigDecimal y = new BigDecimal("100000");
BigDecimal a = y.add(xkomvKbetr);
BigDecimal temp = kompNetpr.multiply(a);
BigDecimal result1 = temp.divide(y, 2, BigDecimal.ROUND_HALF_UP);
BigDecimal result2 = result1.multiply(kompMglme)
.divide(kompKumza, 2 BigDecimal.ROUND_HALF_UP).multiply(kompKumne).divide(kompKpein, 2, BigDecimal.ROUND_HALF_UP);
BigDecimal Result = result2.subtract(kompNetwr);
return Result;
}
}
Edited by: Deepika Mallya on Aug 6, 2009 9:08 AM
hi deepika,
refer this document or read this
http://www.fdc.co.il/tips/88_20090116151515.pdf
mean while i wll send the details answer for u r query
ravindra
Edited by: VENKATA R BOLLAPALL on Aug 6, 2009 12:45 PM
Hi deepika,
Java code
int xkomv - kgrpe =' ';
int xkomv - xkbetr =0;
int koma - kpein = 0;
if(komp - netwr < 0)
{
komp - netpr = 0 - komp - netpr;
}
int xkwert = (((komp - netpr * (100000 + xkomv - xkbetr)) / 100000) * komp - mglme / komp - kumza * komp - kumne / 1000 / komp - kpein) - komp - netwr.
System.out.println(xlwert) // printing purpose just like write statement in abap.
Regards,
Sunaina Reddy T
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.