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

How to replace &val& with value

former_member761936
Active Participant
0 Likes
3,024

Hi All,

I want to replace the &VALUE& with value.

For example

If I have test like ' This process &procees_id' is need to be approved by &USER& ' ,

It should be populated as 'This process leave approval is need to be approved by NARENDRA'.The

values for Process_id and user willbe given by program dyanmically.

Can one please help us solving this problem.

Thanks and Regards,

Narendra.Somarouthu

Hi All,

I want to replace the &VALUE& with value.

For example

If I have test like ' This process &procees_id' is need to be approved by &USER& ' ,

It should be populated as 'This process leave approval is need to be approved by NARENDRA'.The

values for Process_id and user willbe given by program dyanmically.

Can one please help us solving this problem.

Thanks and Regards,

Narendra.Somarouthu

7 REPLIES 7
Read only

Former Member
0 Likes
2,574

Use the command REPLACE..

Read only

former_member156446
Active Contributor
0 Likes
2,574

I am assuming its a print prg..

dynamic data of  value say 10 20.

syntax: The &VALUE& with which program executed.
output:  The 10 20 with which program executed.

syntax: The value with which program executed.
output:  The value with which program executed.

Read only

Former Member
0 Likes
2,574

Hi,

Try this way..

DATA : l_string type string.

l_string = ' This process &procees_id& is need to be approved by &USER& '.

REPLACE '&procees_id&' WITH 'leave approval' INTO l_sting.
REPLACE '&USER&' WITH 'NARENDRA' INTO l_sting.

Read only

Former Member
0 Likes
2,574

>

> If I have test like ' This process &procees_id' is need to be approved by &USER& ' ,

the details u hv provided are quite insufficient, please tell where u r trying to print it.

I think chnaging the position of quotes will work, if u above statemet is already not working.

'This Process' &process_id& 'nedds to be approved by' &user&.

кu03B1ятu03B9к

Read only

dev_parbutteea
Active Contributor
0 Likes
2,574

Hi,

Try this:

v_text = ' This process & is need to be approved by & ' .

REPLACE FIRST OCCURRENCE OF '&' in v_text WITH V_process.

REPLACE FIRST OCCURRENCE OF '&' in v_text WITH V_user.

Regards,

Dev.

Read only

former_member222860
Active Contributor
0 Likes
2,574

Hi,

For inserting the values for 'process_id' and 'user', then this logic works

v_string = 'This process &process_id is need to be approved by &USER&'
    REPLACE ALL OCCURRENCES OF '$process_id' IN v_string WITH v_proces.
    REPLACE ALL OCCURRENCES OF '&USER&' IN v_string WITH v_user.
    CONDENSE v_string.

thanks\

Mahesh

Edited by: Mahesh Reddy on Feb 4, 2009 5:25 AM

Read only

Former Member
0 Likes
2,574

Hi,

Considering your requirement to replace &value& is in forms.

take &value& under a named text-element(say 'text').

In your main program take a variable(say w_value) type compatible to &value& ( here it can be type string)

assign value to be passed to w_value.

call function module(FM) open_form.

Assign formname.

Call FM write_form.

assign the named text element and window (MAIN/VAR) to the export parameters of function module.

Call FM close_form.

ex:

data:

w_value type string.

CALL FUNCTION 'OPEN_FORM'

EXPORTING FORM = 'formname'

..................

w_value = 'Process_id text which u want to pass'.

CALL FUNCTION 'WRITE_FORM'

EXPORTING ELEMENT = 'TEXT'

WINDOW = 'MAIN'

FUNCTION = 'SET'

TYPE = 'BODY'

............

CALL FUNCTION 'CLOSE_FORM'

......

Regards,

Mdi.Deeba Najam.