Quantcast
Channel: SCN : Unanswered Discussions - Process Integration (PI) & SOA Middleware
Viewing all articles
Browse latest Browse all 6719

Scenario on ALE and IDOCs

$
0
0

Dear gurus

 

I am working on

ALE/IDOC Scenario of  SAP Technical First one.

 

I have performed  several steps and  they are being created till now.

 

But when i release the IDOC segment ,it shows first that this basic idoc cannot be changed after released,and then immediate it shows this  pop up

and then creating partner profile and further steps.

 

Then i write a Report Program in SE38 to create IDOC control records and transfer it to destination partner system.

But when i execute it, it shows "No Student Record".

 

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  

 

I dont know whether that basic Idoc has been released properly ?

 

Can anyone help me ?

 

Thanks

 

Regards

Karan


Viewing all articles
Browse latest Browse all 6719

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>