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

BADI for Updating work order component data

Former Member
0 Likes
12,577

Hi,

I need to update the field special stock indicator for the work order component data when it is saved. I am using the BADI WORKORDER_UPDATE for the same, but when I implemented the ZWORKORDER_UPDATE_IM using the standard defenition WORKORDER_UPDATE , the code does not allow me to change the it_component internal table belonging to the BEFORE_UPDATE method. Could you please help me in this.

Basically if we are implementing a standard defenition how to change the parameters of the methods in it.

Regards,

Prabaharan.G

Hi,

I need to update the field special stock indicator for the work order component data when it is saved. I am using the BADI WORKORDER_UPDATE for the same, but when I implemented the ZWORKORDER_UPDATE_IM using the standard defenition WORKORDER_UPDATE , the code does not allow me to change the it_component internal table belonging to the BEFORE_UPDATE method. Could you please help me in this.

Basically if we are implementing a standard defenition how to change the parameters of the methods in it.

Regards,

Prabaharan.G

16 REPLIES 16
Read only

Former Member
0 Likes
6,909

HI,

The definition WORKORDER_UPDATE doesnot contain any method which has CHANGING as table parameter. So its not possible to change the values in component table.

Regards

Kannaiah

Read only

Former Member
0 Likes
6,909

Hi Kannaiah,

Is there any other way to accomplish that . May be like

1) Giving a Pop up after filling a line item for component data and pressing enter - For this is there any user exit / BADI available.

2) Calling some Z function module to update the order exceptionally and clubbing this function module to some user exits that run with the order saving.

Please respond.

Regards,

Prabaharan.G

Read only

0 Likes
6,909

Hi,

Check this Exit:

EXIT_SAPLCOBT_001

Regards

Kannaiah.

Read only

Former Member
0 Likes
6,909

Hi Kanniah,

I tried using the field symbol method but it is not working,

The code is My code is

assign wa_component to <fs_abc>.

<fs_abc>-sobkz = '3'.

Please correct if there is any error in the code.

Is it that I should directly assign the internal table to the field symbol and not the work area?

Regards,

Prabaharan.G

Read only

0 Likes
6,909

Hi,

Try the code below:

FIELD-SYMBOLS: <f_fscomp> TYPE ANY,

<f_fs1> TYPE ANY.

LOOP AT it_component ASSIGNING <f_fscomp>.

ASSIGN COMPONENT 'SOBKZ' OF STRUCTURE <f_fscomp> TO <f_fs1>.

<f_fs1> = '3'.

ENDLOOP.

Regards.

Kannaiah

Read only

Former Member
0 Likes
6,909

Hi ,

It is giving the below dump. The parameter is importing parameter and it does not allow to change even using field symbol. Is there any other way. Is there an user exit which will be called when pressing enter button in component screen. The exit EXIT_SAPLCOBT_001 did not work for this.

Error analysis

The program tried to assign a new value to the field "<F_FS1>" even though

it is protected against changes.

The following objects are protected:

- Character or numeric literals

- Constants (CONSTANTS)

- Parameters of the category IMPORTING REFERENCE for functions

and methods

- Untyped field symbols to which a field has not yet been assigned

using ASSIGN

- TABLES parameters if the corresponding actual parameter is protected

against changes

- USING reference parameters and CHANGING parameters for FORMs if

the actual parameter for this is protected against changes

Regards,

Prabaharan.G

Read only

0 Likes
6,909

Hi,

Yes it wont allow for the changes.

check the following exit:

EXIT_SAPLCOKO1_001

Regards

Kannaiah

Read only

Former Member
0 Likes
6,909

Hi,

The break point is not stopping there in this exit.

Regards,

Prabaharan.G

Read only

0 Likes
6,909

Hi,

Check whether the Exit is active or not. Go to SMOD and test the following enhancement: PPCO0012.

Regards

Kannaiah

Read only

Former Member
0 Likes
6,909

Hi Kannaiah,

EXIT_SAPLCOBT_001 was called correctly but it gets triggered once the order is saved and changing the table parameters after the order saving does not update the value. Is it advisable that I write code to update explicitly using some BAPI and call it in the above exit with a delay of 2 seconds or so. Please reply.

Regards,

Prabaharan.G

Read only

Former Member
0 Likes
6,909

Hi Kanniah,

Thanks a lot for your field symbol suggestion . I used exit EXIT_SAPLCOMK_014 and used field symbol technique to solve this. Thanks a lot again.

Regards,

Prabaharan.G

Read only

Former Member
6,909

EXIT_SAPLCOMK_014 does what is required

Read only

0 Likes
6,909

Hi,

I tried the same procedure, but I still have the dump "Assignment error: Overwriting a protected field".

In exit EXIT_SAPLCOMK_014 I write:

FIELD-SYMBOLS: <f_fscomp> TYPE ANY,

<f_fs1> TYPE ANY.

ASSIGN is_component TO <f_fscomp>.

ASSIGN COMPONENT 'RGEKZ' OF STRUCTURE <f_fscomp> TO <f_fs1>.

<f_fs1> = 'X'.

Could you please suggest me the right code?

Thanks.

Read only

0 Likes
6,909

anyone ..... ?

Read only

0 Likes
6,909

Could someone provide a right solution? The previous code doesn't work.

Read only

0 Likes
6,909

Hi Tiziana,

have you found a solution ?

I try to copy the Sequenznummer from Header to operations.