2018 Jul 25 8:30 AM
Hello Community,
I am trying to adapt the program SAPRDEMO_PIVOTINTERFACE in order to create a dynamic pivot table (in embed sheet) with data from a database table.
When I use the table SFLIGHT, or other tables (also Z* tables) that have few fields, it works fine, but my requirement is to use a large table (100 fields). With my table, the method SET_SOURCE_TABLE of class I_OI_PIVOT is giving error 7, with Retcode 'CONTROL_INTERNAL_ERROR'.
My code is exact the same for SFLIGHT as it is for my Z* large table, and it works for the first but not for the other. Does anyone know what might be happening? I think the problem is the width of the table, as with other Z* table with 55 it does not work either.
Any solution??
My code below:
//// SCREEN 100 ////
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100. "Copied from SAPRDEMO_PIVOTINTERFACE
MODULE CREATE_BASIC_OBJECTS. "Copied from SAPRDEMO_PIVOTINTERFACE
PROCESS AFTER INPUT.
MODULE EXIT AT EXIT-COMMAND. "Copied from SAPRDEMO_PIVOTINTERFACE
MODULE USER_COMMAND_0100. "Edited (below)
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
CASE okcode.
WHEN 'SFL'. "button for SFLIGHT
SELECT * FROM sflight INTO TABLE tempsflight.
CLEAR itemsnr.
wa_name-type = i_oi_pivot=>columnfield.
wa_name-col = 1.
APPEND wa_name TO itemsnr.
wa_name-type = i_oi_pivot=>rowfield.
wa_name-col = 2.
APPEND wa_name TO itemsnr.
wa_name-type = i_oi_pivot=>rowfield.
wa_name-col = 7.
APPEND wa_name TO itemsnr.
wa_name-type = i_oi_pivot=>datafield.
wa_name-col = 8.
APPEND wa_name TO itemsnr.
wa_name-type = i_oi_pivot=>datafield.
wa_name-col = 9.
APPEND wa_name TO itemsnr.
CALL METHOD handle2->set_source_table
EXPORTING
name = 'pivot1'
ddic_name = 'SFLIGHT'
data_table = tempsflight
length = 'L'
itemsnr = itemsnr
IMPORTING
error = error
retcode = retcode.
MESSAGE retcode TYPE 'S' DISPLAY LIKE 'E'.
WHEN 'MYTAB'. "Button for my table with 101 fields
SELECT * FROM zmt_smartmex INTO TABLE gi_smartmex.
CLEAR itemsnr.
wa_name-type = i_oi_pivot=>columnfield.
wa_name-col = 1.
APPEND wa_name TO itemsnr.
wa_name-type = i_oi_pivot=>rowfield.
wa_name-col = 2.
APPEND wa_name TO itemsnr.
wa_name-type = i_oi_pivot=>rowfield.
wa_name-col = 7.
APPEND wa_name TO itemsnr.
wa_name-type = i_oi_pivot=>datafield.
wa_name-col = 8.
APPEND wa_name TO itemsnr.
wa_name-type = i_oi_pivot=>datafield.
wa_name-col = 9.
APPEND wa_name TO itemsnr.
CALL METHOD handle2->set_source_table
EXPORTING
name = 'pivot1'
ddic_name = 'ZMT_SMARTMEX'
data_table = gi_smartmex
length = 'L'
itemsnr = itemsnr
IMPORTING
error = error
retcode = retcode.
MESSAGE retcode TYPE 'S' DISPLAY LIKE 'E'.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
When you post code please do so using the "code" button in the editor. For copy paste, right click and choose "paste as plain text".
2018 Jul 25 11:08 AM
I would debug the standard code to figure out where that error is being thrown and why. Have you tried that?
2018 Aug 06 12:51 PM
Yes, I did debug it before posting this.
Inside of the method SET_SOURCE_TABLE of class I_OI_PIVOT seems to be fine until the call to method CALL_OBJECT_METHOD. This returns the code '999999-', same as it does for the successful examples I've tried, and then it does a FLUSH, where it changes the error code to '7' (CONTROL_INTERNAL_ERROR), while for success examples, the FLUSH returns a '0'.
I am not being able to know or debug what happens inside the flush or where it takes the error code from.
Any idea?
Thanks.
2018 Jul 25 12:41 PM
When you post code please do so using the "code" button in the editor. For copy paste, right click and choose "paste as plain text".
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |