Skip to Content
avatar image
Former Member

Dynamic instance using subform

Hi all,

My requirement is to have a set of fields that needs to grow dynamically based on the input (at runtime). I wrapped those fields in a subform and in initialise event, i wrote a following logic.

<subformname>.instanceManager.setInstances(variable)

Variable will hold the no. of instance, which i am passing from context node. I have one more requirement, i am having a button in the form, if the user press the button, then the set of fields (wrapped in subform) needs to be add one more time in the form. I wrote a logic in Click event as,

<subformname>.instanceManager.addInstance(1).

My problem is, the form is showing as many instances (initially) and if i press the button, i am not able to get one more set of fields. If i remove the coding in initialise event (in subform), then if i press the button, its adding one more set of fields. Please help where i am going wrong.

P.S.: I am using Formcalc and run at client

Regards

V Kumar

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Oct 03, 2009 at 10:28 AM

    Hi,

    In the Button click add the count and check weather it increase the variable value.

    Kind Regards

    Mukesh

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      Thanks for your reply and could you explain me in detail. As in click event, i am increasing the instance using addInstance.

      Regards,

      V Kumar

  • Oct 04, 2009 at 12:11 PM

    your scripting seams ok, is your form a dynamic form (when you create it using abap you have to pass a parameter for this!)

    docparams-fillable = abap_true. (to make it interactice)

    docparams-DYNAMIC = abap_true.

    Add comment
    10|10000 characters needed characters exceeded