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

Putting $ sign before printing the price

Hi Experts,

In my Webdynpro application, the price value is coming from a BAPI. I am diaplaying them in a table

control in a column. I have one requirement where i need to put a "$" before diaplaying them in table.

Can anybody please tell me whether we need to do the code changes in Webdynpro Java or

in ABAP code ?

Thanks.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 19, 2008 at 11:30 AM

    Hi Srini,

    No need to change any thing at ABAP side. You can achieve this by using the calculated attribute.

    Let us suppose the modelAttribute is price.

    1. Create one valueAttribute in the same node where price is there.

    2. Name it as priceCalc.

    3. Change the calculatedAttribute property to true for priceCalc.

    3. Two methods named getXXXPriceCalc() and setXXXPriceCalc() methods will be created automatically in the implementation.

    4. go to the getXXXPriceCalc() method and provide the implementation.

    public String getXXXPriceCalc() (....)

    {

    return "$"+element.getPrice();

    //element represents the current node element. It is one of the argument in getXXXPriceCalc() method.

    }

    5. In the front end bind PriceCalc(value attribute) instead of price(model attribute) attribute.

    Regards,

    VJR.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 19, 2008 at 01:31 AM

    Do not modify the BAPI. If you get numeric values fromn the BAPI like "100", then you can create a calculated context attribute "attr1" and implement its getter method by returning ("$" + <BAPI returned value)

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 19, 2008 at 05:23 AM

    write a method to append $ sign to that attribute...

    you have to traverse on the model node and get have to get that attribute and send that attribute to this method and have to display the return value of that method in the table.

    If you have mapped the model attribute directly to the table column you have to remove that mapping and create new attribute bind this to table column set the return value of the method to this attribute

    Thanks and Regards

    shanto aloor

    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.