290.10. IDoc에 대한 메시지 본문


290.10.1. IDoc 메시지 유형

IDoc Camel SAP 끝점 중 하나를 사용하는 경우 메시지 본문의 유형은 사용 중인 특정 끝점에 따라 달라집니다.

sap-idoc-destination 끝점 또는 sap-qidoc-destination 끝점의 경우 메시지 본문은 문서 유형입니다.

org.fusesource.camel.component.sap.model.idoc.Document
Copy to Clipboard Toggle word wrap

sap-idoclist-destination 끝점, sap-qidococlist-destination 끝점 또는 sap-idoclist-server 끝점의 경우 메시지 본문은 DocumentList 유형입니다.

org.fusesource.camel.component.sap.model.idoc.DocumentList
Copy to Clipboard Toggle word wrap

290.10.2. IDoc 문서 모델

Camel SAP 구성 요소의 경우 기본 SAP IDoc API 주위에 래퍼 API를 제공하는 EMF(Eclipse Modelling Framework)를 사용하여 IDoc 문서가 모델링됩니다. 이 모델에서 가장 중요한 유형은 다음과 같습니다.

org.fusesource.camel.component.sap.model.idoc.Document
org.fusesource.camel.component.sap.model.idoc.Segment
Copy to Clipboard Toggle word wrap

문서 유형은 IDoc 문서 인스턴스를 나타냅니다. 개요에서 문서 인터페이스는 다음 방법을 노출합니다.

// Java
package org.fusesource.camel.component.sap.model.idoc;
...
public interface Document extends EObject {
    // Access the field values from the IDoc control record
    String getArchiveKey();
    void setArchiveKey(String value);
    String getClient();
    void setClient(String value);
    ...

    // Access the IDoc document contents
    Segment getRootSegment();
}
Copy to Clipboard Toggle word wrap

다음 종류의 메서드는 문서 인터페이스에서 노출됩니다.

제어 레코드에 액세스하는 방법
대부분의 방법은 IDoc 제어 레코드의 필드 값에 액세스하거나 수정하는 것입니다. 이러한 메서드는 AttributeName 형식이며, 여기서 AttributeName 은 필드 값의 이름입니다( 표 290.2. “IDoc 문서 속성”참조).
문서 콘텐츠에 액세스하는 방법

getRootSegment 메서드는 문서 내용(IDoc 데이터 레코드)에 대한 액세스를 제공하며, 내용을 Segment 오브젝트로 반환합니다. 각 세그먼트 는 임의의 수의 하위 세그먼트를 포함할 수 있으며 세그먼트는 임의의 정도에 중첩될 수 있습니다.

참고

세그먼트 계층 구조의 정확한 레이아웃은 문서의 특정 IDoc 유형으로 정의됩니다. 따라서 세그먼트 계층을 생성(또는 읽기)할 때 IDoc 유형에 정의된 대로 정확한 구조를 따라야 합니다.

Segment 유형은 IDoc 문서의 데이터 레코드에 액세스하는 데 사용되며, 여기서 세그먼트는 문서의 IDoc 유형으로 정의된 구조에 따라 표시됩니다. 개요에서 Segment 인터페이스는 다음 방법을 노출합니다.

// Java
package org.fusesource.camel.component.sap.model.idoc;
...
public interface Segment extends EObject, java.util.Map<String, Object> {
    // Returns the value of the '<em><b>Parent</b></em>' reference.
    Segment getParent();

    // Return a immutable list of all child segments
    <S extends Segment> EList<S> getChildren();

    // Returns a list of child segments of the specified segment type.
    <S extends Segment> SegmentList<S> getChildren(String segmentType);

    EList<String> getTypes();

    Document getDocument();

    String getDescription();

    String getType();

    String getDefinition();

    int getHierarchyLevel();

    String getIdocType();

    String getIdocTypeExtension();

    String getSystemRelease();

    String getApplicationRelease();

    int getNumFields();

    long getMaxOccurrence();

    long getMinOccurrence();

    boolean isMandatory();

    boolean isQualified();

