Skip to Content
author's profile photo Former Member
Former Member

Hard Coding in program.

Hi Guys,

Just i am a beginner.

if we do hard coding in program like.

<b>write : 'program successful'.</b>

is it necessary to put this statement in a text elment?

like <b>write: text-001.</b>

Is this mandatory?

IF we use text element what is the advantage?

Thanks for ur help in advance.

RAJA.

Add a comment
10|10000 characters needed characters exceeded

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 21, 2005 at 06:28 AM

    not mandatory...

    but it is recommended that you use text-symbols...

    reason being SAP programs can be run on different languages other than english...so when u choose a different language...you might need a translation of the text appearing on screens....

    if you dont use text elements, there will be no translation while in text elements you can translate text elements for different languages.

    rgds,

    PJ

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 21, 2005 at 06:23 AM

    HY,

    IT'S NOT MANDATORY TOO USE TEXT ELEMENTS,

    BUT WHEN U DO EXTENDED CHECK AT TAHT TIME, HTE HARD CODED COMES IN PICTURE.

    SO BETTER USE TEXT ELEMENTS.

    REGARDS,

    KARTIKEY.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 21, 2005 at 06:28 AM

    hi,

    eventhough it's not mandatory , it is always advisable by using text-001

    when you define the string using text element it can be easy for translating ( suppose you want to translate to germen lanuage for the same text ) then it will take care by translate procedure

    cheers,

    sasi

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      u should have opened a new thread for this....

      translated text can be specified in the text elements screen itself...

      from the program goto->text elements -> text symbols...

      from text symbols...goto->translation...

      enter the original and target language and proceed...

  • author's profile photo Former Member
    Former Member
    Posted on Oct 21, 2005 at 06:30 AM

    Hi Raja,

    It is not mandatory to use text element.

    Text elements allow you to create language-independent programs. Any text that the program sends to the screen can be stored as a text element in a text pool. Different text pools can be created for different languages. When a text element is changed or translated, there is no need to change the actual program code. Text elements in an ABAP program are stored in the ABAP Editor.

    Regards,

    Sriram.

    Message was edited by: sriram Ponna

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 21, 2005 at 06:41 AM

    Raja,

    In the example you have given, it is more suitable to use a Text Element (for the reasons that everyone has told you). However, if you are going to hard code something for a SELECT statement, it is bretter to use a constant:

    eg.

    SELECT matnr werks
           from marc
           where matnr = '12345' and
                 werks = 'ABCD'.
    

    should be written as:

    
    constants: c_matnr like mara-matnr value '12345',
               c_werks like marc-werks value 'ABCD'.
    
    SELECT matnr werks
           from marc
           where matnr = c_matnr and
                 werks = c_werks.
    

    This is better practice because if you latwer want to change these constants they are all located in the one spot. Imagine having dozens of SELECT statements, and all of a sudden instead of hittingplant 'ABCD' you need them to hit plant 'EFGH'.

    Hope this helps.

    Cheers,

    Pat.

    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.