Crear Boton (Icono) como Parámetro en Prog Tipo Report

Colapsar
X
 
  • Tiempo
  • Mostrar
Limpiar Todo
nuevos mensajes
  • Ariel-StaFe
    Senior Member
    • nov
    • 321

    #1

    Crear Boton (Icono) como Parámetro en Prog Tipo Report

    Estimados:
    Estoy generando un programa tipo Report Z sencillo, pero me piden que en lugar de que se ejecute con el icono standard (F8) de Sap, tenga 2 funciones (Visualizar que podria ser con el icono del lente) y otro de (Autorizar, con el icono de la bandera), como hago para crear 2 botones y ubicarlos sobre los parametros de ejecución ? (el parametro sería nro de pedido x ejemplo)
    Desde ya muchas Gracias
    Ariel-StaFe
    Analista Programador Abap Senior
    Santa Fe Capital
    Pcia de Santa Fe
    Argentina
  • Jarpi
    Senior Member
    • abr
    • 453

    #2
    Buenas tardes Ariel-StaFe.

    Si entendí bien, tendrías que hacer esto.

    Dentro del primer BLOCK pone esto:

    SELECTION-SCREEN FUNCTION KEY 1.
    SELECTION-SCREEN FUNCTION KEY 2.

    Y después del INITIALIZATION pone:

    e_smp_dyntxt-text = 'Botón 1'.
    e_smp_dyntxt-icon_id = TU ICONO.
    e_smp_dyntxt-icon_text = 'Texto'.
    e_smp_dyntxt-quickinfo = 'Información rapida'.
    e_smp_dyntxt-path = 'Path'.
    sscrfields-functxt_01 = e_smp_dyntxt.

    e_smp_dyntxt-text = 'Botón 2'.
    e_smp_dyntxt-icon_id = TU ICONO.
    e_smp_dyntxt-icon_text = 'Texto'.
    e_smp_dyntxt-quickinfo = 'Informacion rapida'.
    e_smp_dyntxt-path = 'Path'.
    sscrfields-functxt_02 = e_smp_dyntxt.

    Espero te sirva.

    Saludos.

    Comentario

    • Ariel-StaFe
      Senior Member
      • nov
      • 321

      #3
      Muchas Gracias !.
      Puede que sea.
      como declaro la tabla o estructura e_smp_dyntxt ?
      Ariel-StaFe
      Analista Programador Abap Senior
      Santa Fe Capital
      Pcia de Santa Fe
      Argentina

      Comentario

      • Mauricio Hidalgo
        Senior Member
        • may
        • 481

        #4
        Con estos dos eventos deberia ser suficiente: BOTONES es un status donde está definidos tus iconos y codigos de función.


        initialization.
        set pf-status 'BOTONES'.

        parameters p_vbeln type vbak-vbeln.


        at selection-screen.
        case sy-ucomm.
        when 'BACK'.
        leave to screen 0.
        when 'VISUALIZA'.
        when 'AUTORIZA'.
        endcase.

        Comentario

        • Jarpi
          Senior Member
          • abr
          • 453

          #5
          DATA: e_smp_dyntxt LIKE smp_dyntxt

          Saludos.

          Comentario

          • Ariel-StaFe
            Senior Member
            • nov
            • 321

            #6
            Buenisimo !
            Los 2 modos estan barbaros !.
            Muchas gracias a ambos !.
            Saludos desde Santa Fe Capital !.
            Provincia de Santa Fe
            Argentina
            Ariel-StaFe
            Analista Programador Abap Senior
            Santa Fe Capital
            Pcia de Santa Fe
            Argentina

            Comentario

            • Mauricio Hidalgo
              Senior Member
              • may
              • 481

              #7
              En todo caso me gustó más la solución de JARPI. No sabía esa de los cinco codigos de función reservados para usuario.

              Gracias por el aporte.

              Complemento para que quites el Botón del relojito (F8):


              report demo_sel_screen_function_key.
              type-pools icon.
              tables sscrfields.

              data functxt type smp_dyntxt.
              data: begin of fuera occurs 0,
              codi(20) type c,
              end of fuera.

              parameters: p_carrid type s_carr_id,
              p_cityfr type s_from_cit.
              selection-screen: function key 1,
              function key 2.

              initialization.
              clear fuera. refresh fuera.
              fuera-codi = 'ONLI'.
              append fuera.

              call function 'RS_SET_SELSCREEN_STATUS'
              exporting
              p_status = '%_00'
              tables
              p_exclude = fuera.


              functxt-icon_id = icon_display.
              functxt-quickinfo = 'Visualizar'.
              functxt-icon_text = 'Visualizar'.
              sscrfields-functxt_01 = functxt.

              functxt-icon_id = icon_release.
              functxt-quickinfo = 'Autorizar'.
              functxt-icon_text = 'Autorizar'.
              sscrfields-functxt_02 = functxt.

              at selection-screen.
              case sscrfields-ucomm.
              when 'FC01'.

              when 'FC02'.

              when others.
              ...
              endcase.

              start-of-selection.

              Comentario

              • Ariel-StaFe
                Senior Member
                • nov
                • 321

                #8
                Gracias !

                Excelente. Muchas gracias a ambos !
                Ariel-StaFe
                Analista Programador Abap Senior
                Santa Fe Capital
                Pcia de Santa Fe
                Argentina

                Comentario

                Trabajando...