cancel
Showing results for 
Search instead for 
Did you mean: 

Java Issue

vijender_p
Active Participant
0 Kudos

Hi All ,

Please help out in the typical issue , my requirement is that i have to send the data to the target system which consist of huge data character of 10000 characters but maximum character to send the data from IDOC is 132 so i have written code in the which it should split the data and merge the data at last .

if(!Text[0].equals("")) 

int len = Text[0].length(); 

int divide = len/132; 

int count =0;

String out = ""; 

int temp = 0; 

if(len%132 == 0) 

result1.addValue(""); 

for(int i=0;i<divide;i++) 

temp = 132*i; 

out = Text[0].substring (0+temp,132+temp); 

result.addValue(out); 

count= count+1; 

if(count>=5) 

result1.addValue(""); 

result.addContextChange(); 

count=0; 

else 

result1.addValue(""); 

for(int j=0;j<divide;j++) 

temp = 132*j; 

out = Text[0].substring (0+temp,132+temp); 

result.addValue(out); 

count= count+1; 

if(count>=divide) 

result.addContextChange(); 

result1.addValue(""); 

count=0; 

result.addValue (Text[0].substring (divide*132, len)); 

else 

result.addSuppress(); 

Correct me if am wrong

Best Regards,

Vijender

Accepted Solutions (0)

Answers (1)

Answers (1)

vijender_p
Active Participant
0 Kudos

Any one have idea ?

Regards,

Vijender

nitindeshpande
Active Contributor
0 Kudos

Hi Vijender,

Your query is asking for validating your code? Your source is IDoc? If your IDoc is sending 132 characters then how can you send 10K characters?

Can you please elaborate a bit on your requirement?

Regards,

Nitin

ravicarpenter
Active Participant
0 Kudos

Hello,

Please elaborate your requirement:

1. Is it some long text you are sending from SAP ?

2. Is it a custom IDoc ?

3. Idoc segments have restrictions but not of 132 characters ?

4. Explain your scenario a bit rather than pasting java code