Skip to Content
0
Former Member
Dec 05, 2007 at 09:21 AM

Java Web Dynpro. Writing duplicate values to a table

23 Views

Hi,

I've managed to populate the table and execute the bapi but my code is not behaving as I expected...

When I execute this if I populate E_Mail1 and not E_mail2 then the bapi is not executed.

If I populate both E_Mail1 and E_Mail2 then the value in E_Mail2 is written out twice to the table

Any help appreciated

			//Populate email table object
			Bapiadsmtp Email_table = new Bapiadsmtp()			
                          if (wdContext
				.nodeE_Mail_List()
				.currentE_Mail_ListElement()
				.getE_Mail1()
				.length()
				> 1) {
				Email_table.setE_Mail(
					wdContext
						.nodeE_Mail_List()
						.currentE_Mail_ListElement()
						.getE_Mail1());
				input_crtbp.addIt_Email(Email_table);
			}
			if (
				wdContext
						.nodeE_Mail_List()
						.currentE_Mail_ListElement()
						.getE_Mail2()
						.length()
						> 1) {
				Email_table.setE_Mail(
					wdContext
						.nodeE_Mail_List()
						.currentE_Mail_ListElement()
						.getE_Mail2());
				input_crtbp.addIt_Email(Email_table);
			}
			
			//Execute bapi
			wdContext
				.currentZbapi_Bupa_Create_InputElement()
				.modelObject()
				.execute();