Matchcode en XD02

Colapsar
X
 
  • Tiempo
  • Mostrar
Limpiar Todo
nuevos mensajes
  • rayados1967
    Member
    • mar
    • 70

    #1

    Matchcode en XD02

    hola a todos, espero y puedan ayudarme, en la tx xk02 necesito agregar un matchcode para el campo "Concepto de busqueda" SORT1 (elemen.datos ad_sort1ul), he creado el field exit FIELD_EXIT_AD_SORT1UL, solo que al ejecutarlo con la funcion 'F4_FIELD_ON_VALUE_REQUEST' o 'F4IF_INT_TABLE_VALUE_REQUEST' me manda un dump al realizar un CALL. He creado una tabla Z para que sea la ayuda, pero no se como desplegarla ha causa de estos errores. Alguna idea de como puedo crear el matchcode para este campo (SORT1)?, mucho agradecere su apoyo.
  • sconoredhot
    Senior Member
    • feb
    • 341

    #2
    hola

    hola

    probablemente te tira dump por pasarle a la funcion una variable que no es compatible, pero de todas maneras podrias pegarnos parte de la descripcion del dump para revisarlo?
    Sebas

    Desarrollador ABAP.

    Comentario

    • rayados1967
      Member
      • mar
      • 70

      #3
      hola sconoredhot,
      adjunto el codigo de la funcion asi como parte del dump, quedo en espera de comentarios, muchas gracias.

      Código:
      * FUNCION FIELD_EXIT_AD_SORT1UL
      types returntab type table of ddshretval initial size 0.
      
      data :
        v_cfnam(39) type c,
        tabname     type dfies-tabname,
        fieldname   type dfies-fieldname,
        searchhelp  type shlpname.
      data: return_tab type returntab.
      
        get cursor field v_cfnam.
        case v_cfnam. "screen-name.
          when 'ADDR1_DATA-SORT1'.
          tabname = 'ZPROVCLAS'. "tb Z a mostrar en la ayuda
          fieldname = 'CLASI'. "campo tabla Z
          searchhelp = 'ZPROCLAC'. "ayuda p.busqueda creada en se11
        endcase.
      
      if not tabname is initial.
        call function 'F4_FIELD_ON_VALUE_REQUEST'
          exporting
          tabname = tabname
          fieldname = fieldname
          searchhelp = searchhelp
      **   SHLPPARAM = ' '
          DYNPPROG = SY-REPID
          DYNPNR = SY-DYNNR
          DYNPROFIELD = 'SORT1'
      **   STEPL = 0
      **   VALUE = ' '
      **   MULTIPLE_CHOICE = ' '
      **   DISPLAY = ' '
      **   SUPPRESS_RECORDLIST = ' '
      **   CALLBACK_PROGRAM = ' '
      **   CALLBACK_FORM = ' '
      **   SELECTION_SCREEN = ' '
      **   CALLBACK_SELOPT
          tables
          return_tab = return_tab.
      **   EXCEPTIONS
      **   FIELD_NOT_FOUND = 1
      **   NO_HELP_FOR_FIELD = 2
      **   INCONSISTENT_HELP = 3
      **   NO_VALUES_FOUND = 4
      **   OTHERS = 5
      
        if sy-subrc <> 0.
      ** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
      ** WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        endif.
      endif.
      ENDFUNCTION.
      Parte del dump generado *****************************
      Categoría Error de programación ABAP
      Err.tmpo.ejec. RPERF_ILLEGAL_STATEMENT
      Programa ABAP SAPLWDTM
      Anwendungskomponente BC-FES-CTL-F4
      Fecha y hora 09.12.2014 09:09:35

      Texto breve
      Statement "CALL SCREEN" is not allowed in this form.

      Anál.errores
      There is probably an error in the program
      "SAPLWDTM".
      The program was probably called in a conversion ex
      or in a field exit. These are implemented by
      function modules called CONVERSION_EXIT_xxxxx_INPU
      USER_EXIT_xxxxx_INPUT.
      Conversion exits are triggered during screen field
      WRITE statements, field exits during field transpo
      screen to the ABAP/4 program.
      In this connection, the following ABAP/4 statement
      - CALL SCREEN
      - CALL DIALOG
      - CALL TRANSACTION
      - SUBMIT
      - MESSAGE W... and MESSAGE I...
      - COMMIT WORK, ROLLBACK WORK
      - COMMUNICATION RECEIVE
      - STOP
      - REJECT
      - EXIT FROM STEP-LOOP
      Moreover, conversion exits for output conversion
      (implemented by function modules called
      CONVERSION_EXIT_xxxxx_OUTPUT) do not allow

      Detalle código fuente (Texto fuente modificado)
      Lín. Txt.fte.
      163 export callcontrol to memory id 'mcx_callcontrol'.
      164 export flds_out_tab to memory id 'mcx_flds_out_tab'.
      >>>>> call screen 100 starting at 1 1 ending at 5 5.
      166 import record_tab from memory id 'mcx_record_tab'.
      167 read table record_tab index 1.

      muchas gracias, quedo en espera de comentarios.

      Comentario

      • sconoredhot
        Senior Member
        • feb
        • 341

        #4
        hola

        El tema es que
        En un Field exit NO podemos usar ninguna de las siguientes instrucciones:

        BREAK-POINT

        CALL SCREEN

        CALL DIALOG

        CALL TRANSACTION

        SUBMIT

        COMMIT WORK

        ROLLBACK WORK

        MESSAGE I

        al llamar a la función de match code, internamente intenta hacer un call screen y tira dump.
        entiendo que vas a tener que buscar otras alternativas para mostrar el matchcode!
        Sebas

        Desarrollador ABAP.

        Comentario

        Trabajando...