Application Development 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: 

Sort table in maintenance generator

Former Member
0 Kudos

Hi,

I have an automatically generated table maintenance  generator.

Fields are automatically sorted by key fields. I would like to sort it by a non-key field.

I have tried to modify it through the following options:

  • Environment -> Modification -> Maintenance Screens: I have created an include ...O01 (defined in top include of function group) with a PBO module called SORT_EXTRACT. I tried to sort the EXTRACT table, but I get a syntax error that it is unknown. I can access the EXTRACT table in debug mode as it is a global variable. Any ideas on how to access it? The following code does not work as it is unknown:

GT_TAB[] = EXTRACT[].

SORT GT_TAB BY ORDER.

EXTRACT[] = GT_TAB[].

  • Environment -> Modification -> Events: Event 17 Before printing events Doesn't work either. I have created a form, which is not accessed.

Please advise me how to proceed.


BR,

Matei


1 ACCEPTED SOLUTION

Juwin
Active Contributor
0 Kudos

Please search before posting. Check if this helps you.

Thanks,

Juwin

5 REPLIES 5

Juwin
Active Contributor
0 Kudos

Please search before posting. Check if this helps you.

Thanks,

Juwin

Former Member
0 Kudos

Oh, I did search before posting. And not only searched, but tried for two days different solutions!

One of them is:

PROCESS BEFORE OUTPUT.

  MODULE LISTE_INITIALISIEREN.

MODULE SORT_EXTRACT.

  LOOP AT EXTRACT WITH CONTROL

   TCTRL_/SAPLOM/XMM_CNDV CURSOR NEXTLINE.

    MODULE LISTE_SHOW_LISTE.

  ENDLOOP.


MODULE SORT_EXTRACT OUTPUT.

   DATA gt_itab TYPE TABLE OF /SAPLOM/XMM_COND.

   BREAK i321596.

   gt_itab[] = extract[].

   SORT gt_itab BY ORDR ASCENDING.

   extract[] = gt_itab[] .

ENDMODULE.


Result of this solution in syntax check: "EXACT" expected, not "EXTRACT[]". I cannot access the EXTRACT table... I tried with and without the brackets!

Although, if I comment the rest of the code from the breakpoint onwards, I can access the global variable EXTRACT[] in the debugger, but I cannot pass the syntax check if I uncomment the rest of my lines.


I tried also the option Environment -> Modification -> Events: Event 17, 26, AA... But these events only create a blank include, which is not inserted in the TOP include of the function group of the maintenance view. I added it manually, edited it with the code above, but no luck solving the access to the EXTRACT[] variable 😐

Please help!

Juwin
Active Contributor
0 Kudos

Good. A suggestion: You should have posted this information with your earlier question itself.

I will read through your reply and check if I can help you better.

Thanks,

Juwin

0 Kudos

Hi,

You should create your sort PBO MODULE after the includes below in your maintenance function group master program (not in top inlude).

INCLUDE LxxxxTOP" Global Data

INCLUDE LxxxxUXX" Function Modules


eg. INCLUDE LxxxxO01. (as suggested in popup)


Thanks,

Zafer

Former Member
0 Kudos

Thank you so much! You are a life saver!

That did the trick!

I would reward 100 points if I could!!!