Sei sulla pagina 1di 4

Search

Hom e Tra i ni ngs Qui z Ti ps Tutori a l s Functi ona l Ce rt Q's I nte rvi e w Q's Jobs Te sti m oni a l s Adve rti se Conta ct Us

SAP Virtual/Onsite
Trainings
Document Categories:

Step-by-step guide to ALE and IDOCs


...Previous

Click on Edit Menu -> Model View -> Distribute.

ABAPTM
Adobe Forms
ABAP-HR
ALE & IDocs
ALV
BAPI
BASIS
BSP
Business Objects
Business Workflow
CRM NEW
LSMW
SAP Script/Smart Forms
BI/BW
eXchange Infrastructure (XI)
Enterprise Portals (EP)
eCATT
Object Oriented Programming
SAP Query
Userexits/BADIs
WebDynpro for Java/ABAPTM
Others

In displayed dialog box select the partner system and click continue

What's New?
ABAP Test Cockpit HOT
SAP ABAP Pragmas
Understanding SE32 (ABAP
Text Element Maintenance)
Creating an IDoc File on SAP
Application Server
Understanding Advance with
dialog option of SAP Workflow
SAP Workflow Scenario:
Maintenance Notification
Approval
Enhancements to a standard
class
Working with Floating Field in
Adobe Forms
Inserting data from Internal
Table into the step Send Mail
Display GL Account long text
using enhancement framework
Differences between
polymorphism in JAVA and
ABAP
Passing multiline parameters
from an ABAP Class event to a
Workflow container
Concept of Re-evaluate agents
for active work items in SAP
Workflow
Dynamic creation of component
usage in ABAP WebDynpro
Adobe Forms: Display symbols
like copyright and others
Deactivate Hold functionality in
Purchase order (ME21N)
Quiz on OOABAP
Add fields in FBL5N using BADIs
Tutorial on Wide casting
Defining a Range in Module Pool
Program
Copy fields from one
structure/table into another
structure/table
Side Panel Usage in NWBC

Then it will show the Log of Model View Distribution.

Click on Back button.


To check partner profile Go to TCODE WE20
In displayed screen select the partner system in left side tree under Partner Type LS.

Contribute?
Sample Specs
What's Hot?
Web Dynpro for ABAP Tutorials

Join the Mailing List


Enter name and email address below :
Name:
Email:

Subscribe

Unsubscribe

GO

Write a Report Program in SE38 to create IDOC control records and transfer it to destination
partner system.
The following is the program to generate the IDOC control records and process it.
*&---------------------------------------------------------------------*
*& Report ZSHAN_IDOC_STUD
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZSHAN_IDOC_STUD.
TABLES: ZSTUDENTS.
DATA : S_CTRL_REC LIKE EDIDC, "Idoc Control Record
S_ZSHSTUSEG LIKE ZSHSTUSEG. "CUSTOMER Header Data
DATA : T_ZSTUDENTS LIKE ZSTUDENTS OCCURS 0 WITH HEADER LINE.
DATA : T_EDIDD LIKE EDIDD OCCURS 0 WITH HEADER LINE.
"Data Records
DATA : T_COMM_IDOC LIKE EDIDC OCCURS 0 WITH HEADER LINE. "Generated Communication IDOc
CONSTANTS :C_ZSHSTUSEG LIKE EDIDD-SEGNAM VALUE 'ZSHSTUSEG'.
CONSTANTS: C_IDOCTP LIKE EDIDC-IDOCTP VALUE 'ZSHSTUDIDOCS'.
*** Selection Screen
SELECT-OPTIONS : S_STUID FOR ZSTUDENTS-ZSTUID OBLIGATORY.
PARAMETERS : C_MESTYP LIKE EDIDC-MESTYP DEFAULT 'ZSHSTUDMT', "Message Type
C_RCVPRT LIKE EDIDC-RCVPRT DEFAULT 'LS',
"Partner type of receiver
C_LOGSYS LIKE EDIDC-RCVPRN DEFAULT 'IT3CLNT800',
C_RCVPOR LIKE EDIDC-RCVPOR DEFAULT 'PORTSH800',
C_SNDPRN LIKE EDIDC-SNDPRN DEFAULT 'IT3CLNT900',
C_SNDPRT LIKE EDIDC-SNDPRT DEFAULT 'LS'.
"Destination System
***START-OF-SELECTION
START-OF-SELECTION.
PERFORM GENERATE_DATA_RECORDS.
PERFORM GENERATE_CONTROL_RECORD.
PERFORM SEND_IDOC.
*&---------------------------------------------------------------------*
*&
Form GENERATE_DATA_RECORDS
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
* --> p1
text
* <-- p2
text
*----------------------------------------------------------------------*
FORM GENERATE_DATA_RECORDS .
SELECT * FROM ZSTUDENTS
INTO TABLE T_ZSTUDENTS
WHERE ZSTUID IN S_STUID.
IF SY-SUBRC NE 0.
MESSAGE E398(00) WITH 'No Students Found'.
ENDIF.
PERFORM ARRANGE_DATA_RECORDS.
ENDFORM.
" GENERATE_DATA_RECORDS
*&---------------------------------------------------------------------*
*&
Form GENERATE_CONTROL_RECORD
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
* --> p1
text
* <-- p2
text
*----------------------------------------------------------------------*
FORM GENERATE_CONTROL_RECORD .
S_CTRL_REC-RCVPOR = C_RCVPOR. "Receiver Port
S_CTRL_REC-MESTYP = C_MESTYP. "Message type

S_CTRL_REC-IDOCTP = C_IDOCTP. "Basic IDOC type


S_CTRL_REC-RCVPRT = C_RCVPRT. "Partner type of receiver
S_CTRL_REC-RCVPRN = C_LOGSYS. "Partner number of receiver
S_CTRL_REC-SNDPRT = C_SNDPRT. "Sender Partner type
S_CTRL_REC-SNDPRN = C_SNDPRN. "Sender Partner Number
ENDFORM.
" GENERATE_CONTROL_RECORD
*&---------------------------------------------------------------------*
*&
Form SEND_IDOC
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
* --> p1
text
* <-- p2
text
*----------------------------------------------------------------------*
FORM SEND_IDOC .
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
EXPORTING
MASTER_IDOC_CONTROL
= S_CTRL_REC
*
OBJ_TYPE
= ''
*
CHNUM
= ''
TABLES
COMMUNICATION_IDOC_CONTROL
= T_COMM_IDOC
MASTER_IDOC_DATA
= T_EDIDD
EXCEPTIONS
ERROR_IN_IDOC_CONTROL
=1
ERROR_WRITING_IDOC_STATUS
=2
ERROR_IN_IDOC_DATA
=3
SENDING_LOGICAL_SYSTEM_UNKNOWN
=4
OTHERS
=5
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
COMMIT WORK.
LOOP AT T_COMM_IDOC.
WRITE:/ 'IDoc Generated - ', T_COMM_IDOC-DOCNUM.
ENDLOOP.
ENDIF.
ENDFORM.

" SEND_IDOC

*&---------------------------------------------------------------------*
*&
Form ARRANGE_DATA_RECORDS
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
* --> p1
text
* <-- p2
text
*----------------------------------------------------------------------*
FORM ARRANGE_DATA_RECORDS .
DATA: W_INDEX1 LIKE SY-TABIX,
W_INDEX2 LIKE SY-TABIX.
SORT T_ZSTUDENTS BY ZSTUID.
LOOP AT T_ZSTUDENTS.
S_ZSHSTUSEG-ZSTUID = T_ZSTUDENTS-ZSTUID.
S_ZSHSTUSEG-ZSNAME = T_ZSTUDENTS-ZSNAME.
T_EDIDD-SEGNAM = C_ZSHSTUSEG.
T_EDIDD-SDATA = S_ZSHSTUSEG.
APPEND T_EDIDD.
CLEAR T_EDIDD.
ENDLOOP.
ENDFORM.

" ARRANGE_DATA_RECORDS

Now execute the program, and specify the range of records to transfer

Go to TCODE WE02 to check the generated IDOC control records.


Click on Execute

Click here to continue...

Pleas e s end us your feedback/s ugges tions at webm as ter@SAPTechnical.COM


Hom e Contribute About Us Privacy Term s Of Us e Dis claim er Safe Com panies : Advertis e on SAPTechnical.COM | Pos t Job Contact Us
2006-2007 SAPTechnical.COM. All rights reserved.
All product names are trademarks of their respective companies. SAPTechnical.COM is in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver, and and any other SAP trademarks are registered trademarks of SAP AG in Germany and in several other countries.
Every effort is made to ensure content integrity. Use information on this site at your own risk.

Graphic Des ign by Round the Bend Wizards

Potrebbero piacerti anche