cancel
Showing results for 
Search instead for 
Did you mean: 

BPC 7.5 : End Routine BADI

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

esjewett
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Please review the following how-to guide.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/50c39fa1-6f95-2d10-2a95-b594de8e1...

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

Former Member
0 Kudos

Thanks All.

Thanks Rich. Actually I was using the wrong package to load master data in development. I replaced this with right data package and laoded again.The above code is working fine.

Thanks

Prasad

Former Member
0 Kudos

Prasad

Could you please elaborate on how you resolved, what you meant by wrong package.

I am getting the same error.

Thanks

Shilpa

Former Member
0 Kudos

Hi Shilpa,

I created new data package in BPC and used the same in answer prompt file then It got resolved. Try the same.

Thanks

Prasad

Former Member
0 Kudos

I resolved myself.

Thanks

Prasad

Answers (1)

Answers (1)

Former Member
0 Kudos

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