Skip to Content
author's profile photo Former Member
Former Member

HELP NEEDED IN IPC JAVA USER EXIT

Hi Experts,

We are replicating the ECC pricing routines in CRM through IPC JAVA coding. There is a particular routine which states some code like(as stated under). This routine is however similar to a standard routine RV64A036. Our concerned ABAP code looks like -

loop at xvbapu where uepos = xkomv-kposn.
loop at tkomv assigning <fs_tkomv>
where mandt = sy-mandt
and knumv = xkomv-knumv
and kposn = xvbapu-posnr
and kschl = 'R100'.
arbfeld = arbfeld + <fs_tkomv>-kawrt."100% discount which is the same as sub item net value
endloop.
if sy-subrc ne 0.
assign (lv_xkomv) to <fs_xkomv>.
if <fs_xkomv> is assigned.
loop at <fs_xkomv> into ls_komv.
if ls_komv-mandt = sy-mandt
and ls_komv-knumv = xkomv-knumv
and ls_komv-kposn = xvbapu-posnr
and ls_komv-kschl = 'R100'.
arbfeld = arbfeld + ls_komv-kawrt."100% discount which is the same as sub item net value
endif.
endloop.
endif.
endif.
endloop.

I have tried to convert the routine into corresponding JAVA but am not sure if I am moving in right direction. I would really appreciate if experts over here help me convert the same into JAVA. The java code I have written looks like :

public BigDecimal overwriteConditionValue(IPricingItemUserExit pricingItem,

IPricingConditionUserExit pricingCondition)

{

BigDecimal accumulatedNetValue = PricingTransactiondataConstants.ZERO;

IPricingItemUserExit[] prItems = pricingItem.getSubPricingItemsUserExitRecursive();

------- ----- - ----- ---- --- - ------ - --- --- -- ----- ------ --- ---- ---- - ------- - ------- - --

---- ------- ------- --- - --- ---- --- ------Some code here --- - -- --- -- - - --- - -- - --

- -- ------ ----- - ---------- ------- -- ------- ------ ------- - -- ----- ------ -- ---- -- --- ----

for (int i = 0; i < prItems.length; i++)

{

IPricingCondition condition =

((IPricingCondition)prItems[i].findPricingCondition

(pricingCondition.getStepNumber(),pricingCondition.getCounter()));

if(condition != null && condition.getConditionTypeName().equals("R100"))

{

accumulatedNetValue = accumulatedNetValue.add(condition.getConditionBase().getValue());

}

}

}

Any helps in this regard willbe really appreciated and rewarded..!

Regards,

Mayank

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 21, 2012 at 11:02 AM

    Hi All,

    I tested the above piece of code and it worked for me.. Marking it as answer for the benifit of others as well if they have similar requirement

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.