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

Adding a Variable name to a filename in background processing

Former Member
0 Likes
753

Hi All, Currently when I run a background process I am giving it a file name of

file_name = '/tmp/END_CUST'.

CONCATENATE file_name '_' v_dat '_' v_tim '.txt' INTO file_name.

This works and shows the filename correctly. However before running the background processing, I choose a variant and would like to concatenate that name in to it as well. I am not having luck with this.

Rewards for helpful answers

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
686

Change the file names as follows on the INITLISATION event of your Report. This will give you Exact results which you expect.

INITIALIZATION.
  CONCATENATE '\' sy-host 'WFNewHire_' sy-datlo  '_' sy-timlo '_SAP.dat' INTO p_hires.
  CONCATENATE '\' sy-host 'WFTerms_' sy-datlo '_' sy-timlo '_SAP.dat' INTO p_terms.

Amandeep

5 REPLIES 5
Read only

naimesh_patel
Active Contributor
0 Likes
686

Try putting this into Intialization section.

file_name = '/tmp/END_CUST'.
CONCATENATE file_name '_' v_dat '_' v_tim '.txt' INTO file_name.

Regards,

Naimesh Patel

Read only

Former Member
0 Likes
687

Change the file names as follows on the INITLISATION event of your Report. This will give you Exact results which you expect.

INITIALIZATION.
  CONCATENATE '\' sy-host 'WFNewHire_' sy-datlo  '_' sy-timlo '_SAP.dat' INTO p_hires.
  CONCATENATE '\' sy-host 'WFTerms_' sy-datlo '_' sy-timlo '_SAP.dat' INTO p_terms.

Amandeep

Read only

Former Member
0 Likes
686

Hi

The variant name should be in the system variable SY-SLSET.

DATA: V_LEN TYPE I

file_name = '/tmp/END_CUST'.

V_LEN = STRLEN( SY-SLSET ).

CONCATENATE file_name '_' SY-SELST(V_LEN) '_' v_dat '_' v_tim '.txt' INTO file_name.

Max

Read only

0 Likes
686

I am afraid none of the above has worked. Very weird.

Read only

Former Member
0 Likes
686

Hi dipesh,

1. The current variant name is stored in system variable

<b>SY-SLSET</b>

2. Hence, you can concatenate it like this for eg.

file_name = '/tmp/END_CUST'.

CONCATENATE file_name '_' v_dat '_' v_tim '.txt' INTO file_name.

<b>concatenate file_name sy-slset into file_name.</b>

regards,

amit m.