cancel
Showing results for 
Search instead for 
Did you mean: 

Sorting in sap script

Former Member
0 Kudos

Hi experts,

I am using SAP Script for displaying account statement using standard print program (RFKORD10) triggering  by FBL5N transaction.

In that output i am displaying 6 columns totally

Out of 6 columns , 2 columns logic are displaying using custom print program

for Example :   Invoice number ,  Sales order number , Date, Due date , Branch, Store number

These ( branch and store number ) are displaying using custom print program

right now its displaying correctly all the data

But i need to SORT all the line items column  based on BRANCH column

So is there any way to achieve this logic

Thanks in Advance

Vincent

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

The original post seems garbled.  Are you using a standard print program, or have you developed a custom print program?  Do you mean that you have a standard print program and have customized the SAPScript with PERFORM addition to get two additional columns or ??

At any rate, the answer is you cannot sort in the output form.  So, sort the data in the driver program,  before you start the loop to output the form's main window contents.

If you are using standard print program, try to find an implicit enhancement point where you can insert a sort statement.  If you are using a PERFORM in the form to get the two additional fields, then it is not possible to achieve a sort of the entire form output to sequence the output by the two added fields.

Former Member
0 Kudos

If it is a custom print program why can't you sort in the program itself?!!

And if it is a custom form. You can try a ABAP routine something like this:


/:PERFORM GET_NAME IN PROGRAM Z_include_program
/: CHANGING &ITAB&
/:ENDPERFORM.

Former Member
0 Kudos

It is a standard output and how could you possibly sort in a performed routine  These are called from within a window, usually main?  Careful with the advice....no point in adding confusing misdirection.  The solution is to achieve the sort prior to the loop that drives the window output.

Former Member
0 Kudos

What's wrong with you??!!!

nabheetscn
Active Contributor
0 Kudos

Hi Pratik

The solution which you suggested for of using Perform etc is wrong.  Secondly its already mentioned it is a standard SAP program. So what you have suggested is not misleading this is what he mean.

Hope you get my point.

Thanks

Nabheet

Former Member
0 Kudos

Hi Nabheet,

Thanks for your concerns. But they are misdirected. Vincent clearly said that it had a custom print program in the question itself. First of all I did not give a solution. I was trying to help and asked a question using 'if'. Either my English is poor or else I am expected to give solution everytime. I find no point being blatant over here. Not everyone who asks a question is a rocket scientist here. People are trying to help each other.

I hope you guys got my point of view.

Thanks

Pratik.

Former Member
0 Kudos

Why dont you sort in the custom print program?

Former Member
0 Kudos

hi shambu,

I am using standard print program for displaying output when ever the loop runs from the standard program it 's displaying the output before that itself i need to sort the table

In standard we cant  modify is there any other way to sort the table

nabheetscn
Active Contributor
0 Kudos

Hi Vincent

You can search for any customer exit in the above program. If not found then you can go for an implicit enahancement in the subroutine where the loop starts. At beginning only you can add your statement.

Thanks

Nabheet

former_member585060
Active Contributor
0 Kudos

have you tried with the customer exit RFKORIEX which mentioned in the above post.

former_member585060
Active Contributor
0 Kudos

Hi,

    Check on whether the Customer exit "RFKORIEX  Automatic correspondence" is triggered, see if it might be useful. Check on accessing global values in debugger whether you can get any final table filled is available.

Thanks & Regards

Bala Krishna