Versiones comparadas

Clave

  • Se ha añadido esta línea.
  • Se ha eliminado esta línea.
  • El formato se ha cambiado.

Transaction /EDGE/FC_SPRO -> Configuration Folder "Transformations".

...

It is assumed that the XSD of the XML to be transformed has been previously imported into a WSDL and then into the ABAP instance as an ABAP proxy. The procedure is as follows:

  • Import the XML definition, i.e. the XSD, as a WSDL to the SAP system, so that the necessary proxies are created as if a service were being published. This activity is only performed once and must be transported to each environment. The idea is that the ABAP Framework generates a class and an interface with a method, where the only parameter to the method is the XML definition itself. In this way standard tools would be used to deserialise the XML and put it into a simpler ABAP structure.

The proxy created generates an ABAP input structure for the method; this structure is used to traverse the XML and to configure the mapping.

For clarity, the proxy created for electronic invoicing in Costa Rica is shown below, where several operations were created in the WSDL, each with an XML that would be used in the process of both issuing and receiving:

Image Modified

Image Modified

For the reception case where the XML transformation is used, the following structure was generated:

...

  • Transform.
    Transformation code.

  • Name of transformationtransform.
    Description or name of the transformation..

  • Root node of the XML document root node
    XML usually starts from a root or parent node. If this is the case for the transformation that needs to be built, the name of the root node must be indicated here. For example, for Colombia the root node was INVOICE, however for Costa Rica there is no root node, since the most external element of the XML is the message itself; therefore, no root node was indicated..

  • Nodo ítemitem
    Corresponds to the node with occurrence of 0..n or 1..n and that in ABAp is represented by an internal table, which contains the lines, details or items of the invoice.
    If to reach the item node it is necessary to navigate between other structures; these must be separated with a hyphen.

An example of this configuration is shown below:

Image RemovedImage Added

The second configuration to be performed is the actual mapping of the fields. In order to understand the mapping process, it is necessary to take into account the following premises

  • The result of the mapping is two structures. One for headers and one for items..

  • The header structure has the following layout and type:
    Type: /EDGE/FC_ST_PROPERTY
    Disposición:
    Image RemovedImage Added

    When a node that is a list is being mapped at header level, there are two options:
    1. Indicate which record of the list is going to be obtained, this is done with the symbols [n]; where n is equal to the position or record you want to obtain.
    2. If the previous symbols are not indicated, then the transformation engine repeats the same node in the structure as many times as records are found in the list.

  • La estructura de cabecera tiene la siguiente disposición y tipo:
    Tipo: /EDGE/FC_ST_PROPERTY_ITEM
    Disposition:
    Image RemovedImage Added

    When a node that is a list is being mapped at header level, there are two options::
    1. Indicate which record of the list is going to be obtained, this is done with the symbols [n]; where n is equal to the position or record you want to obtain.
    2. The previous symbols are not indicated, then the transformation engine repeats the same node in the structure as many times as records it finds in the list. However, the same ITEM (consecutive) is maintained so that it is clear to which position the mapped nodes belong.

...