SAP help-Efficient way to look

SAP help-Efficient way to look
Iam really surprised by the way people post links to "sap help" when posting questions.
Is there an efficient and quick way to look the SAP-help when one is looking for special things.

I only got this far

http://help.sap.com/
Pressed the "SAP NetWeaver" link on the left side
pressed "English" documentation
Then SAP NetWeaver Library -clicked "Developers Guide"

I hope up to this poing Iam right,From here on If Iam looking for XI topics like message mapping or BPM;how should I proceed to find it...

---------
Check the below link of help which points to PI 7.0

http://help.sap.com/saphelp_nw70/helpdata/en/c9/775b3b82646c3ae10000000a114084/frameset.htm

And in this topics are organised as which objects belong to which area...

like BPM it is a part of the Integration repository so details about the BPM can be found in Integration repository topic area..

similary mappings.. too
---
I only got this far

http://help.sap.com/
Pressed the "SAP NetWeaver" link on the left side
pressed "English" documentation
Then SAP NetWeaver Library -clicked "Developers Guide"

everybody goes this far only :) ..... once you get on the above page you need to type in the words in the Search option so that you get to the related results.... it is on the Top-right portion of the page
In addition to normal search you can also opt for Advance Search option to filter your search area.
Please note that the search results will contain many additional (un-related) results, so you need to select the required one.

Creating SAX output for Java mapping

Creating SAX output for Java mapping
I have created a SAX parser for parsing my document, which is fairly easy.

I would like to create a document in may mapping using the SAX document creation. I'm just unable to find any documentation on how the SAX document can be created.

Can you help with how I can construct the SAX document in Java.

This is a very good blog where u can have an idea of how Java Mapping is done using SAX parser.

http://www.riyaz.net/blog/xipi-java-mapping-demystified/

Some more stuff for Java Mapping-DOM and SAX:
https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/4143

https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1945
https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1946
https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1947
http://www.javacommerce.com/displaypage.jsp?name=index.sql&id=18232
http://www.javacommerce.com/displaypage.jsp?name=saxparser1.sql&id=18232


You need to create a java mapping for this. Check the blog of Stefan on how to write the code for fetching the complete payload.
https://weblogs.sdn.sap.com/pub/wlg/4774

Then you can use your SAX parser(which you have developed). Make sure you have com.sap.xpi.ib.mapping.lib.jar added to the project folder when you create the java mapping

What do you mean by constructing SAX Dcoument??SAX Parcer parse the document ,if you want define output required format you need write a java mapping such a way.

I found Thorstens blog very helpful, it containe the information needed to create a document using SAX

Services Registry for WSDL created in SAP XI3.0

Services Registry for WSDL created in SAP XI3.0
Q:I know that there was a services registry in PI7.1 but is that any services registry in XI3.0 in order for me to public my created WSDL file to third party developer?

Ans:Registry is a place where you register your WSDL's. So you can Register your SAP & non-SAP (3rd party services - WSDL's) here.

If you are looking to create a WSDL for 3rd party, you cannot.

Checkout the Weblog "Publish services from PI 7.1 to the Service Registry"
https://weblogs.sdn.sap.com/pub/wlg/8788

Ans1:
We dont have any service registry in XI 3.0 to store services or to use existing services ,the service registry concept came in PI7.1.
Regards,

Ans2:

Hi,

but is that any services registry in XI3.0 in order for me to public my created WSDL file to third party developer?
There is no service registry but you can publish your wsdl in uddi server. Check these blogs

https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2683
https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2684

------
Thanks for the blog but is that any different between the service registry with UDDI that the blog mention beside publish the WSDL?

----------
There is no difference between Service Registry and UDDI,Service Registry its based on UDDI 3.0 ,SAP using same UDDI server to store the services,but they named as Service Registry.
------
Removal of Visual Admin (from 7.1), and the need to give it a look of a package (SOA) service registry may have been showcased as separate entity....as mentioned above Service Registry is nothing but UDDI....for more info refer the Features section of this help section: http://help.sap.com/saphelp_nwpi71/helpdata/EN/45/b4ca147d2952f5e10000000a1553f7/content.htm
---------------

What is the purpose of Action, Monitoring Process and Step Group in PI ?

What is the purpose of Action, Monitoring Process and Step Group in PI ?
Q:I have installed and explored new PI 7.1 EHP1 SP03, but i couln't understand some of the new feature.
Could you please sharing with me what is the purpose of the this objects below in the Enterprise Service Builder

1. Action
2. Monitoring Process
3. Step Group

Please give me some reference document regarding above new objects.

Ans:
Monitoring Process:
It is nothing but a BPM which is specifically used for monitoring purposes.....can consider it useful in Business Activity Monitoring (BAM).....all the steps and functions are same as in a BPM.....just that it is to be used for monitoring....say if some time limit is exceeded, cost is beyond some level, etc.

Step group:
If you have certain steps occuring in n BPMs (n >1)....and all these steps are same and occur in the same sequence then you can create a template of these steps and just include this template in the respective BPMs at the required places.....this template is called Step Group.

All these are made available from PI7.1 and documents applicable for PI7.1 should also be applicable for PI7.1 EHP1.....SDN has documentations for all the steps that you are looking for.....may be a simple search can give you the required documents.

Ans1:

Using Step gorup function we can merge a frequently-used sequence of steps into a step group,there are some couple of advanategs using this .But i neevr implemented refer help document

Reusability:You define a step group once and can insert it into other processes or reuse it several times within a process.

Clarity:In the process definition in the process editor, you can show or hide the steps within a step group.When you hide the steps, only the symbol for the step group remains visible. This allows you to improve the overall clarity and comprehensibility of processes, complicated processes in particular.

to know about action tyep refer belwo link

http://help.sap.com/saphelp_nwpi711/helpdata/en/c8/6bb5404cc4762ae10000000a155106/frameset.htm

Call sync BPM from Async BPM - issue

Outline: I'm trying to call a synchronous BPM from an asynchronous BPM in a PI 7.0 SP 14 system.
When doing so i get the following error: Object CL_SWF_XI_MSG_BROKER method SEND_SYNCHRON cannot be executed.

Now this is an oldie when searching the forums for this error message. I do however fail to see a solution to the problem.
Note that the following notes (referred to in similar posts)
- 710445
- 718734
- 830803
are implemented since theese refer to older versions of PI.

My scenario is very simple at present since i've startet from scratch again after getting the error. So what i do is:

1) send async message to async BPM
2) async BPM receives request
3) async bpm transform request til sync_request.
4) async BPM calls synchronous BPM
5) sync BPM receives request and opens a async/sync bridge
6) sync BPM maps request to response
7) sync BPM sends response and closes async/sync bridge
8) async BPM reveices sync_response
9) async BPM sends sync_response to some application

Call sync BPM from Async BPM - issue

Now step 8 i never succesfully executed. Instead the error earlier described is triggered.

For simplicity i use 1 and only 1 message type in all message interfaces. I have mapping between my synchronous interfaces outside of BPM.

The synchronus BPM is executed just fine. The only issue is getting the reponse back to the asynchronous BPM.

