Application Development 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: 

hi guru's what is outbound program to run in idocs

Former Member
0 Kudos

hi guru's what is outbound program to run in idocs , plz help me

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hai,

if u r using a user defined idoc,Then u have to write outbound program in se38.

if u r using standard idoc Then u r outbound program depends on u r sending masterdata.

tcode BD10 - SEND MATERIAL DATA

BD12 -SEND VENDOR DATA

BD14-SEND CUSTOMER DATA

Regards

kishore ale

2 REPLIES 2

Former Member
0 Kudos

Hai,

if u r using a user defined idoc,Then u have to write outbound program in se38.

if u r using standard idoc Then u r outbound program depends on u r sending masterdata.

tcode BD10 - SEND MATERIAL DATA

BD12 -SEND VENDOR DATA

BD14-SEND CUSTOMER DATA

Regards

kishore ale

Former Member
0 Kudos

Hi Sri,

If u want to run outbound program for 'Z' segment and Idoc type use this type of program

DATA: Begin of imara occurs 0,

matnr like mara-matnr,

mtart like mara-mtart,

mbrsh like mara-mbrsh,

meins(3) type c,

end of imara.

data: begin of imakt occurs 0,

maktx like makt-maktx,

end of imakt.

DATA: wamas_con LIKE edidc,

imas_data LIKE edidd OCCURS 0 WITH HEADER LINE,

icom_con LIKE edidc OCCURS 0 WITH HEADER LINE.

PARAMETERS: e_matnr LIKE mara-matnr,

e_msgtyp LIKE edidc-mestyp,

e_rcvprn LIKE edidc-rcvprn.

  • retrive app. data from DB

SELECT matnr mtart mbrsh meins FROM mara INTO TABLE imara WHERE

matnr = e_matnr.

SELECT maktx FROM makt INTO TABLE imakt WHERE

matnr = e_matnr and SPRAS = 'E'.

*Master idoc control record

wamas_con-rcvprt = 'LS'.

wamas_con-rcvprn = e_rcvprn.

wamas_con-idoctp = 'YMATMAS1'.

wamas_con-mestyp = e_msgtyp.

  • master idoc data records

LOOP AT imakt.

imas_data-segnam = 'YMAKT1'.

move imakt to imas_data-sdata .

APPEND imas_data.

ENDLOOP.

LOOP AT imara.

imas_data-segnam = 'YMARA1'.

move imara to imas_data-sdata .

APPEND imas_data.

ENDLOOP.

CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'

EXPORTING

master_idoc_control = wamas_con

  • OBJ_TYPE = ''

  • CHNUM = ''

TABLES

communication_idoc_control = icom_con

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

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

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

ENDIF.

COMMIT WORK.

otherwise <b>material master transfer using BD10

customer master using BD12

vendor master using BD14</b>

Regards,

Vijay