Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

FTP Connect

Former Member
0 Likes
3,699

Hello Experts,

I am using FTP_CONNECT Functional Module in 7 to 8 programs for different purposes from FTP. so in all the programs i hard coded user name, password and host name. I want to make these three dynamic. and that should run in back ground process.

Give some suggestion how to make FTP user name, password and host name dynamic. and all the programs should take the same user name, password and host name and any time if we want to change any thing like password or host name we can change without touching the program.

Thanks

Sunita

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,561

Hi Shaik,

I created parameter Id as ZFTP_HOST, ZUSER_NAME, ZUSER_PWD. Then I created 3 data elements where in paramete Id i mentioned the above 3 parameters. Then in my program  i written the below code.

PARAMETERS: USER(30) TYPE C LOWER CASE MEMORY ID ZUSER_NAME,
             PWD(30) TYPE C LOWER CASE MEMORY ID ZUSER_PWD ,
             HOST(64) TYPE C LOWER CASE MEMORY ID ZFTP_HOST.

Then also its not working. Pls suggest.

Thanks

Sunita

Hi Shaik,

I created parameter Id as ZFTP_HOST, ZUSER_NAME, ZUSER_PWD. Then I created 3 data elements where in paramete Id i mentioned the above 3 parameters. Then in my program  i written the below code.

PARAMETERS: USER(30) TYPE C LOWER CASE MEMORY ID ZUSER_NAME,
             PWD(30) TYPE C LOWER CASE MEMORY ID ZUSER_PWD ,
             HOST(64) TYPE C LOWER CASE MEMORY ID ZFTP_HOST.

Then also its not working. Pls suggest.

Thanks

Sunita

25 REPLIES 25
Read only

Arun_Prabhu_K
Active Contributor
0 Likes
3,561

Hello Sunita.

How about making the fields username and password as user input fields in all the programs?

Hostname you can get it via function module SCUT_GET_CLIENTHOST.

You can set the data for these fields (username and password) as variant for running the programs in background mode.

Regards.

Read only

Former Member
0 Likes
3,561

Hi,

Create a Z table with the required fields.

Also create a table maintenance generator for the same.

Maintain login credentials etc in this table.

In your program write a select query and get the data from this table for FTP_CONNECT.

Read only

Former Member
0 Likes
3,561

Hi Arun,

I think that variant will be deleted when we will restart the server.

and if i m saving it in variant when i m opening next time that T.Code that data is not coming automatically.

Read only

0 Likes
3,561

Sunita,

     I am not sure why variant should get deleted on restarting the server.

     For a tcode executing in foreground, default variant cannot be set. You have to choose the variant and then execute.

     Whereas for scheduling a program in background mode, it can be made to execute with specified variant.

Read only

Former Member
0 Likes
3,561

Hi,

Create a Z-table and create Table Maintenance Generator(TMG) for it so that you can maintain the details whenever the Password changes.

Also for running it in Background, the rfc destination should be SAPFTPA.

Regards

Sajid Shaik

Read only

Former Member
0 Likes
3,561

No we cant create tables.. Give any other suggestion. Thanks

Read only

0 Likes
3,561

Dear Sunita,

The other Method would be to create parameters and assign the values to these parameters in SU01 for the users who are going to use the program.So values would come dynamically for that user.

However the disadvantage here is you need to maintain it for many users and if password changes then you need to change the parameter value for all these users.

In my view, Ztable would be best. So that maintainability of the values would be easier.

Regards

Sajid Shaik.

Read only

Former Member
0 Likes
3,561

Hi Shaik,

I created Parameters as user and pwd in my program. But in SU01 in which parameter Id we have to assign. User and pwd is not in list of parameter ID.

Thanks.

Read only

0 Likes
3,561

Dear Sunita,

Go through the following Link for creation of Parameter ID

http://scn.sap.com/thread/1034187

Assigning Parameter id is as shown in below screen shot.

