2010 Feb 17 7:38 AM
Hi there,
i've got a question. I created a dynpro and I want to set sy-uname as default for an input field in a dynpro (field marked in picture). What is the easiest way to make this real?
Thankfully marko
Picture: [Dynpro|http://b.imagehost.org/download/0919/problem]
2010 Feb 17 8:18 AM
Dear markok,
The easiest way to populate the parameters/select-options on the screen is to populate the same in the INITIALIZATION block.
The code snippet:
" Selection screen
PARAMETERS:
pa_uname TYPE sy-uname.
INITIALIZATION.
pa_uname = sy-uname.
START-OF-SELECTION.
" your code goes here
Hope this helps...:)
Regards
s@k
2010 Feb 17 7:41 AM
2010 Feb 17 7:47 AM
How should i mark that field in PBO?If i try to set the field called "Benutzername" to sy-uname (Benutzername = sy-uname) I get a syntax problem. I cant declare the content of the field in PBO.
Thanks anyway
Edited by: markok on Feb 17, 2010 8:50 AM
2010 Feb 17 7:56 AM
<li> If Benutzername is your screen field and wants to use in program, you need to define the variable Benutzername in TOP include and do the same, then it works. Thanks Venkat.O
2010 Feb 17 7:59 AM
Hi Markok,
What is the syntax error you are getting?
Regards,
Swarna Munukoti.
2010 Feb 17 8:16 AM
In PBO or PAI of a Dynpro there is no way to declare anything. You can only work with a few commands like field chain module and so on.
So i build a module where i try to move sy-uname to my field and i called the module from PBO.
But it doesnt work
2010 Feb 17 8:20 AM
Hi,
If the name of your field is A, then go to your TOP include of the Dialog Program and declare it as
DATA: A(10) TYPE c.
This is what Venkat is trying to say.
2010 Feb 17 8:23 AM
Hi,
In TOP Include
Data : Benutzername type sy-uname.
" Follow these steps as mentioned here
in PBO of Screen.
Module status_100.
in program
module status_100 output.
Benutzername = sy-uname. " Make sure you use the Same name(Benutzername) for Screen Field in Screen Painter.
endmodule.
"Make Sure you are not Clearing any Structure or this Value Individually
" We can't use Data key word in FLow Logic neither Assign statements
" The Fundamental Rule in Screen Programs
If Screen Field name and a Variable name in program is same then automatic data transfer takes place.
Cheerz
Ram
2010 Feb 17 8:24 AM
2010 Feb 17 8:18 AM
Dear markok,
The easiest way to populate the parameters/select-options on the screen is to populate the same in the INITIALIZATION block.
The code snippet:
" Selection screen
PARAMETERS:
pa_uname TYPE sy-uname.
INITIALIZATION.
pa_uname = sy-uname.
START-OF-SELECTION.
" your code goes here
Hope this helps...:)
Regards
s@k
2010 Feb 17 8:27 AM
TO Siemens: Thanks but this isnt the solution too. I want that my field "Benutzername" is automatically filled with sy-uname ( For example: [Field|http://b.imagehost.org/download/0145/problem] ).
To others: I try again
Thankfully
Marko
Edited by: markok on Feb 17, 2010 9:28 AM
2010 Feb 17 8:34 AM
create new module at PBO and assign sy-uname to that field in that module.
Sekhar
2010 Feb 17 8:35 AM
hi,
in top include declare the field.
then in the pbo module pass the value field.
filedname = sy-uname.
if this doesnt work then check spa/gpa in the attributes.
regards.
2010 Feb 17 8:36 AM
Dear Marko,
Can you show how you have declared the field "Benutzername"..?
Regards
s@k
2010 Feb 17 10:44 AM
Thank you very much for your answers but it still doesnt work. I did some screenshots now.
Can anybody explain me whats wrong ? The problemfield "Benutzer" is called "einstruktur-erstellerein" in my program.
Its build in a structure ( Screenshot: [Declaration|http://b.imagehost.org/download/0827/problem1] ).
The second picture describes the fieldinput through sy-uname in my module (Screenshot: [Input|http://i.imagehost.org/download/0846/problem2] ). Screenshot three is the PBO calling of the module (Screenshot: [Module|http://i.imagehost.org/download/0735/problem3] ).
The problem is that in debug mode the field "einstruktur-erstellerein" is filled with sy-uname but in dynpro output the field is shown as empty. 😕
Thankfully marko
2010 Feb 17 12:30 PM
Are you sure you're not doing a CLEAR somewhere in a PBO module?
Is the SCREEN field name exactly the same? One small typo is enough to not see the value.
And for testing purposes, try passing SY-UNAME in a PBO module and see if the screen field is still empty.
2010 Feb 17 12:37 PM
Hi Maen Anachronos, thank you for your answer. What do you mean with try passing sy-uname in PBO Module??
The fieldnames are 100% correct. I checked them again and I did it about ten times today ;).
Thanks
2010 Feb 17 12:51 PM
SY-UNAME in a PBO module... sorry misread your post: you already did that.
2010 Feb 17 12:53 PM
Hello,
How is your field defined in the element list of your dynpro ?
Are the checkboxes Input and Output flagged ?
Did you create the reference yourself by creating the element directly on the screen (dynpro) or did you make a reference to the Dictionary with the Dictionary checkbox in the element list ?
The rest of your code seems correct to me.
Wim
2010 Feb 17 1:20 PM
OH MY GOD
I created the dynpro last week and i forgot that i set the field to only input OH MY GOD
Thanks a lot it works !!!
Edited by: markok on Feb 17, 2010 2:20 PM