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

PROBLEM IN BADI

Former Member
0 Likes
407

Hi,

i have problem badi.when i have save the pricing i should change the 'usd' to 'usdn' i have save i should change in to 'usdn'

the code ;

LOOP AT CT_KONPDB_NEW INTO WA.

WA-KONWA = 'USDN'.

ENDLOOP.

iam geetting the error as

WA cannot be converted to the line type of CT_KONPDB_NEW-internal table

please can you tell me what to do.

regards,

sivakumar.

3 REPLIES 3
Read only

Former Member
0 Likes
380

I hope you have declared WA as the type of CT_KONPDB_NEW.

DATA : wa LIKE LINE OF ct_konpdb_new.

LOOP AT ct_konpdb_new iINTO wa.

wa-konwa = 'USDN'

ENDLOOP.

Alsp please note that the above loop will NOT modify the internal table unless u use a MODIFY statement within the loop.

MODIFY ct_konpdb_new FROM wa.

A faster alternative is to use field symbols :

DATA : <fs> LIKE LINE OF ct_konpdb_new.

LOOP AT ct_konpdb_new ASSIGNING <fs>.

<fs>-konwa = 'USDN'

ENDLOOP.

Hope this helps you.

Read only

0 Likes
380

Hi

Now it working fine but it not changing in the table

LOOP AT CT_KONPDB_NEW INTO WA.

wa-KONWA = 'USDN'.

wa-KWAEH = 'USDN'.

MODIFY ct_konpdb_new FROM wa.

ENDLOOP.

but i should change the data in KONP table it not changing

please help me.

regards,

sivakumar

Read only

Former Member
0 Likes
380

Hi,

Did you debug and check if your internal table ct_kondb_new is modified ?

If your internal table is not modified, please use field symbols as suggested in post above.

If your internal table is modified successfully but databse is not, it means either :

1. Your internal table is overwritten at a later point, within your BADI.

2. This is not the right BADi you have chosen

Hope this helps