I am familiar with the following similar posts:
- https://forums.sdn.sap.com/thread.jspa?threadID=197127
- https://forums.sdn.sap.com/thread.jspa?threadID=592449
but find them to be of no use.
Hope someone can help.

Ans:
Can you tell why are you implementing usch an interface?
Looking at your steps I dont think you need Sync BPM.....there is nothing special that your Sync BPM is doing.
When you say you open an Async-Sync bridge in the BPM it should mean that you receive an Async request....then BPM makes a Sync call.....then the response is send to the calling system and the call is closed.....however looking at the steps that you have implemented there is no such logic (of Async-Sync) seems to be implemented.
Do have a re-look at your requirement and do modifications accordingly.....also when you send the message back to Async-BPM make sure that a correlation is defined & used properly.

Ans1:
If everything is working fine then check with your sender sys parameters and authoriztions....basically Sync/Async bridge helpfull...whn your receiving sys does't have the capability to receive Sync/Async messages....(it converts the calls from Sync to Async and vice versa ) pls study your requirment once again and use proper steps.....hope your scenario will be work.
Ans2:
Ok, thought it was clear inj the outline that what i wrote in this post is a simplified scenario whoose sole purpose is to test the problem giving me problems in the "real" scenario.

So, yes, i do need this functionality:-)

And as for the async/synch bridge i mentioned - this is of cause an sync/async bridge instead. My bad for putting it in the wrong order when writing. As i wrote i have an asynchronous BPM and a synchronous BPM. No correlations should be needed in such a scenario.

Hope it clearifies.
------------

This is all internal workflow communication: 1 BPM calls another. Thus I dont believe authorizations are relevant here.
------------
First you do not need any bridges if it is asyn/sync kind of a scenario in the second BPM. You need a bridge when the bpm has to wait with a sync call coming in and response in an async call. Essentially your BPMs (I donno why you need 2.. but let us go with 2)

{quote:title=Daniel Hans Engsig-Karup wrote:}

1) send async message to async BPM
2) async BPM receives request
3) async bpm transform request til sync_request.
4) async BPM calls synchronous BPM
5) sync BPM receives request


(Remove this if you are calling a sync system here) and opens a async/sync bridge

6) sync BPM maps request to response
7) sync BPM sends response

Remove this and closes async/sync bridge

8) async BPM reveices sync_response
9) async BPM sends sync_response to some application
-------------

Really, as previously statet this is a simplified scenario to test my real world scenario. Im not using a async/sync bridge but a sync/async bridge in the synchronous BPM also as previously statet:-) So this means in my "real" scenario lots of more actions take place than described here.

Please dont worry bout the lag of logic in what I described here, but focus on the error i get when trying to perform the synchronous call from the asynchropnous BPM to the synchronous BPM.

For information im corrently having my basis-team try and implement note 1246527. If it solved the issue i will of cause report so when i know:-)
----
Implementing SAP note 1246527 (BPE-RUN: Synchronous send fails if receiver is process) solved the problem.

XI Adapter Parameters - Server Proxie

XI Adapter Parameters - Server Proxie

Q:Scenario - FILE - XI - ECC
Please let me know the parametres that needs to be given in XI adapter.

Target Host : Is it ECC host
Service NO: What no should i need to give.
Path Prefix:/sap/xi/engine/?type=entry

Username: Should i need to give (ECC 6.0 Details) USERID and PWD..
-------
Target Host : Is it ECC host Yes
Service NO: What no should i need to give.
Specify the HTTP port
Path Prefix:/sap/xi/engine/?type=entry
Yes

Username: Should i need to give (ECC 6.0 Details) USERID and PWD..

Yes
--------------
Thanks for the quick response.
I have given the host name as ECC6.0 and PWD and ID of ECC 6.0
Where can i get the host name(HTTP port)
--------------
In ECC, go to SMICM (TCODE)... You will find HTTP port there...
------------
Where can i get the host name(HTTP port)
---> usually it is 80XX where XX is ur system id . other way you can check in SMICM as mentioned above.
------------
The issue has been resolved and how i have awarded the points.

Problem: Lost network connection Integration-/Enterprise Service Builder

Problem: Lost network connection Integration-/Enterprise Service Builder
Q:Hello! I wondering if anyone could help me with a poor issue on the Integration Builder / Enterprise Services Builder developer tool: When the tools are open and my computer lose the network connection (e.g. switch from wired to wireless network) it's not possible to re-logon and continue the work. Very unhappy situation if you foregot to save before.

Ans:

You can not help with it..!! We all have just live with those annoying exit screens..!!

SOAP Receiver Error

SOAP Receiver Error
Scenario - SOAP (async) -> PI -> SOAP (async).
When PI is trying to send message to WS on receiver side, the SOAP channel is throwing an error.
Do I need to mention the SOAP Action? My SOAP receiver configuration is fairly simple - just the URL (http:// ... ).
Do I need to mention anything else?
Or this error is due to some problem at the receiving WS?

SOAP: response message contains an error XIAdapter/PARSING/ADAPTER.SOAP_EXCEPTION - soap fault: System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: . at System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest() at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message) at System.Web.Services.Protocols.SoapServerProtocol.Initialize() at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)

Adapter Framework caught exception: SOAP: response message contains an error XIAdapter/PARSING/ADAPTER.SOAP_EXCEPTION - soap fault: System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: . at System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest() at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message) at System.Web.Services.Protocols.SoapServerProtocol.Initialize() at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)

Delivering the message to the application using connection SOAP_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: SOAP: response message contains an error XIAdapter/PARSING/ADAPTER.SOAP_EXCEPTION - soap fault: System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: . at System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest() at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message) at System.Web.Services.Protocols.SoapServerProtocol.Initialize() at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing).

----------
Is SOAP Action Mandatory?
---------
SOAP action is not mandatory
----------
Any idea why I am getting above error?
----------
You may be sending a data to a service which requires SOAP action. Are you able to test the webservice, with tool like xmlspy .
------------
I tested it with SOAPUI. I am getting following error with that -




soap:Client
System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: http://sap.com/xi/WebService/soap1.1.
at System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest()
at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message)
at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)





Actually, I have created the DT, MT and Service Interface and I have given the WS team the WSDL from the generated Service Interface. I noticed in the WSDL that there is a SOAP Action - http://sap.com/xi/WebService/soap1.1, which doesn't make too much of sense.

Any idea? Do I need to ask the WS team to provide me WSDL? Why not WSDL from Service Interface works in this case?
Sorry for so many questions ... :-)
-------
Actually, I have created the DT, MT and Service Interface and I have given the WS team the WSDL from the generated Service Interface. I noticed in the WSDL that there is a SOAP Action - http://sap.com/xi/WebService/soap1.1, which doesn't make too much of sense.

You are using the receiver channel. the procedure should be that you should upload the wsdl provided by the target system as an external definition. create DT, MT and MI for receiver side. If its asking for action, it means you need to specify the action, ask the webservice guys,

Any idea? Do I need to ask the WS team to provide me WSDL? Why not WSDL from Service Interface works in this case?
Sorry for so many questions ... :-)

We provide webservice to others when we use soap sender adapter.

