2009 Apr 15 9:56 AM
Hi,
Need to create Dynamic Varient
My Requirement is :
When the program runs on last day of the month, varient has to be set up to populate the
the File path as :
/PA1/Interfaces/FlatFiles/new_sales_history.txt
When the program runs on Working day + 1, then the other varient has to be set up to populate the File Path as :
/PA1/Interfaces/FlatFiles/sales_history.txt
Can anybody let me know how i can create Dynamic Varient...?
Any suggestions will be appreciated!
Regards,
Kittu
2009 Apr 15 10:02 AM
hi check the run date...and do like this ...
initialization.
if v_rundate = 'last day of the month'..
p_file = 'PA1/Interfaces/FlatFiles/new_sales_history.txt '
else.
p_file = '/PA1/Interfaces/FlatFiles/sales_history.txt'
endif.
Hi,
Need to create Dynamic Varient
My Requirement is :
When the program runs on last day of the month, varient has to be set up to populate the
the File path as :
/PA1/Interfaces/FlatFiles/new_sales_history.txt
When the program runs on Working day + 1, then the other varient has to be set up to populate the File Path as :
/PA1/Interfaces/FlatFiles/sales_history.txt
Can anybody let me know how i can create Dynamic Varient...?
Any suggestions will be appreciated!
Regards,
Kittu
2009 Apr 15 10:02 AM
hi check the run date...and do like this ...
initialization.
if v_rundate = 'last day of the month'..
p_file = 'PA1/Interfaces/FlatFiles/new_sales_history.txt '
else.
p_file = '/PA1/Interfaces/FlatFiles/sales_history.txt'
endif.
2009 Apr 15 10:04 AM
Hi,
data : p_filepath(50).
data : l_date type sy-datum,
g_date_last type sy-datum,
g_date_1 type sy-datum.
At initialisation.
" calc last day of month and store in g_date_last
"calc workday + 1 and store in g_date_1
l_date = sy-datum.
if l_date = g_date_last.
p_fielpath = '/PA1/Interfaces/FlatFiles/new_sales_history.txt '.
endif.
if l_date = g_date_1.
p_filepath = '/PA1/Interfaces/FlatFiles/sales_history.txt '.
endif.
2009 Apr 15 11:40 AM
Hi,
Thank you for your quick response.
I cannot hardcode the path of the UNix file.....
The user still may want to fill up the Path manually.....
So if you know the way to create Dynamic Varients then please let me know...
Can you let me know the Tcode for creating varients...?
Thanks & Regards,
Kittu
2009 Apr 15 2:24 PM
Consider the following option:
1) Create two parameters on selection screen. One for working day file and another for working day + 1 file.
2) Use logic inside program to determine if working day or not. Accordingly use the correct file name (from parameter).
3) Users can override the file parameters online. If needed, when the program is run online (SY-BATCH = ' '), issue a confirmation popup for the file to be used.
I am not sure "dynamic variants" is the way to go here because you will have to build another program/process of updating it everyday. But here is information about it anyways...
To create customer defined variables to be used in a variant, you will have to create it in table TVARV. See the following two links for further information:
http://help.sap.com/saphelp_45b/helpdata/en/c0/980398e58611d194cc00a0c94260a5/frameset.htm
https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/creatingdynamicvariantusingtable+TVARV
2009 Apr 15 2:29 PM
Hi Kittu , when you are creating the job create two variant... end, end+1
schedule one job with variant end on every end of month
schedule another job with variant end+1 every end of month + 1.
or let the user create a variant and save it.
2009 May 06 3:25 PM
Thank you for your response!
The information provided was helpful..
Regards,
Kittu
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |