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

Externalise fields used in function module

sailpoint
Explorer
0 Likes
2,016

Hi Guys,

I am writing a function module in which i have some variables against which i want to check the input parameters. I want to maintain this configuration outside my FM and want to refer it. What are different ways of externalising such variables used in FM. One way i can think of is creating a table but i am not finding other ways which are simpler. It is like message property configuration we do in web application where behaviour of certain functionality can be controlled through some properties file.

Is there such thing in ABAP? What are best options?

Thanks,

Vijay

8 REPLIES 8
Read only

FredericGirod
Active Contributor
0 Likes
1,922

It will not be easy to answer to your question, it will depend of the context.

Why didn't you create another FM to expose the input parameters of the first one ?

Read only

Sandra_Rossi
Active Contributor
1,922

You can see in transaction code SPRO that there are thousands of standard customizing tables to configure the behavior of programs, so don't reinvent the wheel, just create your own customizing tables.

Read only

matt
Active Contributor
0 Likes
1,922

Is this for testing the FM? If so you can use the built in testing framework.

Read only

Sandra_Rossi
Active Contributor
1,922

Please use the COMMENT button for comments, questions, adding details, replying to a comment or a proposed solution or to the OP question, etc., ANSWER is only to propose a solution, dixit SAP text at the right of the answer area.

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,922

Again, you are proposing to create a custom table to store the configuration used by your function module, and I confirm that SAP does the same with its own standard programs, i.e. create standard tables to store the configuration, so don't bother and do as you proposed.

Read only

sailpoint
Explorer
0 Likes
1,922

Thank you guys for responses. Let me explain flow expected.

1) This FM will be called with an argument called table name and it returns table data. I want to restrict it say T1,T2 table access. Other arguments like T3 results in not allowed exception.

2) Each customer will expose some specific table name through external configuration which can be changed w/o changing the FM code and this FM will read it and do a input table name check against it.

@Frederic, where it will save this table name list through another function module. I dont want it to be accessible to anybody if i use this?

@Sandra , SPRO config, is it a standard practise in SAP through which external properties to such custom programs are maintained?

@ Matthew Thank you but its not for testing.

Read only

sailpoint
Explorer
0 Likes
1,922

sandra.rossi Could you please send me some link ? I am new to ABAP. I am also not in favour of creating a table as customers are reluctant to make such modifications in their systems. Also please let me know about any other ways of providing such configuration in SAP which could be easier. I was evaluating whitelists in ABAP but i am not finding details around it.

Thanks,

Vijay

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,922

I don't see why you are okay to create a custom function module but reluctant to create a custom table, could you explain?

Creating a custom table for containing your allow list is easy and takes 2 minutes (quicker than writing my comment), and there's no easier way. No need of a documentation, it's very basic.

Good luck!