Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

IDOC

Former Member
0 Likes
821

Can any one tell me how to use this FM.

MASTERIDOC_CREATE_CHRMAS

What r the values to be passed

RCVPFC

RCVPRN

RCVPRT

SNDPFC

SNDPRN

SNDPRT

can any one give me example code or any link regarding this.

Thanks in advance

6 REPLIES 6
Read only

Former Member
0 Likes
777

Hi,

Actually the Fm is MASTER_IDOC_DISTRIBUTE.

RCVPFC receiver Rfc ,if u r using logicalsystems then it is logicalsystem name.

RCVPRN receiver partner name

RCVPRT port if u r using LogicalSystems then trfc port is automatically generated

SNDPFC

SNDPRN sender partnerprofile

SNDPRT sender port

ok or u can mail me

Read only

Former Member
0 Likes
777

Hello,

This function module is for master characteristics basic data transfer via Idoc.

& parameters which you have mentioned are for sender & receiver system.

In ale scenario ,you need to define sender & receiver system which will send & receive data respectively.

RCVPFC

RCVPRN

RCVPRT : are parameters for receiver system partner type ,receiver partner & reciver port type & rest are similar parameters for sender system.

Thanks.

Read only

0 Likes
777

Can u give me any sample code.

or any link regarding this

Read only

0 Likes
777
Read only

0 Likes
777

Hi Kalpanashri

Here is a sample code using MASTER_IDOC_DISTRIBUTE to send an idoc named <i>IDOC</i> of message type <i>MESSAGE</i> with a segment named <i>SEGMENT</i> just to give you an idea:

DATA:
Z_SEGNAME(7) TYPE C VALUE 'SEGMENT',
Z_MESTYPE(9) TYPE C VALUE 'MESSAGE',
Z_IDOC_TYPE(8) TYPE C VALUE 'IDOC'.


DATA:
IDOC_CONTROL LIKE EDIDC,
T_COMM_CONTROL LIKE EDIDC OCCURS 0 WITH HEADER LINE,
IDOC_DATA LIKE EDIDD OCCURS 0 WITH HEADER LINE.

*Reads data from Z table
SELECT *
FROM ZTABLE
INTO TABLE L_ZTABLE.

*Set the control data info required for the distribution
IDOC_CONTROL-MESTYP = Z_MESTYPE.
IDOC_CONTROL-DOCTYP = Z_IDOC_TYPE.

<u>
*Populate the IDoc
LOOP AT L_ZTABLE.</u>
CLEAR IDOC_DATA.
IDOC_DATA-SEGNAM = Z_SEGNAME.
IDOC_DATA-SDATA = ZTABLE.
APPEND IDOC_DATA.
ENDLOOP.


*Deliver the IDOC as defined in distribution model/partner profile
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE' IN UPDATE TASK
EXPORTING
MASTER_IDOC_CONTROL = IDOC_CONTROL
TABLES
COMMUNICATION_IDOC_CONTROL = T_COMM_CONTROL
MASTER_IDOC_DATA = IDOC_DATA
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.
COMMIT WORK.
ENDIF. 

Hope it helps,

Kind Regards,

Sergio

Read only

abdul_hakim
Active Contributor
0 Likes
777

hi

hv u chked the fm docu for the same in se37.

i would advice you to read the book "ALE,EDI and IDoc Technologies for SAP" By Arvind Nagpal.

Cheers,

Abdul Hakim