cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Counter value in Header level in daily basis

Former Member
0 Kudos

Hi Experts,

I am sending transactional data from ECC to Third party using file.Here we are sending initial load files and incremental files.by differentiating these two file have to check the flag field.if flag filed value is coming as YES it is initial load and if it is NO then it should be incremental file.here customer asking add counter value as header for incremental files in daily basis. Per day we should get multiple incremental files at the time we should add '1'  as header and next row we will populate the actual data. it keep on increasing the count value for header if incremental data is coming. please find the below example,

EX:

1. DAY 1 we have to generate 5 incremental files, for all 5 files header value should be '1

'file1:

1

1000|AAA

'file2:

1

1001|BBB

.

.

.

'file5:

1

1001|FFF

2. DAY 2 we have to generate 5 incremental files, for all 5 files header value should be '2'

'file1:

2

1000|AAA

'file2:

2

1001|BBB

.

.

.

'file5:

2

1001|FFF

Per day wise it has increase the header counter value like 1,2,3,........keep on increase daily basis.

here my scenario should be Proxy to file(FCC).

Appreciate your help.

Best Regards,

Sanjay.

Accepted Solutions (1)

Accepted Solutions (1)

ambrish_mishra
Active Contributor
0 Kudos

Hi Sanjay,

Can you get the run date from ECC in the proxy structure. If yes, then the solution can be worked out.

Ambrish

Former Member
0 Kudos

Hi Ambrish,

Thanks for your reply. we are not getting run date from ECC, If run date is come then how we can be achieve this in PI level i mean how to pass the sequence number on daily basis. Please provide the complete solution.

Thanks in advance.

Best Regards,

Sanjay.

ambrish_mishra
Active Contributor
0 Kudos

Hi Sanjay,

This is what I can think off at the moment without the run date.

For this solution, we need to store the value of sequence number. It can be a table or a property file.

Lets assume it is a table.

When you get the flag as Y for the initial load, you go and check the table if date exists already. If not, then you populate the current date and assign number 1 to the entry. This will happen for the initial load. When an incremental load happens, you go with current date and refer this table, if it matches, get the sequence number and populate in the data. So the incremental load will pick the value 1 on the first day's run

Your query is not clear if initial load will happen again the next day.I assume it is not going to happen daily which looks logical to me.

Now on the interface run the next day.

When an incremental load happens, you go with current date and compare with date in the table.it will not match, then update the number as n+1 and read the number and populate in the target side.

Simple!

Now coming back to how you can implement this solution. It can be done by an RFC call. The table can reside on ABAP stack of PI or ECC.

Hope it helps!

Ambrish

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Best way to handle it using RFC,d/b look up,file look up (not preferable)

We can also handle it by java code(UDF) as below .

for example from today you are making interface to run in PROD .

1)set today's date as reference and populate (difference b/w today's date and 9/06/2014 ) +1 value as counter value .

But there is a constraint here for example

Today Interface ran ,counter =1

Tomorrow Interface ran counter =2

Day after Tomorrow  Interface not ran

4th day Interface ran ,counter =4 ...

Make sure your client is OK with the above logic .If he is not then go for RFC or d/b look up.

Regards

Venkat

Former Member
0 Kudos

Hi Venkat,

Thanks for your reply. is there any chance to store the values in Global container and get the values for each run by writing UDF. if it is possible please provide me the code.

Thanks in advance."

Best Regards,

Sanjay.

Former Member
0 Kudos

Hi,

Sorry it's not possible to store at run time.It will get vanish when the transaction is completed.

You need to store the values by using either RFC,SOAP,d/b or file look ups.

Regards

Venkat

ambrish_mishra
Active Contributor
0 Kudos

Sanjay,

Go through the solution provided. It will work and suffice your requirement.

Ambrish