    int getRecordLength();

    <T> T get(Object key, Class<T> type);
}
Copy to Clipboard Toggle word wrap

get Cryostatren(String segmentType) 방법은 새 (nested) 하위를 세그먼트에 추가하는 데 특히 유용합니다. 다음과 같이 정의된 type인 SegmentList 의 오브젝트를 반환합니다.

// Java
package org.fusesource.camel.component.sap.model.idoc;
...
public interface SegmentList<S extends Segment> extends EObject, EList<S> {
    S add();

    S add(int index);
}
Copy to Clipboard Toggle word wrap

따라서 E1SCU_CRE 유형의 데이터 레코드를 만들려면 다음과 같은 Java 코드를 사용할 수 있습니다.

Segment rootSegment = document.getRootSegment();

Segment E1SCU_CRE_Segment = rootSegment.getChildren("E1SCU_CRE").add();
Copy to Clipboard Toggle word wrap

290.10.4. 문서 인스턴스 생성 예

예를 들어 예 290.1. “Java에서 IDoc 문서 생성” 는 Java의 IDoc 모델 API를 사용하여 IDoc 유형인 Cryostat CUSTOMER_CREATEFROMDATA01 을 사용하여 IDoc 문서를 생성하는 방법을 보여줍니다.

예 290.1. Java에서 IDoc 문서 생성

// Java
import org.fusesource.camel.component.sap.model.idoc.Document;
import org.fusesource.camel.component.sap.model.idoc.Segment;
import org.fusesource.camel.component.sap.util.IDocUtil;

import org.fusesource.camel.component.sap.model.idoc.Document;
import org.fusesource.camel.component.sap.model.idoc.DocumentList;
import org.fusesource.camel.component.sap.model.idoc.IdocFactory;
import org.fusesource.camel.component.sap.model.idoc.IdocPackage;
import org.fusesource.camel.component.sap.model.idoc.Segment;
import org.fusesource.camel.component.sap.model.idoc.SegmentChildren;
...
//
// Create a new IDoc instance using the modelling classes
//

// Get the SAP Endpoint bean from the Camel context.
// In this example, it's a 'sap-idoc-destination' endpoint.
SapTransactionalIDocDestinationEndpoint endpoint =
    exchange.getContext().getEndpoint(
        "bean:SapEndpointBeanID",
        SapTransactionalIDocDestinationEndpoint.class
    );

// The endpoint automatically populates some required control record attributes
Document document = endpoint.createDocument()

// Initialize additional control record attributes
document.setMessageType("FLCUSTOMER_CREATEFROMDATA");
document.setRecipientPartnerNumber("QUICKCLNT");
document.setRecipientPartnerType("LS");
document.setSenderPartnerNumber("QUICKSTART");
document.setSenderPartnerType("LS");

Segment rootSegment = document.getRootSegment();

Segment E1SCU_CRE_Segment = rootSegment.getChildren("E1SCU_CRE").add();

Segment E1BPSCUNEW_Segment = E1SCU_CRE_Segment.getChildren("E1BPSCUNEW").add();
E1BPSCUNEW_Segment.put("CUSTNAME", "Fred Flintstone");
E1BPSCUNEW_Segment.put("FORM", "Mr.");
E1BPSCUNEW_Segment.put("STREET", "123 Rubble Lane");
E1BPSCUNEW_Segment.put("POSTCODE", "01234");
E1BPSCUNEW_Segment.put("CITY", "Bedrock");
E1BPSCUNEW_Segment.put("COUNTR", "US");
E1BPSCUNEW_Segment.put("PHONE", "800-555-1212");
E1BPSCUNEW_Segment.put("EMAIL", "fred@bedrock.com");
E1BPSCUNEW_Segment.put("CUSTTYPE", "P");
E1BPSCUNEW_Segment.put("DISCOUNT", "005");
E1BPSCUNEW_Segment.put("LANGU", "E");
Copy to Clipboard Toggle word wrap

290.10.5. 문서 속성

