Popup in ALV

Hi! All
        What does the popup option do in ALV Layout?
Thanks & Regards,
Nagulan

Hi! All
        What does the popup option do in ALV Layout?
Thanks & Regards,
Nagulan

Similar Messages

  • Popup from ALV for displaying full text = problems!!!

    Dear all,
       I created an ALV to display data. In this ALV, I have a text column, which just show FIRST 30 characters of the original text.
      Now I want to double click on that field, and it will pop up a small window to show full text (the original text, unknown length).
    I made lots of references and I decided to use FM POPUP_WITH_TABLE because of some reasons:
    a)  the original text is retrieved from another FM READ_TEXT. After the call of READ_TEXT, the text will be stored into an internal table. Then, it can be passed to POPUP_WITH_TABLE without more modification.
    b) POPUP_WITH_TABLE can show the text more meaningfully. I mean, if the length of the text is greater than the length of the popup window, it <b>automatically break the line and displays the rest in the next line</b>. ( FM POPUP_TO_INFORM does NOT do that.)
    However, I've faced some <b>PROBLEMS</b> with FM POPUP_WITH_TABLE
    1) The popup window has 2 button OK and Cancel. <b>Is there any way just to display Cancel button?</b>
    2) If I click on Cancel or OK without choose any line on the popup window => It will raise an exception, called BREAK_OFF. In this case
    If the clicked button is CANCEL => it will close the popup
    If  the clicked button is OK => nothing happens. And I must click on CANCEL to close the popup.
    <b>I want to close the popup windown without raising any exceptions. How can I ?</b>
    3) When I enter many complex selection criteria on Selection Screen to limit the result, displaying ALV is good. But when I click on the text field to popup => the report cannot be manipulated. I have to kill the session in SM04.
    <b>What's wrong? </b>(because for single selection criteria, it works well.)
    Every body has any suggestions?
    Thank you in advance

    I solved it. I just use another list for pop-up event.
    Although it worked well now, I thought it was not a good solution.
    Thank you all of you.
    Best regards.

  • When clic in the field "i_ekpo-ebeln" tab exit in report ALV

    Good Afternoon! *********************************************************
    Coloquei all the code, I believe for better clarification. When clico in the field i_ekpo-ebeln in the report is called transaction ME23 c/o GRID this functioning normally, but with the reports List and Hierarquico it does not happen the same and it prints in the baseboard the message "Invalid Function". when standard use buttons, functions of course.
    obs.: I had that to create a SET Pf-status for each type of report pos I wanted that when clicar in the field box and clicar in the button "TO PRINT REPORT" it printed sapscript. How I make to solve such problem?
    Att, Carlos Eduardo.
    REPORT ztreino NO STANDARD PAGE HEADING LINE-SIZE 220.
    ************************declarações*********************
    DATA: BEGIN OF y_ekko OCCURS 0,
            ebeln TYPE ekko-ebeln,  "Nº documento de compra
            bukrs TYPE ekko-bukrs,  "Empresa
            bsart TYPE ekko-bsart,  "Documento de compra
            loekz TYPE ekko-loekz,  "Código de eliminação
            aedat TYPE ekko-aedat,  "Data de criação do registro
            ernam TYPE ekko-ernam,  "Nome do responsável que criou o objeto
            lifnr TYPE ekko-lifnr,  "Nº conta do fornecedor
            ekgrp TYPE ekko-ekgrp,  "Grupo de compradores
            waers TYPE ekko-waers,  "Chave da moeda
            BOX   TYPE ptrv_approval-box, "campo para chekinbox
          END OF y_ekko,
          BEGIN OF y_ekpo OCCURS 0,
            ebeln TYPE ekpo-ebeln,  "Nº documento de compra
            ebelp TYPE ekpo-ebelp,  "Nº item do documento de compra
            loekz TYPE ekpo-loekz,  "Código de eliminação
            txz01 TYPE ekpo-txz01,  "Texto breve
            matnr TYPE ekpo-matnr,  "Nº material
            bukrs TYPE ekpo-bukrs,  "Empresa
            werks TYPE ekpo-werks,  "Centro
            menge TYPE ekpo-menge,  "Quantidade do pedido
            netpr TYPE ekpo-netpr,  "Preço líquido no documento de compra
            BOX   TYPE ptrv_approval-box, "campo para chekinbox
          END OF y_ekpo.
    *início seleção de dados
    SELECTION-SCREEN BEGIN OF BLOCK bl2 WITH FRAME TITLE text-000.
    SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP.
                                    *Nº documento de compra
    SELECT-OPTIONS : s_ebeln FOR ekko-ebeln NO INTERVALS OBLIGATORY,
                     s_bukrs FOR ekko-bukrs OBLIGATORY,  "Empresa
                     s_bsart FOR ekko-bsart.  "Documento de compra
    SELECTION-SCREEN END OF BLOCK bl1.
    SELECTION-SCREEN END OF BLOCK bl2.
    **fim da seleção de dados----
    **início da variante
    SELECTION-SCREEN BEGIN OF BLOCK bl4 WITH FRAME TITLE text-000.
    SELECTION-SCREEN BEGIN OF BLOCK bl3 WITH FRAME TITLE text-002.
    PARAMETERS : p_vari LIKE disvariant-variant.
    SELECTION-SCREEN END OF BLOCK bl3.
    SELECTION-SCREEN END OF BLOCK bl4.
    ***fim variante -
    ***início modo relatório
    SELECTION-SCREEN BEGIN OF BLOCK bl5 WITH FRAME TITLE text-000.
    SELECTION-SCREEN BEGIN OF BLOCK bl6 WITH FRAME TITLE text-003.
    SELECTION-SCREEN SKIP.
      PARAMETERS : rb1 RADIOBUTTON GROUP TIPO DEFAULT 'X',
                   rb2 RADIOBUTTON GROUP TIPO,
                   rb3 RADIOBUTTON GROUP TIPO.
    SELECTION-SCREEN END OF BLOCK bl6.
    SELECTION-SCREEN END OF BLOCK bl5.
    ****fim modo relatório
    *******início da opção de download
    Dados do arquivo texto de saída.
    SELECTION-SCREEN BEGIN OF BLOCK bl9 WITH FRAME TITLE text-004.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(15) text-005.
    PARAMETERS: p_gerar  AS CHECKBOX.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(15) text-006.
    PARAMETERS: p_dir  LIKE rlgrap-filename DEFAULT 'c:'.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(15) text-007.
    PARAMETERS: p_arq  LIKE rlgrap-filename DEFAULT 'nota-geral.txt'.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN END OF BLOCK bl9.
    DATA :
          i_ekko  LIKE     y_ekko OCCURS 0 WITH HEADER LINE,
          i_ekpo  LIKE     y_ekpo OCCURS 0 WITH HEADER LINE.
         i_tabsaida LIKE  y_saida OCCURS 0 WITH HEADER LINE.
    *********************Fim Declarações*******************************
    *********************Declarações ALV*******************************
    TYPE-POOLS : slis.
    DATA :
           s_layout    TYPE  slis_layout_alv,
           t_sort      TYPE  slis_t_sortinfo_alv WITH HEADER LINE,
           t_fieldcat  TYPE  slis_t_fieldcat_alv WITH HEADER LINE,
           s_grupos    TYPE  slis_t_sp_group_alv WITH HEADER LINE,
           s_keyinfo   TYPE  slis_keyinfo_alv,
           extab       TYPE  slis_t_extab.
    DATA :
           variant_exit(1) TYPE  c,
           def_variant(1)  TYPE  c,
           s_print      TYPE  slis_print_alv,
           s_top        TYPE  slis_t_listheader,
           variante     TYPE  disvariant,
           def_variante TYPE  disvariant,
           v_repid      LIKE  sy-repid,
    *------pega a data que esta rodando a transação
           v_datasaida(10)  TYPE C,
    *------para saber quantos Pedidos na EKKO
           v_exibe      TYPE I,
           s_selfield type slis_selfield,
           v_ucomm like sy-ucomm.
    **********************Fim declarações ALV*************************
                   Contants para Sapscript e declarações                 *
    TABLES: ITCPO.
    CONSTANTS:  c_on(1)  TYPE  C  VALUE  'X',    "Parâmetro para o Sapscript
                c_off(1) TYPE  C  VALUE  ''.     "Parâmetro para o Sapscript
    Data:
          v_element(15) TYPE C,  "Elemento de texto do Sap Script
          v_type(15)    TYPE C,  "BODY
          v_window(15)  TYPE C,  "Janela
          flag          TYPE I,  "Uma condição para impressão do sapscript
          resp          TYPE C,  "resposta para confirmação do download tab
          zlen          TYPE I,  "Para verificar o um diretório válido
    Para a função WS_DOWNLOAD só em declarar as variaveis deste tipo já *
    seria o bastante para passar o caminho para a função
    TABLES : ekko, ekpo.
                       initialization                                    *
    INITIALIZATION.
      PERFORM zf_verifica_variante.
                   at selection-screen on value-request                  *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
      PERFORM zf_busca_variante_existente.
                 at seletion-screen                                      *
    AT SELECTION-SCREEN.
      PERFORM zf_valida_variante.
    validar os campo antes de fazer download do arquivo
      PERFORM zf_trata_parametros_gerar_arqu.
                start-of-selection                                       *
    START-OF-SELECTION.
      PERFORM zf_seleciona_dados.
                       Criando ALV                                       *
      PERFORM zf_alv.
    *&      Form  zf_verifica_variante
          text
    -->  Verifica se a variante selecionada é existente
    FORM zf_verifica_variante.
      CLEAR variante.
      v_repid = sy-repid.
      variante-report = v_repid.
    Buscar variante default
      def_variante = variante.
      CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
           EXPORTING
                i_save        = 'A'
           CHANGING
                cs_variant    = def_variante
           EXCEPTIONS
                wrong_input   = 1
                not_found     = 2
                program_error = 3
                OTHERS        = 4.
      IF sy-subrc EQ 0.
        p_vari = def_variante-variant.
      ENDIF.
    ENDFORM.                    " zf_verifica_variante
    *&      Form  zf_busca_variante_existente
    *-       text
    *-  --> Vai buscar a variante existente
    FORM zf_busca_variante_existente.
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
           EXPORTING
                is_variant          = variante      " Report com as
                i_save              = 'A'           " Variantes Salvas
                i_tabname_header    = 'I_EKPO'      " Tabela interna saida
                it_default_fieldcat = t_fieldcat[]  " Tabela de formatação
                i_display_via_grid  = 'X'  " Dispara POPUP em ALV
           IMPORTING
                e_exit           = variant_exit  " Se não existir variante X
                es_variant       = def_variante     " Variante default
           EXCEPTIONS
                not_found           = 1
                program_error       = 2
                OTHERS              = 3.
      IF sy-subrc = 2.
          MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ELSE.
        IF variant_exit = space.
          p_vari = def_variante-variant. " Recebe variante escolhida
        ENDIF.
      ENDIF.
    ENDFORM.                    " zf_busca_variante_existente
    *-&      Form  zf_valida_variante
    *-       text
    *-  -->  Verifica se a variante digitada é válida.
    FORM zf_valida_variante.
      IF NOT p_vari IS INITIAL.
        variante             =     def_variante.    "nome do report
        def_variante-variant =     p_vari.          "nome que foi digitado
        CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
             EXPORTING
                  i_save     = 'A'
             CHANGING
                  cs_variant = def_variante
                  variante   = def_variante.
      ELSE.
        clear variante.
        variante-report = v_repid.
      ENDIF.
    ENDFORM.                    " zf_valida_variante
    -&      Form  zf_seleciona_dados
    *-       text
    -->  Seleciona os dados da ekko e ekpo
    FORM zf_seleciona_dados.
      SELECT ebeln
           bukrs
           bsart
           loekz
           aedat
           ernam
           lifnr
           ekgrp
           waers
            FROM ekko
            INTO TABLE i_ekko
            WHERE
                 ( ebeln IN s_ebeln AND
                   bsart EQ 'NB' ).
    SORT I_EKKO ASCENDING.
      IF sy-subrc EQ 0.
        SELECT ebeln
               ebelp
               loekz
               txz01
               matnr
               bukrs
               werks
               menge
               netpr
                FROM ekpo
                INTO TABLE i_ekpo
                FOR ALL ENTRIES IN i_ekko
                WHERE
                     ( ebeln EQ i_ekko-ebeln ).
      ENDIF.
    SORT I_EKPO ASCENDING.
    Para exibir no topo do relatório no grid
    DESCRIBE TABLE I_EKKO LINES v_exibe.
    ENDFORM.                    " zf_seleciona_dados
    *-&      Form  zf_ALV
    *-       text
    -->  Opções de alv
    FORM zf_alv.
    IF rb1 = 'X'.
              PERFORM zf_gri.
    ENDIF.
    IF rb2 = 'X'.
              PERFORM ZF_HIERARQUICO.
    ENDIF.
    IF rb3  =  'X'.
              PERFORM ZF_LIST.
    ENDIF.
    ENDFORM.                    " zf_ALV
    *&      Form  zf_gri
    *-       text
    *-  -->  Seqüência para gerar o alv grid
    FORM zf_gri.
      PERFORM zf_layout.
      PERFORM zf_ordena_campos.
      PERFORM zf_monta_campos_alv.
      PERFORM zf_print.
      PERFORM zf_grupo.
      PERFORM zf_top  USING  s_top.
      IF  NOT  I_EKPO[] IS INITIAL.
        PERFORM zf_imprime_alv.
      ELSE.
        MESSAGE s000(zcl001)  WITH  'Nenhum registro encontrado.'.
        STOP.
      ENDIF.
    ENDFORM.                    " zf_gri
    *-&      Form  zf_layout
    *-       text
    -->  cria o layout do alv
    FORM zf_layout.
      s_layout-box_tabname          = 'I_EKPO'.
      s_layout-box_fieldname        = 'BOX'.
      s_layout-get_selinfos         =  'X'.
      s_layout-detail_popup         =  'X'.
      s_layout-detail_initial_lines =  'X'.
      s_layout-zebra                =  'X'.
      s_layout-colwidth_optimize    =  'X'.
    ENDFORM.                    " zf_layout
    *-&      Form  zf_ordena_campos
    *-       text
    -->  Ordenação dos campos
    FORM zf_ordena_campos.
      CLEAR t_sort.
      t_sort-spos      =  '1'.          "prioridade de ordenação
      t_sort-fieldname =  'EBELN'.      "campo da tab int. de saida
      t_sort-tabname   =  'I_EKPO'.     "tab inter de saida
      t_sort-up        =  'X'.          "ordenação do maior para o menor
      APPEND t_sort.
    ENDFORM.                    " zf_ordena_campos
    *-&      Form  zf_monta_campos_alv
          text
    -->  è passado os campos de acordo com a ordem de exibição inicial
    FORM zf_monta_campos_alv.
    IF rb2  =  'X'.
      CLEAR t_FIELDCAT.
      t_FIELDCAT-FIELDNAME      =  'BOX'.
      t_FIELDCAT-TABNAME        =  'I_EKKO'.
      t_FIELDCAT-CHECKBOX       =  'X'.
      t_FIELDCAT-INPUT          =  'X'.
      APPEND t_FIELDCAT.
      CLEAR t_fieldcat.
      t_fieldcat-fieldname      =  'EBELN'.
      t_fieldcat-tabname        =  'I_EKKO'.
      t_fieldcat-ref_fieldname  =  'EBELN'.
      t_fieldcat-ref_tabname    =  'EKKO'.
      APPEND t_fieldcat.
      CLEAR t_fieldcat.
      t_fieldcat-fieldname      =  'BUKRS'.
      t_fieldcat-tabname        =  'I_EKKO'.
      t_fieldcat-ref_fieldname  =  'BUKRS'.
      t_fieldcat-ref_tabname    =  'EKKO'.
      APPEND t_fieldcat.
      CLEAR t_fieldcat.
      t_fieldcat-fieldname      =  'BSART'.
      t_fieldcat-tabname        =  'I_EKKO'.
      t_fieldcat-ref_fieldname  =  'BSART'.
      t_fieldcat-ref_tabname    =  'EKKO'.
      APPEND t_fieldcat.
      CLEAR t_fieldcat.
      t_fieldcat-fieldname      =  'AEDAT'.
      t_fieldcat-tabname        =  'I_EKKO'.
      t_fieldcat-ref_fieldname  =  'AEDAT'.
      t_fieldcat-ref_tabname    =  'EKKO'.
      APPEND t_fieldcat.
      CLEAR t_fieldcat.
      t_fieldcat-fieldname      =  'ERNAM'.
      t_fieldcat-tabname        =  'I_EKKO'.
      t_fieldcat-ref_fieldname  =  'ERNAM'.
      t_fieldcat-ref_tabname    =  'EKKO'.
      APPEND t_fieldcat.
      CLEAR t_fieldcat.
      t_fieldcat-fieldname      =  'LIFNR'.
      t_fieldcat-tabname        =  'I_EKKO'.
      t_fieldcat-ref_fieldname  =  'LIFNR'.
      t_fieldcat-ref_tabname    =  'EKKO'.
      APPEND t_fieldcat.
      CLEAR t_fieldcat.
      t_fieldcat-fieldname      =  'EKGRP'.
      t_fieldcat-tabname        =  'I_EKKO'.
      t_fieldcat-ref_fieldname  =  'EKGRP'.
      t_fieldcat-ref_tabname    =  'EKKO'.
      APPEND t_fieldcat.
    ENDIF.
      CLEAR t_fieldcat.
      t_fieldcat-fieldname      =  'EBELN'.
      t_fieldcat-tabname        =  'I_EKPO'.
      t_fieldcat-ref_fieldname  =  'EBELN'.
      t_fieldcat-ref_tabname    =  'EKPO'.
      t_fieldcat-key            =  'X'.
      t_fieldcat-Hotspot        =  'X'.
      APPEND t_fieldcat.
      CLEAR t_fieldcat.
      T_fieldcat-fieldname     = 'EBELP'.
      T_fieldcat-tabname       = 'I_EKPO'.
      T_fieldcat-ref_fieldname = 'EBELP'.
      T_fieldcat-ref_tabname   = 'EKPO'.
      APPEND t_fieldcat.
      CLEAR t_fieldcat.
      t_fieldcat-fieldname      =  'MATNR'.
      t_fieldcat-tabname        =  'I_EKPO'.
      t_fieldcat-ref_fieldname  =  'MATNR'.
      t_fieldcat-ref_tabname    =  'EKPO'.
      APPEND t_fieldcat.
      CLEAR t_fieldcat.
      t_fieldcat-fieldname      =  'WERKS'.
      t_fieldcat-tabname        =  'I_EKPO'.
      t_fieldcat-ref_fieldname  =  'WERKS'.
      t_fieldcat-ref_tabname    =  'EKPO'.
      APPEND t_fieldcat.
      CLEAR t_fieldcat.
      t_fieldcat-fieldname      =  'MENGE'.
      t_fieldcat-tabname        =  'I_EKPO'.
      t_fieldcat-ref_fieldname  =  'MENGE'.
      t_fieldcat-ref_tabname    =  'EKPO'.
      APPEND t_fieldcat.
      CLEAR t_fieldcat.
      t_fieldcat-fieldname      =  'NETPR'.
      t_fieldcat-tabname        =  'I_EKPO'.
      t_fieldcat-ref_fieldname  =  'NETPR'.
      t_fieldcat-ref_tabname    =  'EKPO'.
      t_fieldcat-do_sum         =  'X'. "totalizar campo
      APPEND t_fieldcat.
      CLEAR t_fieldcat.
      t_fieldcat-fieldname      =  'TXZ01'.
      t_fieldcat-tabname        =  'I_EKPO'.
      t_fieldcat-ref_fieldname  =  'TXZ01'.
      t_fieldcat-ref_tabname    =  'EKPO'.
      APPEND t_fieldcat.
    ENDFORM.                    " zf_monta_campos_alv
    *-&      Form  zf_top
    *-       text
    *-  --> Cria o texto de cabeçalho do ALV, passando por parametro o
    --> p_S_TOP para s_top
    FORM zf_top USING p_s_top  TYPE slis_t_listheader.
      DATA: ls_line  TYPE  slis_listheader.
      CLEAR  ls_line.
      ls_line-typ  =  'H'.
      ls_line-info  =  'Relatório de Compras por Classificação Contábil'.
      APPEND ls_line  TO  p_s_top.
      CLEAR  ls_line.
      ls_line-typ  =  'S'.
      ls_line-KEY  =  'Parametros Seleção '.
      ls_line-info  = '- Documento de compra'.
      APPEND ls_line  TO  p_s_top.
      CLEAR  ls_line.
      ls_line-typ  =  'S'.
      ls_line-info  = '- Empresa'.
      APPEND ls_line  TO  p_s_top.
      CLEAR  ls_line.
      ls_line-typ  =  'S'.
      ls_line-info  = '- Tip.doc.compra'.
      APPEND ls_line  TO  p_s_top.
      CLEAR  ls_line.
      ls_line-typ  =  'S'.
      ls_line-KEY  =  'Total Pedido'.
      ls_line-info  = v_exibe.
      APPEND ls_line  TO  p_s_top.
    início Formatar a data
      CALL FUNCTION 'DATUMSAUFBEREITUNG'
       EXPORTING
         IDATE                 = SY-DATUM
       IMPORTING
         TDAT8                 = v_datasaida.
    Fim Formatar a data
      CLEAR  ls_line.
      ls_line-typ  =  'S'.
      ls_line-KEY  =  'Data da execução'.
      ls_line-info  = v_datasaida.
      APPEND ls_line  TO  p_s_top.
      CLEAR  ls_line.
      ls_line-typ  =  'S'.
      ls_line-KEY  =  'Usuário'.
      APPEND ls_line  TO  p_s_top.
      CLEAR  ls_line.
      ls_line-typ  =  'A'.
      ls_line-info  = sy-uname.
      APPEND ls_line  TO  p_s_top.
    ENDFORM.                    " zf_top
    *-&      Form  zf_print
    *-       text
    *-  -->  Parametros de Impressão para o ALV
    FORM zf_print.
      s_print-no_print_selinfos     =  'N'.
      s_print-no_print_listinfos    =  'N'.
    ENDFORM.                    " zf_print
    *-&      Form  zf_imprime_alv
    *-       text
    *-  -->  Imprime o ALV c/ seu parametros
    FORM zf_imprime_alv.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         I_CALLBACK_PF_STATUS_SET          = 'ZSET_PF_STATUS'
         I_CALLBACK_USER_COMMAND           = 'ZF_USER_COMMAND'
         i_callback_program                = v_repid
         i_callback_top_of_page            = 'TOP_OF_PAGE'
         is_layout                         =  s_layout
         it_fieldcat                       =  t_fieldcat[]
        IT_EXCLUDING                      =
         IT_SPECIAL_GROUPS                 = S_GRUPOS[]
         it_sort                           = t_sort[]
        IT_FILTER                         =
        IS_SEL_HIDE                       =
         i_default                         = 'X'
         i_save                            = 'A'
         is_variant                        = variante
        IT_EVENTS                         =
        IT_EVENT_EXIT                     =
         IS_PRINT                          = S_PRINT
        IS_REPREP_ID                      =
         I_SCREEN_START_COLUMN             = 0
         I_SCREEN_START_LINE               = 0
         I_SCREEN_END_COLUMN               = 0
         I_SCREEN_END_LINE                 = 0
        IT_ALV_GRAPHICS                   =
        IT_ADD_FIELDCAT                   =
        IT_HYPERLINK                      =
        I_HTML_HEIGHT_TOP                 =
        I_HTML_HEIGHT_END                 =
      IMPORTING
        E_EXIT_CAUSED_BY_CALLER           =
        ES_EXIT_CAUSED_BY_USER            =
        TABLES
          t_outtab                          = I_EKPO
       EXCEPTIONS
         program_error                     = 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.
    ENDFORM.                    " zf_imprime_alv
    *-&      Form  zf_top-of-page
    *-       text
    -->  Cabeçalho ALV
    FORM top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
                it_list_commentary       = s_top
                i_logo                   = 'CARLOS_LOGO3'.
      I_END_OF_LIST_GRID       = .
    ENDFORM.                    " zf_top-of-page
    *-&      Form  ZF_HIERARQUICO
    *-       text
    *-  -->  RELATÓRIO HIERÁQUICO
    form ZF_HIERARQUICO.
      PERFORM zf_layout.
      PERFORM zf_ordena_campos.
      PERFORM zf_monta_campos_alv.
      PERFORM zf_print.
      PERFORM zf_grupo.
      IF  NOT  I_EKPO[] IS INITIAL.
        PERFORM zf_imprime_hierarquico_alv.
      ELSE.
        MESSAGE s000(zcl001)  WITH  'Nenhum registro encontrado.'.
        STOP.
      ENDIF.
    endform.                    " ZF_HIERARQUICO
    *-&      Form  zf_grupo
         text
    -->  Não é fundamental a criação de grupos de campos, mas facilita
    ao usuário na hora de escolher os campos de exibição após o clique do
    botão MODIFICAR LAYOUT . Vários campos da fieldcat podem ser
    definidos para um mesmo grupo de campo.
    form zf_grupo.
    MOVE:'Moeda' TO S_GRUPOS-SP_GROUP,
         'Campos moeda' TO S_GRUPOS-TEXT.
         APPEND S_GRUPOS.
    endform.                    " zf_grupo
    *&      Form  zf_imprime_hierarquico_alv
          text
    -->  p1        text
    <--  p2        text
    form zf_imprime_hierarquico_alv.
    Vamos definir as ligações entre as tabelas para as quebras no momento
    da impressão.
      s_keyinfo-header01  =  'EBELN'.
      s_keyinfo-item01    =  'EBELN'.
      CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
        EXPORTING
          I_CALLBACK_USER_COMMAND           = 'ZF_USER_COMMAND'
         I_CALLBACK_PF_STATUS_SET          = 'ZF_SET_PF_STATUS_HIERARQ'
          I_CALLBACK_PROGRAM                = v_repid
          IS_LAYOUT                         = S_LAYOUT
          IT_FIELDCAT                       = T_FIELDCAT[]
          IT_SPECIAL_GROUPS                 = S_GRUPOS[]
         IT_SORT                        =
         IT_FILTER                      =
    -    Parâmetro p/executar sempre com a variante default
          I_DEFAULT                         = 'X'
    -                     Se é possível salvar as variantes
          I_SAVE                            = 'A'
    -                          Nome da variante selecionada
          IS_VARIANT                        = VARIANTE
         IT_EVENTS                      =
         IT_EVENT_EXIT                  =
          i_tabname_header                  = 'I_EKKO'
          i_tabname_item                    = 'I_EKPO'
         I_STRUCTURE_NAME_HEADER        =
         I_STRUCTURE_NAME_ITEM          =
          is_keyinfo                        = S_KEYINFO
          IS_PRINT                          = S_PRINT
         IS_REPREP_ID                   =
         I_BUFFER_ACTIVE                =
         I_BYPASSING_BUFFER             =
      IMPORTING
         E_EXIT_CAUSED_BY_CALLER        =
         ES_EXIT_CAUSED_BY_USER         =
        tables
          t_outtab_header                   = I_EKKO
          t_outtab_item                     = I_EKPO.
    endform.                    " zf_imprime_hierarquico_alv
    *&      Form  ZF_LIST
          text
    -->  p1        text
    <--  p2        text
    form ZF_LIST.
      PERFORM zf_layout.
      PERFORM zf_ordena_campos.
      PERFORM zf_monta_campos_alv.
      PERFORM zf_print.
      PERFORM zf_grupo.
      IF  NOT  I_EKPO[] IS INITIAL.
          PERFORM zf_imprime_list_alv.
      ELSE.
        MESSAGE s000(zcl001)  WITH  'Nenhum registro encontrado.'.
        STOP.
      ENDIF.
    endform.                    " ZF_LIST
    *&      Form  zf_imprime_list_alv
          text
    -->  p1        text
    <--  p2        text
    form zf_imprime_list_alv.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
          I_CALLBACK_PF_STATUS_SET       = 'ZF_SET_PF_STATUS_LIST'
          I_CALLBACK_USER_COMMAND        = 'ZF_USER_COMMAND'
        I_INTERFACE_CHECK              = ' '
        I_BYPASSING_BUFFER             =
        I_BUFFER_ACTIVE                = ' '
         I_CALLBACK_PROGRAM             = v_repid
         I_STRUCTURE_NAME               = 'I_EKPO'
         IS_LAYOUT                      = S_LAYOUT
         IT_FIELDCAT                    = T_FIELDCAT[]
        IT_EXCLUDING                   =
         IT_SPECIAL_GROUPS              = S_GRUPOS[]
         IT_SORT                        = T_SORT[]
        IT_FILTER                      =
        IS_SEL_HIDE                    =
         I_DEFAULT                      = 'X'
         I_SAVE                         = 'A'
         IS_VARIANT                     = VARIANTE
        IT_EVENTS                      =
        IT_EVENT_EXIT                  =
         IS_PRINT                       = S_PRINT
        IS_REPREP_ID                   =
         I_SCREEN_START_COLUMN          = 0
         I_SCREEN_START_LINE            = 0
         I_SCREEN_END_COLUMN            = 0
         I_SCREEN_END_LINE              = 0
      IMPORTING
        E_EXIT_CAUSED_BY_CALLER        =
        ES_EXIT_CAUSED_BY_USER         =
        TABLES
          t_outtab                       = I_EKPO.
    endform.                    " zf_imprime_list_alv
    *&      Form  zf_user_command
          text
    -->  p1        text
    <--  p2        text
    form zf_user_command using p_v_ucomm like SY-UCOMM
                               p_s_selfield type slis_selfield.
    *---tratamento de impressão do Sapscript----
    CASE p_v_ucomm.
      FLAG = 0.
         WHEN 'IMPRIMIR' OR 'PRINT'.
             LOOP AT i_ekpo.
                  IF NOT i_ekpo-BOX IS INITIAL.
                    FLAG = FLAG + 1.
                  ENDIF.
            ENDLOOP.
    se tiver selecionado apenas uma box
            IF flag EQ 1.
                IF p_gerar EQ 'X'.
    *-----perform para confirmação de download
                  PERFORM zf_popup_to_confirm.
                ENDIF.
    *------chama o form para imprimir o sapscript
                  PERFORM zf_sapscript.
            ENDIF.
    box estiver vazia
            IF flag EQ 0.
               MESSAGE E017(ZCL_GRUPO04). "Selecione apenas uma BOX
                                          "referente ao pedido de compras.
               STOP.
            ENDIF.
    "estiver selecionado + de uma box
            IF flag GT 1.
               MESSAGE E017(ZCL_GRUPO04). "Selecione apenas uma
                                         "BOX referente ao pedido de compra.
               STOP.
            ENDIF.
    ENDCASE.
    CASE p_s_selfield-sel_tab_field.
    *observe na exibição do relatório(hierarquico) que temos o EKKO-EBELN
    ficaria  melhor visualmente, a utilização de clicar no mesmo
         WHEN 'I_EKPO-EBELN'. "tab de saida
               SET PARAMETER ID 'BES' FIELD p_s_selfield-VALUE.
               CALL TRANSACTION 'ME23' AND SKIP FIRST SCREEN.
    ENDCASE.
    endform.                    " zf_user_command
    *&      Form  ZSET_PF_STATUS
          text
         -->P_EXTAB  text
    form ZSET_PF_STATUS using    p_extab.
      set pf-status 'BOTOES' EXCLUDING extab.
    endform.                    " ZSET_PF_STATUS
    *&      Form  zf_sapscript
          text
    -->  p1        text
    <--  p2        text
    form zf_sapscript.
    --carregar a ITCPO----
      PERFORM zf_itcpo.
    ----chamar a função Open_form
      PERFORM zf_open_form.
    *----buscar o fornecedor e seus dados
    LOOP AT I_ekko.
            v_element  =  'CABPRIN'.
            v_type     =  'BODY'.
            v_window   =  'JANCABEC'.
            PERFORM  zf_imprime_form USING  v_element
                                            v_type
                                            v_window.
    ENDLOOP.
    *----buscar o documento de compra selecionado
    LOOP AT i_ekpo.
        IF i_ekpo-BOX = 'X'.
            v_element  =  'MAIN'.
            v_type     =  'BODY'.
            v_window   =  'MAIN'.
            PERFORM  zf_imprime_form USING  v_element
                                            v_type
                                            v_window.
    *---o comando EXIT é para que somente quando 1 registro for selecionado
    no relatório e a verificação da igualdade acontecer faz que saia do
    Loop
        EXIT.
        ENDIF.
    ENDLOOP.
      PERFORM zf_close_form.
    endform.                    " zf_sapscript
    *&      Form  zf_itcpo
          text
    -->  p1        text
    <--  p2        text
    form zf_itcpo.
    *Parâmetros para impressão da tabela ITCPO
    ITCPO-TDCOPIES   = 1.           "Quantidade de cópias
    ITCPO-TDPAGESLCT = ''.          "Seleção de páginas
    ITCPO-TDPROGRAM  = SY-REPID.    "Captura o nome do programa
    ITCPO-TDIMMED    = c_on.        "Saída imediata do relatório
    ITCPO-TDPREVIEW  = c_on.        "Exibição prévia do relatório
    ITCPO-TDDEST     = 'LOCL'.      "SPOOL: dispositivo de saída
    ITCPO-TDFAXUSER  = SY-UNAME.    "Usuário logado naquele momento
    ITCPO-TDSENDDATE = SY-DATUM.    "Data de envio desejada
    ITCPO-TDSENDTIME = SY-UZEIT.    "Hora envio desejada
    ITCPO-TDNEWID    = c_on.        "Nova ordem SPOOL
    ITCPO-TDARMOD    = c_on.       "IMPRIMIR: modo de arquivamento
    ITCPO-TDTITLE    = 'Relatório de Compras por Classificação Contábil'.
    endform.                    " zf_itcpo
    *&      Form  zf_open_form

    Boa Tarde Carlos,
    Welcome to the SDN Forums. SDN gets it's power from the large community throughout the world. To harvest that power of knowledge we have settled on one language for posts here which is English.
    Clearly English is not your first language, but don't be afraid, I would vouch that for most of the participant here on SDN English is the second language.
    As it is for me. I am just lucky, that I am living in the States long enough that German colleagues start to look at me strangely when I talk to them in German, because it doesn't totally sound right anymore
    So we are very forgiving her in SDNland regarding grammar and spelling (although not as much anymore in the Weblogs), we even provide a spell checker.
    Please post your question again in English.
    If people don't understand you they will ask you about the things that they don't understand and you can then clarify.
    Try it out. Your chance of an excellent responds is way higher.
    Boa sorte, Mark.

  • ALV poppup -using forms

    I can't use the statement in user exits.
    I need to use it to set the pf-status of ALV grid.
    i.e itis a dynamic call.
    I tried writing this form in another program and calling it from the user exit.But the pf-status in another program dosn't recognises this.

    Siva,
    Can you be more clear as to what exactly you want. If you want a popup of ALV list to select, you can use the function module REUSE_ALV_POPUP_TO_SELECT.
    If you are trying to just display a list as a popup, you can generate a report using Grid control using classes on a screen and call that screen.
    Regards,
    Ravi

  • GOS - Generic Object Services - Change dynamically the title of attachments

    Dear Experts,
    how can I change dynamically the title of the single attachment in the attachment-list of cl_gos_manager?
    I hope you can help me.
    Thanks in advance.

    Thanks for reply.
    I solved the problem by the following way:
    - Function ARCHIV_GET_CONNECTIONS for getting all linked documents
    - Showing list in popup with ALV-Grid
    - SET HANDLER handle_double_click
    - Function ALINK_DOCUMETS_DISPLAY_MIX for viewing selected document on popup
    Marco

  • POV help.  F4  functionality.

    Hi Experts,
    Presently I am using the function module
    'POPUP_WITH_TABLE_DISPLAY'.
    Where I am able to find two buttons, choose and cancel.
    But as per the req. I need to put a button 'Find',
    This button will be used to find the particular record.
    What is the possible way of doing it.
    Thanks in Advance,
    Irfan Hussain

    Hi irfan,
    1. the best thing would be to POPUP
       using ALV functionality.
    2. like this
    (the parameters in BOLD make it POPUP)
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
        it_fieldcat           = alvfc
    <b>    i_screen_start_column = 10
        i_screen_start_line   = 10
        i_screen_end_column   = 20
        i_screen_end_line     = 20</b>
      TABLES
        t_outtab              = itab
      EXCEPTIONS
        program_error         = 1
        OTHERS                = 2.
    3. To get a taste of it,
       just copy paste in new program.
    REPORT abc.
    TYPE-POOLS : slis.
    Data
    DATA : BEGIN OF itab OCCURS 0.
            INCLUDE STRUCTURE t001.
    DATA : END OF itab.
    DATA : alvfc TYPE slis_t_fieldcat_alv.
    Select
    SELECT * FROM t001 INTO TABLE itab.
    *-------  Field Catalogue
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
      EXPORTING
        i_program_name         = sy-repid
        i_internal_tabname     = 'ITAB'
        i_inclname             = sy-repid
      CHANGING
        ct_fieldcat            = alvfc
      EXCEPTIONS
        inconsistent_interface = 1
        program_error          = 2
        OTHERS                 = 3.
    Display
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
        it_fieldcat           = alvfc
        i_screen_start_column = 10
        i_screen_start_line   = 10
        i_screen_end_column   = 20
        i_screen_end_line     = 20
      TABLES
        t_outtab              = itab
      EXCEPTIONS
        program_error         = 1
        OTHERS                = 2.
    regards,
    amit m.

  • "CNTL_ERROR" raised , when using a Function Module

    Hi All,
    I am trying to reuse an existing Function module. This function module, fetches data in an internal table and creates a popup using ALV, using the Call Screen statement. I cannot modify this function module.
    Is there any method, how I can use this Function Module in Web Dynpro Application(which would be executed from portal) , because if I use it directly, I get an error .. Exception condition " CNTL_ERROR" raised as the Custom Container object doesn't get created. As far as  I understand, we cannot use such a function module directly, but please let me know if there Is any work around apart from creating a new function module.
    Best Regards,
    Preethi Santhanam.

    Refer these threads (Ans by Thomas) :
    CNTL_ERROR while calling an FM through WebDynpro

  • Regarding search help for a attribute

    Hi All,
    I have an ALV, there is a hyperlink for one field, which opens up another Popup for ALV as component usage.
    I have one Search help for a field in this popup.
    When I open this popup for first time in that session, F4 for the SH, the value is not getting populated  in that field.
    When I close the popup and open it again, next time the value which I select is getting populated in that field.
    Don't know why this happens.
    Like OVS, can we have F4 help event custom one for SH so that I can triiger it for first time.
    What is the event that gets triggered upon F4 selection of SH.
    Appreciate your replies.
    My server details are as below -
    EHP 4 for SAP ERP 6.0 /7.0
    WEBCUIF 700 0001 SAPK-70001INWEBCUIF SAP WEBCUIF 700
    SAP_ABA 701 0002 SAPKA70102 Cross-Application Component
    Does Service pack has raised these issues.
    Regards,
    Lekha.
    Edited by: Lekha on Aug 11, 2009 6:06 PM

    Resolved by myself.

  • Popup instead of list when using WD4A ALV Grid Drop Down By Key

    I am develop a WD4A application and I am using an ALV grid.  I have set the cell editor for one column wiht the following code:
    CREATE OBJECT lr_ddbk
        EXPORTING
          SELECTED_KEY_FIELDNAME = 'ZCURRENCY'.
      Data: lv_key_visable TYPE abap_bool,
            lv_key_visible_fieldname TYPE string.
       lr_ddbk->set_type( if_salv_wd_c_uie_drdn_by_index=>type_key_value ).
    *  lv_key_visable = lr_ddbk->GET_KEY_VISIBLE( ).
    *  lv_key_visible_fieldname = lr_ddbk->GET_KEY_VISIBLE_FIELDNAME( ).
    *  lr_ddbk->SET_KEY_VISIBLE( abap_false ).
      lr_alv_column->SET_CELL_EDITOR( lr_ddbk ).
    This code works fine.  I then fill the drop down with the following code:
    *...Build the currency drop down list
      DATA lv_default_currency TYPE wdr_context_attr_value.
      DATA lv_currency_count TYPE STRING.
      DATA ls_tcurt TYPE tcurt.
      CLEAR ls_contextvalue_set.
      CLEAR lt_contextvalue_set. REFRESH lt_contextvalue_set.
      CLEAR lv_default_currency.
      loop at it_ac_attr into ls_ac_attr.
        if ls_ac_attr-attr_id eq 'CUR'.
          select single * from tcurt into ls_tcurt
               Where spras = 'EN' AND
                     waers = ls_ac_attr-value.
          If sy-subrc = 0.
            ls_contextvalue_set-value = ls_ac_attr-value.
         ls_contextvalue_set-value = ls_ac_attr-value.
            ls_contextvalue_set-text = ls_tcurt-ktext.
            IF ls_ac_attr-DFT_FLAG = 'X'.
              lv_default_currency = ls_contextvalue_set.
            ENDIF.
            append ls_contextvalue_set to lt_contextvalue_set.
          endif.
        Endif.
      endloop.
      lo_nd_zebuy_describe_item_info = lo_nd_zebuy_describe_item->get_node_info( ).
      lo_nd_zebuy_describe_item_info->set_attribute_value_set(
                                    exporting
                                       name = 'ZCURRENCY'
                                      value_set = lt_contextvalue_set ).
    *...End build currency drop down list
    This code works fine.  The issue I am having is that the drop down is behaving like a search help field rather than a drop down list.  Meaning a popup comes when I drop down the list.  The popup has the values I have set.  I don't want a popup I want a drop down list.  Additionallly the field is editable (meaning I can type a value into the field as well as select a value).  I want the user to only be able to select values from the list.  Any help with this issue would be appreciated.

    I fugured out what I was doing wrong.  I was setting the cell editor to cl_salv_wd_uie_input_field later in the code by mistake.

  • How to create POPUP windows (from ALV report)

    Hi there,
    I have a ALV report which has a field where the user can click and view more details of the selected data. I would like to have a popup and then display the selected data...is that possible? Any function module which I can use to pop up a window and display selected data?
    Thanks in advance!
    Cheers,
    MC

    Hi MC,
    Please follow the steps below for getting the result you desired.
    1. In your field catalogue, move 'X' to the slis_fieldcat_alv-hotspot field. This will enable the user to select it.
    2. Set slis_t_event_exit-ucomm = '&IC1' and slis_t_event_exit-before = 'X' and pass this internal table to the ALV function call. This will enable to code your own logic for that standard user command.
    3. Pass your 'User command' routine name to the appropriate paramter of the function module.
    4. Your 'User command' routine should have the following format.
    *       FORM USER_COMMAND                                             *
    *  -->  UCOMM                                                         *
    *  -->  SELFIELD                                                      *
    FORM user_command USING ucomm    LIKE sy-ucomm
                            selfield TYPE slis_selfield.
      CASE ucomm.
        WHEN '&IC1'.
          PERFORM display_pop_up USING selfield.
        WHEN OTHERS.
      ENDCASE.
      MOVE '&REFRESH' TO ucomm.
    ENDFORM.                                    " USER_COMMAND
    5. Write your code for the pop-up in the routine 'DISPLAY_POP_UP'. Look at 'POPUP*' function modules to pick up the best suitable one for you.
    Hope this helps,
    Srinivas

  • Print ALV report Directly - without the Print Parameter POPUP

    Hai All,
    I want to print a ALV directly to the printer without the Print Paramter POPUP.
    I passed on IS_PRINT parameters in the FM 'REUSE_ALV_LIST_DISPLAY'.
    But still i am getting the popup.
    How to do this.
    It is urgent .
    Kindly help me solving this.
    Vikki.

    Hi,
    i have passed IS_Print-Print = 'X'.
    But even after that i am getting the print parameter popup.
    IS there any other way to handle this. TO SUPPRESS THE PRINT PARAMETER POPUP.
    Please guide me.
    Waiting for ur replies.
    Vikki.

  • Problem with checkbox column in ALV popup (ABAP)

    Hi, the problem is: I've created the code below for maintaining a popup with an ALV table inside. One of the column is a checkbox field. When I run first time the popup, it run well, when I clode the popup window and then I run for second time the popup, i see all the columns except those with the checkbox. Someone else have encountered the same proble, if yes someone could me explain that? Here's the code:
    method WDDOINIT .
    data: l_ref_cmp_usage type ref to if_wd_component_usage.
      l_ref_cmp_usage =   wd_This->wd_CpUse_ALV( ).
      if l_ref_cmp_usage->has_active_component( ) is initial.
        l_ref_cmp_usage->create_component( ).
      endif.
      DATA: l_ref_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .
      l_ref_INTERFACECONTROLLER =   wd_This->wd_CpIfc_ALV( ).
      data:
      l_VALUE type ref to Cl_Salv_Wd_Config_Table.
      data:  l_tabset  type ref to IF_Salv_Wd_Table_SETTINGS.
    l_VALUE = l_ref_INTERFACECONTROLLER->Get_Model( ).
      l_tabset ?= l_value.
      l_tabset->set_read_only( abap_false ).
      l_tabset->SET_VISIBLE_ROW_COUNT( 15 ).
      l_tabset->set_width( '500' ).
      l_tabset->SET_DESIGN( VALUE = CL_WD_TABLE=>E_DESIGN-ALTERNATING ).
    data:
        lr_std_functions type ref to if_salv_wd_std_functions,
        l_table          type ref to if_salv_wd_function_settings.
      lr_std_functions ?= l_value.
      lr_std_functions->SET_EXPORT_ALLOWED( Abap_false ).
      lr_std_functions->SET_VIEW_LIST_ALLOWED( Abap_false ).
      lr_std_functions->SET_PDF_ALLOWED( Abap_false ).
      lr_std_functions->SET_DIALOG_SETTINGS_ALLOWED(  Abap_off ).
      lr_std_functions->SET_DIALOG_SETTINGS_AS_POPUP( Abap_off ).
      lr_std_functions->SET_DISPLAY_SETTINGS_ALLOWED( abap_off ).
      lr_std_functions->SET_EDIT_APPEND_ROWS_ALLOWED( abap_off ).
      lr_std_functions->SET_EDIT_APPEND_ROW_ALLOWED( abap_off ).
      lr_std_functions->SET_EDIT_CHECK_AVAILABLE( abap_off ).
      lr_std_functions->SET_EDIT_DELETE_ROW_ALLOWED( abap_off ).
      lr_std_functions->SET_EDIT_INSERT_ROWS_ALLOWED( abap_off ).
      lr_std_functions->SET_EDIT_INSERT_ROW_ALLOWED( abap_off ).
      lr_std_functions->SET_PDF_ALLOWED( abap_off ).
      data: lr_column   type ref to cl_salv_wd_column.
    instancing check box
      data: lr_checkbox type ref to cl_salv_wd_uie_checkbox.
      create object lr_checkbox
              exporting
                checked_fieldname = 'CHECK'.
      lr_checkbox->set_read_only( value = abap_false ).
      lr_column = l_value->if_salv_wd_column_settings~get_column( 'CHECK' ).
      lr_column->set_cell_editor( lr_checkbox ).
    endmethod.
    Thanks for answers.

    This is just some guessing - but try and set a breakpoint in the wddoinit of your popup.  I'm betting that it isn't being executed on the second call because the original instance is reused. 
    Take a look at the properties on the view for the popup.  You might try  changing the lifetime of the view from "framework controlled" to "when visible".

  • How to do ALV Popup in a new Function module

    Hi experts,
    This is the Client Requirement.
    " Flow Diagram/Pseudo Code:
    Attach a data flow diagram. Write brief pseudo code in plain English.  Be sure to include all access data plans.
    -     FM interface:
    -     Import: company code/ vendor#.
    -     Export: default_line,  type y4ap_t11
    -     Exception: NO_DATA or CANCELED
    In the FM code, past current z_venddefault code, except for write statements. After internal table is generated, show it in ALV popup. On ALV, add a OK/Cancel button. On OK, ensure that one line is selected (otherwise throw warning), and then fill export structure with that line’s G/L account, cost Center, and internal order# fields. Then close the ALV and end FM. For Cancel, just close the ALV end the FM.
    For an example of how to build such popup ALVs, take a look at FM Y4AP_SELECT_APPROVER.
    Unit Test Plan:
    Just use co.code 3000/vend# 1000 to test this FM."
    here i need to do is there is a simple report program by displaying in list.
    But now i need to do is , i have to put that code in a new function module and there i need to display it in alv grid.
    How to do this can anybody help me.
    It's a urgent i need to submit today to client.
    Thank you
    Basu

    Hi,
    Check this.
    select several rows in alv
    It will be helpful.
    Regards,
    J.Jayanthi

  • How to create ALV as a POPUP in abap web dynpro?

    I have a requirement to display an ALV report as a popup for ESS application in HR module. Data fetching and binding is done in component controller
    WDINIT method and it is displaying ALV in ESS. Now my requirement is to show this alv as a popup in ESS, I have used the method "Generate_Popup" using wizard however it is showing error that "Instance is already used for window".
    Please let me know how to create POPUP alv where data fetching is done in "Component controller" hence I have only 1 view and 1 window in my web dynpro program.
    Below is the logic for data fetching and data binding in WDINIT method of "Component controller":
    method WDDOINIT .
      DATA: lv_pernr type p0105-PERNR,
            lv_user  TYPE P0105-USRID.
      lv_user = sy-uname.
       CALL FUNCTION 'RP_GET_PERNR_FROM_USERID'
         EXPORTING
           begda           = sy-datum
           endda           = sy-datum
           usrid           = lv_user
           usrty           = '0001'
        IMPORTING
          USR_PERNR        = lv_pernr
        EXCEPTIONS
          RETCD            = 1
          OTHERS           = 2.
    IF sy-subrc = 0.
    TYPES: BEGIN OF ty_pa2001,
                 PERNR TYPE PERSNO,
                 SUBTY TYPE SUBTY,
                 ENDDA TYPE ENDDA,
                 BEGDA TYPE BEGDA,
                 END OF   ty_pa2001.
          DATA: lt_pa2001 TYPE TABLE OF ty_pa2001.
    "Changes by shiromani
          DATA lo_nd_node_pernr TYPE REF TO if_wd_context_node.
          DATA lo_el_node_pernr TYPE REF TO if_wd_context_element.
          DATA ls_node_pernr TYPE wd_this->element_node_pernr.
    *    navigate from <CONTEXT> to <NODE_PERNR> via lead selection
          lo_nd_node_pernr = wd_context->get_child_node( name = wd_this->wdctx_node_pernr ).
    *    get element via lead selection
          lo_el_node_pernr = lo_nd_node_pernr->get_element( ).
    *    @TODO handle not set lead selection
          IF lo_el_node_pernr IS INITIAL.
          ENDIF.
    *    get all declared attributes
          lo_el_node_pernr->get_static_attributes(
            IMPORTING
              static_attributes = ls_node_pernr ).
    SELECT PERNR
            SUBTY
            ENDDA
            BEGDA FROM pa2001
    INTO CORRESPONDING FIELDS OF TABLE lt_pa2001
    WHERE pernr = lv_pernr AND subty = 'ITEL'.
    if sy-subrc = 0.
       DATA lo_nd_node_details TYPE REF TO if_wd_context_node.
       DATA lo_el_node_details TYPE REF TO if_wd_context_element.
       DATA ls_node_details TYPE wd_this->element_node_details.
    * navigate from <CONTEXT> to <NODE_DETAILS> via lead selection
       lo_nd_node_details = wd_context->get_child_node( name = wd_this->wdctx_node_details ).
    * get element via lead selection
       lo_el_node_details = lo_nd_node_details->get_element( ).
       lo_nd_node_details->bind_table( lt_pa2001 ).
    * alternative access  via index
    ENDIF.
    ENDIF.
    endmethod.

    Hi
    You ca use this function to Create a new window..
      CALL METHOD wd_window->create_window
          EXPORTING
            modal             = abap_true
            window_name       = 'MMPUR_CPPR_RFQ_WDW'
            title             = lv_otr_text
            close_button      = abap_true
            button_kind       = 3
            close_in_any_case = abap_true
          RECEIVING
            window            = wd_comp_controller->window.
        wd_comp_controller->window->open( ).
    here you acn impliment buttons, if you want to subcribe window button please use this window subcribe method.
        CALL METHOD wd_comp_controller->window->subscribe_to_button_event
          EXPORTING
            button            = if_wd_window=>co_button_ok
            action_name       = 'RFQ_WT_VENDOR'
            action_view       = l_api
            is_default_button = abap_false
            button_text       = lv_otr_text
            tooltip           = lv_otr_text.
        wd_comp_controller->window->open( ).
    Please let me know if you have any issue. Please reword if its solve your problem.
    Regards
    Satrajit

  • Popup with generic ALV to display all fields of a structure

    Hello WebDynpro Experts,
    I have developed a WebDynpro application using an ALV control to display all the search results in a table.
    The number of columns shown in this table is reduced by a default view, that is preset for all users.
    In the SAP GUI there is a standard feature to show all the details of a record in a pop up window.
    E.g. in WE02 you see a few fields in the ALV table, and when you click on the details button, you get a popup with all the fields of the selected line.
    Is there something similar in the ALV table for WebDynpro?
    I want to show all the fields of the selected structure in a generic table with two columns: Field label and value.
    Can anybody help?
    Regards,
    Jürgen

    Hello Jurgen,
                    When you select a particular row in ALV table, you can get the data in that row by using ONLEADSELECT
            method from used component(SALV_WD_TABLE).
                   And i Guess you can get all the field names of that structure from DD03L table and you can display them
            in a generic table.
        Regards,
        Harry

Maybe you are looking for

  • How do you move photos from one library to another in iPhoto 9.4.3

    I have half 2009 photos in one library and the other half in a different library.  I'd like to move several photos to one of the libraries to make a photo book.  How do I do this?

  • My iPhone 4 no longer stays connected to wifi.

    I have to manually connect to all networks (previously known ones) and even that won't work.  I'm having to turning my phone off and turn it back on.  That works....for a bit.  It's getting annoying.  It's not my router (everything else works fine on

  • Performa 600 repair/replace options

    I have a 15 year old Performa 600 that will no longer power up.I have used it for record keeping and financial information that I would like to keep. I'm unsure about the operating system(OS 8.0?). I would like to replace, repair or access the inform

  • System restore...I've got a bad feeling about this...

    I've downloaded 10.7.2 on my three Macs, an MB Air and a Mac Pro both at home and in the office.  The office Pro has seen some significant issues since the update.  After the update, my iPhoto was broken--it would not import photos either directly fr

  • Report server name (unix)

    i've forms and reports running on iAS under win2000. now i'd like to transfer them to tru64 unix. normal forms (without reports calls) work fine. but the reportsserver on unix has a different name than the one on windows. - can i change the reports s