----------
I was not aware that for the Receiver SOAP, we need to get the WSDL from the WS team. I thought that might be I can create the structures and provide them the WSDL from MI :-)

I am not closing this thread for the time being, would like to make changes and test. Once it goes through smoothly, then I will close this thread.

Thanks for your help Inder.
------------
Check this link for the SOAP receiver
http://help.sap.com/saphelp_nw04/helpdata/en/29/5bd93f130f9215e10000000a155106/frameset.htm
-----------
For SOAP receiver, never create the DT / MT on your own. Always import the WSDL file.
Also, before importing WSDL and creating the whole scenario, it is advisable to test the WSDL with your end-point using some external tool like SOAPUI. This will help you avoiding a lot of headache.
-----------
That was a helpful tip and it helped in resolving the issue.

Thanks everyone for their valuable input. Closing this thread.

XSL functions help for XML Forms

XSL functions help for XML Forms
Q:I been having some trouble implementing a restriction on the RenderListItem of an XML Forms. I want to display only entries which have the date corresponding to the actual month. To do this I used a simple XSL IF the following way:


...


The Problem seems to be that whenever I use any date related function I get a rendering error: Resource cannot be displayed with XMLResourceRenderer
I don't understand what is wrong as this is the same function that is published in the w3schools website. I managed to isolate the error to date functions. I can't even get the current date using the current-date function:



Is it a limitation associated to the portal? Does anyone know if there is another way to accomplish what I'm looking for?

Ans:
You question seems to be related to the Portal group. Post your question to the Portal Forum. The portal team folks would be able to help you in resolving the issue you are facing.
https://forums.sdn.sap.com/forum.jspa?forumID=41
https://forums.sdn.sap.com/thread.jspa?threadID=110941
--------

The problem is in current-date(). Current date using this function is possible only in XSLT2.0 and PI/XI supports XI1.0. I will suggest you to call java function in XSL and get the current date.
http://help.sap.com/saphelp_nw04/helpdata/EN/55/7ef3003fc411d6b1f700508b5d5211/content.htm

---------
Thank you for your help but I ended up using Time-Dependent Publishing in order to achieve what I needed. It turned out to be a much easier solution. More info can be found here:

http://help.sap.com/saphelp_nw04/helpdata/EN/e8/a9a76828b8dc469969ff450ec81ced/content.htm

FTP to file server - file not reached to file server but in XI success

FTP to file server - file not reached to file server but in XI success
Scenario is

XI is picking file from SAP and sending to a file server. In XI ,communication channel and sxi_moni shows message transferred successfully.

But the file server guys din't receive any file. Can any one tell where the message can be lost. If file is not reaching destination then how come in XI its showing SUCCESSFUL message.

Open the receiver file channel in channel monitoring in RWB and click on the message ID of processed messages.
You can see the audit log there where it mentions the FTP server and path to which the file has been delivered.
Confirm these details with file server team.
Check out the audit log for the message in MDT
http://:/mdt/index.jsp

Also reconfirm the target location(Server,Directory).
Your communication channel is not able to connect with the FTP sever.

Check in RWB the communication channel log also user id, password mentioned in communication channel.

Check whether that user has authorization to create file on FTP sever.
.
Receiver CC itself is stopped polling. Receiver Comm channel is not polling since last 5 days.
You can Select the Communication Channel Monitoring in the RWB and you can restart communication channel again,
here you will also find the SAP UserID who has stopped the CC.

Restar the comm channel and resend the messages probably it will work.

I think this is the way XI works when dealing with EO(IO) messages ... Once msgs have been delegated to the AFW, they are flagged as successfully processed from an IE perspective. But if you look at the MDT tool, you should see your (failed) msgs being either retried or set to an error status (ie, FAILED, NOT DELIVERED) !

ORA-01821: date format not recognized

ORA-01821: date format not recognized
Q:Hi Experts,

I referred the below link to insert records into Oracle database.
http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=%28J2EE3417700%29ID0040647550DB12505920388948501161End?blog=/pub/wlg/2002

But I am getting 'date format not recognized' error.

Along with inserting data I've to convert 24Hr time format to 12Hr format before inserting.

So I used yyyy/MM/dd K:mm:ss a in the constant part before the 2nd concat as explained in the link.

I tried yyyy/MM/dd HH:MI:SS AM also.

Please suggest how this error can be resolved.

Ans:
I am able to convert the 24 hr format to 12 hr format (with AM PM in the end) using the below snippet... Check the cases...

yyyy/MM/dd hh:mm:ss a

-----------
I am getting 'format code appears twice' error now.
-----------
In Audit Log:

INSERT INTO Table_Name (PERSON_ID, PUBLISHED_DATE, ID, FLAG) VALUES (902107, TO_DATE(11/09/2009 23:39:19,MM/dd/yyyy hh:mm:ss a), U420273, N)

Unable to execute statement for table or stored procedure. 'Table_Name' (Structure 'StatementName1') due to java.sql.SQLException: ORA-01810: format code appears twice
-----------
Issue solved by team-member.
currentDate: dd/MM/yyyy hh:mm:ss a
Constant:DD/MM/YYYY HH:MI:SS AM.
---

Error in receiver Mail Adapter of PI 7.1

Error in receiver Mail Adapter of PI 7.1
Q:Hi Team,
I had configured Mail Receiver Adapter in PI 7.1 with the following Parameters.
I had imported the XSD given & Mapped only Subject, From, To, Content fields.
In Receiver Communication Channel parameters are
*Transport Protocol = SMTP
Message Protocol = XIALL
URL = SMTP url given
Authentication Method = Plain
User/ Password given for my id only
MAIL Attributes
From, To = my own company id
Content Encoding = base64*

These are the seeing i had done for Mail Receiver Communication Channel
When I test by HTTP, i am getting Succesful in Moni & in Adapter i am finding this error.

com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error: invalid XIMailAdapter channel 'b7b80e17d9e336b38354f663c01aed68'
Mail Settings have been done in System, got even Test mails from System.

Ans:
URL = SMTP url given

I hope you are making an entry as smtp:// in the URL section
1. I had imported the XSD given & Mapped only Subject, From, To, Content fields.
2. MAIL Attributes
---------
Thanks for the response.

I followed the steps in the blog https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1361

I had created a sender DT with seperate Namespace, is it that I need to maintain SAP Namespace.

If I do not need XSD then How can I have Interfaces, Mappings.

Even in Adapter side i am getting Short Log as not initialized for Mail Adapter.
-----------
See, the XSD that you are referring or the blog is referring needs to
be imported under External Definitions and directly use it in message
interface & message mapping ....you dont again need to create a DT
based on that XSD!......you will need a DT & MT just on the sender
side (in your particular case)

So just create the DT for sender (you seem to have done this part).....import the XSD into IR from this location

https://websmp205.sap-ag.de/~sapidb/012006153200000361852004E/ximail30_xsd.txt

use it on the receiver side.....The only thing that i wanted to mention
is that when you enter the Subject, To, From details in CC you can even
design your own DT for receiver side



I hope that you are entering the URl in this format --> smtp://

Check this thread :http://forums.sdn.sap.com/thread.jspa?messageID=6955347

and this blog to confirm your settings: https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/1798
From, To = my own company id

