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: 

Regarding Dropdown Box....

Former Member
0 Kudos

I am unable to display data in a drop down box created..

The code follows...

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

In flow logic screen, i have defined

PROCESS ON VALUE-REQUEST.

FIELD DEMOF4HELP-CONNID MODULE create_dropdown_box.

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

In source code, i have made the code as Executable Type..

v_status = 'CREATE'.

append v_status to it_status1.

v_status = 'CHANGE'.

append v_status to it_status1.

v_status = 'DELETE'.

append v_status to it_status1.

clear it_status1.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'CONNID'

value_org = 'S'

TABLES

value_tab = it_status1

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

IF sy-subrc <> 0.

...

ENDIF.

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

I have referred ABAPDOCU stuff... Followed the same code.. Still i am unable to display the data like "CREATE", "CHANGE", "DELETE" when i click the dropdown icon over box in screen...

Please help me out.... Itz urgent...

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Exactly how is it_status1 defined?

REgards,

Rich Heilman

17 REPLIES 17

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Exactly how is it_status1 defined?

REgards,

Rich Heilman

0 Kudos

data : v_status(10) type c.

data : begin of it_status1 occurs 0,

connid(8) type c,

end of it_status1.

0 Kudos

Please redefine like this and try again.



data : begin of it_status1 occurs 0,
       connid type char08,
       end of it_status1.


REgards,

Rich Heilman

0 Kudos

Also, you may want to adjust your function call like so. This will enable the value to be passed back to the dynpro field.



  call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting
<b>      DYNPROFIELD     = 'CONNID'
      retfield        = 'CONNID'
      DYNPNR          = sy-dynnr
      dynpprog        = sy-cprog</b>
      value_org       = 'S'
    tables
      value_tab       = it_status1
    exceptions
      parameter_error = 1
      no_values_found = 2
      others          = 3.

REgards,

Rich Heilman

0 Kudos

Rich,

Really appreciate your concern...

But even after following your lines, still facing same problem...

Pavan

0 Kudos

Can you post the complete code?

REgards,

Rich Heilman

0 Kudos

Do you want an F4 dropdown box, or a listbox?

REgards,

Rich Heilman

0 Kudos

PROGRAM ZTEST_SCREEN.

**-- Data Definitions

TABLES : demof4help, zsangap.

data : wa_zsangap like zsangap.

data : req_name type i,

status type i.

data : begin of it_admin occurs 0,

req_name(25) type c,

status(15) type c,

end of it_admin.

*type-pools : vrm.

*data : it_status type VRM_VALUES,

  • value like line of it_status,

  • name type vrm_id.

data : wa_value type zsangap.

data : ok_code TYPE sy-ucomm,

save_ok TYPE sy-ucomm.

data : v_status(10) type c.

****data : begin of it_status1 occurs 0,

        • connid(8) type c,

        • end of it_status1.

data : begin of it_status1 occurs 0,

connid type char08,

end of it_status1.

&----


*& Processing Blocks called by the Runtime Environment *

&----


  • Event Block START-OF-SELECTION

start-of-selection.

call screen 1000.

**-- Exit Functionality

module EXIT input.

leave program.

endmodule. " EXIT INPUT

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

**-- Process Before Output ( PBO )

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

module STATUS_1000 output.

SET PF-STATUS '1000'.

*****-- Drop down Box

***name = 'demof4help-connid'.

***CLEAR demof4help-connid.

***

***value-text = 'CREATE'.

***append value to it_status.

***

***value-text = 'CHANGE'.

***append value to it_status.

***

***value-text = 'DELETE'.

***append value to it_status.

***

***CALL FUNCTION 'VRM_SET_VALUES'

      • EXPORTING

      • id = name

      • values = it_status.

***

endmodule. " STATUS_1000 OUTPUT

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

**-- Process After Input (PAI)

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

module USER_COMMAND_1000 input.

case sy-ucomm.

when 'SAVE'.

clear wa_zsangap.

wa_zsangap-name = req_name.

modify zsangap from wa_zsangap.

endcase.

endmodule. " USER_COMMAND_1000 INPUT

&----


*& Module create_dropdown_box INPUT

&----


  • text

----


module create_dropdown_box input.

v_status = 'CREATE'.

append v_status to it_status1.

v_status = 'CHANGE'.

append v_status to it_status1.

v_status = 'DELETE'.

append v_status to it_status1.

clear it_status1.

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

**-- Process On Value Request (POV)

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

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'CONNID'

value_org = 'S'

TABLES

value_tab = it_status1

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

IF sy-subrc <> 0.

...

ENDIF.

      • call function 'F4IF_INT_TABLE_VALUE_REQUEST'

      • exporting

      • DYNPROFIELD = 'CONNID'

      • retfield = 'CONNID'

      • DYNPNR = sy-dynnr

      • dynpprog = sy-cprog

      • value_org = 'S'

      • tables

      • value_tab = it_status1

      • exceptions

      • parameter_error = 1

      • no_values_found = 2

      • others = 3.

