Application Development 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: 

How can we change filepath dynamically in Variant which is used in standard SAP program and based on this program and variant details, a job will run on daily basis.

Former Member
0 Kudos

Hi Experts,

I have a question as menyioned below:

Scenario is : Application server file path consists of filename which will dynamically change daily based on current system date,

Now i need to use this updated filepath in existing job variant of standard SAP program , Please let me know how to achieve this functionality.

I went through below link but it is mentioned for custom program but not for standard program.

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

I tried to get variant details using Function Module "  RS_VARIANT_CONTENTS" and "RS_CHANGE_CREATED_VARIANT"

but this VALUTAB/VARI_CONTENTS parameters of these function modules is capable of holding 45 characters itself where as my file name is morethan 45 characters hence i am not able to change the file path using these function modules.

Thanks,

Sateesh

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

If the standard report use field for path with more than 45 characters, you wont be able to change this value with usual FM, nor using TVARVC variables. So you could build a wrapper program with similar parameters, but replace the path with a logical name, and call the standard via SUBMIT with resolved filename/path.

Regards,

Raymond

6 REPLIES 6

kesavadas_thekkillath
Active Contributor
0 Kudos

Schedule the custom program in this manner & call the standard inside it

parameters:pa type string no-display.

at selection-screen output.

do 50 times.

concatenate 'A' pa into pa.

enddo.

concatenate pa sy-datum into pa.

start-of-selection.

*call the standard program here using "pa" as your file path

.

0 Kudos

Hi Kesava,

Already file name will be updated/appended with system date at last and placed in AL11 directory level, Now My requirement is to update this filename in already existing variant of standard program so that when job is running then it has to take updated file name.

I am able to get the filename from AL11 directory but my doubt is how to update the existing variant of standard program by using above mentioned FMs i have length restriction of 45 characters, please suggest.

0 Kudos

Which standard program is that, does it not allow to use logical file names as input?


Thomas

kesavadas_thekkillath
Active Contributor
0 Kudos

Instead of function module to get/change the variant contents, did you try with EXPORT/IMPORT from database VARI.

raymond_giuseppi
Active Contributor
0 Kudos

If the standard report use field for path with more than 45 characters, you wont be able to change this value with usual FM, nor using TVARVC variables. So you could build a wrapper program with similar parameters, but replace the path with a logical name, and call the standard via SUBMIT with resolved filename/path.

Regards,

Raymond

0 Kudos

Hi ,

If you are using ECC 6.0 EHP5(Enhancement pack 5 and above) then you can use FMs RS_VARIANT_CONTENTS_255_RFC ,

RS_VARIANT_CONTENTS_255  and

RS_CHANGE_CREATED_VARIANT_255,

RS_CHANGE_CREATED_VARI_255_RFC  to resolve 45 characters issue.

But I am using EHP4 version hence these FMs not available to me hence May be i need to try option specified by Raymond.

Thanks and Best Regards,

Sateesh