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

Table used in function module

Former Member
0 Likes
954

Hi,

As I am programming ABAP for the first time I have a question which I think is pretty basic.

I have created a function module Z_POPUP_GET_VALUES which calls the function POPUP_GET_VALUES. I got some sample code from another forum post and it defines a table name and fieldname. But I am not sure what this table is suppose to be (or do)? Is it an ABAP dictionary table? If so, how do I create one based on the characteristic I want to display??

The implemented code is as follows:

DATA: i_sval Like sval occurs 1 with Header Line.

data: v_subrc like sy-subrc.

i_sval-tabname =

?????

.
i_sval-fieldname = '

?????

'.

i_sval-fieldtext = 'Eiendelsområde'.

i_sval-field_obl = 'X'.

append i_sval.

CALL FUNCTION 'POPUP_GET_VALUES'

EXPORTING

  • NO_VALUE_CHECK = ' '

POPUP_TITLE = 'Asset Area'

  • START_COLUMN = '5'

  • START_ROW = '5'

IMPORTING

RETURNCODE = v_subrc

TABLES

FIELDS = i_sval

EXCEPTIONS

ERROR_IN_FIELDS = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

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

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

ENDIF.

All help appreciated!

Best regards,

TM

3 REPLIES 3
Read only

former_member189631
Active Contributor
0 Likes
665

Hi,

  • Tables in function modules are parameter to that function module.

  • That can be processed when the function module code is called.

and the result can be stored in the tables.

  • Tables have a structure like ABAP Dictionary structure .ie. You will be

define the table type as a dictionary table.

Regards,

<b>Ramganesan K</b>

Read only

Former Member
0 Likes
665

Hi

What purpose you are creating the fun module? first be clear!

if you are using it to display a field(which is in some table) Popup values

give that table name and field name

Here your heading appears that ASSET AREA, so you have to give the field which relates to Asset area and the Table in which this field is there.

Reward points if useful

Regards

Anji

Read only

0 Likes
665

Thanks, this helped me in creating the table.

I am trying to create a popup to restrict a BPS layout (user exit variable). The user is suppose to select an area and then the layout will show only the assets in this area.

Now the popup appears and lets the user enter the correct characteristic value, but when clicking 'Continue' nothing happens. How do I collect the actual value and use it for its purpose? Is it in the 'returncode'?