Tony Rosenthal
Senior CRM Consultant, Bluefin Solutions
ECC Lean Order: Adding a field to the LORD API
28 Mar 2011
ABAP, CRM, ERP
This blog describes an example for integrating a standard sales order field from ECC into the Lean Order Interface so that it can be displayed in the CRM Web UI.
There are essentially 5 steps required:
- Extend the ECC communication structures
- Configure the ECC mapping table
- Register the field in PAI logic to allow save of changed data to ECC
- Extend the CRM structures
- Configure the CRM layout
In the following example we want to display the ‘Your reference’ field of the order (VBKD-IHREZ) in the Web-UI, however the same process can be used to trensfer bespoke fields.
1) Extend the ECC communication structures
First of all we need to identify the correct communication structure of the LORD interface. The following options are available:
- TDS_<object>_COMV
- This contains fields that could be changed
- TDS_<object>_COMR
- This contains read only fields
- TDS_<object>_COMC
- This is a CHAR 1 indicator for each field that is used to derive the correct input status and flags the fields as changed.
<object> is variable depending on the data you are dealing with. In our case we are dealing with header data that need to be able to be changed and therefore we will be applying our enhancements to TDS_HEAD_COMV and TDS_HEAD_COMC.
The following append structures were added to the respective data types in ECC:


2) Configure the LORD mapping table
The next thing we need to do on ECC is to tell the system which field needs to be mapped to our communication structure. This is done by maintaining table LORD_MAPPING.

In here you need to reference the VA03 screen and set the display attributes which are picked up by the *_COMC structure and passed back to CRM to determine the input-readiness.
3) Extend the PAI logic in ECC
Despite the fact that we are dealing with a standard ECC field, we still need to register the fields for PAI processing. This essentially allows the data to be updated in ECC when passed in via the APIs. If this step is not done the changes will be passed to ECC but the new data will be ignored and no update will take place for your field.
There is a BADI available to implement this - BADI_LORD_DO_PAI. Implementing Method IF_BADI_LORD_DO_PAI~ADD_SUPPLY_LIST allows you to register ‘new’ fields to the processing logic.
method IF_BADI_LORD_DO_PAI~ADD_SUPPLY_LIST.
data: ls_supply type tds_field_supply.
if iv_object_id eq 'HEAD'.
clear ls_supply.
ls_supply-field = 'ZZIHREZ'.
ls_supply-check = 'N'.
append ls_supply to ct_supply.
endif.
endmethod.
4) Extend the CRM structures
The next step is to use the AET (Application Enhancement Tool) to automatically extend the ERP order header field in the UI configuration.

5) Configure the layout
Once you have the field available you can configure the layout as normal to display the field in the Web UI.
And then the ECC value is automatically displayed in the UI.

Comments
Thiago Carvalho 08 May 2012
Hi Tony,
thanks for this blog.
I've a problem trying to update VBAK-AUTLF and VBAP-KZTLF, using ERP_LORD_SET and ERP_LORD_SAVE.
I'm setting fields: TDS_HEAD_COMV-AUTLF (value: "X") and TDS_HEAD_COMC (value: "X").
Can you help me?
santa 27 Oct 2011
Hi Tony,
thanks for ur good information .
can tell me what is the error
'data contains errors and cannot be saved '
how this can be resolved
by santa
birmingham
Tony Rosenthal 13 Sep 2011
Antoinio,
Looking at your example I think you are using an unsupported ECC data structure. The enhancement guide attached to OSS 1224179 dscribes these limitations in more detail.
Regards,
Tony
Tony Rosenthal 13 Sep 2011
Antoinio.
The things to check are:
1) The PAI BADI implementation in step 3
2) The extension structures in step 1 are enhanced correctly (i.e. the TDS_object_COMV structure is enhanced to allow the change)
Regards,
Tony
Tony Rosenthal 13 Sep 2011
Ram
The AET (step 4) is accessed via the configuration tool in the UI. To access the configuration tool in the UI (step 5) press F2 on the view in question and then "Configure Layout" assuming you have the right authorisations
There is a lot of documentation on SDN and other forums on these functions
Good Luck
Tony
Ram 13 Sep 2011
Nice Article !!!
Can you please provide more details (if possible screens / tcodes/menu path) for the step#4and 5?
Thanks,
Ram
Antonio 13 Sep 2011
Hi Tony,
thank for your contribution writing on this blog.
But... I've a problem :(
in my scenario i've to display, and change, the field ABLAD at item level of ERP Sales Order.I've called the field ZZABLAD, this one is displayed with the value of ERP sales order, but when i try to change the value from WebUI this one keep the value of ERP.
Do you have any idea, where I wrong?