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: 

EDI inbound Idoc processing for testing purposes

Former Member
0 Kudos
1,097

Hi, I'm new to SAP and ABAP. I produced an ORDERS03 Idoc with my own app on a PC and I want to import and process it in SAP in order do test the contents of the Idoc.

I uploaded it with GUI_UPLOAD (in SE37), but I don't know how to process it from there. I did set up a customer in WE20 for msgtype ORDERS process code ORDE.

I was trying to invoke EDI_DATA_INCOMING, but it wants a filename on the server, and I don't have the means to put a file on the server, that's why I try to make GUI_UPLOAD work.

Can anyone point me in the right direction, or give me a URL with useful information. I read a lot on the forum but it did not help me further yet. Thanks.

7 REPLIES 7

Former Member
0 Kudos
391

Hi,

I think you can try with the FM :MASTER_IDOC_DISTRIBUTE.

Pass the control header and the data part of the idoc to the tables parameter of the FM and then try.

To check the idoc you can goto WE05,give the basic type or idoc number and view the details of the idoc.

Hope it was useful.

Thanks,

Sandeep.

0 Kudos
391

Hi Sandeep, Thank you for answering my question.

I tried MASTER_IDOC_DISTRIBUTE, but I don't know what to fill in in most of the fields of the MASTER_IDOC_CONTROL parameter. And I don't what to write in OBJ_TYPE.

And I was not able to make WE05 work, but I suppose that was because I did not distribute any Idocs at all.

This is just a status update, I'll probably be back with more questions.

Thanks again and regards,

Jos Smit

ferry_lianto
Active Contributor
0 Kudos
391

Hi,

Welcome to SDN.

IDoc usually deals with application server for incoming inbound file.

But if you still want to deal with PC then perhaps you can do something like this.

1. Upload the IDoc file using GUI_ULOAD and save the data into SAP internal tables in format EDIDC and EDIDD.

2. Use FM IDOC_INBOUND_WRITE_TO_DB to create and post an IDoc. Please ensure your distribution model (BD64) and partner profile (WE20) are setup properly.

If you are having a problem, perhaps you check program RSEINB00 (upload IDoc file from application server) and use as reference.

Regards,

Ferry Lianto

0 Kudos
391

Hi Ferry, thank you very much for replying my question.

You have overestimated me. I have follow up questions.

1. How do I save the tables in a certain format. The floppy button at the top seems to do something different (I am still in SE37, test FM). I did discover now that EDIDC is a table (and that I can view it in SE16), and that EDIDD is a structure, I supposed it defines the structure of EDIDC.

2. When I want to use IDOC_INBOUND_WRITE (from SE37 again) it wants to know PI_STATUS_MESSAGE and PC_CONTROL_RECORD. I don't know what to fill in.

Setting up a distribution model in BD64 dazzles me even more, it is asking a lot a fields that I don't know what to fill in. Btw, I'm glad you pointed out the distribution model for me because no other documentation did.

How is the distribution model related to other entities?

Where can I find program RSEINB00? Is it an executable on the server? In that case I don't think I have access to it.

Can you still help me along is do I have a too long way to go.

Thanks and regards,

Jos Smit

ferry_lianto
Active Contributor
0 Kudos
391

Hi Jos,

1. How do I save the tables in a certain format. The floppy button at the top seems to do something different (I am still in SE37, test FM). I did discover now that EDIDC is a table (and that I can view it in SE16), and that EDIDD is a structure, I supposed it defines the structure of EDIDC.

I am not sure your PC IDoc file format but you upload the information and map to the internal tables I_EDIDC and I_EDIDD. Please declare both internal table same as tables EDIDC and EDIDD.

It would be quicker to write simple ABAP report instead of testing around SE37.

2. When I want to use IDOC_INBOUND_WRITE (from SE37 again) it wants to know PI_STATUS_MESSAGE and PC_CONTROL_RECORD. I don't know what to fill in.

No need to fill up the import parameters PI_STATUS_MESSAGE just declare an internal table I_EDIDS LIKE EDIDS. Please check this sample codes.


DATA: I_EDIDC TYPE EDIDC OCCURS 0 WITH HEADER LINE,
      I_EDIDD TYPE EDIDD OCCURS 0 WITH HEADER LINE.

