Application Development and Automation 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: 
Read only

Help : Table control with dropdown list

Former Member
0 Likes
2,312

Hi,

I have a table control with a column call 'Operator' . This column is a LIST column. I need to populate standard default value like "+", "-", "*' & "/" in the list.

How do i do that? Any sample code for reference?

Regards,

Rayden

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,722

hi Rayden ,

In the FLOW LOGIC SCREEN where u have PBO AND PAI events

PROCESS ON VALUE-REQUEST.

FIELD <table name - filed name> MODULE <any user defined name>

Eg table name = ZSIGN

filed name = values

module name = SIGN_VALUE

SO,

FIELD ZSIGN-values MODULE SIGN_VALUE .

Now double click on the module name and create the module inside a new include.....

and there code wat values u wish to display in the F4 help of the filed VALUES of table ZSIGN in this eg.

now populate the values in an internal table 1st and then display in F4 help

data : begin of int_sign occur 0,

Sign type ztable-values,

end of int_sign.

clear int_sign .

int_sign-sign = '+'.

append int_sign.

int_sign-sign = '-'.

append int_sign.

int_sign-sign = '*'.

append int_sign.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'SIGN' “ Int tab field name

DYNPPROG = < > “ Program name

DYNPNR = SY-DYNNR

DYNPROFIELD = 'VALUES' “ Field wer u need F4 help

VALUE_ORG = 'S'

WINDOW_TITLE = ‘Any description’

TABLES

VALUE_TAB = INT_SIGN. “ Internal table name

please reward points if useful.... and mark it answered.....

thank you.

5 REPLIES 5
Read only

Former Member
0 Likes
1,722

create an internal table with a single field 'operator'.

enter the values u want to get displayed in the list box.

data : wa_operator like zoperator,

it_operator like table of wa_operator.

SELECT *

FROM zoperator

INTO TABLE it_operator

WHERE <cond>

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'IT_tablectrl-operator'

value_org = 'S'

TABLES

value_tab = it_operator.

the ret field is the table control column field that must hold the list box with these values.

u can give ur own condition according to the other table control fields,

reward points if helpful

Read only

Former Member
0 Likes
1,723

hi Rayden ,

In the FLOW LOGIC SCREEN where u have PBO AND PAI events

PROCESS ON VALUE-REQUEST.

FIELD <table name - filed name> MODULE <any user defined name>

Eg table name = ZSIGN

filed name = values

module name = SIGN_VALUE

SO,

FIELD ZSIGN-values MODULE SIGN_VALUE .

Now double click on the module name and create the module inside a new include.....

and there code wat values u wish to display in the F4 help of the filed VALUES of table ZSIGN in this eg.

now populate the values in an internal table 1st and then display in F4 help

data : begin of int_sign occur 0,

Sign type ztable-values,

end of int_sign.

clear int_sign .

int_sign-sign = '+'.

append int_sign.

int_sign-sign = '-'.

append int_sign.

int_sign-sign = '*'.

append int_sign.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'SIGN' “ Int tab field name

DYNPPROG = < > “ Program name

DYNPNR = SY-DYNNR

DYNPROFIELD = 'VALUES' “ Field wer u need F4 help

VALUE_ORG = 'S'

WINDOW_TITLE = ‘Any description’

TABLES

VALUE_TAB = INT_SIGN. “ Internal table name

please reward points if useful.... and mark it answered.....

thank you.

Read only

0 Likes
1,722

His code is workable.

Read only

Former Member
0 Likes
1,722

TYPE-POOLS VRM.

DATA: NAME TYPE VRM_ID,

LIST TYPE VRM_VALUES,

VALUE LIKE LINE OF LIST.

CLEAR LIST.

REFRESH LIST.

VALUE-KEY = '1'.

VALUE-TEXT = 'Append'.

APPEND VALUE TO LIST.

VALUE-KEY = '2'.

VALUE-TEXT = 'Replace All'.

APPEND VALUE TO LIST.

VALUE-KEY = '3'.

VALUE-TEXT = 'Replace-Division'.

APPEND VALUE TO LIST.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

ID = 'UPLOADACTION'

VALUES = LIST.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Reward if useful

Read only

Former Member
0 Likes
1,722

Hi,

LIST OF VALUES:

-


Adding dropdown facility to the input fields is called as LIST OF VALUES.

VRM is a predefined type group which has the following structure and internal table:

VRM_VALUE is a structure with the components KEY and TEXT.

VRM_VALUES is an internal table declared for the above structure without header line.

The above type group is used to fetch values from the internal table declared with user-defined records and insert into the input field in the screen.

'VRM_SET_VALUES' is a function module used to carry the records from the internal table and populate in the input field.

NAVIGATIONS TO CREATE DROPDOWN FACILITY FOR INPUT BOX:

-


1. Create MPP program.

2. Create a screen.

3. Add a input box -> Double click -> Specify name (IO1) -> Select LISTBOX from the dropdown list -> A dropdown facility is added for the input field in the screen.

4. Create two pushbuttons (PRINT, EXIT).

5. In Top Include File, specify following code:

TYPE-POOLS VRM.

DATA IO1(20).

DATA A TYPE I.

DATA ITAB TYPE VRM_VALUES. * To create an internal table of an existing type

DATA WA LIKE LINE OF ITAB. * To create a temporary structure of sameline type of internal table.

6. In PBO, specify following code:

IF A = 0.

WA-KEY = 'ABAP'.

WA-TEXT = 'ADVANCED PROGRAMMING'.

APPEND WA TO ITAB.

WA-KEY = 'BW'.

WA-TEXT = 'BUSINESS WAREHOUSING'.

APPEND WA TO ITAB.

WA-KEY = 'EP'.

WA-TEXT = 'ENTERPRISE PORTAL'.

APPEND WA TO ITAB.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

ID = 'IO1'

VALUES = ITAB.

A = 1.

ENDIF.

7. In PAI, specify following:

CASE SY-UCOMM.

WHEN 'PRINT'.

LEAVE TO LIST-PROCESSING.

WRITE 😕 IO1.

WHEN 'EXIT'.

LEAVE PROGRAM.

ENDCASE.

8. Create a Tcode -> Activate all -> Execute.

Regards,

Priya.