Update of custom control

Hello experts,
I built a program with just 1 screen. This screen consists of 2 sections. Section 1 contains input fields for a selection, section 2 constains a custom control on which the selected data is displayed as pdf. For the creation of the pdf I use smartforms.
First selection works fine.
If I do a second selection with other selection values the pdf is not updated but displays the values of the first selection. How can I display the new values?
  IF custom_container IS INITIAL.
    CREATE OBJECT custom_container
          EXPORTING container_name = 'CUSTOM_CONTROL'.
  ENDIF.
  CREATE OBJECT html_viewer
      EXPORTING parent  = custom_container.
* pdf_string_x in Tabelle konvertieren
  length = XSTRLEN( pdf_string_x ).
  full_lines = length DIV 1000.
  last_length = length MOD 1000.
  CLEAR offset.
  DO full_lines TIMES.
    i_data = pdf_string_x+offset(1000).
    APPEND i_data TO it_data.
    offset = offset + 1000.
  ENDDO.
  i_data = pdf_string_x+offset(last_length).
  APPEND i_data TO it_data.
  CALL METHOD html_viewer->load_data
    EXPORTING
*    URL                  =
      type                 = 'text'
      subtype              = 'pdf'
*    SIZE                 = pdf_fsize
*    ENCODING             =
*    CHARSET              =
*    LANGUAGE             =
    IMPORTING
      assigned_url         = url
    CHANGING
      data_table           = it_data[]
*  EXCEPTIONS
*    DP_INVALID_PARAMETER = 1
*    DP_ERROR_GENERAL     = 2
*    CNTL_ERROR           = 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.
  CALL METHOD cl_gui_cfw=>flush.
  CALL METHOD html_viewer->show_data
    EXPORTING
      url = url.
Thanks in advance!
Johannes

CLEAR IT_DATA[].
  DO full_lines TIMES.
    i_data = pdf_string_x+offset(1000).
    APPEND i_data TO it_data.
    offset = offset + 1000.
  ENDDO.
Use   CLOSE_DOCUMENT
      or DO_REFRESH method the second time

