Skip to Content

F4 event on selection screen

I know that when I press F4 button on selection screen on field then I can use:

AT SELECTION-SCREEN ON VALUE-REQUEST FOR psel_low_high,

when I press enter I can use event

AT SELECTION-SCREEN OUTPUT.

but I need an event which is fired befor end of F4 and pressing enter.

What I want to archieve?

I asked in this topic: Dynamic changed text on selection screen on a special behaviour (read topic to more information).

Now I need to extend this case to situation when modified text appears after finished F4 request.

I hope I explain my problem clear.

Thx in advance

Tomek

Off course I reward any helpfull clue.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Sep 26, 2006 at 05:00 PM

    Here is a sample program which should give you some idea.

    
    REPORT ZRICH_0002 .
    
    
    
    data: dynfields type table of dynpread with header line.
    data: return type table of ddshretval with header line.
    
    selection-screen begin of block b1 with frame title text-001 .
    selection-screen begin of line.
    PARAMETERS: P_BUKRS type T001-BUKRS.
    selection-screen comment 30(20) BUTXT for field p_bukrs.
    selection-screen end of line.
    selection-screen end of block b1.
    
    at selection-screen output.
    
    if butxt is initial.
       select single butxt into butxt
             from t001
            where bukrs = p_bukrs.
    endif.
    
    
    at selection-screen on value-request for p_bukrs.
    
      call function 'F4IF_FIELD_VALUE_REQUEST'
           exporting
                tabname           = 'T001'
                fieldname         = 'BUKRS'
                dynpprog          = sy-cprog
                dynpnr            = sy-dynnr
                dynprofield       = 'P_BUKRS'
           tables
                return_tab        = return
           exceptions
                field_not_found   = 1
                no_help_for_field = 2
                inconsistent_help = 3
                no_values_found   = 4
                others            = 5.
    
      read table return with key fieldname = 'P_BUKRS'.
    
    * Add it back to the dynpro.
      dynfields-fieldname = return-retfield.
      dynfields-fieldvalue =  return-fieldval.
      append dynfields.
    
    * Get the company code from db and add to dynpro
      data: xt001 type t001.
    
      clear xt001.
      select single * into xt001
             from t001
            where bukrs = return-fieldval.
    
      dynfields-fieldname = 'BUTXT'.
      dynfields-fieldvalue = xt001-butxt.
      append dynfields.
    
    
    * Update the dynpro values.
      call function 'DYNP_VALUES_UPDATE'
           exporting
                dyname     = sy-cprog
                dynumb     = sy-dynnr
           tables
                dynpfields = dynfields
           exceptions
                others     = 8.
    
    start-of-selection.
    
    

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 26, 2006 at 04:49 PM

    Hi,

    use dynpro_value_update function module

    for ur requirement

    Regards

    amole

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 26, 2006 at 04:23 PM

    Hi

    If The text you want to update is like a parameter you can update it in the AT SELECTION-SCREEN ON VALUE-REQUEST by fm DYNP_VALUES_UPDATE:

    DATA: COUNT TYPE I.

    PARAMETERS: P_BUKRS LIKE T001-BUKRS.

    SELECTION-SCREEN SKIP.

    SELECTION-SCREEN BEGIN OF LINE.

    SELECTION-SCREEN COMMENT 1(30) TEXT MODIF ID INT.

    SELECTION-SCREEN END OF LINE.

    SELECTION-SCREEN SKIP.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_BUKRS.

    DATA: DYNAME LIKE D020S-PROG,

    DYNUMB LIKE D020S-DNUM.

    DATA: DYNPFIELDS LIKE STANDARD TABLE OF DYNPREAD WITH HEADER LINE.

    DYNUMB = SY-REPID.

    DYNUMB = SY-DYNNR.

    COUNT = COUNT + 1.

    DYNPFIELDS-FIELDNAME = 'TEXT'.

    MOVE COUNT TO DYNPFIELDS-FIELDVALUE(20).

    APPEND DYNPFIELDS.

    CALL FUNCTION 'DYNP_VALUES_UPDATE'

    EXPORTING

    DYNAME = DYNAME

    DYNUMB = DYNUMB

    TABLES

    DYNPFIELDS = DYNPFIELDS.

    Max

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 26, 2006 at 04:26 PM

    Use the <b>DYNP_VALUES_UPDATE</b> FM. Once the F4 is seleced the values will returned to the return_tab. After that use the above FM to modify the screen.

    sample code:

    ws_dyname = 'ZSRO_MASTER_DATA'.

    ws_dynumb = '0301'.

    ws_dynpfld-fieldname ='PPDESC'.

    ws_dynpfld-fieldvalue = ty_aa-name_textc.

    APPEND ws_dynpfld TO i_dnpfld.

    CALL FUNCTION 'DYNP_VALUES_UPDATE'

    EXPORTING

    dyname = ws_dyname

    dynumb = ws_dynumb

    TABLES

    dynpfields = i_dnpfld

    EXCEPTIONS

    invalid_abapworkarea = 1

    invalid_dynprofield = 2

    invalid_dynproname = 3

    invalid_dynpronummer = 4

    invalid_request = 5

    no_fielddescription = 6

    undefind_error = 7

    OTHERS = 8.

    IF sy-subrc <> 0.

    ENDIF.

    Regards,

    Prakash.

    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.