2013 Nov 26 4:13 AM
I created a simple report extracting order details and when I click on any row it should select the row if and display the order item details. However on click of the first ALV item it displays 'cx_sy_dyn_call_illegal_form' dump. Could you share your thoughts.
I checked the form name multiple times and I see no issue with it.
Code:
*&---------------------------------------------------------------------*
*& Form GET_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM get_data .
SELECT * FROM ekko INTO TABLE it_ekko UP TO 15 ROWS WHERE bstyp = p_bstyp.
ENDFORM. " GET_DATA
*&---------------------------------------------------------------------*
*& Form DISPLAY_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM display_data .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-cprog
I_CALLBACK_USER_COMMAND = 'validateinput'
I_CALLBACK_TOP_OF_PAGE = 'print_heading'
i_structure_name = 'ekko'
IT_EVENTS = IT_EVENT
TABLES
t_outtab = it_ekko
EXCEPTIONS
program_error = 1
OTHERS = 2
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
ENDFORM. " DISPLAY_DATA
*&---------------------------------------------------------------------*
*& Form FILL_EVENT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM fill_event .
CLEAR wa_event.
wa_event-name = 'TOP_OF_PAGE'.
wa_event-form = 'print_heading'.
APPEND wa_event TO it_event.
CLEAR wa_event.
wa_event-name = 'USER_COMMAND'.
wa_event-form = 'validateinput'.
APPEND wa_event TO it_event.
ENDFORM. " FILL_EVENT
*&---------------------------------------------------------------------*
*& Form print_heading
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM print_heading.
clear wa_header.
wa_header-typ = 'H'.
wa_header-info = 'Purchase Orders List'.
append wa_header to it_header.
*DATA IT_LIST_COMMENTARY TYPE SLIS_T_LISTHEADER.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_header
I_LOGO = 'NAV'
* I_END_OF_LIST_GRID = I_END_OF_LIST_GRID
* I_ALV_FORM = I_ALV_FORM
.
ENDFORM. "print_heading
form validateinput using ucomm type sy-ucomm sel type slis_selfield.
case ucomm.
when '&IC1'.
read table it_ekko into wa_ekko index sel-tabindex.
select * from ekpo into table it_ekpo where ebeln = wa_ekko-ebeln.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-cprog
I_CALLBACK_USER_COMMAND = 'validateinput'
I_CALLBACK_TOP_OF_PAGE = 'print_heading'
i_structure_name = 'ekpo'
TABLES
t_outtab = it_ekpo
EXCEPTIONS
program_error = 1
OTHERS = 2
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
ENDCASE.
ENDFORM.
2013 Nov 26 4:22 AM
Hi Naveed,
While populating your event table, pass the form name in Upper Case.
wa_event-name = 'USER_COMMAND'.
wa_event-form = 'VALIDATEINPUT'.
Try this...hope it helps!!
Regards,
Sumit
2013 Nov 26 4:22 AM
Hi Naveed,
While populating your event table, pass the form name in Upper Case.
wa_event-name = 'USER_COMMAND'.
wa_event-form = 'VALIDATEINPUT'.
Try this...hope it helps!!
Regards,
Sumit
2013 Nov 26 4:37 AM
Hi Naveed,
Do as Sumit suggests and also use upper case in the "display" FM:
DATA lv_program TYPE syrepid VALUE sy-repid.
"providing your callback subroutines are in the same program
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = lv_program
i_callback_user_command = 'VALIDATEINPUT'
i_callback_top_of_page = 'USER_COMMAND'
i_structure_name = 'EKPO'
TABLES
t_outtab = it_ekpo
EXCEPTIONS
program_error = 1
OTHERS = 2.
2013 Nov 26 4:43 AM
I_CALLBACK_USER_COMMAND = 'validateinput' * Wrong
Write like this :
I_CALLBACK_USER_COMMAND = 'VALIDATEINPUT'
2013 Nov 26 4:47 AM
Hii Naveed,
You can do one thing instead of selecting any row , you just select the EBELN and after clicking display the item details.So one little changes in your vaildateinput form like below,
form validateinput using ucomm type sy-ucomm sel type slis_selfield.
case ucomm.
when '&IC1'.
IF sel-fieldname = 'EBELN'.
read table it_ekko into wa_ekko index sel-tabindex.
select * from ekpo into table it_ekpo where ebeln = wa_ekko-ebeln.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-cprog
I_CALLBACK_USER_COMMAND = 'VALIDATEINPUT'
I_CALLBACK_TOP_OF_PAGE = 'PRINT_HEADING'
i_structure_name = 'ekpo'
TABLES
t_outtab = it_ekpo
EXCEPTIONS
program_error = 1
OTHERS = 2
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
ENDIF.
ENDCASE.
ENDFORM.
Just try with this and hope will solve your issue.
regards
Syed
2013 Nov 26 4:48 AM
Simple but irritating issue lol . Its resolved now.
Thanks everyone...
2013 Nov 26 5:07 AM
Hi,
I have done the same report once and it works fine for me.
I have attached a file containing the code.
Hope this helps.
Regards
2013 Nov 26 5:32 AM