IDOC: How to create child segment with abap code.

Hi,
I'am trying to write an abap code to create segments for an Idoc which structure is the following:
ZLE_00060_DLVY
>  E1EDL20
> Z1DEL_CONS
>Z1DEL_MAT_HEADER
> Z1DEL_MAT
> E1EDL20RET2
> E1EDL22
> E1EDL21
> E1EDL23
> E1EDL51
I receive a sintax error: Error in IDoc with status 26 .
Checking the result I note all segment at the same level and an error about the segment E1EDL22
EDI: Syntax error in IDoc (segment cannot be identified)
     Message no. E0078
Diagnosis
     The segment E1EDL22 does not occur at the current level of the basic
     type DELVRY05 (extension ZLE_00060_DLVY).
     This error can have several reasons:
     o   The segment E1EDL22 is assigned to a group whose header segment does
         not occur.
     o   The segment E1EDL22 does not exist in the syntax description of the
         basic type DELVRY05 (extension ZLE_00060_DLVY).
     o   The sequence of segments in the group in which the segment appears
         is incorrect.
     Previous errors ('mandatory' segment or group missing) may be due to
     this error.
Procedure
     Please check the IDoc or the syntax description of the basic type
     DELVRY05 (extension ZLE_00060_DLVY).
After the error I have:
data records
E1EDL20
Z1DEL_CONS
Z1DEL_MAT_HEADER
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
Z1DEL_MAT
E1EDL20RET2
E1EDL22
E1EDL21
Abap code:
        idoc_data-segnam = 'Z1DEL_CONS'.
        idoc_data-sdata = s_z1del_cons.
        append idoc_data.
          idoc_data-segnam = 'Z1DEL_MAT_HEADER'.
          s_z1del_mat_header-tsegment = 'MATERIAL'.
          idoc_data-sdata = s_z1del_mat_header.
          append idoc_data.
        clear idoc_data-sdata.                            <<<<<<<<<<< how to indent the structure because this is a child.
         idoc_data-sdata = s_Z1DEL_MAT.
         idoc_data-segnam = 'Z1DEL_MAT'.
         append idoc_data.
         idoc_data-segnam = 'E1EDL20RET2'.
         idoc_data-sdata = s_E1EDL20RET2.
         append idoc_data.
         clear idoc_data.
         idoc_data-segnam = 'E1EDL22'.
         idoc_data-sdata = s_e1edl22.
         append idoc_data.
         clear idoc_data.
         idoc_data-segnam = 'E1EDL21'.
         idoc_data-sdata = s_e1edl21.
         append idoc_data.
Any help will be well appreciated.
Thanks in advance.
Regards,
    Giovanni

Hi,
following in debugging mode the abap code of the INCLUDE ZXTRKU02 where is defined the TABLES IDOC_DATA STRUCTURE  EDIDD, I find that all field of the table IDOC_DATA are not set. More exactly my expectation is to find values for SEGNUM, HLEVEL, PSGNUM.
In a few words I need to execute an enhancement, via abap code, of the struscure of the idoc before sending it out since I have a requirement to test this enhancement in my XI environment, receiving as input this ideoc modified.
Then, I need to add a new segment and one child.
Any suggestion will be well appreciated.
Thanks in advance.
Regards,
    Giovanni

