Creacion de un TextBox en Dynpro
posted under
MODULE POOL - EJEMPLO
by Antonio Lopez
Codigo para insertar un ComboBox en un Dynpro parecido a los de Visual Basic, Debemos tener un input/output field en la pantalla, llamado "mes", etse field debe tener la propiedad "DropDown" en "ListBox".
********************
FLOW LOGIC DYNPROO
-----------------------
PROCESS BEFORE OUTPUT.
MODULE PBO. "STATUS_0100.
PROCESS AFTER INPUT.
MODULE PAI. "USER_COMMAND_0100.
PROCESS ON VALUE-REQUEST.
FIELD MES MODULE SET_DATA_MES.
Codigo:
***********************
*INCLUDE TOP
***********************
DATA:
itabitems like listitem occurs 0 with header line,
*****************
*INCLUDE OUTPUT
*****************
*----------------------------------------------------------------------*
* INCLUDE ZRF_0009O01 *
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Module PBO OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE pbo OUTPUT.
SET PF-STATUS '009'.
SET TITLEBAR 'MAINTITLE '.
ENDMODULE. " PBO OUTPUT
************************
*INCLUDE INPUT
************************
*----------------------------------------------------------------------*
* INCLUDE ZRF_0009I01 *
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Module PAI INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE pai INPUT.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANC'.
PERFORM leave_program.
ENDCASE.
ENDMODULE. " PAI INPUT
*&---------------------------------------------------------------------*
*& Module SET_DATA_MES INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE set_data_mes INPUT.
IF CONT = 0.
CONT = 1.
itabitems-item = 'ENERO'. APPEND itabitems.
itabitems-item = 'FEBRERO'. APPEND itabitems.
itabitems-item = 'MARZO'. APPEND itabitems.
itabitems-item = 'ABRIL'. APPEND itabitems.
itabitems-item = 'MAYO'. APPEND itabitems.
itabitems-item = 'JUNIO'. APPEND itabitems.
itabitems-item = 'JULIO'. APPEND itabitems.
itabitems-item = 'AGOSTO'. APPEND itabitems.
itabitems-item = 'SEPTIEMBRE'. APPEND itabitems.
itabitems-item = 'OCTUBRE'. APPEND itabitems.
itabitems-item = 'NOVIEMBRE'. APPEND itabitems.
itabitems-item = 'DICIEMBRE'. APPEND itabitems.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'CARRID'
value_org = 'S'
TABLES
value_tab = itabitems
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
ENDMODULE. " SET_DATA_MES INPUT
******************************
*INCLUDE FORMS
******************************
*----------------------------------------------------------------------*
* INCLUDE ZRF_0009F01 *
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Form LEAVE_PROGRAM
*&---------------------------------------------------------------------*
FORM leave_program.
LEAVE PROGRAM.
ENDFORM. " LEAVE_PROGRAM
Comment Form under post in blogger/blogspot