cancel
Showing results for 
Search instead for 
Did you mean: 

checking amount sum in file body

Former Member
0 Kudos

helo all

here i got problem with my scenario.

in my scneario iam processing file to bapi.

before processing i need to check the amount present in file body and to compare with trailer sum if both r same then i need to set flag of bapi to yes otherwise it should be no.

but while iam checking the decimal amount values in body its chowing some difference.

i got the sample file anf i checked the sum it should be 5043.4 but the sum (statistic function) was shown like 5043.444 but when i sum it manually its fine.

so what i have to do to solve this issue.

waiting for u r response.

bye.

regards.

seeta ram.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

hi.

after checking that file i have to process th data of sender file to recievr bapi anfd at the same time i have to send the sender file as it is to the reciever directory.

but here i send the file to bapi and reciever file directory using rfc and file adapter.

but what my confusion is when i resend the same file the recier rfc and file adapter CCS are saying like they recievd the data from the same file again .

after that i checked the bapi but its data is not duplicated and y the reciever file adapter cc is recievd the same file even though the bapi has not recieved the same file contents.

waiting for your great answer.

bye.

regards.

seeta ram.

Former Member
0 Kudos

This issue was raised earlier by the same person and was given proper guidance.

regards

krishna

Former Member
0 Kudos

hi krishna.

but my question was not solved at that time.

so i need to clarify it again.

is there any thing wrong with me.

cheers man.

regards.

seeta ram.

Former Member
0 Kudos

seeta ram

Now, dont you see the same set of solutions re-appearing?

If it didnt solve the problem, why dont you use the same thread . It would save the time of other SDNers and also will help you get closer to where you would like to get.

regards

krishna

P.S The fix has already been pointed out. Only you have to implement the fix and make it work. We are here to help you if your are facing any problems while applying the fix but if you don't go anywhere close to applying the fix, it would be hard for us to help you in this regard.

Message was edited by:

Krishnamoorthy Ramakrishnan

Former Member
0 Kudos

hi krishna.

iam sorry i forgot to continue on the same thread.

any way thanks for u r suggestion.

i will not troube u next time.

bye.

regards.

seeta ram.

Former Member
0 Kudos

seeta ram,

No probs. I didnt get troubled. I just felt that i should point it to you.

Cheers

regards

krishna

Former Member
0 Kudos

I stick a number format in ##########.#

before destiantion field.

Works for me

Former Member
0 Kudos

Hi thanks for u r answer.

but i cont understand what u r saying.

what do u mean by that string format ####################.

waiting for your response.

bye.

regards.

seeta ram.

Former Member
0 Kudos

in the message mapping, in Aritimetic - there is an option - NumberFormat, where you can specify the number format (like in Excel).

#####.### = 12345.678

#####.## = 12345.68

#####.# = 12345.7

Once you have the correct decimal places, you can then compare the amounts.

Former Member
0 Kudos

hi .

thanks for your answer.

but what i have to do with that number format.

can u help me on that.

iam expecting an excallent answer from you.

cheers.

seeta ram.

Former Member
0 Kudos

hi.

this is my sample file

HEADER|28062007|COJ

BODY|123565131|100.05

BODY|133565122|1830.15

BODY|143565513|160.00

BODY|153565814|28345.85

BODY|122565915|220.00

BODY|123565016|41259

BODY|125565817|162.05

BODY|131565218|220.00

BODY|132565149|28.05

BODY|134565170|2213.10->amount

BODY|136565192|198.05

BODY|137565138|128.10

TRAILER|12|74864.4->totamt

see here i have tocheck the sum of amounts in body with totamt in trailer.

i checked the amount with sum(statisticalfunction) by amount->formatnumber(00000.00)->sum and i compered with totamt(trailer)->formatnumber(00000.00).

but the sum is 74864.39 and totamt is 74864.40.

how can we solve it.

waiting for u r answer.

bye.

regards.

seeta ram.

Former Member
0 Kudos

hi.

i did in the way what u said.

but its not working .

can u help e in explaining it briefly.

waiting for u.

bye.

regards.

seeta ram.

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

try this remedy :

/people/thorsten.nordholmsbirk/blog/2006/08/25/new-arithmetic-and-statistical-functions-in-message-mappings-in-sp18

or use Thorstens approach from this previous blog

Regards,

michal

Former Member
0 Kudos

hi michal.

i have seen u r link but.

here iam using statitcal function amont(body field)->SUM(statistic function->checked with traailer totamt field .

after importing xml from sender i tested in design and i look at SUM(display queve)anf its showing false there.

so how we can set it as true for decmal values.

u r answer will be appreciated.

bye.

regards.

seeta ram.

Former Member
0 Kudos

hi seeta,

Applied SAP Note 958486 concerning Arithmetic and Statistic function returning wrong result in message mapping. This note will solve rounding errors.

Regards,

Ramesh P

Former Member
0 Kudos

hi ramesh.

so u want me to search for a note in sap service.com

is it ?

regards.

seeta ram.

Former Member
0 Kudos

hi ramesh.

i look ar sap note 985486 but it doesnt gave any solution there the note was saying about java packages and all to import but iam using graphical mapping here and some statistical functions .if this is the case then how the sapnote is going to help me.

i wil be waiting for u r ranswer.

bye.

regards.

seeta ram.

henrique_pinto
Active Contributor
0 Kudos

Read the note again.

And the proper note # is 958486.

Regards,

Henrique.

Former Member
0 Kudos

yeh i did reading that note but that is not a proper solution and the other thing is here in my scenario iam using graphical mapping ,in that sapnote they had given about java packages and patches to download.

so can u give me the exact and clear solution to me.

waiting for u r answer.

bye.

regards.

seeta ram.

prabhu_s2
Active Contributor
0 Kudos

i havent read that note but as pointed when appyling these patches (corrections) u would turn to get a result as expected.

Former Member
0 Kudos

hi.

accoridng to you it may be correct but i dont know how to download these patches and packages.

can u look at that note and help me.

waiting to u.

bye.

regards.

seeta ram.

prabhu_s2
Active Contributor
0 Kudos

check with ur BASIS as they can help u in applying these patches.

Former Member
0 Kudos

hi michal.

i checked your blog but it doesnt help.

so can u expalin me how to create udf for counting sum of amounts in file body.

already i created a udf bit it was asking to import the required packages but i coulnt provide at that time bcos i dont know how to deal with udf.

waiting for your response.

bye.

regards.

seeta ram.

Former Member
0 Kudos

hi michal.

wat r the patches that i want the basis to apply for.

waitingfor your response.

cheers.

seeta ram.