on 09-18-2014 3:15 PM
Hi all
I'm looking 4 way to control dynamiclly on the positions of labels and input fields in ABAP web-dynpro
i have to select data from table (below) on one formnum and show all the fields of it in WD view/screen
and according to the data to paint the screen (ex: the 3rd field will start in position 40 , since the first 2 fields are 20 each)
if the width is 55, the 4th field will b in new row (that it wiil we cut)
formNum | fieldName | fieldDesc | index | fieldLen | fieldHigh | type | bindHeaderToFieldName | bindValueToFieldName |
1 | employeeID | מספר עובד | 1 | 20 | 10 | text | prm_char_type | prm_char_val |
1 | methodNum | מספר שיטה | 2 | 20 | 10 | text | prm_char_type | prm_char_val |
1 | year | שנה | 3 | 10 | 10 | text | prm_char_type | prm_char_val |
1 | month | חודש | 4 | 15 | 10 | text | prm_char_type | prm_char_val |
1 | hours | מספר שעות עבודה | 5 | 10 | 0 | number | prm_char_type | prn_kf_val |
2 | employeeID | מספר עובד | 1 | 20 | 10 | text | prm_char_type | prm_char_val |
2 | methodNum | מספר שיטה | 2 | 20 | 10 | text | prm_char_type | prm_char_val |
2 | year | שנה | 3 | 10 | 10 | text | prm_char_type | prm_char_val |
2 | month | חודש | 4 | 15 | 10 | text | prm_char_type | prm_char_val |
2 | hours | מספר שעות עבודה | 5 | 10 | 0 | number | prm_char_type | prn_kf_val |
2 | trainNum | מספר רכבת | 6 | 5 | 10 | text | prm_char_type | prm_char_val |
moreover:
if i choosing FormNum 1 i have to paint 5 input fields, i have to take the description height and length from the DB.
i need that all the fields that can will b in the same line (it means i need to calculate the sum of length of all the fields in the same line
before i'm starting i don't know if i'll have one field or 20 fields (or any other number) everything depending how many rows of the relevant formNum are in the DB.
The DB can b changed and I need that the screen/form will create according to relevant data from DB
for example formNum 3 can b with 2 fields FirstName (length 10) and LastName (15 letters) it is mean that last name will start in position 10 and will b paint to position 25.
Thanks in advance
Avner
p.s.
i hope my explanation is clear enough
You can create the gui in wddomodifyview hook method of the view, just search for it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanx Jozef
I found some examples
But i still didn't find the way to do exactlly the specific thing that i want to do
in couple of examples there is a use in
wd_this->mr_view
i'm getting the message
Field "MR_VIEW" is unknown. It is neither in one of the specified ...
1) Where i need to specified it?
2) I'll b very happy if some of u can give short code example for what i asked in the original messge in top of this disccusion.
how to use the data that i have on DB to the screen painting?
what declerations on the WD application? what data and command code?
Thank you
Avnas
well the whole concept is complex. It does not matter where your customization is made, the logic you want to create depends on you.
mr_view from your examples is most probably only a helping reference to the current instance of the view, which could and does not have to be implemented by you.
Have a look at this example:
Creating UI Elements Dynamically in Abap Webdynpro Application - Web Dynpro ABAP - SCN Wiki
Probably you will not need to create dynamic tables (which is done there), but most valueable part for you could be part, where calling of the method cl_wd_input_field=>new_input_field( ) creates a new input field, cl_wd_matrix_head_data=>new_matrix_head_data( ) sets the layout data to the UI element, add_child( ) puts the element to a specific container, This is what you will need to do with your ui elements (labels, input fields, buttons etc.) in the order, which is specified in your customization tables.
It is a little bit tricky, but in general, you need to do programatically all the things that the layout editor does for you (or enables you to do via GUI).
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.