Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Static and Dynamic Context

Question 1. I have created a static value node say vn_static. At run time, based on some condition i want to add dynamic value attributes say va_dynamic1, va_dynamic 2 etcs... What is the code to create a dynamic value attribute to my static value node?

Question 2. I have a drop down list that i created dynamically based on the Function module's output as shown in below code. Now user selects a value from this drop down list and i want to retrieve that user selected value from the drop down on button action. What is the code to retrieve the value?

 IWDNodeInfo rootNodeInfo = wdContext.getNodeInfo();
					IWDNodeInfo configNodeInfo =
						wdContext.getNodeInfo().addChild(
							"vn_DynamicDDnode" + firstLoop,
							null,
							true,
							true,
							false,
							false,
							false,
							true,
							null,
							null,
							null);
					configNodeInfo.addAttribute(
						"va_config",
						"ddic:com.sap.dictionary.string");
					IWDNode configNode =
						wdContext.getChildNode(
							"vn_DynamicDDnode" + firstLoop,
							0);
					IWDNodeElement configElement = configNode.createElement();
					configElement.setAttributeValue("va_config", new String());
					configNode.addElement(configElement);
					IWDDropDownByKey iwdDD1 =
						(IWDDropDownByKey) view.createElement(
							IWDDropDownByKey.class,
							null);
					ISimpleTypeModifiable config =
						wdThis.wdGetAPI().getContext().getModifiableTypeOf(
							"vn_DynamicDDnode" + firstLoop + ".va_config");
					IModifiableSimpleValueSet configValues =
						config.getSVServices().getModifiableSimpleValueSet();
					configValues.put("", "");}

Appropriate answer to either 1 or both the questions will be rewarded with maximum points.

Thanks.

Former Member replied

Hi,

The type of the newly created attribute should be "ddic:com.sap.String".

Regards,

Murtuza

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question