cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic table in interactive form...

Former Member
0 Kudos

Hi Friends,

I am a beginner in adobe forms development.

I want to create an adobe form with dynamic internal table. I.e. addition of rows and deletion of rows dynamically. I have gone through some of the threads in SDN. But still I am not able to make it.

I used following approach for the same. Kindly correct me if i am wrong.

Step1: I have created a context with the required fields in webdynpro abap with cardinality 1..1.

Step2: In the adobe form I created a table using table assistant.

Step3: a. Wrapped the table into a subform and set the content as "Flowed"

b. Selected "Repeat Table item for Each Data Item" at table level and body level with min count as '1'.

c. Selected "Repeat Table item for Each Data Item" at header row with min count and max as '1'.

Step 4: Added two Webdynpro native submit buttons by name "Add" and "Delete" and coded as follows:

For add button:

var nTableLength = Table.nodes.length;

var nNumRow = 0;

for (var nCount = 0; nCount < nTableLength; nCount ++) {

if ((Table.nodes.item(nCount).className == "subform") & (Table.nodes.item(nCount).name !== "HeaderRow")) {

nNumRow = nNumRow + 1;

}

}

if (nNumRow == 7) {

xfa.host.messageBox("The maximum allowable number of rows is 7. You cannot add any more rows.", "Warning", 3);

}

else {

Items.Table.Row1.instanceManager.addInstance(1);

}

Still dynamically rows are not getting created. But when i click on add/delete some process is happening.

Do I need to write any logic in Webdynpro abap??.

Please clarify.

Thanks in advance.

Regards,

Phani.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos
Former Member
0 Kudos

Thanks a lot Runal for the document and great work.

As per your document I have added the adobe form onto webdynpro abap. But the form has become non interactive and buttons got disabled.

The same form when i triggered through program its become interactive. Then also the add/remove buttons are not working.

Is it a problem with the version of the adobe life cycle designer? I am using 7.1 Version. Please clarify.

Thanks again.

Regards,

Phani.

Former Member
0 Kudos

Hi,

If you are calling the Form through Web Dynpro ABAP then add this peice of code in the WDDOMODIFY method of the view.

data: LR_INTERACTIVE_FORM type ref to CL_WD_INTERACTIVE_FORM, LR_METHOD_HANDLER type ref to IF_WD_IACTIVE_FORM_METHOD_HNDL. check first_time = abap_true. LR_INTERACTIVE_FORM ?= VIEW->GET_ELEMENT(u2018INTERACTIVE_FORM_1u2019). LR_METHOD_HANDLER ?= LR_INTERACTIVE_FORM->_METHOD_HANDLER. LR_METHOD_HANDLER->SET_LEGACY_EDITING_ENABLED( abap_true ).

When you call the Form through SE38 or from SAP GUI the interactivity is reduced to a great extent.

Well, the version of ALD you are using should not pose such problems. But if nothing works out trying upgradng to ALD 8.0

Regards,

Runal

Former Member
0 Kudos

Thanks a lot Runal!!!.

Regards,

Phani.

Former Member
0 Kudos

Hi Runal,

I'm following your document, but I'm not getting the adobe forms buttons working. I try to put the code that you mention, but I got an error message in the WebDynpro View saying: "field get_element is unknown", this is the code that I'm adding in the

method WDDOMODIFYVIEW.

data: LR_INTERACTIVE_FORM type ref to CL_WD_INTERACTIVE_FORM,

LR_METHOD_HANDLER type ref to IF_WD_IACTIVE_FORM_METHOD_HNDL.

check first_time = abap_true.

LR_INTERACTIVE_FORM ?= VIEW->GET_ELEMENT(u2018ZDYN_TBL_FORMu2019).

LR_METHOD_HANDLER ?= LR_INTERACTIVE_FORM->_METHOD_HANDLER.

LR_METHOD_HANDLER->SET_LEGACY_EDITING_ENABLED( abap_true ).

If I double click in the class CL_WD_INTERACTIVE_FORM, I can't see any method GET_ELEMENT.

I don't know where the problem is, could you help me?

thanks,

Luis Lara

ankur_jain15
Explorer
0 Kudos

Hi Luis Lara,

"GET_ELEMENT" is a method of interface "IF_WD_VIEW".

And you have to write the code like:

data: LR_INTERACTIVE_FORM  type ref to CL_WD_INTERACTIVE_FORM,

       LR_METHOD_HANDLER    type ref to IF_WD_IACTIVE_FORM_METHOD_HNDL.

check first_time = abap_true.

LR_INTERACTIVE_FORM ?= VIEW->GET_ELEMENT( 'INTERACTIVE_FORM_1' ).

LR_METHOD_HANDLER ?= LR_INTERACTIVE_FORM->_METHOD_HANDLER.

LR_METHOD_HANDLER->SET_LEGACY_EDITING_ENABLED( abap_true ).

Where 'INTERACTIVE_FORM_1' is the name of Interactive form element.

Ankur Jain

Answers (0)