2013 Dec 26 6:20 AM
2013 Dec 26 6:26 AM
2013 Dec 26 6:26 AM
Hi Richa,
I am not clear with this.
if amount is less than 110 then add 25.
if amount is greater than 110 dont change.
is this correct ?
and what if the amount is exactly 110 ?
please clarify.
Regards,
Bhaskar
2013 Dec 26 6:26 AM
Hello Richa.
Guess the calculated values from header are not passed on to internal table's body.
You have to use MODIFY statement to pass internal table HEADER data to its BODY.
For instance,
MODIFY GIT_HFINAL TRANSPORTING DMBTR1.
Regards.
2013 Dec 26 6:30 AM
2013 Dec 26 6:36 AM
Dear All,
Thanks for the Response.
Please check my code
GIT_HFINAL-DMBTR1 = GIT_HFINAL-HPPC3.
if
GIT_HFINAL-DMBTR1 < 110. " Less then 110 then add 25 Rupess.
GIT_HFINAL-DMBTR1 = GIT_HFINAL-DMBTR1 + dmbtr14.
else.
GIT_HFINAL-DMBTR1 = GIT_HFINAL-HPPC3.
endif.
GIT_HFINAL-DMBTR2 = GIT_HFINAL-HPPC3 .
LV_RATE = GIT_HFINAL-DMBTR2 * '0.25' .
GIT_HFINAL-DMBTR2 = GIT_HFINAL-DMBTR2 + LV_RATE + 4.
GIT_HFINAL-DMBTR4 = ( ( GIT_HFINAL-DMBTR2 ) * '9.08' ) / 100 .
GIT_HFINAL-DMBTR3 = GIT_HFINAL-DMBTR4 + GIT_HFINAL-DMBTR2.
GIT_HFINAL-DMBTR3 = ( ( GIT_HFINAL-DMBTR3 ) * '4.15' ) / 100..
GIT_HFINAL-DMBTR5 = GIT_HFINAL-DMBTR2 + GIT_HFINAL-DMBTR4 + GIT_HFINAL-DMBTR3 .
GIT_HFINAL-DMBTR5 = CEIL( GIT_HFINAL-DMBTR5 ).
GIT_HFINAL-PRICE = ( ( GIT_HFINAL-DMBTR5 ) * '8' ) / 100 .
GIT_HFINAL-PRICE1 = ( ( GIT_HFINAL-DMBTR5 ) * '4' ) / 100.
We have declare two condition 1: is if less then 110 then add 25 Rupees.
2: if grate then 110 then work GIT_HFINAL-DMBTR2 condition.
2013 Dec 26 6:39 AM
Yoour loop is on which tables..GIT_HFINAL if yes where are you modifying it with the values calculated before end of loop?
How are you displaying data ALV/Classical?
Nabheet
2013 Dec 26 6:32 AM
Hi Richa,
Either you are not appending the values into table or overwriting the same variable in the loop or somewhere after this code.
It will be better if you post complete code.
Thanks & Regards,
-Vijay
2013 Dec 26 6:43 AM
Hi,
I hope you got the answer. You just need to use modify statement. Modify the internal table using work area.
Regards
2013 Dec 26 6:54 AM
Dear Richa,
As the gurus already have explained, when you loop an internal table into work area only the entries from internal table are copied into work area, any change in the work area will not get updated in the internal table automatically. There are 2 ways to do that,
Considering that you have already finished a bigger chunk of coding, in my opinion the easier way to do that will be using modify table statement.
Please find the help on using the modify statement at:
https://help.sap.com/saphelp_45b/helpdata/en/34/8e72f96df74873e10000009b38f9b8/content.htm
Best Regards,
Imran
2013 Dec 26 8:05 AM
Hi Richa,
How you are displaying the report! If it working in debugging and not working in dispaly. check the below things.
- your local variables
- How you are passing the calculated values to internal table or modifying the table
- displaying the value in the final output