Skip to Content
0
Former Member
Jan 21, 2011 at 09:57 AM

BPC 7.5 : End Routine BADI

80 Views

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