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: 

How to Add Value table data to the drop down

Former Member
0 Kudos

Hi friends,

I have created a customer table, in which I will be having the fields like MAND VKORG,and AUART.

auart has a value table.but customer wants to see those values in SM30( TABLE MAINTAINCE GENERATOR) when creating the values in Drop down instead of in a F4. please help to achive the requirement.

I have gone to SE 51 and changed the AUART to list box. I am getting the drop down but I am not able to see the F4 values in drop down. Please help me incase I need to write the code,procedure by step wise

Thanks& regards,

Xavier

5 REPLIES 5

Former Member
0 Kudos

Hi Xavier,

Provide fixed values to the domain that you have used for the field AUART and if this doesn't work then establishing a foreign key relationship to the field AUART in your table will definetely solve the issue.

bbalci
Contributor
0 Kudos

Hello,

Go to maintenance screen of your table,

create a new module on PBO,

and call function VRM_SET_VALUES in this module

I've an exmaple for it :

REPORT ZBB_DENEME2 .

DATA BUKRS LIKE BSIS-BUKRS. <--BUKRS is the field screen 9000 no matter it is in a table control or not

TYPE-POOLS : VRM.

DATA :

LIST TYPE VRM_VALUES,

VALUE LIKE LINE OF LIST,

NAME TYPE VRM_ID.

START-OF-SELECTION.

CALL SCREEN 9000.

&----


*& Module STATUS_9000 OUTPUT

&----


  • text

----


MODULE STATUS_9000 OUTPUT.

VALUE-KEY = '001'.

VALUE-TEXT = 'VALUE1'.

APPEND VALUE TO LIST.

VALUE-KEY = '002'.

VALUE-TEXT = 'VALUE2'.

APPEND VALUE TO LIST.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

ID = 'BUKRS'

VALUES = LIST.

ENDMODULE. " STATUS_9000 OUTPUT

I hope it helps.

Edited by: Bulent Balci on Jul 26, 2010 7:32 PM

Former Member
0 Kudos

Hi,

You need to get the values in the Internal Table and then with minimal coding effort you can provide the F4 Value help.

Have a look at the demo code for how to populate the F4 value help.. DEMO_DYNPRO_DROPDOWN_LISTBOX

You need to use your own PBO module which will have your own customized coding.

Hope this helps.

Thanks,

Samantak.

Former Member
0 Kudos

Hi,

Use below code to fill dropdown(listbox) field of screen

with value attribute of screen filed as 'A'.

Below code to be placed In PBO.

TYPE-POOLS : VRM
DATA : field_id TYPE VRM_ID ,
            values  TYPE VRM_VALUES,
             value   LIKE LINE OF values.
 
PROCESS BEFORE OUTPUT
MODULE list_fill_100
 
MODULE list_fill_100 OUTPUT
SELECT f1 f2 f3  FROM tab WHERE <condition>.
value-KEY = f1.
value-TEXT = f2
APPEND value TO VALUES
sort VALUES.

CALL FUNCTION 'VRM_SET_VALUES'
       EXPORTING
            id     = 'i/o screen field'  " In which you want dropdown to be displayed on screen.
            values = values[].
 
ENDMODULE. 

NOTE: value-KEY will be sent back to screen field.

Cheers,

Dep

0 Kudos

Hi deepa,

The given code is working and thank you.

when I am saving the value it is getting save along with Descriptions.

But I want save only key. so that when the program reads ,reads only key not description.

Please advise me.

Thank you.

Regards,

Xavier.P