cancel
Showing results for 
Search instead for 
Did you mean: 

Number range in XI

Former Member
0 Kudos

Hi All,

I have multiple SAP->XI-->3rdParty interfaces running in my system.

They all are IDOC to file.

Requirement is to have the file name based on a common number range for all these interfaces. Currently I was using individual number range in each comm channel of the interface.

Eaxmple:

Number range starts from 0000

When interface 1 runs, its output file name would be 00001.txt.

Then interface 2 runs, and its output file name would be 0002.txt

then the 3rd interface file name would be 0003.txt and so on

So is it possible that all these interfaces will share a common number range.

Regards

Shirin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I think that Increment will happen to that particular Interface only

This will not applicable to all the Interfaces those runs in your Landscape or Server.

REgards

Seshagiri

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

i think only the solution for your requirement for change the file name is using the

"Run Operating System Command After Message Processing".

Using operating system command or unix script to change the file.

The logic is,

Use the same command for all your receivers.

Compare the existing count and rename the new file name.

Like,

you create a file each receivers "xxx.txt","yyy.txt".

First time Non of the counter is there.

so the first file name changed to "0001.txt".

Second time it compare with existing count and rename the yyy.txt to "0002.txt".

Regards,

Prakasu

Former Member
0 Kudos

Hi Prakasu,

Do you know of any OS command to do this.

Regards

Shirin

Former Member
0 Kudos

Solved the problem by using a RFC lookup to R/3.

In R/3 I had maintained a new number range object which is being shared now(via XI) by all the outbout interfaces(receiver adapter).

Many thanks for all the help and suggestions

Shirin

Former Member
0 Kudos

hi,

you can add a field(number required) to the message1 passing to interface1 and hence include the number in output file name through variable substitution. You can have a glance at this concept demo at:

http://saptechnical.com/Tutorials/XI/Variable/substitution.htm

Thanks,

Durga

Former Member
0 Kudos

Hi Durga,

Thanks for the reply. I am aware of variable substitution, but it means I need to have a new field in my IDOC and this will need to be populated in R/3 and then used in XI.

The only reason I want to avoid is because, I am trying to avoid any changes to existing IDOC and XI data structures.

So needed a way without disturbing the existing data structures.

Regards

Shirin

santhosh_kumarv
Active Contributor
0 Kudos

Hi,

You can name a file even without using the variable substution.

Use this UDF to set the FileName parameter. Just enable the option Set Adapter Specific Message Attribute and file name in the receiver file channel.

//write your code here
 DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

String fname = "file" + a +".xml";
conf.put(key, fname);

Use the RFC call to get the sequence number and pass it as a input a to the UDF.

This UDF creates a file with a schema <file><sequence number>.xml.

Thanks

SaNv...

Former Member
0 Kudos

If it is not possible to use number range in XI, is there a way we can get it from R/3 and put this number into the file name.

I know in Message-mapping, through UDF you can do a RFC call to R/3 and get the next number, but here I am trying to get the number in my comm-channel to use it as a file name.

So any other way to do it?

Many thanks

Shirin

santhosh_kumarv
Active Contributor
0 Kudos

If all the interfaces are using the same receiver file channel you can make the File Construction Mode as Add Counter and achieve this.

Thanks

SaNv...