Sending IDOC from BC to SAP urgent

Hello,
I can receive a document from remote system and put it into records.
How can I send it to SAP as sales Order. I’m interesting in setup routing rules and services which should I use to transfer IDOC to SAP system. If is there any other idea to create sales order in SAP from BC please rewrite.
Thanks,
Marcnus

Hey
We have standard SAP delivered BAPIs for creating sales orders.

BAPI_SALESORDER_CREATEFROMDAT1 (obsolete from 4.6 version)
BAPI_SALESORDER_CREATEFROMDAT2

for calling bapis u can use BAPI look-up functionality and outboundmap from BC to SAP. After fetching the records u can fill the required records/lists for the bapi and outbound map call would do the rest.

hope it helps u…
Thanks

Thanks for reply.
I’ve created outbound map for BAPI_SALESORDER_CREATEFROMDATA (is there something different to BAPI_SALESORDER_CREATEFROMDAT1?). How can I send/view in SAP order document? Is there any additional routing rule need before sending?
Thanks in advance,
Marcnus

When I run my service (generated from BAPI_SALESORDER_CREATEFROMDATA), BC server crash. Anybody could explain me how can I transfer ORDERS01 or
similar via ALE to SAP?
Regards,
Marcnus

I suggest you to test this BAPI in SE37 transaction code in SAP GUI and check whether or not it’s creating sales order in SAP. Check out hte server exceptions for which it crashed…

if u wish u to go for ALE instead of BAPI method, u can use this system service pub.sap.transport.ALE:outboundProcess whose input variables are self-explanatory…
happy sending orders…

Thanks for help Sreedhar Kurella.
I used pub.sap.transport.ALE:outboundProcess to send Idoc to SAP system. When I displain’ Idoc list Idoc which I’ve send appears with following errors:
Status: 56 Idoc with error added
Message: EDI: Partner profile not available

I think it depends of Control Record:
Control record Direction: Inbound Sender: LS/ / IDoc type: ORDERS01 Message: ORDERS
which have no all fields filled.

Is BC should fill this fields (Routing > Routing Rules) or EDI_DC40?

Routing rule on my BC:

Sender: BC
Receiver: SAP100 (logical system on SAP server)
Message Type: ORDERS
Main flow service: wm.PartnerMgr.flows.BC.SAP100RDERS
Transport: ALE (R/3 IDOC)
SAP Destination: TESTSAP

EDI_DC40 I’ve filled with following data:
IDOCTYP ORDERS01
MESTYP ORDERS
MESCOD CS
SNDPOR BC
SNDPRT LS
RCVPOR SAP100
RCVPRT LS

Regards,
Marcnus

Try sending “BC” as SNDPRN and “SAP100” RCVPRN in the Control Record. (In fact the routing rules have the values of receiver/sender and the same values must figure in the IDOC control Record for the IDOC processing to happen in SAP R3)

HTH
Bhavani Shankar

I’ve sent it with following results:
Control record Direction: Inbound Sender: LS/ /BC IDoc type: ORDERS01 Message: ORDERS
Message: EDI: Partner profile inbound not available

Fields in Control Record:
Recipient - Port: ________
Partner type: LS
Partner no.: SAP100

Sender -
Port: BC
Partner type: LS
Partner no.: BC

I’ve got configuration for inbound Partner Profile as -
Partner number: SAP100
Partner type: LS
Inbound parameters -
Message type: ORDERS
Inbound process code: ORDE

Regards,
Marcnus

Could someone rewrite here guide (step-by-step) how to configure Idoc flow from BC (Outbound) to SAP R/3 system (Inbound). Maybe I forgot about something.
Thanks in advance,
Marcnus

I’ve solved my problem.There was a wrong field value in EDI_DC40 -> MESCOD which hasn’t in SAP Partner Profile.
Thanks for help,
Marcnus

Hi Marcin,

Can u please post the guide(step-by-step) how to configure IDoc flow from BC(outbound) to SAP R/3 system(inbound).

we are in very much need of this i am not able to configure the BC properly…

Thanks in advance,
vamshi

Hello,

