cancel
Showing results for 
Search instead for 
Did you mean: 

Error while creating dynamic layout

Former Member
0 Kudos

Your help in this will be highly appreciated.

I am trying to create layout with labels, input fields and a button, dynamically. The corresponding code is

method WDDOMODIFYVIEW .

data: MY_TEXT type string.

data: MY_TEXT1 type string.

MY_TEXT = 'nani'.

MY_TEXT1 = 'nani'.

data: LR_CONTAINER type ref to CL_WD_UIELEMENT_CONTAINER,

LR_LABEL1 TYPE REF TO CL_WD_LABEL,

LR_INPUT1 TYPE REF TO CL_WD_INPUT_FIELD,

LR_LABEL2 TYPE REF TO CL_WD_LABEL,

LR_INPUT2 TYPE REF TO CL_WD_INPUT_FIELD,

LR_BUTTON type ref to CL_WD_BUTTON,

LR_FLOW_DATA type ref to CL_WD_FLOW_DATA.

LR_INPUT1 = CL_WD_INPUT_FIELD=>NEW_INPUT_FIELD( ID = 'nani' ).

LR_FLOW_DATA = CL_WD_FLOW_DATA=>NEW_FLOW_DATA( element = LR_INPUT1 ).

LR_LABEL1 = CL_WD_LABEL=>NEW_LABEL( text = 'ENTER FIRST NUMBER' label_For = 'nani' ).

LR_FLOW_DATA = CL_WD_FLOW_DATA=>NEW_FLOW_DATA( element = LR_LABEL1 ).

LR_INPUT2 = CL_WD_INPUT_FIELD=>NEW_INPUT_FIELD( ID = 'bobby' ).

LR_FLOW_DATA = CL_WD_FLOW_DATA=>NEW_FLOW_DATA( element = LR_INPUT2 ).

LR_LABEL2 = CL_WD_LABEL=>NEW_LABEL( text = 'ENTER SECOND NUMBER' label_For = 'bobby' ).

LR_FLOW_DATA = CL_WD_FLOW_DATA=>NEW_FLOW_DATA( element = LR_LABEL2 ).

LR_BUTTON = CL_WD_BUTTON=>NEW_BUTTON( text = MY_TEXT enabled = '' ).

LR_FLOW_DATA = CL_WD_FLOW_DATA=>NEW_FLOW_DATA( element = LR_BUTTON ).

LR_CONTAINER ?= view->GET_ELEMENT( 'ROOTUIELEMENTCONTAINER' ).

LR_CONTAINER->ADD_CHILD( LR_LABEL1 ).

LR_CONTAINER->ADD_CHILD( LR_INPUT1 ).

LR_CONTAINER->ADD_CHILD( LR_LABEL2 ).

LR_CONTAINER->ADD_CHILD( LR_INPUT2 ).

LR_CONTAINER->ADD_CHILD( LR_BUTTON ).

endmethod.

I am getting the following error when i test this appl.

The following error text was processed in the system NSP : WebDynpro Exception: IDs Can Only Contain Characters of Syntactical Character Set

The error occurred on the application server PRAHLADA_NSP_00 and in the work process 0 .

The termination type was: RABAX_STATE

The ABAP call stack was:

Method: RAISE of program CX_WD_GENERAL=================CP

Method: CONSTRUCTOR of program CL_WDR_VIEW_ELEMENT===========CP

Method: CONSTRUCTOR of program CL_WD_INPUT_FIELD=============CP

Method: NEW_INPUT_FIELD of program CL_WD_INPUT_FIELD=============CP

Method: WDDOMODIFYVIEW of program /1BCWDY/2GN5ALLJN5OMZS36CS81==CP

Method: IF_WDR_VIEW_DELEGATE~WD_DO_MODIFY_VIEW of program /1BCWDY/2GN5ALLJN5OMZS36CS81==CP

Method: DO_MODIFY_VIEW of program CL_WDR_DELEGATING_VIEW========CP

Method: MODIFY_VIEW of program CL_WDR_VIEW===================CP

Method: DO_MODIFY_VIEW of program CL_WDR_CLIENT_COMPONENT=======CP

Method: DO_MODIFY_VIEW of program CL_WDR_WINDOW_PHASE_MODEL=====CP

Accepted Solutions (1)

Accepted Solutions (1)

raja_thangamani
Active Contributor
0 Kudos

You can visit these blogs by Thomas Szues:

[Dynamic Programming in Web Dynpro ABAP - 1|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2888] [original link is broken] [original link is broken] [original link is broken];

[Dynamic Programming in Web Dynpro ABAP - II |https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2915] [original link is broken] [original link is broken] [original link is broken];

Hope this helps

Raja T

Answers (2)

Answers (2)

russell_day2
Participant
0 Kudos

I think the problem here is that the IDs are in lower case. The syntactic character set is upper case A-Z, 0-9, underscore and not much else.

Former Member
0 Kudos

Hi Prahlada Sriyapureddy,

Well, Welcome to DYNAMIC PROGRAMMING IN WDA's...

I have been fighting with these kind of problems for the past 4 days...Error messages are so wierd that they wont even indicate proper reason.

BTW,I think you can fix this error, by mapping these input fields to some existing context elements. I mean,

LR_INPUT1 = CL_WD_INPUT_FIELD=>NEW_INPUT_FIELD( ID = 'RAJA' BIND_VALUE = 'GENERAL_DATA.NUMBER1' ).

Assuming that there is a Context Attribute - NUMBER1 in the Context Node - GENERAL_DATA.

Hope this should close your problem.

Regards

Raja Sekhar

raja_thangamani
Active Contributor
0 Kudos

Raja Sekhar, I knew you will come up with this reply since you had similar issue :).

Raja T