Ayuda Matchcode.

Colapsar
X
 
  • Tiempo
  • Mostrar
Limpiar Todo
nuevos mensajes
  • miguel.esteban.martin
    Member
    • ene
    • 89

    #1

    Ayuda Matchcode.

    Hola bueno dias.

    Tengo un alv con bastantes campos, uno de ellos se llama "accion".
    me gustaria que salir un matchcode con estos valores.

    garantia
    reparacion
    prestamo.

    como puedo crear este matchcode sin enlazarlo a ninguna tabla de verificacion ni nada.

    Solo por codigo, poner uqe salgan estras 3 opciones.

    Muchas gracias.
  • Garces
    Senior Member
    • ago
    • 321

    #2
    Originalmente publicado por miguel.esteban.martin
    Hola bueno dias.

    Tengo un alv con bastantes campos, uno de ellos se llama "accion".
    me gustaria que salir un matchcode con estos valores.

    garantia
    reparacion
    prestamo.

    como puedo crear este matchcode sin enlazarlo a ninguna tabla de verificacion ni nada.

    Solo por codigo, poner uqe salgan estras 3 opciones.

    Muchas gracias.

    Chequea este código... te puede ayudar

    Código:
    [COLOR=#0000ff][COLOR=#0000ff]
    [/COLOR][/COLOR][FONT=Courier New]FORM obtener_matchcode [/FONT]
    [FONT=Courier New]  CHANGING p_accion TYPE string.[/FONT]
     
    [FONT=Courier New]  DATA: lt_return TYPE STANDARD TABLE OF ddshretval.[/FONT]
    [FONT=Courier New]  DATA: lw_return TYPE ddshretval.[/FONT]
     
    [FONT=Courier New]  DATA: BEGIN OF lt_matchcode OCCURS 3,[/FONT]
    [FONT=Courier New]          VALOR TYPE string,[/FONT]
    [FONT=Courier New]        END OF lt_matchcode.[/FONT]
     
    [FONT=Courier New]  lt_matchcode-VALOR = 'Garantía'.[/FONT]
    [FONT=Courier New]  APPEND lt_matchcode.[/FONT]
    [FONT=Courier New]  lt_matchcode-VALOR = 'Reparación'.[/FONT]
    [FONT=Courier New]  APPEND lt_matchcode.[/FONT]
    [FONT=Courier New]  lt_matchcode-VALOR = 'Préstamo'.[/FONT]
    [FONT=Courier New]  APPEND lt_matchcode.[/FONT]
     
    [FONT=Courier New]  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'[/FONT]
    [FONT=Courier New]    EXPORTING[/FONT]
    [FONT=Courier New]      RETFIELD        = 'VALOR'[/FONT]
    [FONT=Courier New]      WINDOW_TITLE    = <título_ventana>[/FONT]
    [FONT=Courier New]      VALUE_ORG       = 'S'[/FONT]
    [FONT=Courier New]    TABLES[/FONT]
    [FONT=Courier New]      VALUE_TAB       = lt_matchcode[/FONT]
    [FONT=Courier New]      RETURN_TAB      = lt_return[/FONT]
    [FONT=Courier New]    EXCEPTIONS[/FONT]
    [FONT=Courier New]      PARAMETER_ERROR = 1[/FONT]
    [FONT=Courier New]      NO_VALUES_FOUND = 2[/FONT]
    [FONT=Courier New]      OTHERS          = 3.[/FONT]
     
    [FONT=Courier New]  IF sy-subrc NE 0.[/FONT]
    [FONT=Courier New]    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno[/FONT]
    [FONT=Courier New]          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.[/FONT]
    [FONT=Courier New]  ELSE.[/FONT]
    [FONT=Courier New]    READ TABLE lt_return INTO lw_return INDEX 1.[/FONT]
    [FONT=Courier New]    p_accion = lw_return-fieldval.[/FONT]
    [FONT=Courier New]  ENDIF.[/FONT]
    [FONT=Courier New]ENDFORM.[/FONT]
    Ello debería funcionar
    Miguel Ángel Garcés Ramírez

    Comentario

    • miguel.esteban.martin
      Member
      • ene
      • 89

      #3
      mi alv es alv orientado a objetos, esto sirve para objetos tambien???

      Comentario

      • Garces
        Senior Member
        • ago
        • 321

        #4
        La verdad nunca lo he probado en ALV's OO ... pero no veo por qué no vaya a funcionar...
        En fin.... La única manera de estar seguros es probándolo...
        Ojalá tengas suerte...
        Nos avisas el resultado
        Miguel Ángel Garcés Ramírez

        Comentario

        Trabajando...