Dynamic label texts on dynpro
Hello,
I created a dynpro with screen painter and want to determine the label texts dynamically from a Z dict table.
I hoped that I could change the text of the labels with loop at screen, but there it isn't possible to do that.
Could you help me here?
Best regards
Tim
Hello Tim Eisenmann
Use an input field instead of the label
but set "output only" tick on screen painter.
It has the same appearance as label.
I mean double click on the component on the screen painter,
go to "Program" tab at the right screen and tick "Output Only"
Now you can set whatever you want as an input field.
I hope it helps.
Edited by: Bulent Balci on Aug 9, 2010 4:23 PM
Similar Messages
-
i have a dynpro containing a tabstrip control
i would make the tab title sequence dynamic
as the tab title are pushbutton i have thought to make the pushbutton text dynamic
how can i do it?
i'm sure it's possible to do it in selection screen
thanks!!
bye
DavideOk..here is my example. Most of the code was generated by screen painter via the tabstrip control wizard. Create screen 100, use the tabstrip control wizard to create your tabstrip, name it TABSTRIP. Double click on the tab text elements, rename them TABSTRIP_TEXT1 and TABSTRIP_TEXT2 for the tab text elements, make sure that the output only check box is checked.
REPORT ZRICH_0003 .
data: TABSTRIP_TEXT1(30) type c,
TABSTRIP_TEXT2(30) type c.
start-of-selection.
call screen 100.
*& Module STATUS_0100 OUTPUT
* text
module STATUS_0100 output.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
* Fill the tabstrip text elements here!
TABSTRIP_TEXT1 = 'Text 1'.
TABSTRIP_TEXT2 = 'Text 2'.
endmodule. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
module USER_COMMAND_0100 input.
endmodule. " USER_COMMAND_0100 INPUT
* FUNCTION CODES FOR TABSTRIP 'TABSTRIP'
CONSTANTS: BEGIN OF C_TABSTRIP,
TAB1 LIKE SY-UCOMM VALUE 'TABSTRIP_FC1',
TAB2 LIKE SY-UCOMM VALUE 'TABSTRIP_FC2',
END OF C_TABSTRIP.
* DATA FOR TABSTRIP 'TABSTRIP'
CONTROLS: TABSTRIP TYPE TABSTRIP.
DATA: BEGIN OF G_TABSTRIP,
SUBSCREEN LIKE SY-DYNNR,
PROG LIKE SY-REPID VALUE 'ZRICH_0003',
PRESSED_TAB LIKE SY-UCOMM VALUE C_TABSTRIP-TAB1,
END OF G_TABSTRIP.
DATA: OK_CODE LIKE SY-UCOMM.
* OUTPUT MODULE FOR TABSTRIP 'TABSTRIP': SETS ACTIVE TAB
MODULE TABSTRIP_ACTIVE_TAB_SET OUTPUT.
TABSTRIP-ACTIVETAB = G_TABSTRIP-PRESSED_TAB.
CASE G_TABSTRIP-PRESSED_TAB.
WHEN C_TABSTRIP-TAB1.
G_TABSTRIP-SUBSCREEN = '0101'.
WHEN C_TABSTRIP-TAB2.
G_TABSTRIP-SUBSCREEN = '0102'.
WHEN OTHERS.
* DO NOTHING
ENDCASE.
ENDMODULE.
* INPUT MODULE FOR TABSTRIP 'TABSTRIP': GETS ACTIVE TAB
MODULE TABSTRIP_ACTIVE_TAB_GET INPUT.
OK_CODE = SY-UCOMM.
CASE OK_CODE.
WHEN C_TABSTRIP-TAB1.
G_TABSTRIP-PRESSED_TAB = C_TABSTRIP-TAB1.
WHEN C_TABSTRIP-TAB2.
G_TABSTRIP-PRESSED_TAB = C_TABSTRIP-TAB2.
WHEN OTHERS.
* DO NOTHING
ENDCASE.
ENDMODULE.
Screen Flow is ....
PROCESS BEFORE OUTPUT.
* PBO FLOW LOGIC FOR TABSTRIP 'TABSTRIP'
MODULE TABSTRIP_ACTIVE_TAB_SET.
CALL SUBSCREEN TABSTRIP_SCA
INCLUDING G_TABSTRIP-PROG G_TABSTRIP-SUBSCREEN.
MODULE STATUS_0100.
PROCESS AFTER INPUT.
* PAI FLOW LOGIC FOR TABSTRIP 'TABSTRIP'
CALL SUBSCREEN TABSTRIP_SCA.
MODULE TABSTRIP_ACTIVE_TAB_GET.
MODULE USER_COMMAND_0100.
Regards,
Rich Heilman -
Dynamic Label change the Text depending of the locale
Hi,
I have create a dynamic UI (some InputFields with Labels). The development is in American English. I have create resource name in the xlf-Files. For American English and for German. I set the text of the label by the dynamic creation of the label.
If I try to get the label texts in english I get always the text of the creation one but not the german one. The other texts of the UI-elements are right, which I have translate to german.
It looks like that it is not possible to create UI-Labels for international using.
Any idea.
regards
Gunterhi Werner,
you try in this pdf
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/wd%20java/wd%20tutorials/internationalization%20of%20web%20dynpro%20applications.pdf
Regards,
vino -
How to create label & text items in a page dynamicly(TOP URGENT)
Dear all;
did any1 tried before to create a PLSQL which can create labels or text items?!! i have a page which i want to create labels according to the count of rows in the Database table?
Regards;I would first try creating an 'On Load - Before Header' PL/SQL Computation to count the rows, and store the result in a hidden page/application item, e.g. P120_ROW_COUNT.
Then in the label of the item, put &P120_ROW_COUNT. as the Label Text.
I haven't tested it - but it should work. -
How to change a labels text which created at runtime?
hi,
i am creating label controls in runtime dynamically and adding them to a group component. this group component is in another custom component and i have lots of custom comp. in my app.
my question is how can access (via id) and change a labels text whict created at runtime?
i can change like this but i am setting id's and want to reach via id.
var lbl:mx.controls.Label = mx.controls.Label(subMenu5.group_subMenu5.getElementAt(1));
lbl.text = "good job";
thank you, have a good day.First off, if you are already using a Spark Group, I would suggest you use a Spark Label instead of an MX Label. If you want to reference the Labels from the group, loop through the group's elements and check the if the element id matches the Label you want to assign text to.
var lbl:Label;
var n:int = myGroup.numElements;
for (var i:int = 0; i < n; i++)
lbl = myGroup.getElementAt(i) as Label;
if (lbl && lbl.id == "myLabel")
lbl.text = "newText"; -
How to add dynamic label in qml
I am not familar with this , but I think you might want to take a look in the developer forums. I see some stuff on this subject..
http://supportforums.blackberry.com/t5/10K-Developer-Commitment/dynamically-change-label-text-QML/td... -
Hi,
I want to overwrite a Label Text.
The Text I want to overwrite comes from a bound Context Node.
Before I want to overwrite it I need the current Text, because I want to change Labels dynamically - however to get the actual Text I use Method GET_TEXT of Class CL_WD_LABEL but this Method sets some Attributes (which seems to be an error for my understanding of OO Concepts) anyway it seems not possible to overwrite the Text with Method SET_TEXT after calling GET_TEXT method (GET_TEXT will call the Bound Attribute after 1st call).
Any ideas?
TIA,
SebastianHi,
I want to change n-Lables
And I want to do it like that: Loop at every Labels of a View and Replace every Occurance of "Oracle" with "SAP" (for example)
But if the Label I want to change the text for is bound to a Context Element with an DDIC-Type the GET_TEXT Method (which I need for dynamic text changes) will set Parameters in the Label class which will always will get the old text (on next GET_TEXT call) never mind what text I assigned with SET_TEXT.
But without a GET_TEXT I will not get all "Oracle" lables and so I can't replace the Texts I want to.
Hope I could explain my Prob
Regards,
Sebastian -
Hoe to Dynamically assign text to the lable
Hi Gurus,
I want assign text dynamically to the lable but it's giving run time error lable for property not set of the lable.
Please provide me the sample cod
Regards,
Rahul.Hi Rahul,
Have a context attribute 'TEXT' of string/char type that will hold the value of the label text. Bind this attribute to the text property of your label element. In the context itself, give a default value for the attribute, so that it will be set initially. Then, whenever you want to change the label text, write the following code in the event handler:
method onactionchange_label.
data: label_text type string,
lr_element type ref to if_wd_context_element.
label_text = 'New text'.
lr_element = wd_context->get_element( ).
lr_element->set_attribute(
exporting
name = 'TEXT'
value = label_text
end method.
You will get the error while compiling if the text property is left blank. If it is bound to the context, you will not get the error. For the above code, the context attribute TEXT is not under any node. It is directly defined in the context. If you have your attribute in a node, change accordingly using the code wizard.
Hope this helps. <b>Please award points if it solved your problem.</b>
Regards
Nithya -
Hi,
I am creating CheckBox dynamically based on the entries in the table.
Is it possible to give them label dynamically as I am creating it. I want to do it in simple ABAP. I am in Basis and do not want to go to Module programming or Dypro etc.
I will be glad if it is possible via simple ABAP.
Regards,
SCHi SC,
you could try the following code snippet:
PARAMETERS: p_xcheck AS CHECKBOX.
AT SELECTION-SCREEN OUTPUT.
%_p_xcheck_%_app_%-text = 'hola'.
(extracted from [SAP ABAP Help - Dynamic Parameter Texts in Selection Screen|http://help-abap.zevolving.com/2009/04/dynamic-parameter-texts-in-selection-screen/] and Dynamic changes to the text field label on a screen
Kind regards,
Alvaro -
Hello again.
In AS 2.0, I used to be able to make a single movie clip that I could re-use over and over again as a button. Each instance of this button would then be dynamically labeled at runtime based on some code using onClipEvent(load) and textFormat. I tried to so something similar using actionscript 3.0 and came up against some problems. Could anybody tell what I am doing wrong?
The button is instance named "lgndOneBedroom_mc" and this is the code on the root timeline:
import flash.display.Sprite;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormat;
lgndOneBedroom_mc.buttonMode = true;
lgndOneBedroom_mc.buttonTextField.text = "One Bedroom";
Then, in the button movie clip I have a dynamic text field instance named "buttonTextField" and the following code on the actions layer:
myTextFormat = new TextFormat()
buttonTextField.setTextFormat(myTextFormat);
Thanks everyone.Hey, I'm pretty sure its a minor error with either the name or the text field, but here's a completely dynamic piece where even the text field is created by action script so u don't need anything on the stage, just use the label.x and label.y to place it where you want, hope this helps;
var label:TextField;
function TextFormat() {
configureLabel();
setLabel("Hello ");
function setLabel(str:String):void {
label.text = str;
function configureLabel():void {
label = new TextField();
label.autoSize = TextFieldAutoSize.LEFT;
label.background = true;
label.border = true;
var format:TextFormat = new TextFormat();
format.font = "Verdana";
format.color = 0xFF0000;
format.size = 10;
format.underline = true;
label.defaultTextFormat = format;
addChild(label);
//label.x = where?
//label.y = where?
TextFormat() ; -
Personalization for dynamic labels.
Hi Everyone,
I need to personalize my screen from english to french.
i have used the same label in 2 different views.
for one view it is create and other it is change.
i am changing it dyanmicaly in the code.(in english).
but now i need to personalize these labels to french.
how do we personalize a dynamically changing label in webdynpro?
Thanks and regards,
rohan.Hi,
Put your label texts as part of the message pool and then access them using the key and assign to the respective labels.
Regards
Ayyapparaj -
How Do I Display Quotation Marks in Dynamic HTML Text
I'm using a dynamic text file that has some Quotation Marks
that need to be displayed with the content on certain words in the
TXT file.
How do i display Quotation Marks inside a Dynamic text field?
Please Advise. As soon as possible.
ThanksTry this page - it does the job for you:
http://www.dommermuth-1.com/protosite/experiments/encode/index.html
Otherwise search this forum for "Special and characters and
dynamic and text"
You'll see a couple of thread on the topic. You have to
encode the special characters for them to display correctly. -
How can i change the column label text in a alv table display
how can i change the column label text in a alv table display??
A similar kinda of question was posted previuosly where the requirement was the label text was needed and following below code was given as solution :
<i>* declare column, settings, header object
DATA: lr_column TYPE REF TO cl_salv_wd_column.
DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
DATA: lr_column_header type ref to CL_SALV_WD_COLUMN_HEADER.
get column by specifying column name.
lr_column = lr_column_settings->get_column( 'COLUMN_NAME1' ).
set Header Text as null
lr_column_header = lr_column->get_header( ).
lr_column_header->set_text( ' ' ).</i>
My specific requirement is i have an input field on the screen and i want reflect that value as the column label for one of the column in the alv table. I have used he above code with slight modification in the MODIFYVIEW method of the view since it is a process after input. The component gets activated without any errors but while run time i get an error stating
<i>"The following error text was processed in the system CDV : Access via 'NULL' object reference not possible."</i>
i have checked in debugging and the error occured at the statement :
<i>lr_column = lr_column_settings->get_column( 'CURRENT_YEAR' ).</i>Please can you provide me an alternative for my requirement or correct me if i have done it wrong.
Thanks,
SuriI found it myself how to do it. The error says that it is not able to find the reference object i.e it is asking us to refer to the table. The following piece of code will solve this problem. Have to implement this in WDDOMODIFYVIEW method of the view. This thing works comrades enjoy...
DATA : lr_cmp_usage TYPE REF TO if_wd_component_usage,
lr_if_controller TYPE REF TO iwci_salv_wd_table,
lr_cmdl TYPE REF TO cl_salv_wd_config_table,
lr_col TYPE REF TO cl_salv_wd_column.
DATA : node_year TYPE REF TO if_wd_context_node,
elem_year TYPE REF TO if_wd_context_element,
stru_year TYPE if_alv_layout=>element_importing,
item_year LIKE stru_year-i_current_year,
lf_string TYPE char(x),
DATA: lr_column TYPE REF TO cl_salv_wd_column.
DATA: lr_column_header TYPE REF TO cl_salv_wd_column_header.
DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
Get the entered value from the input field of the screen
node_year = wd_context->get_child_node( name = 'IMPORTING_NODE' ).
elem_year = node_year->get_element( ).
elem_year->get_attribute(
EXPORTING
name = 'IMPORT_NODE-PARAMETER'
IMPORTING
value = L_IMPORT_PARAM ).
WRITE L_IMPORT_PARAM TO lf_string.
Get the reference of the table
lr_cmp_usage = wd_this->wd_cpuse_alv( ).
IF lr_cmp_usage->has_active_component( ) IS INITIAL.
lr_cmp_usage->create_component( ).
ENDIF.
lr_if_controller = wd_this->wd_cpifc_alv( ).
lr_column_settings = lr_if_controller->get_model( ).
get column by specifying column name.
IF lr_column_settings IS BOUND.
lr_column = lr_column_settings->get_column( 'COLUMN_NAME').
set Header Text as null
lr_column_header = lr_column->get_header( ).
lr_column_header->set_text( lf_string ).
endif. -
Problem displaying dynamically loaded text in Flash CS3
I created a Flash CS3 application that does not display
dynamically loaded text (from internal AS3 scripts) on 3/6 of my
client's computers. All computers run IE 6 and Flash Player 9. I
cannot replicate the problem on any computer in my department. The
problem seems to be related to Flash Player 9 or a browser
setting/IT restriction. Has anyone encountered this? If so, have
you found a solution?
If I cannot find a solution, then I will need to almost
completely redo the application.
One slightly insane idea I have considered is to, if
possible, convert dynamically loaded text to an image real-time. Is
that possible?
Btw, I have created a font in my library. Should I try
manually embedding the font from the Properties menu and selecting
all characters?
Thanks in advance.yes, even though you may be using a font from the library,
you still have to specify that each text field that uses that font
embeds the font, and you'll need to select all characters(well not
all, unless you require all the different scripts of the world -
upper-case, lower-case, numerals and punctuation usual suffices).
I bet if you checked, the computers where the font did not
appear did not have the font on their system.
Good luck
Craig -
How to change the field label text in standard WD application
Hello All,
I have a requirement to change the filed label text in standard WebDynpro application.
Application Name: /SAPSRM/WDC_UI_DO_BIDDER
View: V_DO_BIDDER_SEARCH_C
I want to change the label text from "Last Name" to "Vendor Name".
Can anyone please provide me the possible options to change label text?
Thanks in Advance.
Regards,
ShyamThread closed...Found the solution ...
Maybe you are looking for
-
Size limit on an external hard drive?
I recently bought a Maxtor 200Gb hard disk and, using Intech's ATA driver, partitioned into 128Gb and 60Gb so that it could be used internally. I have now moved it into a USB2 drive enclosure and have formatted it as a single partition 200Gb drive. M
-
I have tried to install Bootcamp with Windows XP four times now and never has it asked me (during the Windows installation with the blue screen) if I want to reformat the disk to NTFS. I choose a partition between 91-99GB, so I must use NTFS. The onl
-
HT203175 My daughter can not remember her password how can I reset it her ipod?
My daughter forgor her password how can I rest it through itunes?
-
Has anyone found a solution for choosing what version of PS CS4 will open when double clicking a PS linked file (aka PSD, TIFF, etc)? It's really irritating me that I have to open the 32-bit version first just to make sure the files open in the corre
-
how do you set up a rescue email