Skip to Content
author's profile photo Former Member
Former Member

Fill standard field in order (IW31) in dependence of custom field

Hello guys,

I'm looking for a way to fill some fields when creating an order (TA: IW31) automatically in dependence of other fields. In my case I created a custom field ZZBKP which I displayed on enhancement tab in order. When filling this field, the SAP standard field ILART should be filled as well.

At the moment I use exits EXIT_SAPLCOIH_018 / 019 for handling the custom field. Unfortunately in this exit I only have the custom fields in access and not the SAP standard fields of structure CAUFVD.

Is there any possibility (exit, BADI, BTE) to get some standard field of an order filled in dependence of some other field?

Regards
Michael

Add comment
10|10000 characters needed characters exceeded

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 11, 2015 at 10:06 AM
    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hm I see the WORKORDER_UPDATE badi and BEFORE_UPDATE method there. Is it really for changing the values? They are all importing parameters which normally means I am not allowed to change them in the method.

      Regards
      Michael

  • Posted on Jun 11, 2015 at 11:43 AM

    I fear there is no such BAdI/Exit. So you may be required to either use

    • an ASSIGN to structure CAUFVD of main program SAPLCOIH
    • an EXPORT TO MEMORY in the exit, and an implicit enhancement in calling form IWO_10018_PAI in include LCOIHF4E of SAPLCOIH

    Warning : Also insure the updated field is correct, as the program won't execute the expected PAI for this field.


    Regards,

    Raymond

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 11, 2015 at 01:13 PM

    Hello Michael,

    This code in the include ZXWOCU07 (user-exit IWO10009) performs your requirement at SAVE event of the Order.


    IF CAUFVD_IMP-ZZBKP = 'XYZ1234567' .
    CAUFVD_IMP-ILART = '023'.
    ENDIF.

    CALL FUNCTION 'CO_IH_SET_HEADER'
    EXPORTING
    CAUFVD_IMP = CAUFVD_IMP.
    PERFORM HEADER_UPDATE(SAPLCOIH).

    Means: When the value 'XYZ1234567' is given in your custom field, then at the Save event of the Order the ILART field will be filled with '023' value. I have tested this. Works fine.

    Hope this helps.

    KJogeswaraRao

    Add comment
    10|10000 characters needed characters exceeded

    • If you are asking technically, I do not think any inconsistencies would happen. Your query is answered to the point. Doubts about inconsistencies if any, is a part of testing. That should be done by you. Once satisfied then only you move forward. These are standard practices of an ABAPer. One thing I can tell you is, I am using this code to default values while creating Orders of few types.