On our training system I reproduced a supplier create with a legacy vendor number. The number survived approval and was missing from the vendor after activation. The change request still showed the number, while the vendor general table did not.

TL;DR

In reuse mode a staging attribute isn't enough.

The supplier SMT mapping must map the field and its X-flag, in both directions.

A partner that is active here and missing in the plant is a different fault, which I wrote up earlier. Here the hub's own vendor was the record that went live without the number.

The request still had the number

The request was a create, type SUPPL1P1, Create Supplier, on data model BP. After activation the status was Final Check Approved, which is 05 in field USMD_CREQ_STATUS of table USMD120C.

On this data model ZZLEGACY is an attribute of entity type BP_VENGEN, the vendor general data. The change documents for that entity still showed the legacy number under the requester user. No later document line had cleared the field, and the approvers had not edited it.

I read LFA1 for the new vendor and found the ZZLEGACY column present but initial. BUT000 has no ZZLEGACY column, because this attribute is not central business-partner data.

The number remained on the change request through submit, approval, and the final check. Reuse mode dropped the number when activation wrote the active vendor from the mapping.

Staging is not the vendor

Data model BP stores the active supplier in the vendor tables under the reuse option. The change request holds the value in staging until activation writes the vendor. On activation the supplier handler maps staging into the vendor API that writes LFA1.

An attribute on BP_VENGEN is only the staging field, and it is not the column on LFA1. For a vendor-only component the customer include is INCL_EEW_LFA1, and the change-flag include is INCL_EEW_LFA1_X. The same component belongs on VMDS_EI_VMD_CENTRAL_DATA, and the flag component on VMDS_EI_VMD_CENTRAL_DATA_XFLAG. On the training system I added ZZLEGACY through those includes, then on BP_VENGEN, and activated the model.

Generate Data Model-Specific Structures had put the component on the generated structure for BP_VENGEN, which I checked with program USMD_DATA_MODEL. Staging could hold the number, which is why the change request still showed it after approval. The mapping that activation runs had not been extended for this component yet.

The mapping activation runs

In MDGIMG I open General Settings, Data Modeling, Extend Mappings, which starts the Service Mapping Tool. This mapping stays on the hub, between staging and the structures activation hands to the vendor API. It is not key mapping or value mapping, which translate a partner on the way to another system.

The central pair for business-partner data is MDG_BS_BP_MAP_2STA together with BP_BP_CENTRL_2API. MDG_BS_BP_MAP_2STA maps the business-partner API structures back into staging for entity BP_CENTRL. BP_BP_CENTRL_2API maps that entity's staging structures out to the business-partner API, which writes BUT000. ZZLEGACY is not an attribute of BP_CENTRL, so that pair never sees it. On the training system the central pair had been extended, and that extension does not carry a vendor-general field.

Vendor general data is carried by two other mappings, one toward the API and one back. SUPPL_BP_VENGEN_2API maps the staging structures to the vendor API, and that is the mapping activation runs. SUPPL_BP_VENGEN_2STA maps the vendor API back into staging when a later change request reads the supplier.

I opened the extension of SUPPL_BP_VENGEN_2API on the training system. The structure node above ZZLEGACY was mapped, and there was no field row for the component itself. Map the field itself, because a node mapping misses a component added under that node later.

The flag row was missing on that mapping as well. Components on VMDS_EI_VMD_CENTRAL_DATA_XFLAG are update indicators, and the vendor API updates a central-data component when the matching flag is set. A blank flag means the vendor API leaves that LFA1 column unchanged. On this reproduction the data component held the number and the flag was initial, so LFA1 stayed initial. The request still reached status 05, because ZZLEGACY is not required and the API accepted the save.

SUPPL_BP_VENGEN_2STA had the same gap, with no field row for the component. A create does not read an existing vendor, so the gap stays hidden until the next change of this supplier. That later request would open with a blank, and a save could write the blank back onto LFA1.

For one attribute on BP_VENGEN, the delivered supplier handler is enough on its own. That class is CL_MDG_BS_SUPPL_HANDLER, and on the training system it had no enhancement on the save. The supplier SMT mappings carry a single extra attribute on this entity. Handler code is for a new node, so I left the delivered handler in place.

The fix: map the field and the flag, both ways

I extended SUPPL_BP_VENGEN_2API and mapped the field, not the node. The source is the staging component, and the target is the same component on VMDS_EI_VMD_CENTRAL_DATA. A second row sets the flag on VMDS_EI_VMD_CENTRAL_DATA_XFLAG when the staging field is filled.

I extended SUPPL_BP_VENGEN_2STA in the other direction, so the active number comes back into staging. Without that row, the next change request for this supplier opens with a blank.

The includes on LFA1, the two API structures, the attribute on BP_VENGEN, and both mapping extensions belong in one transport. The data model was already active with the component on the generated structure, so I did not generate it again. If the component is missing from that structure, generate it before you map. The Service Mapping Tool cannot map a component the structure does not have.

Read LFA1, then open a change

I created a new SUPPL1P1 request on the training system and typed a legacy number I could find afterwards. I submitted the request and let the workflow run through to activation.

After activation I read LFA1, where ZZLEGACY held the number I had typed. I did not take that proof from the change request, which had shown the number even before the mapping existed.

I then opened a change request for that same active vendor. The field opened with that number, which is what SUPPL_BP_VENGEN_2STA is there to do. I saved without editing the field and activated again, and LFA1 still held the number. If the second activation clears the column, the write mapping is still wrong, or the flag is still unmapped.

I walk the following check before I call this kind of field done.

  • The customer includes INCL_EEW_LFA1 and INCL_EEW_LFA1_X contain the component, and the same component is on VMDS_EI_VMD_CENTRAL_DATA and VMDS_EI_VMD_CENTRAL_DATA_XFLAG.
  • The attribute is on BP_VENGEN, the data model is active, and the generated structure for that entity contains the component.
  • SUPPL_BP_VENGEN_2API and SUPPL_BP_VENGEN_2STA each map the field, and the write mapping sets the flag.
  • The supplier handler is still the delivered class CL_MDG_BS_SUPPL_HANDLER, with no local write that skips the mapping.
  • After activation I read LFA1, and then I open a change and read the field again.

A central field has the same shape on a different set of objects. The includes are CI_EEW_BUT000 and CI_EEW_BUT000_X, the entity is BP_CENTRL, and the mappings are BP_BP_CENTRL_2API and MDG_BS_BP_MAP_2STA. I do not point the vendor mappings at that field, and I do not expect the field on LFA1.

The number has to survive activation

The screen, the change request, and the approvals were all reading staging. Reuse mode writes the mapped API payload, rather than copying the staging row onto the vendor. On the training system the column and the staging attribute were already in place. The central mapping had been extended, and this entity never uses that mapping.

I now open Extend Mappings before I call a new supplier field done. The mapping I open is the one for that entity, in both directions, with the field and the flag. One create then has to leave the typed number on LFA1.

If you want to practise this on our training servers, the next MDG batch is at https://saberia.in/training. For help on a live landscape, write to admin@saberia.in or see https://saberia.in/consulting.

Join next MDG batch or admin@saberia.in

All posts · RSS