Académique Documents
Professionnel Documents
Culture Documents
"hotspot_click
METHOD handle_double_click.
DATA :
wa_mara TYPE t_mara,
wa_marc TYPE t_marc.
DATA :
l_index TYPE sy-tabix.
READ TABLE i_mara INTO wa_mara INDEX e_row-index.
IF sy-subrc EQ 0.
REFRESH i_marc.
SELECT matnr
werks
INTO TABLE i_marc
FROM marc
WHERE matnr EQ wa_mara-matnr.
IF sy-subrc EQ 0.
LOOP AT i_marc INTO wa_marc.
l_index = sy-tabix.
wa_marc-mtart = wa_mara-mtart.
wa_marc-maktx = wa_mara-maktx.
MODIFY i_marc FROM wa_marc INDEX l_index
TRANSPORTING mtart maktx.
ENDLOOP.
CALL SCREEN 200.
ELSE.
"MESSAGE e121 WITH text-005 wa_mara-matnr.
ENDIF.
ENDIF.
ENDMETHOD.
"handle_double_click
ENDCLASS.
"lcl_rcvr_class IMPLEMENTATION
*---------------------------------------------------------------------* Start of Selection
*---------------------------------------------------------------------START-OF-SELECTION.
* Extract the Material Master data for the Input Material.
SELECT a~matnr
a~mtart
b~maktx
INTO TABLE i_mara
FROM mara AS a
INNER JOIN makt AS b
ON a~matnr EQ b~matnr
WHERE a~matnr IN s_matnr
AND b~spras EQ sy-langu.
END-OF-SELECTION.
IF NOT i_mara[] IS INITIAL.
* Call Screen to display the Material Master data.
CALL SCREEN 100.
ELSE.
"MESSAGE s121 WITH text-006.
ENDIF.
*&---------------------------------------------------------------------*
*& Module DISP_GRID OUTPUT (SE DEBE COLOCAR EN EL PBO DE LA PANTALLA 100)
*&---------------------------------------------------------------------*
MODULE disp_grid OUTPUT.
* Build the Field catelog for Material Master data.
PERFORM build_fcat.
* Display the Material Master data using ALV.
PERFORM disp_alv.
ENDMODULE. " DISP_GRID OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
*when exit or cancel is clicked program has to come out
CASE sy-ucomm.
WHEN 'EXIT' OR 'CANC'.
LEAVE PROGRAM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
= 'MTART'.
= text-002.
'I_MARA'.
i_fcat1.
ws_fcat-fieldname
ws_fcat-scrtext_m
ws_fcat-tabname =
APPEND ws_fcat TO
CLEAR ws_fcat.
= 'MAKTX'.
= text-003.
'I_MARA'.
i_fcat1.
= 'MATNR'.
= text-001.
'I_MARC'.
i_fcat2.
ws_fcat-fieldname
ws_fcat-scrtext_m
ws_fcat-tabname =
APPEND ws_fcat TO
CLEAR ws_fcat.
= 'WERKS'.
= text-004.
'I_MARC'.
i_fcat2.
ws_fcat-fieldname
ws_fcat-scrtext_m
ws_fcat-tabname =
APPEND ws_fcat TO
CLEAR ws_fcat.
= 'MTART'.
= text-002.
'I_MARC'.
i_fcat2.
ws_fcat-fieldname
ws_fcat-scrtext_m
ws_fcat-tabname =
APPEND ws_fcat TO
CLEAR ws_fcat.
= 'MAKTX'.
= text-003.
'I_MARC'.
i_fcat2.
EXPORTING
i_parent
= lp_cont2
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS
= 5.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
* Display Material Plant data by calling method.
CALL METHOD lp_grid2->set_table_for_first_display
CHANGING
it_outtab
= i_marc
it_fieldcatalog
= i_fcat2
EXCEPTIONS
invalid_parameter_combination = 1
program_error
= 2
too_many_lines
= 3
OTHERS
= 4.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
ENDIF.
ELSE.
* Call method 'REFRESH_TABLE_DISPLAY' to refresh the grid data.
CALL METHOD lp_grid2->refresh_table_display.
ENDIF.
ENDFORM. " disp_alv_plant