Are you trying to provide the To, From email ids both in the CC and also in the XSD?.....it should either be in the XSD (when you check Use Mail Attributes) or in the CC (when you uncheck Use Mail Attributes)....since it is SMTP --> XIALL the To, From, Subject should be mentioned in the CC .... the email package XSD is of no use here...even if you create a DT and try to pass this message structure it will pass.

BPM: ParForEach Multiline Issue

BPM: ParForEach Multiline Issue
In an integration process I use the following step sequence:

Transformation: Splitting Abstract Interface A to Multiple Abstract Interfaces A
Block (ParForEach): Loop over multiline container element ( referring to abstract interface a),
and send single message (singleline container element)

Basic behavior of the operations mapping is the following:

abstract interface a ( 1 occurence) -> abstract interface a (0..Unbounded occurences)

Source Message:

submission
...
item
item
item

Target Message:

submission
item
submission
item
submission
item

In this case I would like to loop over the submissions (using a ParForEach Block) and send three single messages with this structure:




My problem now is the following: When I set the proporties of the ParForEach Block I select multiline
container element a - this is working fine - however when I want to select "current line" the dropdown
list of possible container elements is empty.

I have however set up two container elements (both are referring to abstract interface a), for one of them
the multiline option is activated.

Why does this not work as expected? Could it be a problem with the transformation step to create a
multiple messages?

------------

1) The single line element defined is having the block name under the Container column (and not process)
2) Check the First, Second, Third points mentioned in this blog...they should solve your problem:
https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/10526

-----------


Changing the scope of the Current Line container variable to the block (instead of the process) solved the problem!


Processing of messages without namespace

Processing of messages without namespace

Q:I would like to use PI to process XML-messages from a third-party-system to the RFC-Adapter unsing the Plain-HTTP-Adapter. Unfortunately, the third-party-system does not use a namespace in the XML-messages, but in the ESR, there is always a namespace required to model message types.
How can I create the message types for that system in ESR? Currently the only way that I see ist to create a XSD for each message manually and to import the XSD as external definition. Or is there another way to do that?

Ans:I would like to use PI to process XML-messages from a third-party-system to the RFC-Adapter unsing the Plain-HTTP-Adapter. Unfortunately, the third-party-system does not use a namespace in the XML-messages, but in the ESR, there is always a namespace required to model message types.
How can I create the message types for that system in ESR? Currently the only way that I see ist to create a XSD for each message manually and to import the XSD as external definition. Or is there another way to do that?
----------
but in the ESR, there is always a namespace required to model message types.
When you create the message type just remove the entry from XML
namespace section.....namespace wont come while processing....this

-------------



Thanks for your reply. tried it right now. The field is editable, but
unfortunately, the field is mandatory. I think it is not possible to
-----------------
I dont think so.....there is even a blog on SDN which shows how to
remove the namespace and process the message.....message processing
wont be affected if the nemaspce is removed from XML namespace....you
------------
Yes it is possible to have an empty XML Namespace in the Message Type.

What error did you get?



Here, after I activate it, I just get a warning:



Check result for Message Type: Test | http://sdn.sap.com/nfe:

Using an empty XML namespace contradicts the WS-I standard


But it activates it nevertheless.
-----------


can check my reply here:

http://forumsa.sdn.sap.com/thread.jspa?messageID=8366301#8366301
have this field empty.


Sender CC for MS SQL 2005 Driver error invalid object name

Sender CC for MS SQL 2005 Driver error invalid object name
Q:
can some one help me with the following problem?
I'm trying to implement a JDBC to IDoc XI/PI scenario with PI 7.1.
In RWB CC monitor i'm getting the following error : "Database-level error reported by JDBC driver while executing statement 'SELECT * FROM SAP_SALES_TRANS_PAYMENTS WHERE TRANSFERRED_FLAG='0''. The JDBC driver returned the following error message: 'com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'SAP_SALES_TRANS_PAYMENTS'.'. For details, contact your database server vendor".

Communication channel configuration:
JDBC Driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
Connection: jdbc:sqlserver://:1433;databaseName=

Query SQL Statement is : "SELECT * FROM SAP_SALES_TRANS_PAYMENTS WHERE TRANSFERRED_FLAG='0'"
Update SQL Statement: "UPDATE SAP_SALES_TRANS_PAYMENTS SET TRANSFERRED_FLAG='1' WHERE TRANSFERRED_FLAG='0'"

The name of the database is 'SAP_SALES_TRANS_PAYMENTS', is checked. Are the table name and/or table fields names key sensitive?
The MT definition is identical with the data base table.

Ans:
this issue is solved now.
The problem was in the name of the database table. The Database was created for more then one
company codes (by an other partner company ) and the full/right name in the query is

SELECT * FROM dbo.$SAP_SALES_TRANS_PAYMENTS WHERE TRANSFERRED_FLAG='0'

how to assign values to Communication channel dynamically

how to assign values to Communication channel dynamically
Q:I have a requirement where the value coming in this field in the ‘Logon Language’ of the RFC_IN channel. i.e we need to dynamically identify the login language based on this value.
Ans:You can change Communication Channel Parameters using dynamic configuration. In repository write code for 'Dynamic Configuration' in UDF to call the communication channel and change the parameters accordingly. Here is the UDF sample code for your reference to change file name.

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
//conf.removeAll();

DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

String filename= "tb_"a".txt";

conf.put(key1,filename);
-----------
You can change Communication Channel Parameters using dynamic configuration. In repository write code for 'Dynamic Configuration' in UDF to call the communication channel and change the parameters accordingly. Here is the UDF sample code for your reference to change file name.

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
//conf.removeAll();

DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

String filename= "tb_"a".txt";

conf.put(key1,filename);
----------------
This link may help u
http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/3507%3Fpage%3Dlast%26x-showcontent%3Doff
----------------
We cannot dynamically assign value to ‘Logon Language’ parameter in RFC channel as Logon Language is not part of ASMA(Adapter Specific Message Attributes).

Can you explain your requirement and reason behind assigning values to logon field dynamically?
--------------
I wanted to know is there any other way we can assign the language value coming in xml to ‘Logon Language’ parameter in reciever RFC channel. In our scenario(SOAP to RFC) the language value may vary in the input xml
.---------------------
An alternative will be to use different communication channel for this and then in receiver determination check the source field and route to appropriate service

Configure message in its own queue

Configure message in its own queue
Q:My issue is that I receive some messages from a sender system. these are to be processed into my SAP system from PI as idocs. I want to process these messages/idocs in a separate queue. How can this be achieved? When setting "Queue Processing" in Idoc receiver adapter, what more is needed? Is this dependent on a source system also setting a queue id?
Ans:
The procedure for queue processing(Serializing IDocs) has been clearly explained in the documentation-
http://help.sap.com/saphelp_nw70/helpdata/EN/96/791c42375d5033e10000000a155106/content.htm
-----
Thanks, I saw this config, but I had some problems with it, probably because my messages are not defined as EOIO, but EO. I used the Prioritized message function instead to add some interfaces in its own prioritized queue. I think that was more appropriate for me this time.

