How to use same Data Type and Length for two fields

How to use same data type and length for two fields when using 'FOR ALL ENTRIES IN' in a select statement? For instance the select queries are :
SELECT bukrs gjahr belnr lifnr budat bldat zlspr dmbtr waers shkzg
FROM bsik
INTO TABLE it_bsik
WHERE bukrs = p_bukrs
AND lifnr IN s_lifnr.
IF it_bsik IS NOT INITIAL.
SELECT belnr gjahr awkey awtyp
FROM bkpf
INTO TABLE it_bkpf
FOR ALL ENTRIES IN it_bsik
WHERE belnr = it_bsik-belnr
AND gjahr = it_bsik-gjahr.
IF it_bkpf IS NOT INITIAL.
SELECT belnr gjahr lifnr xblnr
FROM rbkp
INTO TABLE it_rbkp
FOR ALL ENTRIES IN it_bkpf
WHERE belnr = it_bkpf-awkey+0(10)
AND gjahr = it_bkpf-awkey+10(4).
ENDIF.
ENDIF.
Here it gives an error in the 3rd select query that 'When you use the addition "FOR ALL ENTRIES IN itab", the fields "GJAHR" and "IT_BKPF2-AWKEY+10(4)" must have the same type and the same length.'
Kindly clarify.

Hi Saurabh,
Please see the example code that I have developed for you. It will help you solve the problem.
REPORT ZTEST_3 .
tables : BKPF.
data : begin of it_bkpf occurs 1,
         belnr type RE_BELNR,
         awkey type awkey,
         awtyp type awtyp,
         gjahr type GJAHR,
       end of it_bkpf.
data : begin of it_bkpf1 occurs 1,
         belnr type RE_BELNR,
         awkey type gjahr,              " change the data type
         awtyp type awtyp,
         gjahr type GJAHR,
       end of it_bkpf1.
data : begin of it_rbkp occurs 1,
         belnr type BELNR_D,
         gjahr type gjahr,
         lifnr type LIFRE,
         xblnr type XBLNR,
       end of it_rbkp.
select belnr
       awkey
       awtyp
       gjahr
       from bkpf
       into table it_bkpf
       where BUKRS = 'TELH'.
loop at it_bkpf.
it_bkpf1-belnr = it_bkpf-belnr.
it_bkpf1-awkey = it_bkpf-awkey+10(4).           "Here only append the required length.
it_bkpf1-awtyp = it_bkpf-awtyp.
it_bkpf1-gjahr = it_bkpf-gjahr.
append it_bkpf1.
clear it_bkpf1.
endloop.
select  belnr
        gjahr
        lifnr
        xblnr
        from RBKP
        into table it_rbkp
        for all entries in it_bkpf1
        where belnr = it_bkpf1-belnr
This is just an example. Change the fields according to your requirement.
Regards
Abhii
Edited by: Abhii on Mar 9, 2011 9:08 AM

