Skip to Content
avatar image
Former Member

how to get a popup window for search help on pressing f4

in a transaction to select values from search help .how can we do this'plz help

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Dec 13, 2006 at 05:55 AM

    hi,

    chk this sample code.

    REPORT zsha_f4 .
     
    tables: mara, makt.
    
    data: begin of itab occurs 0,
    matnr like mara-matnr,
    end of itab.
    
    
    data : begin of btab occurs 0,
    maktx like makt-maktx,
    end of btab.
    
    data mak like makt-maktx.
    
    DATA : return like ddshretval occurs 0 with header line.
    
    data: begin of dynpfields occurs 0.
    include structure dynpread.
    data: end of dynpfields.
    
    parameters: p_matnr like mara-matnr,
    p_maktx like makt-maktx.
    
    Initialization.
    
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_matnr.
    
    REFRESH ITAB.
    SELECT matnr FROM mara INTO TABLE ITAB.
    
    call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    retfield = 'MATNR '
    dynprofield = 'P_MATNR '
    dynpprog = sy-REPID
    dynpnr = sy-dynnr
    value_org = 'S'
    TABLES
    value_tab = ITAB
    return_tab = return.
    
    select single maktx from makt into mak where matnr = return-fieldval.
    
    p_matnr = return-fieldval.
    
    refresh return.
    clear return.
    
    move 'P_MAKTX' to dynpfields-fieldname.
    move mak to dynpfields-fieldvalue.
    append dynpfields.
    
    
    CALL FUNCTION 'DYNP_VALUES_UPDATE'
        EXPORTING
          dyname               = sy-cprog
          dynumb               = sy-dynnr
        TABLES
          dynpfields           = 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.
    
    .
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    
    refresh return.
    clear return.
    .

    rgds

    anver

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 13, 2006 at 05:55 AM

    In a simple way:

    For reports try with additions: <b>MATCHCODE OBJECT mobj</b>

    In Dialog program, assign the search help in the properties by changes the layout via transaction <b>SE51</b>.

    Kind Regards

    Eswar

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 13, 2006 at 06:49 AM

    Check this example, it may help u.

    report z_example.

    parameters: p_bukrs type t001-bukrs,

    p_butxt type t001-butxt,

    p_ort01 type t001-ort01,

    p_land1 type t001-land1.

    data: dynfields type table of dynpread with header line.

    data: return type table of ddshretval with header line.

    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 = 'P_BUTXT'.

    dynfields-fieldvalue = xt001-butxt.

    append dynfields.

    dynfields-fieldname = 'P_ORT01'.

    dynfields-fieldvalue = xt001-ort01.

    append dynfields.

    dynfields-fieldname = 'P_LAND1'.

    dynfields-fieldvalue = xt001-land1.

    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.

    Add comment
    10|10000 characters needed characters exceeded