Application Development 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: 

Userexit or BADI for CS01 and CS02 ?

Former Member
0 Kudos

hi....

I have two questions.

1) I want to save the data in other table

when I click save button using t-code cs01/cs02.

checked instructions below and then tried to put break point and try debugging,

but user exit didn't work out.

If you have done this correctly,

pls, let me know.

2) Please let me know how to use badi.

BOM_UPDATE

Your help will be appreciated.

Regards

1 ACCEPTED SOLUTION

Former Member
0 Kudos

HI,

If you want to make use of the BADI definition BOM_UPDATE, you have do implement this.

This can be done by,

1. Go to SE18 and give the BADI BOM_UPDATE.

2.Go to Implementation-->Create then give the implementation name as ZBOM_UPDATE then give the desription for the implementation.

3.Then go to the interface tab there you can find the Methods.

Here for this defintion you can find the methods are CHANGE_IN_UPDATE, CHANGE_BEFORE_UPDATE, CHANGE_AT_SAVE.

Put the break point in the relevent methods and activate the implementation.

or otherwise use this code


DATA: l_matkl type mara-matkl.

DATA: stpob TYPE stpob.

DATA: FIELD_NAME(30) VALUE '(SAPLCSBT)O1-STPOB[]'.

FIELD-SYMBOLS: <TABLE> TYPE TABLE.

ASSIGN (FIELD_NAME) TO <TABLE>.


LOOP AT <TABLE> INTO STPOB.
clear l_matkl
clear stpob-sortf.

select single matkl
from MARA
into l_matkl
where matnr = stpob-idnrk.

if sy-subrc eq 0.
concatenate l_matkl(3) '.' stpob-posnr(3) into sortf.
modify <table> from stpob.
*else.
*modify <table> from stpob.
endif.

ENDLOOP.

COMMIT WORK and WAIT.

<b>Reward the points if it is useful. :)</b>

regards

Sathish

6 REPLIES 6

Former Member
0 Kudos

ans for your second question

implement the BADI using transaction se19 and write your code in method CHANGE_AT_SAVE. you can write your code here to save the data in another table.

0 Kudos

First of all thank you for the reply.

In additons, I clicked the display button using Implementation name:CHANGE_AT_SAVE in T-code se 19.

And the message below came out as below.

"BAdI implementation CHANGE_AT_SAVE does not exist!"

I checked with bom_updated in T-CODE SE18,

I could see CHANGE_AT_SAVE as method in CHANGE_AT_SAVE.

So, I want know the three points additionally..

1) What shoud I do to check in Se19..?

2) Otherwise Should I do creation with CHANGE_AT_SAVE ??

3) or should I find CHANGE_AT_SAVE and correct it??.

former_member194669
Active Contributor
0 Kudos

Hi,

Try to use

user exit PCSD0005. FM EXIT_SAPLCSDI_006.

aRs

0 Kudos

First of all thank you for the reply.

&----


*& Include ZXCSAU10 *

&----


DATA: L_DATA.

L_DATA = '1'. " ==>break point

MESSAGE I000(ZPMD) WITH 'aaa'. " ==>break point

I tried to insert the code above and put break point.

And then I entered to cs02 tcode and

changed the quantity of component and finally tried to save,

but user exit din't work out.

what else should I do? Pls, advise me on this with thanks.

0 Kudos

Did you activate the project in CMOD ? if so then try with below user exits :

CNEX0011 BOM explosion in network on component overview

CNEX0014 External data for BOM transfer

CNEX0015 Change BOM data for BOM transfer

CNEX0030 Update event for BOM assignment

CNEX0034 Check a New Allocation in BOM Transfer

CNEX0035 Check a Change in BOM Transfer

CNEX0036 Check deletion as part of BOM transfer

i hope above one of user exit should trigger,if not try below user exits

PCSD0001

PCSD0002

PCSD0003

PCSD0004

PCSD0005

PCSD0006

PCSD0007

PCSD0008

PCSD0009

PCSD0010

PCSD0011

PCSD0012

PCSD0013

Thanks

Seshu

Former Member
0 Kudos

HI,

If you want to make use of the BADI definition BOM_UPDATE, you have do implement this.

This can be done by,

1. Go to SE18 and give the BADI BOM_UPDATE.

2.Go to Implementation-->Create then give the implementation name as ZBOM_UPDATE then give the desription for the implementation.

3.Then go to the interface tab there you can find the Methods.

Here for this defintion you can find the methods are CHANGE_IN_UPDATE, CHANGE_BEFORE_UPDATE, CHANGE_AT_SAVE.

Put the break point in the relevent methods and activate the implementation.

or otherwise use this code


DATA: l_matkl type mara-matkl.

DATA: stpob TYPE stpob.

DATA: FIELD_NAME(30) VALUE '(SAPLCSBT)O1-STPOB[]'.

FIELD-SYMBOLS: <TABLE> TYPE TABLE.

ASSIGN (FIELD_NAME) TO <TABLE>.


LOOP AT <TABLE> INTO STPOB.
clear l_matkl
clear stpob-sortf.

select single matkl
from MARA
into l_matkl
where matnr = stpob-idnrk.

if sy-subrc eq 0.
concatenate l_matkl(3) '.' stpob-posnr(3) into sortf.
modify <table> from stpob.
*else.
*modify <table> from stpob.
endif.

ENDLOOP.

COMMIT WORK and WAIT.

<b>Reward the points if it is useful. :)</b>

regards

Sathish