on 09-27-2006 2:50 PM
Hi all,
I tried to send data into R/3 using table input parameter of BAPI.
When I sent one row, sending is succesfull and data are save in R/3, but if I want to send more rows, all rows are filled by the last row of table and this value is save in the R/3
Any idea how I could solve this problem?
Thank
Hi
I think your not proper to capture the table record value.
If u capture the proper value then u should do it correct.
U can do all these things in the Onleadselection of the table.
Check the value when u press the record on the table , if it is correct value is coming or not.
it make sense.
Thanks
Lohi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lohitha M,
exactly I have long text fron TextEdit element.
I must to split this long text to more rows of table (72 chars lenght).
Here is code I used:
temp_NewCommentary - long text
// Create node for binding Table data
Zc4Liv_Bapi_Send_Result_Input input = new Zc4Liv_Bapi_Send_Result_Input();
Zc4Liv_Ln_Ltext commentary = new Zc4Liv_Ln_Ltext();
int modul = 72;
int startPosition = 0;
int endPosition = 0;
if(wdContext.currentContextElement().getTemp_NewCommentary() != "")
{
do
{
startPosition = endPosition;
endPosition = endPosition + modul;
if(endPosition > wdContext.currentContextElement().getTemp_NewCommentary().length())
{
endPosition = wdContext.currentContextElement().getTemp_NewCommentary().length();
}
commentary.setTdformat("*");
commentary.setTdid("9000");
commentary.setTdline(wdContext.currentContextElement().getTemp_NewCommentary().substring(startPosition, endPosition));
input.addIt_Ltext(commentary);
}
while(endPosition<wdContext.currentContextElement().getTemp_NewCommentary().length());
wdContext.nodeZc4Liv_Bapi_Send_Result_Input().bind(input);
I don't know where I have to use Onleadselection statement.
temp_NewCommentary - long text
// Create node for binding Table data
Zc4Liv_Bapi_Send_Result_Input input = new Zc4Liv_Bapi_Send_Result_Input();
int modul = 72;
int startPosition = 0;
int endPosition = 0;
String temp_NewCommentary = wdContext.currentContextElement().getTemp_NewCommentary();
if(temp_NewCommentary != null && temp_NewCommentary.length()>0)
{
int length = temp_NewCommentary.length();
do
{
Zc4Liv_Ln_Ltext commentary = new Zc4Liv_Ln_Ltext();
startPosition = endPosition;
endPosition = endPosition + modul;
if(endPosition > length)
{
endPosition = length;
}
commentary.setTdformat("*");
commentary.setTdid("9000");
commentary.setTdline(temp_NewCommentary.substring(startPosition, endPosition));
input.addIt_Ltext(commentary);
} while(endPosition<length);
}
wdContext.nodeZc4Liv_Bapi_Send_Result_Input().bind(input);
Hi Maksim,
imagine, that I fill the TextEdit element by text with lenght about 160 chars and start execution.
Result is, that in R/3 in the appropriate table there are three new rows, all filled with the end of input string (16 chars).
I think split code is OK (yours code is optimized, but idea is the same as mine), but statement
input.addIt_Ltext(commentary);
or transport to the R/3 ocures that first two rows are rewrited by the last row.
I tried fill the table from predefined field, but it works as bad as the previous part of code.
I need to find way to insert new row into the table and not rewrite all rows by the last sentence.
I read something about this problem in WebDynpro forum (it was about handling tables and add new row into the table), but I can't to find this message
Artax
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.