Ir al contenido principal

Entradas Dynpro Forzadas f4 ayuda de búsqueda

Luego de los eventos PBO - PAI, estan los Value Request, que se activan a la hora de setear el campo.

Por ejemplo

process on value-request.

  field p9003-campo1  module zcampo1.

  field p9003-campo2       module zcampo2.


Estos modulos tenian que tene una ayuda de busqueda basada en una tabla Z, y a la vez cuando seleccionaba en un campo el valor, el correspondiente al otro campo se debia actualizar.

Pasos, hacer la busqueda a la tabla Z guardo en lt_tab_valores, agregarle un Indice numerico, para luego llamar a funcion que muestar la ayuda en el dialogo.


  call function 'F4IF_INT_TABLE_VALUE_REQUEST'

    exporting

      retfield        = 'ZINDEX_ACT'  "este campo es una clave interna que me invento para tener referencia

      window_title    = 'Titulo que quiero'

      value_org       = 'S'

    tables

      value_tab       = lt_tab_valores

      return_tab      = lt_return

    exceptions

      parameter_error = 1

      no_values_found = 2

      others          = 3.

  if sy-subrc = 0.

    read table lt_return index 1 assigning field-symbol(<lfs_return>).

    if sy-subrc is initial.

      read table lt_tab_valores assigning field-symbol(<lfs_pgl_i>)

        with key zindex_act = <lfs_return>-fieldval.

      if sy-subrc is initial.

        move <lfs_pgl_i>-valor_muestra to p9003-campo1  .

        lv_value = <lfs_pgl_i>-campo2.  

"fUERZO LA ACTUALIZACION DEL OTRO CAMPO DEPENDIENTE

        call function 'SET_DYNP_VALUE'

          exporting

            i_field = 'P9003-CAMPO2'

            i_repid = sy-cprog

            i_dynnr = sy-dynnr

            i_value = lv_value.

      endif.

    endif.


  endif.



Idea:

Fuente:

https://www.lapolitecnica.net/foro/abap/77-actualizar-campo-dynpro-desde-ayuda-con-function-set-dynp-value

 * Actualizar de modo inmediato el campo de una dynpro, sin pasar por PBO


  CALL FUNCTION 'SET_DYNP_VALUE'
    EXPORTING
      i_field = 'CAMPO_DYNPRO'
      i_repid = sy-cprog
      i_dynnr = sy-dynnr
      i_value = vl_valor.
Para obtener el valor modificado sin validación:
    CALL FUNCTION 'GET_DYNP_VALUE'
      EXPORTING
        i_field = 'CAMPO_DYNPRO'
        i_repid = sy-cprog
        i_dynnr = sy-dynnr
      CHANGING
        o_value = vl_valor.

Comentarios

Entradas más populares de este blog

A to Z of OLE Excel in ABAP 7.4

  SAP users, both business and end users always need to download the output of a report to spreadsheet and do their analytics.   The standard excel output from a report is very simple process but it is old fashioned and the spreadsheet looks quite boring.  There is no default formatting and the users have to do all the hard work of changing the fonts, coloring the texts, marking the borders etc. Updated 16th Aug 2019  –  If you are working in non-ABAP 7.4 (below), there is complete reference program for you too. Go to the end of this article.  Thank you  Legxis  ( LeonievonK ) for the share. I acknowledge, whatever I mentioned above can be achieved in many ways programmatically. We can do it in the old traditional ABAP way but  providing multiple tabs in the spreadsheet and formatting is quite tricky with non  OLE  method. OLE = Object Linking and Embedding The high level agenda of this article is to be the  G.O.A.T.  (ple...
How to add custom field in Additional B Tab for SAP Sales Order In this article we want to explain step by step how to add custom field in SAP Sales Order transaction VA01/VA02/VA03. This time Mr ABAPGurus will give the tutorial of enhancement to add custom field in SAP Sales order. In this sample we will add new custom field for comments and customer satisfaction, this data will save into separate table from SAP Standard table ( VBAK / VBAP ). SAP provided us with ADDITIONAL TAB in the sales order transaction ( VA01/VA02/VA03 ) which allow customer to add custom fields.  T he different between ADDITIONAL A and ADDITIONAL B is the ADDITIONAL A for field which already predefine in Sales Order Header ( VBAK ) fields and ADDITIONAL B is for field that freely define. This sample we will use ADDITIONAL B because we will store data from customer satisfaction into Z database table. 1. Create one Z table using SE11 SAP Transaction code. 2.Using SE38 Transactio...

VA03 VA02 Obtener Textos Cabecera, Funct. ‘READ_TEXT’

Hoy me tocó obtener textos de pedidos, me pareció un tema interesante para compartir. Si bien no escribí yo el documento, me sirvió por eso lo comparto, y abajo cito la fuente. Obtener textos de las cabeceras en este caso mas especifico el texto de los pedidos como por ejemplo obtener el texto de un pedido. La forma de obtener textos es a través de la función ‘READ_TEXT’, pero tiene cierto chiste usarla y pasarle los parámetros correctos entonces vamos a proceder con el tutorial. Lo primero será en este caso ingresar a nuestro pedido, ya sea VA02 o VA03. Una vez que ingresamos el pedido daremos enter, y nos visualizará todo el pedido, procederemos a dar clic en el menú ‘Pasar a’ - ‘Cabecera’ - ‘Textos’ Esto nos llevará al texto que buscamos Una vez que vemos el texto, daremos doble para que nos abra una nueva ventana, dentro de la nueva ventana daremos clic en menú ‘Pasar a’ - ‘Cabecera’ y nos mostrará lo siguiente. Lo más importante de esta pantalla es: Nom...