cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP web dynpro Dynamic position

Former Member
0 Kudos


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)

formNumfieldNamefieldDescindexfieldLenfieldHightypebindHeaderToFieldNamebindValueToFieldName
1employeeIDמספר עובד12010textprm_char_typeprm_char_val
1methodNumמספר שיטה22010textprm_char_typeprm_char_val
1yearשנה31010textprm_char_typeprm_char_val
1monthחודש41510textprm_char_typeprm_char_val
1hoursמספר שעות עבודה5100numberprm_char_typeprn_kf_val
2employeeIDמספר עובד12010textprm_char_typeprm_char_val
2methodNumמספר שיטה22010textprm_char_typeprm_char_val
2yearשנה31010textprm_char_typeprm_char_val
2monthחודש41510textprm_char_typeprm_char_val
2hoursמספר שעות עבודה5100numberprm_char_typeprn_kf_val
2trainNumמספר רכבת6510textprm_char_typeprm_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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You can create the gui in wddomodifyview hook method of the view, just search for it.

Former Member
0 Kudos

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

Former Member
0 Kudos

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).

Answers (0)