2018 Nov 15 6:56 AM
hello,
I need assistance with my ABAP program to compare the range of values in a column and derived the required entry in my output data. I have used attached code to test the comparison.
My requirement is to loop through the amount in column J and compare the value with the amount coming from input table ( column D).
Case 1: the input amount in item 10 is 49 and my result should be line 6 where the amount is 40,100 since 49 is greater than 40
Case 2: the input amount in item 20 is 15. My result should be line 4 since value 15 is less than the next highest value which is 20,100

hello,
I need assistance with my ABAP program to compare the range of values in a column and derived the required entry in my output data. I have used attached code to test the comparison.
My requirement is to loop through the amount in column J and compare the value with the amount coming from input table ( column D).
Case 1: the input amount in item 10 is 49 and my result should be line 6 where the amount is 40,100 since 49 is greater than 40
Case 2: the input amount in item 20 is 15. My result should be line 4 since value 15 is less than the next highest value which is 20,100

2018 Nov 15 7:08 AM
You can change the logic to below:
" amounts that are less than main table
if <result_fields>-amount >= wa_zlookup-amount.
" Checking the best less amount record.
if <result_fields>-field2 < wa_zlookup-amount. " Highest values less than
<result_fields>-field1 = wa_zaxaptcnd-field1.
<result_fields>-field2 = wa_zaxaptcnd-field2.
endif.
endif.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |