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: 

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

Former Member
0 Kudos

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

7 REPLIES 7

Former Member

0 Kudos

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

raymond_giuseppi
Active Contributor
0 Kudos

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

0 Kudos

Hello Raymond,

what to you mean with ASSIGN of structure CAUFVD?

Regards
Michael

jogeswararao_kavala
Active Contributor
0 Kudos

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

0 Kudos

Ok that works, but what effect does it have on normal work with orders? Can it cause any inconsistencies when I call the SAPLCOIH program here?

Regards
Michael

0 Kudos

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.