cancel
Showing results for 
Search instead for 
Did you mean: 

problem saving data in backend

Former Member
0 Kudos

HI Experts,

I have 2 UI elements (dropdownbyindex and Textedit) in my application and in dropdown i have 2 values named OPEN and Completed.Intalliy i am entering data in Textedit with OPEN mode from dropdown.

For Ex;

TextEDIT UI:

first line

second line

third line

When click on save button the textedit data had saved in backend with same format line wise.

Backend:

first line

second line

third line

Up to here my application is working fine.Now my issue is when i want to edit the same application like i opened the above data and i changed the OPEN to COMPLETED and without doing anything in the text box and clicking on Save button.Here the data is saving in this below format.

firstline ## secondline ## third line.

but if i entered anything in textbox the data saving perfectly.If i enter SPACE also its working fine .Can any body give me your inputs to solve this problem.

Please help me ...

Regards,

Prasad

Accepted Solutions (1)

Accepted Solutions (1)

former_member197348
Active Contributor
0 Kudos

Hi Prasad,

The data is being converted

first line

second line

third line

into

firstline ## secondline ## third line.

You can handle this. Check this

[ thread|]

Regards,

Siva

Former Member
0 Kudos

Hi siva,

My code working prefectly when i am creating new but the problem is when editing that the previous data at that

time i am facing problem.

Could you please help me out from this issue.

Regards,

Prasad

Former Member
0 Kudos

Hello Prasad,

I have similar requirement in my project.Did you find the solution for this?

Thanks

Vijay

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Prasad

Put External debuging in R/3 and check whether data is pulled according to your requirment or not.

I suppose that validation is coming from R/3 side

please check it.

Thanks

Tulasi Palnati

Former Member
0 Kudos

HI Tulasi and Aishwarya,

thanks for your reply,

I already debug the application the values are not perfectly transfering to backend when i edited the application with out doing anything in textbox. if i entered data in the textbox then its working fine.

Regards,

Prasad

Former Member
0 Kudos

hi

can you provide the code you have written ?

Thanks

Former Member
0 Kudos

Hi Prasad

Please tell me where you are handling the validations?

Former Member
0 Kudos

Hi murali,

This is my code:

int patNotesIndex = 0;
int beginIndex3 = 0;
int endIndex3 = 0;
String text = wdContext.currentContextElement().getFreetext_value(); //Textedit attribute
int length3 ;
try
{
	length3 = text.length();
	
}
catch(Exception e)
{
	length3 = -1;

}
while(beginIndex3 < length3)
{
endIndex3 = text.indexOf("\r\n",beginIndex3);
if(endIndex3 == -1)
endIndex3 = length3;
String line = text.substring(beginIndex3,endIndex3);//get the new line
//start
int strLineLen=line.length();
if(strLineLen>132)//line length > 132
{
for(int i=0;i<strLineLen;i=i+131)
{
Tline patNotesObj = new Tline();
if(i==0)
patNotesObj.setTdformat("*");// line begins
else if(i!=0 && (i+131)<strLineLen)
patNotesObj.setTdformat("=");//intermediate part of the line
else if(i!=0 && (i+131)>strLineLen)
patNotesObj.setTdformat("=");// line finishes	
String strTemp="";
if((i+131)<strLineLen)
strTemp=line.substring(i,(i+131));
else
strTemp=line.substring(i,strLineLen);					
patNotesObj.setTdline(strTemp);
freetext.addTlines(patNotesObj);
Header.add(patNotesIndex,patNotesObj);
patNotesIndex ++;
				
msg.reportSuccess("ftext1"+patNotesObj);
}
beginIndex3 = endIndex3 + 2;
if(beginIndex3 >=length3)
break;
}
//end
else// line with length < 132
{
Tline patNotesObj = new Tline();
patNotesObj.setTdformat("*");
patNotesObj.setTdline(line);
				
freetext.addTlines(patNotesObj);
				
Header.add(patNotesIndex,patNotesObj);
patNotesIndex ++;
beginIndex3 = endIndex3 + 2;
if(beginIndex3 >=length3)
break;
msg.reportSuccess("ftext2"+patNotesObj);
		}
	

Regards,
Prasad		
	}

Former Member
0 Kudos

Hi,

I think null values are getting stored

manipulate your code to exclude null values..

and if the fields take strings you can also put trim() method on it and check its length