Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

drop down list not working

Former Member
0 Kudos

hi friends..

i am making dropdown list on field t001w-werks in module pool ..following is code..

PROCESS BEFORE OUTPUT.

MODULE STATUS_1000.

*

PROCESS AFTER INPUT.

MODULE cancel AT EXIT-COMMAND.

MODULE USER_COMMAND_1000.

PROCESS ON VALUE-REQUEST.

FIELD t001w-werks MODULE create_dropdown_box.

************

REPORT ZDROP_DOWN.

tables : t001w.

data : begin of itab_t001w occurs 0,

werks like t001w-werks,

end of itab_t001w.

module STATUS_1000 output.

SET PF-STATUS 'MENU'.

SET TITLEBAR 'TIT'.

endmodule. " STATUS_1000 OUTPUT

module cancel input.

LEAVE PROGRAM.

endmodule. " cancel INPUT

module USER_COMMAND_1000 input.

CASE sy-ucomm.

WHEN 'SELECTED'.

MESSAGE i888(sabapdocu) WITH t001w-werks.

ENDCASE.

break-point.

endmodule. " USER_COMMAND_1000 INPUT

module create_dropdown_box input.

SELECT werks FROM t001w iNTO CORRESPONDING FIELDS OF TABLE itab_t001w.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'WERKS'

VALUE_ORG = 'C'

tables

value_tab = itab_t001w

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3

.

endmodule. " create_dropdown_box INPUT

Help Please

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi madan,

1. U have not passed some required parameters

in the FM.

2. use like this :

DATA : BEGIN OF itab OCCURS 0,

bukrs LIKE t001-bukrs,

butxt LIKE t001-butxt,

END OF itab.

SELECT * FROM t001 INTO CORRESPONDING FIELDS OF TABLE itab.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'BUKRS'

<b> value_org = 'S'

dynprofield = 'MYLISTTAB'

dynpprog = sy-repid

dynpnr = sy-dynnr</b>

TABLES

value_tab = itab

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

regards,

amit m.

19 REPLIES 19

Former Member
0 Kudos

Hi madan,

1. U have not passed some required parameters

in the FM.

2. use like this :

DATA : BEGIN OF itab OCCURS 0,

bukrs LIKE t001-bukrs,

butxt LIKE t001-butxt,

END OF itab.

SELECT * FROM t001 INTO CORRESPONDING FIELDS OF TABLE itab.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'BUKRS'

<b> value_org = 'S'

dynprofield = 'MYLISTTAB'

dynpprog = sy-repid

dynpnr = sy-dynnr</b>

TABLES

value_tab = itab

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

regards,

amit m.

0 Kudos

amit ji, it is still not working.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'WERKS'

DYNPPROG = sy-repid

DYNPNR = sy-dynnr

DYNPROFIELD = 'T001W-WERKS'

VALUE_ORG = 'S'

tables

value_tab = itab_t001w

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3

.

endmodule. " create_dropdown_box INPUT

0 Kudos

Hi Madan,

Please refer the demo program

<b>DEMO_DYNPRO_F4_HELP_MODULE</b>.

Hope this will help you.

Thanks& Regards,

Siri.

0 Kudos

Hi madan,

pass the returntab to the FM, and see my previous reply...

regards

vijay

0 Kudos

hi friends ..at last code runs...

previously i take name of ield in screen as t001w-werks ie refers to database field.

but when i take it just werks.

then it werks...

thanks for all for there kind sugession.

but i still not clear why this happen.

0 Kudos

Hi madan,

have a look at the demo program <b>DEMO_DYNPRO_F4_HELP_MODULE</b>

this will clear your doubts..

Regards

vijay

0 Kudos

ok fiends real problem was in parameter

retfield = 'WERKS' of the function module.

i thought it should be field of table but it should be fields name taken in screen..

thanks for brain storming..

regards.

0 Kudos

once again you all have to bear me..

i want to know the significance and meaning of

VALUE_ORG = 'S' (DD: truth value)

what is diff between 'S' and 'C' .

when i put 'C' program doesnot run.

thanks in advance.

0 Kudos

Hi madan,

read the FM documentation ,

S is structure,

C is column.

i am giving the FM docu (just for reference).

This module implements the standard help at POV while passing the values to be displayed in a table. The entire dialogue behaves as for a standard F4 help. This module also supports input help control.

Note: Before you use this module at POV (Process on Value-Request), reconsider whether a search help could not carry out the same task. You can implement self-defined value selection in a search help exit. This has the advantage that you can attach the search help to a data element or a field of a structure. The F4 help is then automatically available for all users of the data element or structure.

The values to be displayed are passed in table VALUE_TAB. There are different ways to organize the data in VALUE_TAB. These are mainly defined with the parameter VALUE_ORG.

1. VALUE_ORG = 'S' (Structure)
This option should be used for new developments (despite other default values).
VALUE_TAB is an internal table with a (flat) structure. Every line in VALUE_TAB then corresponds to one line in the list to be displayed.
How the definition of the data struture is passed to the module is described below.
The data in VALUE_TAB is available in internal representation.
2. VALUE_ORG = 'C' (Column)
Each line of VALUE_TAB contains the contents of a single field. The contents of VALUE_TAB are copied to the hit list line by line. The description of the columns is passed in FIELD_TAB. When all fields of FIELD_TAB have been edited, the next line is processed.
In this case the values in VALUE_TAB must be passed in external representation. This means that for types whose external and internal representation differ, the values should be passed to VALUE_TAB with the ABAP command WRITE and not with MOVE (These are for example all the numeric types, date, fields with conversion exit, etc.). Use the extension LEFT-JUSTIFIED for numbers.
Caution: Do not copy any constants directly to VALUE_TAB. For example, if a date is defined as constant "01.01.1998", it can no loner be interpreted for other user-specific settings.

