cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic file configuration

former_member303666
Active Participant
0 Kudos

Hi,

Requirement

scenario is file to i doc

File naming format is : XXXXXXXXXX-YYYYMMDD-HHMMSS-ZZZ

XXXXXXXXXX LS name

ZZZ Millisec value of Current Time Instance

YYYYMMDD-HHMMSS time stamp

i know the adding the time stamp but this requirement is quite different..

Thanks and regards,

Kesava.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

File naming format is : XXXXXXXXXX-YYYYMMDD-HHMMSS-ZZZ

might be its helpful for ur requirement:

udf1(GetReceiverPartner) +constant(-) + concat ->udf2(GetTimestamp) -> concat->target node.

udf1(GetReceiverPartner):

String GetReceiverPartner(Container container) throws StreamTransformationException{

String var1 = "";

String var2 = System.getProperty("SAPSYSTEMNAME");

if(var2.equals("dev"))

var1 = "sys name";

if(var2.equals("Qua"))

var1 = "sys name ";

if(var2.equals("Pro"))

var1 = "sys name";

return(var1);

.................................................

udf2(GetTimestamp):

String GetTimestamp(Container container) throws StreamTransformationException{

String DATE_FORMAT_NOW = "YYYYMMDD-HHMMSS-SSS";

Calendar cal = Calendar.getInstance();

SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);

return sdf.format(cal.getTime());

note: import package: java.text.SimpleDateFormat

Former Member
0 Kudos

Dear Kesava

YOur question is not quite clear, Can you elaborate on following point:

Do you need to pass the file name to any of the fields of IDoc?

Sourabh

former_member184681
Active Contributor
0 Kudos

Hi Kesava,

Go for Variable Substitution to get the receiver system name (either as the sender/receiver system, or from message payload). You can read more about the VS here:

http://help.sap.com/saphelp_nwpi71/helpdata/en/44/6a316af5a23672e10000000a114a6b/content.htm

And use the timestamp as you know it in parallel with Variable Substitution to achieve your goal.

Hope this helps,

Greg