cancel
Showing results for 
Search instead for 
Did you mean: 

Select Option f4 search help.

0 Kudos

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 ??

Accepted Solutions (0)

Answers (9)

Answers (9)

hiriyappa_myageri
Participant
0 Kudos

read the return table  values u will get plant description

Former Member
0 Kudos

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

former_member226419
Contributor
0 Kudos

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.

Former Member
0 Kudos

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


Former Member
0 Kudos

Hi Shiva,

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

will write the Field Value "1000". not the name .

Correct me if I'm wrong.

Regards,

S.Anandabalan

Former Member
0 Kudos

Hi Anandabalan,

This depends on the exporting parameter 'retfield', If u pass the companycode then its meaning that you are requesting for companycode.

If you pass the name, then you will get name as return parameter.

Regards,

Shiva

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.


Former Member
0 Kudos

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.

Former Member
0 Kudos

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

0 Kudos

Will it change the actual value ? coz i need value as 1000, but display as its Name .

Former Member
0 Kudos

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


0 Kudos

Will it change the actual value ? coz i need value as 1000, but display as its Name .

nabheetscn
Active Contributor
0 Kudos

Hi Andy

There are various options in your code based on company code names entered you can select the code from T001 as a first step

Nabheet

Former Member
0 Kudos

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

nabheetscn
Active Contributor
0 Kudos

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