‎2010 Mar 18 5:29 PM
HI!
I created a abap query and added few additional fields with codes in them and tried running the query. When I run teh query with selections on my selection screen it runs well and gives me output correctly but when I run it open without any selection I geta runtime error with following description.
Short text
Field symbol has not yet been assigned.
__What happened?__ Error in the ABAP Application Program
The current ABAP program "AQZZZSD=========ZSD_LISTOFFLST" had to be terminat
because it has
come across a statement that unfortunately cannot be executed.
Error analysis You attempted to access an unassigned field symbol
(data segment 27).
This error may occur if
- You address a typed field symbol before it has been set with
ASSIGN
- You address a field symbol that pointed to the line of an
internal table that was deleted
- You address a field symbol that was previously reset using
UNASSIGN or that pointed to a local field that no
longer exists
- You address a global function interface, although the
respective function module is not active - that is, is
not in the list of active calls. The list of active calls
can be taken from this short dump.
How to correct the error
If the error occures in a non-modified SAP program, you may be able to
find an interim solution in an SAP Note.
If you have access to SAP Notes, carry out a search with the following
keywords:
"GETWA_NOT_ASSIGNED" " "
I am not sure why its running ok when I provide selection and it gives error when I ran it open.
Thanks
‎2010 Mar 18 5:40 PM
‎2010 Mar 18 5:40 PM
‎2010 Mar 18 7:18 PM
I tried that assigning process too , yet it gives me the same error at the same place . Yet it dosent give error if I do enter something in the selection screen . Please suggest.
Thanks
‎2010 Mar 18 10:45 PM
‎2010 Mar 25 6:42 PM
The code where it shows error :
loop at gt_konv assigning <fs_konv>
where kposn = vbrp-posnr
and ( kschl = 'ZPRL' or kschl = 'ZWRO' or
kschl = 'ZSPT' or kschl = 'ZWSU' or
kschl = 'ZOTH' or kschl = 'ZQUA' or
kschl = 'ZTAR' or kschl = 'ZCMD' ).
add <fs_konv>-kwert to unitpr.
endloop.
unitpr = ( unitpr / vbrp-fkimg ).
uomup = <fs_konv>-kmein.
If lines( gt_konv ) gt 0.<<<<<<<<,<<<<<<<Runtime error point is here
clear psagediff.
IF ( PRICEDIFF <> '0.00' AND LPRICE <> '0.00' ).
PSAGEDIFF = ( PRICEDIFF / LPRICE ) * 100.
else.
PSAGEDIFF = '0.00'.
endif.
endif.
* Logic in code section
case v_pricetype.
when '00'.
pricetype = 'Others'.
when '01'.
pricetype = 'List'.
when '02'.
pricetype = 'Off-List'.
when '03'.
pricetype = 'No Price'.
endcase.
‎2010 Mar 25 8:22 PM
No it's here
> uomup = <fs_konv>-kmein.
As I can see in your code, this happens when the loop condition didn't match any record in gt_konv. So you should test if it did
loop at gt_konv assigning <fs_konv>
where kposn = vbrp-posnr
and ( kschl = 'ZPRL' or kschl = 'ZWRO' or
kschl = 'ZSPT' or kschl = 'ZWSU' or
kschl = 'ZOTH' or kschl = 'ZQUA' or
kschl = 'ZTAR' or kschl = 'ZCMD' ).
add <fs_konv>-kwert to unitpr.
endloop.
IF sy-subrc = 0. "<<<<<<<<<<<<<<< ADD IT
uomup = <fs_konv>-kmein.
ENDIF.
unitpr = ( unitpr / vbrp-fkimg ).
If lines( gt_konv ) gt 0.
clear psagediff.