Skip to Content
avatar image
Former Member

BADI for Updating work order component data

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

8 Answers

  • avatar image
    Former Member
    Oct 09, 2007 at 06: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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 09, 2007 at 06: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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 09, 2007 at 07: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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • avatar image
    Former Member
    Oct 09, 2007 at 07: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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      Yes it wont allow for the changes.

      check the following exit:

      EXIT_SAPLCOKO1_001

      Regards

      Kannaiah

  • avatar image
    Former Member
    Oct 09, 2007 at 07:52 PM

    Hi,

    The break point is not stopping there in this exit.

    Regards,

    Prabaharan.G

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

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

      Regards

      Kannaiah

  • avatar image
    Former Member
    Oct 10, 2007 at 04: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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 11, 2007 at 05: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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 28, 2007 at 02:20 PM

    EXIT_SAPLCOMK_014 does what is required

    Add comment
    10|10000 characters needed characters exceeded