‎2007 Apr 30 3:54 AM
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.
‎2007 Apr 30 4:13 AM
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.
‎2007 Apr 30 4:41 AM
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
‎2007 Apr 30 4:52 AM
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