Populating the IDoc

Hi,
I have a custom IDoc with 2 same level segments, No mandatory segments are there.  I am filling the IDocs in the following way.
I am filling the first segment in a loop after that I am filling the second segment in a nested loop of the first loop.  After filling the second segment it is again going to first segment and it is filling and this process is going on until the loop ends.
I am getting the 26 syntax error in the IDoc.
My IDOC is in the following way right now.
1st segment
2nd segment
1st segment
2nd segment
1st segment
2nd segment
Can anybody tell me is this filling of IDoc is wrong or correct.
Thanks,
BSV.

Hi,
         just go through these
EXIT_SAPLMV01_002 Enhancements in Material Master: IDoc
EXIT_SAPLMV02_002 Enhancements in Material Master: IDoc
Go through this userdefined program u can understand .
*& Report ZBT_SEL_PROGRAM *
REPORT zbt_sel_program .
TABLES: mara.
Data declaration
*--Material number selection.
SELECT-OPTIONS: s_matnr FOR mara-matnr.
PARAMETERS:
*--Rec.Partner
p_rcvprn TYPE edi_rcvprn,
*--Message type
p_msgtyp TYPE edi_mestyp.
Internal table declaration
DATA:
*--MARA data
it_mara TYPE STANDARD TABLE OF mara WITH HEADER LINE,
*--To fill the segment Z1MARM
it_temp_mara TYPE STANDARD TABLE OF z1marm WITH HEADER LINE,
*--MAKT data
it_makt TYPE STANDARD TABLE OF makt WITH HEADER LINE,
*--To fill the segment E1MAKTM
it_temp_makt TYPE STANDARD TABLE OF e1maktm WITH HEADER LINE.
DATA: st_edidd TYPE STANDARD TABLE OF edidd WITH HEADER LINE,
st_comm_cont TYPE STANDARD TABLE OF edidc WITH HEADER LINE,
st_mast_cont TYPE edidc.
*--Fetch the data from MARA table
SELECT * FROM mara INTO TABLE it_mara WHERE matnr IN s_matnr.
IF sy-subrc = 0.
SORT it_mara.
ENDIF.
*--Fetch the data from MAKT table
IF NOT it_mara[] IS INITIAL.
SELECT * FROM makt INTO TABLE it_makt FOR ALL ENTRIES IN it_mara
WHERE matnr = it_mara-matnr.
IF sy-subrc = 0.
SORT it_makt.
ENDIF.
ENDIF.
*--Fill the iternal tables which is type the same of Segments
LOOP AT it_mara.
MOVE-CORRESPONDING it_mara TO it_temp_mara.
APPEND it_temp_mara.
CLEAR it_temp_mara.
ENDLOOP.
LOOP AT it_makt.
MOVE-CORRESPONDING it_makt TO it_temp_makt.
APPEND it_temp_makt.
CLEAR it_temp_makt.
ENDLOOP.
*--Fill the segments
LOOP AT it_temp_mara.
st_edidd-segnam = 'Z1MARM'.
st_edidd-sdata = it_temp_mara.
APPEND st_edidd.
CLEAR st_edidd.
ENDLOOP.
LOOP AT it_temp_makt.
st_edidd-segnam = 'E1MAKTM'.
st_edidd-sdata = it_temp_makt.
APPEND st_edidd.
CLEAR st_edidd.
ENDLOOP.
*--Fill Master IDOC
st_mast_cont-rcvprt = 'LS'.
st_mast_cont-rcvprn = p_rcvprn.
st_mast_cont-mestyp = p_msgtyp.
st_mast_cont-idoctp = 'ZMATMAS01'.
*--Create the communication IDOC by passsing master IDOC and control
information.
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
EXPORTING
master_idoc_control = st_mast_cont
OBJ_TYPE = ''
CHNUM = ''
TABLES
communication_idoc_control = st_comm_cont
master_idoc_data = st_edidd
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.
*--Commit work
COMMIT WORK.
ENDIF.
*--Display IDOC Number.
LOOP AT st_comm_cont.
WRITE: 'IDOC Numbers:',st_comm_cont-docnum.
ENDLOOP.
Regards

