Skip to Content

Modify SCREEN after fill in parameter

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.
screen.png (3.0 kB)
Add a comment
10|10000 characters needed characters exceeded

  • Thanks Sandra Rossi for your reply

    how to change P_FOLIOS if the value of P_WERKS is manually input instead of using F4 button. Is that it?, Yes! that is my question :D

    I'll delete the end-of-selection ;)

  • I understand that after pressing F4 (or the "F4" button) on P_WERKS input field, to display the list of possible values, if you select one value, it's returned in the input field, and additionally your code initializes P_FOLIOS which corresponds to the P_WERKS you have selected.

    Now, your question is, how to change P_FOLIOS if the value of P_WERKS is manually input instead of using F4 button. Is that it?

    NB: you don't understand what END-OF-SELECTION is for, it's only to be used with logical databases, please remove the line (currently, it has no effect in your code).

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Oct 30, 2019 at 01:18 PM

    The event AT SELECTION-SCREEN (without any addition) is triggered right after the user has pressed ENTER or any other non-exit function key, so you may change P_FOLIOS at that time (no need to use DYNP_VALUES_UPDATE because this latter is only needed for value help i.e. AT SELECTION-SCREEN ON VALUE-REQUEST ...):

    AT SELECTION-SCREEN.
      DATA lv_fol TYPE zclsd_tb_031-num_fol.
      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.
      P_FOLIOS = lv_fol.
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.