cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically Creation of input field in webdynpro

Former Member
0 Kudos

Hello Experts,

I am new to webdynpro.

I have a requirement to create the input filed dynamically for material.

Requirement:- I have to button in my screen "+" and "-" button.

after execution while i will click on + button one input filed should be created automatically and while i will clicik on

- button the newly creaed inputfield should be deleted from the screen.

Coulld anybody help me on this.

it would be great if somebody can share any solutin or sample code.

Thanks in Adv...

Accepted Solutions (0)

Answers (2)

Answers (2)

Lukas_Weigelt
Active Contributor
0 Kudos

Hi,

just being curious: In what situation are you, that you have to dynamically create UI-Elements and I guess respective Context as well? Couldn't you just create the input-field in design time, set it invisible and set it visible dynamically when pushing that button?

Cheers, Lukas

former_member184578
Active Contributor
0 Kudos

Couldn't you just create the input-field in design time, set it invisible and set it visible dynamically when pushing that button?

Hi Lukas,

Jus to clarify on this: There might be situations, we don't know how many fields the user wants to create at runtime.

Let say, the user is inserting product items and their validities, we are not sure how many product items he is going to insert.

To simplify this situation we can use a table UI with add button also.

Thanks & Regards,

Kiran.

Lukas_Weigelt
Active Contributor
0 Kudos

Hi Kiran,

Jus to clarify on this: There might be situations, we don't know how many fields the user wants to create at runtime.

Yes, OK, that does make sense and justifies the effort in this case, I agree with you.

But in OP's case I think he only wants one field:

after execution while i will click on + button one input filed should be created automatically and while i will clicik on

Still, it does make sense to dynamically create them if there could be one up to X to keep the application slender.

Cheers, Lukas

former_member184578
Active Contributor
0 Kudos

Hi Lukas,

Yep. If it is one input field he can set it invisible and onClick of add button he can set it visible. But User can click that button again.! and one input field has to create..!! Ok we will leave this to him. It doesn't make sense discussing on this without knowing what excatly the requirement was.

Cheers,

Kiran.

Lukas_Weigelt
Active Contributor
0 Kudos

Hi Lukas,

>

> Yep. If it is one input field he can set it invisible and onClick of add button he can set it visible. But User can click that button again.! and one input field has to create..!! Ok we will leave this to him. It doesn't make sense discussing on this without knowing what excatly the requirement was.

>

> Cheers,

> Kiran.

Haha, you are right . I think he has to good approaches now and can choose as per his requirements accordingly

Cheers, Lukas

Former Member
0 Kudos

Hi

I have to create 10 input field dynamically

thanks

former_member184578
Active Contributor
0 Kudos

Hi,

Check my first post. Those links will help you.

Thanks & regards,

Kiran.

Former Member
0 Kudos

Hi Kiran,

how can we add search help to input field dynamically . if u have any code snippets drop a mail to me

ravi2389@gmail.com

Thanks in Advance.

Former Member
0 Kudos

Hello,

you can create as many as UI you want to create but for that you need to write code in the Modifyview method.

here is a good link which will provide you no. of links to do this things..

http://www.google.co.in/#fp=40855a382358404c&q=how+to+create+input+field+dynamically+in+web+dynpro&s...

BR

Chandra..

Former Member
0 Kudos

Hi chandra sekhar,

my requirement is adding search help to input field previouly input field does not have any search help

please share the details

Former Member
0 Kudos

just make use of OVS(https://www.google.co.in/#fp=40855a382358404c&q=how%20to%20implement%20ovs%20in%20webdynpro%20abap)

on the particular attribute and bind that attribute with newly created input field as you must provided some attribute in dynamic creation of input field.

.. Chandra..

former_member184578
Active Contributor
0 Kudos

Hi,

You need to code in DOMODIFYVIEW method. Check this wiki for reference: [Dynamic UI in WDA|http://wiki.sdn.sap.com/wiki/display/WDABAP/CreatingUIElementsDynamicallyinAbapWebdynpro+Application]

Also check this demo by thomas sir: [Dynamic Programming in WDA|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/201ddd3b-b4ce-2b10-8883-880ae8147f89]

hope this helps u.,

Thanks & Regards,

Kiran.