2007 Jul 03 8:09 AM
hi all,
1. create a program, which when executed, creates a custom idoc ( time sheet idoc type ) , using a custom outbound function module.
In the selection screen of the program, include
a)personnel number (range)
b)date
When this program is executed, idoc must be created with the time data of the given personnel numbers.
if u have any code or atleast information regarding it send to me to [email protected]
any suggestions are highly appreciated.
its very urgent................
thanks in regards,
Suresh.A
hi all,
1. create a program, which when executed, creates a custom idoc ( time sheet idoc type ) , using a custom outbound function module.
In the selection screen of the program, include
a)personnel number (range)
b)date
When this program is executed, idoc must be created with the time data of the given personnel numbers.
if u have any code or atleast information regarding it send to me to [email protected]
any suggestions are highly appreciated.
its very urgent................
thanks in regards,
Suresh.A
2007 Jul 04 10:22 AM
HI ,
Steps to create a custom Idoc.
1.Create a message type
2.Create segments and add segments to message type
3.populate the segments with required data
4.populate the control record in one work area.
5. call the function module 'MASTER_IDOC_DISTRIBUTE to create idoc
check the program below
Rewrd point if it is helpful.
Report zz_program_to_create_idoc .
Tables : ekko, ekpo.
Selection - screen skip three.
Selection - screen begin of block b1 with frame t itle titl.
Selection - screen skip.
Select-options s_ebeln for ekko - ebeln.
Selection - screen skip.
Selection - screen end of block b1.
Data : header_segment_name like edidd - segnam value 'Z1EKKO'
Item_segment_name like edidd - segnam val ue 'Z1EKPO'
Idoc_name like edidc - idoctp value 'Z1983 8IDOC1 '.
Data : header_segment_data like z1ekko.
Item_segment_data like z1ekpo.
Data : control_record like edidc.
Data : messagetyp like edmsg - msgtyp value 'ZZ9838ME SG1 '.
Data : i_communication like edidc occurs with heade 0 r line,
I_data like edidd occurs 0 with header line.
Data : begin of i_ekko occurs 0,
Ebeln like ekko - ebeln.
Aedat like ekko - aedat.
Bukrs like ekko - bukrs.
Bsart like ekko - bsart.
Lifnr like ekko - lifnr.
End of i_ekko.
Data : begin of i_ekpo occurs 0,
Ebelp like ekpo - ebelp.
Matnr like ekpo - matnr.
Menge like ekpo - menge.
Meins like ekpo - meins.
Netpr like ekpo - netpr.
End of i_ekpo.
Start-of-selection.
Select ebeln aedat bukrs bsart lifnr from ekko
I_ekko into table where ebeln in s_ebeln.
Select ebelp
Matnr
Menge
Meins
Netpr
From ekpo
Into table i_ekpo
Where ebeln in s_ebeln.
Control_record - mestyp = messagetyp.
Control_record - rcvprt = 'LS'.
Control_record - idoctp = idoc_name.
Control_record - rcvprn MART800 ='0 '.
Loop at i_ekko.
Header_segment_data - ebeln = i_ekko - ebeln.
Header_segment_data - aedat = i_ekko - aedat.
Header_segment_data - bukrs = i_ekko - bukrs.
Header_segment_data - bsart = i_ekko - bsart.
Header_segment_data - lifnr = i_ekko - lifnr.
I_data - segnam = header_segment_name.
I_data - sdata = header_segment_data.
Append i_data.
Select ebelp
Matnr
Menge
Meins
Netpr
From ekpo
Into table i_ekpo
Where = i_ekko ebeln - ebeln.
Loop at i_ekpo.
Item_segment_data - ebelp = i_ekpo - ebelp.
Item_segment_data - matnr = i_ekpo - matnr.
Item_segment_data - menge = i_ekpo - menge.
Item_segment_data - meins = i_ekpo - meins.
Item_segment_data - netpr = i_ekpo - netpr.
I_data - segnam = item_segment_name.
I_data - sdata = item_segment_data.
Append i_data.
Endloop.
I_ekpo clear.
Refresh i_ekpo.
Endloop.
Call function 'MASTER_IDOC_DISTRIBUTE'
Exporting
Master_idoc_control = contro l_record
OBJ_TYPE =''
CHNUM =''
Tables
Communication_idoc_control = i_c ommunication
Master_idoc_data = i_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 - ms gno
With sy - msgv1 sy - msgv2 sy - msgv3 sy - msg v4.
Else.
Loop at i_communication.
Write : 'IDOC GENERATED' i_communication - docnum.
Endloop.
Commit work.
Endif.
Initialization.
Titl = 'ENTER THE PURCHASE ORDER NUMBER'.
2007 Jul 04 10:29 AM
Hi,
steps to be followed to create a custom idoc.
1) Create Z segment with required fields(fields coming towards you) using WE31
2) Create Z idoc using segment created in step 1 using WE30.
3) Create Z message type using WE81.
4) Link idoc created in step 2 with message type created in step 3 in WE82.
5) Create Z function module to post the idoc in SE37. Include all validations, updations to tables, Error handling in source code tab of this FM.
6) Maintain Inbound process code using the FM in WE42
Refer link
http://www.sapfans.com/sapfans/forum/intface/messages/4272.html
<b>Reward points</b>
Regards
2007 Jul 09 7:07 AM
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |