‎2007 Jul 09 6:42 AM
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...
‎2007 Jul 09 6:51 AM
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...
‎2007 Jul 09 6:53 AM
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!