http://help.sap.com/saphelp_nw2004s/helpdata/en/3c/499240ed38ce62e10000000a155106/content.htm

multiple receivers

Multiple Receivers
Q:I've a interface RFC - File

I need to leave the file in diferent paths depending a value of field source message. (different receivers)

The file is always the same. Only it change the receiver

How can i do it?
---------
Since different receivers you need to route the message, you need to have multiple receiver services and can use the same receiver interface in all...

The use the condition editor in receiver determination and route the message to particular receiver (based on source field)
---------------
Different file paths on different server -> i can't use varible sustitution

II had created,
- a new business service
- a new communication channel
- a new entry in Receiver Determintaion with condition, however below the new business service all is empty..what more need it?
------------
create the necessary communication channels...required for your scenario under it...

if you know already this then please provide more details...
------------
You have to create Interface determination and receiver agreement as well. However as your mapping program is same, you can specify same across all 3 interface determination.
------------
This problem has been solved,

https://forums.sdn.sap.com/message.jspa?messageID=7631993

Now, the problem is other, in message mapping,..
I had open other thread for this,

How to process a text file (mail attachment) using the sender mail adapter

How to process a text file (mail attachment) using the sender mail adapter

Q:Is it possible to process mail attachments using the sender mail adapter? Let's say I have a structured text file (attachment) which needs to be mapped and sent to target system.
Post please any thoughts or experience.

Ans:
Check this blog:
http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/2849%3Fpage%3Dlast

Ans:

Have a look at these helpful links -
1. http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/9e6c7911-0d01-0010-1aa3-8e1bb1551f05&overridelayout=true
2. http://www.riyaz.net/blog/xipi-configuring-the-sender-mail-adapter/
3. http://help.sap.com/saphelp_nw70/helpdata/en/23/c093409c663228e10000000a1550b0/content.htm

Mapping program is not available in runtime cache

Mapping program is not available in runtime cache
Q:Anyone encountered this error in sxmb_moni for PI7.1? I saw the other thread regarding this matter but it wasn't very helpful. The question was answered but the answer posted was very vague. Please help.

About this URL: http://://?style=document -> what's the web service name and endpoint name? Thanks!

Ans:
Is your mapping program assigned to interface mapping?
Is your interface mapping assigned to interface determination?

If answer to above question is YES and you are able to see mapping program in IR, then please do following things.

Refresh IR cache.

Execute SXMB_IFR. Go to Administration --> Repository --> Cache --> Refresh Repository Cache.

You can also refresh individual object here.
----------------
right click on the SCV in IR. then tick Objects are modifiable, then Save.

RFC Connection of Type H missing in SM59 in ECC 6.0

RFC Connection of Type H missing in SM59 in ECC 6.0

I have to create an RFC Connection of Type H, in the ECC system.
Now I am in T-code 59, and do not see this type of connection in SM59.
I can see other Types, mainy 3, G, I, L, T, X.

Our system has ECC 6.0 at level SP18.

Is there a configuration that has to be made, so that this H type of RFC is available in SM59.

Please forward your valuable suggestions ASAP.
In standard cases, there is no such configuration required for making type H RFC destinations visible in sm59. When you simply click on new, then for Connection Type field, couldn't you see type H in options?

Note: Words such as ASAP shouldn't be used on forums. Please have a look at Rules of Engagement first.

First of all, thanks reminder, so that I avoid to use the term.
Yes I see now the type, when I try to create.
I think, as there is no new entry under this type currently, it may not be visible so.

.

SAP Netweaver PI and SOA

SAP Netweaver PI and SOA
Q:I need to give small presentation on SOA and SAP Netweaver PI.
Pls send me blogs/ppt/docs ?

Ans:
check following link .
http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/12650%3Fpage%3Dlast%26x-order%3Ddate
---
Start yours presentaion with explaining about SOA concepts and what is the roles of webservices in SOA ,Then explain about Enterprise Services,What is Enteprise Services and how to use enterprise services,and explain about Sevice Registrty role in SOA.

THEN START explaning about how PI7.1 chnaged accroding to ESOA architecture,and explain some concepts like Global data types,service interfaces concept...How to use sertvices in PI,and how to consume the services and publish the services...

prepare your presentation like that..

REFER BELOW LINK

http://help.sap.com/content/documentation/esoa/docu_esoa_intro.htm

http://www.lac2007.nl/Uploads/Files/SAP_2.pdf

http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/c019bf26-8bb8-2910-4f8f-e9bd55eda650&overridelayout=true

ABOVE LINKS explain about ESOA,and the role ESOA in PI,prepare the presenattion using the documents..

Newbie Question: Install/configure the SAP NetWeaver MDM PI Adapter

Newbie Question: Install/configure the SAP NetWeaver MDM PI Adapter
Q:

I'm new to PI and need to install/configure the SAP NetWeaver MDM PI Adapter.
Can someone guide me or link me up ?

Ans:There is a guide available on SMP: https://websmp205.sap-ag.de/~sapidb/011000358700001890482008E
Check if this helps...section3 should be of your interest.....you need to use S-user credentials to view the above document.


Design Time

 

At configuration time, an integration expert (for example, an integration consultant) configures the integration scenario specified at design time for a specific system landscape to enable the scenario to run in this system landscape.The first configuration task is to identify, the “players” of the game at runtime – the systems that actually communicate with each other – and relate them to the corresponding process components. The following figure illustrates the relationship between the entities defined at design time (above, the communication of two process components including the entities introduced with figure 3) and those relevant at configuration time (below, for an exemplary system landscape). The different colors of the systems indicate the different technical characteristics the systems may be based on:

image

Figure 5: Relationship between design time and configuration time entities

Based on this assignment, an integration expert specifies further details at configuration time on how the messages are to be exchanged between the systems: x How the messages are routed by the integration broker from a sender system to one or multiple receiver systems x How the individual systems (each may be based on different technical characteristics) can be connected to the integration broker (connectivity and adapters) x Which security-relevant settings apply to the data exchange (for example, if messages are secured using digital signatures) The configuration time-relevant concepts and procedures are explained in detail in the chapter  Configuring Integration Content

Phases of an Integration Project

 

Based on this decoupling, it is possible to describe the integration-relevant aspects of a business process at an abstract level first – irrespective of the details of a particular system landscape. We call the corresponding phase of an integration project the design time. At design time, those parts of a business process can be specified that are independent from any technical details which are  implementation-relevant or system landscape-relevant. We have already introduced the integration scenario as a high-level description of the integration at design time and we will continue to use this term in the following discussion. In a later phase – at configuration time – the integration scenario will be configured to run in a specific system landscape. You can consider one and the same integration scenario to be deployed on completely different system landscapes. For example, in one case there is a material management integration scenario that spans only few systems within a midsize company, whereas in another case the same integration scenario spans several hundreds of systems located in the different departments of a large enterprise. The same scenario in this case involves the execution of the same business logic - just on a completely different scale. The scenario is finally executed at runtime and can be monitored by an administrator. The following figure illustrates the relationship of the design time and configuration time view

image

