01-19-2010 11:58 AM
Hi Experts,
I am populating data in internal table TKOMV in pricing routine RV61AXXX for a particular condition type. If this condition is manually entered. I get the error saying "Field symbol has not yet been assigned". This internal table comes from the standard program SAPLV61A. Whenever the condition is manually entered, this error occurs saying that TKOMV does not exists. If the pricing is updated using the option carry out new pricing, this does not happen.
Moreover, TKOMV is not a fieldsymbol, its an internal table, why does it happen and how do I check. I can check a field symbol using is assigned. But what do I do here.
Thanks,
Abdullah
Edited by: Abdullah Ismail on Jan 19, 2010 5:29 PM
01-19-2010 12:26 PM
01-19-2010 12:43 PM
Error analysis
You attempted to access an unassigned field symbol
(data segment 85).
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.
read table tkomv assigning <f_komv> with key kposn = komp-kposn
kschl = 'ZPR4'.
if sy-subrc eq 0.
<f_komv>-kbetr = v_kbetr.
endif.
The issue is with tkomv here.
Thanks,
Abdullah
01-19-2010 1:10 PM
how do i check if the internal table exists. Using reference or any other way?
Thanks,
Abdullah
01-19-2010 2:17 PM
TKOMK LIKE STANDARD TABLE OF KOMK
That means TKOMK is a STANDARD INTERNAL TABLE
So u should define:
DATA TKOMK LIKE STANDARD TABLE OF KOMK WITH HEADER LINE.
CALL FUNCTION <......>
EXPORTING
TKOMK = TKOMK[]
Probably you've a call like this:
CALL FUNCTION <function>
EXPORTING
ztkomk = tkomk
U need to transfer the data only, not the header line:
CALL FUNCTION <function>
EXPORTING
ztkomk = tkomk[]
01-19-2010 2:03 PM
Extract from [READ TABLE - result |http://help.sap.com/abapdocu_70/en/ABAPREAD_TABLE_OUTDESC.htm#!ABAP_ALTERNATIVE_2@2@]
If the READ statement is successful (sy-subrc has value 0), it is guaranteed that the data reference variable immediately after the execution of the statement indicates a row. A query using IS BOUND is not necessary there.
Strange, how did you define your field-symbol, if it has not the type of the internal table record, you should assign its component to another field-symbol, or add [CASTING|http://help.sap.com/abapdocu_70/en/ABAPASSIGN_CASTING.htm] option.
Regards,
Raymond
01-19-2010 2:37 PM
I am pasting the whole code here.
FORM KOBED_905.
*{ INSERT D01K916099 1
*
field-symbols: <f_komv> type komv.
case sy-tcode.
when: 'VA01'.
when: 'VA02'.
when: 'VA03'.
when: 'VF01'.
when: 'VF04'.
* import record_tab from memory id 'mcx_record_tab'.
* read table record_tab index 1.
* if sy-subrc eq 0 and record_tab-string(1) = 'B'.
* else.
* sy-subrc = 0.
* exit.
* endif.
when others.
sy-subrc = 0.
exit.
endcase.
data: v_kbetr type konp-kbetr.
clear v_kbetr.
select single kbetr
from konp as a
join a056 as b
on a~knumh = b~knumh
into v_kbetr
where b~vkorgau = komk-vkorg and
b~werks = komp-werks.
if sy-subrc eq 0.
read table tkomv assigning <f_komv> with key kposn = komp-kposn
kschl = 'ZPR4'.
if sy-subrc eq 0.
<f_komv>-kbetr = v_kbetr.
endif.
endif.
sy-subrc = 0.
*} INSERT
ENDFORM.
FORM KOBEV_905.
ENDFORM.
Even if I give a work area instead of the fieldsymbol <f_komv> there will be no difference because in debugging I see that the table TKOMV is not active.
01-19-2010 3:17 PM
Are you sure you can use the formal parameter name tkomv and not the xkomv data of the top include ?
Look at [Note 327220 - VOFM function and its objects|https://service.sap.com/sap/support/notes/327220], [Note 393012 - VOFM: Syntax error for user-defined routines|https://service.sap.com/sap/support/notes/393012] and [Note 28683 - PERFORM_NOT_FOUND: VOFM routine is not active|https://service.sap.com/sap/support/notes/28683] and of course [Note 156230 - Requirements: What is permitted, what is not?|https://service.sap.com/sap/support/notes/156230]
Regards,
Raymond
01-19-2010 4:46 PM
Well I found a solution!!
When the condition type is entered manually, the global variable, INCL_KONDITIONEN changes to X. I am not going ahead with my routine.
When the condition is called through the standard way, the function module PRICING calls my routine. This FM has the internal table TKOMV. This happens in the case of new sales order/invoices.
Where as, the manual entry is done only for the open sales order, this condition type is entered, FM PRICING_CHECK calls my routine.
In debugging stack, the first scenario has the condition as Z, the other scenario, it changes to X.
Now whats the use of the routine? Well, it is called during save and executes.
Thanks to all of you for your suggestions.
A special thanks to my buddies Manu Kapur and Ashok Pratap also who gave valuable inputs.
01-19-2010 2:12 PM
try this...
read table tkomv assigning <f_komv> with key kposn = komp-kposn
kschl = 'ZPR4'.
if sy-subrc eq 0 and <f_komv> is assigned.
<f_komv>-kbetr = v_kbetr.
endif.