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: 

create idocs from custom program

Former Member
0 Kudos

hi

i have a custom program and will have custome segements.

so i can fill both control and data records.from here i need to generate idoc..any FM's to do this??

appreciate any help.

thanks

siva

1 ACCEPTED SOLUTION

Former Member
0 Kudos

this will generate an IDOC if you pass the EDIDD and EDIDC.

6 REPLIES 6

Former Member
0 Kudos

Use the function module MASTER_IDOC_DISTRIBUTE

0 Kudos

i thought this FM is for ALE???

laxmanakumar_appana
Active Contributor
0 Kudos

Hi Siva ,

There is no FM to fill segments data , you need to write your own logic fill IDOC data ,

then use 'MASTER_IDOC_DISTRIBUTE' to send IDOC.

check this sample code :

DATA :idoc_line       TYPE edidd,
      idoc_data       TYPE STANDARD TABLE OF edidd.

  x_a00-transaction_type  = c_trans_type_a00.
  x_a00-organisation_id   = x_externalid.
  x_a00-file_type         = 'XXX'.
  x_a00-creation_date     = sy-datum.
  x_a00-creation_time     = sy-uzeit.
  x_a00-generation_number = ''.
  x_a00-int_file_type     = 'XXX'.

  idoc_line-sdata  = x_a00.
  idoc_line-segnam = 'ZX_A00'.

  cnt_no = cnt_no + 1.
  idoc_line-segnum = cnt_no.
  APPEND idoc_line TO idoc_data.




DATA : x_idoc_control like edidc.

x_idoc_control-mestyp = x_mestyp.         "Message type
x_idoc_control-idoctp = x_idoctp.         "Basis Idoc Type
x_idoc_control-cimtyp = space.            "Customer extension
x_idoc_control-mescod = space.
x_idoc_control-sndpfc = space.
x_idoc_control-sndprn = x_sender_no.
x_idoc_control-sndprt = x_sender_type.
x_idoc_control-rcvpfc = space.                 "Partner Role Receiv.
x_idoc_control-rcvprn = x_distributor.         "Partner Nr.
x_idoc_control-rcvprt = x_sp_type.            "Partner Type Receiv.

Regards

Appana

Former Member
0 Kudos

this will generate an IDOC if you pass the EDIDD and EDIDC.

0 Kudos

hi

i am filling my segments and control record. only thing i need is to generate idoc send to external system..

can we use master_idoc_distribute for EDI?? i am sure that can be used in ALE..

Former Member
0 Kudos

Yes you can use this for EDI also.