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

Repacing &&&& with field values

Former Member
0 Likes
601

Dear All,

In table EDIDS there is a status test field (STATXT). That field is having having values like &&&&. There are other fields in the table EDIDS like parameter1 (STAPA1), parameter2 (STAPA2), parameter3 (STAPA3) and parameter4 (STAPA4).

Now I want to replace the values of &&&& with the values in the field STAPA1 to STAPA4. So that instead of &&&& it will be STAPA1STAPA2STAPA3STAPA4.

Please guide me how to go on this.

Warm Regards,

N.Jain

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
559

Hi Nishu ,

Use the REPLACE command.

Here is a sample code for the same

data : v_test type string.

v_test = '&&&&'.

replace '&' with 'STAPA1' into v_test.

write / v_test.

replace '&' with 'STAPA2' into v_test.

write / v_test.

replace '&' with 'STAPA3' into v_test.

write / v_test.

replace '&' with 'STAPA4' into v_test.

write / v_test.

Regards,

Arun

4 REPLIES 4
Read only

Former Member
0 Likes
560

Hi Nishu ,

Use the REPLACE command.

Here is a sample code for the same

data : v_test type string.

v_test = '&&&&'.

replace '&' with 'STAPA1' into v_test.

write / v_test.

replace '&' with 'STAPA2' into v_test.

write / v_test.

replace '&' with 'STAPA3' into v_test.

write / v_test.

replace '&' with 'STAPA4' into v_test.

write / v_test.

Regards,

Arun

Read only

0 Likes
559

hi arun,

if suppose in STATXT field there is a value like "Vendor &, Customer&, Party&, Address&" and now i want to fill the values of first & with STAPA1 value then second & with STAPA2 value etc. thn how to go for that.

Warm Regards,

N.Jain

Read only

0 Likes
559

Hi Nishu ,

The all you need to do is remove ' , then it will take the value in the varaible.

So your statement will look like this

replace '&' with STAPA1 into v_test.

replace '&' with STAPA2 into v_test.

replace '&' with STAPA3 into v_test.

replace '&' with STAPA4 into v_test.

Assign points if helpful

Regards,

Arun

Read only

Former Member
0 Likes
559

thanks for ur valuable replies.