cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamicly fill Standard Simple Types with JDBC

Former Member
0 Kudos

Hi all,

Can somebody tell me if it is possible to fill a standard greated simple type by using JDBC connection.

I have created a simple type in the dictionary part of the developer Studio, but i want to fill the content with a sql statement.

Kind regards,

Richard Middelburg

Accepted Solutions (1)

Accepted Solutions (1)

vijayakhanna_raman
Active Contributor
0 Kudos

Hi,

U can do this by dropdownby key also. but i have used dpopdown by index and i have not checked for key. in dropdownby key bind it to the selected key properties.

check this link to get idea about dropdownby key

http://127.0.0.1:2592/help/index.jsp?topic=/com.sap.devmanual.doc.user/08/13dbfb6e779743bb2ca641ebcb...

Regards,

Vijayakhanna Raman

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Vijayakhanna,

Thanks for your source. Can I do the same with a dropDownByKey?

Kind Regards,

Richard

vijayakhanna_raman
Active Contributor
0 Kudos

Hi Richard,

U can create a simple type in dictionary and change the type of the attribute to simple type and bind to a dropdownbox to display the values similarly the values here are there in the database table and u can set to the dropdown attribute directly, why u want to set to simple type in dictionary.

LetThis is a DropDownBy Index. Create a node Node_sub and Attribute subjectid and bind to it and get the values from the database tabe and display it in the DropDown

try{

InitialContext ctx=new InitialContext();

DataSource ds=(DataSource)ctx.lookup("jdbc/SAPJ2EDB");

Connection con=ds.getConnection();

Statement stmt=con.createStatement();

ResultSet rs1=stmt.executeQuery("select * from TMP_TECHNOLOGY");

while(rs1.next()){

String id1=rs1.getString("SUBJECTID");

IPrivatePermission_Adminview.INode_subElement x=wdContext.nodeNode_sub().createNode_subElement();

wdContext.nodeNode_sub().addElement(x);

wdContext.currentNode_subElement().setPermission_subjectid(id1);

wdContext.nodeNode_sub().moveNext();

}

Let me know weather this works for u

Regards,

Vijayakhanna Raman.

Former Member
0 Kudos