Similar Messages

  • Populating the custom segments for the Basic type attached to HRMD_A (IDOC)

    Hi,
    I've enhanced a few infotypes and want the new fields to be available in an IDOC created through the program RHALEINI.
    Here are the steps I followed.
    Step 1 :(we31)
    We created new segment Z1IT023 , containing all the fields from infotype 0023 along with the custom fields added.
    Step 2 :(we30)
    We created an extension of IDOC type HRMD_A07 by name HRMD_EX to include this segement.
    Step 3 :
    We added an entry in table EDIMSG against message type HRMD_A , with base type : HRMD_A07 , extension : HRMD_EX , version : 700
    Step4 :(we20)
    Now , we made changes to partner profile by adding entry for message type HRMD_A with base IDOC type as HRMD_A07 and extension as HRMD_EX
    Step5:
    We changed the entry in table T777D and specified the IDOC segment as Z1IT023.
    Step6.
    We then tried to execute the report RHALEINI to generate the IDOC. The IDOC got created, but it didn't have the data for the segment Z1IT023.
    In fact, there is a different solution to this... by adding the custom segment(containing nly the new infotype fields) as a child of the original segment E1P0023 and then writting code in the user-exit to populate the segment, but our intension is to have a single segment with all the infotype 0023 data. Besides, I believe in HR, making an entry in T777D should free us from writing any code for populating the IDOC segments.
    Can anybody please suggest me, where am I going wrong. How can the new segments be populated automatically.
    Thanks in advance.
    Sujit.
    Responses will be suitably rewarded.

    Hi,
    Did u get any exit to populate the custom segment?
    Thanks,
    San

  • Populating the data tab field for the FM IDOC_INPUT_CREDITOR

    HI
    I need to use the function module IDOC_INPUT_CREDITOR .
    When i am populating the idoc data table i need to update the field sdata  for the segment E1LFA1M.
    What is the best way to populate the field .
    Is there a function module which  will get the import structure of the table LFA1into the the sdata field.
    Thanks a lot in advance.
    Anjali

    Check for the user exit of the idoc function module. You can check for - EXIT_SAPLKD02_001 & include -  zxvsvu04.

  • Populating  the segments of idocs

    Hi,
        How do segments of the idoc get populated with data from SAP tables ?  (for SAP standard idoc or newly created idoc and outbound process)
    Can anyone say in details?
    Good answer will be rewarded
    Thanks ,
    Manas Behera

    For any IDOC there is a specific standard function module assigned that is called to fill the IDOC segments.
    For orders it is e.g. IDOC_OUTPUT_ORDERS.
    This function takes care of the filling of the IDOC segments. You also usually have user exits available in those function modules that you can use to manipulate the IDOC data or fill/add custom segments/fields.
    The function modules usually start with IDOC_OUTPUT_* for outgoing IDOCS and IDOC_INPUT_* for incoming IDOCS.
    Hope that helps,
    Michael

  • Populating the Conditions segment in PORDCR102-PO create IDOC

    Hi Gurus,
    Iam populating some fields in the E1BPMEPOCONDHEADER segment of the IDOC PORDCR102. But the condition record is not getting generated in the PO.
    Kindly can anyone throw some light on the mandatory fields that needs to be populated in this segment and is there any necessity to populate some other linked segments along with this segment inorder to get the condition record created.
    I am populating some fields below :
      E1BPMEPOCONDHEADER-COND_TYPE = 'ZA00'.
      E1BPMEPOCONDHEADER-COND_VALUE = '12'.
      E1BPMEPOCONDHEADER-CURRENCY = 'USD'.
      E1BPMEPOCONDHEADER-CURRENCY_ISO = 'USD'.
      E1BPMEPOCONDHEADER-COND_UNIT  = 'EA'.
      E1BPMEPOCONDHEADER-COND_P_UNT = '1'.
      E1BPMEPOCONDHEADER-APPLICATIO = 'EF'.
    Please help
    Thanks
    Venkatesh P

    you need to pass
    CONDITION_NO
    ITM_NUMBER 
    in 1BPMEPOCONDHEADER and 1BPMEPOCONDHEADERX also..

  • Populating the Conditions segment in PORDCR101-PO create IDOC

    Hi ,
    Iam populating some fields in the E1BPMEPOCONDITION segment of the IDOC PORDCR101. But the condition record is not getting generated in the transaction ME22N.Kindly can anyone throw some light on the mandatory fields that needs to be populated in this segment and is there any necessity to populate some other linked segments along with this segment inorder to get the condition record created.
    Iam passing the below given fields.
    E1BPMEPOCOND-ITM_NUMBER
    E1BPMEPOCOND-COND_VALUE
    E1BPMEPOCOND-CURRENCY
    E1BPMEPOCOND-CURRENCY_ISO
    E1BPMEPOCOND-COND_UNIT
    E1BPMEPOCOND-COND_P_UNT
    E1BPMEPOCOND-CHANGE_ID .
    Thanks,
    Kittu.

    hi,
    I am having the same requirement i.e file-xi-r3 create po, can any one tell me the necessary steps needed for this. i am new to all this and still learning things, so please help me.
    thank you
    email [email protected]

  • Idocs not populating the fields

    Hi
    We are using Extended Classic Scenario. After the shopping cart is approved, the PO is generated in the backend R/3. The PO is generated in the backend and the idoc is triggered which is sent to supplier.
    The problem we are facing is as below:
    There are some fields in the idocs which are not getting populated. We are using badi implementation BBP_PO_INBOUND_BADI in the backend. We have used both the methods BBP_MAP_BEFORE_BAPI
    BBP_MAP_AFTER_BAPI
    The table EKPO is getting updated but the idoc does not have the fields.
    Also when we are second time retriggering the output the idoc is having the required fields.
    Kindly advice.
    Thanks and Regards
    Manoj

    Hello,
    It looks the first generation occurs to early in the process.
    Can you should check the processing time you defined in condition records ?
    3 is too early, 4 should work because a commit work is done before. And at worst set it to 1 (selection report) and schedule a job to process the message.
    Rgds,
    Pierre

  • IDOC Segment is missing in the IDOC even though I have populated values

    Hi Experts,
       I face a problem in the IDOC processing.
       I have a custom IDoc type with 2 segments in the same Hierarchy.
       In the Z program I populate both the segments and send the internal table to the MASTER_IDOC_DISTRIBUTE Fun.Module.
       When the IDOC is generated, I see the IDOC with only one segment and the 2nd segment is missing.
       When I debugged the program, I see the 2nd Segment also getting populated.
       Can you give some info that can resolve my issues.
    Thanks,
    Micheal

    Check the below points,
    1. Check the internal table IDOC_DATA in MASTER_IDOC_DISTRIBUTE in debug mode whether the segement with values are populated.
    2. Are you populating the parent & hierarchy level in segment, if yes check whether the values are right one.
    3. There may be a possiblity the std SAP code would delete the custom segment if its any syntax error in segment defenition.
    Check this and if you still have the issue come back.

  • How is the IDOC CRMXIF_ORDER_SAVE_M getting populated? Please help!

    Hi All,
    I am trying to troubleshoot an issue in the idoc CRMXIF_ORDER_SAVE_M.
    Segment name is E101CRMXIF_APPOINTMENT_XT under E101CRMXIF_BUSTRANS.
    The values in this node are as below:
    It should actually be populating,
    APPL_SNAME : CRMXIF_APPOINTMENT
    APPT_TYPE : EXPIRYDATE
    TIMESTAMP_FROM : 20110308080000
    TIMESTAMP_TO : 20110308080000
    RULE_NAME : ZDDW_DEF
    DURATION : 0
    OBJECT_TASK : I
    But some times it gets populated with below values:
    APPL_SNAME : CRMXIF_APPOINTMENT
    APPT_TYPE : APPROVEDATE
    TIMESTAMP_FROM : 20101108080000
    TIMESTAMP_TO : 20101108080000
    RULE_NAME : TODAY
    DURATION : 0
    OBJECT_TASK : I
    Why and how are these values (especially APPT_TYPE and RULE_NAME) getting populated in the IDOC?
    Please help.
    Thanks
    Gopal

    From the BIAPPS documentation: ETL_PROC_WID This column is the unique identifier for the specific ETL process used to create or update this data.
    Given this description the value should be unique for every execution of an ODI integration process. If you want to see the logic behind the variable, either navigate to the ODI Console or ODI Studio connect to the BIApps ODI repository and take a look at the variable setup. 

  • Has anyone populated the doc_flow details for an ORDERS05 IDOC?

    I am having trouble understanding what needs to be populated in the doc_flow itab of line type CRMXIF_DOC_FLOW_I.
    In my case I am trying to populate the doc flow with CONSIP (customer reference contract) details. I can work out what field 'RELATION_TYPE' is and can see that it needs to have a value of 'VONA'. This one is easy to identify because of the 4 character field definition, but I can't work out what goes in the relobj_roletype, relobj_objkey, relobj_type, or the relobj_object_id fields. Can anyone be of help here. I have been trying a number of different values, for example, I populated the relobj_roletype field with 'BUS2000135' which is the object name for a 'CRM Customer contract', but that was rejected and resulted in a status 51 being set in the IDOC.
    Blue

    Stephen,
    I agree with you, but you try and get a VAN to supply IDOC related details in the complex data structure format. They can do it but they're not at all happy about it and go to great lengths to avoid, whereas the ORDERS05 is a standard that most already output to.
    I can process ORDERS05 type IDOC's okay, although I had to add my own code to process a few segments. Anyway, the orders are being created okay. I did initially have a problem when blocking an item, based on certain checks perfromed in the BADI, but that has now been resolved. My only other problem, which a support message has been raised with SAP about, is to parse back status messages to IDOC. Again, there's a BADI which allows you to add content, but there's a mismatch in parameters between the FM and BADI. I'm sure they'll sort it out.
    The only thing left now is to get the item level doc flow to update when pointing to customer reference contract. Again, it's just a case of reverse engineering the data from the IDOC created by the CRMXIF_ORDER_TEST program.
    Regards
    Dr Sidewalk

  • Populating the SEGMENT attribute for  IDocs

    When mapping to an IDoc, each IDoc data element has a corresponding SEGMENT attribute, which I assume is the sequential segment number of the segment in the IDoc.
    Does that value need to be set, or does the IDoc adapter take care of it? If I do need to map it, how can I do it, because I would need to find a way of generating a running number either in the mapper, or externally in an XSL mapping file.

    Hi,
    OK thanks for explicitly stating thae answer! I was hoping for that.
    BR,
    Tony.

  • Problem in populating the delivery text in Idoc

    Hi Experts,
           We are using a custom EDI output type for VT02n transaction. Currently we are encountering a problem when we set the dispatch time as 'Send immediately'.
           The problem is some of the characters in delivery texts are missing in the segment of the idoc generated.
           The problem does not occur when we set the dispatch time as 'send with application own transaction'.
           But we did not do any coding based on the dispatch time.
           Please provide us suggestions to solve this problem.
    Regards
    K Arasu.

    Hi,
    Check whether you have maintained the condition records for output for the above combination & also the Print device in the Communication tab & Print immediately settings.
    If you haven't maintained the above, do the same & check.
    Thanks & Regards,

  • Error while posting the IDOC. Status message '56'

    Hi,
    I have a requirement where I will post an IDOC which inturn will split the original IDOC into child IDOCs based on the store value.
    I am trying to post the IDOC in WE19. So, the Original IDOC is posted successfully with status '53'. Whereas, the child IDOCS finished with error. The status of the message is '56' and the error says 'EDI: Partner profile not available'. Could someone tell me what could be the reason for this..?
    Actually, the IDOC was created by the Functional Consultant. So, should the partner profile creation also done by them or do we need to do anything to solve this problem.? Could someone answer me this question. Thanks in advance.
    Best Regards,
    Paddu.

    It looks like the control data for the child segment is not getting populated. you have to find the code which populated the control data and see if it is doing what it should.

  • Error while unmarshalling the IDOC using an IDOC OTD in JCAPS

    Hi,
    I've created an OTD from SAP IDOC Type in SeeBeyond JCAPS 5.1.2. And when I'm trying to unmarshal the IDOC payload using OTD tester in eDesigner. And the same error is thrown at runtime also. I've tried with multiple IDOCs but no use. And when I navigate to the column number (shown in error message), always it shows stops at same segment. I don't know why. The error message thrown is
    "There was an error during unmarshal.
    less than 1 occurrences! Column Number [30289]"Can any one help me?
    Thanks in advance
    Satya Krishna

    It looks like the control data for the child segment is not getting populated. you have to find the code which populated the control data and see if it is doing what it should.

  • Receipient port not getting populated in IDOC

    Hi,
    I have checked the adapter specific identifiers, rfc destination and everyting seems to be correct.
    Still, my receiver idocs are not populated with receipient port.  What should i be doing
    My scenario is xi-idoc(r/3)  Partner number is getting populated

    Hi,
    Can you please tell me from which  source you are trying to send to the IDOC.Is it IDOC to IDOC or a File to IDOC ...
    For example if it  is idoc-XI-idoc scenario then the recipient port will be populated automatically.If it is anyother third party - XI - IDOC then we need to map the repcipient port in the message mapping.
    Hope I have answered wht u expected else please let me know .
    Regards,
    sharath

