on 01-21-2011 9:57 AM
Hi,
I wrote End Rountine BADI to add ALL_CCS as top node to nodes NO_CC and CTOP. I got the dump and the message is showing "Field symbol has not yet been assigned.".
BADI CODE:
method IF_UJD_ROUTINE~RUNROUTINE.
DATA: lo_dataref TYPE REF TO data.
FIELD-SYMBOLS: <lt_data_im> TYPE STANDARD TABLE.
FIELD-SYMBOLS: <lt_data_ex> TYPE STANDARD TABLE.
FIELD-SYMBOLS: <ls_data> TYPE ANY.
FIELD-SYMBOLS: <lv_str> TYPE string.
Assign importing data reference to field symbol
*CREATE DATA ir_data TYPE any.
get REFERENCE OF <lt_data_im> INTO ir_data.
ASSIGN ir_data->* TO <lt_data_im>.
Create work area for importing data
CREATE DATA lo_dataref LIKE LINE OF <lt_data_im>.
ASSIGN lo_dataref->* TO <ls_data>.
Create new internal table for exporting data
CREATE DATA lo_dataref LIKE TABLE OF <ls_data>.
ASSIGN lo_dataref->* TO <lt_data_ex>.
Get ECC_CC value from custom table or other datasource
LOOP AT <lt_data_im> ASSIGNING <ls_data>.
APPEND <ls_data> TO <lt_data_ex>.
ENDLOOP.
ASSIGN COMPONENT 'NODENAME' OF STRUCTURE <ls_data> TO <lv_str>.
MOVE 'NO_CC' to <lv_str>.
ASSIGN COMPONENT 'HIER_NAME' OF STRUCTURE <ls_data> TO <lv_str>.
MOVE 'PARENTH1' to <lv_str>.
ASSIGN COMPONENT 'PARENT' OF STRUCTURE <ls_data> TO <lv_str>.
MOVE 'ALL_CCS' to <lv_str>.
APPEND <ls_data> TO <lt_data_ex>.
ASSIGN COMPONENT 'NODENAME' OF STRUCTURE <ls_data> TO <lv_str>.
MOVE 'CTOP' to <lv_str>.
ASSIGN COMPONENT 'HIER_NAME' OF STRUCTURE <ls_data> TO <lv_str>.
MOVE 'PARENTH1' to <lv_str>.
ASSIGN COMPONENT 'PARENT' OF STRUCTURE <ls_data> TO <lv_str>.
MOVE 'ALL_CCS' to <lv_str>.
APPEND <ls_data> TO <lt_data_ex>.
Exporting data to exporting data references
GET REFERENCE OF <lt_data_ex> INTO er_data.
endmethod.
Error Message:
Error analysis
You attempted to access an unassigned field symbol
(data segment 32779).
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.
Thanks
Prasad
Prasad,
The dump should tell you on exactly which line you attempt to access the unassigned field symbol. I'm guessing it is when you attempt to get the reference of <lt_data_im> before it has been assigned, but I'm not entirely sure. What are you trying to accomplish there?
Ethan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Ethan. Yes it is showing the line when I create work area for importing data. But I'm not understanding the exact probelm here.
Requirement:
I have three top nodes ALL_CCS, NO_CC and CTOP. I want to add ALL_CCS as the PARENTH1 to other node NO_CC and CTOP by using the END ROUTINE BADI in hierarchy transformation file.
Thanks
Prasad
Please review the following how-to guide.
Notice in the source code for the ENDROUTINE, it simply uses an ASSIGN statement to pull the data into the <LT_DATA_IM> internal table. THere is no need to use the GET_REFERENCE statement as you have in your code.
Regards,
Rich Heilman
Hi,
I have requirement to add ALL_CCD as PARENTH1 to other two ID's NO_CC and CTOP. I have standard END ROUTINE BADI (BPC 7.5) .
TRANSFROMATION FILE STRUCTURE:
NODENAME=NODENAME
HIER_NAME=*STR(PARENTH1)
PARENT=PARENT
ORDER=ORDER
How can I add the two lines to to the export table in this BADI. Can any one share the sample code for this.
Thanks
Prasad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
5 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.