2008 Mar 18 4:25 AM
Hi all,
can any one pls provide me with sample code for populating IDoc with segments maintained in hierarchical level.
vikas.
2008 Mar 18 4:32 AM
Refer to RBDSEMAT program.
else open program for any Tcode BD10, BD12, BD14 u will find the way to deal with sending of IDOC data.
2008 Mar 18 4:32 AM
Refer to RBDSEMAT program.
else open program for any Tcode BD10, BD12, BD14 u will find the way to deal with sending of IDOC data.
2008 Mar 18 5:12 AM
Hi Vikas ,
Please fidn the below sample code .
DATA: C_INVREV_SEGNAME(7) TYPE C VALUE 'Z1INVRV',
C_INVREV_MESTYPE(6) TYPE C VALUE 'ZINVRV',
C_INVREV_IDOC_TYPE(8) TYPE C VALUE 'ZINVRV01',
Z1INVRV LIKE Z1INVRV,
C_INVREV_DOCTYPE LIKE BKPF-BLART VALUE 'YY',
IDOC_CONTROL LIKE EDIDC,
T_COMM_CONTROL LIKE EDIDC OCCURS 0 WITH HEADER LINE,
IDOC_DATA LIKE EDIDD OCCURS 0 WITH HEADER LINE.
*--- Move the document header into a structure
LOOP AT DOC_HEAD_TAB INTO DOC_HEAD.
ENDLOOP.
*--- Move the document item data into a structure
LOOP AT DOC_ITEM_TAB INTO DOC_ITEM WHERE NOT ( LIFNR IS INITIAL ).
ENDLOOP.
*--- Populate the IDoc segments field with the required data
CLEAR Z1INVRV.
Z1INVRV-LIFNR = DOC_ITEM-LIFNR. Store vendor number for filter
Z1INVRV-XBLNR = DOC_HEAD-XBLNR. Billing number
IDOC_DATA-SEGNAM = C_INVREV_SEGNAME. Segment name
IDOC_DATA-SDATA = Z1INVRV. Segment data
APPEND IDOC_DATA. Populate IDoc internal table
Procedure
1.Get the required data
2. fill the all segment and append to the Idoc data internal table Idoc_data .
Please let me know if u have any queries . I hope this will solve the problem .
Rgds
Sree M
2008 Mar 18 5:22 AM
hi,
thanks for ur reply.
but again i hv one question that, do we need to do any thing while populating the IDOC when the segments are defined as mandetory segments.
like what if my internal table do not contains any data and segment is mandetory segment
2008 Mar 18 7:59 AM
Hi Vikas ,
what if my internal table do not contains any data and segment is mandetory segment?
You have to fill all the mandatory segments in the Idoc for this Please discuss with your Functional and Business scenario definitely will support to fill the Mandatory segments . Otherwise Idoc will give the Status as Syntax Error .Please ensure whether it is a mandatory or not in WE60.
.I hope so it will resolve ur query .
Rgds
Sree M
2008 Mar 18 8:04 AM
Hi,
Goto WE60 tcode ,there give ur message and basic type,u will get the documentation of the required segments.
for mandatory segments u shouls always pass the data...
Regards,
Nagaraj