Maybe you are looking for

  • Oracle 8.1.5 for linux, install help.

    Does anyone have a successful installation of Oracle 8.1.5 running on Red Hat 6.0? I have tried to install it but, I can't get the installer to run. I get java errors when I run, runInstaller. I have installed jre1.1.6. Any help would be appreciated.

  • Applescript won't run as .app but runs fine in AppleScript Editor

    I'm an experienced web developer.. but total applescript noob. so forgive me if this is a silly question. I'm calling my script it from Flash via fscommand to launch a PDF using finder, rather than a browser. The script works great from AppleScript E

  • IDOC not displayed in billing document

    Hi Experts, I have a issue about the outbound idoc's generated from two different billing document. I can see the idoc's from these documents though the path Goto>header>Output ---> Processing log. But if i check the services of object button for one

  • Font in Style sheet

    Hello everybody,   I  have create the style sheet for the smartform. In the Style I have select the font KF-Kiran (for text dispaly  in devnagari- maathi language) I have upload the same by using the se73. but in style when I select the font, then In

  • XLR - Excel 2007  Error

    SAP 2007B MS Excel 2007 Error: "Security settings in microsoft excel prohibits Xl reporter from running" Issue: gives an error when tried to open an XL report. Previously it was working fine with excel 2003 after configuring macros.