Similar Messages

  • How to create transport request with Transaction Code

    hi,
    i have made a Report and then i have transport it to QAS server but mistakenly i transport the request without T-Code.
    Now i want to make a new transport request with T-Code but can't understand where i can make this new request because when i go to this path*UTILITIES -> VERSION MANAGEMENT -> *  it shows me the request which i have transport it.So i want to make a new request with Transaction Code included in that request.Kindly guide me where i can make this request.
    Thanks.

    hi,
    Goto se93 give your tcode and press chagne,after entering into it make some change and click on save, it wil ask for TR. Save it and export it to quality.
    Regards
    harris

  • How to create dataslices IP with abap

    Dear Experts,
    I need to CREATE dataslices in IP via abap but don't really know how to do it, any FM that I can use? Hope somebody can help me...
    Thanks !

    Hi,
    Hint - Please try using function modules from the function group "RSPLSDS" like, RSPLSDS_PLDS_CREATE.
    Also Please refer thread :
    [Create new data slices via ABAP|Create new data slices via ABAP]
    Thanks and Regards,
    Prashant Vankudre.
    Edited by: Prashant_Vankudre on Dec 13, 2011 12:10 PM

  • How to Create Organization unit with customised code?

    Hi all,
       My business requirement need to create a Organization unit with a customised report.
    That customised report need to be developed in which i will be incorporating the code to create a new orgganization unit in sap
    and also to assign it in the organization structure.
    Please suggest me the Function Module to create it...or any sort of Standard report which is already doing that
    Thanks and Regards
    Sonal Jain.

    If I understand you correctly, you want to create a PROGRAM to create an Organization Unit (IT1000) and it's relation to it's parent Org.Unit (IT1001 with relation A_002).
    Check out program RHCOPY00, and create a Z version adapted to your needs.

  • How to create a node with attributes at runtime in webdynpro for ABAP?

    Hi Experts,
             How to create a node with attributes at runtime in webdynpro for ABAP? What classes or interfaces I should use? Please provide some sample code.
    I have checked IF_WD_CONTEXT_NODE_INFO and there is ADD_NEW_CHILD_NODE method. But this is not creating any node. I this this creates only a "node info" object.
    I even check IF_WD_CONTEXT_NODE but i could not find any method that creates a node with attribute.
    Please help!
    Thanks
    Gopal

    Hi
       I am getting the following error while creating a dynamic context node with 2 attributes. Please help me resolve this problem.
    Note
    The following error text was processed in the system PET : Line types of an internal table and a work area not compatible.
    The error occurred on the application server FMSAP995_PET_02 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: IF_WD_CONTEXT_NODE~GET_STATIC_ATTRIBUTES_TABLE of program CL_WDR_CONTEXT_NODE_VAL=======CP
    Method: GET_REF_TO_TABLE of program CL_SALV_WD_DATA_TABLE=========CP
    Method: EXECUTE of program CL_SALV_WD_SERVICE_MANAGER====CP
    Method: APPLY_SERVICES of program CL_SALV_BS_RESULT_DATA_TABLE==CP
    Method: REFRESH of program CL_SALV_BS_RESULT_DATA_TABLE==CP
    Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE_DATA of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMP_TABLE_DATA~UPDATE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_VIEW~MODIFY of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMPONENT~VIEW_MODIFY of program CL_SALV_WD_A_COMPONENT========CP
    My code is like the following:
    TYPES: BEGIN OF t_type,
                CARRID TYPE sflight-carrid,
                CONNID TYPE sflight-connid,
             END OF t_type.
      Data:  i_struc type table of t_type,
      dyn_node   type ref to if_wd_context_node,
      rootnode_info   type ref to if_wd_context_node_info,
      i_node_att type wdr_context_attr_info_map,
      wa_node_att type line of wdr_context_attr_info_map.
          wa_node_att-name = 'CARRID'.
          wa_node_att-TYPE_NAME = 'SFLIGHT-CARRID'.
          insert wa_node_att into table i_node_att.
          wa_node_att-name = 'CONNID'.
          wa_node_att-TYPE_NAME = 'SFLIGHT-CONNID'.
          insert wa_node_att into table i_node_att.
    clear i_struc. refresh i_struc.
      select carrid connid into corresponding fields of table i_struc from sflight where carrid = 'AA'.
    rootnode_info = wd_context->get_node_info( ).
    rootnode_info->add_new_child_node( name = 'DYNFLIGHT'
                                       attributes = i_node_att
                                       is_multiple = abap_true ).
    dyn_node = wd_context->get_child_node( 'DYNFLIGHT' ).
    dyn_node->bind_table( i_struc ).
    l_ref_interfacecontroller->set_data( dyn_node ).
    I am trying to create a new node. That is
    CONTEXT
    - DYNFLIGHT
    CARRID
    CONNID
    As you see above I am trying to create 'DYNFLIGHT' along with the 2 attributes which are inside this node. The structure of the node that is, no.of attributes may vary based on some condition. Thats why I am trying to create a node dynamically.
    Also I cannot define the structure in the ABAP dictionary because it changes based on condition
    Message was edited by: gopalkrishna baliga

  • How to create function module in abap for VirtualProvider in bi

    how to create function module in abap for VirtualProvider in bi ???????????????
    can any one help me with simple example ?????????????????
    Moderator message : Duplicate post locked. Read forum rules before posting.
    Edited by: Vinod Kumar on Jun 15, 2011 4:40 PM

    Hi ,
    Thanks for replies about my question??.
    If i am using the exit in my char relation ship how can i debugg that exit???
    if i am using BPS0 how to do it???If i am using BPS_WB how to do it??
    Case1.Variable (type Exit) I known how to do debugg this one in BPS0 but i'm not sure in BPS_WB??
    Case2:Char Relation Ship(Type Exit) how to do in BPS0 and BPS_WB??.
    Thanks.

  • "How to create new client in ABAP sneek Preview "

    HI ,
             Can anybody tell me how to create new client in ABAP sneek preview , i had  create  a new client 100 and tried to enter with Cilent 100. User : SAP* , and Password : pass. But i'm unable to log into the sap system.

    Hello,
    perhaps this will help you --> <a href="http://www.sap-img.com/bc049.htm">instructions</a>
    And this quote from another thread:
    <i>in SAPNW2004sSneakPreviewABAP this procedure only works if the system <b>profile parameter login/no_automatic_user_sapstar is set to 0</b> (and the system restarted after that), otherwise you will have a new client without any user thus useless ;-).</i>
    Regards,
    Norman

  • How to assign function module with process code in IDOC ?

    how to assign function module with process code in IDOC ? and what code i have to write in that function module for custom IDOC ?
    helpful answer will be rewarded?

    Hi,
    First goto transaction we42 -->editing mode --> new entries -->give name of your process code and description --> processing with alv service and function module -->then press enter -->after that enter the name of the function module you want to associate from the drop down and save it.
    Thats the way to assign function module with process code.
    In that process code we will have the Function modules and Bapi's which will take the data which we are sending through IDOC and then process it.
    for example: i am triggering the IDOC for every purchase order created then this process code in the receiver system will take the data which i have enetered in the sender system to create the purchase order and process it and creates the same purchase order in the receiver's system.
    Reward if helpful.
    with regards,
    Syed

  • How to create excise invoice with reference thorugh credit memo

    Hi All,
    Please provide any solution for the following qurey:
    How to create excise invoice with reference thorugh credit memo

    Hi murali,
    i am unable to understand your requirement i think there is no like this scenario requirement for any client
    if any requirement is there kindly explain detail
    cheers

  • How to create a complaint with pre-decessor document Inovice?

    Hello experts,
    I need create a complaint with reference to a pre-decessor document type Invoice (apart from other types such as sales order and service order). Can someone enlighten me
    1) how to create an invoice in IC Web Client and backend?
    2) how to create a complaint with reference to this created invoice in IC Web client and backend?
    Thanks a lot!!!

    Hi Easwar
    Thanks  a lot for answering the question.
    Yes I do have CRM Billing documents. But the problem is
    a) either the billing document doesn't have Transfer to Accounting status Transferred or
    b) a transferred billing document, but all items have error "Unable to offset billing item 90003458 0000000060" etc.
    Do you know
    1) how I can make a billing document have "Transferred" status? Pressing "Transfer to Accounting" button in the billing document overview page will only set the status to "Being transferred". And it's always being tranfered.
    2) What does the error "Unable to offset billing item ... "mean? How to get rid of them?
    Thanks a lot!

  • How to create a table with events in smartforms?

    How to create a table with events view in smartforms?
    It doesn't like general table with header, main area and footer.
    for example:
    in smartforms: LE_SHP_DELNOTE
    table name is TABLEITEM(Delivery items table)

    Vel wrote:
    I am creating XML file using DBMS_XMLGEN package. This XML file will contain data from two different database tables. So I am creating temporary table in the PL/SQL procedure to have the data from these different tables in a single temporary table.
    Please find the below Dynamic SQL statements that i'm using for create the temp table and inserting the data into it.
    Before insert the V_NAME filed, i will be appending a VARCHAR field to the original data.
    EXECUTE IMMEDIATE 'CREATE TABLE TEMP_TABLE (UNIQUE_KEY NUMBER , FILE_NAME VARCHAR2(1000), LAST_DATE DATE)';
    EXECUTE IMMEDIATE 'INSERT INTO TEMP_TABLE values (SEQUENCE.nextval,:1,:2)' USING V_NAME,vLastDate;What exactly i need is to eliminate the INSERT portion of it,Since i have to insert more 90,000 rows into it. Is there way to have the temp table created with data in it along with the sequence value as well.
    I'm using Oracle 10.2.0.4 version.
    Edited by: 903948 on Dec 22, 2011 10:58 PMWhat you need to do to eliminate the INSERT statement is to -- as already suggested by others - eliminate the temporary table. You don't need it. It is just necessary overhead. Please explain why you (apparently) believe that the suggestion of a view will not meet your requirements.

  • How to create shipment document with out inbound delivery document

    Dear Friends
    How to create shipment document with out outbound/inbound delivery document.
    In my client scenario, there is no inbound delivery for normal purchases.
    Just there are raising the PO to vendor, then they are doing MIGO for goods receipt.
    Can we do shipment creation with reference to PO?
    If it is possible, how it will be?
    Please let it solve
    With regards
    Lakshmikanth

    Dear Sameer,
    Please go to transaction VT01N here you enter Transportation planning point and shipment type then press enter.
    Now system will take you to the shipment document creation screen here you click on Select deliveries or press F6 now system will take you to the select outbound deliveries screen in this screen you enter selection data then execute, now deliveries will get assigned to that shipment.
    After assigning the deliveries enter the remaining data then complete the shipment finally save the shipment document.
    For more information please go through this SAP help link
    Note:- Shipment process need to be carry out for the deliveries before PGI.
    http://help.sap.com/saphelp_47x200/helpdata/en/f5/04898047bd11d2bf750000e8a7386f/frameset.htm
    I hope this will help you,
    Regards,
    Murali.

  • How to create a table with varied number of columns?

    I am trying to create a balance table. The colunms should include years between the start year and end year the user will input at run time. The rows will be the customers with outstanding balance in those years.
    If the user input years 2000 and 2002, the table should have columns 2000, 2001, 2002. But if the user input 2000 and 2001, the table will only have columns 2000 and 2001.
    Can I do it? How? Thanka a lot.

    Why did you create a new thread for this?
    How to create a table with varied number of columns?

  • How to create a table with datatype blob and insert a pdf file (ravi)

    how to create a table with datatype blob and insert a pdf file,
    give me the explain asap
    1.create the table?
    2.insert the pdffiles into tables?
    3.how to view the files?
    Thanks & Regards
    ravikumar.k
    Edited by: 895044 on Dec 5, 2011 2:55 AM

    895044 wrote:
    how to create a table with datatype blob and insert a pdf file,
    give me the explain asapPerhaps you should read...
    {message:id=9360002}
    especially point 2.
    We're not just sitting here waiting to answer your question as quickly as possible for you.

  • I need your expert opinion on how to create a map with multiple conditions.

    Hello.
    I need your expert opinion on how to create a map with multiple conditions.
    I have a procedure (which i cannot import or re-create in OWB due to the bug), so i am trying to create a map instead :-(
    How can i create a cursors within the map?
    My function creates table and cursor.
    Then it will have to check for duplicates in the tables (the one created and another table) - the criteria for finding duplicates is a number of fields.I then need to place few different conditions (if some attributes are not available) and it has to load cursor based on this conditions. The next step is to fetch the data into the cursor based on what attributes are missing.
    The next thing it will do is insert the data into table (if record doesn't exist), output the error in separate table is record is corrupted, or update the record with changed information.
    In short i need to re-create match / merge but with conditions, iterations etc 'built into' it.
    I can read up on available functions - it's just what would be the best options? and what would be the best approach to do so?
    In my function i use %rowtype - but cannot use it in owb - so what would be the alternative? i don't really want to create a lot of variables and then have a nightmare of maintaing it. are there any tips regarding this?
    having looked through Oracle dedupe - it's not really what i need because it is just DISTINCT.
    I would appreciate any help / advise on this.
    Thank you very much

    thanks a lot for your reply - i will look into this option :-)
    it is a bit more complicated now as i have to re-create the match / merge and then somehow 'tweak' it to achieve the result i need.
    At the moment i am looking to breakdown the package into smaller chunks 'functions' and try creating the map that way.
    Anyway, thank you very much for your suggestion.

Maybe you are looking for

  • Suggestion about Report Generation Toolkit

    I'm adding report generation capabilities to a labview product test application.  The report will be 2-4 pages long with text and plots.  For other applications, I've used Word Templates in the past using VBA and Visual Basis 6.   I had been planning

  • SQL statement with Function returns slow in Interactive Report

    I have an Interactive Report that returns well but when I add in a function call in the where clause that does nothing but return a hard coded string of primary keys and is compared to a table's primary key with a like operator the performance tanks.

  • Table exists even after dropping

    I dropped a table named contacts,but still it exists when i type "select * from tab" SQL> drop table contacts; Table dropped. SQL> commit; Commit complete. SQL> drop table contacts; drop table contacts ERROR at line 1: ORA-00942: table or view does n

  • Import Elements catalog into Lightroom

    Hi everybody, I used PSE on my notebook for a couple of years now. As i bougth a new pc recently I want to upgrade to Photoshop CC / Lightroom. So here is my question: Is it possible to import my elements catalog into Lightroom including my tags? I s

  • How do i get the bookmars to stop automatically stop showing up the browser box while im typing something

    everytime i write something in the location box (web addresses) it shows my bookmarks. i want it to stop. how do i do it?