cancel
Showing results for 
Search instead for 
Did you mean: 

Need Help on Dynamic File Name

former_member200386
Active Participant
0 Kudos

Dear Experts,

I am working on File to File (Pass Through) scenario where no ESR Objects involved.

i need to generate target file like this format.

if Source file  name is like this 123.txt  then i need to create  my target file name like this  123.txt.pgp.

Please advise me.

Thanks & Regards,

Pavan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Answers (3)

Answers (3)

rohitjagtap_it51
Discoverer
0 Kudos

4 Steps to achieve this.. what we are going to do is.. first store the actual original file name (123.txt) in a variable using Dynamic Configuration Bean... then save this value in another variable using variable substitution... and finally we will just append .pgp to this variable... so final result will be 123.txt.pgp

Add the DynamicConfigurationBean as follows:

Configure the parameters:

Add variable substitution:

Use the variable in your file name:

abhradeepbasu
Participant
0 Kudos

Hi Pavan,

Yes, you can use operating system cmmand after message processing in your file adapter.

Rename <Old file name> <New file name>

OR

Ren <Old file name> <New file name>

former_member200386
Active Participant
0 Kudos

Hi Abhradeep Basu,

Thanks for the response i tried to run OS command at my sender file channel(NFS) before message processing.

my source file name is sf_out_*.txt

my desired file name sf_out*.txt.pgp

i write my command like this

Renamesf_out_*txtsf_out*.txt.pgp

&

Rensf_out*txtsf_out_*.txt.pgp

both are not working.

Please provide your inputs.

Thanks & Regards,

Pavan

gagandeep_batra
Active Contributor
0 Kudos

Hi pavan

did you give space between command also?

give like blow:

cmd.exe "Ren sf_out*.txt sf_out_*.txt.pgp"

Regards

Gagan

former_member200386
Active Participant
0 Kudos

Hi Gagan,

Thanks for the prompt response. I tried as you said. But no use. Still i am getting my output file name as .txt only.

i have gone thru this below link. in this link it is mentioned that we need SAP_XI_CONFIG_FILE_OS_CMD_J2EE role to assign OS command. But this link is for PI7.3 EHP 1. My PI version is 7.3 SP5. i checked the role but does not exist in my PI server.

Thanks & Regards,

pavan

iaki_vila
Active Contributor
0 Kudos

Hi pava,

Check this wiki http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=272171407

If you only need to change the extension i would use an OS command in a way similar that the wiki mentioned.

Regards.

former_member200386
Active Participant
0 Kudos

Hi Inakai,

Thanks for the prompt response. I have gone through your suggested link.

All options not possible.

I can't run OS command  hence i am using SFTP adapter at receiver end.

I can't write UDF ( no ESR involved).

  Please find the screen shot of source file format.

STATUS;USERID;USERNAME;FIRSTNAME;LASTNAME;MI;GENDER;EMAIL;MANAGER;HR;DEPARTMENT;DIVISION;LOCATION;TIMEZONE;HIREDATE;EMPID;TITLE;BIZ_PHON;FAX;ADDR1;ADDR2;CITY;STATE;ZIP;COUNTRY;MATRIX_MANAGER;DEFAULT_LOCALE;PASSWORD

Active  ;SF8000007                     ;DOBRD0007                     ;David                                   ;Dobraszkiewicz                          ;                                        ;M;


every field is "; " separated.

I  have one approach in my mind. Kindly suggest the possibility.


I will create a data types contains 1 filed(0.unbound) and i will pass the data as a string. then i will perform mapping (includes UDF for my Dynamic name).

at receiver end i will use Content conversion. (SFTP with Content Conversion).

Is this possible?

I will pass this data in

Thanks & Regards,

pavan

iaki_vila
Active Contributor
0 Kudos

Hi Pavan,

Yes, it's possible your approximation with ASMA configuration. Check this thread http://scn.sap.com/thread/3195212 because there are some things that you need to configure for avoid problems, as Gred suggestion if you are using the advantco adapter.

Regards

former_member200386
Active Participant
0 Kudos

HI Inaki,

Thanks for the prompt response. I am stuck st receiver SFTP  side. SFTP adapter doesn't support file content conevrsion directly.

We need to use Module Configuration to convert the data into fcc format.

i need to use these below FCC parameters

Fields.end Seperator ‘nl’

Fields.fieldSeperator'nl'

Fields.fieldNames Message.

How can add this below parameters in my SFTP comm channel?>

Thanks & Regards,

pavan

iaki_vila
Active Contributor
0 Kudos

Hi Pavan,

Have you tried with the adapter module MessageTransformBean?

http://help.sap.com/saphelp_nw04/helpdata/en/24/4cad3baabd4737bab64d0201bc0c6c/content.htm

Regards.

former_member200386
Active Participant
0 Kudos

Hi Inkai,

Thanks for the response. I developed my scenario. While i am testing the interface i am getting the below error.

SAP:Stack>Runtime exception occurred during application mapping com/sap/xi/tf/_MM_SuccessFactor_Outbound_PGP_File~; com.sap.aii.utilxi.misc.api.BaseRuntimeException:Content is not allowed in prolog.</SAP:Stack>

<SAP:Retry>M</SAP:Retry>

i searched SDN  and made changes according to this below blog

http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/08/16/the-mystery-of-content-is-not-all...

but still error persists

Thanks & Regards,

Pavan

former_member184789
Active Contributor
0 Kudos

Hi,

You can have a Java mapping in place with dummy service interfaces. In the mapping append the desired extension to your file name.

https://wiki.sdn.sap.com/wiki/display/XI/Sample+JAVA+Mapping+code+using+PI+7.1+API

former_member200386
Active Participant
0 Kudos

Hi Adarsh,

can't i achieve this using OS command at Sender File channel(NFS). ?

i can see Run OS command options(after & before processing)

i am using run OS command to at sender File channel(NFS) rename the File name Before processing.

Ant body can provide me the syntax to rename the file

my source file name will be like this sf_out_201209281006.txt

i need to write a OS command to add .PGP extension to my source file name before processing

sf_out_201209281006.txt.pgp

Thanks & Regards,

Pavan

former_member200386
Active Participant
0 Kudos

Hi Adarsh,

I have gone through your suggested link. Can you  please guide me how can i achieve my requirement using dummy service interface.

The jave code is for PI 7.1 but we are using PI 7.3 sp5. do i need to change the code?

then what will be my design plan?

please provide me your valuable inputs.

Thanks & Regards,
pavan