Regards

vijay

Former Member
0 Kudos

use the fm

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

dyname = w_repid

dynumb = w_dynnr

TABLES

dynpfields = git_dynpfields

EXCEPTIONS

OTHERS = 01.

IF sy-subrc <> 0.

"? add later

ENDIF.

Former Member
0 Kudos

see the modifications in this code.

if helpful reward points

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

exporting

retfield = 'WERKS'

value_org = 'S'

display = 'F'

tables

value_tab = itab_t001w

return_tab = return_values

exceptions

parameter_error = 1

no_values_found = 2

others = 3.

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

else .

read table return_values index 1.

itab_t001w-werks = return_values-fieldval.

move itab_t001w to itab.

endif.

endif.

former_member188685
Active Contributor
0 Kudos

Hi,

<b>

DATA: RET_TAB LIKE DDSHRETVAL OCCURS 0 WITH HEADER LINE.</b>

    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
      EXPORTING
        RETFIELD        = 'ZZPLANN_AREA'
        WINDOW_TITLE    = TEXT-PLA
        VALUE_ORG       = 'S'
        MULTIPLE_CHOICE = ' '
      TABLES
        VALUE_TAB       = IT_PLAN
        <b>RETURN_TAB      = RET_TAB</b>
      EXCEPTIONS
        PARAMETER_ERROR = 1
        NO_VALUES_FOUND = 2
        OTHERS          = 3.
    IF SY-SUBRC <> 0.
      REFRESH IT_PLAN.
      EXIT.
    ENDIF.

Regards

vijay

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

If you want F4 help,here is the sample code.

tables kna1.

data:

begin of t_values occurs 2,

value like kna1-begru,

end of t_values,

t_return like ddshretval occurs 0 with header line.

select-options s_begru for kna1-begru.

at selection-screen on value-request for s_begru-low.

refresh t_values.

t_values = 'PAR*'.

append t_values.

t_values = 'UGG'.

append t_values.

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

exporting

retfield = 'BEGRU'

value_org = 'S'

tables

value_tab = t_values

return_tab = t_return

exceptions

parameter_error = 1

no_values_found = 2

others = 3.

if sy-subrc = 0.

read table t_return index 1.

s_begru-low = t_return-fieldval.

endif.

<b>If you need dropdown,here is the sample code.</b>report z.

type-pools: vrm.

data: it_val type vrm_values,

w_line like line of it_val.

parameters p_bukrs like t001-bukrs as listbox

visible length 25 obligatory.

initialization.

select bukrs butxt from t001 into (w_line-key, w_line-text).

append w_line to it_val.

check p_bukrs is initial.

p_bukrs = w_line-key.

endselect.

at selection-screen output.

call function 'VRM_SET_VALUES'

exporting

id = 'P_BUKRS'

values = it_val.

end-of-selection.

write: / 'Company Code:', p_bukrs.

former_member188685
Active Contributor
0 Kudos

Hi Madan,

your code is fine, you missed return tab..

after calling the FM do this way..

IF RET_TAB[] IS NOT INITIAL.
      READ TABLE RET_TAB INDEX 1.
      IF SY-SUBRC = 0.
        P_PLAN = RET_TAB-FIELDVAL.
      ENDIF.
    ENDIF.

Regards

vijay

former_member186077
Active Participant
0 Kudos

Hi Madan ,

The above fm mentioned by our friends will work.

If still not just check if in the attributes of the field you have not mentioned it as a LIST BOX.

Regards,

Sriranjani Chimakurthy.

Former Member
0 Kudos

Hi again,

1. In your screen pai,

u will have to write like this:

PROCESS AFTER INPUT.

MODULE pai_1000.

PROCESS ON VALUE-REQUEST.

field mylistab module abc.

(where abc = module name

mylistab = fieldname on screen)

2. Put break-point and check,

whether the program is coming in your module or not

3. Other wise the code is allright

4. I think 'Amit' is cool, (instead of amit ji)

regards,

amit m.

Former Member
0 Kudos

Re: drop down list not working

Posted: Feb 27, 2006 4:53 AM Reply E-mail this post

use.

1.did u declare f4 in pov in pai of ur module pool.

2.check the field names in the same .

3.put a debugger and see teh value of value_tab.

4. all the parameters look okay just see the return value of itab in debugging and let us know the problem.

vijay.

if not itab_too1w is initial.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'WERKS' < check the field with ur declaration>

DYNPPROG = sy-repid

DYNPNR = sy-dynnr

DYNPROFIELD = 'T001W-WERKS' < check the field with ur declaration>

VALUE_ORG = 'S'

tables

<break-point and check in debugging>

value_tab = itab_t001w

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3

endif.

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

t_return like ddshretval occurs 0 with header line.

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

exporting

retfield = 'WERKS'

value_org = 'S'

tables

value_tab = itab_t001w

return_tab = t_return

exceptions

parameter_error = 1

no_values_found = 2

others = 3.

if sy-subrc = 0.

read table t_return index 1.

" t_return-fieldval will have the value.Assign it to the screen field.

endif.

Former Member
0 Kudos

just let us know what u declared in process on value request .

module pai.

loop at itab.

endloop.

module at-exit command etc...

*******************

process on value request for field ' ' .

*********************

\

now in here just giv us ur code for the same what is the declaration u hav made here for the f4 help on werks .

vijay