cancel
Showing results for 
Search instead for 
Did you mean: 

how to delay the processing of file adapter in append mode..?

former_member208396
Participant
0 Kudos

Hello Experts,

I have a requirement of IDocs to file(FCC) scenario in which SAP PI 7.3(single stack) will receive IDocs from ECC system and will write to text file as CSV format. In this scenario we have to use only one file and need to append data to same file for which I have used append mode in receiver file adapter.

But this is working fine for only one record in IDocs. If suppose one IDocs contains same multi segments and all these segments needs to be written to file at the same time in append mode then it is taking only 1st record and skips all other records.

Below is the example..

IDoc--

-- Segment1

     -value1

     - value2

-- Segment1          --(segments1 is repeated)

     -value1

     -value2

Required File format--

value1,value2

value1,value2

Current file format-

Value1, value2               --- (from 1st segment1)

In above example all the records in segment1(both) needs to be written in file in append mode. Since "segment1" is repeated in same IDOC so file adapter need to process it in one go with append mode which it not able to do

So is it possible for receiver file adapter to delay processing in append mode..??

Please help...!!

Regards,

Vishnu Srivastava

Accepted Solutions (1)

Accepted Solutions (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Vishnu,


So is it possible for receiver file adapter to delay processing in append mode..??

In your file receiver under Run OS Command Before Message Processing, try entering sleep 5 (for Unix) or timeout 5 (for Windows). It will make the receiver adapter sleep for 5 seconds.

Regards,

Mark

former_member186851
Active Contributor
0 Kudos
former_member208396
Participant
0 Kudos

Hello Raghu,

Thanks fro your reply. I have tried using ufd in between starting node of IDOC(IDOC) & starting node of receiver  datatype(MT_IDOC_TO_FILE_INBOUND) but issue still persist. Still I can see only one record in file though I have multiple repeated nodes in IDocs.

Please suggest.

Regrds,

Vishnu Srivastava

former_member208396
Participant
0 Kudos

Hello Mark,

Thanks for your prompt response..!!

As I dont have access to any drive of server on which SAP PI is installed. So I can go with this option.

Will writing "5" in option "timeout(secs)" under Run OS Command Before Message Processing work here..?

Regards,

Vishnu Srivastava

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Vishnu,

If you are sure that your OS is Windows it would work. Unix uses sleep

Regards,

Mark

former_member208396
Participant
0 Kudos

Hello Mark,

Yes I can see in channel logs that command line is executed successfully but I can't see delay in in message processing( tried with both "sleep 5" & "timeout 5"). PFA the screenshot.

Regards,

Vishnu

maheswarareddykonda
Active Contributor
0 Kudos

Hi ,

Your screen shot seems that , that command line able to process file 5sec delay.

please check

also increase the number and see again..will find difference

Former Member
0 Kudos

Sleep only works in a batch file. There are a number of well known "hacks" that can be used in a command prompt to block for a specified number of seconds. Some examples are:

Example 1

timeout 5 >nul


Example 2

ping -n 5 127.0.0.1 > nul

These may/may not work depending on your Windows version.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Vishnu,

Are you sure timing is the issue? Can you post your receiver FCC configuration for us to review?

Regards,

Nick

former_member208396
Participant
0 Kudos

Hi Nick,

PFA the requested info. Please let me know if you require any further info. Thanks.

Regards,

vishnu

former_member208396
Participant
0 Kudos

Hi Nick,

Please find the attached screenshot in which I can see the delay but not on required place.

Green area should be in delay to achieve this condition whereas I am getting delay in red area after providing "sleep 5" command in command line before message processing.

Regards,

Vishnu

Former Member
0 Kudos

Ok so I assume your mapping produces an output type with repeating node Details that is mapped from the repeating segment in the source IDOC? Do you have a screenshot of that mapping?

Before trying OS commands you need to ensure that the mapping is functioning properly. Also the processing log won't pick up any stderr/stdout from the OS command since it doesn't block.

former_member208396
Participant
0 Kudos

Hello Experts,

Any suggestions plss..

Regards,

Vishnu

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Vishnu,

Have you tried thread.sleep(5000); as suggested in an earlier reply?

Regards,

Mark

former_member186851
Active Contributor
0 Kudos

Hello Vishnu,

Try increasing the timeout in OS command or use NWBPM or Bypass Scenario(both require additional development time).

former_member208396
Participant
0 Kudos

Hello Mark,

I tried with this option as well also able to see processing delay but again receiver channel is unable to append multi records at a time. PFA the screenshot.

The delay is in area marked in red but requirement is to get delay in area which is marked in green.

Also in this scenario I am using multi receivers concept so I used UDF in mapping which is used to determine receivers. PFA

Have tried using same UDF in main mapping also but same result.

Please suggest.

Regards,

Vishnu

former_member208396
Participant
0 Kudos

Hi Raghu,

I tried increasing the timings also. But again the same issue. I need message delay after every record while its getting fetched by receiver channel but somehow it is not happening .

Also, Our customer does not have BPM installed as of now, So can't go with these options.

Regards,

Vishnu