IDOC development process

  • View
    142

  • Download
    17

Embed Size (px)

DESCRIPTION

IDOC development process

Text of IDOC development process

IDOC

IDOCPort definition for all examplesSalesorder IDOCCreating a G/L posting IDOC manuallyCreating a G/L posting IDOC using an ABAP programTransaction codesDeveloping IDOCsUsefull programsPort definitionsThis port definition is used in all the examples.Use transaction code WE21 to create a new port.The port should be created as type FILEGeneral data and outbound file

NOTE: Remember to leave Outbound file blank

Inbound file

undefined

undefined

More...

undefined

[Close]

undefined

[Close]

undefined

Salesorder IDOCIn this example a purchase is created, using the SAP standard functionallity for creating salesorders. When the salesorder is saved, and IDOC is automatically generated. Then we use the IDOC test tool to create an order confirmation from the salesorder IDOC.

Create VendorCreate customerCreate partner profilesCreate purchase orderCreate the order confirmation IDOC

Create vendorCreate vendor using transaction code MK01. You can also use an existing vendor.Vendor: T-BILHFNPurch. org. : 001Purchase organization may vary from system to system.Create CustomerCreate a customer using transaction VD01. You could also use an existing customer.In the follwing example the vendor 3471 is used.Create partner profilesCreate vendor partner profileGeneral data

Outbound parameters

Inbound parameters

Create customer partner profileGeneral data

Outbound parameters

Imbound parameters

Create purchase orderUse transaction ME21 to create the purchase order.

To send an IDOC when the document is finished, go to Header -> Messages and change the output medium to EDI.

Then select Further Data and change Dispatch Time to Send immediately. This will create the IDOC as soon as the purchase order is saved.

Save the document.Use transaction WE02 to check that the IDOC has been created without errors

Create the order confirmation IDOCAs the system has not been configured to handle the IDOC flow, the IDOC test tool is used to simulate the flow. TheOrder IDOC is used as a template to create the order confirmation IDOC.Transaction code: WE19Type the number of the Order IDOC in on the start screen and select menu IDOC -> Create to create the template.Change the control record

Note that the name of the port SAPTST may vary from system to system. The name can be seen in the Sender port of the IDOCCreate new E1DK02 segmentThe E1DK02 Document header reference data segment includes references to other documents.The new E1DK02 segment should be created as a copy of the existing E1DK02, and at the same level. Change the following fields of the record:Qualifier: 002Document item: 10Qualifier = IDOC qualifier reference document = 002 = Vendor orderDocument item =: Item number, see the item number on the purchasing document Create E1EDP02 segmentThe E1EDP02 Document Item Reference data includes references to other documents.Create E1EDP02 as subelement of E1EDP01 Document item General DataQualifier: 001 Document: 4500010757 Document item: 10 Qualifier : IDOC qualifier reference document 001 = Customer purchase orderDocument : Document number The number of the purchase order Document item : Item number, see the item number on the purchasing document Changing the ACTION field at header or item levelIf you are working without a confirmation control key, the IDoc must have a processable action code at either header or item level:

At header level, the segment field ACTION of segment E1EDK01 must be filled with the value '000' if the complete purchase order is to be confirmed.

At item level, the segment field ACTION of segment E1EDP01 must be filled with the value '000' or '004' if the PO item is to be confirmed.

Test IDOCAfter the changes have been made, press the Standard Inbound button to generate the IDOC.

If no errors occurs go to transaction WE02 to check if the IDOC has been processed without errors.

If the IDOC has been processed without errors, then display the Purchase order (Transaction ME23). display the item data and double-click on the item line. If all went well, you will now se that the field Acknowl. no. has been filled out.

undefined

undefined

More...

[Close]

[Close]

Find Old Friends

Creating a G/L posting IDOC manually In this example we try to create a FI posting IDOC manually using the IDOC test toll WE19. Creating a partnerThe first step is to create a partnerGeneral settings

Outbound

Inbound

Notes:

1. As message control is not used, the message control parameters should not be filled out

2. Remember to set the Post permitted agent to your own user (Typ: US Agent: )

Creating the IDOCUse transaction WE19 to create a test IDOC from basic type ACC_GL_POSTING01. Control record

