2010 Jun 04 11:12 AM
Hi all,
In my ALV Report, value are repeating for all document number.
for ex. there are 10 document No's in my Report, when I execute my Report, all amount are coming same. The amount which I have entered for First Document, the same value is coming for rest of the documents.
How I can get the exact value for every particular document.
Thanks
Devinder.
2010 Jun 04 12:46 PM
Hi Devinder,
Looks like the issue is in populating the Final internal table which you are passing to the ALV.
You would have retrieved all the data from different tables into many internal tables. Then you would be looping over the main internal table to Append a final internal table.
Check the logic over there... are you reading the same record again & appending it in final internal table ??
Thanks,
Best regards,
Prashant
Hi all,
In my ALV Report, value are repeating for all document number.
for ex. there are 10 document No's in my Report, when I execute my Report, all amount are coming same. The amount which I have entered for First Document, the same value is coming for rest of the documents.
How I can get the exact value for every particular document.
Thanks
Devinder.
2010 Jun 04 11:15 AM
Check if you have cleared the workarea from where that value is captured in the loop.
2010 Jun 04 11:27 AM
Hi,
IF I clear workarea, either all values become "0" or only First row will come with correct values, rest of others will come '0'.
Thanks
Devinder
2010 Jun 04 11:33 AM
Hi,
In debugging mode, check the final internal table values before ALV display.
Regards
Vinod
2010 Jun 04 11:34 AM
2010 Jun 04 12:42 PM
Hi Vinod,
My final table is itab1... and I have noticed while debugging , first values is only coming for another documents. that means.. the values which is coming for Document No. 1, the same values are repeating for another Document No. also..
Thanks
Devinder
2010 Jun 04 12:46 PM
Hi,
Check the logic used for populating the final internal table. As mentioned by Gautham, the problem might be related to
Clearing of Work area before inserting the record into internal table.
Regards
Vinod
2010 Jun 04 12:49 PM
Hi Sai,
Code is given below :
*clear wa_bseg.
LOOP AT ITAB_BSEG INTO WA_BSEG.
clear wa_bseg.
CASE WA_BSEG-KTOSL.
WHEN 'KBS'.
WA-DMBTR1 = WA_BSEG-DMBTR.
WHEN 'JSS'.
WA-DMBTR2 = WA_BSEG-DMBTR.
WHEN 'JSE'.
WA-DMBTR3 = WA_BSEG-DMBTR.
WHEN 'JSH'.
WA-DMBTR4 = WA_BSEG-DMBTR.
ENDCASE.
*clear wa_bseg.
ENDLOOP.
WA-DMBTR = "ABS( WA-WT_QSSHH ) +
ABS( WA-WT_QSFHH ) +
ABS( WA-J_1ISURAMT ) +
ABS( WA-WT_QBSHH ) +
ABS( WA-DMBTR1 ) +
ABS( WA-DMBTR2 ) +
ABS( WA-DMBTR3 ) +
ABS( WA-DMBTR4 ).
*clear wa_bseg.
MODIFY ITAB1 FROM WA .
2010 Jun 04 12:53 PM
Hi,
It seems final internal table is populated after the LOOP. Do you need only one record in the output ? As per the code, only last record of itab_bseg is populated to final internal table.
Regards
Vinod
2010 Jun 04 1:24 PM
2010 Jun 04 1:40 PM
Hi,
Check your code, you are clearing the WA_BSEG values at first it self.
LOOP AT ITAB_BSEG INTO WA_BSEG.
* clear wa_bseg. " Comment it here, you are clearing the workarea value before processing
CASE WA_BSEG-KTOSL.
WHEN 'KBS'.
WA-DMBTR1 = WA_BSEG-DMBTR.
WHEN 'JSS'.
WA-DMBTR2 = WA_BSEG-DMBTR.
WHEN 'JSE'.
WA-DMBTR3 = WA_BSEG-DMBTR.
WHEN 'JSH'.
WA-DMBTR4 = WA_BSEG-DMBTR.
ENDCASE.
WA-DMBTR = "ABS( WA-WT_QSSHH ) +
ABS( WA-WT_QSFHH ) +
ABS( WA-J_1ISURAMT ) +
ABS( WA-WT_QBSHH ) +
ABS( WA-DMBTR1 ) +
ABS( WA-DMBTR2 ) +
ABS( WA-DMBTR3 ) +
ABS( WA-DMBTR4 ).
MODIFY ITAB1 FROM WA . " or APPEND wa TO itab1.
CLEAR : wa_bseg, WA.
ENDLOOP.Regards
Bala Krishna
2010 Jun 04 12:46 PM
Hi Devinder,
Looks like the issue is in populating the Final internal table which you are passing to the ALV.
You would have retrieved all the data from different tables into many internal tables. Then you would be looping over the main internal table to Append a final internal table.
Check the logic over there... are you reading the same record again & appending it in final internal table ??
Thanks,
Best regards,
Prashant
2010 Jun 04 2:07 PM
Hi
Add the additions 'INDEX' and 'TRANSPORTING...' in ur MODIFY statement.
Regards
Senthil