Insert Nodes into Hierarchy via ABAP Program

Hello,
I want to create ABAP program to insert nodes into a hierarchy.
I got a class CL_RSSH_HIERMAINTAIN_FRONT with method INSERT_NODES_HIERARCHY .
But the method is private and cannot be used in the ABAP call.
I also don't want a pop up which asks for the action on duplicate nodes.
Can anyone guide me a bit here ?
Any help would be appreciated.
Varun

pl check following
http://www.scribd.com/doc/7300428/Structure-of-a-Flat-Hierarchy-File-for-Loading-Using-a-PSA

Similar Messages

  • Send a mail via ABAP program

    Hello Experts,
    I want to send mail via ABAP program with the following requirements :
    1. Recipient is OUTLOOK email -id
    2. Sender address has to be an external email-id
    3. Send mail as CC and BCC also to other email-id.
    Is there any function module which can satisfy all the above requirements.
    Regards,
    Mansi.

    hi,
    this code will definately help you just go through it:
    firstly  exported the data to memory using the FM LIST_FROM_MEMORY.
    CALL FUNCTION 'LIST_FROM_MEMORY'
    TABLES
    listobject = t_listobject
    EXCEPTIONS
    not_found = 1
    OTHERS = 2.
    IF sy-subrc 0.
    MESSAGE e000(su) WITH text-001.
    ENDIF.
    then i converted it into ASCII using LIST_TO_ASCI,
    CALL FUNCTION 'LIST_TO_ASCI'
    TABLES
    listasci = t_xlstab
    listobject = t_listobject
    EXCEPTIONS
    empty_list = 1
    list_index_invalid = 2
    OTHERS = 3.
    IF sy-subrc NE 0.
    MESSAGE e003(yuksdbfzs).
    ENDIF.
    This gives the data in ASCII format separated by '|' and the header has '-', dashes. If you use this internal table directly without any proccesing in SO_NEW_DOCUMENT_ATT_SEND_API1, then you will not get a good excel sheet attachment. To overcome this limitation, i used cl_abap_char_utilities=>newline and cl_abap_char_utilities=>horizontal_tab to add horizontal and vertical tabs to the internal table, replacing all occurences of '|' with
    cl_abap_char_utilities=>horizontal_tab.
    Set the doc_type as 'XLS', create the body and header using the packing_list and pass the data to be downloaded to SO_NEW_DOCUMENT_ATT_SEND_API1 as contents_bin.
    This will create an excel attachment.
    Sample code for formatting the data for the attachment in excel format.
    u2022     Format the data for excel file download
    LOOP AT t_xlstab INTO wa_xlstab .
    DESCRIBE TABLE t_xlstab LINES lw_cnt.
    CLEAR lw_sytabix.
    lw_sytabix = sy-tabix.
    u2022     If not new line then replace '|' by tabs
    IF NOT wa_xlstab EQ cl_abap_char_utilities=>newline.
    REPLACE ALL OCCURRENCES OF '|' IN wa_xlstab
    WITH cl_abap_char_utilities=>horizontal_tab.
    MODIFY t_xlstab FROM wa_xlstab .
    CLEAR wa_xlstab.
    wa_xlstab = cl_abap_char_utilities=>newline.
    IF lw_cnt NE 0 .
    lw_sytabix = lw_sytabix + 1.
    u2022     Insert new line for the excel data
    INSERT wa_xlstab INTO t_xlstab INDEX lw_sytabix.
    lw_cnt = lw_cnt - 1.
    ENDIF.
    CLEAR wa_xlstab.
    ENDIF.
    ENDLOOP.
    Sample code for creating attachment and sending mail:
    FORM send_mail .
    u2022     Define the attachment format
    lw_doc_type = 'XLS'.
    u2022     Create the document which is to be sent
    lwa_doc_chng-obj_name = 'List'.
    lwa_doc_chng-obj_descr = w_subject. "Subject
    lwa_doc_chng-obj_langu = sy-langu.
    u2022     Fill the document data and get size of message
    LOOP AT t_message.
    lt_objtxt = t_message-line.
    APPEND lt_objtxt.
    ENDLOOP.
    DESCRIBE TABLE lt_objtxt LINES lw_tab_lines.
    IF lw_tab_lines GT 0.
    READ TABLE lt_objtxt INDEX lw_tab_lines.
    lwa_doc_chng-doc_size = ( lw_tab_lines - 1 ) * 255 + STRLEN( lt_objtxt ).
    lwa_doc_chng-obj_langu = sy-langu.
    lwa_doc_chng-sensitivty = 'F'.
    ELSE.
    lwa_doc_chng-doc_size = 0.
    ENDIF.
    u2022     Fill Packing List For the body of e-mail
    lt_packing_list-head_start = 1.
    lt_packing_list-head_num = 0.
    lt_packing_list-body_start = 1.
    lt_packing_list-body_num = lw_tab_lines.
    lt_packing_list-doc_type = 'RAW'.
    APPEND lt_packing_list.
    u2022     Create the attachment (the list itself)
    DESCRIBE TABLE t_xlstab LINES lw_tab_lines.
    u2022     Fill the fields of the packing_list for creating the attachment:
    lt_packing_list-transf_bin = 'X'.
    lt_packing_list-head_start = 1.
    lt_packing_list-head_num = 0.
    lt_packing_list-body_start = 1.
    lt_packing_list-body_num = lw_tab_lines.
    lt_packing_list-doc_type = lw_doc_type.
    lt_packing_list-obj_name = 'Attach'.
    lt_packing_list-obj_descr = w_docdesc.
    lt_packing_list-doc_size = lw_tab_lines * 255.
    APPEND lt_packing_list.
    u2022     Fill the mail recipient list
    lt_reclist-rec_type = 'U'.
    LOOP AT t_recipient_list.
    lt_reclist-receiver = t_recipient_list-address.
    APPEND lt_reclist.
    ENDLOOP.
    u2022     Finally send E-Mail
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    document_data = lwa_doc_chng
    put_in_outbox = 'X'
    commit_work = 'X'
    IMPORTING
    sent_to_all = lw_sent_to_all
    TABLES
    packing_list = lt_packing_list
    object_header = lt_objhead
    contents_bin = t_xlstab
    contents_txt = lt_objtxt
    receivers = lt_reclist
    EXCEPTIONS
    too_many_receivers = 1
    document_not_sent = 2
    document_type_not_exist = 3
    operation_no_authorization = 4
    parameter_error = 5
    x_error = 6
    enqueue_error = 7
    OTHERS = 8.
    Hope it will help you
    regards
    Rahul sharma

  • How to extract data from BPC InfoCube via ABAP program?

    Hi experts!!
    I tried to extract data from a BPC InfoCube via ABAP program, but I did'n have succeed.
    I used the function 'RSDRI_INFOPROV_READ' to extract data from standard InfoCubes such as '0COPC_C07' and it run OK! However, when I change the InfoCube name to '/CPMB/WAIX8NE' (BPC InfoCube), everything goes wrong...
    Is there any difference between extracting data from BPC and standard InfoCubes?
    Thank you all!

    Moderator message - Welcome to SCN.
    But please do not cross and duplicate post.
    Thread locked.
    Rob

  • Create Node in Solar01 using ABAP Program

    Hi Experts
    In our project, the integration between ARIS and Solution Manager is not working. So the project team has decided to develop a workaround solution for this problem. The solution is we download all the BPP & BPS from ARIS into an excel file. We should upload the file and create the necessary BPP/BPS nodes in SOLAR01 using an ABAP program. Now we have the file and the below data in file.
    We have the parent level SAP GUID in the file. Using this as reference we need to create the below two nodes.
    ARIS Level 4 Sub-Process - This should be created as Solution Manager Business Process Node
    ARIS Level 5 Task - This should be created as Solution Manager Business Process Step Node
    Can anyone of you have done any similar development to the above? I will really appreciate if you can provide me with some function modules or any pseudo code or the approach to achieve this requirement.
    Regards
    Hari

    Hi Hari,
    There is no need of creating a program
    this functionality is available in Solution manager 7.1 to upload via content files like excel sheet etc
    https://help.sap.com/saphelp_sm71_sp05/helpdata/en/ea/7d9d444c404849bf99a0dd19f2107a/content.htm
    you can refer my below article for all the steps
    SAPexperts | How to Quickly Create Business Blueprints in SAP Solution Manager 7.1 Using Content Upload Interface
    Thanks
    Prakhar

  • Calling ITS Service via abap program

    We have made an ITS Service (SAP GUI for HTML) for one of the R/3 programs (Customized).
    If the URL is linked directly to the service, it shows correctly.
    But if we call the service via transaction code as in: Call tcode Zabc..., it does not work.
    How can we call the service directly from the abap program on the click of a button?
    Thanks in advance.

    Hi,
    You can do something like this:
    CALL FUNCTION 'CALL_BROWSER'
             EXPORTING
               url                          = path
               new_window                   = 'X'
             EXCEPTIONS
               frontend_not_supported       = 1
               frontend_error               = 2
               prog_not_found               = 3
               no_batch                     = 4
               unspecified_error            = 5
               OTHERS                       = 6
    where PATH variable is ITS service url:
        CONCATENATE 'http://server:port/sap/bc/gui/sap/its/webgui?transaction=xxxxxx&okcode=xxxx INTO path.
    Hope this helps,
    Iván.

  • Schedule Jobs with multiple steps via ABAP Program

    Hi,
    I need to schedule multiple programs via background jobs on a daily basis. Since all these jobs are to be run as a single job, the various programs have to be run as steps in a major job.
    I am however not very clear on how this can be done via an ABAP program ( the idea of a program is that various parameters to be passed to each program in the step can be entered dynamically rather than via variants).
    I am using the JOB_OPEN and JOB_CLOSE functions and submitting the programs with selection screen parameters dynamically passed to create a job. I need to do this for various programs as a job step (WITHOUT Variants being defined).
    Can anyone suggest any ideas for this? I have tried out JOB_SUBMIT Function but am not very confident I know what exactly it is for as it asks for a variant.
    Thanks very much,
    Preet

    Hi Preet,
    just to be sure: you know, that variants can be dynamical, too?
    It's quite usual to assign dynamical current date, but it's also possible to add / subtract value and even define own functionality.
    Maybe it's easier to implement a dynamical selection and handle static jobs.
    If you try to plan a job (online or with JOB_SUBMIT), you have to use variants - you can create (or change) them dynamical in beforehand. Only SE38, F8, F9 is creating a temporary variant, so that no saved variant is necessary.
    But if you end up creating variants dynamical, you can change one existing variant, too. Then you can use a static job definition (with periodical starting rule).
    So: have a look, if dynamic variants are enough, otherwise change variants per job.
    Regards,
    Christian

  • Create a DDic sturcture via ABAP program

    Hello,
    is it possible to create a DDic structure via a ABAP program? I've got the components and component type of the new structure in a table.
    I want to create a DDic structure with this information. Is there function module or a method, with this functionality?
    Thanks for help!
    Matthias

    I need a DDic structure to use this in the exporting parameters of an remote-enabled function module.  Thier isn't it posible to use an none typed parameter, because of the remote.
    I want to create an admin-screen for an tool calls DocFinder. For this tool you need for every DocuSpace an extra structure to return the values.
    We use this tool in an shared systemlandscape so its nessessary to use an remode-enabled function module.
    In the admin-screen it should be able to create an new DocuSpace with its structures and other generatet coding.
    But I've got no idea how to create an structure via programm.

  • How to add a new output type in sales order header via ABAP program

    Hi All,
    I have to add new output type (ex Z001) in sales order header via an ABAP program. please let me know how to do this.
    Thank you all in advance.

    Hi,
    You can use the FM ..RV_MESSAGE_UPDATE..
    Thanks
    Naren

  • Copy Attachement in CV03N via ABAP program

    I would like to copy an attachment in CV03N to my C: drive.  I can do this by right clicking on the file and selecting Copy To.  I need to do this via an ABAP program.  Is this possible?
    Thanks Gary

    Found the answer....
    CALL FUNCTION 'CVAPI_DOC_VIEW' copies attachment from CV03N to my PC

  • Insert Node into XML using XPATH

    Hi,
    I'm having problems inserting a node into a XML. After getting some attributes from the CRC result i'd like to store them in a temp xml variable.
    After that the parent node of the attributes should be inserterd in a goal XML with a repeating node structure.
    Whats the right way to set a node to a certain position in the goal XML?
    Now the only thing i'm getting is erros about transaction:
    Caused by: javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a307d1e:fd15:4d35c503:1351f50 status: ActionStatus.ABORT_ONLY >
        at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectio nManager.java:304)
        at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnec tionManager2.java:396)
    Etc..
    Thx!

    You can always append new nodes which has a unique tag name (this won't get overwritten).
    Which means, each time when you add a node, it should have tag name which has not already present within the same parent node.
    Later you can replace the tag name with the actual name by using XSL transformations.
    I've tried this in one of my project and worked fine.
    Nith

  • Parse XML streams via ABAP program or class

    Hi all,
    because of a new requirement we would like to create characteristics from a XML file by using the following structure.  
    xmlns:gdt="http://sap.com/xi/SAPGlobal/Global" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    We do not use SAP XI but I would like to parse the XML stream from a file in order to have the information available in a ABAP program. For this reason I'm looking for a standard SAP ABAP program or class to read and parse such a XML file. 
    I would appreciate if somebody have more details on this topic.

    Check this out.
    XML to ABAP
    Regards,
    Rich Heilman

  • Schedule/Execute POWL Query in Background or via ABAP Program

    Hi all,
    I would like to know if there is any chance/possibilities to schedule/execute the POWL Query for example the Query ID
    "SAPSSRM_R_CENTRALCONFIRM_01_01" Confirmations Pending in the background to output report.
    Or perhaps there is anyway I can make use of the logic within the Query ID above in an ABAP program?
    The main reason is that I need create a Confirmations Pending report and sent out to relevant SC Creator and the quickest way is to make use of the existing query of above.
    Many thanks and regards,
    Hon Leong

    Hi Hon Leong,
    please first check POWL - Web Dynpro ABAP - SCN Wiki to understand, how POWL works.
    You need to find a Feeder Class of your query and execude GET_OBJECTS Method to get the result list.
    For example you can check report POWL_WLOAD or function module POWL_QUERY_REFRESH.
    Regards
    Konstantin

  • Urgently need help inserting nodes into TreeTable

    Hi, I've got the following problem -
    I use the model that retrieves data from Oracle Database, and it works ok, but when I try to insert new node dynamically, I get very strange reaction of TreeTable and I've been looking where the problem for several hours and I can't find it.
    When I insert the new node I see that the new node is inserted BUT the information in the table doesn't match to the one I've inserted - the node's name is empty and the information in the table just the same as the previous element has.
    I use TreeTable built on the exmple from Sun.
    To notify the TreeTable about changes I use
      public void nodesChanged(){
            TreePath path = treeTableProcess.getTree().getPathForRow(1);
            Object newChild[]= processMonitorModel.newNode();
            int[] ind = new int[newChild.length];
            for (int i=0;i<newChild.length;i++) {
                ind[i] = i;
            processMonitorModel.fireTreeNodesInserted(this,
                                                      path.getPath(),
                                                      ind,
                                                      newChild);
        }I know that TreePath is ok, I checked it out, my node object contains information, the method fireTableDataChanged() get called but the node that I see doesn't contain the information of the node I inserted.
    Thank you in advance!
    Yuri, Germany

    This is the error I get
    Error starting at line 1 in command:
    INSERT INTO PROJECT_CONSULTANT
    (PROJECT_ID, CONSULTANT_ID, ROLL_ON_DATE, ROLL_OFF_DATE, TOTAL_HOURS)
    VALUES
    (1, 100, '06/15/2009', '12/15/2009', 175.00)
    Error report:
    SQL Error: ORA-01843: not a valid month
    01843. 00000 - "not a valid month"
    *Cause:   
    *Action:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Insert node into JTree with own TreeModel

    Hi,
    I use JTree in combination with my own TreeModel. When a node is removed I use this to inform all listeners:
    actListener.treeStructureChanged(new TreeModelEvent(this, pathToRoot));The above works fine. Now if I insert a node and its' parent is already expanded nothing happens at all! I tried to call actListener.treeStructureChanged(new TreeModelEvent(this, pathToRoot)); and actListener.insertTreeNodes(new TreeModelEvent(this, pathToRoot)); without success!
    As long as the parent is collapsed and a new node is inserted my getChildCount() method in my TreeModel gets called and the freshly added node will be display correctly but whan the node is already expanded nothing happens.
    I've also checked the listeners of my model: one of them is JTree, so it is informed about the insertions but why won't it update its' view? It's especially funny since everything is fine when deleting a node.
    Many thanks for any hints.
    Regards,
    Ren�

    I am struggling with the same problem, and have yet to find a solution, maybe some more suggestions can be made? Here is the situation... I've got a JTree and a custom TreeModel. Now, if I do not expand a node, I can insert and delete from it at will using treeStructureChanged(new TreeModelEvent(this,path))and when I expand the node it will have the correct children. However, once I have expanded the node, all attempts to add or remove children are futile. Even if I un-expand the node, changes will not register in the JTree. I've tried out both suggestions already provided in this thread, but to no avail. Additionally, if I reset the root node, all my changes will appear correctly, however the trees "expanded" state is lost and this is not desireable.
    Anybody have any advice?

  • Cost Center Hierarchy in ABAP program

    Hi All,
    We are writing a custom program to extract the cost center master data from SAP.
    There is a requirement to extract the cost center group that is linked to the cost center as well.
    But the extracted group should only be the one attached to it in the standard hierarchy.
    All other groups should be rejected.
    Please share your experiences on how can this be achieved as I could not find a table where the cost center hierarchy is maintained directly.
    regards,
    Manish Gupta

    Hi Manish
    The table is SETLEAF.. All cost center groups including Cost Center Hierarchy are stored there
    there might be some differentiating field between the Hierarchy and other Cost Ctr Gruops...
    BR,Ajay M

Maybe you are looking for

  • Animated gif is tiling when opened on iPad email

    I am trying to design a simple email blast with an animated gif which i have been doing so for 5 years. today, i designed a new email blast for my client and it works perfectly on all my email accounts including mac mail and thunderbird. however, whe

  • Display not working correctly... cant figure it out.

    Hello all, I have a MacBook Pro and for some reason today when I reset my computer and it turned back on the display was stretched about 10px on each side. So when I move my mouse around my screen is moving around now too. Very annoying. I had an ext

  • Hard Drive Crashed -  New Hard Drive - Time Machine

    So my hard drive crashed. I have the black MacBook A1181. So I decided to get the Western Digital - Scorpio Black hard drive. Its a perfect fit and a huge upgrade from the stock Toshiba hard drive you get. The only problem is, i can't install Mac OSX

  • E-Learning Toolkit - using the Learning Site

    Hi I don't know if anyone wil be able to help me or not but I'll give it a shot:- I have recently bought a copy of the Dreamweaver MX e-Learning Toolkit by Michaal Doyle. My version of Dreamweaver is Dreamweaver MX 2004 which may be why I am havign a

  • Iweb 1.1.2 to iweb 2.0.4

    For the life of me I can't figure out how to open the working sites i built in 1.1.2 with my newer version, 2.0.4 to work on them. Is there some secret i'm not privy to?