2013 Oct 17 11:17 PM
Dear friends i have the following problem, I'm using a subscreen with select options but not to enter the values shown in the dockcontainer data, this is the code:
TYPES: BEGIN OF....
......
endof ....
DATA:.......
.....
DATA:
*User Command
ok_code TYPE sy-ucomm,
*Variable para Docking Container
r_dock_container TYPE REF TO cl_gui_docking_container,
*Variable para Alv Grid
r_grid TYPE REF TO cl_gui_alv_grid.
SELECTION-SCREEN BEGIN OF SCREEN 300 AS SUBSCREEN.
PARAMETERS: so_mtart TYPE mara-mtart.
SELECT-OPTIONS: so_matnr for mapl-matnr,
so_werks FOR mapl-werks OBLIGATORY,
so_plnty FOR mapl-plnty DEFAULT 'N' OBLIGATORY.
SELECTION-SCREEN END OF SCREEN 300 .
START-OF-SELECTION.
*Mostrar datos
PERFORM display_output.
*&---------------------------------------------------------------------*
*& Form display_output
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM display_output.
*Llenar catalogo
PERFORM fill_fieldcat USING:
'PLNAL' 'T_MAPL' '5' 'C' 'CGH',
.....
.........
........
CALL SCREEN 500.
ENDFORM. "display_output
MODULE status_0500 OUTPUT.
SET PF-STATUS 'STATUS'.
SET TITLEBAR 'TITLE'.
ENDMODULE. "status_0500 OUTPUT
MODULE create_objects OUTPUT.
*Crear Docking y control dock al lado derecho de la pantalla
CHECK r_dock_container IS INITIAL.
CREATE OBJECT r_dock_container
EXPORTING
side = cl_gui_docking_container=>dock_at_right
extension = 980
caption = 'Materials'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CREATE OBJECT r_grid
EXPORTING
i_parent = r_dock_container
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL METHOD r_grid->set_table_for_first_display
CHANGING
it_outtab = t_mapl
it_fieldcatalog = t_fieldcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. "
ENDMODULE. "create_objects OUTPUT
MODULE user_command_0500 INPUT.
CASE ok_code.
WHEN 'EXECUTE'.
IF mapl-matnr IS NOT INITIAL.
SELECT .......
............
............
WHERE mara~mtart EQ so_mtart
AND mapl~matnr EQ so_matnr
AND mapl~werks EQ so_werks
AND mapl~plnty EQ so_plnty.
LOOP AT t_mapl ASSIGNING <fs_data>.
....................
..................
CALL METHOD r_grid->refresh_table_display.
WHEN 'BACK' OR 'CANCEL' OR 'EXIT'.
LEAVE TO SCREEN 0.
WHEN OTHERS.
ENDCASE.
ENDMODULE.
PROCESS BEFORE OUTPUT.
MODULE status_0500.
MODULE create_objects.
CALL SUBSCREEN are INCLUDING 'Z75_DOCKING1' '300'.
PROCESS AFTER INPUT.
CALL SUBSCREEN are.
MODULE user_command_0500.
Please guide me with some hope example
Thank you for your valuable time
Regards
2013 Oct 19 1:46 PM
2013 Oct 20 5:24 AM
Hi Brujo,
Your query isn't very clear.
All I could understand is - you want to have select-option in a docking container of the screen.
But, what is the issue you are facing?
2013 Oct 21 2:33 AM
Thanks for answering...
The problem is that putting the values are not displayed in the container data
This is the query I'm using.
CASE ok_code.
WHEN 'EXECUTE'.
IF mapl-matnr IS NOT INITIAL.
SELECT mapl~werks mapl~plnty mapl~plnnr mapl~plnal mapl~datuv mapl~matnr
plko~ktext plko~verwe plko~statu plko~andat plko~annam plko~aedat plko~aenam
plkz~abdat plkz~abanz
plas~plnkn
mara~mtart
INTO CORRESPONDING FIELDS OF TABLE t_mapl
FROM mapl INNER JOIN plko ON mapl~plnty = plko~plnty
AND mapl~plnnr = plko~plnnr
AND mapl~plnal = plko~plnal
INNER JOIN plkz ON mapl~plnty = plkz~plnty
AND mapl~plnnr = plkz~plnnr
AND mapl~plnal = plkz~plnal
INNER JOIN plas ON mapl~plnty = plas~plnty
AND mapl~plnnr = plas~plnnr
AND mapl~plnal = plas~plnal
INNER JOIN mara ON mapl~matnr = mara~matnr
WHERE mara~mtart EQ so_mtart
AND mapl~matnr EQ so_matnr
AND mapl~werks EQ so_werks
AND mapl~plnty EQ so_plnty.
ELSE.
SELECT mapl~werks mapl~plnty mapl~plnnr mapl~plnal mapl~datuv mapl~matnr
plko~ktext plko~verwe plko~statu plko~andat plko~annam plko~aedat plko~aenam
plkz~abdat plkz~abanz
plas~plnkn
mara~mtart
INTO CORRESPONDING FIELDS OF TABLE t_mapl
FROM mapl INNER JOIN plko ON mapl~plnty = plko~plnty
AND mapl~plnnr = plko~plnnr
AND mapl~plnal = plko~plnal
INNER JOIN plkz ON mapl~plnty = plkz~plnty
AND mapl~plnnr = plkz~plnnr
AND mapl~plnal = plkz~plnal
INNER JOIN plas ON mapl~plnty = plas~plnty
AND mapl~plnnr = plas~plnnr
AND mapl~plnal = plas~plnal
INNER JOIN mara ON mapl~matnr = mara~matnr
WHERE mara~mtart EQ so_mtart
AND mapl~werks EQ so_werks
AND mapl~plnty EQ so_plnty.
ENDIF.
2013 Oct 21 6:05 AM
Did you do a REFRESH after the values are fetched..? do a refresh of the grid using method REFRESH_TABLE_DISPLAY
2013 Oct 21 4:55 AM
2013 Oct 24 8:06 PM
Thank you all for help cleaning the object was solved OK_CODE
Clear: ok_code, at the end of CASE.
Regards gurus.