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

replace value within quotes

Former Member
0 Likes
326

hello all,

i am writing a bdc program in which i have to replace the value of "sr_no" in 'VBAP-POSNR(sr_no)' at runtime.

the statement is as follows:

perform bdc_field using 'BDC_CURSOR'

'VBAP-POSNR(02)'.

i have replaced "02" by "sr_no" which has to be populated at run time as i have to do the same thing for multiple line items:

perform bdc_field using 'BDC_CURSOR'

'VBAP-POSNR(sr_no)'.

but i am facing a problem as this value has to be passed within quotes.

i.e.

'VBAP-POSNR(01)'

'VBAP-POSNR(02)', etc...

2 REPLIES 2
Read only

Former Member
0 Likes
300

Hi,

Instead of passing the variable name, pass the variables value.

Loop at sr_no.

Concatenate ''VBAP-POSNR('

sr_no

')'' into l_field.

perform bdc_field using 'BDC_CURSOR'

l_field.

endloop.

Best regards,

Prashant

'VBAP-POSNR(02)', etc...

Read only

Former Member
0 Likes
300

Hi,

Take one string or character variable.

see below how to do it:

data: var(14) type c.

loop at itab.

concatenate 'VBAP-POSNR(' sr_no ')' into var.

And use this var at

perform bdc_field using 'BDC_CURSOR'

var.

sr_no = sr_no + 1.

endloop.

Reward if useful!