Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Getting error when coding in BADI....

Former Member
0 Likes
935

Hi,

I am working on a BADI called "ADDRESS_UPDATE". Now there is a importing paramater called IM_T_XADRC defined as IM_T_XADRC TYPE ADRC_TAB for interface IF_EX_ADDRESS_UPDATE by SAP.

When I try to code below inside the method <b>IF_EX_ADDRESS_UPDATE~ADDRESS1_SAVED</b>:

IF IM_T_XADRC-NAME3 IS INITIAL.
IM_T_XADRC-NAME3 = IM_T_XADRC-NAME1.
ENDIF.

It gives me following error:

"IM_T_XADRC" is a table without header line and therefore has no component called "NAME3".

How do I solve this error ?

Please help.

Regards,

Rajesh.

1 ACCEPTED SOLUTION
Read only

former_member249594
Participant
0 Likes
843

Hi Rajesh Thomas

IM_T_XADRC is typing a table type of ADRC_TAB, you can not handle its field directly, please loop IM_T_XADRC into a WA and move the field of WA to other data objects.

For example:

DATA: wa type VADRC.

LOOP im_t_xadrc INTO WA.

wa-name3 = wa_name1.

MODIFY im_t_xadrc FROM wa.

ENDLOOP.

7 REPLIES 7
Read only

Former Member
0 Likes
843

HI,

<b> remember u are using OOPS in BADI and all the intenal tables that you declare are with out header line and is so ur problem..</b>

Declare a structure of type IM_T_XADRC and say

read table IM_T_XADRC into strucrure.

IF structure-NAME3 IS INITIAL.

structure-NAME3 = structure-NAME1.

modify im_t_xadrc from strucure index sy-tabix.

ENDIF.<b></b>

Read only

former_member249594
Participant
0 Likes
844

Hi Rajesh Thomas

IM_T_XADRC is typing a table type of ADRC_TAB, you can not handle its field directly, please loop IM_T_XADRC into a WA and move the field of WA to other data objects.

For example:

DATA: wa type VADRC.

LOOP im_t_xadrc INTO WA.

wa-name3 = wa_name1.

MODIFY im_t_xadrc FROM wa.

ENDLOOP.

Read only

Former Member
0 Likes
843

declare like

data: IM_T_XADRC TYPE ADRC_TAB with hader line.

Read only

0 Likes
843

Its giving an error saying, "The field "IM_T_XADRC cannot be changed".

Rajesh...

Read only

0 Likes
843

HI

Check with the paramter IM_T_YADRC.. i think this contains the old address

u do the processing for this table and say

loop at im_t_yadrc into structure.

structrure-name3 = structure-nam1.

append strucute to im_t_xadrc.

endloop.

Read only

0 Likes
843

Same error, But can we actually change it because its a import parameter of and not the changing parameter !!!!

Read only

0 Likes
843

HI,

try with the field symbols and see if it works. something like this am not sure many need some changes

field-symbols : <fs> type any,

<name1> type any,

<name3> type any.

loop at im_t_xadrc assigning <fs>.

assign elemnet 'NAME1' of <fs> to <name1>.

assign element 'NAME3' of <fs> to <name3>.

assign <name1> to <name3>

endloop.

thanks

Mahesh