cancel
Showing results for 
Search instead for 
Did you mean: 

User defined function for removing wrong data ... !!!

Former Member
0 Kudos

Hi Experts,

I'm having a source data like this

1001 545 6895895 1584 654 5478

1002 525 6895895 5084 654 5472

1003 535 6895895 0584 654 5478

1004 545 6895895 5184 654 5478 4XXX &^%% 1004 545

1005 555 6895895 5824 654 5478 8547 0000 522# ##00

1006 565 6895895 5844 654 5478

1007 575 6895895 5845 654 5478

1008 585 6895895 5846 654 5478

Some times I get a wrong data in my source file (above 4 and 5 th rows) .

My requirement is to remove these kind of wrong lines(entire lines to be removed) whenever XI reads the data. For this what is the standard function i can use in mapping. I thought I can create my own function to remove such kind of false data lines. It would be helpful for me if some body provide me the java code.

Thanks very much.

Accepted Solutions (1)

Accepted Solutions (1)

jyothi_anagani
Active Contributor
0 Kudos

Hi Swarna,


1001 545 6895895 1584 654 5478
1002 525 6895895 5084 654 5472
1003 535 6895895 0584 654 5478
1004 545 6895895 5184 654 5478 4XXX &^%% 1004 545
1005 555 6895895 5824 654 5478 8547 0000 522# ##00
1006 565 6895895 5844 654 5478
1007 575 6895895 5845 654 5478
1008 585 6895895 5846 654 5478

is it the .txt file you are keeping. Or the input in your mapping.

You just Tell your requirement properly.

If it is input in Mapping. Map like this


input ----->subtring( starting position 0 andNumber of characters 30) ---->Output

substring is a standard Text function.

Thanks.

Former Member
0 Kudos

Yes, source is txt file with tabular data format.

Thanks.

jyothi_anagani
Active Contributor
0 Kudos

Hi Swarna,

Then you can use those using FCC parameters. Using field.ignoreAdditionalFields .

Thanks.

Former Member
0 Kudos

Hello Jyothi,

Thanks.

Can you please elaborate your advise? i mean FCC? Field ignore func?

Also data to be updated into sap ecc system. I have created 3 z tables in target system. So, now am not in a position to decide which adapter to use either ABAP Proxy or RFC.

If I go with an RFC adapter then rfc connection should be established XI to R/3 and then BAPI to be created for data update.

Is there any standard BAPI, using which I can read the data from XI and updates my 3 customized tables in R/3?

Thanks very much.

jyothi_anagani
Active Contributor
0 Kudos

Hello Swarna,

While using FCC you can give this parameter

NameA.additionalLastFields ignore

Check this link...Here you can get more inFormation on This...

http://help.sap.com/saphelp_nw04/helpdata/EN/2c/181077dd7d6b4ea6a8029b20bf7e55/frameset.htm

Thanks.

Former Member
0 Kudos

Excellent. Thats what am looking.

But my other query includes

If I go with an RFC adapter then rfc connection should be established XI to R/3 and then BAPI to be created for data update.

Is there any standard BAPI, using which I can read the data from XI and updates my 3 customized tables in R/3?

Any help?

Thanks.

jyothi_anagani
Active Contributor
0 Kudos

Hi Swarna,

I dont think there is any standard BAPI. You have to write your own RFC.

Thanks.

Answers (2)

Answers (2)

Former Member
0 Kudos

Done.

former_member187339
Active Contributor
0 Kudos

Hi,

If source length is same then check for length and if the value is more than that just ignore.

else try this logic

node = node.replaceAll(" ","");

node = node.replaceAll("[^a-zA-Z 0-9]+","#");

now check if node contains '#' ignore the line else select it

Regards

suraj