Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
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:
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
Contribute?
Sample Specs
What's Hot?
Web Dynpro for ABAP Tutorials
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
" 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