‎2012 May 21 8:13 AM
hie, I am working on a module pool program where i have a table control and i need to get VBELN through a input field and based on that field i need to write a select query and display the so items in table control.
i have defined the input field as vbak-vbeln for the input field in the screen, activated it.
the prob is ,When i write the select query, i get an error that vbak-vbeln is not defined.
can any one tel me what could be wrong ?
‎2012 May 21 8:21 AM
That name is accessible only in your screen & not in your program. You have to either use tables statement ( obsolete) in your program like tables:VBAK , or declare a individual variable referring to vbeln and use that variable name to your screen field.
‎2012 May 21 8:27 AM
if that is the problem, previously had a report program where the input field declared in the screen was accessible in the program. I did not declare an individual variable for that ... same here, but a module pool.. and this not working
Additional Information: During the debugging mode, the input field which i declared on the screen is accessible in program holding the VBELN, but when i give the same in the program, it throws an error
‎2012 May 21 8:45 AM
Report program & module pool both are different.
"During the debugging mode, the input field which i declared on the screen is accessible in program holding the VBELN - Which Program ?, but when i give the same in the program, it throws an error" Which Program. ?
Hope you understood what i meant.
‎2012 May 21 9:18 AM
Dear Karthikeyan,
In the include top declare as below:
data:vbak type vbak.
Vbak will be structure now and when you have defined the input/output fieldname as VBAK-VBELN ( Note: while defining in the input/output field you need to call the variable from program not from dictionary ) then that value will come to the structure field VBAK-VBELN which can be used in your select query.
With thanks & regards,
‎2012 May 21 9:49 AM
Thank you for all your valuble comments. I solved the problem myself.. The mistake i did was i used program fields window(F6) in the screen and displayed the input field directly from the DB table. So the Input fields acts as a two way both for Saving and displaying.
It will be a confusion there SO what i did was i declared a local varaible refering to vbeln and i used program fields window, insted of getting from attributes, i clicked on Get from program.I linked that local variable to the input field .. Problem solved.