03-12-2007 3:19 PM
The value is not passing to l_text1 field from transaction code screen field
DATA: l_text1 TYPE vekp-exidv,
l_vekp TYPE vekp-exidv.
IF l_text1 IS NOT INITIAL.
SELECT SINGLE exidv FROM vekp INTO l_vekp WHERE exidv EQ l_text1.
IF sy-subrc = 0.
PERFORM f_check_mtype.
PERFORM f_move.
ENDIF.
ELSE.
MESSAGE i000(8i) WITH text-001.
03-12-2007 3:36 PM
Hi,
May I know where r u passing the value to the variable l_text1 to fetch data?
As far as i understand, u should either declare l_text1 as a screen field or should pass a value to it in the program prior to the data selection.
Sudha
03-12-2007 3:38 PM
03-12-2007 6:01 PM
Hi,
In SAP, the local variable take precedence over global variable.
So if you have variable l_text1 defined globally and you assign value in PBO but if you define same variable locally in PAI module, these are <b>two seperate variable with same name</b>. Whenever you try to access l_text1 in PAI, it will return whatever value it holds in PAI module and when you access l_text1 in PBO, it will return the value it holds in PBO.
I hope i clarify your doubt.
Regards,
RS
03-12-2007 3:39 PM
Hello,
Here u r declaring the field
<b>If u u passing the value in PBO then why u r declaring the field again in PAI.</b>
DATA: l_text1 TYPE vekp-exidv.
At this point l_text1 will be initial.
Regards,
Vasanth
03-12-2007 3:42 PM
If the code above is really what you got then it is obvious that l_text1 is not carrying any value:
you define it but don't pass anything to it.
Or do you have a field with the same name defined on a dialog screen?
Guenther