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
496

Hi,

In I want to send a idoc from one client to another client in same server.i created IDOC by program in 810 successfully.In we02 also i checked the green symbol only came,but when i checked in 800 the idoc doesnt present.what can i do for this.help me please.I copied my program also.

DATA:I TYPE I VALUE '1'.

DATA:IEDIDC LIKE EDIDC OCCURS 0 WITH HEADER LINE.

*PARAMETERS:PDOCNUM LIKE EDIDC-DOCNUM.

*SELECT RCVPOR MESTYP IDOCTP RCVPRT SNDPOR RCVPRN SNDPRT SNDPRN FROM

*EDIDC INTO TABLE IEDIDC WHERE DOCNUM = PDOCNUM.

DATA:BEGIN OF ITAB OCCURS 0,

IMATNR LIKE E1MARAM-MATNR,

IMBRSH LIKE E1MARAM-MBRSH,

IMTART LIKE E1MARAM-MTART,

IMAKTX LIKE E1MAKTM-MAKTX,

IMEINS LIKE E1MARAM-MEINS,

END OF ITAB.

CONSTANTS :

C_ZRZSEG1 LIKE EDIDD-SEGNAM VALUE 'E1MARAM',

C_ZRZSEG2 LIKE EDIDD-SEGNAM VALUE 'E1MAKTM'.

DATA:I_EDIDD LIKE EDIDD OCCURS 0 WITH HEADER LINE.

DATA:T_COMM_IDOC LIKE EDIDC OCCURS 0 WITH HEADER LINE.

DATA:ZE1MARAM LIKE E1MARAM OCCURS 0 WITH HEADER LINE,

ZE1MAKTM LIKE E1MAKTM OCCURS 0 WITH HEADER LINE.

DATA:C_MESTYP LIKE EDIDC-MESTYP VALUE 'MATMAS',

*C_RCVPRT LIKE EDIDC-RCVPRT VALUE 'LS',

*C_LOGSYS LIKE EDIDC-RCVPRN VALUE '810',

*C_RCVPOR LIKE EDIDC-RCVPOR VALUE 'A000000016',

*C_SNDPOR LIKE EDIDC-SNDPOR VALUE 'SAPTSI',

*C_SNDPRN LIKE EDIDC-SNDPRN VALUE '800',

*C_IDOCTP LIKE EDIDC-IDOCTP VALUE 'MATMAS05',

*C_SNDPRT LIKE EDIDC-SNDPRT VALUE 'LS',

C_MESTYP1 LIKE EDIDC-MESTYP VALUE 'MATMAS',

C_RCVPRT1 LIKE EDIDC-RCVPRT VALUE 'LS',

C_LOGSYS1 LIKE EDIDC-RCVPRN VALUE '800',

C_RCVPOR1 LIKE EDIDC-RCVPOR VALUE 'A000000016',

C_SNDPOR1 LIKE EDIDC-SNDPOR VALUE 'SAPTSI',

C_SNDPRN1 LIKE EDIDC-SNDPRN VALUE '810',

C_IDOCTP1 LIKE EDIDC-IDOCTP VALUE 'MATMAS05',

C_SNDPRT1 LIKE EDIDC-SNDPRT VALUE 'LS'.

TYPE-POOLS:TRUXS.

DATA:ITDATA TYPE TRUXS_T_TEXT_DATA.

CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'

EXPORTING

  • I_FIELD_SEPERATOR =

I_LINE_HEADER = 'X'

i_tab_raw_data = ITDATA

i_filename = 'C:\Documents and Settings\User\Desktop\IDOC555.xls'

tables

i_tab_converted_data = ITAB

  • EXCEPTIONS

  • CONVERSION_FAILED = 1

  • OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

PERFORM GENERATE_CONTROL_RECORD.

PERFORM SEND_IDOC.

FORM GENERATE_CONTROL_RECORD.

*IEDIDC-RCVPOR = C_RCVPOR. "Receiver Port

*IEDIDC-MESTYP = C_MESTYP. "Message type

*IEDIDC-IDOCTP = C_IDOCTP. "Basic IDOC type

*IEDIDC-RCVPRT = C_RCVPRT. "Partner type of receiver

*IEDIDC-SNDPOR = C_SNDPOR. "SENDER PORT