Similar Messages

  • How to use one keyboard, mouse and display for two PC's?

    hey guys, right now i'm using a mac mini and also another Windows PC tower. whenever i want to switch between them i need to re-plug in my headphones/keyboard/mouse/display and this is getting annoying. i've been using a usb hub for the mouse and keyboard so it's not as difficult to setup. is there anything out there that'll allow me to switch between them more easily?
    what are my options?
    thank you

    If both are on your intranet, try Synergy.
    I personally use the Wormhole.  You can drag between desktops.

  • For abap-hr i need datatype and length for the fields which i selected

    hi seniors,
          I got one task for which i have to get the data type and length for the fields of a table in abap-hr. I am using dd03l table, but my team leader told me to not to use this. So, please anybody can help, i will be thankfull.
          I have to select PA30 fields in which pernr and choic, subty and whatever i have selected the infotypes fields. If there is any function module to find data type and length or else any other table.
    thanks,
    sekhar.

    Hi,
    Try using the Function Module "DDIF_FIELDINFO_GET". You can use this for fetching the complete details of a structure or, a specific field.
    Input:->
    TABNAME        PA0001
    FIELDNAME     PERNR
    Output:->
    Check the DFIES_TAB  it will contain all the details you need for the specific field.
    Sample--->
    CALL FUNCTION 'DDIF_FIELDINFO_GET'
      EXPORTING
        TABNAME              = 'PA0001'
    *   FIELDNAME            = ' '
    *   LANGU                = SY-LANGU
    *   LFIELDNAME           = ' '
    *   ALL_TYPES            = ' '
    *   GROUP_NAMES          = ' '
    *   UCLEN                =
    *   DO_NOT_WRITE         = ' '
    * IMPORTING
    *   X030L_WA             =
    *   DDOBJTYPE            =
    *   DFIES_WA             =
    *   LINES_DESCR          =
    TABLES
       DFIES_TAB            = MY_DFIES_TAB
    *   FIXED_VALUES         =
    * EXCEPTIONS
    *   NOT_FOUND            = 1
    *   INTERNAL_ERROR       = 2
    *   OTHERS               = 3.
    Hope this was of some help.
    Best regards,
    Sagar.

  • How to use same collection type in different database

    i have created a synonym for a package whcih uses a collection type as input and when i am calling through that synonym it is throwing an error b'coz of the collection type saying wrong no. of arguements...
    declare
    collection_type collection_type:=collection_type('value');
    begin
    package_synonym1.procedure1(collection_type);
    END;
    how to rectify it can someone suggest....
    a quick response would be highly appreciated

    i have a package in schema A in which my input in a procedure is of type
    like
    create or replace package abc as
    procedure efg (
    ptbl_service_id in tbl_input_list,
    pn_error_code_out OUT NUMBER,
    pv_error_msg_out OUT VARCHAR2
    and in schema A the type is created.the package is working fine
    but when i am trying to test this package from database b with script as
    declare
    xyz tbl_input_list :=tbl_input_list('abcdefgh');
    begin
    abc.efg(
    xyz,
    pn_error_code_out,
    pv_error_msg_out
    end;
    then it gives an error saying wrong no. of arguements ORA-06550
    I have created the type in this database with the same OID as well and i have also tried the option of creating a synonym or calling it through a database link...
    Is there any other way through which we can use it.....
    A Quick Response will be highly appreciated...

  • Data type and Length issue

    Dear SDNers,
    I exctacting data from Oracle and I am getting the source fields with data type DEC with length 13 and 3 decimals.
    ex:GROSS_WGHT_MTRC_QTY DEC     13     3
    I have created an Key Fig info object as Quantity type .It is giving an warning in transformations as source lenth is larger that BW legth. So which data type shall I take here to get all the data match with source.
    Thanks,
    Swathi

    Hi,
    Have you checked on the R/3 side what the number looks like in the production?
    If you think that you will get a number which 9 digit char can't accomodate, then you should go ahead with what the poster above suggested. Create the KF as a number. But then you will also have to create a Characteristic like "Unit" and make sure that this is always included /associaed when you use this KF. You cannot use "Unit" itself because your quantity is now not a quantity but a number.
    -RMP

  • How to edit data using a LOV list AND textfield for one Field

    I am trying to edit the templated edit from HTMLDB template when I create a new table. I implemented most of the fields with LOV list like yes/no, joe/bob/john etc. But some fields as many probably have seen have a LOV called "Other" where a person types a different value than the ones available. Can someone tell me how I can accomplish that? Do I need to insert "Other" into LOV and have it be set as the value in the textfield? I am not sure how i can create both LOV list and textfield per category/field i.e. Name.
    Thanks

    Again, I urge you to use HTML DB nomenclature to describe what you've done. For example: "I ran the Form on a Table wizard to create a form" Rather than using the word "template" for everything you describe. "Template" has a specific meaning in HTML DB and it is not what you are referring to.
    You really should invest the time required to accurately phrase your problem. Just like answering questions on this forum requires time, so does formulating your question. It is time well spent and it is effort on your part that the experts on this forum deserve. If you don't put in this effort and instead just post a stream of consciousness, that means the readers of this forum will gloss over your question and ignore it. As a result, you have to ask the question again...and again.
    Having said that, if I understand your question correctly, you should use a popup LOV item. This will allow the user to select from a list but will also allow typing of a non existent option into a text field.
    Sergio

  • How can I search the attribute including type and length of the field in the SD table or form such as sales executive table through debug?

    Some users show that  the sales docment external name is not printed completely in the form of delivery form printing, so I want to find how much length of the field is there through debugging. I am very expected to gain some suggestion from you.

    for exploding the bom if you know header material use
      CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
        EXPORTING
          CAPID                 = 'PP01'
          DATUV                 = SY-DATUM
          MEHRS                 = 'X'
          MTNRV                 = P_MATNR
          WERKS                 = P_WERKS
        TABLES
          STB                   = I_BOM
        EXCEPTIONS
          ALT_NOT_FOUND         = 1
          CALL_INVALID          = 2
          MATERIAL_NOT_FOUND    = 3
          MISSING_AUTHORIZATION = 4
          NO_BOM_FOUND          = 5
          NO_PLANT_DATA         = 6
          NO_SUITABLE_BOM_FOUND = 7
          CONVERSION_ERROR      = 8
          OTHERS                = 9.
    now check PLPO & PLKO table for routing or AFVC and AFVV for routing.
    if production order created you have to check in afvc and afvv else check in plpo and plko.
    for checking with plpo and plko you have to check MAPL table.
    for bom and material link
    MAST,STPO,STKO.
    stlnr is the common field
    regards
    shiba dutta

  • How to set the BARCODE width and length for label printing..

    Hi All,
    How to set the Code 39 barcode label format in the sizxe of 0.20" * 1.4". By default while printing barcode size exceeds my current requirement. Please let me know to customize the size of barcode labels.
    Thanks.

    I don't know what you mean by "Code 39" because my Output Designer software doesn't offer that barcode (or do you mean "code 3 of 9?). In any case, are you trying to control the size of the text (which is what I think of when you refer to "label")? If you are, then just change the font & size. If you are wanting to modify the physical characteristics of the barcode itself (height & length for a certain number of characters) then you are probably out of luck. Or at least in for some trial & error.
    There are a series of "barcode.xxx" files in the 'config' folder where Output Designer was installed to. These are text files that contain the physical characteristics of the various barcodes for various printers. The parameters that you would be interested in is the height and width of the bars (black & white). For example, a barcode might be defined as .400 high with narrow bars 3 "dots" wide, wide bars 9 "dots" wide and white space the same or different. Presumably changing these values would affect the generated barcode. For example, in this example the wide bars are 3 times the width of the narrow bars so I would assume that relationship would have to remain. To make the resulting barcode shorter you would then use 2 for the narrow and 6 for the wide.
    You would have to make the change in the file(s) that would be used for your printer(s).
    There are four width values for each of the parameters. Most of the barcodes only use 2 but some have 4. I'm assuming that when there are 4, like in "4 8 12 16", that the barcode definition has 4 different widths of bars and/or spaces.
    There is no guarantee that the scanning hardware & software will "see" and interpret the resulting barcode correctly.

  • How to use my logic sessions and ilok at two places

    Hi there,
    I am wondering if I can use my Logic sessions and even my ilok plugins at two places, two countries?
    - but still keeping my ilok at one place.
    Is there any way via internet? perhaps using some kind of network server for my sessions
    - iDisk perhaps?
    what is the best solution?
    Thanks
    Message was edited by: Olavur
    Message was edited by: Olavur

    Buy a second iLok, and licenses for your software

  • Metadata: how to use same data on multiple tracks in a project.

    I need to figure out how to cut and paste metadata from one audio file to the next. I am transferring 500 vinyl albums to digital. I would like to be able to fill in the ID3 and other metadata that is the same for the 10 to 12 songs on the disk and have that information transfer to each of the files I ultimately turn into mp3. How can I do that. Essentially, artist, album, recording data, comments, genre, and copyright are all the same.
    My workflow is to copy all of the tracks from the master recording of the disk into individual audio files and save those as the MP3. If I enter metadata manually in the audio track, it is saved with the MP3 and read by iTunes when converted. However, I want to be able to create one metadata -- I guess template -- with the data that is the same and have that automatically transferred from the master to the cuts.
    Is it possible?

    Not in Audition, I'm afraid. But there's certainly software that will allow extensive metadata manipulation of ID3 tags available, possibly for just the reasons you are mentioning. You have to bear in mind that Audition is essentially an editor, and MP3s are just a saving possibility, and not the format it natively works in, so it's not extensively set up to deal with them in the way you want; not it's job, really!

  • Using Complex Data Types in Import JavaBean Model

    Hi,
    I have searched and read forums and weblogs related to import javabean model.
    But I am not clear about how to use complex data types like ArrayList, Collection etc in my java bean.
    If I use these complex datatypes in my bean, when creating model in WDF it displays the Complex data elements in Model Relation. I dont know how to use this model relation in my WD project.
    Anyone please explain the<b> step by step solution</b> about using complex data type(used in Bean) in WD Project.
    Thanks,
    Krishna Kumar

    Hi Krishna,
    Valery`s blog contains sample code ( http://www.jroller.com/resources/s/silaev/Employees.zip )
    Another blogs from this area:
    /people/anilkumar.vippagunta2/blog/2005/09/02/java-bean-model-importer-in-web-dynpro
    /people/valery.silaev/blog/2005/08/30/javabean-model-import-when-it-really-works
    And forum topics:
    Import JavaBean Model
    Problem Importing JavaBean Model in NetWeaver Developer Studio
    Issue on "Import JavaBean Model"
    import  JavaBean Model: no executable Methods?
    JavaBeans Model Import
    POLL : JavaBean Model Importer
    JavaBean-Model
    Invalid Class - Javabean not available for import
    WebDynpro Using JavaBean Model ->Please Help
    Best regards, Maksim Rashchynski.

  • Can we use same data definition with multiple concurrent programs?

    Hi,
    My requirement is as below:
    I have two concurrent programs (say CP1 and CP2), both concurrent programs need to use same data definition (the same data template xml file) and same RTF layout template. However when registering data definition in the E-Biz, the data definition code must match concurrent program, hence I have to create two definitions (for the same data template xml file) and because layout template is attached with data definition I have to duplicate the layout definition also.
    In summary, i have to create two (duplicate) Data Definition and Layout Template for the same dataTemplate.xml and Layout.rtf files. Is there any way to avoid this duplication?
    The only issue with duplication is any change in xml or rtf needs to be updated in all the four definitions (2 data definitions and 2 layout definitions).
    Thanks
    Bhavik

    I found the resolution and thought of sharing
    you can see this post
    *[How to use same data definition/template between multiple concurrent programs? |http://techatwork.wordpress.com/2009/08/06/how-to-use-same-data-definitiontemplate-between-multiple-concurrent-programs/]*
    Thanks
    Bhavik

  • How to read XI Data type in Java code and populate as array list, using UDF

    Hi,
    How to read XI Data type in Java code and populate as array list, using UDF?
    Is there any API using which  the XI data types can be read?
    Kindly reply.
    Richa

    Input Structure:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:CustomerCreateResp xmlns:ns0="urn:bp:xi:up:re:cust_mdm:cmdm:pr5:100">
       <CUSTOMER>
          <item>
             <CUSTOMERNO/>
             <MDMCUSTOMER/>
             <CREATE_DATE/>
             <RETURN>
                <TYPE/>
                <MESSAGE/>
             </RETURN>
             <PT_CONTPART_RETURN>
                <item>
                   <MDM_CONTACT/>
                   <CONTACT/>
                </item>
             </PT_CONTPART_RETURN>
             <PARTNERS>
                <item>
                   <CUSTOMERNO/>
                   <PARTNER_FUNCTION/>
                   <PARTNER_NUMBER/>
                   <DEFAULT_PARTNER/>
                </item>
             </PARTNERS>
          </item>
       </CUSTOMER>
    </ns0:CustomerCreateResp>
    Output structure
    (Sample output structure.This actually needs to be mapped and generated using UDF)
    <?xml version="1.0" encoding="UTF-8"?>
    <ns1:updateCustomer xmlns:ns1="urn:xiSericeVi"><ns1:customer><ns2:ArrayList xmlns:ns2="java:sap/standard">[]</ns2:ArrayList></ns1:customer><ns1:name>2344566</ns1:name></ns1:updateCustomer>

  • How to use same transaction when calling CMP entity beans and  DAO (JDBC)

    We are currently using Weblogic 8.1 SP2 with an Oracle 10g database (using XA thin and non-XA drivers).
    We have a session bean that invokes an entity bean and a DAO (data access object pattern) in order to add data in 2 separate tables (account and history). Rows are added to the first (account) table using a CMP Entity bean while inserts are done in the 2nd (history) table using a DAO. Here is some pseudo code:
    addHistorySessionBean (trans-attribute="Required")
    begin
    Step #1 - call addAccountEntityBean (trans- attribute="Required")
    Step #2 - call addHistoryDAO (get datasource, connection)
    end
    The 2nd table (history) has a foreign key constraint to ensure that the corresponding key exists in the first (account) table. Unfortunately, DAO inserts on the 2nd (history) table fail with a foreign key constraint violation (INTEGRITY CONSTRAINT VIOLATION - PARENT KEY NOT FOUND!) since they cannot see the row added to the 1st (account) table in step #1 by the CMP entity bean.
    How does one ensure that all this is done in a single transaction ? It appears that the app server creates two seperate transactions (one for the session bean facade and the entity bean and a 2nd transaction (when we retrieve a connection using the same data source JNDI name) for the DAO.
    A post on server side suggested using a "<resource-ref>" in the session bean to tie the two potentially separate transactions together, but that does not work for us. However, I am not sure if we are doing that correctly. After we define the resource ref in the session facade bean, do we use the resource ref "name" attribute to lookup the datasource or do we still lookup the datasource by JNDI name ? Do we need to define the resource-ref tag in the entity bean also ?
    Does Weblogic allow using a single transaction for this type of a scenario ? How does one specify within Weblogic that the same transaction should be utilized by the entity bean and any subsequent DAOs?
    People have also suggested that we defer constraint checking until the transaction(s) are committed but that sounds like a work acount without addressing this issue. Would postponing the constraint checking in Oracle cause any additional overhead ?
    Any suggestions with specific examples or documentation on how to address this issue will be gratefully appreciated.

    Thanks for your suggestion. Unfortunately, this does not work since it appears that there are 2 separate transactions going on here. One, the original one initiated by the session bean and used by the entity bean and the other initiated by the DAO. Any other ideas appreciated.
    Hi,
    Try setting the delay-database-inserts tag to
    ejbCreate in RDBMS descriptor file.
    http://bernal/stage/wls/docs81/ejb/DDreference-cmp-jar
    .html#1113981
    vasanthi ramesh

  • Problem importing two service interfaces using the same data types

    Hi,
    I've been playing around with BPM for a while. Now I wanted to add a custom service interface to my starting event. I created the interface in ESR of CE 7.11. After importing I get this error message and I can't use the interface:
    Cannot change XsdSimpleTypeDefinition AcademicTitleCodeContent by importing the document http://sap.com/xi/APPL/SE/Global::src/wsdl/TestInterface.wsdl, because it is already defined in the document http://sap.com/xi/APPL/SE/Global::src/wsdl/rootwsdl_CustomerERPByIDQueryResponse_InService.wsdl in this project. Importing into another project might be possible.
    Of course the problem is clear, but how can I achieve importing two service interfaces that use the same data type without changing the xsd source?
    Thanks in advance,
    Mane

    Sorry for the late answer, but I am really busy at the moment.
    Unfortunately I can't the Interface and data types are already changed.
    But this happened various times. Each time I already had imported a SAP Enterprise Service into NW BPM that contains a bunch of inline data types. While creating my own interface I referenced one of those data types that are stored in a SAP namespace. After import the error message appeared.
    In the wsdl of the created interface there is a import statement for the namespace where the referenced data types origin from. Additionally there is a namespace definition xmlns:p1="SAPnamespace". In the element the type is "p1:ReferencedType". Could this maybe cause the error, because one time it is with this leading p1 in my created wsdl and once without in the SAP Service wsdl?
    Thanks and I am looking forward to next EhP of NW BPM,
    Mane

Maybe you are looking for

  • Currency field in alv grid display

    Hi, I am using alv grid display.I am having one currency field netprice.I want it to be displayed as blank when i am not passing any value.But it gives 0.00 when it is not having any value.How to make it blank instead of 0.00. Points will be rewarded

  • Multiple iPod 30GB issues

    Hi folks, I've been having some issues regarding my iPod video 30GB which I can't solve. I will explain what happened in details. I had some files from my computer (Sony VAIO 40GB NTFS partitioned) in my iPod, about 25 GB (including songs). Then my g

  • Fox Call function

    Dear experts, How can I call a function in FOX? I want to read a table and extract a value in a field. thanks

  • Imported App - Install Failure

    I am trying to install a tiny app exported from hosted htmldb onto my 1.3.9.00.15 local install Here is the export from Hosted HTMLDB - (Workspace/schema : ADP) http://32.97.40.160/graphic/export.jpg Import no problem. but on install, got this error

  • Execute SQLJ/JDBC within InfoBus Data Form???

    Is there a way to execute SQLJ or JDBC from within the InfoBus data forms without opening a new connection? Is there a way to execute SQLJ or JDBC via the Business Components using the connection already established in the InfoBus frame? Please post