10-09-2007 7:05 PM
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
10-09-2007 7:24 PM
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
10-09-2007 7:32 PM
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
10-09-2007 8:02 PM
10-09-2007 8:16 PM
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
10-09-2007 8:25 PM
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
10-09-2007 8:35 PM
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
10-09-2007 8:44 PM
Hi,
Yes it wont allow for the changes.
check the following exit:
EXIT_SAPLCOKO1_001
Regards
Kannaiah
10-09-2007 8:52 PM
Hi,
The break point is not stopping there in this exit.
Regards,
Prabaharan.G
10-10-2007 7:14 AM
Hi,
Check whether the Exit is active or not. Go to SMOD and test the following enhancement: PPCO0012.
Regards
Kannaiah
10-10-2007 5:17 PM
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
10-11-2007 6:05 PM
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
10-28-2007 2:20 PM
12-24-2008 10:36 AM
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.
01-13-2009 1:13 PM
06-02-2009 11:47 AM
Could someone provide a right solution? The previous code doesn't work.
09-05-2015 11:06 AM
Hi Tiziana,
have you found a solution ?
I try to copy the Sequenznummer from Header to operations.