webMethods step by step SAP adapter scenarios
Jan 29, 2012 21:36 0 Comments Adapters Tomas

 

 

 

Task: SAP Adapter scenarios

 

 

 

OS: WindowsOS

 

Platform: SAP BC 4.7

 

 

 

Sending an IDOC  from a SAP system.

 

 

When a  IDOC is sent by an SAP system it is  received by WM IS and some processing is done on the IDOC or stored in a secondary storage device .

When a IDOC is received a flow service in IS has to be executed , we have to give the service  name , folder name and package name in the routing role(when a routing rule is defined).

 

 

 

Receive an IDOC service:

 

 

->  Sap.idoc.decodesdata    (byte array to values object (with key & value)).

->  Sap . idoc . encode

 Service out (XML Data  -------------- IDOC data) (IDOC in values format to XML string)

-> Sample.IO.test.write to file

                 Filename   : file path ........... XML

 IDOC  data  ----------  file content

 

 

For test sending an IDOC to wM IS

 

1) Open web browser and paste the link  

http://localhost:5555/SAP/submit-IDOCXML.html

 

 

2) Copy and paste the IDOC  in text area (IDOC which is in XML format).

 

3) Modify the fields

Receiving logical system name given by SAP people(Found in routing rule)

 sending logical system  name given by  SAP people (or found in Routing rule)

 

 message type MATMOS(ORDERS) INVOICE/------------ Given by SAP

 

4) Click on the submit  button to send the IDOC to an IS

 

 

Sending an IDOC (MATMAS)  format to an SAP system and Data in the form of XML file.

Steps:

 

1) Get an sample MATMAS DOC  in  XML format.

 

2) Create a DTD from the MATMAS XML file . This is a document type in (MATMAS FORMAT)

 

3) Collect the mandatory  fields  for MATMAS and create a Document with the fields

 (IDOC _ MAN).

 

4) Create a document  type with the configurations for sending an IDOC

  (IDOC--CONFIG)

 

DOCUMENT:

-> Table name  -- EDI  - DC40

-> Direct  (2 for sending)

- > IDOC type (MATMAS 01/02/03)

-> Message type (MATMAS)

-> SNDPOR – MIR 57

-> SNDPRN  -- MIR 57 LS (logical system name created in SAP server)

-> SNDPRT  -- LS  (Partner type)

-> RCVPOR --  SAP IDS

-> RCVPRN – IDS47800

-> Receiver port - LS

 

5) Create an XML Document  from  the  XML file (Data in XML format) (IDOC __ XML) 

 

6) Send  IDOC service (For sending an IDOC) 

 

->  get file                                                            inputs

 

File name :  Path                                  DTD ref of (IDOC -- CONFIG)

 

Load AS    :  bytes                                DTD  ref of (IDOC --MAN)

 

-> String to document (SAP BC 4.7) XML String to XML node (WM 6.1)

 

      Body

 

              Bytes ---> file data

 

->  Document to record (SAP BC 4.7)  XML  node to document (WM 6.1)

 

             Bound node --  (Ref DTD/ document of XML)

 

                                       MATMAS 03.outbound : XML(XML)

 

->  MAP

 

IDOC  configuration (all fields    ->    

 

IDOC – MAN            (all fields   ->  (MATMAS - FORMAT)

 

       XML                   (all fields   ->     (recognised fields)

 

 ->  Transform  hierarchy to flat  [pub.sap.idoc.transform hierarchy to flat]

 

    (MATMAS - format)  ------  bound node

 

[reformat  IDOC  fromhierrachia format to RFC format]

 

-> Outbond process [pub. Sap.transport.ALE.OUTBOUND Process]

 

            Transport  params   -> server : SAP server name – WM SAP

 

            [To send an IDOC to SAP server ]

  

DEBMAS and ORDERS IDOCS sending Same as MATMAS but          mandatory fields changes

 

-> In SAPBC developer 4.1  we can create an SAP IDOC (document type) by giving the parameters IDOC type : ORDERS 02 / MATMAS 03/

 

-> In SAPBC 4.6 Document is called a RECORD. 

 

1) SAPBC  ------>  SAP

 

-> We  just  have  to give the package name and folder name while configuring  SAP BC -> SAP map  and a service name is given.

 

-> After that by refreshing the developers page we can find that service in the path.

 

 2)   SAP  ------->   SAP BC

 

-> We have to give the package  name and folder name while configuring. SAP 

 

->  SAP BC map and a service which is already created in any folder (folder name) and service name has to be given while configuring SAP -> SAP BC map.

 

-> Then when we refresh our developer browser a flow service is created in our developer in the same package in which we had given ref of WM service.

 

-> The service name is same(SAP service) which is by default stored in path.

 

         SAP -> INBOUND -> WMSAP ->  BAPI-COMPANY CODE -> GETLIST

 

                                        (SAP server name)                       (SAP service name)    

 

 Which invokes our add service.

 

-> Double click on BAPI – COMPANY CODE _ GETLIST and  copy all the input and output fields and paste it in our service  (add ) map the require fields and save.

 

-> SAP system will call BAPI – COMPANY CODE –getlist which in turn calls our wM flow service add by the input parameters provided by SAP system and output is generated by our service (add).which is then provided to BAPI – COMPANY CODE –GETLIST flow service then to SAP system.

 

Prev Next
About the Author
Topic Replies (0)
Leave a Reply
Guest User

You might also like

Not sure what course is right for you?

Choose the right course for you.
Get the help of our experts and find a course that best suits your needs.


Let`s Connect