RRI to a Transaction me23 in R/3

Hi,
I have to implement an RRI from BW report to an R/3 ME23 transaction. In the BW report I have an I/O 'Object key' which refers to the R/3 field 'OBJKY' of the NAST table. I have done all the settings in the RSBBS like -
1.sender-receiver assignment and choose Assignment Details & for the field assignments i have selected Type as table field, field name as OBJKY, selection type as parameter, data element & domain as NA_OBJKEY corresponding to OBJKY, but with these selections also the query to r/3 transaction jump is not working...
I am unable to give the get/set parameter in RSBBS assignment cause this field in nast doesnt have Parameter ID !
Pls guide...
Thanks in advance,
sandy.

Hi,
My requirement was to go to the specific Purchase Order in MN23N.  Following is the settings I had to make in the Assignment Details of RSBBS for the RRI to work:
InfoObject: 0OI_EBELN
Type: 3 Table Field
Field Name: EBELN (Corresponding R3 field)
Selection Type: *
Required: TRUE
Data Element: EBELN (Corresponding R3 field)
Domain: CHAR 10 (Got this info by looking at the InfoObject)
SET/GET Parameter: BES (Got this info by doing an F1 on the field in the WebGUI)
I hope this helpds you!

Similar Messages

  • RRI to Opportunity transaction on CRM UI

    Hi All,
    We are using BI 7.0 and CRM 7.0. I have a requirement of jumping from opportunity BI Report to its opportunity screen on CRM UI. I have maintained sender-receiver assignment but it is not working.
    Has anyone worked on RRI to CRM transaction (opportunity/Lead). Please suggest with the parameters required for the jump.
    Thanks
    Santosh

    Hello,
    Have you been able to resolve this issue?
    regards,
    Atul Kulkarni

  • Define RRI in BW

    Hi experts,
    we have defined an RRI from a Query into an iview. This iview contains the ERP transaction ME23. So we can jump with the purchase doc number from the Query (it is included in an iview in our portal) into the iview including the ERP transaction.
    everythink works fine.
    But now the new request from our purchaser. They want to jump from the query into the transaction ME23N. If i define the jump to an iview including the ME23N it works, but it doesn't change the purchase doc number. In ME23N is no starting screen, where you can select anythink. It starts with the last purchase doc number you used some days ago.
    My Idea is: Before the RRI puts the purchase doc number into iview it has to enter "SHIFT ans F5". Because then opens a popp up to change the purchase doc number.
    Is there any way to define the RRI to do that?
    Thanks experts.
    Arthur

    Hi experts,
    we have defined an RRI from a Query into an iview. This iview contains the ERP transaction ME23. So we can jump with the purchase doc number from the Query (it is included in an iview in our portal) into the iview including the ERP transaction.
    everythink works fine.
    But now the new request from our purchaser. They want to jump from the query into the transaction ME23N. If i define the jump to an iview including the ME23N it works, but it doesn't change the purchase doc number. In ME23N is no starting screen, where you can select anythink. It starts with the last purchase doc number you used some days ago.
    My Idea is: Before the RRI puts the purchase doc number into iview it has to enter "SHIFT ans F5". Because then opens a popp up to change the purchase doc number.
    Is there any way to define the RRI to do that?
    Thanks experts.
    Arthur

  • RRI Jump

    Hello
    We have created a RRI through RSBBS transaction
    We have mentioned the Infosource and transaction to go
    For  the costcenter report we have mentione dthe transaction KSB1 through RSBBS
    I ran the query and tried to GO tO - transaction KSB1 , its not working.
    It was working couple of weeks ago. I donno what go t changed.
    Any idea please.
    meps

    meyappan ,
    Have you installed ITS ? it is a key component for the above to work .. and also which version of BW are you useing? if it is BW3.5 you get ITS integrated with WAS 6.4...
    Please give more details as to the error message that you get..
    Arun

  • JUMP (RSBBS) from a query on a transaction(local)

    Hi,
    Can You help me ?
    I want to do a jump from a query on a transaction RSDMD (on local system).But particullary, I want to put in parameter the data  (doc number) with wich I jumped.
    So How I have to define the assignement detail in RSBBS for the transaction RSDMD?
    Because, for the moment I have a popup where I must fill the name of my charactéristic and after the number of my doc number (for example), and it's with the doc number that I do my jump.
    But, I don't want to fill characteristic and doc number, I want that it's automaticaly...
    Thank you for your help...
    Carine.

    Calling the RRI with a transaction or an ABAP/4 Report as the receiver is done with the RRI
    from the SAP NetWeaver Application Server. This is possible in an ERP system, a CRM
    system or within the BI system. The selections are prepared by the BI system that does not
    recognize the transaction or the report. The assignment is transferred from the RRI of the
    SAP NetWeaver Application Server using inverse transformation rules. There must also be a
    complete chain from the DataSource of the source system to the InfoSource, through
    transformations up to the InfoProvider. This does not mean that data absolutely has to be
    loaded using this chain. If this chain does not exist, the RRI cannot transfer the selections to
    the source system. Calling the RRI only works for fields with dictionary reference. For ABAP reports, this means that the parameter has to be PARAMETERS param LIKE <table_field>
    For transactions, this means that the Dynpro has to have a dictionary reference. Not every
    transaction can be called with the RRI of the SAP Application Server.
    These are the steps to do this
    If you want to jump from a Web application to a transaction or ABAP/4 report using the
    RRI, an ITS for the target system has to be assigned beforehand.
    ● The value of the input field to be supplied must be known at the time of the jump (for
    example by entering a single value on the selection screen of the sender or by the
    cursor position at the time of the jump).
    ● Sender and receiver fields that correspond to one another generally must link to the
    same data element or at least to the same domain, otherwise the values cannot be
    assigned to one another.
    ● The assignment of sender and receiver fields must always be a 1:1 assignment. For
    example, the transactions called from the start screen cannot have two input fields of
    the same data type. Then it is not clear which of the fields is to be supplied, which
    means neither of them is supplied.
    ● There has to be a complete chain from the DataSource of the source system to the
    InfoSource, through update rules up to the target.
    Proceed as follows after you have created the sender-receiver assignment as described
    above.
    1. As the type, choose Table Field. The columns Field Name, Data Element, Domain and
    Set-/Get Parameter become input ready.
    2.  Specify the field name, data element, domain and parameter ID for the receiver
    transaction. You need to know this information because input help is not available. You
    can usually find the parameter ID in the ABAP dictionary entry for the data element.
    If this does not always make jumping to the transaction possible, it may be necessary to
    program a short ABAP start program. For more information on how to do this, see SAP Note
    number 383077

  • Problem with Me23n transaction

    Hi
    I am facing one problem where when i run transaction ME23 n to display the PO, and than if i select the button through which i can enter other PO numbers and display them ,I get the error that
    Input should be in the form__.__._~,_V".message number 00 088
    As i am just in display mode i am not doing anything just viewing the PO how can i get such message.
    I have tried changing my Default settings also it does'nt help.
    This problem is coming only for me not for others.all others are able to see it.
    Can you please suggest what is the problem
    This prolem is not specific to any PO this is commom to all the PO's i am trying to view.
    Once i get this error my system hangs i cant go back ,i have to log off to come out.

    What has happened is that the number is not entered in the correct format. This happened in your last PO. When you go to ME23N it tries to retrieve your last PO and gets this error.
    To correct this, please go to ME21N and then select the button to display other POs.
    I am certain this will solve your problem. If, by chance, it does not, create a dummy PO and save it. Then go to ME23N and try to display the PO you want.
    Let me know if it resolves your problem
    Lakshman

  • 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.

  • Double click on list field in ALV grid control

    Hello all,
    I developed a report with a ALV grid control. I would like to move some functionality from marking a line and pressing a button in the status line to double clicking a specific field in the output list and execute a command there (i.e. double click on PO number and go to PO display TAC then). Can anybody provide some example coding for that?
    Thanks so much for your help!
    Torsten

    Here is your sample program.  Copy this code into a z program.  Create the screen 100 with a container in it and name it "ALV_CONTAINER".  Create the gui-status with "BACK".
    report zrich_0001.
    tables: ekko.
    data: begin of i_alv occurs 0,
          ebeln type ekko-ebeln,
          end of i_alv.
    *       CLASS cl_event_receiver DEFINITION      Handles Double Click
    class cl_event_receiver definition.
      public section.
        methods handle_double_click
          for event double_click of cl_gui_alv_grid
          importing e_row e_column.
      private section.
    endclass.
    *       CLASS CL_EVENT_RECEIVER IMPLEMENTATION    Handles Double Click
    class cl_event_receiver implementation.
      method handle_double_click.
        perform drill_down using e_row-index.
      endmethod.
    endclass.
    data: alv_container  type ref to cl_gui_custom_container.
    data: event_receiver type ref to cl_event_receiver.
    data: alv_grid       type ref to cl_gui_alv_grid.
    data: layout    type lvc_s_layo.
    data: fieldcat  type lvc_t_fcat.
    selection-screen begin of block b1 with frame title text-001 .
    select-options: s_ebeln for ekko-ebeln.
    selection-screen end of block b1.
    start-of-selection.
      perform get_data.
      call screen 100.
    *      Module  status_0100  OUTPUT
    module status_0100 output.
      set pf-status '0100'.
      set titlebar '0100'.
      data: variant type  disvariant.
      variant-report = sy-repid.
      variant-username = sy-uname.
    * Create Controls
      create object alv_container
             exporting
                   container_name    = 'ALV_CONTAINER'.
      create object alv_grid
             exporting
                   i_parent          =  alv_container.
    *  Create Event Receiver
      create object event_receiver.
    *  Populate Field Catalog
      perform get_fieldcatalog.
      call method alv_grid->set_table_for_first_display
          exporting
               is_layout              = layout
               is_variant             = variant
               i_save                 = 'U'
               i_structure_name       = 'I_ALV'
          changing
               it_outtab       = i_alv[]
               it_fieldcatalog = fieldcat[].
    *   handler for ALV grid
      set handler event_receiver->handle_double_click for alv_grid.
    endmodule.
    *      Module  USER_COMMAND_0100  INPUT
    module user_command_0100 input.
      case sy-ucomm.
        when 'BACK' or 'CANC'.
          if not alv_container is initial.
            call method alv_container->free.
            clear: alv_container.
            free : alv_container.
          endif.
          if sy-subrc = 0.
            set screen 0.
            leave screen.
          else.
            leave program.
          endif.
        when 'EXIT'.
          if not alv_container is initial.
            call method alv_container->free.
            clear: alv_container.
            free : alv_container.
          endif.
          leave program.
      endcase.
    endmodule.
    * FORM GET_DATA
    form get_data.
      select * into corresponding fields of table i_alv
                from ekko
                     where ebeln in s_ebeln.
      sort i_alv ascending by ebeln.
    endform.
    *      Form  Get_Fieldcatalog - Set Up Columns/Headers
    form get_fieldcatalog.
      data: ls_fcat type lvc_s_fcat.
      refresh: fieldcat.
      clear: ls_fcat.
      ls_fcat-reptext    = 'PO Number'.
      ls_fcat-coltext    = 'PO Number'.
      ls_fcat-fieldname  = 'EBELN'.
      ls_fcat-ref_table  = 'I_ALV'.
      ls_fcat-outputlen  = '12'.
      ls_fcat-col_pos    = 1.
      append ls_fcat to fieldcat.
    endform.
    * DRILL_DOWN
    form drill_down using index.
      read table i_alv index index.
      if sy-subrc = 0.
        set parameter id 'BES' field i_alv-ebeln.
        call transaction 'ME23' and skip first screen.
        if not alv_container is initial.
          call method alv_container->free.
          clear: alv_container.
          free : alv_container.
        endif.
      endif.
    endform.
    Regards,
    Rich Heilman

  • Total for a Numeric field in ALV Grid display

    Hi all,
    I am not getting the Total for a Numeric field in ALV Grid output. What might be the problem.
    Regards,
    Balavardhan.K

    Check this code for subtotals and totals..
    REPORT ZYFI_REPT007
           NO STANDARD PAGE HEADING
           LINE-SIZE 300
           LINE-COUNT 50
           MESSAGE-ID ZYFI.
    TABLES : COOI, " Commitments Management: Line Items
             LFA1,                         " Vendor master (general section)
             VBEP,
             RKPLN.
          TABLE TYPES AND INTERNAL TABLES                                *
    DATA : BEGIN OF TYP_COOI ,
           OBJNR LIKE COOI-OBJNR,
           SAKTO LIKE COOI-SAKTO,
           MEGBTR LIKE COOI-MEGBTR,
           MEINH LIKE COOI-MEINH,
           WKGBTR LIKE COOI-WKGBTR,
           REFBN LIKE COOI-REFBN,
           RFPOS LIKE COOI-RFPOS,
           SGTXT LIKE COOI-SGTXT,
           BUDAT LIKE COOI-BUDAT,
           LIFNR LIKE COOI-LIFNR,
           END OF TYP_COOI.
    DATA : BEGIN OF TYP_LFA1 ,
            LIFNR LIKE LFA1-LIFNR,
            NAME1 LIKE LFA1-NAME1,
           END OF TYP_LFA1.
    DATA : BEGIN OF IT_OUTTAB OCCURS 0,
             OBJNR LIKE COOI-OBJNR,
             SAKTO LIKE COOI-SAKTO,
             MEGBTR LIKE COOI-MEGBTR,
             MEINH LIKE COOI-MEINH,
             WKGBTR LIKE COOI-WKGBTR,
             REFBN LIKE COOI-REFBN,
             RFPOS LIKE COOI-RFPOS,
             SGTXT LIKE COOI-SGTXT,
             BUDAT LIKE COOI-BUDAT,
             LIFNR LIKE COOI-LIFNR,
             NAME1 LIKE LFA1-NAME1,
           END OF IT_OUTTAB.
    DATA : IT_COOI LIKE TYP_COOI OCCURS 0 WITH HEADER LINE,
           IT_LFA1 LIKE TYP_LFA1 OCCURS 0 WITH HEADER LINE.
    *-- ALV Declarations
    TYPE-POOLS SLIS.
    DATA: IT_EVENTS            TYPE SLIS_T_EVENT,
          GS_EVENT             TYPE SLIS_ALV_EVENT,
          wa_fldcat            type slis_fieldcat_alv.
    DATA: S_LAYOUT TYPE SLIS_LAYOUT_ALV,
          GT_PRINT TYPE SLIS_PRINT_ALV.
    DATA: IT_FLDCAT       TYPE SLIS_T_FIELDCAT_ALV.
    DATA: IT_SORT             TYPE SLIS_T_SORTINFO_ALV.
    DATA: V_REPID LIKE SY-REPID.
                        SELECTION SCREEN                                 *
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS : S_KOKRS FOR COOI-KOKRS NO-EXTENSION NO INTERVALS,
                                           " Controlling Area
                     S_BUKRS FOR COOI-BUKRS NO-EXTENSION NO INTERVALS,
                                           " Company code
                     S_GJAHR FOR COOI-GJAHR NO-EXTENSION NO INTERVALS,
                                           " Fiscal Year
                     S_OBJNR FOR RKPLN-AUFNR MATCHCODE OBJECT ORDE,
                                                            " Internal order
                     S_SAKTO FOR COOI-SAKTO MATCHCODE OBJECT KART,
                                                              " Cost Element
                     S_BUDAT FOR COOI-BUDAT, " Debit Date
                     S_LIFNR FOR COOI-LIFNR. " Vendor
    SELECTION-SCREEN END OF BLOCK B1.
           S T A R T   O F   S E L E C T I O N                           *
    START-OF-SELECTION.
    *-- Read data
      PERFORM GET_DATA.
           E N D   O F   S E L E C T I O N                               *
    END-OF-SELECTION.
    *-- Process the data and prepare the output data
      PERFORM CALCULATE_FINAL_INFO.
    *--Display Report output
      PERFORM DISPLAY_REPORT.
          FORM CALCULATE_FINAL_INFO                                     *
        Process the data and prepare final internal table               *
    FORM CALCULATE_FINAL_INFO.
      DATA : L_OBJNR LIKE COOI-OBJNR.
      SORT IT_LFA1 BY LIFNR.
      DELETE ADJACENT DUPLICATES FROM IT_LFA1 COMPARING LIFNR.
      LOOP AT IT_COOI.
        L_OBJNR = IT_COOI-OBJNR+2(20).
        SHIFT L_OBJNR LEFT DELETING LEADING '0'.
        IF L_OBJNR IN S_OBJNR.
          READ TABLE IT_LFA1 WITH KEY LIFNR  = IT_COOI-LIFNR.
          IF SY-SUBRC EQ 0.
            IT_OUTTAB-NAME1 = IT_LFA1-NAME1.
          ENDIF.
          MOVE-CORRESPONDING IT_COOI TO IT_OUTTAB.
          CLEAR IT_OUTTAB-OBJNR.
          IT_OUTTAB-OBJNR = L_OBJNR.
          APPEND IT_OUTTAB.
          CLEAR IT_OUTTAB.
          CLEAR IT_LFA1.
          CLEAR L_OBJNR.
        ENDIF.
      ENDLOOP.
    ENDFORM.
    *&      Form  GET_DATA
         Fetch the Data from the table COOI and LFA1
    FORM GET_DATA.
      SELECT OBJNR
            SAKTO
            MEGBTR
            MEINH
            WKGBTR
            REFBN
            RFPOS
            SGTXT
            BUDAT
            LIFNR
            FROM COOI
            INTO TABLE IT_COOI
            WHERE   BUDAT IN S_BUDAT
            AND LIFNR IN S_LIFNR
            AND KOKRS IN S_KOKRS
            AND BUKRS IN S_BUKRS
            AND GJAHR IN S_GJAHR
            AND SAKTO IN S_SAKTO.
      IF SY-SUBRC EQ 0 .
    Get the Vendor name from LFA1
        SELECT LIFNR
               NAME1
               FROM LFA1
               INTO TABLE IT_LFA1
               FOR ALL ENTRIES IN IT_COOI
               WHERE LIFNR EQ IT_COOI-LIFNR.
      ELSE.
        MESSAGE I999 WITH TEXT-013.
      ENDIF.
    ENDFORM.                               " GET_DATA
    *&      Form  DISPLAY_REPORT
           Display the output
    FORM DISPLAY_REPORT.
      PERFORM BUILD_CATALOG.
      PERFORM FRM_PREPARE_EVENT_LIST TABLES IT_EVENTS.
      IF NOT IT_OUTTAB[] IS INITIAL.
        CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
             EXPORTING
                  I_CALLBACK_PROGRAM      = V_REPID
                  I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
                  IT_FIELDCAT             = IT_FLDCAT
                  IT_SORT                 = IT_SORT
                  IT_EVENTS               = IT_EVENTS
             TABLES
                  T_OUTTAB                = IT_OUTTAB
             EXCEPTIONS
                  PROGRAM_ERROR           = 1
                  OTHERS                  = 2.
      ELSE.
        MESSAGE I999 WITH TEXT-013.
      ENDIF.
    ENDFORM.                               " DISPLAY_REPORT
    *&      Form  BUILD_CATALOG
          Build the Field catalog for the ALV Report
    FORM BUILD_CATALOG.
      DATA: V_INDEX LIKE SY-TABIX.
      V_REPID = SY-REPID.
      DATA: LS_SORT TYPE SLIS_SORTINFO_ALV.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                I_PROGRAM_NAME         = V_REPID
                I_INTERNAL_TABNAME     = 'IT_OUTTAB'
                I_INCLNAME             = V_REPID
           CHANGING
                CT_FIELDCAT            = IT_FLDCAT
           EXCEPTIONS
                INCONSISTENT_INTERFACE = 1
                PROGRAM_ERROR          = 2
                OTHERS                 = 3.
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      READ TABLE IT_FLDCAT WITH KEY FIELDNAME = 'WKGBTR'
                             TABNAME = 'IT_OUTTAB' INTO WA_FLDCAT.
      IF SY-SUBRC  EQ 0.
        WA_FLDCAT-DO_SUM  = 'X'.
        MODIFY IT_FLDCAT FROM WA_FLDCAT INDEX SY-TABIX.
      ENDIF.
      READ TABLE IT_FLDCAT WITH KEY FIELDNAME = 'OBJNR'
                                TABNAME =  'IT_OUTTAB' INTO WA_FLDCAT.
      IF SY-SUBRC EQ 0.
         WA_FLDCAT-SELTEXT_L = 'Order'.
         WA_FLDCAT-COL_POS = 1.
         WA_FLDCAT-DDICTXT = 'L'.
        MODIFY IT_FLDCAT FROM WA_FLDCAT INDEX SY-TABIX.
      ENDIF.
      LS_SORT-FIELDNAME = 'OBJNR'.
      LS_SORT-SPOS      = 1.
      LS_SORT-UP        = 'X'.
      LS_SORT-SUBTOT    = 'X'.
      APPEND LS_SORT TO IT_SORT.
    ENDFORM.                               " BUILD_CATALOG
    *&      Form  FRM_PREPARE_EVENT_LIST
          Build the Events
    FORM FRM_PREPARE_EVENT_LIST TABLES IT_EVENTS TYPE SLIS_T_EVENT.
      CLEAR GS_EVENT.
      GS_EVENT-NAME = SLIS_EV_TOP_OF_PAGE.
      GS_EVENT-FORM = 'TOP_OF_PAGE_REPORT'.
      APPEND GS_EVENT TO IT_EVENTS.
    ENDFORM.                               " FRM_PREPARE_EVENT_LIST
         TOP OF PAGE
    FORM TOP_OF_PAGE_REPORT.
      CALL FUNCTION 'Z_YREPORT_HEADER'
           EXPORTING
                DL_TITLE = SY-TITLE
                DL_REPID = SY-CPROG
                DL_LINSZ = SY-LINSZ
           EXCEPTIONS
                OTHERS   = 1.
    ENDFORM.                               " FRM_TOP_OF_PAGE_REPORT
    *&      Form  USER_COMMAND
      Drill Down Functionality to Call the Transaction ME23
    FORM USER_COMMAND USING    P_UCOMM    LIKE SY-UCOMM
                               P_SELFIELD TYPE SLIS_SELFIELD.
      DATA : L_INDEX LIKE SY-INDEX,
             L_REFBN LIKE COOI-REFBN.
      L_INDEX = P_SELFIELD-TABINDEX.       " holds the selected table index
      CLEAR L_REFBN.
      CASE P_UCOMM.
    *-- On Double Click
        WHEN '&IC1'.
          CLEAR L_REFBN.
    *-- Read the Current Line
          READ TABLE IT_OUTTAB INDEX L_INDEX.
          IF SY-SUBRC EQ 0.
            L_REFBN = IT_OUTTAB-REFBN.
            IF NOT L_REFBN IS INITIAL.
    *-- Set the BES Paramater Id to the Current line Purchase Order Number
              SET PARAMETER ID 'BES' FIELD L_REFBN.
    *-- Call the Transaction Purchase Order Display with the above PO Number
              CALL TRANSACTION 'ME23' AND SKIP FIRST SCREEN.
            ENDIF.
          ELSE.
            MESSAGE E999 WITH TEXT-014.
          ENDIF.
      ENDCASE.
    ENDFORM.                               " USER_COMMAND

  • Me23n user exit dynpro problem

    Hello Everybody,
    I'm developing a user exit for me23n transaction. I have added a tab in which i have some fields i want to fill, but i'm having the next problem.
    when i enter in the me23n transaction,  i push the edit button and those fields appear on editable state, but when i modify the values and push save the fields the fields continue in editable state.
    I have tried to solve this problem in the catching the MESAVE action in the pai of the me22 and calling leaving to the transaction me23 with the vnew values but it's not working. Any ideas?
    Here is the source code ( dynpro 111)
    process after input.
      field ekpo_ci-zzref_alb.
      field ekpo_ci-ZZFECH_DES.
      field ekpo_ci-zzeqveh.
      field ekpo_ci-zzmatricula.
      field ekpo_ci-zzeqtar.
      field ekpo_ci-zztarjeta.
      field ekpo_ci-ZZCENTRO_SER.
      field ekpo_ci-ZZREF_FACT.
      field ekpo_ci-ZZCLIENTE.
      field ekpo_ci-ZZPAIS.
      field ekpo_ci-zzdoc.
    module user_command_0111.
    module USER_COMMAND_0111 input.
    if sy-tcode = 'ME23N' and sy-ucomm = 'METOGG'.
    leave to transaction 'ME22N'.
    endif.
    if sy-tcode = 'ME22N' and sy-ucomm = 'METOGG'.
      leave to transaction 'ME23N'.
    endif.
    if sy-tcode = 'ME22N' and sy-ucomm = 'MESAVE'.
    sy-ucomm = 'METOGG'.
      leave to transaction 'ME23N'.
    endif.
    Thanx

    Hi,
    Check the code below:
    CALL FUNCTION 'READ_TEXT'
    EXPORTING
    id = '0001'
    language = sy-langu
    name = sname "sales doc is given here
    object = 'VBBK'
    TABLES
    lines = tlines.
    if not tlines is initial.
    LOOP AT tlines.
    CASE sy-tabix.
    WHEN 1.
    ztable-field1 = tlines-tdline.
    WHEN 2.
    ztable-field2 = tlines-tdline.
    WHEN 3.
    ztable-field3 = tlines-tdline.
    ENDLOOP.
    UPDATE ztable SET field1= ztable-field1
    field2= ztable-field2
    field3 = ztable-field3
    WHERE vbeln = vbak-vbeln.
    ENDIF.
    endif.
    Regards
    Kannaiah

  • To get details after second list in interactive report

    hai abap experts,
    i got a problem, i have written acode in which 3rd list is not executing how to write code for 3rd list(my 3rd list is to get item details by call transaction 'me23')
    i'll send u all my  code lz check n help out.
    TABLES : EKKO,
             EKPO,
             LFA1,
             EKET.
    SELECT-OPTIONS :  S_LIFNR FOR EKKO-LIFNR,
                      S_BSART FOR EKKO-BSART,
                      S_AEDAT FOR EKKO-AEDAT.
    ************************INTERNAL TABLES*******************************
    DATA : BEGIN OF RESULTS OCCURS 1000,    "DATA RETRIEVAL RESULTS
                 LIFNR LIKE EKKO-LIFNR,
                 EBELN LIKE EKKO-EBELN,
                 EBELP LIKE EKPO-EBELP,
                 AEDAT LIKE EKKO-AEDAT,
                 ERNAM LIKE EKKO-ERNAM,
                 LINES(3) TYPE N,
                 NETWR LIKE EKPO-NETWR,
                 MENGE LIKE EKPO-MENGE,
                 WEMNG LIKE EKET-WEMNG,
                 TXZ01 LIKE EKPO-TXZ01,
          END OF RESULTS.
    DATA : BEGIN OF WRK,                       "WORK FIELD DEFINATIONS
              HDRSW(1),                        "LIST HEADER SWITCH
              TITLE2(40),                      "2ND TITLE LINE FOR REPORT
           END OF WRK.
    DATA : BEGIN OF SELECT,                    "USER SELECTION FIELDS
                EBELN LIKE EKKO-EBELN,         "PURCHASE ORDER NO
                CHECKBOX(1) TYPE C,
           END OF SELECT.
    DATA : BEGIN OF STATS,                      "STATISTICS
           START_TIME LIKE SY-UZEIT,
           END_TIME LIKE SY-UZEIT,
           PROC_TIME LIKE SY-UZEIT,
           RECS_EKPO LIKE SY-DBCNT,
           RECS_EKKO LIKE SY-DBCNT,
       END OF STATS.
    **************************EVENTS**************************************
    INITIALIZATION.
      CLEAR S_AEDAT.
      S_AEDAT-SIGN = 'I'.
      S_AEDAT-OPTION = 'BT'.
      S_AEDAT-LOW = SY-DATUM - 30.
      S_AEDAT-HIGH = SY-DATUM.
      APPEND S_AEDAT.
    AT SELECTION-SCREEN.
      LOOP AT S_LIFNR.
        CHECK S_LIFNR-OPTION = 'EQ'.
        SELECT SINGLE * FROM LFA1 WHERE LIFNR = S_LIFNR-LOW.
        IF SY-SUBRC NE 0.
          MESSAGE E002 WITH 'VENDOR' S_LIFNR-LOW 'NOT FOUND IN LFA1'.
        ENDIF.
      ENDLOOP.
    START-OF-SELECTION.
      GET TIME.
      STATS-START_TIME = SY-UZEIT.
      SET PF-STATUS 'MAIN'.
      PERFORM DATA_RETRIEVAL.
      PERFORM PROCESS_DATA.
      PERFORM DISPLAY_LIST.
      PERFORM WRITE_SELECTIONS.
      PERFORM WRITE_STATISTICS.
    AT LINE-SELECTION.
      CHECK NOT SELECT-EBELN IS INITIAL.
      PERFORM DISPLAY_ITEM_DETAIL USING SELECT-EBELN.
      CLEAR : SELECT-EBELN.
    AT USER-COMMAND.
       CASE SY-UCOMM.
          WHEN 'DSA'.
            PERFORM CLEAR_ALL_SELECTED.
          WHEN 'DSL'.
             PERFORM DISPLAY_ALL_SELECTED.
       ENDCASE.
    TOP-OF-PAGE.
      CASE WRK-HDRSW.
        WHEN '1'.
          WRK-TITLE2 = 'PROGRAM SELECTIONS'(002).
        WHEN '2'.
          WRK-TITLE2 = 'PROGRAM DETAIL'(003).
        WHEN '3'.
          WRK-TITLE2 = 'PROGRAM SUMMARY'(004).
        WHEN '4'.
          WRK-TITLE2 = 'PROGRAM STATISTICS'(005).
      ENDCASE.
      FORMAT COLOR COL_HEADING.
      PERFORM PGH_STANDARD_HEADING
          USING        TEXT-001
                        WRK-TITLE2.
      IF WRK-HDRSW = '2'.
        WRITE : /01 SY-VLINE,
                 02 'VENDOR #'(103),
                 16 SY-VLINE,
                 17 'PO #'(104),
                 32 SY-VLINE,
                 33 'ENTRY DATE'(105),
                 43 SY-VLINE,
                 44 'USER'(106),
                 59 SY-VLINE,
                 60 'LINES'(107),
                 70 SY-VLINE,
                 71 'AMOUNT'(108),
                 91 SY-VLINE.
        WRITE : /01 SY-ULINE(91).
      ENDIF.
      FORMAT RESET.
    **************************SECONDRY LIST*******************************
    TOP-OF-PAGE DURING LINE-SELECTION.
      CASE WRK-HDRSW.
        WHEN '5'.
          WRK-TITLE2 = 'DETAIL LISTING'(201).
      ENDCASE.
      FORMAT COLOR COL_HEADING.
      PERFORM PGH_STANDARD_HEADING
          USING        TEXT-001
                        WRK-TITLE2.
      IF WRK-HDRSW = '5'.
        WRITE : /01 SY-VLINE,
                 02 'VENDOR #'(103),
                 16 SY-VLINE,
                 17 'PO #'(104),
                 32 SY-VLINE,
                 33 'ENTRY DATE'(105),
                 43 SY-VLINE,
                 44 'USER'(106),
                 59 SY-VLINE.
        WRITE : /01 SY-ULINE(59).
        FORMAT COLOR COL_KEY.
        WRITE : /01 SY-VLINE,
                 02 RESULTS-LIFNR,
                 16 SY-VLINE,
                 17 RESULTS-EBELN,
                 32 SY-VLINE,
                 33 RESULTS-AEDAT DD/MM/YY,
                 43 SY-VLINE,
                 44 RESULTS-ERNAM,
                 59 SY-VLINE.
        WRITE : /01 SY-ULINE(101).
        FORMAT COLOR COL_HEADING.
        WRITE : /01 SY-VLINE,
                 02 'LINE'(301),
                 07 SY-VLINE,
                 08 'DESCRIPTION'(302),
                 48 SY-VLINE,
                 49 'QTY ORDERDED'(303),
                 64 SY-VLINE,
                 65 'QTY RECEIVED'(304),
                 80 SY-VLINE,
                 81 'AMOUNT'(305),
                 101 SY-VLINE.
        WRITE : /01 SY-ULINE(101).
      ENDIF.
      FORMAT RESET.
    *************************SUBROUTINES**********************************
    FORM DISPLAY_ALL_SELECTED.
    DATA : LINE_NUMBER LIKE SY-LILLI.
              LINE_NUMBER = 1.
      DO.
      CLEAR : SELECT-CHECKBOX,
              SELECT-EBELN.
    READ LINE LINE_NUMBER   FIELD VALUE SELECT-CHECKBOX
                                           SELECT-EBELN.
      IF SY-SUBRC NE 0.
            EXIT.
      ENDIF.
    ADD 1 TO LINE_NUMBER.
    CHECK SELECT-CHECKBOX = 'X'.
    NEW-PAGE.
    PERFORM DISPLAY_ITEM_DETAIL USING SELECT-EBELN.
    ENDDO.
    ENDFORM.
    FORM CLEAR_ALL_SELECTED.
    DATA : LINE_NUMBER LIKE SY-LILLI.
             LINE_NUMBER = 1.
      DO.
      READ LINE LINE_NUMBER   FIELD VALUE SELECT-CHECKBOX
                                           SELECT-EBELN.
      IF SY-SUBRC NE 0.
            EXIT.
      ENDIF.
    IF SELECT-CHECKBOX = 'X'.
    CLEAR : SELECT-CHECKBOX.
    MODIFY LINE LINE_NUMBER FIELD VALUE SELECT-CHECKBOX
                                      SELECT-EBELN.
    ENDIF.
    ADD 1 TO LINE_NUMBER.
    ENDDO.
    ENDFORM.
    FORM DATA_RETRIEVAL.
      SELECT * FROM EKKO WHERE BSART IN S_BSART
                           AND AEDAT IN S_AEDAT
                           AND LIFNR IN S_LIFNR.
        CLEAR RESULTS.
        RESULTS-LIFNR = EKKO-LIFNR.
        RESULTS-EBELN = EKKO-EBELN.
        RESULTS-AEDAT = EKKO-AEDAT.
        RESULTS-ERNAM = EKKO-ERNAM.
        SELECT * FROM EKPO WHERE EBELN = EKKO-EBELN.
          MOVE 1 TO RESULTS-LINES.
          MOVE EKPO-NETWR TO RESULTS-NETWR.
          RESULTS-EBELP = EKPO-EBELP.
          RESULTS-TXZ01 = EKPO-TXZ01.
          RESULTS-MENGE = EKPO-MENGE.
          APPEND RESULTS.
        ENDSELECT.
      ENDSELECT.
    ENDFORM.                    "DATA_RETRIEVAL
    FORM PROCESS_DATA.
      LOOP AT RESULTS.
        CLEAR RESULTS-WEMNG.
        SELECT * FROM EKET WHERE EBELN = RESULTS-EBELN
                       AND EBELP = RESULTS-EBELP.
          ADD EKET-WEMNG TO RESULTS-WEMNG.
        ENDSELECT.
        MODIFY RESULTS.
      ENDLOOP.
    ENDFORM.                    "PROCESS_DATA
    FORM DISPLAY_LIST.
      DATA : TOT_LINES(3) TYPE N.
      DATA : TOT_AMT      LIKE EKPO-NETWR.
      DATA : WRT_FLAG(1)  TYPE C.
      SORT RESULTS BY LIFNR EBELN.
      NEW-PAGE.
      WRK-HDRSW = '2'.
      LOOP AT RESULTS.
        AT END OF EBELN.
          MOVE 'X' TO WRT_FLAG.
        ENDAT.
        ADD 1 TO TOT_LINES.
        ADD RESULTS-NETWR TO TOT_AMT.
        IF WRT_FLAG = 'X'.
          WRITE : /01 SY-VLINE,
                   02 SELECT-CHECKBOX AS CHECKBOX,
                   04 RESULTS-LIFNR,
                   16 SY-VLINE,
                   17 RESULTS-EBELN,
                   32 SY-VLINE,
                   33 RESULTS-AEDAT MM/DD/YY,
                   43 SY-VLINE,
                   44 RESULTS-ERNAM,
                   59 SY-VLINE,
                   60 TOT_LINES,
                   70 SY-VLINE,
                   71 TOT_AMT,
                   91 SY-VLINE.
          SELECT-EBELN = RESULTS-EBELN.
          HIDE : SELECT-EBELN.
          CLEAR : SELECT-EBELN.
          WRITE : /01 SY-ULINE(91).
          CLEAR : WRT_FLAG,
                  TOT_LINES,
                  TOT_AMT.
        ENDIF.
        AT END OF LIFNR.
         SUM.
          FORMAT COLOR COL_GROUP.
          WRITE : /01 SY-VLINE,
                   02 'TOTAL FOR VENDOR:'(101),
                       RESULTS-LIFNR,
                   70 SY-VLINE,
                   71 RESULTS-NETWR,
                   91 SY-VLINE.
          WRITE : /01 SY-ULINE(91).
          FORMAT RESET.
        ENDAT.
      ENDLOOP.
      IF SY-SUBRC NE 0.
        FORMAT COLOR COL_NEGATIVE.
        WRITE : /01 SY-VLINE,
                 02 'NO RECORDS FOUND'(102),
                 91 SY-VLINE.
        WRITE : /01 SY-ULINE(91).
        FORMAT RESET.
      ENDIF.
    ENDFORM.                    "DISPLAY_LIST
    FORM DISPLAY_ITEM_DETAIL USING L_EBELN.
    CALL TRANSACTION 'ME23' AND SKIP FIRST SCREEN.
    SET PARAMETER ID 'BES' FIELD L_EBELN.
    *GET PARAMETER ID 'BES' FIELD L_EBELN.
      WRK-HDRSW = '5'.
      SET PF-STATUS 'STLI'.
      LOOP AT RESULTS WHERE EBELN = L_EBELN.
        WRITE : /01 SY-VLINE,
                 02 RESULTS-EBELP,
                 07 SY-VLINE,
                 08 RESULTS-TXZ01,
                 48 SY-VLINE,
                 49(15) RESULTS-MENGE,
                 64 SY-VLINE,
                 65(15) RESULTS-WEMNG,
                 80 SY-VLINE,
                 81 RESULTS-NETWR,
                 101 SY-VLINE.
          WRITE : /01 SY-ULINE(101).
        ENDLOOP.
      IF SY-SUBRC NE 0.
        FORMAT COLOR COL_NEGATIVE.
        WRITE : /01 SY-VLINE,
                 02 'NO RECORDS FOUND'(102),
                 91 SY-VLINE.
        WRITE : /01 SY-ULINE(91).
        FORMAT RESET.
      ENDIF.
    ENDFORM.                    "DISPLAY_ITEM_DETAIL
    FORM WRITE_SELECTIONS.
      NEW-PAGE.
      WRK-HDRSW = '1'.
      WRITE : /01 SY-VLINE,
               02 'VENDOR NUMBER'(112),
               25 SY-VLINE.
      LOOP AT S_LIFNR.
        WRITE : 26 S_LIFNR,
                91 SY-VLINE.
        WRITE : /01 SY-ULINE(91).
      ENDLOOP.
      IF SY-SUBRC NE 0.
        WRITE : 26 '*ALL*'(200),
                91 SY-VLINE.
        WRITE : /01 SY-ULINE(91).
      ENDIF.
      WRITE : /01 SY-VLINE,
               02 'PO TYPE'(111),
               25 SY-VLINE.
      LOOP AT S_BSART.
        WRITE : 26 S_BSART,
                91 SY-VLINE.
        WRITE : /01 SY-ULINE(91).
      ENDLOOP.
      IF SY-SUBRC NE 0.
        WRITE : 26 '*ALL*'(200),
                91 SY-VLINE.
        WRITE : /01 SY-ULINE(91).
      ENDIF.
      WRITE : /01 SY-VLINE,
               02 'ENTRY DATES'(112),
               25 SY-VLINE.
      LOOP AT S_AEDAT.
        WRITE : 26 S_AEDAT,
                91 SY-VLINE.
        WRITE : /01 SY-ULINE(91).
      ENDLOOP.
      IF SY-SUBRC NE 0.
        WRITE : 26 '*ALL*'(200),
                91 SY-VLINE.
        WRITE : / SY-ULINE(91).
      ENDIF.
    ENDFORM.                    "WRITE_SELECTIONS
    FORM WRITE_STATISTICS.
      NEW-PAGE.
      WRK-HDRSW = '4'.
      GET TIME.
      STATS-END_TIME = SY-UZEIT.
      IF STATS-END_TIME > STATS-START_TIME.
        STATS-PROC_TIME = STATS-END_TIME - STATS-START_TIME.
      ELSE.
        STATS-PROC_TIME = '240000'.
        STATS-PROC_TIME = STATS-PROC_TIME - STATS-START_TIME.
        STATS-PROC_TIME = STATS-PROC_TIME + STATS-END_TIME.
      ENDIF.
      WRITE : /01 SY-VLINE,
               02 'START TIME'(113),
               25 SY-VLINE,
               26 STATS-START_TIME USING EDIT MASK '__:__:__',
               91 SY-VLINE.
      WRITE : /01 SY-ULINE(91).
      WRITE : /01 SY-VLINE,
               02 'END TIME'(114),
               25 SY-VLINE,
               26 STATS-END_TIME USING EDIT MASK '__:__:__',
               91 SY-VLINE.
      WRITE : /01 SY-ULINE(91).
      WRITE : /01 SY-VLINE,
               02 'PROCESSING TIME'(115),
               25 SY-VLINE,
               26 STATS-PROC_TIME USING EDIT MASK '__:__:__',
               91 SY-VLINE.
      WRITE : /01 SY-ULINE(91).
      WRITE : /01 SY-VLINE,
               02 'EKKO RECORDS READ'(116),
               25 SY-VLINE,
               26 STATS-RECS_EKKO,
               91 SY-VLINE.
      WRITE : /01 SY-ULINE(91).
      WRITE : /01 SY-VLINE,
               02 'EKPO RECORDS READ'(117),
               25 SY-VLINE,
               26 STATS-RECS_EKPO,
               91 SY-VLINE.
      WRITE : /01 SY-ULINE(91).
    ENDFORM.                    "WRITE_STATISTICS
    FORM PGH_STANDARD_HEADING USING L_TITLE1
                                    L_TITLE2.
      FORMAT COLOR COL_HEADING.
      PERFORM PGH_WRITE_DATE_TIME.
      PERFORM PGH_WRITE_TITLE USING L_TITLE1.
      PERFORM PGH_WRITE_REPORT_PAGE.
      PERFORM PGH_WRITE_USERID.
      PERFORM PGH_WRITE_TITLE USING L_TITLE2.
      PERFORM PGH_WRITE_SYSTEM_CLIENT.
      FORMAT RESET.
    ENDFORM.                    "PGH_STANDARD_HEADING
    FORM PGH_WRITE_USERID.
      WRITE : /01 SY-ULINE(91).
      WRITE : /01 SY-VLINE,
               02 'USERID:',
               10 SY-UNAME,
               91 SY-VLINE.
    ENDFORM.                    "PGH_WRITE_USERID
    FORM PGH_WRITE_DATE_TIME.
      WRITE : /01 SY-ULINE(91).
      WRITE : /01 SY-VLINE,
               02 'DATE:',
               10 SY-DATUM MM/DD/YYYY,
               21 '/',
               23 SY-UZEIT USING EDIT MASK'__:__:__',
               91 SY-VLINE.
    ENDFORM.                    "PGH_WRITE_DATE_TIME
    FORM PGH_WRITE_TITLE USING L_TITLE.
      DATA : L_LINSZ LIKE SY-LINSZ.
      DATA : L_TITLEL LIKE SY-TABIX.
      DATA : L_START LIKE SY-TABIX.
      L_LINSZ = SY-LINSZ.
      L_TITLEL = STRLEN( L_TITLE ).
      L_START = ( L_LINSZ / 2 ) - ( L_TITLEL / 2 ).
      POSITION L_START.
      WRITE :/01 SY-VLINE,
              02 L_TITLE,
              91 SY-VLINE.
    ENDFORM.                    "PGH_WRITE_TITLE
    FORM PGH_WRITE_REPORT_PAGE.
      DATA : L_LINSZ LIKE SY-LINSZ.
      DATA : L_START LIKE SY-TABIX.
      L_LINSZ = SY-LINSZ.
      L_START = L_LINSZ - 24.
      POSITION L_START.
      WRITE : /01 SY-VLINE,
               02 'REPORT:', SY-REPID, 'PG', (4) SY-PAGNO,
               91 SY-VLINE.
      POSITION L_LINSZ.
    ENDFORM.                    "PGH_WRITE_REPORT_PAGE
    FORM PGH_WRITE_SYSTEM_CLIENT.
      DATA : L_LINSZ LIKE SY-LINSZ.
      DATA : L_START LIKE SY-TABIX.
      L_LINSZ = SY-LINSZ.
      L_START = L_LINSZ - 24.
      POSITION L_START.
      WRITE :/01 SY-VLINE,
              02 'SYSTEM:', SY-SYSID,'/',SY-MANDT,
              91 SY-VLINE.
      POSITION L_LINSZ.
    WRITE :/01 SY-VLINE.
      WRITE : /01 SY-ULINE(91).
    ENDFORM.                    "PGH_WRITE_SYSTEM_CLIENT

    There is a very minor correction in your logic.
    FORM DISPLAY_ITEM_DETAIL USING L_EBELN.
    CALL TRANSACTION 'ME23' AND SKIP FIRST SCREEN.
    SET PARAMETER ID 'BES' FIELD L_EBELN.
    *GET PARAMETER ID 'BES' FIELD L_EBELN.
    instead of this try
    SET PARAMETER ID 'BES' FIELD L_EBELN.
    CALL TRANSACTION 'ME23' AND SKIP FIRST SCREEN.
    you should always set the parameter id first and then call the transaction.
    i tried it in my system and it seems to be working.

  • TEXT_ID for Item Text of Purchase Order

    Hi,
    i want to fill a item text of a purchase order via BAdI BBP_PO_INBOUND_BADI. The BAdI is called, that's tested.
    Transaction ME23, Item / Texts / Text overview.
    I tried with
      data:
        lw_TEXT type BBPS_IF_BAPIMEPOTEXT.
        lw_TEXT-PO_NUMBER = '4400001659'.
        lw_TEXT-PO_ITEM   = '00001'.
        lw_TEXT-TEXT_ID   = '0001'.
        lw_TEXT-TEXT_FORM = '* '.
        lw_TEXT-TEXT_LINE = 'strike'.
        append lw_text to BBP_POTEXTITEM.
    and hoped to see "strike" as text - no success. Of course the values should be found later dynamicly.
    In my point of view the parameter TEXT_ID is the problem. I tried 01, 0001, L01, K01, A01 and F01 but without success.
    How can i find out the right TEXT_ID?

    Hello Udo,
    I have exactly the same requirement, I need to fill the item text via (BBP_PO_INBOUND_BADI, method: BP_MAP_BEFORE_BAPI).
    In my case I have to write some values in BAPI_POTEXTITEM.   However, it seems that the badi is not saving the data.  At least I cannot see the text values in ME23N, Item / Texts.
    Would you give me an advice ?
    Thank you !
    best regards,
    Diego

  • Item Text of Purchase Order

    Hi,
    i want to read a (long) text of a purchase order item.
    Transaction ME23, Item/Texts/Text overview
    In my user-exit i have access to po-no (EBELN), item-no (EBELP) and some other parameters of the purchase order.
    Does somebody know a function module or the way how to select that text?
    Regards,
    Udo

    Check this sample.
    report zrich_0002.
    data:  id like  thead-tdid,
           name like  thead-tdname,
           object like  thead-tdobject.
    data: lines type table of tline with header line.
    parameters: p_ebeln type ekpo-ebeln,
                p_ebelp type ekpo-ebelp.
    start-of-selection.
      id = 'F01'.            " Item Text
      object = 'EKPO'.
      concatenate p_ebeln p_ebelp into name.
      call function 'READ_TEXT'
           exporting
                id       = id
                language = sy-langu
                name     = name
                object   = object
           tables
                lines    = lines.
      loop at lines.
        write:/ lines-tdline.
      endloop.
    Regards,
    Rich Heilman

  • Determine Purchase Order in ME23n/ME22n

    Hello.
    Question from user. In transaction ME23/ME22 firstly selection screen appear and you could choose exact PO for display/change. Wjen you use ME23n/ME22n trs the last (or last used don't know exactly) PO displayed and only after that you able to choose the Order you want to display/change.
    Is it possiable to have selection screen first in the ME23n/ME22n without displaying default PO?

    >>you can use custom developement for this.
    You mean user exits? Do you know what user exit I can use for that?

  • Regarding Drill down

    Dear all,
    I have an interactive ALV report.
    When i double click on PO number,
    if user has authorization to change then drill down should take user to ME22N.
    if user has authorization only to display then drill down should take to ME23N.
    if user does not have any authorization a pop should say "No authorization to drill down".
    Please help me in this.
    Thanks in Advance
    Regards,
    Vineel

    REPORT ZMK_SHIPMENT_ALV
             no standard page heading
             line-size 105
             line-count 50(5)
             message-id zz.
           TABLES                  *
    tables : vttk, "Shipment Header
             vttp, " Shipment Item
             lips. " Delivary Item
    ***TYPE-POOLS                    *
    type-pools : slis.
    *WORK AREAS                      *
    Work area for field catalog table
    data : wa_fldcat type slis_fieldcat_alv.
    Work area for Events table
    data : wa_events type slis_alv_event.
    Work area for layout.
    data : wa_layout type slis_layout_alv.
    *INTERNAL TABLES                  *
    Shimpment Details
    data : begin of itab occurs 0,
           tknum like vttk-tknum,
           shtyp like vttk-shtyp,
           tpnum like vttp-tpnum,
           vbeln like vttp-vbeln,
           end of itab.
    data : begin of itab1 occurs 0,
           vbeln like lips-vbeln,
           posnr like lips-posnr,
           matnr like lips-matnr,
           lfimg like lips-lfimg,
           meins like lips-meins,
           end of itab1.
    For field catalog table
    data : it_fldcats type slis_t_fieldcat_alv.
    For Events table
    data : it_event type slis_t_event.
    For layout.
    data : it_layout type slis_layout_alv.
    For field catalog table
    data : it_fldcats1 type slis_t_fieldcat_alv.
    For Events table
    data : it_event1 type slis_t_event.
    data : v_repid like sy-repid.
    *Data Declaration
    data: v_index type sy-index,
          v_vbeln like lips-vbeln.
    *SELECT-OPTIONS
    selection-screen begin of block b with frame title text-001.
              select-options : s_tknum for vttk-tknum .
    selection-screen end of block b.
    *INITIALIZATION
    initialization.
    v_repid = sy-repid.
    *START-OF-SELCTION
    start-of-selection.
      perform populate-data.
      sort itab by tknum.
    top-of-page.
    write : 'Shipment wise Delivary Report'.
    end-of-selection.
      perform build-fieldcatalog.
      perform modify-fieldcatalog.
      perform build-events.
      perform modify-events.
      perform set-layout.
    perform set-pfstatus.
      perform list-display.
    *&      Form  populate-data
        Retrives the Shipment data depending on the selection criteria   *
    FORM populate-data.
    select vttk~tknum
           vttk~shtyp
           vttp~tpnum
           vttp~vbeln
           into table itab
           from vttk
           join vttp
           on vttptknum = vttktknum
           where vttk~tknum  in s_tknum.
       if sy-subrc <> 0.
        message e999 with 'NO DATA FOUND'.
        exit.
      endif.
    ENDFORM.                    " populate-data
    *&      Form  build-fieldcatalog
          text
    -->  p1        text
    <--  p2        text
    form build-fieldcatalog.
      call function 'REUSE_ALV_FIELDCATALOG_MERGE'
    exporting
        i_program_name               = v_repid
        i_internal_tabname           = 'ITAB'
      I_STRUCTURE_NAME             =
      I_CLIENT_NEVER_DISPLAY       = 'X'
        i_inclname                   = v_repid
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
      changing
        ct_fieldcat                  = it_fldcats
      exceptions
        inconsistent_interface       = 1
        program_error                = 2
        others                       = 3
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    endform.                    " BUILD-FIELDCATALOG
    *&      Form  build-events
          text
    -->  p1        text
    <--  p2        text
    FORM build-events.
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
       I_LIST_TYPE           = 0
    IMPORTING
       ET_EVENTS             = it_event
    EXCEPTIONS
       LIST_TYPE_WRONG       = 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.                    " build-events
    *&      Form  set-layout
          text
    -->  p1        text
    <--  p2        text
    FORM set-layout.
      wa_layout-zebra          = 'X'.
      wa_layout-colwidth_optimize = 'X'.
      wa_layout-no_colhead = space.
      wa_layout-no_vline = space.
    ENDFORM.                    " set-layout
    *&      Form  list-display
          text
    -->  p1        text
    <--  p2        text
    FORM list-display.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
       I_CALLBACK_PROGRAM             = v_repid
      I_CALLBACK_PF_STATUS_SET       = ' '
       I_CALLBACK_USER_COMMAND        = 'USER_COMMAND'
      I_STRUCTURE_NAME               =
       IS_LAYOUT                      = wa_layout
       IT_FIELDCAT                    = it_fldcats
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
      IT_SORT                        =
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      IS_VARIANT                     =
       IT_EVENTS                      = it_event
      IT_EVENT_EXIT                  =
      IS_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                       = itab
    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.                    " list-display
    *&      Form  modify-fieldcatalog
          text
    -->  p1        text
    <--  p2        text
    FORM modify-fieldcatalog.
    loop at it_fldcats into wa_fldcat.
        case wa_fldcat-fieldname.
          when 'TKNUM'.
            wa_fldcat-seltext_l = 'Ship No.'.
            wa_fldcat-col_pos = 1.
            wa_fldcat-ddictxt = 'L'.
            when 'SHTYP'.
            wa_fldcat-seltext_l = 'Ship Type'.
            wa_fldcat-col_pos = 2.
            wa_fldcat-ddictxt = 'L'.
         when 'TPNUM'.
            wa_fldcat-seltext_l = 'Item No.'.
            wa_fldcat-col_pos = 3.
            wa_fldcat-ddictxt = 'L'.
         when 'VBELN'.
            wa_fldcat-seltext_l = 'Delivary No.'.
            wa_fldcat-hotspot = 'X'.
            wa_fldcat-col_pos = 4.
            wa_fldcat-ddictxt = 'L'.
        endcase.
       modify it_fldcats from wa_fldcat.
       endloop.
    ENDFORM.                    " modify-fieldcatalog
    *&      Form  modify-events
          text
    -->  p1        text
    <--  p2        text
    form modify-events.
        read table it_event with key name =
    slis_ev_top_of_page into wa_events.
       if sy-subrc = 0.
        wa_events-form = 'HEADER-OF-REPORT'.
        modify it_event from wa_events index sy-tabix.
        clear wa_events.
       endif.
       read table it_event with key name =
    slis_ev_end_of_page into wa_events.
       if sy-subrc = 0.
        wa_events-form = 'FOOTER-OF-REPORT'.
        modify it_event from wa_events index sy-tabix.
        clear wa_events.
      endif.
    endform.                    " modify-events
    *&      Form  HEADER-OF-REPORT
          text
    -->  p1        text
    <--  p2        text
    FORM HEADER-OF-REPORT.
    write : 'Shipment Wise Delivary Report'.
    ENDFORM.                    " HEADER-OF-REPORT
    *&      Form  FOOTER-OF-REPORT
          text
    -->  p1        text
    <--  p2        text
    FORM FOOTER-OF-REPORT.
    write : 'End of Report'.
    ENDFORM.                    " FOOTER-OF-REPORT
    *&      Form  USER_COMMAND
          User command for Calling Transaction VT03N, Execute and Refresh
    FORM user_command USING    p_ucomm    LIKE sy-ucomm
                             p_selfield TYPE slis_selfield.
      V_INDEX = P_SELFIELD-TABINDEX.      " holds the selected table index
      CASE p_ucomm.
        WHEN '&IC1'.
         IF p_selfield-fieldname eq 'VBELN'.
          perform secondary_list.
         ENDIF.
      ENDCASE.
    ENDFORM.                    " USER_COMMAND
    *&      Form  secondary_list
          text
    -->  p1        text
    <--  p2        text
    FORM secondary_list.
    perform get_data1.
    perform build-fieldcatalog1.
      perform modify-fieldcatalog1.
      perform build-events1.
      perform modify-events1.
    perform set-layout.
    perform set-pfstatus.
      perform list-display1.
    ENDFORM.                    " secondary_list
    *&      Form  build-fieldcatalog1
          text
    -->  p1        text
    <--  p2        text
    FORM build-fieldcatalog1.
    call function 'REUSE_ALV_FIELDCATALOG_MERGE'
    exporting
        i_program_name               = v_repid
        i_internal_tabname           = 'ITAB1'
      I_STRUCTURE_NAME             =
      I_CLIENT_NEVER_DISPLAY       = 'X'
        i_inclname                   = v_repid
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
      changing
        ct_fieldcat                  = it_fldcats1
      exceptions
        inconsistent_interface       = 1
        program_error                = 2
        others                       = 3
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    ENDFORM.                    " build-fieldcatalog1
    *&      Form  modify-fieldcatalog1
          text
    -->  p1        text
    <--  p2        text
    FORM modify-fieldcatalog1.
    loop at it_fldcats into wa_fldcat.
        case wa_fldcat-fieldname.
          when 'VBELN'.
            wa_fldcat-seltext_l = 'Delivary No.'.
            wa_fldcat-col_pos = 1.
            wa_fldcat-ddictxt = 'L'.
            when 'POSNR'.
            wa_fldcat-seltext_l = 'Item No'.
            wa_fldcat-col_pos = 2.
            wa_fldcat-ddictxt = 'L'.
         when 'MATNR'.
            wa_fldcat-seltext_l = 'Material'.
            wa_fldcat-col_pos = 3.
            wa_fldcat-ddictxt = 'L'.
         when 'LFIMG'.
            wa_fldcat-seltext_l = 'Quantity'.
            wa_fldcat-col_pos = 4.
            wa_fldcat-ddictxt = 'L'.
         when 'MEINS'.
            wa_fldcat-seltext_l = 'Unit of Measure'.
            wa_fldcat-col_pos = 5.
            wa_fldcat-ddictxt = 'L'.
        endcase.
       modify it_fldcats from wa_fldcat.
       endloop.
    ENDFORM.                    " modify-fieldcatalog1
    *&      Form  build-events1
          text
    -->  p1        text
    <--  p2        text
    FORM build-events1.
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
       I_LIST_TYPE           = 0
    IMPORTING
       ET_EVENTS             = it_event1
    EXCEPTIONS
       LIST_TYPE_WRONG       = 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.                    " build-events1
    *&      Form  modify-events1
          text
    -->  p1        text
    <--  p2        text
    FORM modify-events1.
    read table it_event1 with key name =
    slis_ev_top_of_page into wa_events.
       if sy-subrc = 0.
        wa_events-form = 'HEADER_OF_REPORT_2'.
        modify it_event1 from wa_events index sy-tabix.
        clear wa_events.
       endif.
    ENDFORM.                    " modify-events1
    *&      Form  list-display1
          text
    -->  p1        text
    <--  p2        text
    FORM list-display1.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
       I_CALLBACK_PROGRAM             = v_repid
      I_CALLBACK_PF_STATUS_SET       = ' '
      I_CALLBACK_USER_COMMAND        = 'USER_COMMAND'
      I_STRUCTURE_NAME               =
       IS_LAYOUT                      = wa_layout
       IT_FIELDCAT                    = it_fldcats1
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
      IT_SORT                        =
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      IS_VARIANT                     =
       IT_EVENTS                      = it_event1
      IT_EVENT_EXIT                  =
      IS_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                       = itab1
    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.                    " list-display1
    *&      Form  get_data1
          text
    -->  p1        text
    <--  p2        text
    FORM get_data1.
    READ TABLE itab INDEX V_INDEX.
    v_vbeln = itab-vbeln.
    select vbeln
            posnr
            matnr
            lfimg
            meins
            from lips
            into table itab1
            where vbeln eq v_vbeln.
    ENDFORM.                    " get_data1
    *&      Form  header_of_report_2
          text
    -->  p1        text
    <--  p2        text
    FORM header_of_report_2.
    write: 'Delivary item list'.
    ENDFORM.                    " header_of_report_2
    *-- callling a transaction code by passing the initial screen value.
    *&      Form  USER_COMMAND
    form user_command using    p_ucomm    like sy-ucomm
                             p_selfield type slis_selfield.
      data : l_index like sy-index,
             l_refbn like cooi-refbn.
      l_index = p_selfield-tabindex.       " holds the selected table index
      clear l_refbn.
      case p_ucomm.
        when '&IC1'.
          clear l_refbn.
          read table it_outtab index l_index.
          if sy-subrc eq 0.
            l_refbn = it_outtab-refbn.
            if not l_refbn is initial.
    CALL FUNCTION 'AUTHORITY_CHECK_TCODE'
      EXPORTING
        TCODE         = 'ME22'
    EXCEPTIONS
       OK            = 1
       NOT_OK        = 2
       OTHERS        = 3
       if sy-subrc eq 1.
              set parameter id 'BES' field l_refbn.
              call transaction 'ME22' and skip first screen.
      else.
    CALL FUNCTION 'AUTHORITY_CHECK_TCODE'
      EXPORTING
        TCODE         = 'ME23'
    EXCEPTIONS
       OK            = 1
       NOT_OK        = 2
       OTHERS        = 3
        if sy-subrc eq 1.
    set parameter id 'BES' field l_refbn.
              call transaction 'ME23' and skip first screen.
       endif.
      else.
       call function 'POPUP_DISPLAY_MESSAGE'
      exporting
        titel = 'This is a popup message'
        msgid = '00'
        msgty = 'E'
        msgno = '001'
        msgv1 = 'Message Variable 1'
        msgv2 = 'Message Variable 2'
        msgv3 = 'Message Variable 3'
        msgv4 = 'Message Variable 4'.
      endif.
            endif.
          else.
            message e999 with text-014.
          endif.
      endcase.
    endif.

Maybe you are looking for

  • Modification in MB52

    Hi, i am working on to modify a standard program by copying it. the stadandrd tcode is MB52. i copied the program and making changes.. My requirement is to add to know fields. they are 1. material date 2. no.of days from today the material is created

  • See the box model in Design View

    This is probably a simple question but I can't seem to figure this out or find out about it in the help.sometines when I'm working on a page element the margnins and padding are shown in the design view window. most often they are not visable. How ca

  • Snow Leopard software update log

    I have enclosed a capture of my Snow leopard update software update log found in the "Apple menu" "system preferences" You will noticed that Itunes did not have a version and never updated on my system. Can any one tell me what the update called "MBP

  • What is other mean in iPhone summary

    What is other mean in iPhone summary

  • Deploy .war file directly to OC4J

    is it possible to deploy a .war file directly with having to create a .ear file