How to write abap code to create manual hierarchy

Hi,
This is urgent got to write abap code to create manual hierarchy.
Thanks

Hi Adam
Thanks for replying.
In my scenario i have one custom zinfoobject which have lots of attributes.
So, i have to create hierarchy for this zinfoobject with three nodes. one node/charateristic is present in this zinfoobject as attribute. which will be the first node of hierarchy.
Then second custom infoobject is external not present in attribute list. which will be the second node of hierarchy.
Third node will be for which i am creating hierarchy.
So basically need solution for this first.
some one will load hierarchy info in some table and then will create view on top of that then i have to create datasource on top of that and write a program to load the data from that view in this hierarchy.
Need solution for this abap program also.
Thanks
SAPBW

Similar Messages

  • How to write ABAP code behind, the OLAP navigation functions

    Hi SDN Community,
    We have created an artificial hierarchy within BEx, using order structure elements, or characteristic key figures as SAP calls them.
    Now, the only feature that dosent seem to be present within the OLAP, is to expand all hiearchy nodes.
    It allows you to expand one hierarchy node, but not all the structure element nodes.
    I have tried command sequencing by specifying the technical id's of the the structure elements found via RSRT2, but this dosen't work.
    I have seen that when the nodes are expanded, that there is indeed standard SAP ABAP code executing back in the datawarehouse.
    Hence, do you know
    - Where to make ABAP enhancements for OLAP functionality
    - How to execute this ABAP (will it be by using Web API and javascript enhancements)
    - Is this possible, or has it been done by anyone?
    Thank you.
    Simon

    Hi Thomas,
    I have been working with a brilliant ABAP'er, and together we
    implemented a solution in the START method, that makes use of the
    following methods and expands all the hierarchy nodes at start.
    And this class can be omitted in the Print all view we have formulated
    as only a collapsed view has been specified there.
    thank you.
    Simon
    I found this all in that class interface CL_RSR_REQUEST
    for N_R_REQUEST
    for N_R_DATA_SET
    Initial Value: Set Drilldown State of a Hierarchy
    Description: 'SET_DRILL_STATE'
    this looks like the method that gets executed. what do you think?
    can you code this in the program
    constants C_CMD_SET_DRILL_STATE type RSRCMDID
    value 'SET_DRILL_STATE'. "#EC NOTEXT
    methods SET_DRILL_STATE
    importing
    value(I_AXIS) type RRXAXIS optional
    value(I_POSITION) type I optional
    value(I_FOCUS_IOBJNM) type RSIOBJNM optional
    value(I_DRILLSTATE) type RRXDRILLSTATE optional
    value(I_TOGGLE) type RS_BOOL default RS_C_FALSE
    !I_R_PARAMETER type ref to CL_RSR_PARAMETER optional
    exporting
    !E_KEEP_LAST_LINES type I
    !E_KEEP_FIRST_LINES type I
    !E_NEW_LINES_FROM type I
    !E_NEW_LINES_TO type I
    !E_NODE_POSITION_FROM type I
    !E_NODE_POSITION_TO type I
    exceptions
    NO_PROCESSING
    X_MESSAGE .

  • How to write ABAP code to split a sentence into Word by Word and store them

    Hi all,
        I have to split a sentence into word by word and store them into separate columns. This sentence is nothing but a text description (TXTMD) from table TXXXX. The description will have 3 or more than 3 words and LAST word will be <b>always with %</b>'. The following is the sample input data:
    KEY(ORD43)       Description(TXTMD)
    'AAAA'                '1234  ABCD COMPANY USA  80%'
    'BBBB'                '4745  XYZ INC CANADA ABCD  70%'
    For the first record:
      '1234' should stored in to <b>Field 1</b>, 'ABCD COMPANY USA' into <b>Field 2</b> and
    '80%' into <b>Filed 3</b>.
    For the second record:
      '4745' should stored in to <b>Field 1</b>, 'XYZ INC CANADA ABCD'  into <b>Field 2</b> and 70%' into <b>Field 3</b>.
      The first word into Field 1, the last word with % into Field 3 and all middle words into Field 2. The number of words in the sentence could be 3 or more than 3.
      Could you please help in writing the ABAP for this requirement ????
      Thanks in advance.
    Regards,
    Venkat.

    Easy way if you know the length of the field.
    In my example I assumed my field has 12 places.
    DATA: obs TYPE string,
           bkp TYPE char12.
    obs = '12345678901234567890123456789012345678901234567890'.
    DO.
       MOVE obs TO bkp.
       SHIFT obs BY 12 PLACES LEFT.
       write: / bkp.   "Do what you want with bkp variable
       IF obs IS INITIAL.
         EXIT.
       ENDIF.
    ENDDO.

  • How to write ABAP code to split a sentence into Word by Word ???

    Hi all,
    I have to split a sentence into word by word and store them into separate columns. This sentence is nothing but a text description (TXTMD) from table TXXXX. The description will have 3 or more than 3 words and LAST word will be always with %'.
    This description is available on R/3 table and in InfoObject on BW side and this split is required in reporting. Should I split it in R/3 itself or BW side, PLEASE ?
    The following is the sample input data:
    KEY(ORD43) Description(TXTMD)
    'AAAA' '1234 ABCD COMPANY USA 80%'
    'BBBB' '4745 XYZ INC CANADA ABCD 70%'
    For the first record:
    '1234' should stored in to Field 1, 'ABCD COMPANY USA' into Field 2 and
    '80%' into Filed 3.
    For the second record:
    '4745' should stored in to Field 1, 'XYZ INC CANADA ABCD' into Field 2 and 70%' into Field 3.
      The first word into Field 1, the last word with % into Field 3 and all middle words into Field 2.
    Could you please help in writing the ABAP for this requirement ????
    Thanks in advance.
    Regards,
    Venkat.

    Hi,
    in case your text is built in that way for every record you can do the following in routines of the update rules to the 3 fields:
    routine for field 1:
    result = comm_structure-<name of your textfield>(4).
    routine for field 2:
    data: l_length type i.
    l_length = strlen( comm_structure-<name of your textfield> ).
    l_length = l_length - 9.  "the 5 characters at the beginning + 4 at the end.
    result = comm_structure-<name of your textfield>+4(l_length).
    routine for field 3:
    data: l_length type i.
    l_length = strlen( comm_structure-<name of your textfield> ).
    l_length = l_length - 3.
    result = comm_structure-<name of your textfield>+l_length(3).
    hope this helps!
    kind regards
    Siggi

  • How to write the expression when create the calculated column?

    Dear,
           I want to create some calculated column in my attribute view, but I don't know how to write the code in the expression, is there any introduction about this part, how to use those function and how about the grammar in this expression code ?  or is there any example about this calculated column?
       Thanks for your sincerely answer.

    Hi Zongjie,
    you can find some information about the creation of calculated columns in the HANA Modeling Guide (http://help.sap.com/hana/SAP_HANA_Modeling_Guide_for_SAP_HANA_Studio_en.pdf).
    Within chapter 6.2.1 (Create Analytic Views) you can see under point 7 some basics and also a simple example. The same is also valid for Calculation Views.
    Chapter 8.9 (Using Functions in Expressions) describes the different available functions.
    You also can use the integrated search in the HANA Studio by clicking the "?" button in the button left corner. Then you get some links in the side panel with related information.
    In general you can write your expression manually or you can just drag and drop the functions, elements, operators into the editor window. For example if you drag and drop the "if" function into the editor window you get "if(intarg,arg2,arg3)" inserted. The arguments can be replaced manually or also by drag and drop.
    It is also worse to use the "Validate Syntax" button on top of the editor window. It gives you directly a feedback if your expression syntax is correct. If not you get some helpful information about the problem (ok, sometimes it is a little bit confusing because of the cryptic error message format ).
    Best Regards,
    Florian

  • For RFC  Sender  " Is it must i need to write ABAP code " ?

    Hi All
       I am learning XI but  i have problem while creating RFC sender ?
       How to configure RFC sender? I must write ABAP code in R/3 side ?
      Can any one expalin me indetail on this?
      I see many links in SDN but i was not able to find the exact one
    Adv..thanks and points
    Rakesh

    Hi ,
    Go thru this data...
    <b>Configuring the Sender RFC Adapter </b>
    <b>Use</b>
    You configure the sender RFC adapter so that you can use it to convert RFC calls from a sender to XML messages and send these messages to the Integration Server.
    <b>Integration</b>
    You configure the adapter on the Parameters tab page during the definition of a communication channel. In addition to the adapter configuration, on the Module tab page in the module processor, you can specify generic modules, which give the adapter additional functions.
    <b>Prerequisites</b>
           1.      You have created a new communication channel or have opened an existing one.
           2.      On the Parameter tab page you have selected the adapter type RFC.
           3.      You have selected the Sender radio button to define the adapter as a sender adapter.
           4.      The communication channel in which the RFC adapter is defined must be defined for a service of type Business System in the area Service Without Party.
           5.      The specifications in the communication channel must match the specifications for the adapter-specific identifiers for the business system. For more information on adapter-specific identifiers, see:  Service
    <b>Activities</b>
    <b>Transport Protocol</b>
    The transport protocol is RFC.
    <b>Message Protocol</b>
    The message protocol is RFC (RFC XML).
    <b>Adapter Engine</b>
    Select the Adapter Engine on the Integration Server, or select a non-centrally installed Adapter Engine.
    <b>Adapter Status</b>
    Set the adapter to Active to enable messages to be exchanged.
    RFC Server Parameters
    The RFC server parameters identify the sender system.
    <b>Specify the following parameters:</b>
    Parameter     Entry
    Application server (Gateway)     Gateway host of the sender system
    Application server service (Gateway)     Gateway service of the sender system
    Program ID     Program ID of the registered server program
    Unicode     Select this check box if the sender system is a Unicode system
    Initial connections     Number of initial connections required between sender system and adapter
    Maximum connections     Maximum possible number of initial connections required between sender system and adapter
    Advanced mode     Select this check box if you want to specify additional parameters of the class JCO.Server for the adapter configuration
    Enter the name and values of the parameters in the table displayed
    <b>RFC Metadata Repository Parameters</b>
    The RFC metadata repository parameters identify the SAP system containing the repository for the RFC metadata. This does not necessarily have to be the sender system.
    <b>Specify the following parameters:</b>
    <b>Parameter     Entry</b>
    Load balancing     Select this check box if your SAP system works with load balancing
    Application server     Host name of the SAP system (without load balancing)
    System number     System number of the SAP system (without load balancing)
    Message server     Host name of the message server (with load balancing)
    Message server service     Operating system service of the message server or message server port (with load balancing)
    System ID     System ID of the SAP system (with load balancing)
    Logon group     Logon group for the dynamic logon load (with load balancing)
    Authentication Type     Logon data for the SAP system
    User Name     SAP user name
    User Password     SAP user password
    Logon language     SAP logon language
    Client     SAP client
    Advanced mode     Select this check box if you want to specify additional parameters of the class JCO.Client for the adapter configuration
    Enter the name and values of the parameters in the table displayed
    Depending on the SAP system version, the following authorizations are required to read the metadata (authorization object: S_RFC, ACTVT: 16, FUGR):
    Function Groups by R/3 Release
    R/3 Release     Function Groups (FUGRs)
    As of 3.1H     RFC1, SG00, SRFC, SUNI, SYST
    As of 4.0A     RFC1, SDIF, SG00, SRFC, SYST, SYSU, SUNI
    As of 4.6A     RFC1, SDIF, SG00, SRFC, SYST, SYSU
    As of 4.6D     RFC1, SDIFRUNTIME, SG00, SRFC, SYST, SYSU
    As of SAP Web Application Server 6.20, the role SAP_BC_JSF_COMMUNICATION_RO is available, which is used for the user SAPJSF and contains all the required authorizations.
    Regards,
      Jayaram...

  • How to write ABAP HR reports in ABAP web dynapro

    Hi All,
    How  to write ABAP HR reports in ABAP web dynapro? We can add HR REPORT CATEGORY in ABAP HR using logical database like PNP.How to add HR REPORT CATEGORY in ABAP Webdynapro ?
    Thanks.

    You can't use legacy concepts like logical databases directly in Web Dynpro ABAP.  Even if you could do so, you shouldn't.  Web Dynpro ABAP should always follow MVC - meaning that your business logic (the model) should be separated from WD as much as possible. This means calling function modules or class methods to consume the business logic and data.  So in general there should be no difference between building HR reports or any other type of report in WDA - since from the WDA side you are calling other objects to consume the data. 
    This probably does mean that you will need to create classes to expose the HR data that you want in your WDA.

  • HOW TO WRITE ABAP PROGRAMMING IN JAVA BY USING NETWEAVER

    HI,
    i am working with bapi(mean is calling bapis in my java programs).
    please tell me the how to write abap programs in nwds
    Thanqqqqqqqqq
    Guru

    Hi,
    Refer the following links..
    http://manuals.sybase.com/onlinebooks/group-iaw/iag0203e/iadgen2/@Generic__BookTextView/24685
    and this blog
    /people/kathirvel.balakrishnan2/blog/2005/07/26/remote-enable-your-rfchosttoip-to-return-host-ip-to-jco
    Regards,
    Uma

  • SQ01 DIsplay Problem (Can v write abap code ) Sql Query

    Hi
    Need help in SQL Query
    I generated one sql query which has the following output in general .
    Customer   name   description   amount
    asrq1  sharekhan      Amount payed      10
    asrq1  sharekhan     Amount Advance     20
    asrq1  sharekhan    Amount due             30
    but i need the output in the following way
    Customer  name  AMount payed     Amount  Advance                  Amount Due
    asrq1   sharekhan  10    20     30
    and iam new this sql query but came to know we can write code ..but iam unable to initiliaze to write
    a peace of code as i dont know what are the select-options defined ..i saw in the include but didnt got it
    % comes prefix of select-options,and iam unable to get he internal table which is displayed in the query .
    can anyone help me in this answers will be awarded points.

    First, I will suggest to go for ABAP report for this kinda requirement.
    If you really want to go for it through SQ01, even then you will have to write some ABAP to display the records in one row. You will need to create three custom fields.
    I will give Psudo for one field:
    Field Name := ZAmountPayed
    Select Amount_Payed into varAmountPayed from Table Where Emp# = '12345'
    ZAmountPayed := varAmountPayed
    Convert the above into relative ABAP code and create 2 more similar fields, and you should be all set.
    You have to know the table names and any other calculations to get the right data.

  • How to write html code in narrative

    Hi,
    How to write html code in narrative to get following format
    desc value1 Value2 totalvalue
    a 10 20 30
    b 20 30 50
    Totalvalue 30 50 80
    Total % 0.3 0.5 0.8
    Can any one help guide on writing HTMl code for above table format in narrative type of display data at report level
    Thank you
    Manu

    Hi Balu,
    If you are using the Web Application server (WEBAs), Then you can create applications using BSP( Bussiness server pages). Which is some what luike JSP.
    Or
    In SE80 , Try to create internet service files uisng BHTML. In the dropdown select internet service. And then try to create the HTML templates
    Thanks,
    Sarayoodharan.K

  • How to write agal2 code

    i can not find information about how to write agal2 coding.
    conditional forward jump code 'IFE' or 'ELS', 'EIF'... I cant know how to write agal code.
    and how to use Fragment depth.
    please give me writing agal code, or lecture page.

    In addition to Gary's excellent blog posts that Anton references, we also have these posts created by the developers that implemented these features:
    Stage3D “standard” profile
    Relaxing Render Target Clear operation in Stage3D

  • How to write source code in smart forms?

    hi friends,
    can anyone can help me in writing  sorcecode in smartforms r
    any materail link.
    if it is helpful points can b rewarded.Thanks in advance.

    Hi,
    Check this link for
    how to write source code in smart forms?
    http://****************/Tutorials/Smartforms/GettingStarted/SimpleText.htm
    You can write Source Code in smartforms By Choosing Program Lines.
    Check this link with Screen Shots
    http://****************/Tutorials/Smartforms/PO/page1.htm
    Reward All Helpfull Answers
    Regards
    Fareedas
    Edited by: Fareeda Tabassum S on May 21, 2008 3:09 PM

  • How to write a code for  open new txt file in swing

    hai all,
    now i do one project in java.that project's GUI is Swing. But i don't known swing (basic).So how to write a code for open new txt file and "Open window " in menu item on swing.that means when i click the "New" on menu that time open a new txt file. open also like that type.
    plz give me that code ! very urgent
    Advance Thanks !
    RSK

    Swing Tutorial:
    http://java.sun.com/docs/books/tutorial/uiswing/index.html
    Since you don't know the basic of swing read the tutorial, it is for your own good because it is useless if we provide you with a code you don't even understand and how it works.
    If you want a menu read the tutorial about using menus and for opening a file read using JFileChooser.
    note: don't use the word urgent because it implies that your problem is more important than others.

  • How to write the code to send the report output to the local file.

    dear all,
    how to write the code to send the report output to the local file.
    Thanks & Regards,
    Jyothi.

    Hi,
    Try this , it will display report and download the file as well. Just vhange the path and execute
    TYPE-POOLS : SLIS.
    DATA : IT_SCARR TYPE TABLE OF SCARR,
           IT_FCAT  TYPE SLIS_T_FIELDCAT_ALV.
    SELECT *
    FROM SCARR
    INTO TABLE IT_SCARR.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    *   I_PROGRAM_NAME               =
    *   I_INTERNAL_TABNAME           =
        I_STRUCTURE_NAME             = 'SCARR'
    *   I_CLIENT_NEVER_DISPLAY       = 'X'
    *   I_INCLNAME                   =
    *   I_BYPASSING_BUFFER           =
    *   I_BUFFER_ACTIVE              =
      CHANGING
        CT_FIELDCAT                  = IT_FCAT
    * EXCEPTIONS
    *   INCONSISTENT_INTERFACE       = 1
    *   PROGRAM_ERROR                = 2
    *   OTHERS                       = 3
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    *   I_INTERFACE_CHECK              = ' '
    *   I_BYPASSING_BUFFER             =
    *   I_BUFFER_ACTIVE                = ' '
    *   I_CALLBACK_PROGRAM             = ' '
    *   I_CALLBACK_PF_STATUS_SET       = ' '
    *   I_CALLBACK_USER_COMMAND        = ' '
    *   I_STRUCTURE_NAME               =
    *   IS_LAYOUT                      =
       IT_FIELDCAT                    = IT_FCAT
    *   IT_EXCLUDING                   =
    *   IT_SPECIAL_GROUPS              =
    *   IT_SORT                        =
    *   IT_FILTER                      =
    *   IS_SEL_HIDE                    =
    *   I_DEFAULT                      = 'X'
    *   I_SAVE                         = ' '
    *   IS_VARIANT                     =
    *   IT_EVENTS                      =
    *   IT_EVENT_EXIT                  =
    *   IS_PRINT                       =
    *   IS_REPREP_ID                   =
    *   I_SCREEN_START_COLUMN          = 0
    *   I_SCREEN_START_LINE            = 0
    *   I_SCREEN_END_COLUMN            = 0
    *   I_SCREEN_END_LINE              = 0
    *   IR_SALV_LIST_ADAPTER           =
    *   IT_EXCEPT_QINFO                =
    *   I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
    * IMPORTING
    *   E_EXIT_CAUSED_BY_CALLER        =
    *   ES_EXIT_CAUSED_BY_USER         =
      TABLES
        T_OUTTAB                       = IT_SCARR
    * EXCEPTIONS
    *   PROGRAM_ERROR                  = 1
    *   OTHERS                         = 2
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
      EXPORTING
    *    BIN_FILESIZE              =
        FILENAME                  = 'C:\Documents and Settings\sap\Desktop\Hi.xls' " Change path
    *    FILETYPE                  = 'ASC'
    *    APPEND                    = SPACE
    *    WRITE_FIELD_SEPARATOR     = SPACE
    *    HEADER                    = '00'
    *    TRUNC_TRAILING_BLANKS     = SPACE
    *    WRITE_LF                  = 'X'
    *    COL_SELECT                = SPACE
    *    COL_SELECT_MASK           = SPACE
    *    DAT_MODE                  = SPACE
    *    CONFIRM_OVERWRITE         = SPACE
    *    NO_AUTH_CHECK             = SPACE
    *    CODEPAGE                  = SPACE
    *    IGNORE_CERR               = ABAP_TRUE
    *    REPLACEMENT               = '#'
    *    WRITE_BOM                 = SPACE
    *    TRUNC_TRAILING_BLANKS_EOL = 'X'
    *  IMPORTING
    *    FILELENGTH                =
      CHANGING
        DATA_TAB                  = IT_SCARR
    *  EXCEPTIONS
    *    FILE_WRITE_ERROR          = 1
    *    NO_BATCH                  = 2
    *    GUI_REFUSE_FILETRANSFER   = 3
    *    INVALID_TYPE              = 4
    *    NO_AUTHORITY              = 5
    *    UNKNOWN_ERROR             = 6
    *    HEADER_NOT_ALLOWED        = 7
    *    SEPARATOR_NOT_ALLOWED     = 8
    *    FILESIZE_NOT_ALLOWED      = 9
    *    HEADER_TOO_LONG           = 10
    *    DP_ERROR_CREATE           = 11
    *    DP_ERROR_SEND             = 12
    *    DP_ERROR_WRITE            = 13
    *    UNKNOWN_DP_ERROR          = 14
    *    ACCESS_DENIED             = 15
    *    DP_OUT_OF_MEMORY          = 16
    *    DISK_FULL                 = 17
    *    DP_TIMEOUT                = 18
    *    FILE_NOT_FOUND            = 19
    *    DATAPROVIDER_EXCEPTION    = 20
    *    CONTROL_FLUSH_ERROR       = 21
    *    NOT_SUPPORTED_BY_GUI      = 22
    *    ERROR_NO_GUI              = 23
    *    others                    = 24
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE
      EXPORTING
        DOCUMENT               = 'C:\Documents and Settings\sap\Desktop\Hi.xls' "Change path
    *    APPLICATION            =
    *    PARAMETER              =
    *    DEFAULT_DIRECTORY      =
    *    MAXIMIZED              =
    *    MINIMIZED              =
    *    SYNCHRONOUS            =
    *    OPERATION              = 'OPEN'
    *  EXCEPTIONS
    *    CNTL_ERROR             = 1
    *    ERROR_NO_GUI           = 2
    *    BAD_PARAMETER          = 3
    *    FILE_NOT_FOUND         = 4
    *    PATH_NOT_FOUND         = 5
    *    FILE_EXTENSION_UNKNOWN = 6
    *    ERROR_EXECUTE_FAILED   = 7
    *    SYNCHRONOUS_FAILED     = 8
    *    NOT_SUPPORTED_BY_GUI   = 9
    *    others                 = 10
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • How find the ABAP code with Error message

    Hi
    How to  find the ABAP Code for Error Message?
    Example:
    Error Message: ZF026.
    Regards
    Odaiah Pelley
    Edited by: Odaiah Pelley on Aug 22, 2008 4:21 AM

    Hi
    Excellent Answer, I appreciate it.
    My question is with Error Message ZF026.
    How to find ABAP Code ?
    If I go for SE91 I will get same message as if I am getting error message.It is no use.
    Regards
    Odaiah Pelleyu

Maybe you are looking for