Adding two wage types in Webdypro for ABAP
I am new to webdynpro for ABAP.I have declared two attributes under two different nodes.
1.BASICAMOUNT is declared of type PA0008-BET01 under node LTA.
2.FIXEDAMOUNT is a constant of type T511K-KWERT under node FIXEDAMT.
3.I have another attribute TOTALAMOUNT of type Float under node LTA.
My requirement is to sum the BASICAMOUNT and FIXEDAMOUNT and I have to map the result to the attribute TOTALAMOUNT.All these attributes I am trying to display in a single screen as a text view.I am able to fetch and display the BASICAMOUNT and FIXEDAMOUNT.
Please help me in adding these two attributes and guide me to map the result to the attribute TOTALAMOUNT.
Karthiheyan Murugesan replied
"I am able display these values also on the screen.I am facing problem in reading these values."
If you are able to display value (but facing issue in reading) I guess you just binded the textviews to basic and fixed amount attributes.
After the select query you will have list of basicamount and fixedamount data in lt_lta and lt_fixed respectively. Then i believe you have binded the internal tables to node.(Check whether your internal tables are filled or not)
Calculating total amount can be done by looping a internal table (basicamount or fixed amount) and assigning a workarea to ls_lta ,then inside the loop add basicamount and fixedamount and assign to lv_fixed. Perform the logic you require to calculate the totalamount.
Irrespective of the UI element(Textview or Inputfield) the logic behind works.
Eventhough you have a table attached in the node, if you have binded a textview to the attribute in node,it wil display just single value (which is a lead selected one).
Try to learn about the architecture of Webdynpro.
Have a look Web Dynpro for ABAP: Tutorials for Beginners
If you still face issues,Kindly revert back with exact information on what you did and about the error you encountered?.