Figure 3: Integration scenario (design time view; left) and assignment of process components to systems of the actual system landscape (configuration time view; right) As an example, the figure shows the systems of the actual system landscape where the business logic of process components 1 and 2 is implemented: Process component 1 is deployed on systems 1a and 1b, whereas process component 2 is deployed on systems 2a, 2b, and 2c. Resulting from this, the communication between two process components is broken down to communication between the systems mentioned above at runtime, whereas the communication is mediated by an integration broker. The three phases introduced here can be considered to be phases of an integration project: They form the basic framework for the detailed description of the concepts in this handbook

Decoupling Business Semantics from Implementation Details

 

The preceding sections have already set out the basic concept. If we assume the different parts of a cross-system business application and their interactions to be “hard-coded” on the individual systems the process spans, then every change at the technical implementation level (such as changing a server address) would entail a change of the whole business process. This is time-consuming, error prone, and does not scale for complex business processes and large system landscapes. Therefore, one basic principle is to decouple the business semantics from the technical details of the concrete system landscape. Business semantics are, for example, the business flow of a process and its separation into individual process components, as well as the structure of exchanged data. These aspects of a business process are merely determined by business considerations rather than by details of the implementation or of the concrete system landscape.

SAP XI/PI Tutorials

Mediation

 

Technically, the business logic of different process components in an integration scenario is implemented on different systems. Let us assume that the systems involved in an integration scenario communicate directly with each other. For example, if the process components run on different SAP systems, one SAP system calls another using a remote function call. We call this kind of communication “point-to-point” or direct communication. However an upgrade to one part of the system landscape would, for example, entail that all individual connections that are affected also have to be adapted as part of the upgrade. In the case of large system landscapes, this approach could easily get out of control since the number of connections grows to the square of the number of systems. However, consider a situation where a central instance interconnects the systems as a communication hub or data hub. We call this type of communication mediated communication and refer to the data hub as the integration broker. With a central instance interconnecting the systems you then have the option to have all integration-relevant information accessible at one central location. In contrast to the point-to-point scenario where there is a “spaghetti-like” arrangement of connections, in a mediated scenario the number and arrangement of connections remains manageable. The following figure illustrates the difference between mediated and point-to-point communication:

image

Figure 2: Point-to-point communication (left) compared to mediated communication (right)

Mediated communication based on an integration broker is executed by exchanging XML messages. Accordingly, in the context of SAP NetWeaver PI we usually speak of message-based integration. The messages contain the business data exchanged between the systems involved in a cross-component process. The message protocol of SAP NetWeaver PI (which the integration broker can process) is based on the W3C standard SOAP Messages with Attachments (see also Messages). Note: While we do cover direct or point-to-point communication (see Setting Up Direct Communication between WSRM-  Enabled Systems), the main focus of this handbook is on mediated communication.

SAP XI Training

Integration of Processes

 

SAP NetWeaver PI is SAP’s implementation of Service-oriented Architecture (SOA) middleware and

facilitates the integration of business processes that span different departments, organizations, or companies. We will start by introducing the term process component which will accompany us throughout this handbook. A process component is part of the value chain of a business application or a business process. If we assume that a business application ranges over different departments of one company, then a process component usually represents one part of the process that is performed in one department. The following figure displays an integration scenario and shows the separation of a business application into its process components (blue icons), as well as the connections between the process components. In the example outlined in the figure, the process components run in three different departments of a company: A, B, and C. Process components can run on different systems, can be hosted in different departments of a company, or can be implemented in completely different companies that have a business relationship to each other. The process components exchange data with each other and thereby ensure that the value chain of the business process as a whole is maintained.

image

Figure 1: Integration scenario showing the interaction of process components

The focus of SAP NetWeaver PI is not on the inner life of the individual process components or how the

business logic is implemented within a process component but rather on how the process components

exchange data with each other. Process integration is all about the choreography of data exchange between

process components.

SAP XI Interview Questions

 

caity5r4jd

Complete XI Backup / Restore in an hour

Systems fail due to many reasons. Some try to recover from the error, learning new things. But most of the time we are in need of a proper backup - restore procedure which is not time consuming. This blog is about taking a complete backup of XI and restoring it to the same state, even after a reinstallation/crash of the operating system. This backup is very specific for oracle database.

Steps to take Backup

Backup files

There are many ways one can take a backup. The most traditional way is to zip it! Lets zip the necessary files.

  • /usr
  • /oracle (including ctrl & data files)

The total size of compressed files comes around 8 GB (the data is for SP15).

Backup registry

image

Take a backup of only for those marked inside red as a registry (.reg) file.

Steps to Restore XI

Restoring XI is a very tricky way. You cant just extract and make the server up instantly. But there is no need for the machine to have oracle installed or any general prerequisite apart from jdk.

File Extraction

Extract the compressed backup to the same location as previously installed.

Registry Updation

Remove the existing registry entries for oracle and sap and run the registry file. Restart your system after updating registry.

Make the oracle database up

The next challenge is to make the oracle database up. Login to <SID>adm, goto console and type

image

C> sqlplus /nolog

SQL> startup mount;

You will get some error like this.

ORA-00214: controlfile C:\oracle\<SID>\origlogA\cntrl\CNTRLCXI.DBF
version 762 inconsistent with file
C:\oracle\<SID>\sapdata1\system_1\cntrl\CNTRLCXI.DBF version 758

Dont panic.

Type

SQL> shutdown;

Now, copy the file from C:\oracle\<SID>\origlogA\cntrl\CNTRLCXI.DBF to C:\oracle\<SID>\sapdata1\system_1\cntrl\CNTRLCXI.DBF.

After copying, now retype,

SQL> startup mount;

This time you will get a different error like the one below for C:\oracle\CXI\sapdata1\system_1\SYSTEM.DATA1

ORA-01113: file 1 needs media recovery

Now, type

SQL> shutdown;

SQL> recover database;

SQL> startup;

Oracle database must be up and running for next step to proceed. These are the only two problems which must be faced.

Register the services

Even though, we updated the registry with the backup services, the services will not be registered. To register the services, the best suggested way is to re-run the central instance step of installation (which takes less than 10 minutes) which has the registering the services step. Make sure you give the same SID and other details in the CI installation.

image

Start the XI Server

Go to MMC and start the instances. Bingo! The server is up and running as on the date of backup.

Final note:

The server is up and the restore is over. But make sure you clear the java web-start cache if your restore is made after applying some patches. If you don’t, you will not be able to see Adapter Engine in any adapter. This is mainly due the different SP versions in web-start and server since the cache is not cleared.

Managing bulky flat messages with SAP XI (tunneling once again) - UPDATED

I've recently run into the challenge of managing a really bulky message (over 25 Mb!) in SAP XI, where both source and target are flat structures. So I wondered: why going through the overhead of memory consuming XML conversion? Can I get rid of it in this case? Sure I can!

Benchmark

At the beginning of May 2006 (after writing this blog) I had chance to benchmark this approach, compared to the classic one (IDoc XML - graphical mapping - JMS conversion from XML to flat). Here are the astonishing results. I won't unveil XI box's sizing here, as I don't consider it very interesting. The only thing I'll say is that both tests were made on the same machine, with the same load conditions.
Test data: 60 messages of 4 Mb each (flat size), "dropped in" XI almost simultaneously.
Processing: pure XI (adapters, routing, mapping)
Results:
- classical method: between 45 and 50 minutes
- this method: 3 minutes

