Skip to Content
0
Oct 30, 2019 at 02:20 AM

Modify SCREEN after fill in parameter

183 Views

Hello i have a problem that i haven't solved

I have a screen with 3 parameter: center, invoice, copies ; so when i fill in center i need to do aquery to search in a table the invoice and display it on the screen in my parameter invoice (it's just for information). I tried with at-selection-screen output but i htink this is not a solution for me be cause this is pbo and is not called each time that i change mi parameter werks ( am i right?)

Any ideas ? Please help :'C

SELECTION-SCREEN BEGIN OF BLOCK a.

PARAMETERS: p_werks  TYPE t001w-werks  OBLIGATORY,            " Centro
            p_folios TYPE zclsd_tb_031-num_fol,               " N° Folio Actual
            p_copies TYPE zclsd_tb_031-num_fol OBLIGATORY.    " Cantidad a imprimir
SELECTION-SCREEN END OF BLOCK a.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_werks.
  PERFORM selection_screen.
END-OF-SELECTION.


AT SELECTION-SCREEN OUTPUT.
  PERFORM conf_param.
END-OF-SELECTION.

START-OF-SELECTION.
  PERFORM obtener_data. "get data
  PERFORM llamar_impresion. "call smartforms




FORM conf_param.
  LOOP AT SCREEN.
    IF screen-name = 'P_FOLIOS'.
      screen-input = ''.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.
ENDFORM.


FORM selection_screen.
  DATA:
    w_dynpfields TYPE dynpread,
    i_dynpfields LIKE STANDARD TABLE OF dynpread.


*  IF p_werks IS NOT INITIAL.
    SELECT SINGLE num_fol
       FROM zclsd_tb_031 INTO lv_fol
       WHERE werks EQ p_werks.


    WRITE lv_fol TO lv_fol.
    CONCATENATE 'Folio: ' lv_fol INTO lv_fol.

    w_dynpfields-fieldname    = 'P_FOLIOS'.
    w_dynpfields-fieldvalue   = lv_fol.
    APPEND w_dynpfields TO i_dynpfields.
    CLEAR w_dynpfields.

    CALL FUNCTION 'DYNP_VALUES_UPDATE'
      EXPORTING
        dyname               = sy-repid
        dynumb               = sy-dynnr
      TABLES
        dynpfields           = i_dynpfields
      EXCEPTIONS
        invalid_abapworkarea = 1
        invalid_dynprofield  = 2
        invalid_dynproname   = 3
        invalid_dynpronummer = 4
        invalid_request      = 5
        no_fielddescription  = 6
        undefind_error       = 7
        OTHERS               = 8.
*  ENDIF.
ENDFORM.

Attachments

screen.png (3.0 kB)