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 Updating KNA1 table fields.

naresh_kumar2
Explorer
0 Likes
1,994

Hi,

I have small issue , i need to block the customer while creating im using BADI(ADDRESS_UPDATE) to block the customer created.In the BADI im trying to update few fields of KNA1 table using UPDATE statement.

Like this...

WA_KNA1-SPERR = 'X'.

WA_KNA1-CASSD = 'X'.

WA_KNA1-AUFSD = '01'.

WA_KNA1-FAKSD = '01'.

WA_KNA1-LIFSD = '01'.

UPDATE KNA1 SET SPERR = WA_KNA1-SPERR

AUFSD = WA_KNA1-AUFSD

LIFSD = WA_KNA1-LIFSD

FAKSD = WA_KNA1-FAKSD

CASSD = WA_KNA1-CASSD

WHERE KUNNR = W_KUNNR.

when this statement excutes it is updating

1) SPERR

2) AUFSD this two field remaining 3 fields it is not updating

Can anyone pls let me know the reason .

thanks in Adv.

1 ACCEPTED SOLUTION
Read only

anup_deshmukh4
Active Contributor
0 Likes
1,435

Hello ajju_bobby ,

If you are in a BADI,

write a wrapper Function module to update the fields in and Call it in update task

Have a commit at end of function module ,

Don't forget to lock the customer using FM ENQUEUE DEQUE WHILE updating as it is a change BADI

Hi,

I have small issue , i need to block the customer while creating im using BADI(ADDRESS_UPDATE) to block the customer created.In the BADI im trying to update few fields of KNA1 table using UPDATE statement.

Like this...

WA_KNA1-SPERR = 'X'.

WA_KNA1-CASSD = 'X'.

WA_KNA1-AUFSD = '01'.

WA_KNA1-FAKSD = '01'.

WA_KNA1-LIFSD = '01'.

UPDATE KNA1 SET SPERR = WA_KNA1-SPERR

AUFSD = WA_KNA1-AUFSD

LIFSD = WA_KNA1-LIFSD

FAKSD = WA_KNA1-FAKSD

CASSD = WA_KNA1-CASSD

WHERE KUNNR = W_KUNNR.

when this statement excutes it is updating

1) SPERR

2) AUFSD this two field remaining 3 fields it is not updating

Can anyone pls let me know the reason .

thanks in Adv.

5 REPLIES 5
Read only

Former Member
0 Likes
1,435

see note 1469543

it is not possible to update kna1 directly, you must create a bim

oops sorry see that you're question is it inside a badi and not bapi

kind regards

arthur

Edited by: A. de Smidt on Jul 20, 2010 10:45 AM

Read only

0 Likes
1,435

im updating kna1 in BADi

Read only

anup_deshmukh4
Active Contributor
0 Likes
1,436

Hello ajju_bobby ,

If you are in a BADI,

write a wrapper Function module to update the fields in and Call it in update task

Have a commit at end of function module ,

Don't forget to lock the customer using FM ENQUEUE DEQUE WHILE updating as it is a change BADI

Read only

0 Likes
1,435

thanks for ur quick reply .

but which Function Module should for updation .

pls let me know Deque and Enqu for locking Customer.

pls let me know ..

Thanks in adv.

Read only

naresh_kumar2
Explorer
0 Likes
1,435

k