‎2007 Oct 12 6:48 AM
hiii, I want to initialize the constant data object used in my ABAP program with the value of text element, Can anybody plz tell me how to do so?
‎2007 Oct 12 7:44 AM
I am sorry. You need to specify the value in the statement itself.
Values of text elements are assigned at runtime hence its not allowed to assign with text elements.
You may use :
DATA: text_buffer TYPE string VALUE `Text`,
count TYPE i VALUE 1,
price TYPE p LENGTH 8 DECIMALS 2 VALUE '1.99'.
‎2007 Oct 12 6:50 AM
Hi,
Why do you want to define the constant using a text element..you can directly use the text element
Thanks
Naren
‎2007 Oct 12 7:03 AM
Actually in my program I was using some constants data object to hold the description of the field name which will be displayed in ALV list in header. for example,, like this
*Constants for Field Descriptions:
Constants:
c_text1 TYPE descr_40 VALUE 'Material',
c_text2 TYPE descr_40 VALUE 'Description',
c_text3 TYPE descr_40 VALUE 'Phys Inv Doc',
c_text4 TYPE descr_40 VALUE 'Plant'.
Now i want to make these descriptions <u><b>language independent</b></u> hence i tend to use text element like this:-
c_text1 TYPE descr_40 VALUE text-001
but this thing is not working giving some error.
‎2007 Oct 12 7:08 AM
Hi,
Did you say language dependant or language independant..
If language dependant on your logon language then you can directly use the text elements in your alv..
If language independant which means all the languages should display in english..Then use the constants c_material ...default 'Material'.
Thanks
Naren
‎2007 Oct 12 7:20 AM
yaa,, I want to make the descriptions dependent upon login language,,,
for this i want to initialize constants used in program with the value of text element.
So Is it possible to initials the value of constant data object by value of text element. If not then i will be using variable instead of constants like this.
DATA: matnr_desc type descr_40.
matnr_desc = text-001.
‎2007 Oct 12 7:21 AM
*Constants for Field Descriptions:
Constants:
c_text1 TYPE descr_40 VALUE text-001,
c_text2 TYPE descr_40 VALUE text-002, " 'Description'
c_text3 TYPE descr_40 VALUE text-003, "'Phys Inv Doc'
c_text4 TYPE descr_40 VALUE text-004. "'Plant'.
‎2007 Oct 12 7:26 AM
‎2007 Oct 12 7:29 AM
‎2007 Oct 12 7:34 AM
‎2007 Oct 12 7:44 AM
I am sorry. You need to specify the value in the statement itself.
Values of text elements are assigned at runtime hence its not allowed to assign with text elements.
You may use :
DATA: text_buffer TYPE string VALUE `Text`,
count TYPE i VALUE 1,
price TYPE p LENGTH 8 DECIMALS 2 VALUE '1.99'.