How to include a structure in a method

Hi All,
when i executed this statement in a method
types : BEGIN OF TY_ITAB2.
          INCLUDE STRUCTURE LTAP_VB.
types :  END OF TY_ITAB2.
Syntax Message:
Within classes and interfaces, you can only use "TYPE" to refer to ABAP Dictionary types, not "LIKE" or "STRUCTURE".          
how to create such structure

Here it is,
  DATA: w_ltap_vb TYPE ltap_vb.
  TYPES : BEGIN OF ty_itab2.
  TYPES: kunnr TYPE kunnr,
         name1 TYPE name1_gp,
         adrnr TYPE adrnr.
          INCLUDE STRUCTURE w_ltap_vb.
  TYPES : END OF ty_itab2.
Regards
Kathirvel

Similar Messages

  • How to create a structure in a method

    Hi
    Would any please tell me how to delcare a structure in a method which contains a SAP defined structre in it . I have done it in normal ABAP but it not taking that syntax in ABAP objects method . Please tell me syntax for a method .
    Thanks
    Anita

    Hello Anita
    I assume you tried the statement
    DATA: begin of <struct>.
    In methods we have to use the following approach:
    TYPES: begin of ty_s_struc.
    TYPES:   field1   TYPE <fieldname>.
    TYPES:   field2   TYPE <struct-fieldname>.
    TYPES:   ...
    TYPES: end of ty_s_struc.
    DATA:
      ls_struc     TYPE ty_s_struc,
      lt_itab      TYPE STANDARD TABLE OF ty_s_struc
                   WITH DEFAULT KEY.
    I prefer to place my type definition in the "TYPES section" (see push button "Types" in SE24). However, all types defined within your class are <b>private</b> meaning you cannot use them in the interface of public methods.
    Regards
       Uwe

  • HOW TO INCLUDE A STRUCTURE  ELIMINATING MANDT FIELD.

    HI GURUS,
                      I AM INCLUDING A STRUCTURE ZFT057_MSC_SRVHD. BUT IT IS GIVING AN ERROR THAT
    IT_MANDT HAS ALREADY BEEN DECLARED. IS THERE ANY ALTERNATE OPTION TO INCLUDE THE STRUCTURE ELIMINATING MANDT FIELD FROM IT.

    Hi Patil,
    i just tried it.
    do this.
    go to se11 --> create a structure --> from main menu go to Edit > include> copy components then u'll get all the fields in the structure . here delete the fields which u don;t want to get repeated.
    now again try edit --> include --> insert the new structure or table and execute.
    thanks & regards,
    kat.

  • In LSMW how to include customer fields in BAPI method ?

    Hi all,
    We have a requirement to use BAPI method in LSMW. We have some custom fields defined needs to be handled in BAPI structures.Please tell me how to handle BAPI extension structures(EXTENSIONIN/OUT) in LSMW.

    Hi Venugopal,
    You can use the sold to party field fiield for your requirement.
    Press f4, you will get a pop up to select customer depending on various selection criteria including customer name.
    If can enter the customer name, which will sort out the sold to party number whihc you can use.
    If this is not wat is required you have to copy the transaction and create a new Zreport.
    Hope this helps you.
    Thanks
    Arun

  • How to determine the structure of parameter method in WebServiceDataControl

    Hi all ,
    I have a web Service Data Control ,this data control has web service method that take a parameter of type (java.lang.Object)
    how can I determine the structure of this object to send it to the web service method
    (how can create the object that satisfy the object parameter of web service data control)

    I can see the constructor of data control which contain (name,age)
    but I don't know how can I send these two parameter in one object that satisfy the type of object in the web service method
    "parameterObject" : contain (name and age) values . (I don't know the type of "parameterObject" in web service)
    Map params = operationBinding.getParamsMap();
    params.put("arg0", parameterObject);

  • How to include columns with a space in name in clientcontext load method in JSOM

    Hi Gurus,
    I have a situation where I need to read a list that has a column 'Repositary Name'.
    While I am reading the list in my JSOM I need to load this column in the clientcontext.load method.
    My code likes this below.
    this.collListItem = list.getItems(camlQuery);
        ctx.load(collListItem, 'Include(Title, 'Repositary Name')')
    The Issue is I can not load this 'Repositary Name' column. I tried with its internal name, removing the space, putting the name in single quote but nothing works.
    Please advice how to include a column in clientcontext.load method that has a space in its name .
    Changing the column is not a option and I have to have call it before I use it my Async Methods.

    Hi,
    If I am getting your issue correctly, I think you should put _x0020_ in place of space in your column name. In your case try Repositary_x0020_Name.
    ***If my post is answer for your query please mark as answer***
    ***If my answer is helpful please vote***

  • How to include payment method in F-28 TX (I need in F-28 Obligatory)

    How to include payment method in F-28 TX (I need in F-28 Obligatory)

    Hi
    If you want to make assignment and document header text has required. Then go to SPRO-Financial Accounting - Document types - Define document types for entry view
    Here you select the Document type for incoming payments (ie)  DZ.
    In DZ Document type configuration there is section called required during document entry, there you will find check boxes referance document and Document header. Tick them, then it will become a required entry.
    Note:- When you do the entry These fields will not show with the indicator of Mandatory item but u cannot post the transaction without filling these fields.
    Cheers
    V.Krishnan
    (Assign Points if useful)

  • In query, how many objects can include in structure

    Hi expert,
    In BEX query coloum, How many objects can include in structure.

    Hi Sunil,
    We can include maximum of 999 fields in one structure.
    http://help.sap.com/saphelp_nw04/helpdata/en/4d/e2bebb41da1d42917100471b364efa/frameset.htm
    Regards,
    Venkatesh

  • How to include all the fields of a Table into a Structure.

    How to include a Complete Table into a Structure.
    I want to include all the fields of KNA1 into a structure say W_KNA1(A local structure declared within a program)....How this can b acheived.
    Thanks in Advance.

    if i want to use INCLUDE STRUCTURE.....how will it work.
    TYPES : begin of ty_kna1,
                      INCLUDE STRUCTURE KNA1,
                  end of ty_kna1.
    tell me this is correct stmt.

  • How to include new fields in PRICAT

    Hi,
    My aim is to import a new field to the PRICAT price catalogue, and be able to
    maintain this field in transaction W_PRICAT_MAINTAIN.
    I have entered the new field in table PRICAT_K003 (using an append structure),
    and have used the Badi implementation WRF_PRICAT_DIALOG to include the new field in the ALV report definition for transaction W_PRICAT_MAINTAIN. For this purpose I also included the field in structure WRF_PRICAT_K003_STY.
    However, when trying to make the necessary changes to copy the field content  from PRICAT_K003 to the new screen field, I encounter a few problems.
    For this I have created a new Badi implementation for Badi definition
    WRF_PRICAT_POOL, method IF_EX_WRF_PRICAT_POOL~EXTEND_ARTICLE_MASTER.
    This method uses parameter io_inbound_item (type ref to CL_INBOUND_ITEM). The field doesn't seem to be visible in any of the available structures in this method. I have attempted to include the new field in some of the other structures (in addtion to WRF_PRICAT_K003_STY), but have been told by the system not to do this.
    Any suggestions on how to solve this problem?
    If there is anybody out there who have a description on how to import new fields
    into PRICAT and further on to the article master, I would very much appreciate if you could pass it on to me.
    Best regards,
    Per Erik Fjelde

    Hi,
    I have a similar problem with inbound pricat. I extended PRICAT_K003 with a few custom fields. These fields are filled using a BAPI table extension and implementing IF_EX_PRICAT_IN_EXTIN. The fields show up correctly in W_PRICAT_MAINTAIN and are also filled when I look in the database table. But when I create an article master from an entry in the pricate catalogue, all custom fields are cleared. I wanted to use IF_EX_WRF_BADIPRE_POST_MAT~PRICAT_PRE_POSTING_PROCESS to transfer the custom fields to MARA, but the incoming structures of the method only include blank custom fields.
    So I found IF_EX_WRF_PRICAT_POOL, but it's methods include only structures which are not extendable. So I don't see how I can preserve the data in my custom fields.
    Per Erik, have you found a solution for your problem?
    Is there anybody else out there who knows how to transfer custom fields from the price catalogue to material master data?
    Best regards,
    Holger Merk

  • How to include a jsp page in another jsp jsp page

    hi,
    i m trying to include a jsp page name "header.jsp" into one jsp page name"selectattribute.jsp" i m using these commands in "selectattribute.jsp"
    <%@include file "header.jsp"%> bcz both these jsp page are C:\program files\tomcat 4.0\webapps\examples\jsp\Poject\
    but the problem is that , i m invoking this jsp page "selectattribute.jsp" from a servlet reportcontroller.java using REQUEST DISPATCHER.
    the servlet is in
    C:\Program files\tomcat 4.0\webapps\examples\WEB-INF\classes\Project\
    i want to know how to include some other jsp page in a jsp page and how to invoke applet from jsp page when that particular jsp page is being invoked by servlet.
    plz help
    manish

    use this for including in your selectattribute.jsp
    <jsp:include page="header.jsp" flush="true"/>
    I never tried calling an applet. I think you can write the code for calling the applet in a javabean method and call the method in the jsp

  • How to include one view into another view

    Hi SDN's,
                   Could any please tell me,How to include one view into another view.
    In my requirment.I want to create a 'Z' view for an interface .In that  view i have to take,
    1) Ship-to-email adrr by
                              LIKP-KUNNR -> KNA1-ADRNR
                              KNA1-ADRNR -> ADR6-ADDRESNUMBER.
    2) E-mail addr of person who created the document.i.e
        LIKP-ERNAM -> USR21-BNAME.
        USR21-ADDRESNUMBER ->  ADR6-ADDRESNUMBER 
        USR21-PERSNUMBER -> ADR6-PERSNUMBER.
       In both the case we have to pass ADDRESSNUMBER to ADR6 table.
    If we pass these condition it fails,B'Coz at a time it passes Two ADDRESSNUMBER and a PERSNUMBER.
    So i created two which fetches only the email addr of  person who created the document.and another view fetches Ship-to-email addr.
    Now i want to include the second view into first view . Is it possible?or please
    tell me someother way to get these email addresses in a single view.

    hi
    as per my knowledge, nested views are not possible. However, while creating a new view, selection method will not giv u option to select the already created view(S) except the tables..i think so.
    regards,
    shamim

  • In BADi , How to pass the values between two Method

    Hi Experts,
    We have two methods in BADis. How to pass the value  between two Methods. Can you guys explain me out with one example...
    Thanks & Regards,
    Sivakumar S

    Hi Sivakumar!
    Create a function group.
    Define global data (there is a similiar menu point to jump to the top include).
    Create one or two function modules, with which you can read and write the global data.
    In your BADI methods you can access the global data with help of your function modules. It will stay in memory through the whole transaction.
    Regards,
    Christian

  • HOW to include a reference currency fields in a view ?

    Hello Experts,
    <b>I am having Currency fields error in generic extraction</b>
    I have table where I am trying to extract data to BW via generic extraction. When I tried
    to extract with the TABLE its giving me an error
    <b>Invalid extract structure template RPSCO of DataSource ZBW_REP3_TEST
    You tried to generate an extract structure with the template structure RPSCO. This operation failed, because the template structure quantityfields or currency fields, for example, field WLP00 refer to a differenttable</b>.
    Now I created a view with all the fields same as my table.
    But its still giving me the same error and taking all the fields as a primary keys. I have over 12 currency fields in the table. I am confused how to fix this issue and add a currency field to my view?
    hOW to include a reference currency fields in a view ?
    All inputs are much appreciated.
    Thanks and Regards,
    Harish

    Thank you for your responce,
    Can you please check my view and let me know where I am going wrong     
    View    Table   Field  Dataele  Data
    field                    type                                            0                                                                
    WLP01     RPSCO     WLP01     BP_WPL     CURR     15     Period value in ledger currency
    WLP02     RPSCO     WLP02     BP_WPL     CURR     15     Period value in ledger currency
    WLP03     RPSCO     WLP03     BP_WPL     CURR     15     Period value in ledger currency
    WLP04     RPSCO     WLP04     BP_WPL     CURR     15     Period value in ledger currency
    WLP05     RPSCO     WLP05     BP_WPL     CURR     15     Period value in ledger currency
    WLP06     RPSCO     WLP06     BP_WPL     CURR     15     Period value in ledger currency
    WLP07     RPSCO     WLP07     BP_WPL     CURR     15     Period value in ledger currency
    WLP08     RPSCO     WLP08     BP_WPL     CURR     15     Period value in ledger currency
    WLP09     RPSCO     WLP09     BP_WPL     CURR     15     Period value in ledger currency
    If I add a
    Table TCURC against any field what would be the view field and data element
    Do I need to tick MOD?
    Please suggest.
    Kapadia,
    If I do that its still taking all the fields are a primary keys and bringing 6 lakh records to where I originally have 49 records in a table
    Thanks and Regards,
    Harish

  • How to populate Tree structure from BAPI while tree grows or shrinks

    Hi All
    Currently I am populating the tree structure from BAPI based on the HLevel (Hierarchy  Level) parameter, but when ever insertion and deletion happens in the tree at any level in the UI and at the same time i am updating these tree node values with HLevel value(example : 1 is first level , 2 is second level, 3 is third level etc)  updating successfully& correctly  into the BAPI, no issues.
    Once it is updated into the BAPI, next time when i refreshed the UI then i am not populating the tree structure correctly from BAPI with updated new nodes based on the HLevel. when tree struture grows or shrinks in the BAPI after updating into BAPI from UI then i am not populating the tree sturcture correctly based on the HLevel value from the BAPI.
    Please let me know any sample code how to populate tree structure correctly when tree structure grows or shrinks based on the HLevel value ( Hierarchy Level , for example : 1 is level , 2 is 2nd level , 3 is third level nodes etc)
    anybody helps in this regard with sample code on the populating tree tructure then it would be great help to me.
    Thanks in advance
    Regards
    Kalki Reddy
    Edited by: KalkiReddy on Nov 29, 2009 3:48 PM

    Bapi output node:
    Value     | Text     | HLevel
    01     | A     | 1               
    0101     | AA       | 2
    010101     | AAA     | 3
    01010B     | AAB     | 3
    0102     | AB     | 2
    02     | B     | 1
    0201     | BA        | 2
    This code is used to build the tree in wdDoInit method
         IE_T_CatalogueNode catalogueNode = wdContext.nodeE_T_Catalogue();
         int size = catalogueNode.size();
         ICatalogoElement level1elem = null;
         for (int i = 0; i < size; i ++)
              IE_T_CatalogueElement catalogueElem = catalogueNode.getE_T_CatalogueElementAt(i);
              if (catalogueElem.getLevel().equals("1"))
                   // 1 Livello
                   level1elem = wdContext.createCatalogoElement();
                   level1elem.setKATALOGART_CODE(catalogueElem.getKatalogart());
                   level1elem.setCODEGRUPPE_CODE(catalogueElem.getCodegruppe());
                   level1elem.setCODE(catalogueElem.getCode());
                   level1elem.setCODE_DESCR(catalogueElem.getKatalogart_Descr());
                   level1elem.setDESCR(catalogueElem.getKatalogart_Descr());
                   wdContext.nodeCatalogo().addElement(level1elem);
                   for (int j = i + 1; j < size; j ++)
                        IE_T_CatalogueElement catalogueElem2level =
                                                 catalogueNode.getE_T_CatalogueElementAt( j );
                        String level2 = catalogueElem2level.getLevel();
                        if (level2.equals("2"))
                             ICatalogoElement level2elem = level1elem.nodeChild().createCatalogoElement();
                             level2elem.setKATALOGART_CODE(catalogueElem2level.getKatalogart());
                             level2elem.setCODEGRUPPE_CODE(catalogueElem2level.getCodegruppe());
                             level2elem.setCODE(catalogueElem2level.getCode());
                             level2elem.setCODE_DESCR(catalogueElem2level.getCodegruppe_Descr());
                             level2elem.setDESCR(catalogueElem2level.getCodegruppe_Descr());
                             level1elem.nodeChild().addElement(level2elem);
                             for (int k = j + 1; k < size; k ++)
                                  IE_T_CatalogueElement catalogueElem3level =
                                                           catalogueNode.getE_T_CatalogueElementAt( k );
                                  String level3 = catalogueElem3level.getLevel();
                                  if (level3.equals("3"))
                                       ICatalogoElement level3elem = level2elem.nodeChild().createCatalogoElement();
                                       level3elem.setKATALOGART_CODE(catalogueElem3level.getKatalogart());
                                       level3elem.setCODEGRUPPE_CODE(catalogueElem3level.getCodegruppe());
                                       level3elem.setCODE(catalogueElem3level.getCode());
                                       level3elem.setCODE_DESCR(catalogueElem3level.getCode_Descr());
                                       level3elem.setDESCR(catalogueElem3level.getCode_Descr());
                                       level2elem.nodeChild().addElement(level3elem);
    Damiano

Maybe you are looking for