‎2006 Jul 24 8:02 PM
I am using a simple Itab to load into my ALV display. The container is showing its screenname I've given it. But the ALV grid will not display. The Screens are activated and I'm using the proper structure with my Itab. Any Ideas??
‎2006 Jul 24 8:07 PM
Hi,
Can you post the code?
I guess there is some problem in the initialisation of custom container.
Regards,
Tanveer
<b>Please marh helpful answers</b>
‎2006 Jul 24 8:07 PM
Hi,
Can you post the code?
I guess there is some problem in the initialisation of custom container.
Regards,
Tanveer
<b>Please marh helpful answers</b>
‎2006 Jul 24 8:09 PM
‎2006 Jul 24 8:27 PM
*&----
*
*& Report ZTESTINCENTIVES
*&
*&----
*
*&
*&
*&----
*
REPORT ztestincentives.
DATA: incent_itab TYPE STANDARD TABLE OF ztestincstructure,
wa_incent LIKE LINE OF incent_itab.
Data: hold_data LIKE /bic/azinccred00.
DATA: ok_code LIKE sy-ucomm,
save_ok LIKE sy-ucomm,
g_container TYPE scrfname VALUE 'Incentives ALV',
g_grid TYPE REF TO cl_gui_alv_grid,
gs_layout TYPE lvc_s_layo,
g_custom_container TYPE REF TO cl_gui_custom_container.
CALL SCREEN 100.
*&----
*
*& Module PBO OUTPUT
*&----
*
text
*----
*
MODULE pbo OUTPUT.
SET PF-STATUS 'MAIN100'.
SET TITLEBAR 'MAIN100'.
IF g_custom_container IS INITIAL.
CREATE OBJECT g_custom_container
EXPORTING container_name = 'g_container'.
CREATE OBJECT g_grid
EXPORTING
i_parent = g_custom_container.
*§1.Set status of all cells to editable using the layout structure.
gs_layout-edit = 'X'.
*Get data from table and place into structure.
SELECT * FROM /bic/azinccred00 INTO hold_data
WHERE bill_item = '000001'.
MOVE-CORRESPONDING hold_data TO wa_incent.
APPEND wa_incent TO incent_itab.
ENDSELECT.
CALL METHOD g_grid->set_table_for_first_display
EXPORTING
i_structure_name = 'ztestincstructure'
is_layout = gs_layout
CHANGING
it_outtab = incent_itab.
*§2.Use SET_READY_FOR_INPUT to allow editing initially.
(state "editable and ready for input").
CALL METHOD g_grid->set_ready_for_input
EXPORTING
i_ready_for_input = 1.
ENDIF.
ENDMODULE. " PBO OUTPUT
*&----
*
*& Module PAI INPUT
*&----
*
text
*----
*
MODULE pai INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'EXIT'.
PERFORM exit_program.
WHEN 'SWITCH'.
PERFORM switch_edit_mode.
WHEN OTHERS.
do nothing
ENDCASE.
ENDMODULE. " PAI INPUT
*&----
*
*& Form exit_program
*&----
*
FORM exit_program .
LEAVE PROGRAM.
ENDFORM. " exit_program
*&----
*
*& Form switch_edit_mode
*&----
*
FORM switch_edit_mode .
*§3.Use IS_READY_FOR_INPUT to fetch current substate of editable cells.
IF g_grid->is_ready_for_input( ) EQ 0.
*§4.Use SET_READY_FOR_INPUT to switch between the substates.
CALL METHOD g_grid->set_ready_for_input
EXPORTING
i_ready_for_input = 1.
ELSE.
CALL METHOD g_grid->set_ready_for_input
EXPORTING
i_ready_for_input = 0.
ENDIF.
ENDFORM. " switch_edit_mode
‎2006 Jul 24 8:41 PM
*&----
*
*& Report ZTESTINCENTIVES
*&
*&----
*
*&
*&
*&----
*
REPORT ztestincentives.
DATA: incent_itab TYPE STANDARD TABLE OF ztestincstructure,
wa_incent LIKE LINE OF incent_itab.
Data: hold_data LIKE /bic/azinccred00.
DATA: ok_code LIKE sy-ucomm,
save_ok LIKE sy-ucomm,
g_container TYPE scrfname VALUE 'Incentives ALV',
g_grid TYPE REF TO cl_gui_alv_grid,
gs_layout TYPE lvc_s_layo,
g_custom_container TYPE REF TO cl_gui_custom_container.
CALL SCREEN 100.
*&----
*
*& Module PBO OUTPUT
*&----
*
text
*----
*
MODULE pbo OUTPUT.
SET PF-STATUS 'MAIN100'.
SET TITLEBAR 'MAIN100'.
IF g_custom_container IS INITIAL.
CREATE OBJECT g_custom_container
EXPORTING container_name = 'g_container'.
CREATE OBJECT g_grid
EXPORTING
i_parent = g_custom_container.
*§1.Set status of all cells to editable using the layout structure.
gs_layout-edit = 'X'.
*Get data from table and place into structure.
SELECT * FROM /bic/azinccred00 INTO hold_data
WHERE bill_item = '000001'.
MOVE-CORRESPONDING hold_data TO wa_incent.
APPEND wa_incent TO incent_itab.
ENDSELECT.
CALL METHOD g_grid->set_table_for_first_display
EXPORTING
i_structure_name = 'ztestincstructure'
is_layout = gs_layout
CHANGING
it_outtab = incent_itab.
*§2.Use SET_READY_FOR_INPUT to allow editing initially.
(state "editable and ready for input").
CALL METHOD g_grid->set_ready_for_input
EXPORTING
i_ready_for_input = 1.
ENDIF.
ENDMODULE. " PBO OUTPUT
*&----
*
*& Module PAI INPUT
*&----
*
text
*----
*
MODULE pai INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'EXIT'.
PERFORM exit_program.
WHEN 'SWITCH'.
PERFORM switch_edit_mode.
WHEN OTHERS.
do nothing
ENDCASE.
ENDMODULE. " PAI INPUT
*&----
*
*& Form exit_program
*&----
*
FORM exit_program .
LEAVE PROGRAM.
ENDFORM. " exit_program
*&----
*
*& Form switch_edit_mode
*&----
*
FORM switch_edit_mode .
*§3.Use IS_READY_FOR_INPUT to fetch current substate of editable cells.
IF g_grid->is_ready_for_input( ) EQ 0.
*§4.Use SET_READY_FOR_INPUT to switch between the substates.
CALL METHOD g_grid->set_ready_for_input
EXPORTING
i_ready_for_input = 1.
ELSE.
CALL METHOD g_grid->set_ready_for_input
EXPORTING
i_ready_for_input = 0.
ENDIF.
ENDFORM. " switch_edit_mode
‎2006 Jul 24 9:39 PM
hi ,
Instead of
CREATE OBJECT g_custom_container
EXPORTING container_name = 'g_container'.
use
CREATE OBJECT g_custom_container
EXPORTING container_name = <b>'G_CONTAINER'</b>.
Regards,
Vara
‎2006 Jul 25 3:11 PM
Hi,
I tried the uppercase container_name, did not work, any other ideas would be greatly appreciated!
Thanks.
Ryan
‎2006 Jul 25 3:28 PM
Ryan,
Please re-clarify your expected output. Are you expecting titles in the ALV grid?
‎2006 Jul 25 3:36 PM
My actual ALV Grid(rows/columns) is not displaying, I see only the container name at the top of the screen. I have my GUI Status and GUI Title are named MAIN100, My screen is 0100. Everything is activated. Any thoughts? Thanks
‎2006 Jul 25 3:46 PM
In the actual screen itself (in Screen Painter), is the Custom Container named 'G_CONTAINER' ? It needs to be (with your code example).
‎2006 Jul 25 3:47 PM
Also - G_CONTAINER must be in CAPS in your CREATE OBJECT statement.
‎2006 Jul 25 3:51 PM
‎2006 Jul 25 3:52 PM
‎2006 Jul 25 3:57 PM
The brackets did not help, no column headings either, just seeing a blank screen with the title (Incentives Display)
‎2006 Jul 25 3:59 PM
‎2006 Jul 25 4:02 PM
Ryan,
Also - make sure that your STRUCTURE name is in CAPS in the set_table statement.
Also - remove the data declaration of g_container.
Is your custom container called "G_CONTAINER" as menetioned above?
‎2006 Jul 25 4:23 PM
HI,
Your program should work, if you do the following changes,..
First of all remember that whenever you choose the specify the screen field name in the program, it should always be in CAPITAL Letters.
1st Change
So, Instead of
g_container TYPE scrfname VALUE 'Incentives ALV',
use
g_container TYPE scrfname VALUE <b>'INCENTIVES ALV'</b>,
(avoid using spaces in the name)
2nd change
instread of
CREATE OBJECT g_custom_container
EXPORTING container_name = 'g_container'.
use
CREATE OBJECT g_custom_container
EXPORTING container_name = <b>g_container</b>.
Regards,
Vara
‎2006 Jul 25 4:34 PM
‎2006 Jul 25 4:37 PM
‎2006 Jul 25 4:12 PM
‎2006 Jul 25 4:18 PM
When I capitalize the container name, I'm still getting no display.. Thanks for all of your help!
‎2006 Jul 25 4:21 PM
Ryan,
Is your custom container called "G_CONTAINER" as menetioned above?
This is ESSENTIAL to making the ALV Grid appear !!!
‎2006 Jul 25 4:22 PM
‎2006 Jul 25 4:23 PM
Go into Screen Painter (SE51) for screen 100, click on the Custom Container object. What name appears in the upper left of the screen as the Object name. It MUST be G_CONTAINER in your example.
‎2006 Jul 25 4:23 PM
What have you called the grid space in your screen. If it is not G_CONTAINER, then you must call what you have stated in screen painter and have the same name as the name of the variable in your data declarartion.
‎2006 Jul 25 4:31 PM
‎2006 Jul 25 4:38 PM
Ryan,
To that point, set a breakpoint at one of the CREATE OBJECT statements. Are you stopping on those statements? Watch the ABAP error handler...
‎2006 Jul 25 4:52 PM
Thanks for everyones help, I will rewards points for sure! I will try these ideas! Thanks again.
‎2006 Jul 25 5:22 PM
I'm sure its the empty space being shown, but I'm not seeing the custom container button in se51..
‎2006 Jul 25 5:30 PM
In SE51, you must click on the "Custom Control" object in the left hand box. Drag it over to the screen space and place it on the screen. Give it the object name of G_CONTAINER.
Now compile and execute.
‎2006 Jul 25 5:50 PM
‎2006 Jul 25 5:53 PM
‎2006 Jul 25 5:58 PM
Yes, I did not create the control on the screen. That was all. Good learning experience though. Thanks again!
‎2006 Jul 25 6:11 PM
Ryan,
The actual G_CONTAINER screen object IS the container for the ALV Grid object.
The Custom Control (G_CONTAINER) must exist as a physical entity on the screen; and the ALV Grid object reference must be bound to the Custom Control using the CREATE OBJECT (as you are doing now).
Glad it works for you now.
‎2006 Jul 25 6:12 PM
‎2006 Jul 25 6:14 PM