*IEDIDC-RCVPRN = C_LOGSYS. "Partner number of receiver

*IEDIDC-SNDPRT = C_SNDPRT. "Sender Partner type

*IEDIDC-SNDPRN = C_SNDPRN. "Sender Partner Number

*IEDIDC-RCVPOR = C_RCVPOR1. "Receiver Port

IEDIDC-MESTYP = C_MESTYP1. "Message type

IEDIDC-IDOCTP = C_IDOCTP1. "Basic IDOC type

IEDIDC-RCVPRT = C_RCVPRT1. "Partner type of receiver

IEDIDC-SNDPOR = C_SNDPOR1. "SENDER PORT

IEDIDC-RCVPRN = C_LOGSYS1. "Partner number of receiver

IEDIDC-SNDPRT = C_SNDPRT1. "Sender Partner type

IEDIDC-SNDPRN = C_SNDPRN1. "Sender Partner Number

APPEND IEDIDC.

*APPEND IEDIDC.

ENDFORM.

FORM SEND_IDOC.

LOOP AT ITAB.

READ TABLE ITAB INDEX I.

ZE1MARAM-MATNR = ITAB-IMATNR.

ZE1MARAM-MBRSH = ITAB-IMBRSH.

ZE1MARAM-MTART = ITAB-IMTART.

ZE1MARAM-MEINS = ITAB-IMEINS.

APPEND ZE1MARAM.

ZE1MAKTM-MAKTX = ITAB-IMAKTX.

APPEND ZE1MAKTM.

I_EDIDD-SEGNAM = C_ZRZSEG1.

I_EDIDD-SDATA = ZE1MARAM.

APPEND I_EDIDD.

I_EDIDD-SEGNAM = C_ZRZSEG2.

I_EDIDD-SDATA = ZE1MAKTM.

APPEND I_EDIDD.

CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'

EXPORTING

master_idoc_control = IEDIDC

  • OBJ_TYPE = ''

  • CHNUM = ''

tables

communication_idoc_control = T_COMM_IDOC

master_idoc_data = I_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.

ENDIF.

LOOP AT T_COMM_IDOC.

WRITE:/ 'IDoc Generated - ', T_COMM_IDOC-DOCNUM.

ENDLOOP.

I = I + 1.

ENDLOOP.

ENDFORM.

include bdcrecx1.

start-of-selection.

LOOP AT ITAB.

perform open_group.

perform bdc_dynpro using 'SAPLMGMM' '0060'.

perform bdc_field using 'BDC_CURSOR'

'RMMG1-MTART'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'RMMG1-MATNR'

ITAB-IMATNR.

perform bdc_field using 'RMMG1-MBRSH'

ITAB-IMBRSH.

perform bdc_field using 'RMMG1-MTART'

ITAB-IMTART.

perform bdc_dynpro using 'SAPLMGMM' '0070'.

perform bdc_field using 'BDC_CURSOR'

'MSICHTAUSW-DYTXT(02)'.

perform bdc_field using 'BDC_OKCODE'

'=ENTR'.

perform bdc_field using 'MSICHTAUSW-KZSEL(01)'

'X'.

perform bdc_field using 'MSICHTAUSW-KZSEL(02)'

'X'.

perform bdc_dynpro using 'SAPLMGMM' '4004'.

perform bdc_field using 'BDC_OKCODE'

'BU'.

perform bdc_field using 'MAKT-MAKTX'

ITAB-IMAKTX.

perform bdc_field using 'BDC_CURSOR'

'MARA-MEINS'.

perform bdc_field using 'MARA-MEINS'

ITAB-IMEINS.

perform bdc_dynpro using 'SAPLMGMM' '4004'.

perform bdc_field using 'BDC_OKCODE'

'=BU'.

perform bdc_field using 'BDC_CURSOR'

'MAKT-MAKTX'.

perform bdc_field using 'MAKT-MAKTX'

ITAB-IMAKTX.

perform bdc_field using 'MARA-MEINS'

ITAB-IMEINS.

perform bdc_transaction using 'MM01'.

perform close_group.

ENDLOOP.

Thank u

Manjula devi.D

1 REPLY 1
Read only

Former Member
0 Likes
358

Hi,

1.Check the RFC destination SM59.

2.Logical systems are assigned correctly or not.

3.The settings are correctly or not check once.

Regards,

Shiva.