Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

...

Process diagram

The diagram below demonstrates generalized outbound idoc processing (SAP ECC/S4 → SAP FSM).

...

...

Additional process

...

description

...

Info

Keep in mind that even though most of the steps described below are relevant for the majority of objects, some of them are ACTIVITY-specific.

Run the sending program for the object

Navigate to the sending program for activities - /PACG/ECM_TRIG_ACTIE. Enter an activity number and a relevant company ID. Click execute.

...

Start of selection in the sending program

Object key table

In the activity transfer program the values entered in the select-option ‘Activity number’ (S_ACTNR) are looped at and appended to the object key table (LT_OBJKEY). This table will later be passed to the selection class.

Class assignment

Based on the message type, a relevant class assignment is retrieved from table /PACG/ECM_CLASGN. In this case the message type is ‘/PACG/ECM_ACTIVITYOUT’.

Class assignment for each message type is maintained in transaction /PACG/ECM_CLSASSIG - FSM Connector's Outgoing Messages Configuration. Notice that for message type ‘/PACG/ECM_ACTIVITYOUT’ the following selection class ('Data selection') and outbound idoc class ('IDOC class') are currently defined.

...

If no selection class was found for this message type, the program wouldn’t proceed. The selection class is used for dynamic object creation.

Notice that in the selection class’s class-constructor sales area assignment is read.

Proceed to the selection class

Once the LO_DATASEL object has been created, the interface method ‘SEND' can be called.

Notice which parameters are passed to this method and that the activity number entered on the selection screen is passed in internal table LT_OBJKEY as parameter IT_OBKEY. Further processing will take place in the method /PACG/ECM_IF_S_DATA_SEND~SEND of selection class /PACG/ECM_CL_S_SEL_ACTIVITY_E.

Selection class

The general purpose of this method is to prepare a relevant list of objects to pass for the idoc outbound class.

Example of selection logic #1 - sales area assignment check

...

Selection class - examples of selection logic

Object assignment check

For the case of activities, check if any sales area is maintained for the target company and object ‘ACTIVITY’ in Sales Area assignment. If not, the object is not relevant for transfer.

If sales areas are found, it is checked if the selected activity’s sales area matches the retrieved values.

Example of selection logic #2 - activity mapping check

...

Activity mapping check

Ensure that the activity’s type (in this case it’s ‘ASSI’) can be found in the activity type mapping - transaction /PACG/ECM_ACTMAE - Activity code mapping.

Since such an entry can be found for company 1 and type ‘ASSI’, the execution proceeds.

Generate a document

An idoc document is created by method ‘CREATE’ of class /PACG/ECM_CL_S_IDOC. Notice which values are passed as parameters.

Take a look at the current ABAP stack.

...

Basic idoc control data is filled.

Based on class assignment of message type ‘/PACG/ECM_ACTIVITYOUT’ (to be precise, the 'Process code' field), a relevant function module name is determined.

The retrieved function module’s name is /PACG/ECM_S_IDOC_OUTPUT. It is now called to fill the idoc’s header and segments. Notice which data is passed as parameters.

Fill the idoc

Take a look at the current ABAP stack:

...

...

Class /PACG/ECM_CL_S_IDOC

...

Idoc output class

Take a look at the current ABAP stack:

...

The idoc output class gathers all the additional data for objects retrieved in the selection class so that all relevant idoc fields can be filled with properties.

...

The final result of output idoc class processing is the idoc data table which will be passed back to function /PACG/ECM_S_IDOC_OUTPUT and then method CREATE in class /PACG/ECM_CL_S_IDOC.

Hash handling

If no exception was raised and the class assignment configuration has the ‘Use hash’ checkbox set, a hash will be created for the transferred activityobject in method HASH_HANDLING of class /PACG/ECM_CL_S_IDOC.

Info

Please note that starting from Release 2202, use hash option will be always defaulted to true and hidden from the below view.

...

Hash handling prevents resending of already transferred idocs. A hash is created for this activity object based on the idoc’s content. If the same hash has been generated before for this company, message type and activity object number (can be found in table /PACG/ECM_AHASH), the ‘forcesend’ parameter must be checked. In such a case the old hash will be overwritten. Otherwise, the activity object won’t be transferred at all.

...

The idoc will be distributed using the SAP standard function ‘MASTER_IDOC_DISTRIBUTE'.

Back to the selection class

The idoc’s document number is passed back to the selection class method.

Process the idoc

Idoc processing

A function module responsible for idoc processing is assigned to ports in transaction WE21.

...

Idoc segments are read with the function 'EDI_DOCUMENT_OPEN_FOR_PROCESS' based on the imported document number. The function exports the control segment. If no processing errors were raised (e.g. related to idoc’s status) , the function 'EDI_SEGMENTS_GET_ALL' retrieves all the idoc segments.

Send data to the communication channel

Data is sent to the channel with method ‘PROCESS’ of an instance of class /PACG/ECM_CL_S_COM_FACADE.

After determination of the communication channel, the data will be passed for sending to the communication channel.

XML transformation

...

...

It is in method /PACG/ECM_IF_S_CHANNEL~SEND of class /PACG/ECM_CL_S_CHANNEL_XML_WS where the XML transformation will be is called.

The transformation logic is the same for all message types apart from /PACG/ECM_ATTCHMOUT, /PACG/ECM_CHECKLIST_D_O and /PACG/ECM_GENERIC (which require special handling). The outgoing class assignment configuration is read once again, this time to retrieve the XSLT transformation program name . In this case it is /PACG/ECM_OUT_ACTIVITY_1.XSLT. The retrieved XSLT transformation is calledand call it.

The source XML will be transformed to FSM-friendly format (tag names will correspond corresponding to SAP FSM property names). Before transformation. Currently, the XML reflects the idoc field names, as shown below:

...

The control segment and the first segment:

...

languagexml

...

After successful transformation, the XML’s tags correspond to SAP FSM property names:

...

The control segment and the first segment:

...

languagexml

...

The XML is then converted into UTF-8 string and certain ASCII codes are removed from it.

Proxy - send the data to the Message Broker

Before sending the data to the Message Broker, the logical port is determined from mapping in table /PACG/ECM_CACC (to be customized with transaction /PACG/ECM_CACC - Company account assignment).

...

The method ‘SEND_XML_MESSAGES’ of class /PACG/ECM_CL_S_WS_PROXY will be is used to pass the XML to a webservice. Notice that sending Sending of XML will be repeated up to 30 times (the loop will be escaped once the sending is successful). Sending failures might be caused by Message Broker disfunction or internal network issues.

Idoc status and log update

Idoc statuses will be updated based on the success of transfer.

Document process closing is conducted by function ‘EDI_DOCUMENT_CLOSE_PROCESS’. Finally, the statuses and logs are saved by a commit.

Back to the sending program

The successful transfer is confirmed by logs. A new idoc of type /PACG/ECM_ITYPE_ACTIVITY_OUT can be found in transaction WE02.

...