‎2010 Jan 20 1:51 PM
Hi,
I got a requirement for an inbound idoc
Idoc type : DELFOR02
message type : DELINS
User exit functional module : IDOC_INPUT_DELINS
My actual reqirement is.......
The DELFOR02 Idoc sent from the subsystem to SAP will have to be split into multiple DELFOR02 Idocs depending upon the number of line items.
The DELFOR02 Idoc is separated into header and item data. The header data will have to be mapped to each split Idoc and then update each Scheduling agreement. The Item detail will have to be split for each occurrence of an E1EDP10 segment. For example if 3 line items are contained on the DELFOR02 Idoc this will have to be split in to 3 Idocs, as shown below:
DELFOR02 Idoc
Header Level E1EDK09
.
.
.
Item Level E1EDP10
E1EDP10
E1EDP10
How i approach this requirement.......please help me out..its critical req
‎2010 Jan 22 8:54 AM
Hi,
I am just briefing the steps on how you can proceed. The following information may not be complete.
Copy the functional module : IDOC_INPUT_DELINS to new custom FM Z_IDOC_INPUT_DELINS and link this to existing process code.
In FM Z_IDOC_INPUT_DELINS :
store the header data into global structure, also populate T_NEW_IDOCDATA.
Then based on your conditions, i.e. no of segments E1EDP10
case IDOC-SEGNAM.
when 'E1EDP10'.
store the segment data into internal table T_NEW_IDOCDATA.
perform create_new_split_idoc.
endcase.
FORM CREATE_NEW_IDOC.
MOVE-CORRESPONDING IDOC_CONTRL TO S_CONTROL_RECORD_IN.
S_CONTROL_RECORD_IN-MESCOD = 'SPT'. "new message code SPT for split Idocs
S_CONTROL_RECORD_IN-DOCNUM = SPACE.
S_CONTROL_RECORD_IN-IDOCTYP = IDOC_CONTRL-IDOCTP.
APPEND S_CONTROL_RECORD_IN.
CALL FUNCTION 'INBOUND_IDOC_PROCESS'
TABLES
IDOC_CONTROL = S_CONTROL_RECORD_IN
IDOC_DATA = T_NEW_IDOCDATA
EXCEPTIONS
OTHERS = 1.
IF SY-SUBRC = 0.
COMMIT WORK.
endif.
ENDFORM.
For split Idocs create a new message code SPT and do the partner profile setting in WE20.
Thanks,
Savitha