cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Sorting in routine

Former Member
0 Likes
448

Hi all,

I am working on a report in that report i have 6 charactics and 4 key figure.

charactics : material number

demand type,vendor,date.

here requirment is that before displaying data on the BEX client wants to sort the data on the basic of following logic first material number then demand type then date and then vendor . I can do this on BEX but problem is Demand type

Demand type variable contaning following values PO,PR,PL so sorting can not done at BEX leven on character type basic .So i have to write a routine where i have added one more field zsort and assigned the value 1 for PO ,2 for PR and 3 for PL . I am getting all assigned values for Zsort at BEX but as per client's requirement I dun have to show the variable at BEx but shorting has to be done on the basis of this variable only. I wont take this variable neither in dimension nor in keyfigures and will write a routine by taking this variable in my code. Folowing code I had written in R/3 FM to write in routine:

Sort IT by matnr zsort date.

I want to write same code in routine so where and what code I will have to write? Main problem is we don't have any internal table available here so inplace of IT(internal table) what I will have to write that is the main problem for me. Second where the code would be written in start routine or field level routine??

Thanks

Ankit modi

View Entire Topic
yogesh8984
Contributor
0 Likes

Hi Ankit,

Can we do it like this? Take the ZSORT field in the Query Design in BEx, Use sort functionality on it and set this field to NO DISPLAY.

This will ensure the sorting of data for Demand Type and you need not show ZSORT in the final report.

Regards,

Yogesh.

Former Member
0 Likes

Hi

Is it possible at BEx first sorting will be done on material no then zsort then date if is it possible then my problem can be solved .

My question is how prefrences will be difined under bex out of these three variables ????

thanks

Ankit modi.

Former Member
0 Likes

Hi Ankit,

when you design the query you can define what the default sorting procedure will be. Check the properties of each characteristic and adjust the sorting behaviour according to your needs.

For example, for characteristic material you might choose in the properties something like sort characteristic 'Material', sort by 'key' or 'text' and sort direction 'Ascending' or 'Descending'.

The same should hold for the rest of the characteristics.

Best Regards,

Theodoros

yogesh8984
Contributor
0 Likes

Hi Ankit,

To answer your question regarding preferences in sorting, the order in which you place your characteristics in the rows of BEx query, sorting will be done in that order only.

For example, if you enables sorting for YEAR, MONTH and DAY, and you put YEAR as a first row, MONTH as second row and DAY as third row, the records will be sorted first on YEAR, then on MONTH and finally on DAY.

Hope it clears everything.

Regards,

Yogesh.