2012 Oct 23 10:35 AM
Hi Experts,
I am displaying purchase order in sort order in ALV.
when displaying in the output it is not displaying in the sort order.
This is causing issue when double clicking the purchase order to interactive list.
when i click on the first purchae order, it is displaying in the whatever there in the internal table first.
what is the cause for the problem? how i can display the output according to internal table sort order in ALV display.
Regards,
udupi
2012 Oct 23 12:03 PM
Dear Udupi,
Can you post your code:
Are you using cl_gui_alv_grid or something else ?
Dear Udupi,
Can you post your code:
Are you using cl_gui_alv_grid or something else ?
2012 Oct 23 11:24 AM
Dear Udupi,
Check the internal table which you have passed to the ALV Function module, that Internal table must be sorted and that too based on the PO number i think EBELN.
SORT ITAB by EBELN.
And for displaying the PO in ME23n you need to go for the SET PARAMETER ID using Sy-ucomm .
Regards
Dinesh
2012 Oct 23 11:47 AM
internal table is sorted both EBELN and EBELP.
But when dispplaying the layout in is not displaying in the sorted order.
and when user double click on the purchase order number , it is displaying in the order of the internal table.
2012 Oct 23 11:53 AM
Check the fieldcatalog definition where you have declared the field EBELN and the associated Table as well as the reference field in the fieldcatalog.
If everything works fine.
Then just put a break-point before the CALL FUNCTION REUSE_ALV_GRID is called as well as check the sy-ucomm and the sy-repid.
2012 Oct 23 12:03 PM
Dear Udupi,
Can you post your code:
Are you using cl_gui_alv_grid or something else ?
2012 Oct 23 12:26 PM
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
EXPORTING
i_callback_program = l_repid
is_layout_lvc = ls_layout
it_fieldcat_lvc = lt_fcat
i_save = 'A'
it_sort_lvc = t_sort
i_grid_settings = ls_glay
is_variant = ls_variant
it_events = lt_events
it_event_exit = lt_event_exit
i_screen_start_column = im_screen_start_column
i_screen_start_line = im_screen_start_line
i_screen_end_column = im_screen_end_column
i_screen_end_line = im_screen_end_line
IMPORTING
e_exit_caused_by_caller = l_exit_by_caller
es_exit_caused_by_user = ls_exit_caused_by_user
TABLES
*Begin of Modification by SREDDY on 19/OCT/2010 - SAP-6910.
* t_outtab = <table>
t_outtab = it_main
2012 Oct 23 1:01 PM
Can you show us please the code that is activate when you click on the purchae order
2012 Oct 23 1:24 PM
Have a look at program ERPSLS_CUSTOMERS.
Note the the use of formUSER_COMMAND
2012 Oct 23 1:45 PM
FORM alv_user_command CHANGING ch_ucomm TYPE sy-ucomm
ch_selfield TYPE slis_selfield.
CHECK NOT gf_controller IS INITIAL.
CALL METHOD gf_controller->handle_user_command
CHANGING
ch_ucomm = ch_ucomm
ch_selfield = ch_selfield.
l_ehp4_active = cl_ops_switch_check=>mm_sfws_p2pse( ).
lo_const = cl_mmpur_constants=>get_instance( ).
IF i_ebeln IS INITIAL AND i_data_from_buffer IS INITIAL.
MESSAGE e015(mepo) RAISING invalid_call.
ENDIF.
IF i_bstyp IS INITIAL OR (
i_bstyp EQ lo_const->bstyp_k AND l_ehp4_active EQ lo_const->yes ).
CALL FUNCTION 'ME_EKKO_SINGLE_READ'
EXPORTING
pi_ebeln = i_ebeln
IMPORTING
po_ekko = l_ekko
EXCEPTIONS
IF l_skip NE space.
CALL TRANSACTION l_t
ELSE.
CALL TRANSACTION l_t
ENDIF.
ELSE.
2012 Oct 23 1:51 PM
FORM alv_user_command CHANGING ch_ucomm TYPE sy-ucomm
ch_selfield TYPE slis_selfield."#EC CALLE
CHECK NOT gf_controller IS INITIAL.
CALL METHOD gf_controller->handle_user_command
CHANGING
ch_ucomm = ch_ucomm
ch_selfield = ch_selfield.
l_ehp4_active = cl_ops_switch_check=>mm_sfws_p2pse( ).
lo_const = cl_mmpur_constants=>get_instance( ).
IF i_ebeln IS INITIAL AND i_data_from_buffer IS INITIAL.
MESSAGE e015(mepo) RAISING invalid_call.
ENDIF.
IF i_bstyp IS INITIAL OR (
i_bstyp EQ lo_const->bstyp_k AND l_ehp4_active EQ lo_const->yes ).
CALL FUNCTION 'ME_EKKO_SINGLE_READ'
EXPORTING
pi_ebeln = i_ebeln
IMPORTING
po_ekko = l_ekko
EXCEPTIONS
isplay transaction
IF l_skip NE space.
CALL TRANSACTION l_tcode AND SKIP FIRST SCREEN.
ELSE.
CALL TRANSACTION l_tcode.
ENDIF.
2012 Oct 23 1:57 PM
I am sorry but I am not familiar with this coding technic.
Now days we are using cl_gui_alv_grid and hotspots. it is much easier
then REUSE_ALV_GRID_DISPLAY .
2012 Oct 23 2:04 PM
Hello Udupi,
If you are not able display in sort order of PO number and item in ALV. That means I believe some where your sorting is getting overwritten by some other sort/code. Pls check that in debugging and wt are the values your passing for parameter t_sort to FM Reuse... This parameter will have effect on sort of final display of output.
I think if you sort out the first issue, then second issue will be resolved. If still problem exists for second after one sorting out first issue. Pls check the wt are the values are passing to parameter ch_selfield while calling form alv_user_command in debugging.
Pls let me know if you need any more help.
Shravan
2012 Oct 23 2:17 PM
Hi Sharvan,
Thanks for your reply.
In debugging mode, i deleted sort internal table, than also i am geting same output.
2012 Oct 23 2:19 PM
Hi Sharvan,
Thanks for your reply.
In debugging mode, i deleted sort internal table, than also i am geting same output.
2012 Oct 23 2:22 PM
Hi
I've checked your code, but it's not clear where you get the PO number (variable I_EBELN): I can't see in your form alv_user_command.
Max
2012 Oct 23 2:31 PM
Program not using AT USER_COMMAND. program populating events USER_COMMAND in the it_event in the internal table.
2012 Oct 23 2:58 PM
Hi Udupi,
Pls comment the below line of code in FM Reuse_alv...instead of deleting sort table in debugging mode.
it_sort_lvc = t_sort
Before calling this FM, sort the internal table it_main with ebeln and ebelp and let me know how it goes.
Shravan
2012 Oct 23 3:02 PM
2012 Oct 23 7:34 PM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |