Pages

Tuesday, July 10, 2012

Display Text in Module pool screen

  DATAobj_cont1 TYPE REF TO cl_gui_custom_container,
        obj_cont2 TYPE REF TO cl_gui_custom_container,
        obj_cont3 TYPE REF TO cl_gui_custom_container,
        obj_cont4 TYPE REF TO cl_gui_custom_container,
        obj_cont5 TYPE REF TO cl_gui_custom_container,
        obj_editor1 TYPE REF TO cl_gui_textedit,
        obj_editor2 TYPE REF TO cl_gui_textedit,
        obj_editor3 TYPE REF TO cl_gui_textedit,
        obj_editor4 TYPE REF TO cl_gui_textedit,
        obj_editor5 TYPE REF TO cl_gui_textedit.




MODULE fill_text_ycsmg OUTPUT.

  IF obj_editor1 IS NOT BOUND.
    CREATE OBJECT obj_cont1
      EXPORTING
        container_name 'LINK_CONT'.
    CREATE OBJECT obj_editor1
      EXPORTING
        parent obj_cont1.

    CALL METHOD obj_editor1->set_selected_textstream
      EXPORTING
        selected_text                 'To facilitate manual movements of components within the multilevel structures (Material BOM) of the product. Instead of several-step process with usage of standard transactions such as CS02 or CEWB.'
*       enable_editing_protected_text = false
      EXCEPTIONS
        error_cntl_call_method        1
        not_supported_by_gui          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.

    CALL METHOD obj_editor1->set_toolbar_mode
      EXPORTING
        toolbar_mode 0.
    CALL METHOD obj_editor1->set_readonly_mode
      EXPORTING
        readonly_mode 1.
    CALL METHOD obj_editor1->set_statusbar_mode
      EXPORTING
        statusbar_mode 0.

  ENDIF.

ENDMODULE.    





**************************
  CASE sy-ucomm.
    WHEN 'LINK'.
      CALL TRANSACTION 'YCSMG'."Link Transfer WB
    WHEN 'YCAPPH'."Allocation of S-Note comp
      CALL TRANSACTION 'YCAPPH'.
    WHEN 'YCASNH'."Manage of S-Note Comp
      CALL TRANSACTION 'YCASNH'.
    WHEN 'REPLACE'.
      SUBMIT yrep_kola_modify_linkid VIA SELECTION-SCREEN AND RETURN.
    WHEN 'UNREPLACE'.
      SUBMIT yrep_kola_modify_link_undo VIA SELECTION-SCREEN AND RETURN.
    WHEN 'BACK' OR 'CANCEL' OR 'EXIT'.
      LEAVE TO SCREEN 0.
  ENDCASE.

Monday, June 25, 2012

Dynamic SELECT query


  DATAlv_cond TYPE string,
        lv_ecmas TYPE char6,
        lv_kola TYPE char4,
        lv_matmas TYPE char6,
        lv_docmas TYPE char6.

  REFRESH p_idoc.

  IF cb_bom EQ gc_o.
    MOVE 'KOLA' TO lv_kola.
********ECMMAS,MATMAS,DOCMAS****************************************
    IF cb_ecm EQ gc_x AND cb_mat NE gc_x AND cb_doc NE gc_x.
      MOVE 'ECMMAS' TO lv_ecmas.
      CONCATENATE 'mestyp = lv_ecmas'
                  'AND sndprn =' 'lv_kola' 'AND credat IN s_odays'
                  INTO lv_cond SEPARATED BY space.
    ELSEIF cb_ecm EQ gc_x AND cb_mat EQ gc_x AND cb_doc NE gc_x.
      MOVE 'ECMMAS' TO lv_ecmas.
      MOVE 'MATMAS' TO lv_matmas.
      CONCATENATE 'mestyp = lv_ecmas OR mestyp = lv_matmas'
                  'AND sndprn =' 'lv_kola' 'AND credat IN s_odays'
                  INTO lv_cond SEPARATED BY space.
    ELSEIF cb_ecm EQ gc_x AND cb_mat EQ gc_x AND cb_doc EQ gc_x.
      MOVE 'ECMMAS' TO lv_ecmas.
      MOVE 'MATMAS' TO lv_matmas.
      MOVE 'DOCMAS' TO lv_docmas.
      CONCATENATE
      'mestyp = lv_ecmas OR mestyp = lv_matmas OR mestyp = lv_docmas'
      'AND sndprn =' 'lv_kola' 'AND credat IN s_odays'
                  INTO lv_cond SEPARATED BY space.
    ELSEIF cb_ecm NE gc_x AND cb_mat EQ gc_x AND cb_doc EQ gc_x.
      MOVE 'DOCMAS' TO lv_docmas.
      MOVE 'MATMAS' TO lv_matmas.
      CONCATENATE 'mestyp = lv_docmas OR mestyp = lv_matmas'
                  'AND sndprn =' 'lv_kola' 'AND credat IN s_odays'
                  INTO lv_cond SEPARATED BY space.
    ELSEIF cb_ecm NE gc_x AND cb_mat NE gc_x AND cb_doc EQ gc_x.
      MOVE 'DOCMAS' TO lv_docmas.
      CONCATENATE 'mestyp = lv_docmas'
                  'AND sndprn =' 'lv_kola' 'AND credat IN s_odays'
                  INTO lv_cond SEPARATED BY space.
    ELSEIF cb_ecm NE gc_x AND cb_mat EQ gc_x AND cb_doc NE gc_x.
      MOVE 'MATMAS' TO lv_matmas.
      CONCATENATE 'mestyp = lv_matmas'
                  'AND sndprn =' 'lv_kola' 'AND credat IN s_odays'
                  INTO lv_cond SEPARATED BY space.
    ENDIF.

    IF NOT lv_cond IS INITIAL.
      SELECT docnum status credat cretim mestyp
             mescod mesfct upddat updtim
          INTO CORRESPONDING FIELDS OF TABLE p_idoc
          FROM edidc
          WHERE (lv_cond).
    ENDIF.
********CHRMAS,CLSMAS,ECMREV****************************************