SAP for Utilities Discussions
Connect with fellow SAP users to share best practices, troubleshoot challenges, and collaborate on building a sustainable energy future. Join the discussion.
cancel
Showing results for 
Search instead for 
Did you mean: 

Table EABL Question SORT with reading date ADATTATS and ADAT

Former Member
0 Kudos
387

Hi all,

I have selction criteria to qery EABL.

After select ,i have to sort to get latest 10 records from EABL .

I was told if the value of ADATTATS is null ,i should display ADAT .

But to select latest 10 records i have need to sort based upon date field..IF date field is null i will not get sort in proper descending order......

Any suggestions and help ?

display :for a partcular contract account

Current meter reading date 1

previous meter reading date 2

previous meter reading date 3

Is there any other field in this table EABL which could be used for SORT here for this display.

Thanks in advance...

Edited by: Sona on Feb 26, 2008 7:29 PM

1 ACCEPTED SOLUTION

Former Member
0 Kudos
275

There is no other field that you can use, but what you can try doing is to copy ADAT field value to ADATTATS where ADATTATS is blank and then sort it by ADATTATS. You can then display ADATTATS always.

LOOP AT itab WHERE adattats IS INITIAL.

MOVE itab-adat TO itab-adattats.

MODIFY itab.

ENDLOOP.

SORT itab BY adattats.

View solution in original post

9 REPLIES 9

Former Member
0 Kudos
276

There is no other field that you can use, but what you can try doing is to copy ADAT field value to ADATTATS where ADATTATS is blank and then sort it by ADATTATS. You can then display ADATTATS always.

LOOP AT itab WHERE adattats IS INITIAL.

MOVE itab-adat TO itab-adattats.

MODIFY itab.

ENDLOOP.

SORT itab BY adattats.

0 Kudos
275

Thanks for saying theres no other field that could be used...

Former Member
0 Kudos
275

If answered please make sure you close the [other|; threads you opened for this issue.

0 Kudos
275

Thankyou for ur reply.

I used SORT ITAB9 BY ADATTATS ADAT DESCENDING. for sorting.

Adavi,could u suggest if above statement is very correct ?I tested ,looks ok.but need to confirm.

For display,i already had a loop (3 itabs)for calculating diff ,there i' m assigning other value if null.

I'm not only displaying this date , many other values..

0 Kudos
275

I am not sure how, because it will still not give you the kind of sorting you are looking for, unless I misunderstood your requirement.

As an example

ADATTATS ADAT

20070201 20070202

20070122

20070121 20070121

20071201

If I sort it the way you coded, my result will be 1, 3, 4 and 2. But if I look at your requirement, I thought you wanted 4, 1, 3 and 2. You can get 4, 1, 3 and 2 order only if you copy the value of ADAT to ADATTATS where ADATTATS is blank so that your internal table now looks like this

ADATTATS ADAT

20070201 20070202

20070122 20070122

20070121 20070121

20071201 20071201

So now if you sort by ADATTATS, you should have the right order. Of course if I misunderstood your requirement, then this is all wrong.

0 Kudos
275

Yes,

My case is :

ADATTATS

record1 : date1

date2

null

null

record5 : date5

ADAT

record1 : 0

0

date3

date4

record5 : 0

Result is :

date1

date2

date3

date4

date5

I was told only if date is null in ADATTATS i should go for ADAT.(that means only then value will be in ADAT)The majority of the time there will be a date in ADATTATS. If an estimate or manual MR is entered, the date will come from ADAT.

My test table has all null values in ADATTATS ,i hv values only in ADAT in test table.

Another question :

Can we change the data in test tables ?

Testing process to check the billing run ?what r the steps involved ?

0 Kudos
275

In my req ,

I have done some chages in Fm so that somevalues will be loaded in a new table

and im my report pgm i will display those values along with some other data from many tables.

I hv tested the pgm..

Only at each billing cycle that FM will load data to my new table.

How to test that billing run.what r the steps involved ?my FC will do it,i think.i'm not sure..

is it enough to test this FM in se37 providing parameters..FC has TO provide data for that..Am i right?

Because those i checked those existing test tables r empty,

Thanks in advance.

0 Kudos
275

I am sorry, since I did not use the formatting, this forum removed the leading blank space I had in my example. Here is the correct one.


ADATTATS ADAT
20070201 20070202
         20070122
20070121 20070121
         20071201

You can change your internal table entries any way you want to. To change the values you are getting from the DB table, there is not really an option, because your actual meter reading date ADATTATS is updated when you upload meter reading results(EL28) or an estimation is done. Your ADAT is controlled by config, I think. So that is not easy to change at the database level. Your ADATTATS is blank in your system probably because your meter reading results are not uploaded. Ask for the help of your functional team person to upload some meter reading results so that this field is filled in.

0 Kudos
275

Could you tell ur thoughts about this : How to test that billing run.what r the steps involved ?

Only at each billing cycle that FM will load data to my new table.

is it enough to test this FM in se37 providing parameters..

Because those i checked those existing test tables (in FM parameters)r empty,

Also ,suggestions needed on what all should be done in QA Testing?

will functional consultant provide test cases and test data?

Thanks a lot.