Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ABAP Ranges (sort order)

Former Member
0 Likes
2,381

Hi Friends,

I have a requirement to modify a program which uses a submit statement. This submit passes parameters defined in a "ranges" type.

                        "Submit RSNASST00

                                   WITH r_objky IN key"

                        CALL FUNCTION

                             EXPORTING

                                      


This prints the object keys in the internal table just fine just not in the order I need them to be. Even with a pre-sort on this range and appends on equal values (as opposed to low and high values). The IN statement seems to always pass the values to the function in numerical order. Is my thinking on this correct and that  there is no way to pass an internal table (ranges) for the IN statement with a desired sort order.

If this is a case what would anyone suggest  an alternative to achieve passing the values for a submit command in a desired order if possible.

Thanks and Regards,

sifter


1 ACCEPTED SOLUTION
Read only

JackGraus
Active Contributor
0 Likes
1,385

Hi Sifter, not a direct answer, but instead of submitting RSNAST00 you could call function module RV_MESSAGE_PROCESSING_VB. It needs NAST records you first need to select from database and then processes the output for these records in sequence.

Regards Jack

Hi Friends,

I have a requirement to modify a program which uses a submit statement. This submit passes parameters defined in a "ranges" type.

                        "Submit RSNASST00

                                   WITH r_objky IN key"

                        CALL FUNCTION

                             EXPORTING

                                      


This prints the object keys in the internal table just fine just not in the order I need them to be. Even with a pre-sort on this range and appends on equal values (as opposed to low and high values). The IN statement seems to always pass the values to the function in numerical order. Is my thinking on this correct and that  there is no way to pass an internal table (ranges) for the IN statement with a desired sort order.

If this is a case what would anyone suggest  an alternative to achieve passing the values for a submit command in a desired order if possible.

Thanks and Regards,

sifter


3 REPLIES 3
Read only

JackGraus
Active Contributor
0 Likes
1,386

Hi Sifter, not a direct answer, but instead of submitting RSNAST00 you could call function module RV_MESSAGE_PROCESSING_VB. It needs NAST records you first need to select from database and then processes the output for these records in sequence.

Regards Jack

Read only

Former Member
0 Likes
1,385

Hi Jack Graus,

Thanks for the workaround and replying. I was hoping to avoid any major changes to the program. I have not tested this function module, but I can already see one problem. The spool from the submit is actually printed in a background job. I do not know of anyway or could not find any exporting parameters to the FM that would allow this to be printed in a background job. Do you know if this would be possible with the FM. Basically it works like this

1. OPEN JOB

2.     submit rsnast00 with s_kappl eq 'V2'

               with objky IN l_objky

          2a      to sap-spool
                     spool parameters print_parameters
                     without spool dynpro
                    via job w_name number w_number

                    and return.

3. CLOSE JOB

Thanks,

sifter

Read only

JackGraus
Active Contributor
0 Likes
1,385

Hi, that might be solved by using the NEW-PAGE PRINT ON statement:

NEW-PAGE PRINT ON
PARAMETERS print_parameters

Regards Jack