on 11-29-2007 10:59 AM
Hi,
How can I populate/manipulate the data in a table object in a model which has been passed from a bapi?
For example I am creating a customer who can have up to 3 telephone numbers.
The create bapi passes a table object 'Telephone' I need to add all three telephone numbers into the table and pass it back?
Any help appreciated.
Rob
HI Rob,
When you say "passing back" I think you need to run another BAPI for updating...
You fetch the data from R3 (You call BAPI1).
You manipulate the data in Web Dynpro (add, delete, update)
You update the data in R3 (You call BAPI2)
Regards,
Omri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
This is a create.
A user fills in 2 Inputfields with 2 e-mail addresses. I now need to pass this into the table and then execute the bapi.
How do I iterate through rows of the table to populate each e-mail?
//Populate email table object
Bapiadsmtp Email_table = new Bapiadsmtp();
input_crtbp.addE_Mail(Email_table);
Email_table.setE_Mail(wdContext.nodeE_mail_List().currentE_mail_ListElement().getE_mail1());
//Iterate code..............????????????????
Email_table.setE_Mail(wdContext.nodeE_mail_List().currentE_mail_ListElement().getE_mail2());
Hi,
you don't use an Iterator for that.
you can do it in a simple for loop like:
for(int i = 0; i < wdContext.wdContext.nodeE_mail_List().size(); i++){
Bapiadsmtp Email_table = new Bapiadsmtp();
input_crtbp.addE_Mail(email_table);
email_table.setE_Mail(
wdContext.nodeE_Mail_List().getE_mail_ListElementAt(i).getE_Mail1());
//and so on...
}
you are now looping through all rows of your table.
Regards,
Dennis
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();
Hi Rob
i think the prob with ur code is that you are using same Bapiadsmtp object for both E_Mail1 and E_Mail2. which is why i think u r getting two values for E_Mail2.actually the duplicate which u r getting is of E_Mail1 and not that of E_MAIL2.
//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);
}
Deeps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.