표 290.2. “IDoc 문서 속성” Document 개체에서 설정할 수 있는 컨트롤 레코드 특성을 표시합니다.

Expand
표 290.2. IDoc 문서 속성
속성길이SAP 필드설명

archiveKey

70

ARCKEY

EDI 아카이브 키

클라이언트

3

MANDT

클라이언트

creationDate

8

CREDAT

날짜 IDoc이 생성됨

creationTime

6

CRETIM

Time IDoc이 생성됨

방향

1

DIRECT

방향

eDIMessage

14

REFMES

message 참조

eDIMessageGroup

14

REFGRP

메시지 그룹 참조

eDIMessageType

6

STDMES

EDI 메시지 유형

eDIStandardFlag

1

STD

EDI 표준

eDIStandardVersion

6

STDVRS

EDI 표준 버전

eDITransmissionFile

14

REFINT

교환 파일에 대한 참조

iDocCompoundType

8

DOCTYP

IDoc 유형

iDocNumber

16

DOCNUM

IDoc 번호

iDocSAPRelease

4

DOCREL

SAP IDoc 릴리스

iDocType

30

IDOCTP

기본 IDoc 유형의 이름

iDocTypeExtension

30

CIMTYP

확장 유형 이름

messageCode

3

MESCOD

논리 메시지 코드

messageFunction

3

MESFCT

논리 메시지 기능

messageType

30

MESTYP

논리 메시지 유형

outputMode

1

OUTMOD

출력 모드

recipientAddress

10

RCVSAD

수신자 주소 (SADR)

recipientLogicalAddress

70

RCVLAD

수신자의 논리 주소

recipientPartnerFunction

2

RCVPFC

수신자의 파트너 기능

recipientPartnerNumber

10

RCVPRN

수신자의 파트너 번호

recipientPartnerType

2

RCVPRT

수신자의 파트너 유형

recipientPort

10

RCVPOR

수신기 포트(SAP 시스템, EDI 하위 시스템)

senderAddress

 

SNDSAD

보낸 사람 주소 (SADR)

senderLogicalAddress

70

SNDLAD

보낸 사람의 논리 주소

senderPartnerFunction

2

SNDPFC

보낸 사람의 파트너 기능

senderPartnerNumber

10

SNDPRN

보낸 사람의 파트너 번호

senderPartnerType

2

SNDPRT

보낸 사람의 파트너 유형

senderPort

10

SNDPOR

보낸 사람 포트(SAP 시스템, EDI 하위 시스템)

직렬화

20

직렬

EDI/ALE: 직렬화 필드

status

2

상태

IDoc의 상태

testFlag

1

TEST

테스트 플래그

290.10.6. Java에서 문서 속성 설정

Java에서( 표 290.2. “IDoc 문서 속성”에서) 제어 레코드 속성을 설정할 때 Java 빈 속성에 대한 일반적인 규칙이 적용됩니다. 즉, 특성 값을 가져오고 설정하는 데 getNamesetName 메서드를 통해 name 속성에 액세스할 수 있습니다. 예를 들어 iDocType,iDocTypeExtensionmessageType 속성은 Document 오브젝트에 다음과 같이 설정할 수 있습니다.

// Java
document.setIDocType("FLCUSTOMER_CREATEFROMDATA01");
document.setIDocTypeExtension("");
document.setMessageType("FLCUSTOMER_CREATEFROMDATA");
Copy to Clipboard Toggle word wrap

290.10.7. XML에서 문서 속성 설정

XML에서 제어 레코드 특성을 설정할 때 idoc:Document 요소에 특성을 설정해야 합니다. 예를 들어 iDocType,iDocTypeExtensionmessageType 속성은 다음과 같이 설정할 수 있습니다.

<?xml version="1.0" encoding="ASCII"?>
<idoc:Document ...
               iDocType="FLCUSTOMER_CREATEFROMDATA01"
               iDocTypeExtension=""
               messageType="FLCUSTOMER_CREATEFROMDATA" ... >
    ...
</idoc:Document>
Copy to Clipboard Toggle word wrap
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat