Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

IDOCS: Inbound non-SAP system

Former Member
0 Kudos

Hi

The outbound idocs works fine. I want to create an inbound goods receipt/movement idoc.

Should i rather write RFC to update the SAP system from a non-SAP system ?

7 REPLIES 7

ferry_lianto
Active Contributor
0 Kudos

Hi Giovanni,

If you want to use RFC, you can use this BAPI <b>BAPI_GOODSMVT_CREATE</b> to create an inbound GR.

If you want to use IDoc, you need to have a middleware to tranform data from external system into IDoc format then you process the IDoc file using progrm <b>RSEINB00</b>. Other solution, you can write custom program to upload the data file, perform data mapping and posting for IDoc type <b>DELVRY03</b>.

Hope this will help and give you an idea.

Regards,

Ferry Lianto

Please reward points if helpful.

0 Kudos

Ferry.

Haven't done BAPIs before. I went to tcode : BAPI and did found BAPI_GOODSMVT_CREATE. I see goods movement and goods receipts.

Should i just move data into the fields, how will/should i address it if there is more then one line item?

I need to somehow trigger inbound movements of production orders receipts,purchase order goods receipt, sales order delivery and goods issue as well as stock adjustments during stock count.

Do you info on BAPI?

Message was edited by: Giovanni Baumann

0 Kudos

Hi,

Your first query...

Should i rather write RFC to update the SAP system from a non-SAP system ?

Always prefer using idocs for posting before BAPI / RFC fucntion module.

As you have mentioned outbound idocs are working fine..which means you are able to create idocs from non-sap system..right? If so you can use same idoc type for posting.

Your second query's answer...

Check out following code for calling BAPI_GOODSMVT_CREATE

You need to code to call function module /BAPI in your posting program as follows..

append the data into the corresponding internal tables and work-area, check for the IMPORT and TABLES parameter in the function module BAPI_GOODSMVT_CREATE.

a. GOODSMVT_HEADER-DOC_DATE = SYST-DATM

b. GOODSMVT_HEADER -PSTNG_DATE = RECEIPT_DATE (Input File)

c. GOODSMVT_HEADER - HEADER_TXT = BATCH ID (Input File)

d. GOODSMVT_HEADER - GR_GI_SLIP_NO = GOODS_INWARD_NO (Input File)

e. GOODSMVT_ITEM-MOVE_TYPE = Constant ‘101’

f. GOODSMVT_ITEM-PO_NUMBER = PURCHASE_ORDER_NO (Input File)

g. GOODSMVT_ITEM -PO_ITEM = PURCHASE_ORDER_LINE_NO (Input File)

h. GOODSMVT_ITEM –PLANT = From Selection Screen (WERKS)

i. GOODSMVT_ITEM – STGE_LOC = From Selection Screen (LGORT)

j. GOODSMVT_ITEM -ENTRY_QNT = QUANTITY_RETURNED (Input File)

k. GOODSMVT_ITEM -NO_MORE_GR = COMPLETE_INDICATOR (Input File). Value ‘X’ if status = ‘X’ else space.

6. Call the function module BAPI_GOODSMVT_CREATE.

7. Use function module BAPI_TRANSACTION_COMMIT to do the commit work.

append the data into the corresponding internal tables and work-area, check for the IMPORT and TABLES parameter in the function module BAPI_GOODSMVT_CREATE.

a. GOODSMVT_HEADER-DOC_DATE = SYST-DATM

b. GOODSMVT_HEADER -PSTNG_DATE = RECEIPT_DATE (Input File)

c. GOODSMVT_HEADER - HEADER_TXT = BATCH ID (Input File)

d. GOODSMVT_HEADER - GR_GI_SLIP_NO = GOODS_INWARD_NO (Input File)

e. GOODSMVT_ITEM-MOVE_TYPE = Constant ‘101’

f. GOODSMVT_ITEM-PO_NUMBER = PURCHASE_ORDER_NO (Input File)

g. GOODSMVT_ITEM -PO_ITEM = PURCHASE_ORDER_LINE_NO (Input File)

h. GOODSMVT_ITEM –PLANT = From Selection Screen (WERKS)

i. GOODSMVT_ITEM – STGE_LOC = From Selection Screen (LGORT)

j. GOODSMVT_ITEM -ENTRY_QNT = QUANTITY_RETURNED (Input File)

k. GOODSMVT_ITEM -NO_MORE_GR = COMPLETE_INDICATOR (Input File). Value ‘X’ if status = ‘X’ else space.

6. Call the function module BAPI_GOODSMVT_CREATE.

7. Use function module BAPI_TRANSACTION_COMMIT to do the commit work.

Hope this will help you.

Cheers,

Nilesh

0 Kudos

Nilesh

The Outbound IDOC is from SAP to Non-SAP. I'm sure that if we don't make use of Business connector or XI it would be difficult to code the layout into a IDOC format.

How can a simmulate a inbound IDOC so that i can see how the layout looks like?

How does the Non-SAP system trigger the BAPI?

Giovanni

Message was edited by: Giovanni Baumann

Message was edited by: Giovanni Baumann

0 Kudos

You can create/simulate your test inbound/outbound idocs from WE19 tcode and do the test run of inbound fm.

Regds

Manohar

Message was edited by: Manohar Reddy

0 Kudos

Hi,

There are two ways of doing this.

1. BAPI.

I am not sure what kind of non-SAP system we are talking about here, but if it happens to be a Java application or a .Net Application these applications can call the BAPI's from their applications using Java Connector (JCo) and .Net Connector (NCo). The other way of doing this is to have the data in a flat file and write a ABAP program which will read the file and call the BAPI.

2. IDOCS

Usually this is used to have integration done between SAP-SAP systems. However, if the data is in a file in a IDOC format, you can call function and make the process as if the IDOC is being sent from another application.

The only different in these two cases, you can monitor the IDOCs using WE02 transaction, where as using the BAPI, you will have either have the appropriate error handling. Also in case IDOC's there will be built in message types and IDCOS types for Goods Receipt.

Regards

Ravi

Note : Please mark the helpful posts.

ferry_lianto
Active Contributor
0 Kudos

Hi Giovanni,

For more information on how to use BAPI, please check this online document.

http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf

http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf

For your case, I would like to suggest to use BAPI instead of IDoc since you do not have middleware system.

BAPi is easy to use in programming. It does not require detail mapping like an IDoc.

The only downside, IDoc has better error handling than BAPI and also has capability to reprocess an error IDoc without recreate from beginning.

Regards,

Ferry Lianto

Please reward points if helpful.