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: 

are there global parameters in SAP

former_member186143
Active Contributor
0 Kudos

Just wondering if there is also an option to define global parameters with global values.

I know there are parameters but those I have to attach to a user with a value.

there is also an user_dir with AL11 which is used for directories .

I look for instance for an requirement where I can maintain email adresses.

Now I have hardcoded it in ABAP but it happens from time to time due to reorganisations that emails change.

CASE ekko-bukrs.
          WHEN '1600'.
            so_sender = 'inkoopsomewhere.nl'.
          WHEN OTHERS.
            so_sender = 'inkoopotherdepartment.nl'.
        ENDCASE.

it is in these cases not possible to put it in customizing in organisation structure since other emails are used there.

I want to be able to maintain the specific mail adresses in 1 spot. in the example of the programm above there are also other programms with the same mail adresses hard coded.

it there something like global parameters or an other option to maintain email adresses or other objects ?

or with other words, define global abap independent constants.

the table tvarv for instance looks promising but is als a bit of an abuse and limited in var value length since these vars are meant for report use.

kind regards

arthur

Edited by: A. de Smidt on May 24, 2011 1:56 PM

Edited by: A. de Smidt on May 24, 2011 2:29 PM

1 ACCEPTED SOLUTION

brad_bohn
Active Contributor
0 Kudos

Using TVARVC in that way is not abuse. It's common to store values there that aren't just used for selection screens. However, since a value field in TVARVC is limited to 45 characters, it won't be sufficient for an email address, unless you just need to store a user ID. A system user ID would be better for 'senders' as you'd get the benefit of both name and smtp address without having to force it but you could also maintain a global email notification/mapping table as well.

7 REPLIES 7

brad_bohn
Active Contributor
0 Kudos

Using TVARVC in that way is not abuse. It's common to store values there that aren't just used for selection screens. However, since a value field in TVARVC is limited to 45 characters, it won't be sufficient for an email address, unless you just need to store a user ID. A system user ID would be better for 'senders' as you'd get the benefit of both name and smtp address without having to force it but you could also maintain a global email notification/mapping table as well.

awin_prabhu
Active Contributor
0 Kudos

Please check whether tcode SO23 ( To Create SAP mail distribution lists ) will be useful.

Maintain all mail ids in a list in SO23 and in program from table ADR6 fetch the required mail id passing the address number.

ThomasZloch
Active Contributor
0 Kudos

I might get smacked by OO-purists, but I'm using a dedicated global class with public constant attributes for a similar purpose.

Thomas

maciej_domagaa
Contributor
0 Kudos

I think the most convenient way in such cases is to create your own Z-table and put all the parameters you need there.

Having this done you can generate a maintenance program using table maintenance generator (see t-code SE54) - this way you can have your own transaction to edit data stored in the table, even transport the data from DEV system to PRD, etc.

In the ABAP code instead of using "case ... when... " you can put "select ... from your Z-table" and you don't have to change the code anymore when you need to change your parameters.

regards

Former Member
0 Kudos

Though a little crude, you can try SO10 tcode for standard text.

Maintain email ids at each line of the standard text and use FM read_text to retrieve the same and use it in your code.

But I thought TVARV table is a good option, otherwise I guess you have to make a custom table to store these.

MarcinPciak
Active Contributor
0 Kudos

Maybe I won't add value to previous anwsers but I would lean towards Maciej's suggestion. We use it for one customer and anytime something changes in requirements it is user who takes care of altering data in such table. Suffice to assign proper authorization to user, the rest becomes configurable ad hoc.

BTW: today I accidentally visited blog [Program Parameters vs hardcoding|/people/igor.barbaric/blog/2005/05/31/program-parameters-vs-hardcoding]. You may find it helpful.

Regards

Marcin

former_member186143
Active Contributor
0 Kudos

thanks for all the answers, since it was a more informative question also all the answers are rewarded since they confirmed my choice to make a ztable for the parameters. but I couldn't help to think that SAP might have a sollution or already a table for this.

we had some problems with distribution lists recently so I am not a big fan of using those.

I have now set up an ztable with

PARAM_NAME PARAM_NAME CHAR 15

PARAM_VAL PARAM_VAL CHAR 80

PARAMTEXT PARAMTEXT CHAR 79

thanks

Arthur