Regards

Sajid

Read only

Former Member
0 Likes
3,562

Hi Shaik,

I created parameter Id as ZFTP_HOST, ZUSER_NAME, ZUSER_PWD. Then I created 3 data elements where in paramete Id i mentioned the above 3 parameters. Then in my program  i written the below code.

PARAMETERS: USER(30) TYPE C LOWER CASE MEMORY ID ZUSER_NAME,
             PWD(30) TYPE C LOWER CASE MEMORY ID ZUSER_PWD ,
             HOST(64) TYPE C LOWER CASE MEMORY ID ZFTP_HOST.

Then also its not working. Pls suggest.

Thanks

Sunita

Read only

0 Likes
3,561

Dear Sunita,

All you need to do is -

1. take SM30 and give table name as TPARA and create 3 Parameters .

2. Take SU01 and as given in the above screen shot maintain the values for 3 parameter ids.

Regards

Sajid

Read only

0 Likes
3,561

Hi Shaik,

Yes I created these three parameters in SM30. and assigned in SU01.

But how to pass in FTP_connect functional module?

Thanks

Sunita

Read only

0 Likes
3,561

Hi,

By defining the parameters in the selection screen of Program.

Once you have declared the parameters in the Program. Just test it once.

When you run the program, the values will get filled automatically .

Regards

Sajid

Read only

0 Likes
3,561

Its not working, User name and password is not fetching from there.. What to do for that?

Its showing an error message as

Invalid FTP handle

Message no. 04206

Read only

0 Likes
3,561

Dear Sunita,

Its working in our system.

send me the screen shot of su01.

Also are you executing it in the same client and with same user id (which was used in SU01).

Regards

Sajid

Read only

Former Member
0 Likes
3,561

Hi Shaik,

I have attached the image how we maintained in SU01. Yes i have maintained this for same client and same user ID.

Read only

0 Likes
3,561

Dear Sunita,

you have maintained correctly in Su01.

May be the parameter ids are maintained differently in your program.

PARAMETERS: USER(30) TYPE C LOWER CASE MEMORY ID ZUSER_NAME,
             PWD(30) TYPE C LOWER CASE MEMORY ID ZUSER_PWD ,
             HOST(64) TYPE C LOWER CASE MEMORY ID ZFTP_HOST.

It should be

PARAMETERS: USER(30) TYPE C LOWER CASE MEMORY ID Z_NAME,
             PWD(30) TYPE C LOWER CASE MEMORY ID Z_PWD ,
             HOST(64) TYPE C LOWER CASE MEMORY ID Z_HOST.

Regards

Sajid

Read only

0 Likes
3,561

Like this also I tried but its not working.  Give some idea...

Read only

0 Likes
3,561

Dear Sunita,

All the steps done are correct. I have no idea why its not working for you 😞

Regards
Sajid

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
3,561

The SPA/GPA Ids are relevant for all the sessions of a particular user.

So if i maintain these params for Shaik & try to run the report using Sunita's user will this work?

- Suhas

Read only

0 Likes
3,561

Dear Suhas,

If the parameters are not maintained for user Sunita then it wont work(does not matter if its maintained for other users).

Regards

Sahik

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
3,561

If you understand that, then what was your rationale in proposing a solution which will only work for a single user?

Read only

Pawan_Kesari
Active Contributor
0 Likes
3,561

You can create and store variables in table TVARVC using transaction STVARV. Then use them in your program. Values can be maintained separately without accessing your program.

Regards,

Pawan.

Read only

0 Likes
3,561

thanks every one.. Its working now.....

Read only

0 Likes
3,561

HI sunita..

Please help me. I got the same requirement. I have to download the data in the background from application server to presentation server.  I already uploaded the data to the application server. but I want to downlod the data from there. I saw in my forums. this can achive through the FTP concept. But I don't have an idea about FTP concept. how did you achive this? can you share related documetns.  its very urgent for me...