Introduction

The process I am about to describe here could seem a kind of XI nature negation, but I tend to consider it rather another possibility to achieve a goal. Well, you may be asking yourself, what is this goal? It' easier said than done.
I have an IDoc going out of SAP R/3 that must be mapped against a flat target structure (yeah, the good old classic one with a 4 bytes record type at the beginning), which has to be sent to an MQ queue through JMS Adapter.  Unfortunately this IDoc is bulky: its size can easily reach 25 Mb, if weighed flat (imagine when converted into XML!). We all know that managing this kind of message in XI with a mapping that takes place in the J2EE stack (be that graphical, Java or XSLT) can be dangerous, and make our XI box sit down and have coffee&cigarette... ;-)

Flow

So I first investigated the IDoc tunneling technique (also described in this Michal's weblog), sadly realizing that it's only possible when both sender and receiver are SAP systems exchanging the same IDoc with no mapping at all.
Then the weird solution came up to my mind:

  1. R/3 system dumps the IDoc with a file port (in place of the canonical tRfc port) in flat format
  2. XI reads the flat IDoc with a sender file adapter with no content conversion
  3. data are mapped with an ABAP mapping, thus avoiding any unnecessary JCo data flow between the two stacks
  4. a receiver JMS adapter writes data to the queue with no content conversion
Assumptions

I assume you are familiar enough with WE20 (Partner Profiles) and WE21 (Port definition) in SAP R/3, so I won't go into the details of it. I also assume you're able to configure both communication channels (file sender and JMS receiver), as it should also be easier than ever, considering my technique allows to cut short with them (remember: no content conversion). The only thing that needs to be mentioned is probably how to enable ABAP mapping (which comes disabled in a brand new XI installation): you need to change something in the Exhange Profile and reboot your J2EE stack. For this purpose refer to SAP documentation.

Realization

Before drawning into ABAP code, another general concept. You may be wondering where and how I have designed source and target structures... Well, for what concerns IDoc, I create them dinamically by reading XI definition of it, while for legacy target structures it's up to you, but I decided to define ABAP dictionary structures with SE11 trx (you can also have them in an ABAP include as I did for IDoc, see below).
First step is to create an ABAP mapping class, which must implement the standard interface IF_MAPPING (see this documentation chapter for details). For details about ho to create ABAP package, change request and so on, please refer to SAP documentation or have a look at this weblog o' mine, where this steps are given full details.
Here below is a simplified version of my own ABAP mapping, hopefully commented enough to be self-explanatory.

THE ABAP MAPPING CODE HERE

 

------------------------------------------------------------------------------------------------------------------------------------

*******************************************************************
*******************************************************************
* Very important prerequisite: for ZGUA_IDOCSTR_GENERATE_INCL to
* work correctly, if IDoc was changed in the backend,
* it must be manually deleted (and optionally regenerated) in IDX2.
* No automatic refresh is performed by XI in this case because no
* IDoc adapter is actually involved.
*******************************************************************
*******************************************************************

METHOD if_mapping~execute.

  TYPES: idocline(1065) TYPE c.

  DATA: tmp      TYPE string,
        idocline TYPE idocline,
        theidoc  TYPE TABLE OF string,
        edidc    TYPE edi_dc40,
        edidd    TYPE myedidd,
        linenr   TYPE i,
        lv_str   TYPE string,
        lv_tab   TYPE string,
        dummy    TYPE TABLE OF string.

  DATA: lv_trg    TYPE string,                      " target line
        lt_trg    TYPE TABLE OF string,             " target table
        lv_trgstr TYPE string.                      " target table stringfied

* Target structures (DDIC structures)
  DATA: ls_cl TYPE zgua_st_cl,
        lt_cl TYPE TABLE OF zgua_st_cl,
        ls_rm TYPE zgua_st_rm,
        lt_rm TYPE TABLE OF zgua_st_rm,
        ls_tc TYPE zgua_st_tc,
        lt_tc TYPE TABLE OF zgua_st_tc.

  FIELD-SYMBOLS: <idocline> TYPE string.

* Infinite loop for real runtime debugging
* DATA: debug. WHILE debug IS INITIAL. ENDWHILE.

* Process start --------------------------------------------------------------

* Convert source from xstring to string
  CALL FUNCTION 'ECATT_CONV_XSTRING_TO_STRING'
    EXPORTING
      im_xstring = source
    IMPORTING
      ex_string  = tmp.

* Create string table at crlf
  SPLIT tmp AT cl_abap_char_utilities=>newline INTO TABLE theidoc.

* Last row is dirty??? (bad, but done by xstr2str function), so get rid of it
*  DESCRIBE TABLE theidoc LINES linenr.
*  DELETE theidoc INDEX linenr.

* Get the control record
  READ TABLE theidoc INTO edidc INDEX 1.
  DELETE theidoc INDEX 1.
* Check if include with IDoc segments structure has to be regenerated before including it
  SUBMIT ZGUA_idocstr_generate_incl
    WITH idoctyp = edidc-idoctyp
    WITH cimtyp  = edidc-cimtyp
    WITH port    = edidc-sndpor
    AND RETURN.

  INCLUDE zi_my_std_or_cust_idoc/.

* Collect data of data segments ----------------------------------------------------
  LOOP AT theidoc ASSIGNING <idocline>.
    MOVE <idocline> TO edidd.
    seg_e2_e1 edidd-segnam.
    CASE edidd-segnam.
      WHEN 'Z1SEGMENT01'.
        MOVE edidd-sdata TO ls_z1segment01.
        APPEND ls_z1segment01 TO lt_z1segment01.

      WHEN 'Z1SEGMENT02'.
        MOVE edidd-sdata TO ls_z1segment02.
        APPEND ls_z1segment02 TO lt_z1segment02.

      WHEN 'Z1SEGMENT03'.
        MOVE edidd-sdata TO ls_z1segment03.
        APPEND ls_z1segment03 TO lt_z1segment03.

    ENDCASE.

  ENDLOOP.

** Mapping ------------------------------------------------------------
*
* Notice that in this simple case I'm doing just a "trivial" move-corresp.
* but the mapping logic could be as complicated as needed

  LOOP AT lt_z1segment01 INTO ls_z1segment01.
    ls_cl-rectype = 'CLIE'.
    MOVE-CORRESPONDING ls_z1segment01 TO ls_cl.
    ls_cl-crlf = cl_abap_char_utilities=>cr_lf.
    APPEND ls_cl TO lt_cl.
  ENDLOOP.

  LOOP AT lt_z1segment02 INTO ls_z1segment02.
    ls_rm-rectype = 'REME'.
    MOVE-CORRESPONDING ls_z1segment02 TO ls_rm.
    ls_rm-crlf = cl_abap_char_utilities=>cr_lf.
    APPEND ls_rm TO lt_rm.
  ENDLOOP.

  LOOP AT lt_z1segment03 INTO ls_z1segment03.
    ls_tc-rectype = 'TECO'.
    MOVE-CORRESPONDING ls_z1segment03 TO ls_tc.
    ls_tc-crlf = cl_abap_char_utilities=>cr_lf.
    APPEND ls_tc TO lt_tc.
  ENDLOOP.

* ...
* ...      [ MORE MAPPING LOGIC TO COME HERE ]
* ...

* Final steps ----------------------------------------------------------

* Collect target data and put them as fixed length records
  trgstr2flatstring lt_trg ls_cl lt_cl.
  trgstr2flatstring lt_trg ls_rm lt_rm.
  trgstr2flatstring lt_trg ls_tc lt_tc.

* Convert flat string table to string
  LOOP AT lt_trg INTO lv_trg.
    CONCATENATE lv_trgstr lv_trg INTO lv_trgstr.
  ENDLOOP.

* Convert string to xstring
  CALL FUNCTION 'ECATT_CONV_STRING_TO_XSTRING'
    EXPORTING
      im_string  = lv_trgstr
    IMPORTING
      ex_xstring = result.

ENDMETHOD.

------------------------------------------------------------------------------------------------------------------------------------

MACROS CODE HERE

------------------------------------------------------------------------------------------------------------------------------------

* Get segment type from segment definition
DEFINE seg_e2_e1.
  segnam = &1.
  seglen = strlen( segnam ).
*  describe field segnam length seglen in character mode.
  seglen = seglen - 3.                                " get rid of trailing three chars
  &1 = segnam(seglen).
  replace '2' with '1' into &1
    length 3.
END-OF-DEFINITION.

* Put the given target structure or table to the flat strings table
DEFINE trgstr2flatstring.
* We have a table (0..n element)
  if not &3 is initial.
    loop at &3 into &2.
      oneline = &2.
      append oneline to &1.
    endloop.
  else.
    oneline = &2.
    append oneline to &1.
  endif.
END-OF-DEFINITION.

 

------------------------------------------------------------------------------------------------------------------------------------

The report invoked is the real magic one: it exploits a standard function module behind trx IDX2 to get the IDoc definition and dinamically create an ABAP include with all segments definition.

THE REPORT CODE HERE

 

------------------------------------------------------------------------------------------------------------------------------------

*&---------------------------------------------------------------------*
*& Report  ZGUA_IDOCSTR_GENERATE_INCL
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ZGUA_idocstr_generate_incl.

DATA: lv_incname TYPE programm.

DATA: lv_idocdate TYPE d,
      lv_idoctime TYPE t,
      lv_idocts(14) TYPE n,
      lv_incdate TYPE d,
      lv_inctime(6),
      lv_incts(14) TYPE n,
      ls_segdef TYPE idxedsappl,
      lt_segdef TYPE TABLE OF idxedsappl,
      lv_strname TYPE string,
      lv_tabname TYPE string.

*       The dynamic internal table stucture
DATA: BEGIN OF seg,
      name(30) TYPE c,
      BEGIN OF struct,
        fildname(8) TYPE c,
        abptype TYPE c,
        length TYPE i,
      END OF struct,
      END OF seg.

* The dynamic program source table
TYPES: BEGIN OF incstr,
         line(72),
       END OF incstr.
DATA: incstr TYPE incstr,
      inctabl TYPE STANDARD TABLE OF incstr,
      generr TYPE string.

PARAMETERS: idoctyp TYPE edipidoctp,
            cimtyp TYPE edipidoctp,
            port TYPE idx_port DEFAULT 'SAPSID'.

START-OF-SELECTION.

* -------------------------------------------------------------------------------- *
* Init include name.
  CONCATENATE 'ZI_' idoctyp '/' cimtyp INTO lv_incname.

* Refresh IDoc structure, if needed (the function is smart enough :-)
  CALL FUNCTION 'IDX_STRUCTURE_GET'
    EXPORTING
      port                  = port
      doctyp                = idoctyp
      cimtyp                = cimtyp
      release               = ''
      direction             = ''
      saprel                = '46C'
    TABLES
      edsappl               = lt_segdef
*    EXCEPTIONS
*      no_doctyp             = 1
*      wrong_rfc_destination = 2
*      communication_error   = 3
      .

*  IF sy-subrc <> 0.
*    EXIT.
*  ENDIF.

* Caching mechanism: is IDoc metadata younger than generated include?
  SELECT SINGLE upddate updtime
    FROM idxsload
    INTO (lv_idocdate, lv_idoctime)
    WHERE port = port
    AND   idoctyp = idoctyp.
  CONCATENATE lv_idocdate lv_idoctime INTO lv_idocts.

  SELECT SINGLE sdate stime
    FROM trdir
    INTO (lv_incdate, lv_inctime)
    WHERE name = lv_incname.
  CONCATENATE lv_incdate lv_inctime INTO lv_incts.

* Not in synch with IDoc: incldue must be regenerated
  IF lv_idocts > lv_incts.
    SORT lt_segdef BY segtyp pos.

* Create the dynamic internal table definition in the dyn. program
    LOOP AT lt_segdef INTO ls_segdef.
      AT NEW segtyp.
*       Type for segment
        CONCATENATE 'types: begin of' ls_segdef-segtyp ','
          INTO incstr-line SEPARATED BY space.
        APPEND incstr TO inctabl.
      ENDAT.

      CONCATENATE ls_segdef-fieldname '(' ls_segdef-expleng '),'
        INTO incstr-line.
      APPEND incstr TO inctabl.

      AT END OF segtyp.
        CONCATENATE 'end of' ls_segdef-segtyp '.'
          INTO incstr-line SEPARATED BY space.
        APPEND incstr TO inctabl.
*       Internal table
        CONCATENATE 'lt_' ls_segdef-segtyp INTO lv_tabname.
        CONCATENATE 'data:' lv_tabname 'type table of' ls_segdef-segtyp '.'
          INTO incstr-line SEPARATED BY space.
        APPEND incstr TO inctabl.
*       Working area
        CONCATENATE 'ls_' ls_segdef-segtyp INTO lv_strname.
        CONCATENATE 'data:' lv_strname 'type' ls_segdef-segtyp '.'
          INTO incstr-line SEPARATED BY space.
        APPEND incstr TO inctabl.

      ENDAT.
    ENDLOOP.

* Create and generate the dynamic include
    INSERT REPORT lv_incname FROM inctabl PROGRAM TYPE 'I'.
* GENERATE REPORT lv_incname MESSAGE generr.
    COMMIT WORK AND WAIT.
  ENDIF.

END-OF-SELECTION.

 

------------------------------------------------------------------------------------------------------------------------------------

Conclusion

You may find the whole stuff a bit crazy maybe, but I can guarantee that performance is terrific... 1,5 second mapping time for a 20 Mb file in a DEV box!
Last but not least: in my case the source IDoc is custom, so I developed it so that on each segment I always have key field(s) of the parent, just for convenience. If this is not your case, segments numbering and hierarchy is anyway present in the IDoc flat representation and you may need to improve my code in order to handle them in your ABAP mapping.
In the next weblog I will show you how I realized a split of the resulting message into several smaller and packaged messages in order to overcome an MQ limitation of JMS message size.

SAP Developer Network SAP Weblogs: SAP Process Integration (PI)