Similar Messages

  • Custom Table updation thru table control

    Hi All,
    My requirement is to update the custom table by creating a custom screen with table control,say my z table has 2 fields name1 and bukrs.
    if i enter the value in table control then i click the save icon these fields should get updated in the z table .can any one send me the piece of code for this,since i have not worked on table control i need it in detail.
    Useful answers will be rewarded....
    Thanks in Advance.....

    PROGRAM  ZSD_REBATE_MASTER MESSAGE-ID FV
             NO STANDARD PAGE HEADING.
    TABLES: KONA,
            ZSD_BILLINFO,
            ZSD_RBT_ELG_INV,
            KNVV.
    DATA: OK_CODE LIKE SY-UCOMM,
          L_CODE LIKE SY-UCOMM.
    DATA : BEGIN OF I_KNVV_DATA OCCURS 0,
           GJAHR LIKE ZSD_RBT_MAS_DATA-GJAHR,
           KNUMA LIKE ZSD_RBT_MAS_DATA-KNUMA,
           VKBUR LIKE ZSD_RBT_MAS_DATA-VKBUR,
           VKORG LIKE ZSD_RBT_MAS_DATA-VKORG,
           VTWEG LIKE ZSD_RBT_MAS_DATA-VTWEG,
           SPART LIKE ZSD_RBT_MAS_DATA-SPART,
           OTQTY LIKE ZSD_RBT_MAS_DATA-OTQTY,
           PCPDAYS LIKE ZSD_RBT_MAS_DATA-PCPDAYS,
           OTPC LIKE ZSD_RBT_MAS_DATA-OTPC,
           MATKL LIKE ZSD_RBT_MAS_DATA-MATKL,
          EBDFROM LIKE ZSD_RBT_MAS_DATA-EBDFROM,
          EBDTO LIKE ZSD_RBT_MAS_DATA-EBDTO,
           STATUS LIKE ZSD_RBT_MAS_DATA-STATUS,
         END OF I_KNVV_DATA.
    DATA : G_ANS(1), GR1, FLAG(1),LS(1).
    *&      Module  STATUS_1500  OUTPUT
          text
    MODULE STATUS_1500 OUTPUT.
      SET PF-STATUS '1500'.
      SET TITLEBAR 'HEADING_1500'.
    ENDMODULE.                 " STATUS_1500  OUTPUT
    *&      Module  USER_COMMAND_1500  INPUT
          text
    MODULE USER_COMMAND_1500 INPUT.
      OK_CODE = SY-UCOMM.
      L_CODE = OK_CODE.
      IF L_CODE = 'EXIT'.
        LEAVE PROGRAM.
      ELSEIF L_CODE = 'OK'.
        PERFORM ERROR_MESSGE.
        IF FLAG <> '1'.
          SELECT SINGLE * FROM ZSD_RBT_ELG_INV WHERE KNUMA = KONA-KNUMA.
          IF SY-SUBRC = 0.
            UPDATE ZSD_RBT_MAS_DATA SET STATUS = 'C'
                           WHERE KNUMA = KONA-KNUMA.
            COMMIT WORK.
          ENDIF.
          CALL SCREEN 1600.
        ENDIF.
      ENDIF.
    ENDMODULE.                 " USER_COMMAND_1500  INPUT
    *&      Module  MOD_CHECK_INPUT  INPUT
          text
    MODULE MOD_CHECK_INPUT INPUT.
      SELECT SINGLE * FROM KONA WHERE KNUMA = KONA-KNUMA.
      IF SY-SUBRC <> 0.
        MESSAGE E999 WITH 'Agreement No. ' KONA-KNUMA 'does not exists'.
      ENDIF.
    ENDMODULE.                 " MOD_CHECK_INPUT  INPUT
    *&      Module  EXIT  INPUT
          text
    MODULE EXIT INPUT.
      OK_CODE = SY-UCOMM.
      L_CODE = OK_CODE.
      CLEAR OK_CODE.
      IF L_CODE = 'EXIT'.
        LEAVE PROGRAM.
      ENDIF.
    ENDMODULE.                 " EXIT  INPUT
    ***&SPWIZARD: DATA DECLARATION FOR TABLECONTROL 'GRID_MAST'
    *&SPWIZARD: DEFINITION OF DDIC-TABLE
    TABLES:   ZSD_RBT_MAS_DATA.
    *&SPWIZARD: TYPE FOR THE DATA OF TABLECONTROL 'GRID_MAST'
    TYPES: BEGIN OF T_GRID_MAST,
             GJAHR LIKE ZSD_RBT_MAS_DATA-GJAHR,
             KNUMA LIKE ZSD_RBT_MAS_DATA-KNUMA,
             VKBUR LIKE ZSD_RBT_MAS_DATA-VKBUR,
             VKORG LIKE ZSD_RBT_MAS_DATA-VKORG,
             VTWEG LIKE ZSD_RBT_MAS_DATA-VTWEG,
             SPART LIKE ZSD_RBT_MAS_DATA-SPART,
             OTQTY LIKE ZSD_RBT_MAS_DATA-OTQTY,
             PCPDAYS LIKE ZSD_RBT_MAS_DATA-PCPDAYS,
             OTPC LIKE ZSD_RBT_MAS_DATA-OTPC,
             MATKL LIKE ZSD_RBT_MAS_DATA-MATKL,
            EBDFROM LIKE ZSD_RBT_MAS_DATA-EBDFROM,
            EBDTO LIKE ZSD_RBT_MAS_DATA-EBDTO,
             STATUS LIKE ZSD_RBT_MAS_DATA-STATUS,
           END OF T_GRID_MAST.
    *&SPWIZARD: INTERNAL TABLE FOR TABLECONTROL 'GRID_MAST'
    DATA:     G_GRID_MAST_ITAB   TYPE T_GRID_MAST OCCURS 0 WITH HEADER LINE,
              G_GRID_MAST_WA     TYPE T_GRID_MAST. "work area
    DATA:     G_GRID_MAST_COPIED.           "copy flag
    *&SPWIZARD: DECLARATION OF TABLECONTROL 'GRID_MAST' ITSELF
    CONTROLS: GRID_MAST TYPE TABLEVIEW USING SCREEN 1600.
    *&SPWIZARD: LINES OF TABLECONTROL 'GRID_MAST'
    DATA:     G_GRID_MAST_LINES  LIKE SY-LOOPC.
    DATA: L_LINE LIKE GRID_MAST-CURRENT_LINE.
    *&SPWIZARD: OUTPUT MODULE FOR TC 'GRID_MAST'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: COPY DDIC-TABLE TO ITAB
    **&      Module  GRID_INACT  OUTPUT
          text
    MODULE GRID_MAST_INIT OUTPUT.
      DATA: L_FLAG(1).
      IF G_GRID_MAST_COPIED IS INITIAL.
    *&SPWIZARD: COPY DDIC-TABLE 'ZSD_RBT_MAS_DATA'
    *&SPWIZARD: INTO INTERNAL TABLE 'g_GRID_MAST_itab'
        PERFORM GET_DATA.
        LOOP AT I_KNVV_DATA.
          G_GRID_MAST_ITAB-GJAHR = I_KNVV_DATA-GJAHR.
          G_GRID_MAST_ITAB-KNUMA = I_KNVV_DATA-KNUMA.
          G_GRID_MAST_ITAB-VKBUR = I_KNVV_DATA-VKBUR.
          G_GRID_MAST_ITAB-VKORG = I_KNVV_DATA-VKORG.
          G_GRID_MAST_ITAB-VTWEG = I_KNVV_DATA-VTWEG.
          G_GRID_MAST_ITAB-SPART = I_KNVV_DATA-SPART.
          G_GRID_MAST_ITAB-OTQTY = I_KNVV_DATA-OTQTY.
          G_GRID_MAST_ITAB-PCPDAYS = I_KNVV_DATA-PCPDAYS.
          G_GRID_MAST_ITAB-OTPC = I_KNVV_DATA-OTPC.
          G_GRID_MAST_ITAB-MATKL = I_KNVV_DATA-MATKL.
         G_GRID_MAST_ITAB-EBDFROM = I_KNVV_DATA-EBDFROM.
         G_GRID_MAST_ITAB-EBDTO = I_KNVV_DATA-EBDTO.
          G_GRID_MAST_ITAB-STATUS = I_KNVV_DATA-STATUS.
         G_GRID_MAST_ITAB-OTPC = I_KNVV_DATA-OTPC.
          APPEND G_GRID_MAST_ITAB.
        ENDLOOP.
        L_FLAG = 'X'.
        G_GRID_MAST_COPIED = 'X'.
        REFRESH CONTROL 'GRID_MAST' FROM SCREEN '1600'.
      ENDIF.
      IF L_FLAG IS INITIAL.
        L_LINE = GRID_MAST-CURRENT_LINE.
        IF NOT G_GRID_MAST_WA IS INITIAL.
         READ TABLE G_GRID_MAST_ITAB INDEX GRID_MAST-CURRENT_LINE.
         IF SY-SUBRC <> 0.
          MOVE-CORRESPONDING G_GRID_MAST_WA TO G_GRID_MAST_ITAB.
          APPEND G_GRID_MAST_ITAB.
          REFRESH CONTROL 'GRID_MAST' FROM SCREEN '1600'.
         CLEAR G_GRID_MAST_WA.
         ENDIF.
        ENDIF.
      ELSE.
        CLEAR L_FLAG.
      ENDIF.
    ENDMODULE.                    "GRID_MAST_INIT OUTPUT
    *&SPWIZARD: OUTPUT MODULE FOR TC 'GRID_MAST'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: MOVE ITAB TO DYNPRO
    MODULE GRID_MAST_MOVE OUTPUT.
      IF NOT G_GRID_MAST_WA IS INITIAL.
        MOVE-CORRESPONDING G_GRID_MAST_WA TO ZSD_RBT_MAS_DATA.
        CLEAR G_GRID_MAST_WA.
      ENDIF.
      GRID_MAST-LINES = G_GRID_MAST_LINES + 100.
    ENDMODULE.                    "GRID_MAST_MOVE OUTPUT
    **&SPWIZARD: OUTPUT MODULE FOR TC 'GRID_MAST'. DO NOT CHANGE THIS LINE!
    **&SPWIZARD: GET LINES OF TABLECONTROL
    MODULE GRID_MAST_GET_LINES OUTPUT.
      SELECT SINGLE * FROM ZSD_RBT_ELG_INV WHERE KNUMA = KONA-KNUMA.
      IF SY-SUBRC = 0.
        UPDATE ZSD_RBT_MAS_DATA SET STATUS = 'C'
                       WHERE KNUMA = KONA-KNUMA.
        COMMIT WORK.
        IF ZSD_RBT_ELG_INV-ZFLAG = 'C'.
          LOOP AT SCREEN.
            IF SCREEN-GROUP1 = 'GR1'.
              SCREEN-INPUT = '0'.
            ENDIF.
            MODIFY SCREEN.
          ENDLOOP.
        ENDIF.
      ENDIF.
      G_GRID_MAST_LINES = SY-LOOPC.
    ENDMODULE.                    "GRID_MAST_GET_LINES OUTPUT
    *&SPWIZARD: INPUT MODULE FOR TC 'GRID_MAST'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: MODIFY TABLE
    MODULE GRID_MAST_MODIFY INPUT.
      MOVE-CORRESPONDING ZSD_RBT_MAS_DATA TO G_GRID_MAST_WA.
      IF L_FLAG IS INITIAL.
        L_LINE = GRID_MAST-CURRENT_LINE.
        IF NOT G_GRID_MAST_WA IS INITIAL.
        IF L_LINE = GRID_MAST-CURRENT_LINE.
         READ TABLE G_GRID_MAST_ITAB INDEX GRID_MAST-CURRENT_LINE.
         IF SY-SUBRC = 0.
          MODIFY G_GRID_MAST_ITAB    FROM G_GRID_MAST_WA
        INDEX GRID_MAST-CURRENT_LINE.
        ELSE.
          MOVE-CORRESPONDING G_GRID_MAST_WA TO G_GRID_MAST_ITAB.
          APPEND G_GRID_MAST_ITAB.
          REFRESH CONTROL 'GRID_MAST' FROM SCREEN '1600'.
        ENDIF.
        ELSE.
          MOVE-CORRESPONDING G_GRID_MAST_WA TO G_GRID_MAST_ITAB.
          APPEND G_GRID_MAST_ITAB.
          REFRESH CONTROL 'GRID_MAST' FROM SCREEN '1600'.
         CLEAR G_GRID_MAST_WA.
         ENDIF.
        ENDIF.
      ELSE.
        CLEAR L_FLAG.
      ENDIF.
    MODIFY G_GRID_MAST_ITAB
       FROM G_GRID_MAST_WA
       INDEX GRID_MAST-CURRENT_LINE.
    ENDMODULE.                    "GRID_MAST_MODIFY INPUT
    *&SPWIZARD: INPUT MODULE FOR TC 'GRID_MAST'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: PROCESS USER COMMAND
    MODULE GRID_MAST_USER_COMMAND INPUT.
      OK_CODE = SY-UCOMM.
      PERFORM USER_OK_TC USING    'SY-UCOMM'
                                  'G_GRID_MAST_ITAB'
                                  'FLAG'
                         CHANGING OK_CODE.
      SY-UCOMM = OK_CODE.
    ENDMODULE.                    "GRID_MAST_USER_COMMAND INPUT
    *&      Module  STATUS_1600  OUTPUT
          text
    MODULE STATUS_1600 OUTPUT.
      SET PF-STATUS 'STATUS_1600'.
      SET TITLEBAR 'HEADING_1600'.
    ENDMODULE.                 " STATUS_1600  OUTPUT
    *&      Module  USER_COMMAND_1600  INPUT
          text
    MODULE USER_COMMAND_1600 INPUT.
      CASE SY-UCOMM.
        WHEN 'CAN'.
          CLEAR: G_GRID_MAST_COPIED, G_GRID_MAST_ITAB.
          LEAVE TO SCREEN '1500'.
        WHEN 'BACK'.
          CLEAR: G_GRID_MAST_COPIED, G_GRID_MAST_ITAB.
          LEAVE TO SCREEN '1500'.
        WHEN 'EXIT'.
          LEAVE TO SCREEN '1500'.
        WHEN 'SAVE'.
        DELETE FROM ZSD_RBT_MAS_DATA WHERE KNUMA EQ KONA-KNUMA.
          PERFORM SAVE_DATA.
       WHEN 'DELE'.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_1600  INPUT
    *&      Form  FCODE_INSERT_ROW                                         *
    FORM fcode_insert_row
                  USING    P_TC_NAME           TYPE DYNFNAM
                           P_TABLE_NAME             .
    &SPWIZARD: BEGIN OF LOCAL DATA----
      DATA L_LINES_NAME       LIKE FELD-NAME.
      DATA L_SELLINE          LIKE SY-STEPL.
      DATA L_LASTLINE         TYPE I.
      DATA L_LINE             TYPE I.
      DATA L_TABLE_NAME       LIKE FELD-NAME.
      FIELD-SYMBOLS <TC>                 TYPE CXTAB_CONTROL.
      FIELD-SYMBOLS <TABLE>              TYPE STANDARD TABLE.
      FIELD-SYMBOLS <LINES>              TYPE I.
    &SPWIZARD: END OF LOCAL DATA----
      ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get the table, which belongs to the tc                     *
      CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
      ASSIGN (L_TABLE_NAME) TO <TABLE>.                "not headerline
    *&SPWIZARD: get looplines of TableControl                              *
      CONCATENATE 'G_' P_TC_NAME '_LINES' INTO L_LINES_NAME.
      ASSIGN (L_LINES_NAME) TO <LINES>.
    *&SPWIZARD: get current line                                           *
      GET CURSOR LINE L_SELLINE.
      IF SY-SUBRC <> 0.                   " append line to table
        L_SELLINE = <TC>-LINES + 1.
    *&SPWIZARD: set top line                                               *
        IF L_SELLINE > <LINES>.
          <TC>-TOP_LINE = L_SELLINE - <LINES> + 1 .
        ELSE.
          <TC>-TOP_LINE = 1.
        ENDIF.
      ELSE.                               " insert line into table
        L_SELLINE = <TC>-TOP_LINE + L_SELLINE - 1.
        L_LASTLINE = <TC>-TOP_LINE + <LINES> - 1.
      ENDIF.
    *&SPWIZARD: set new cursor line                                        *
      L_LINE = L_SELLINE - <TC>-TOP_LINE + 1.
    *&SPWIZARD: insert initial line                                        *
      INSERT INITIAL LINE INTO <TABLE> INDEX L_SELLINE.
      <TC>-LINES = <TC>-LINES + 1.
    *&SPWIZARD: set cursor                                                 *
      SET CURSOR LINE L_LINE.
    ENDFORM.                              " FCODE_INSERT_ROW
    *&      Form  FCODE_DELETE_ROW                                         *
    FORM fcode_delete_row
                  USING    P_TC_NAME           TYPE DYNFNAM
                           P_TABLE_NAME
                           P_MARK_NAME   .
    &SPWIZARD: BEGIN OF LOCAL DATA----
      DATA L_TABLE_NAME       LIKE FELD-NAME.
      FIELD-SYMBOLS <TC>         TYPE cxtab_control.
      FIELD-SYMBOLS <TABLE>      TYPE STANDARD TABLE.
      FIELD-SYMBOLS <WA>.
      FIELD-SYMBOLS <MARK_FIELD>.
    &SPWIZARD: END OF LOCAL DATA----
      ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get the table, which belongs to the tc                     *
      CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
      ASSIGN (L_TABLE_NAME) TO <TABLE>.                "not headerline
    *&SPWIZARD: delete marked lines                                        *
      DESCRIBE TABLE <TABLE> LINES <TC>-LINES.
      LOOP AT <TABLE> ASSIGNING <WA>.
    *&SPWIZARD: access to the component 'FLAG' of the table header         *
        ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
        IF <MARK_FIELD> = 'X'.
          DELETE <TABLE> INDEX SYST-TABIX.
          IF SY-SUBRC = 0.
            <TC>-LINES = <TC>-LINES - 1.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDFORM.                              " FCODE_DELETE_ROW
    *&      Form  COMPUTE_SCROLLING_IN_TC
          text
         -->P_TC_NAME  name of tablecontrol
         -->P_OK       ok code
    FORM COMPUTE_SCROLLING_IN_TC USING    P_TC_NAME
                                          P_OK.
    &SPWIZARD: BEGIN OF LOCAL DATA----
      DATA L_TC_NEW_TOP_LINE     TYPE I.
      DATA L_TC_NAME             LIKE FELD-NAME.
      DATA L_TC_LINES_NAME       LIKE FELD-NAME.
      DATA L_TC_FIELD_NAME       LIKE FELD-NAME.
      FIELD-SYMBOLS <TC>         TYPE cxtab_control.
      FIELD-SYMBOLS <LINES>      TYPE I.
    &SPWIZARD: END OF LOCAL DATA----
      ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get looplines of TableControl                              *
      CONCATENATE 'G_' P_TC_NAME '_LINES' INTO L_TC_LINES_NAME.
      ASSIGN (L_TC_LINES_NAME) TO <LINES>.
    *&SPWIZARD: is no line filled?                                         *
      IF <TC>-LINES = 0.
    *&SPWIZARD: yes, ...                                                   *
        L_TC_NEW_TOP_LINE = 1.
      ELSE.
    *&SPWIZARD: no, ...                                                    *
        CALL FUNCTION 'SCROLLING_IN_TABLE'
             EXPORTING
                  ENTRY_ACT             = <TC>-TOP_LINE
                  ENTRY_FROM            = 1
                  ENTRY_TO              = <TC>-LINES
                  LAST_PAGE_FULL        = 'X'
                  LOOPS                 = <LINES>
                  OK_CODE               = P_OK
                  OVERLAPPING           = 'X'
             IMPORTING
                  ENTRY_NEW             = L_TC_NEW_TOP_LINE
             EXCEPTIONS
                 NO_ENTRY_OR_PAGE_ACT  = 01
                 NO_ENTRY_TO           = 02
                 NO_OK_CODE_OR_PAGE_GO = 03
                  OTHERS                = 0.
      ENDIF.
    *&SPWIZARD: get actual tc and column                                   *
      GET CURSOR FIELD L_TC_FIELD_NAME
                 AREA  L_TC_NAME.
      IF SYST-SUBRC = 0.
        IF L_TC_NAME = P_TC_NAME.
    *&SPWIZARD: et actual column                                           *
          SET CURSOR FIELD L_TC_FIELD_NAME LINE 1.
        ENDIF.
      ENDIF.
    *&SPWIZARD: set the new top line                                       *
      <TC>-TOP_LINE = L_TC_NEW_TOP_LINE.
    ENDFORM.                              " COMPUTE_SCROLLING_IN_TC
    *&      Form  FCODE_TC_MARK_LINES
          marks all TableControl lines
         -->P_TC_NAME  name of tablecontrol
    FORM FCODE_TC_MARK_LINES USING P_TC_NAME
                                   P_TABLE_NAME
                                   P_MARK_NAME.
    &SPWIZARD: EGIN OF LOCAL DATA----
      DATA L_TABLE_NAME       LIKE FELD-NAME.
      FIELD-SYMBOLS <TC>         TYPE cxtab_control.
      FIELD-SYMBOLS <TABLE>      TYPE STANDARD TABLE.
      FIELD-SYMBOLS <WA>.
      FIELD-SYMBOLS <MARK_FIELD>.
    &SPWIZARD: END OF LOCAL DATA----
      ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get the table, which belongs to the tc                     *
      CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
      ASSIGN (L_TABLE_NAME) TO <TABLE>.                "not headerline
    *&SPWIZARD: mark all filled lines                                      *
      LOOP AT <TABLE> ASSIGNING <WA>.
    *&SPWIZARD: access to the component 'FLAG' of the table header         *
        ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
        <MARK_FIELD> = 'X'.
      ENDLOOP.
    ENDFORM.                                          "fcode_tc_mark_lines
    *&      Form  FCODE_TC_DEMARK_LINES
          demarks all TableControl lines
         -->P_TC_NAME  name of tablecontrol
    FORM FCODE_TC_DEMARK_LINES USING P_TC_NAME
                                     P_TABLE_NAME
                                     P_MARK_NAME .
    &SPWIZARD: BEGIN OF LOCAL DATA----
      DATA L_TABLE_NAME       LIKE FELD-NAME.
      FIELD-SYMBOLS <TC>         TYPE cxtab_control.
      FIELD-SYMBOLS <TABLE>      TYPE STANDARD TABLE.
      FIELD-SYMBOLS <WA>.
      FIELD-SYMBOLS <MARK_FIELD>.
    &SPWIZARD: END OF LOCAL DATA----
      ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get the table, which belongs to the tc                     *
      CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
      ASSIGN (L_TABLE_NAME) TO <TABLE>.                "not headerline
    *&SPWIZARD: demark all filled lines                                    *
      LOOP AT <TABLE> ASSIGNING <WA>.
    *&SPWIZARD: access to the component 'FLAG' of the table header         *
        ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
        <MARK_FIELD> = SPACE.
      ENDLOOP.
    ENDFORM.                                          "fcode_tc_mark_lines
    FORM GET_DATA...
    FORM GET_DATA.
      CLEAR : I_KNVV_DATA, ZSD_BILLINFO, G_GRID_MAST_COPIED,
      G_GRID_MAST_ITAB, ZSD_RBT_MAS_DATA, KNVV, ZSD_RBT_ELG_INV.
      REFRESH: I_KNVV_DATA, G_GRID_MAST_ITAB.
      SELECT SINGLE * FROM KONA WHERE KNUMA = KONA-KNUMA.
      IF SY-SUBRC = 0.
        SELECT * FROM ZSD_RBT_MAS_DATA
               INTO
               CORRESPONDING FIELDS OF
               TABLE I_KNVV_DATA
               WHERE KNUMA = KONA-KNUMA.
        IF SY-SUBRC <> 0.
          SELECT * INTO CORRESPONDING FIELDS OF TABLE I_KNVV_DATA
          FROM KNVV
          WHERE KUNNR = KONA-BONEM.
          SELECT SINGLE * FROM ZSD_BILLINFO WHERE KUNAG = KONA-BONEM.
          LOOP AT I_KNVV_DATA.
            SELECT SINGLE * FROM ZSD_RBT_ELG_INV
                WHERE KNUMA = KONA-KNUMA
                  AND VKORG = I_KNVV_DATA-VKORG
                  AND VTWEG = I_KNVV_DATA-VTWEG
                  AND SPART = I_KNVV_DATA-SPART.
            IF SY-SUBRC = 0.
              I_KNVV_DATA-STATUS = ZSD_RBT_ELG_INV-ZFLAG.
            ENDIF.
            I_KNVV_DATA-GJAHR = ZSD_BILLINFO-GJAHR.
            I_KNVV_DATA-KNUMA = KONA-KNUMA.
            MODIFY I_KNVV_DATA INDEX SY-TABIX.
          ENDLOOP.
        ENDIF.
      ENDIF.
    ENDFORM.                    "GET_DATA
    FORM SAVE_DATA...
    FORM SAVE_DATA.
      IF NOT G_GRID_MAST_ITAB IS INITIAL.
        CALL FUNCTION 'POPUP_TO_CONFIRM'
           EXPORTING
            TITLEBAR                    = 'Confirmation'
      DIAGNOSE_OBJECT             = ' '
       TEXT_QUESTION               = 'Do you want to save the document?'
            TEXT_BUTTON_1               = 'YES'
      ICON_BUTTON_1               = ' '
            TEXT_BUTTON_2               = 'NO'
      ICON_BUTTON_2               = ' '
             DEFAULT_BUTTON              = '1'
             DISPLAY_CANCEL_BUTTON       = ''
      USERDEFINED_F1_HELP         = ' '
      START_COLUMN                = 25
      START_ROW                   = 6
      POPUP_TYPE                  =
      IV_QUICKINFO_BUTTON_1       = ' '
      IV_QUICKINFO_BUTTON_2       = ' '
          IMPORTING
            ANSWER                      = G_ANS
    TABLES
      PARAMETER                   =
          EXCEPTIONS
            TEXT_NOT_FOUND              = 1
            OTHERS                      = 2
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        IF G_ANS = '1'.
          SELECT SINGLE * FROM ZSD_RBT_MAS_DATA
              WHERE KNUMA = KONA-KNUMA.
          IF SY-SUBRC = 0.
            LOOP AT G_GRID_MAST_ITAB.
             IF G_GRID_MAST_ITAB-OTQTY > 0.
                  I_KNVV_DATA-PCPDAYS
                  I_KNVV_DATA-OTPC
                  I_KNVV_DATA-EBDFROM
                  I_KNVV_DATA-EBDTO
              ZSD_RBT_MAS_DATA-GJAHR = G_GRID_MAST_ITAB-GJAHR.
              ZSD_RBT_MAS_DATA-KNUMA = G_GRID_MAST_ITAB-KNUMA.
              ZSD_RBT_MAS_DATA-VKBUR = G_GRID_MAST_ITAB-VKBUR.
              ZSD_RBT_MAS_DATA-VKORG = G_GRID_MAST_ITAB-VKORG.
              ZSD_RBT_MAS_DATA-VTWEG = G_GRID_MAST_ITAB-VTWEG.
              ZSD_RBT_MAS_DATA-SPART = G_GRID_MAST_ITAB-SPART.
              ZSD_RBT_MAS_DATA-MATKL = G_GRID_MAST_ITAB-MATKL.
              ZSD_RBT_MAS_DATA-OTQTY = G_GRID_MAST_ITAB-OTQTY.
              ZSD_RBT_MAS_DATA-PCPDAYS = G_GRID_MAST_ITAB-PCPDAYS.
              ZSD_RBT_MAS_DATA-OTPC = G_GRID_MAST_ITAB-OTPC.
             ZSD_RBT_MAS_DATA-EBDFROM = G_GRID_MAST_ITAB-EBDFROM.
             ZSD_RBT_MAS_DATA-EBDTO = G_GRID_MAST_ITAB-EBDTO.
              MODIFY ZSD_RBT_MAS_DATA.
              COMMIT WORK.
             ENDIF.
            ENDLOOP.
          ELSE.
            LOOP AT G_GRID_MAST_ITAB.
             IF G_GRID_MAST_ITAB-OTQTY > 0.
                  I_KNVV_DATA-PCPDAYS
                  I_KNVV_DATA-OTPC
                  I_KNVV_DATA-EBDFROM
                  I_KNVV_DATA-EBDTO
              ZSD_RBT_MAS_DATA-GJAHR = G_GRID_MAST_ITAB-GJAHR.
              ZSD_RBT_MAS_DATA-KNUMA = G_GRID_MAST_ITAB-KNUMA.
              ZSD_RBT_MAS_DATA-VKBUR = G_GRID_MAST_ITAB-VKBUR.
              ZSD_RBT_MAS_DATA-VKORG = G_GRID_MAST_ITAB-VKORG.
              ZSD_RBT_MAS_DATA-VTWEG = G_GRID_MAST_ITAB-VTWEG.
              ZSD_RBT_MAS_DATA-SPART = G_GRID_MAST_ITAB-SPART.
              ZSD_RBT_MAS_DATA-OTQTY = G_GRID_MAST_ITAB-OTQTY.
              ZSD_RBT_MAS_DATA-PCPDAYS = G_GRID_MAST_ITAB-PCPDAYS.
              ZSD_RBT_MAS_DATA-OTPC = G_GRID_MAST_ITAB-OTPC.
             ZSD_RBT_MAS_DATA-EBDFROM = G_GRID_MAST_ITAB-EBDFROM.
             ZSD_RBT_MAS_DATA-EBDTO = G_GRID_MAST_ITAB-EBDTO.
              ZSD_RBT_MAS_DATA-STATUS = G_GRID_MAST_ITAB-STATUS.
              ZSD_RBT_MAS_DATA-MATKL = G_GRID_MAST_ITAB-MATKL.
              INSERT ZSD_RBT_MAS_DATA.
              COMMIT WORK.
             ENDIF.
            ENDLOOP.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDFORM.                    "SAVE_DATA
    ENDMODULE.                 " GRID_CHECK  OUTPUT

  • Update Custom Controls Throughout Program

    I am trying to come up with a way to update all of my custom controls throughtout the program without replacing every control individually. (Ex. I have a cluster (custom control) on a shift register which connects to several Vis therefor everytime I make a change to this cluster I must make the change in several places). I would like to only make one change and have it populate throughtout the program. Any Ideas???

    Hi ABB Rob,
    Take a look at saving the custom control as a "Strict Type def". Then replace all of the occurances of that control with the strict type def. Once you have done this, updates tath are saved to the control will be applied to every occurance.
    Note: If you pop-up and create a constant, it will be created based on the current strict type def. Changes will not propogate to these constatnts. Instead of doing the create constant thing, navigate to the strict type def. This will create the constant and link it to the strict def.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Team Foundation Server 2013 Refresh button not refreshing Custom Control values in TFS Templates

    Hi all,
    We have recently migrated from Team Foundation Server 2010 to Team Foundation Server 2013 Update 2. In TFS 2013 template design we found the refresh form control (inbuilt control of TFS) which is unable to refresh the custom control values that is built
    by us. Is there any way that we can programatically modify to enable the refresh button work with custom control.
    Please find below screenshot link for reference.
    http://postimg.org/image/z4mo3t8r9/
    SaranRam

    Hi SaranRam,
    The refresh button is there to allow the data that populated the work item to be refreshed. The data that you want refreshed is part of the rendering of the form and would only be refreshed when the browser refreshes. Refer to MrHinsh's reply in this
    page.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to create a custom control of a button where the look will be applied to all others but not the Boolean text?

    Hi all
    I would like to create a customized button as a master so that if I change the look of the master all other buttons will change too.
    I have done this with a custom control as a "strict type def" otherwise the look will not change BUT If I do this as a strict type def I cannot change the Boolean text anymore which should be different on every button.
    How can I create a master control of a button where the look will be applied to all others but not the Boolean text?
    Stay Hungry, Stay Foolish
    Solved!
    Go to Solution.

    Steve Chandler wrote:
    I don't think you can do that. I just looked and as I suspected the Boolean text property is read only for strict typedefs so you cannot use property nodes to change the text.
    As a workaround just make it a typedef. When you want to change the look open the typedef and make it strict, make your changes, then make it non strict again. You will have to update the Boolean text again for all instances. Kind of a pain. Maybe this is something for the idea exchange.
    Kudos for being sneaky.
    I like these creative work-arounds!
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to have custom control in DataGridView display object's value?

    I have a sample project located
    here
    The project has a main form `Form1` where the user can enter customers in a datagridview. The `CustomerType` column is a custom control and when the user clicks the button, a search form `Form2` pops up.
    The search form is populated with a list of type `CustomerType`. The user can select a record by double-clicking on the row, and this object should be set in the custom control. The `DataGridView` should then display the `Description` property but in the background
    each cell should hold the value (ie. the `CustomerType` instance).
    The relevant code is located in the following classes:
    The column class:
    public class DataGridViewCustomerTypeColumn : DataGridViewColumn
    public DataGridViewCustomerTypeColumn()
    : base(new CustomerTypeCell())
    public override DataGridViewCell CellTemplate
    get { return base.CellTemplate; }
    set
    if (value != null && !value.GetType().IsAssignableFrom(typeof(CustomerTypeCell)))
    throw new InvalidCastException("Should be CustomerTypeCell.");
    base.CellTemplate = value;
    The cell class:
    public class CustomerTypeCell : DataGridViewTextBoxCell
    public CustomerTypeCell()
    : base()
    public override void InitializeEditingControl(int rowIndex, object initialFormattedValue, DataGridViewCellStyle dataGridViewCellStyle)
    base.InitializeEditingControl(rowIndex, initialFormattedValue, dataGridViewCellStyle);
    CustomerTypeSearch ctl = DataGridView.EditingControl as CustomerTypeSearch;
    if (this.Value == null)
    ctl.Value = (CustomerType)this.DefaultNewRowValue;
    else
    ctl.Value = (CustomerType)this.Value;
    public override Type EditType
    get { return typeof(CustomerTypeSearch); }
    public override Type ValueType
    get { return typeof(CustomerType); }
    public override object DefaultNewRowValue
    get { return null; }
    And the custom control:
    public partial class CustomerTypeSearch : UserControl, IDataGridViewEditingControl
    private DataGridView dataGridView;
    private int rowIndex;
    private bool valueChanged = false;
    private CustomerType value;
    public CustomerTypeSearch()
    InitializeComponent();
    public CustomerType Value
    get { return this.value; }
    set
    this.value = value;
    if (value != null)
    textBoxSearch.Text = value.Description;
    else
    textBoxSearch.Clear();
    private void buttonSearch_Click(object sender, EventArgs e)
    Form2 f = new Form2();
    DialogResult dr = f.ShowDialog(this);
    if (dr == DialogResult.OK)
    Value = f.SelectedValue;
    #region IDataGridViewEditingControl implementation
    public object EditingControlFormattedValue
    get
    if (this.value != null)
    return this.value.Description;
    else
    return null;
    set
    if (this.value != null)
    this.value.Description = (string)value;
    public object GetEditingControlFormattedValue(DataGridViewDataErrorContexts context)
    return EditingControlFormattedValue;
    public void ApplyCellStyleToEditingControl(DataGridViewCellStyle dataGridViewCellStyle)
    this.BorderStyle = BorderStyle.None;
    this.Font = dataGridViewCellStyle.Font;
    public int EditingControlRowIndex
    get { return rowIndex; }
    set { rowIndex = value; }
    public bool EditingControlWantsInputKey(Keys key, bool dataGridViewWantsInputKey)
    return false;
    public void PrepareEditingControlForEdit(bool selectAll)
    //No preparation needs to be done
    public bool RepositionEditingControlOnValueChange
    get { return false; }
    public DataGridView EditingControlDataGridView
    get { return dataGridView; }
    set { dataGridView = value; }
    public bool EditingControlValueChanged
    get { return valueChanged; }
    set { valueChanged = value; }
    public Cursor EditingPanelCursor
    get { return base.Cursor; }
    #endregion
    private void CustomerTypeSearch_Resize(object sender, EventArgs e)
    buttonSearch.Left = this.Width - buttonSearch.Width;
    textBoxSearch.Width = buttonSearch.Left;
    However, the `DataGridView` is not displaying the text and it also is not keeping the `CustomerType` value for each cell.
    What am I missing?
    Marketplace: [url=http://tinyurl.com/75gc58b]Itza[/url] - Review: [url=http://tinyurl.com/ctdz422]Itza Update[/url]

    Hello,
    1. To display the text, we need to override the ToString method for CustomerType
    public class CustomerType
    public int Id { get; set; }
    public string Description { get; set; }
    public CustomerType(int id, string description)
    this.Id = id;
    this.Description = description;
    public override string ToString()
    return this.Description.ToString();
    2. To get the cell's value changed, we could pass the cell instance to that editing control and get its value changed with the following way.
    public partial class CustomerTypeSearch : UserControl, IDataGridViewEditingControl
    private DataGridView dataGridView;
    private int rowIndex;
    private bool valueChanged = false;
    private CustomerTypeCell currentCell = null;
    public CustomerTypeCell OwnerCell
    get { return currentCell; }
    set
    currentCell = null;
    currentCell = value;
    public CustomerTypeSearch()
    InitializeComponent();
    private void buttonSearch_Click(object sender, EventArgs e)
    Form2 f = new Form2();
    DialogResult dr = f.ShowDialog(this);
    if (dr == DialogResult.OK)
    currentCell.Value = f.SelectedValue;
    this.textBoxSearch.Text = f.SelectedValue.Description;
    #region IDataGridViewEditingControl implementation
    public object EditingControlFormattedValue
    get
    if (this.currentCell.Value != null)
    return (this.currentCell.Value as CustomerType).Description;
    else
    return null;
    set
    if (this.currentCell != null)
    (this.currentCell.Value as CustomerType).Description = (string)value;
    public object GetEditingControlFormattedValue(DataGridViewDataErrorContexts context)
    return EditingControlFormattedValue;
    public void ApplyCellStyleToEditingControl(DataGridViewCellStyle dataGridViewCellStyle)
    this.BorderStyle = BorderStyle.None;
    this.Font = dataGridViewCellStyle.Font;
    public int EditingControlRowIndex
    get { return rowIndex; }
    set { rowIndex = value; }
    public bool EditingControlWantsInputKey(Keys key, bool dataGridViewWantsInputKey)
    return false;
    public void PrepareEditingControlForEdit(bool selectAll)
    //No preparation needs to be done
    public bool RepositionEditingControlOnValueChange
    get { return false; }
    public DataGridView EditingControlDataGridView
    get { return dataGridView; }
    set { dataGridView = value; }
    public bool EditingControlValueChanged
    get { return valueChanged; }
    set { valueChanged = value; }
    public Cursor EditingPanelCursor
    get { return base.Cursor; }
    #endregion
    private void CustomerTypeSearch_Resize(object sender, EventArgs e)
    buttonSearch.Left = this.Width - buttonSearch.Width;
    textBoxSearch.Width = buttonSearch.Left;
    Cell:
    public class CustomerTypeCell : DataGridViewTextBoxCell
    public CustomerTypeCell()
    : base()
    public override void InitializeEditingControl(int rowIndex, object initialFormattedValue, DataGridViewCellStyle dataGridViewCellStyle)
    base.InitializeEditingControl(rowIndex, initialFormattedValue, dataGridViewCellStyle);
    CustomerTypeSearch ctl = DataGridView.EditingControl as CustomerTypeSearch;
    ctl.OwnerCell = this;
    public override Type EditType
    get { return typeof(CustomerTypeSearch); }
    public override Type ValueType
    get { return typeof(CustomerType); }
    public override object DefaultNewRowValue
    get { return null; }
    Result:
    Regards,
    Carl
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Custom Control Doesn't Load On Some Clients

    I have a LightSwitch application developed in Visual Studio 2012 that has been in production for several years without any major issues. The application has a custom control that has been included in the app from the very beginning. The app uses Silverlight
    5.
    I recently made a change and re-deployed the application to the server. This is not the first change deployed since the app was released. The custom control no longer renders when running the app on some clients. Not all clients are affected.
    This is only a problem when running the app from the production server. When I run the app from the development server, the custom control renders without any issues on all clients.
    When the app runs from the production server, I get the following in place of the custom control:
    How do I get the control to render when running the app from the production server?
    Thank you,
    Jack Helfrich

    I recently updated to io6 and ran into FB notification not sounding. So I decided to do a backup like I have done many of times. Well doing this all my custom tones went by by...Never changing anything in itunes. They worked fine up until I restored. I did all the trouble shooting steps like normal for my custom tones. Re-synched and so on. text goes off...nothing, changed to a default tone worked fine then change back to custom tone worked, except for purchased tones those still don't work. I re-purchase one tone I already bought and now works fine. All are working again accept the original problem of the notification tone for FB still not working.

  • ALE / IDOC / sales order customer control record change

    I'm trying to look for a "standard" answer.  Here's my problem:
    Record comes into SAP with a non-sap customer number that needs translated to SAP customer number.
    Options I'm looking into:
    1.  Use the user exit and pull the customer characteristic from the customer master.  Based on the characteristics then convert the control record.
    2.  Use the user exit at the sales order create.  Based on the characteristics then convert the sales order and do not convert the control record.
    3.  Use standard EDPAR and convert the control record.
    The problems:
    If I use code to change the sold to custmer number at the control record level, I'd like to do the same thing at the detail level.  The standard SAP code uses EDPAR.  There are many different user exits based on the IDOC type in the system.  I really don't want to change the code for each one.
    EDPAR is maintained by IS.  However, the customer master is in the business hands and is easily used.  The customer master would be the perfered way to do things.
    Any suggestions?  Has anyone else had a problem with the customer number in the control record?  We used to do it prior to moving the record into the SAP system.  We would like to move away from that.
    Thank you!
    Michelle

    OK so we have a strange setup.  Yes, sold-to and ship-to is in the sales order.
    The customer number in the control record is really our SAP sold-to number.  It also is the partner number.   It is required for WE20.  However when the IDOC comes into our system our customer doesn't always send the partner number.  They can send their number for our company, the DUNS number or others.  We have to take that number and convert it to our partner number.
    While conversion from X12 to IDoc, based on the ISA ID or Sold-to party number you should map the correct SAP partner number onto the control record.
    Coming to non-SAP sold-to party number in E1EDKA1 segment, the same non-sap sold-to number can be mapped to this segment but you should maintain EDPAR Entries. (VOE4).   Yes, I found that EDPAR seems to be the way SAP is expecting the conversions.  However, we want our customer service to maintain the conversion.   That means that it has to be in a good format.  So I could write a Z transaction over the EDPAR table for easier maintenance, or use the customer master screens.  The customer master seems to be a logical place for custmer service to enter in the conversions.  However, EDPAR is what SAP is expecting.  So I decided to have them update the customer master via characteristics, and then use a BADI to send the information to EDPAR.  Use "standard" functionality to change the control record.  I believe it is a user exit.
    Any questions??  I always have questions.   I think the above solution will work.   We haven't prototyped it yet.   That will happen soon.    My question was very generic and probably hard to follow.  
    Hopefully this clears up what I think we are going to do.  Any other solutions would be appreciated.   The control record may or may not be correct when it is recieved.  So we need to convert.  Another requirement is that customer service has to set up the conversion values.  VOE4 is not a good transaction for non-technical people to use.   So we need a better way.  
    Again we have voted to try the above solution.  But I welcome any other suggestions.
    Thannk you,
    Michelle

  • Adding commandLink to custom control

    I'm trying to create a custom control.
    I want to add a commandLink but really don't know how to bind to an action defined in the faces-config file. The commandLink is just link for navigation.
    I've put my code for the controle in de encodeBegins because i don't really need to use different renderers.
    How can i add the commandLink to my custom control and bind it to an action?
    THe action hasn't to be defined in an argument but is hard coded for now.
    I hope it's clear what i need....

    Hi Poorna,
       Thanks for the reply.
       I have to add field to the txn QM02. User will specify the value for the custom field in this txn and the same should be updated in the database table.
       The field is not a std SAP field, it is added to the table using append structure.
    Thanks,
    Punit

  • Custom controll showing repetative data

    Hello Friends,
    Im using custom control to allow user to enter long text in zmodule pool program.
    I have created three such custom control in my zscreen but when im saving the data all the three custom container is updating the database table with
    the data entered in the third custom control.
    Pls suggest what could be the reason ?
    Following is the code for your reference u2026 I hav repeated the same steps for the other two  custom control container
    Declarations *****************************************************
    CLASS event_handler DEFINITION.
      PUBLIC SECTION.
        METHODS: handle_f1 FOR EVENT f1 OF cl_gui_textedit
                 IMPORTING sender,
                 handle_f4 FOR EVENT f4 OF cl_gui_textedit
                 IMPORTING sender.
    ENDCLASS.                    "event_handler DEFINITION
    DATA:save_ok LIKE sy-ucomm.
    DATA: init,
          container TYPE REF TO cl_gui_custom_container,
          editor    TYPE REF TO cl_gui_textedit.
    DATA: event_tab TYPE cntl_simple_events,
          event     TYPE cntl_simple_event.
    DATA handle TYPE REF TO event_handler.
    DATA: line(256) TYPE c,
          text_tab LIKE STANDARD TABLE OF line,
          field LIKE line,
          wa_text type line,
          lv_txt type string,
          header like thead,
          header1 like thead,
          header2 like thead,
          tbtxt like standard table of line,
          WTBTXT type line,
          FTTXT LIKE STANDARD TABLE OF LINE,
          WFTTxt type line.
    Internal table to store the Longtext
    DATA:BEGIN OF I_LINES OCCURS 0.
            INCLUDE STRUCTURE TLINE.
    DATA:END OF I_LINES.
    DATA:BEGIN OF I_LINES1 OCCURS 0.
            INCLUDE STRUCTURE TLINE.
    DATA:END OF I_LINES1.
    DATA:BEGIN OF I_LINES2 OCCURS 0.
            INCLUDE STRUCTURE TLINE.
    DATA:END OF I_LINES2.
    Pbo
    MODULE STATUS_2000 OUTPUT.
      SET PF-STATUS 'ZPF2000'.
    SET TITLEBAR 'xxx'.
    IF init is initial.
       init = 'X'.
       FOR TEXTEDIT CUSTOM CONTROL
        CREATE OBJECT: container EXPORTING container_name = 'TEXTEDIT',
                       editor    EXPORTING parent = container,
                       handle.
        event-eventid = cl_gui_textedit=>event_f1.
        event-appl_event = ' '.                     "system event
        APPEND event TO event_tab.
        event-eventid = cl_gui_textedit=>event_f4.
        event-appl_event = 'X'.                     "application event
        APPEND event TO event_tab.
        CALL METHOD: editor->set_registered_events
                     EXPORTING events = event_tab.
        SET HANDLER handle->handle_f1
                    handle->handle_f4 FOR editor.
    ENDIF.
      CALL METHOD editor->set_text_as_stream
        EXPORTING
          text = text_tab.
    for tbtxt contaner
    CLEAR INIT.
    IF init is initial.
       init = 'X'.
        CREATE OBJECT: container EXPORTING container_name = 'TBTXT',
                       editor    EXPORTING parent = container,
                       handle.
      CALL METHOD editor->set_text_as_stream
        EXPORTING
          text = tbtxt.
    ENDMODULE.                 " STATUS_2000  OUTPUT
    PAI
    CASE SY-UCOMM.
        WHEN 'INSERT'.
          CONCATENATE ZSV_SD_SP-COMINV ZSV_SD_SP-COMINVYR INTO NAME.
          SELECT SINGLE * FROM STXH WHERE TDOBJECT = 'ZMEMO1'
                  AND TDNAME EQ NAME AND TDID EQ '0001'.
          IF SY-SUBRC EQ 0.
            DELETE FROM STXH WHERE TDOBJECT = 'ZMEMO1'
          AND TDNAME EQ NAME AND TDID EQ '0001'.
           COMMIT WORK AND WAIT.
            DELETE FROM STXL WHERE TDOBJECT = 'ZMEMO1'
        AND TDNAME EQ NAME AND TDID EQ '0001'.
    COMMIT WORK AND WAIT.
          ENDIF.
          CALL METHOD editor->get_text_as_stream
            IMPORTING
              text = text_tab.
          IF NOT TEXT_TAB[] IS INITIAL.
            LOOP AT TEXT_TAB INTO WA_TEXT.
              I_LINES-TDLINE = WA_TEXT-LINE.
              APPEND I_LINES.
              CLEAR : I_LINES,WA_TEXT.
            ENDLOOP.
            HEADER-TDOBJECT = 'ZMEMO1'.
            HEADER-TDNAME   = NAME.
            HEADER-TDID     = '0001'.
            HEADER-TDSPRAS  = SY-LANGU.
            CALL FUNCTION 'SAVE_TEXT'
              EXPORTING
               CLIENT                = SY-MANDT
                HEADER               = HEADER
               INSERT                = 'X'
      SAVEMODE_DIRECT       = ' '
      OWNER_SPECIFIED       = ' '
      LOCAL_CAT             = ' '
    IMPORTING
      FUNCTION              =
      NEWHEADER             =
              TABLES
                LINES                 = I_LINES[]
            IF SY-SUBRC EQ 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
              COMMIT WORK AND WAIT.
             REFRESH TEXT_TAB.
             CALL SCREEN 1000.
            ENDIF.
          ENDIF.
    ENDMODULE.                 " USER_COMMAND_2000  INPUT
    Kind Regards,
    Sunny Vaswani

    Hello Sandeep,
    One possiblility I suspect is only single internal table is getting used for all the three custom containers.
    Only then it is possible that finally that internal table will have data from 3rd container.
    Try defining different internal table per custom containers and then on save event you
    can save those internal tables to database one by one.
    One more way to debug this program is go unit wise.
    For e.g.
    During first test only enable code for first editor and save data from that container to database.
    like wise you can go on enabling code for rest of two containers this way you will come to know where
    actually data is getting overwritten.
    Apart from that I would also like to suggest you to follow abap standard and avoid using obsolute statements like occur etc.
    Also you can make use of Markup facilities for posting code which is provided on right bottom of sdn page.
    for e.g.
    -> Displays the line as programming code
    Check if this can help!
    Enjoy SAP!
    Augustin.

  • I need create a custom control for visualization HTML

    Hi guys,
      I need create a custom control for HTML files visualization on SAPGUI JAVA. I created a sample program and perfectly run on SAPGUI Windows.
    Thanks.
    Regards.
    Jose Antonio Campos.

    Hi,
    Just as a quick start
    http://gumbo.flashhub.net/sizer/  (view source enabled).
    this uses a skin to make a titlewindow resizable, its not about the skin as much as giving you a starting point for resizing code.
    if you look into the skin you will see these functions
    protected function sizer_mouseDownHandler(event:MouseEvent):void
    OldX=event.stageX;
    OldY=event.stageY;
    systemManager.addEventListener(MouseEvent.MOUSE_MOVE,startResize);
    systemManager.addEventListener(MouseEvent.MOUSE_UP,endResize);
    protected function endResize(event:MouseEvent):void
    systemManager.removeEventListener(MouseEvent.MOUSE_MOVE,startResize);
    systemManager.removeEventListener(MouseEvent.MOUSE_UP,endResize);
    private function startResize(event:MouseEvent): void
    hostComponent.width -= OldX-event.stageX;
    hostComponent.height -= OldY-event.stageY;
    OldX=event.stageX;
    OldY=event.stageY;
    The idea is to have a hit area on your custom component (a corner, or all corners). You capture the mouseposition when you mousedown then in the mouse move eventlistener you update the object size with the difference between current X and Y from initial X and Y.
    Hope this gets you started.
    David

  • Issue in Custom Control UI element

    Hi there,
                   I have created 2 custom controls(SAP mobile 7.1), one for rendering images(actually map images) and another for capturing user's signature. Both are integrated into the main application and works fine when alone. But when present together, certainly on different screens in the main app, still it works but with rendering problems. Say when navigating from the screen that displays the map custom control to the screen that has the signature capuring custom control, the map image is still getting displayed over the signature custom control view.
               I wonder , if the problem is with disposing of the custom control. Can anyone suggest how to do that. Or something else has to be done?
    Regards,
    Aravind

    Hopefully someone more knowledgeable about custom controls \ SWT can add some input
    I do know disposing the SWT controls is important but not sure if it would solve your problem
    from our application that uses a few simple custom controls together, we definitely needed to use dispose or it would cause memory consumption issues and slow performance
    within the constructor
    [Text object].addDisposeListener(this);
    method to dispose color and fonts used
    public void widgetDisposed(DisposeEvent event)
                  font.dispose();
                  amber.dispose();

  • OOP ALV report custom control performance problem

    HI
    how to write OOP ALV report without custom control.. Actually with custom control which taking long time... and time out happens for huge selection of data..
    Regards
    Roops.

    timeout is not an alv problem. If you try to display a "huge" amount of data, any display technology will fail. Even sap programs fail, their wise solution is to ask user to restrict data to be displayed. Or reduce database selection time, or display amount. Or propose the user to download data as a spool, or output to a file on server.
    Otherwise, read some advices about how to handle timeout in [Note 25528 - Parameter rdisp/max_wprun_time|http://service.sap.com/sap/support/notes/25528].
    About your question, if you still want to try, look at [example code with alv class cl_salv_table for simple display|http://help.sap.com/saphelp_nw2004s/helpdata/en/f9/1ab54099de3726e10000000a1550b0/frameset.htm]

  • How do I find the EventID of an event in a custom control?

    Hi all,
    I have a custom control created in VB .NET that I have embedded into a SAP screen using a wrapper class as described in Thomas Jungs example: <a href="/people/thomas.jung3/blog/2004/09/01/using-net-windows-controls-in-the-abap-control-framework .Net Windows Controls in the ABAP Control Framework</a>
    My problem is that I cannot get the wrapper class to react to any events raised by the custom control!
    I do not know how to find what the EventID is of an event so that I can register it in the class - do you know how to find this EventID? Or even if this is the problem?
    Tx.
    N

    Is there any way to find the image dpi in a free or low cost program?

  • How to limit the number of rows in the Custom Control box

    Hi All,
    In my Module pool screen I have a Custom Control box for providing some free text as input. Now, there is no limit in the number of rows allowed for this box.
    But, the requirement is, it should have the maximum number of rows = 99. and each row should have maximum length = 60 characters.
    User should not be allowed to enter more than 60 characters per row and more than 99 rows.
    Could you please let me know how to do this..? Are there any methods available which controls the maximum number of rows and maximum length per row..?
    Please help me in resolving the issue. Thanks in advance.
    Thanks & Regards,
    Paddu.

    By "Custom Control Box", do you mean a Custom Container or a Table Control?
    Anyway, I suggest you to use a table control (not a custom container as your requirement seems to be very precise on that point, maybe ask your client twice to make sure). Look at the examples of table controls in ABAPDOCU transaction.

Maybe you are looking for