Skip to Content
author's profile photo Former Member
Former Member

Select Option f4 search help.

Hi All,

I have used FM F4IF_FIELD_VALUE_REQUEST for select option search help. However when i click on the f4 help it gives mi a list as below

Cmpany code| Name
1000 | SAP

2000 | SAP2

so when i select any one from this, the value displays on selction option as '1000'. But i need to display value as 'SAP'. so i want the name instead of value.

How can i do that ??

Add a comment
10|10000 characters needed characters exceeded

Related questions

9 Answers

  • Posted on Dec 10, 2013 at 06:15 AM

    Pass the SHLPPARAM as BUTXT or company code name field it will return the name value

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 10, 2013 at 06:32 AM

    Hello Andy,

    The search help you are using in FM F4IF_FIELD_VALUE_REQUEST must be exporting company code. Easier option to copy the Search Help to Z Search Help and Export Name instead of company code.

    Cheers 😊


    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Ys of-course it will work.

      You must be having below data in some IT.

      Cmpany code| Name
      1000 | SAP

      2000 | SAP2

      After getting the value from search help just read the corresponding name from IT and update it.

      Regards

      Ansumesh

  • author's profile photo Former Member
    Former Member
    Posted on Dec 10, 2013 at 06:49 AM

    Make use of FM's DYNPRO_READ_VALUE & DYNPRO_UPDATE_VALUE for reading the value choosen using fm F4IF_INT**** from the screen.

    catch company code using DYNPRO_READ_VALUE and then determine the name based on this value. Then use DYNPRO_UPDATE_VALUE to update final calue to the screenfield.

    Sometimes simply moving the determined name to the screen field variable also works..which is based on module pool screen flow.

    Check if it helps..

    Regards

    Ansumesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 10, 2013 at 07:11 AM

    hi,

    Please try this code ,

    DATA: SH TYPE SHLP_DESCR_T.

    DATA: INTERFACE LIKE DDSHIFACE OCCURS 0 WITH HEADER LINE.

    DATA: LT_F4 LIKE DDSHRETVAL OCCURS 0 WITH HEADER LINE.

    DATA: V_BUKRS TYPE BUKRS,

    V_DESC TYPE CHAR250.

    DATA: T_RETURN LIKE DDSHRETVAL OCCURS 0 WITH HEADER LINE.

    DATA: V_SUBRC TYPE SYSUBRC.

    SELECT-OPTIONS P_BUKRS FOR ZWRK_AP520_BUKRS-COCODE.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_PLNTY-LOW.

    SH-SHLPNAME = 'ZBUKRS'. " Search Help Name

    SH-SHLPTYPE = 'SH'.

    CALL FUNCTION 'DD_SHLP_GET_DIALOG_INFO'

    CHANGING

    SHLP = SH.

    INTERFACE-SHLPFIELD = 'COCODE'. " Field1 of which value to be returned

    INTERFACE-VALFIELD = 'V_BUKRS'.

    APPEND INTERFACE.

    INTERFACE-SHLPFIELD = 'DESCRIPTION'. " Field2 of which value to be returned

    INTERFACE-VALFIELD = 'V_DESCRIPTION'.

    APPEND INTERFACE.

    SH-INTERFACE[] = INTERFACE[].

    CALL FUNCTION 'F4IF_START_VALUE_REQUEST'

    EXPORTING

    SHLP = SH

    DISPONLY = ' '

    IMPORTING

    RC = V_SUBRC

    TABLES

    RETURN_VALUES = T_RETURN. " Contains the value of 2 fields.


    Capture.PNG (16.8 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 17, 2013 at 06:07 AM

    Hi,

    After reading the selected value from the FM, read the corresponding Name in the Select Option(For display purpose alone).

    Then again the "At Selection Screen" event, read the value using the Name and change the value back to '1000'. So that it ll hold the value for the following processing.


    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 17, 2013 at 06:30 AM

    Hi Andy,

    I too had a similar requirement.

    I used this FM: F4IF_INT_TABLE_VALUE_REQUEST.

    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    retfield = '<return_parameter_name' "In ur case it should be 'Name'
    value_org = 'S'
    TABLES
    value_tab = <internal_table> "pass ur internal table having value & name
    return_tab = gt_return
    EXCEPTIONS
    parameter_error = 1
    no_values_found = 2
    OTHERS = 3.


    READ TABLE gt_return INTO gwa_return INDEX 1.
    IF sy-subrc = 0.
    parameter_field = gwa_return-fieldval.
    ENDIF.


    Note: gt_return and gwa_return should be of type ddshretval.

    Try it, it will work.



    Regards,

    Shiva


    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      I am not technic guy, but you have used the FM "VALUE" so it will retrieve only VALUE .. Isn't it.. ?

      F4IF_FIELD_VALUE_REQUEST = VALUE

      Do you have anything or any FM similar to pulling for CONSTANTS...

      Or else should write ABAP code to overwrite the VALUE and Constants...

      Hope this helps..

      Rewards points if this was helpful.

      Thanks & Regards

      Rahaman.

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2013 at 07:57 AM

    Hi,

    Kindly find the below tcode.

    Before that i have created one Ztable 'Zt001' and assign zsearch help zt001 to the same.

    Then follow below code.

    TYPES: BEGIN OF t_t001,

    bukrs type bukrs,

    butxt TYPE butxt,

    END OF t_t001.

    DATA: lt_t001 TYPE STANDARD TABLE OF t_t001,

    lt_return LIKE ddshretval OCCURS 0 WITH HEADER LINE .

    PARAMETERS: p_butxt TYPE zt001-butxt .

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_butxt.

    SELECT bukrs butxt FROM zt001 INTO TABLE lt_t001 UP TO 1 ROWS.

    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

    EXPORTING

    * DDIC_STRUCTURE = ' '

    retfield = 'BUTXT'

    value_org = 'S'

    TABLES

    value_tab = lt_t001

    * field_tab = lt_return

    return_tab = lt_return.

    p_butxt = lt_return-fieldval.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2013 at 09:18 AM

    Hi ,

    Its problem with the return parameter. Check the code below.

    TYPES: BEGIN OF ly_t001,
    bukrs TYPE bukrs,
    name TYPE t001w-name1,
    END OF ly_t001.

    DATA: lt_t001 TYPE TABLE OF ly_t001.


    SELECT bukrs name1 INTO TABLE lt_t001 FROM t001.

    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    retfield = 'NAME' " structure field
    dynpprog = sy-repid
    dynpnr = sy-dynnr
    dynprofield = 'WA-NAME' " module pool screen field
    value_org = 'S'
    display = 'F'
    TABLES
    value_tab = lt_t001
    return_tab = lt_display.

    This should work.

    Thanks ,

    Janardhana

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 03, 2014 at 11:14 AM

    read the return table values u will get plant description

    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.