View
88
Download
7
Embed Size (px)
Developing your own ALE scenarioALE scenario development = + Creating an IDOC + Creating an outbound program + Create an inbound program + Setting ALE configuration
Section #. Chapter #.Page #
Chapter Title
Scenario analysis How does the IDOC look like ? How is data being sent ? How is the data being received ?
Section #. Chapter #.Page #
Chapter Title
IDOC creation
Section #. Chapter #.Page #
Chapter Title
IDOC creation Create new segments Create new IDOCs Create a new message type Link message type with IDOC type
Section #. Chapter #.Page #
Chapter Title
Create New Segments
Section #. Chapter #.Page #
Chapter Title
How to create Segments
Section #. Chapter #.Page #
Chapter Title
Create IDOC type
Section #. Chapter #.Page #
Chapter Title
How to create IDOC types
Section #. Chapter #.Page #
Chapter Title
Create new message type
Section #. Chapter #.Page #
Chapter Title
Link message type with IDOC type
Section #. Chapter #.Page #
Chapter Title
Outbound program development
Section #. Chapter #.Page #
Chapter Title
Outbound program Program logic How is the IDOC being IDOC created ? Triggering How is the IDOC creation kicked off ?
Section #. Chapter #.Page #
Chapter Title
Slide Idea !
Program logicIDOC program Select data from application tables Fill data into IDOC Pass IDOC to ALE layer (Call function MASTER_IDOC_DISTRIBUTE) Commit Work
MASTER_IDOC_DISTRIBUTE Receiver determination Segment filtering Version Control Dispatch Control ALE layer
Section #. Chapter #.Page #
Chapter Title
MASTER_IDOC_DISTRIBUTECall function MASTER_IDOC_DISTRIBUTE?
Exporting
?master_idoc_control:?
IDOC control record returned information about the distribution IDOC data segments
Tables
?communication_idoc_control: ?master_idoc_data:
Section #. Chapter #.Page #
Chapter Title
Control Record information Control record contains general information about the IDOC (Envelope) Control record is field string with structure EDIDCRelevant fields: ?MESTYP: Logical message type Basic IDOC type
?IDOCTP:
Section #. Chapter #.Page #
Chapter Title
Data Record information Data records contain the data of the message Data records are passed as an internal table with structure EDIDD Relevant fields:
?SEGNAM: ?SDATA:
Segment type of the specific IDOC data record 1000 byte-long character field for the data of the specific IDOC data record
Section #. Chapter #.Page #
Chapter Title
Slide Idea
Filling an EDIDD structureHeader (55bytes) . SEGNAM . SDATA (1000bytes)
EDIDD
Z1SEG
Field1 10
Field2 ABC
Field3
Field4
MOVE Z1SEG to EDIDD-SEGNAM MOVE 10 to Z1SEG-FIELD1 MOVE ABC to Z1SEG-FIELD2 MOVE Z1SEG to EDIDD-SDATA
Section #. Chapter #.Page #
Chapter Title
General Programming rules? Design Guidelines for creating IDOC data records: Left-justified filing of IDOC Fields
Replacing SAP codes with ISO codes
?currency keys ?country keys ?unit of measure ?shipping instructions Converting Currency Amounts
Section #. Chapter #.Page #
Chapter Title
Left-justified Filling? All fields must be left-justified?
Character fields:
?automatic?
Non-character fields:
?Condense statement must be used ?Check IDOC documentation to find out which fieldsrequire a condense
?All types unequal to char, cuky, clnt, accp, numc,dats, tims or unit require a condense
Section #. Chapter #.Page #
Chapter Title
Code Conversions? Replacing SAP codes with ISO codes Currency keys: currency_code_sap_to_iso Country keys: country_code_sap_to_iso Units of measure: unit_of_measure_sap_to_iso Shipping instructions: sap_iso_package_type_code
Conversion of currency amounts currency_amount_sap_to_iso
Section #. Chapter #.Page #
Chapter Title
Code Example? MASTER_IDOC_CREATE_XAMPLE
Section #. Chapter #.Page #
Chapter Title
Exercise 2? Write outbound program ? Maintain Distribution Model
Section #. Chapter #.Page #
Chapter Title
Slide IDea
Triggering Select Data IDOC program Fill IDOC Call MASTER_IDOC_DISTRIBUTE
?
MASTER_IDOC_DISTRIBUTE ALE layer
Section #. Chapter #.Page #
Chapter Title
Triggering Options Transaction Data: IDOC created when application document is created 2 Options: Hardcoded call to ALE layer Message Control triggers call to ALE layer Master Data: IDOC not imediately created 2 Options: stand-alone program to create IDOC Change-pointer based trigger
Section #. Chapter #.Page #
Chapter Title
Hardcoded-ALE-layer callApplication Posting Post Application document
(Optional)
Need to create IDOC If yes Create IDOC Call ALE layer Commit Work
Customer Distribution Model
ALE layer
Section #. Chapter #.Page #
Chapter Title
Example
Section #. Chapter #.Page #
Chapter Title
Output DeterminationApplication Posting Post Application document Customer Distribution Model
Determine Output Commit Work
Output Determination If Output ALE (RSNASTED / ALE_PROCESSING) Get Process Code Call IDOC module Call ALE layerALE layer IDOC module IDOC_OUTPUT_ Read application data Fill IDOC
Section #. Chapter #.Page #
Chapter Title
IDOC module? IDOC program has to be implemented as function module ? Naming Convention: IDOC_OUTPUT_ ? Function module gets object key passed from message control. The object key is the primary key to the application object (I.e. Order number) ? Function module logic:? ?
Read application document using object key Fill IDOC structure
Section #. Chapter #.Page #
Chapter Title
Differences? Function module doesnt call Commit Work ? Function module doesnt check distribution model ? Function module doesnt call MASTER_IDOC_DISTRIBUTE
Section #. Chapter #.Page #
Chapter Title
ALE configuration? Output determination? ?
Medium:
A (ALE)
Receiver defined in Condition record is converted to receiver defined in distribution model (by ALE layer)
? Publish the new function module? ? ?
Define Outbound Process Code Link Process Code to Function module Refer to Process Code in Partner Profile definiton (message control section)
Section #. Chapter #.Page #
Chapter Title
Example
Section #. Chapter #.Page #
Chapter Title
Change PointersApplication Posting Post Application document Master data
Batch Program(RBDMIDOC) Determine IDOC module Call IDOC module
Create Change Document Are changes ALE relevant ? Write Change Pointers
ALE configuration ALE relevant Fields IDOC Module(Masteridoc_Create_ SMD_) Change pointers Read Change Pointers Fill IDOC Call ALE layer Update Change Pointer ALE layer Master_IDOC_DISTRIBUTE
Commit Work
Section #. Chapter #.Page #
Chapter Title
IDOC module? IDOC module has to be implemented as function module ? Naming Convention:MASTERIDOC_CREATE_SMD_
? Function module reads change pointers information to get data that needs to go into IDOC ? Function module logic:? ? ? ? ?
Read change pointers Fill IDOC structure Call ALE layer Update Change Pointer status Commit Work
Section #. Chapter #.Page #
Chapter Title
ALE Configuration Define change pointer creation
Define which change document fields are to be logged
Change pointer activation
Activate generally Activate per message type
Publish new function module Link message type to function module
Section #. Chapter #.Page #
Chapter Title
Standalone-Program Example: RBDSEMAT Similar to our exercise
Section #. Chapter #.Page #
Chapter Title
Which trigger ?Master data ? Y Only send objects that have changed ? Y Change Pointer available? y Change Pointer based Program Standalone with custom logic to keep track of changes N Standalone program with user-definable selection criteria
N
Section #. Chapter #.Page #
Chapter Title
Which trigger ?Transaction Data ? Y Ensure transactional Integrity? Y Output Determinat ion available ? y Output determinaton based Program User-Exit available? N N See Master data
N
hardcoded ALE layer Modification
Y Hardcoded ALE layer no Modification
Section #. Chapter #.Page #
Chapter Title
Inbound program development
Section #. Chapter #.Page #
Chapter Title
Overview? ALE inbound components? ? ?
Inbound function module ALE customizing Workflow task
Section #. Chapter #.Page #
Chapter Title
OverviewINBOUND_IDOC_PROCESS IDOC Version change Segment filter Field conversion Call function IDOC_INPUT_ Return Variables Read IDOC data Post Application data Send Success info back to ALE layer
ALE configuration Partner Profiles Process Code Function module attribute Function module registry
If ERROR, trigger Workflow Task ALE layer
Section #. Chapter #.Page #
Chapter Title
Inbound Function module? Name: Z_IDOC_INPUT_ ? Interface:?
Import
?Input_Method ?Mass_Processing?
process in dialog or not? used for WF programming Was update in update task used ? Was a Call T