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

create idocs from custom program

Former Member
0 Likes
1,002

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
Read only

Former Member
0 Likes
948

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

6 REPLIES 6
Read only

Former Member
0 Likes
948

Use the function module MASTER_IDOC_DISTRIBUTE

Read only

0 Likes
948

i thought this FM is for ALE???

Read only

Laxmana_Appana_
Active Contributor
0 Likes
948

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

Read only

Former Member
0 Likes
949

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

Read only

0 Likes
948

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..

Read only

Former Member
0 Likes
948

Yes you can use this for EDI also.