Skip to Content

are there global parameters in SAP

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • Best Answer
    Posted on May 24, 2011 at 01:03 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 24, 2011 at 01:19 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 24, 2011 at 01:19 PM

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

    Thomas

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 24, 2011 at 01:26 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 24, 2011 at 01:59 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 24, 2011 at 01:20 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 25, 2011 at 01:11 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.