E1BPACHE08 Posting in Accounting: General PostingOBJ_TYPE

Object type. Choose an object type from table TTYP

Selected value: BKPFI - Acctg doc.f.initial.

OBJ_KEY

The object key consists of a reference document number and a reference organizational unit.

I dont quite understand this field, but it seems that typing in a random number will do.

Selected value (E.g.): 127387347

OBJ_SYS

Logical system of source document. Choose a system from table TBDLS

Selected value: APOCLNT800

USERNAME

Selected value: WMHEFRN

HEADER_TXT

Document header text

Selected value: My first header text

COMP_CODE

Company code.

Selected value: 1000

FISC_YEAR

Fiscal year

Selected value: 2001

DOC_DATE

Document date

Selected value: 20010617

PSTNG_DATE

Posting date.

Selected value: 20010617

TRANS_DATE

Transaction date.

Selected value: 20010617

FIS_PERIOD

Fiscal period

Selected value: 06

DOC_TYPE

Document type

Selected value: SAE1BPACGL08 Posting in Accounting: General Posting Contains general data for one line item. There most be created a segment for each line item.

Some of the segment fields are the same as in the E1BPACHE08 segment (Company code, date..), and seems that it is not necessary to fill them out if they are filled out in segment E1BPACHE08.

ITEMNO_ACC

Line number in the document.

Selected value debit segement: 10Selected value credit segement 20

GL_ACCOUNT

G/L account number

Selected value debit segement: 0000046000Selected value credit segement 0000046020

NOTE: Remember to to fill in leading zeros !

ITEM_TEXT

Write some text of your own choiceE1BPACCR08 Posting in Accounting: Billing Doc. (Currency Fields, Item)Currency fields for line items.

ITEMNO_ACC

Line number in the document. Use the corresponding number from segment E1BPACGL08.

Selected value debit segement: 10Selected value credit segement 20

CURR_TYPE

Code for currency type e.g. Document currency and Company code currency. The most important types are:

'00' Document currency '10' Company code currency '11' Company code currency, group valuation

See the IDOC documentation for further types. Seems like a new segment has to be created for each type you want to use.

The currency type is required to be able to transfer amounts between different components of the R/3 System such as Financial Accounting and Controlling (using interfaces).

Selected value debit segement: 00Selected value credit segement 00

CURRENCY

Selected value debit segement: EURSelected value credit segement EUR

AMT_DOCCUR

Amount in document currency. In the last line item, you can specify a '*'. The system will then enter the balance of the line items entered prior to the last item as the amount for the last item. Note: Seems not to work.

NOTE: The IDOC has no posting key segment field. Instead use negative amounts for credit amounts.

Selected value debit segement: 1000Selected value credit segement -1000Test the IDOCTest the IDOC using the Standard Inbound button in WE19

undefined

undefined

More...

[Close]

[Close]

Find Old Friends

Creating a G/L posting IDOC using an ABAP program Here we create an ABAP program to extract FI postings from SAP and create an outbound IDOC. When the outbound IDOC has been created, the outbound IDOC is processed using program RSEOUT00. Next transaction WE12 is used to create an inbound IDOC and program RBDAPP01 is used to process it.

PreparationsThe ABAP programProcess outbound IDOCsCreate inbound IDOCsProcess inbound IDOCs

PreparationsUse the partner profile created in Creating a G/L posting IDOC manually or create a similar partner profile.The ABAP ProgramThis program is developed as a standalone program (No use of message control or change pointers). The program flow is: Extract data from BKPF and BSEG

Build the IDOC control record using structure EDIDC.

Build and internal table of structure EDIDD with IDOC segments. EDIDD contains some keyfields, but the data segment field is simply one string, as EDIDD is used for all type of IDOCs. To simplify the process of building this string, use the SAP datastructures with the same name as the segment. E.g for segment E1BPACHE08 use structure E1BPACHE08.

Use function module MASTER_IDOC_DISTRIBUTE to create the IDOCs. Remember to commit.

After the program has been executed, the iDOCs can be viewed using transaction WE02. The IDOCs should habve status code 30 IDOC ready for dispacth. Important: This program can not handle multiple documents, so all po