DATA: DOCNUM  LIKE EDIDC-DOCNUM,
      STPROC  LIKE SY-SUBRC,
      I_EDIDS LIKE EDIDS,
      I_TEDE2 LIKE TEDE2.

...

PERFORM FILL_EDIDC.
PERFORM FILL_EDIDD.

CALL FUNCTION 'IDOC_INBOUND_WRITE_TO_DB'
  EXPORTING
    PI_STATUS_MESSAGE       = I_EDIDS
  IMPORTING
    PE_IDOC_NUMBER          = DOCNUM
    PE_STATE_OF_PROCESSING  = STPROC
    PE_INBOUND_PROCESS_DATA = I_TEDE2
  TABLES
    T_DATA_RECORDS          = I_EDIDD
  CHANGING
    PC_CONTROL_RECORD       = I_EDIDC
  EXCEPTIONS
    IDOC_NOT_SAVED          = 1
    OTHERS                  = 2.

...

FORM FILL_EDIDC .

DATA: L_PORT    LIKE EDIDC-RCVPOR,
      L_PARTNER LIKE EDIDC-RCVPRN.

CLEAR: L_PORT, L_PARTNER.
CONCATENATE 'SAP' SY-SYSID INTO L_PORT.
CONCATENATE SY-SYSID 'CLNT' SY-MANDT INTO L_PARTNER.

CLEAR I_EDIDC.
REFRESH I_EDIDC.
I_EDIDC-MANDT     = SY-MANDT.
I_EDIDC-DOCNUM    = SPACE.
I_EDIDC-DOCREL    = SPACE.
I_EDIDC-STATUS    = SPACE.
I_EDIDC-DIRECT    = '2'.
I_EDIDC-RCVPOR    = L_PORT.
I_EDIDC-RCVPRT    = 'LS'.
I_EDIDC-RCVPRN    = L_PARTNER.
I_EDIDC-MESCOD    = 'ASN'.
I_EDIDC-SNDPOR    = L_PARTNER.
I_EDIDC-SNDPRT    = 'LS'.
I_EDIDC-SNDPRN    = L_PARTNER.
I_EDIDC-CREDAT    = SY-DATUM.
I_EDIDC-CRETIM    = SY-UZEIT.
I_EDIDC-STDMES    = 'DESADV'.
I_EDIDC-MESTYP    = 'DESADV'.
I_EDIDC-DOCTYP    = 'DELVRY03'.
I_EDIDC-IDOCTP    = 'DELVRY03'.
I_EDIDC-UPDDAT    = SY-DATUM.
I_EDIDC-UPDTIM    = SY-UZEIT.
APPEND I_EDIDC.

...

Setting up a distribution model in BD64 dazzles me even more, it is asking a lot a fields that I don't know what to fill in. Btw, I'm glad you pointed out the distribution model for me because no other documentation did. How is the distribution model related to other entities?

If you are not familiar with BD64, I would suggest to work with ALE/IDoc folks.

I don't know where to start to explain about distribution mode. It is a complex process. Please check this link perhaps it may help you to start

with.

http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm

Also check this online documents for ALE and IDoc as well.

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

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

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

http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVEDISC/CAEDISCAP_STC.pdf

http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVEDI/CAEDI.pdf

Where can I find program RSEINB00? Is it an executable on the server? In that case I don't think I have access to it.

You can go to transaction SE38 to execute or display the source codes.

For your case, you may not need this program but take a look the logic perhaps it may help you to build your own program to upload IDoc file from PC.

Regards,

Ferry Lianto

0 Kudos
391

Wow, that is a lot of information. Thanks. I'll spend tomorrow investigating all of it.

Former Member
0 Kudos
391

Jos,

Please let me few things about the setting u have made already.

and do let me know how u produced an ORDERS03 Idoc.

Hope this is a Flat file.

There are few steps/settings u need to do before posting an inbound IDocs.

As far as my knowledge and experince goes Model distribution has nothing to do with EDI, but with ALE. (Please correct me folks if i m wrong). So do not get in distributing models.

Hope i m clear ......... so do reply.

Regards,

Sai.