If the IDOC in BC is in a record, probably you have to convert it using TransformHierarchytoFlat
and then later invoke the OutboundProcess with the TransportParams filled with serverName

HTH
Bhavani Shankar

Hi Shankar,

Thanks for your reply…

I need some help from you…I am totally a new to this…

I have installed the SAP BC 4.6 and SAP 4.6b running on the same machine.From legacy system i will get the XML document into which i have to convert it into idoc and update in SAP.I dont know how to do this…

Can u please help me out…
Thanks,
vamshi

Hi Shankar,

Thanks for your reply…

I need some help from you…I am totally a new to this…

I have installed the SAP BC 4.6 and SAP 4.6b running on the same machine.From legacy system i will get the XML document into which i have to convert it into idoc and update in SAP.I dont know how to do this…

Can u please help me out…
Thanks,
vamshi

Please have a look at the service “sap.demo:handleIDocXMLPost” in SAP Package. This is useful provided the Legacy system sends IDOCs as a XML Document. This posts IDOCs, taking XML as the input.

However, if the input data is not an IDOC, then you must create steps that can convert the input to the IDOC Structure and then invoke the OutboundProcess.

HTH.
Bhavani Shankar

Hi Shankar,

Legacy system in our requirment is Lotus Notus where we created frontend forms for customer master creation when LnUser submits XML doc is created…my doubt is where should i store this XML doc so that SAP BC picksup and converts into IDoc first and then updates into SAP…

Like i have doubts where to store the xml doc,creating routing rules…etc.Can u please helpme out…can u tell me the steps tobe followed…

Basically i can say integration between legacy system to SAP

Thanks,
vamshi

Hi,
I’m also receivin’ XML files from external system.
In my solution first I read file from storage (I wrote simple java service to do it) and convert it to String. Then I use stringToDocument
(it converts string to node) and documentToRecord which conversts node to boundNode. Previous steps are useful for checking xml syntax and various employments. Next I map boundNode to hierarchical record (should generate this record from xml schema) or directly to IDoc. Last steps are transformHierarchyToFlat and OutboundProcess (for sending IDoc to SAP system).
In routing rules you should define sender (BC) and receiver system (SAP) and message type. As transport choose for example ALE (R/3 IDoc) and specify your destination server. Hope it helps.
Regards,
MW

Hi,

First of all thanks for the replies…

Marcin can u please send me the code of java service and procedure for writing the Routing Rules…becos i am new to this…

As shankar told there are some services which takes xml as input and convert into IDoc …etc. Shankar i also have the same query

" But the question is How can the Legacy System write into the IS? "
do u have any idea about this…

Thanks,
vamshi

Looks like you are confused. Routing rules are required only to route the IDOCs to the SAP R3 based on the Sender, Receiver and Message Type combinations. Generally, it is not required when you do a OutboundProcess directly in your SAP BC Service.

Regarding the data transfer, please follow the following steps.

Create a new PORT in the SAP BC as “webMethods/FTP Port”.

Give any number, mention the package name and save. Also change the Access mode to “Allow by default” or specify the Legacy systems IP address only.

By this you have created a FTP Port on your SAP BC.

Further to this, your Legacy system can use “ftp-put” to send data to the IS.
Here, the ftp directory path must be like, for example (/ns/FTPDemo/get) if the servicenamespace is FTPDemo:get

The BC service will have a contentStream object as the input and the first step is to use the “streamToString” service which converts the stream into a string.

This can be further converted to a IDOC using xmltodocument and transformhierarchytoflat.

HTH and have fun.
Bhavani Shankar

Note :
Please refer SAPBCAdministrationGuide.pdf. This will give more details on how to configure ports and allow access. (Note, the PDF file name could be different, but it is surely Adminstration.pdf and available in the docs folder of your SAP BC Server setup.)

Hi Shankar,

Now i am clear that what you are telling…and i am trying these going thru the SAPBCAdministrationGuide.pdf .

And my another challenging requirement is that i want to send the MasterData which is in SAP R/3-Oracle DB to another Oracle DB thru
the SAP BC and IDoc. Can we do this,if so how…

can u guide me if there any solution…

Thanks,
vamshi