endmodule. " create_dropdown_box INPUT

The flow logic goes like this....

PROCESS BEFORE OUTPUT.

MODULE status_1000.

PROCESS AFTER INPUT.

MODULE user_command_1000.

MODULE exit AT EXIT-COMMAND.

PROCESS ON VALUE-REQUEST.

FIELD DEMOF4HELP-CONNID MODULE create_dropdown_box.

Regards

Pavan

0 Kudos

If you are looking for a listbox, make sure that you set it as listbox in the screen. Go to the screen, click layout, double click field, in the dialog box, in the "Drop Down" field, choose "Listbox".

REgards,

Rich Heilman

0 Kudos

I am in need of just LIST BOX...

0 Kudos

in screen layout, i have defined the dropdown box perfectly..

I have given it as LISTBOX...

0 Kudos

Hi Pavan,

module create_dropdown_box input.

v_status = 'CREATE'.

append v_status to it_status1.

v_status = 'CHANGE'.

append v_status to it_status1.

v_status = 'DELETE'.

append v_status to it_status1.

<b>clear it_status1.</b>

In the above code , after filling the internal table with values, why are u using the statement

CLEAR it_status1.

I think it will clear the entire internal table.

Just remove that statement and try.

Regards,

SP.

0 Kudos

Hi Pavan,

You said you are setting the value list attribute in the screen painter as listbox.. In that case, you cannot use this FM F4IF_INT_TABLE_VALUE_REQUEST.

You can use that FM only if you don't specify anything in the value list attribute.

If you are specifying it as LISTBOX , then you have to use VRM_SET_VALUES.

Just go through this link.

http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbabe435c111d1829f0000e829fbfe/content.htm

Also check your internal table if it is containing any values in it.

<b>Reward points if found useful.</b>

Regards,

SP.

0 Kudos

Hey Thanks SP...

Now i am able to display the data in my Listbox using 'VRM_SET_VALUES'...

The problem is, i am displaying 3 values in Listbox... i,e "create", "change" and "delete".

"Create" is gettingas default..

If i select "change" or "delete", its not getting selected and parking in the List box...

Please help me out..

really i am Thankfull Boss...

Pavan

0 Kudos

Hi Pavan,

Can you post the new code here....?

Regards,

SP.

0 Kudos

&----


*& Module pool ZTEST_SCREEN *

*& *

&----


*& *

*& *

&----


PROGRAM ZTEST_SCREEN.

**-- Data Definitions

TABLES : demof4help, zsangap.

data : wa_zsangap like zsangap.

data : req_name type i,

status type i.

data : begin of it_admin occurs 0,

req_name(25) type c,

status(15) type c,

end of it_admin.

type-pools : vrm.

data : it_status1 type VRM_VALUES,

value like line of it_status1,

name type vrm_id.

data : wa_value type zsangap.

data : ok_code TYPE sy-ucomm,

save_ok TYPE sy-ucomm.

data : v_status(10) type c.

&----


*& Processing Blocks called by the Runtime Environment *

&----


  • Event Block START-OF-SELECTION

start-of-selection.

call screen 1000.

**-- Exit Functionality

module EXIT input.

leave program.

endmodule. " EXIT INPUT

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

**-- Process Before Output ( PBO )

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

module STATUS_1000 output.

SET PF-STATUS '1000'.

<b>*****-- Drop down Box</b>

name = 'demof4help-connid'.

CLEAR demof4help-connid.

value-text = 'CREATE'.

append value to it_status1.

value-text = 'CHANGE'.

append value to it_status1.

value-text = 'DELETE'.

append value to it_status1.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = name

values = it_status1.

endmodule. " STATUS_1000 OUTPUT

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

**-- Process After Input (PAI)

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

module USER_COMMAND_1000 input.

case sy-ucomm.

when 'SAVE'.

clear wa_zsangap.

wa_zsangap-name = req_name.

modify zsangap from wa_zsangap.

endcase.

endmodule. " USER_COMMAND_1000 INPUT

In flow logic screen ,

PROCESS BEFORE OUTPUT.

MODULE status_1000.

PROCESS AFTER INPUT.

MODULE user_command_1000.

MODULE exit AT EXIT-COMMAND.

Thanks and regards

Pavan

Former Member
0 Kudos

Hi Pavan,

Dropdown box usually refers to a listbox. If you want to fill data in a listbox, first fill the internal table with all the values you want to display and pass the internal table to the Function Module <b>VRM_SET_VALUES</b>.

Just go through this link....

http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbabe435c111d1829f0000e829fbfe/content.htm

If you want to fill value similar to pressing F4 on a field, then different technique is used.

Just go through this link...

http://help.sap.com/saphelp_45b/helpdata/en/9f/dbaac935c111d1829f0000e829fbfe/content.htm

Regards,

SP.