cancel
Showing results for 
Search instead for 
Did you mean: 

Count

former_member10771
Active Participant
0 Kudos

Hi

I have a scenario from IDOC to file where in we are doing a count at the end of the file which is the total number of records . For one IDOC it works fine, but since the file is in append mode how to get the exact count after each append.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

If I am not mistaken then your motive is to count the number of records at the end of file and the file is in append mode, correct?

Now what I can see from my point of view is, you create on additional field "Record_Count" in your target structure and in mapping you count the number of records and map them to this "Record_Count". Now whenever you write your file you will have the number of records at the end of file, so next time when new IDoc will come and append the records in this file then you will have the record count for that IDoc below the first one.

Regards,

Sarvesh

former_member200962
Active Contributor
0 Kudos

Hi,

Are you using a counter function to achieve the logic...if yes then please note that counter functions fails in such cases.....instead use a Static -> index function...for more info on index function refer:

http://help.sap.com/saphelp_nw70/helpdata/EN/43/c4cdfc334824478090739c04c4a249/frameset.htm

also you can search SDN for

Reset Counter

threads...there are many.

Regards,

Abhishek.

MichalKrawczyk
Active Contributor
0 Kudos

Hi Abhishek,

>>>fails in such cases.....instead use a Static -> index function...for more info on index function refer:

how can he use a function if the file (with records) is already in the folder - APPEND MODE ?

Regards,

Michal Krawczyk

former_member200962
Active Contributor
0 Kudos

Hi,

Extremely sorry i missed the Append part :(....took it some other way.....

regards,

Abhishek.

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>For one IDOC it works fine, but since the file is in append mode how to get the exact count after each append.

use sender IDOC apdater packaging:

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/06/d781977e8b40b3ac8e651cae383df5/content.htm

to send all IDOCs (idoc package) to one file at once

(the you will not have this issue as you won't have to do the append)

Regards,

Michal Krawczyk

former_member10771
Active Participant
0 Kudos

Hi,

Thanks for the response. Is there any blog which could help me understand this in detail.

MichalKrawczyk
Active Contributor
0 Kudos

hi,

in WE20 in ERP set idoc package to 50

in XI sender channel - package to 50

XI will receive 50 IDOCs in one file so you don't have to do the append

there is not a lot to understand here

Regards,

Michal Krawczyk

former_member206760
Active Contributor
0 Kudos

Hi Michal,

I dont think Amit should be combining all the idocs in one file ( though i had seen the same in one of the blogs from you/Stefan) because if there are hugh number of idocs the file will be huge

also if the idocs are realtime that collecting them in one file would be different....or am i missing something ?

Hi Amit,

I think your user just needs to veify that number of Idocs left from R3 and number of records in the target file are the same..

what you can do is ....at the end of the day may be you can chk we02/we05 tcode on R3 to chk number opf idocs sent ... and compare it with the number of records in the target file...and this would be a manula activity..

nothing other than this would work...even though you use say a RFC lookup take a count and store it in a Ztable in XI ...you never know .. they can still fail at receiver communication channel...

Michal,

Kindly reply on what do u think