Curiosity: How to use a table for input when testing a functionmodule?

actually I am sick of writing test programs for every function I want to test using ABAP.
So why it is (made) impossible to generate input data for a table as input parameter of a functionmodule?
Has really nobody ever tested this stuff when the test function was implemented in SE37 or was this bug implemented on purpose to generate work?

Andreas,
You can input data into the internal table by:
Test FM
> Testing initial screen --- click on the table icon against your table parameter
> Input your input data in the fields
> to Input more lines in the table.. press Insert Line (icon with plus sign)
After this press back button.
Now, you will have your test data in the tables.
Regards,
Naimesh

Similar Messages

  • How to use ADF variables in C:when test?

    I have a <af:iterator in my page fragment as follows
    <af:iterator id="i1" value="#{queryModel.currentDescriptor.conjunctionCriterion.criterionList}" var="criterion" varStatus="vs">
    Within this iterator, I want to make a decision absed on the index of the iterator. To do this test, I am using jstl as follows
    <c:when test="${vs.index == '0' or vs.index == '2' or vs.index == '4'}">
    This test is however always evaluating to false. I have tried cahnging my code using various combiantion as below ...
    <c:when test="#{vs.index == '0' or vs.index == '2' or vs.index == '4'}">
    <c:when test="${vs.index == 0 or vs.index == 2 or vs.index == 4}">
    <c:when test="${vs.index == '0' || vs.index == '2' || vs.index == '4'}">
    But nothign seems to be working fine.
    Can some one help me with what I am doing wrong?
    Thanks.

    How to use ADF variables in <C:when test?

  • Here's how to use DYNAMIC tables for almost any structure (4.6C onwards)

    Hi guys
    I'm describing a  feature  here that has been around since 4.6C that is not really well known but can really simplfy programming where you need to get data into some sort of internal table and then display it either as a classical list or as al ALV grid.
    This feature is RTTI which allows you to retrieve your structure, build a dynamic FCAT (Field catalog) and a Dynamic table.
    Here's a really quick little program which reads 200 entries from VAPMA into a dynamic table. Any structure will work if you use the code sample shown.
    To pass it to an ALV GRID  is then really simple as you've already got the Field Catalog, Table and Data.
    The method I'm showing below will work for almost ANY structure you care to name whether or not the fields are in the data dictionary.
    I create a dynamic FCAT and dynamic table based on the FCAT and then populate it.
    You can create field catalogs dynamically quite simply by using the new RTTI facility available from 4.6C onwards.
    (From here it's only a small step to dynamic tables and EASY ALV grid displays)
    Example to create dynamic FCAT and table and populate it with 200 entries from VAPMA
    PROGRAM ZZ_BUILD_FLDCATALOG.
    tables: vapma.
    Define any structure
    types: begin of s_elements,
    vbeln type vapma-vbeln,
    posnr type vapma-posnr,
    matnr type vapma-matnr,
    kunnr type vapma-kunnr,
    werks type vapma-werks,
    vkorg type vapma-vkorg,
    vkbur type vapma-vkbur,
    status type c,
    end of s_elements.
    end of your structure
    data lr_rtti_struc type ref to cl_abap_structdescr .
    data:
    zog like line of lr_rtti_struc->components .
    data:
    zogt like table of zog,
    wa_it_fldcat type lvc_s_fcat,
    it_fldcat type lvc_t_fcat ,
    dy_line type ref to data,
    dy_table type ref to data.
    data: dref type ref to data.
    field-symbols: <fs> type any,
    <dyn_table> type standard table,
    <dyn_wa>.
    *now I want to build a field catalog
    *First get your data structure into a field symbol
    create data dref type s_elements.
    assign dref->* to <fs>.
    lr_rtti_struc ?= cl_abap_structdescr=>describe_by_data( <fs> ).
    zogt[] = lr_rtti_struc->components.
    Now build the field catalog.  zogt has the structure in it from RTTI.
    loop at zogt into zog.
    clear wa_it_fldcat.
    wa_it_fldcat-fieldname = zog-name .
    wa_it_fldcat-datatype = zog-type_kind.
    wa_it_fldcat-inttype = zog-type_kind.
    wa_it_fldcat-intlen = zog-length.
    wa_it_fldcat-decimals = zog-decimals.
    wa_it_fldcat-coltext = zog-name.
    wa_it_fldcat-lowercase = 'X'.
    append wa_it_fldcat to it_fldcat .
    endloop.
    Let's create a dynamic table and populate it
    call method cl_alv_table_create=>create_dynamic_table
    exporting
    it_fieldcatalog = it_fldcat
    importing
    ep_table = dy_table.
    assign dy_table->* to <dyn_table>.
    create data dy_line like line of <dyn_table>.
    assign dy_line->* to <dyn_wa>.
    select vbeln posnr matnr kunnr werks vkorg vkbur
    up to 200 rows
    from vapma
    into corresponding fields of table <dyn_table>.
    from here you can pass your table to a GRID for display etc etc.
    Cheers
    Jimbo

    Thanks for the info.
    I went to their web site and also Googled.
    I found a great review on their photographer's books on nikonians.org
    They use an HP/Indigo Ultrastream 3000 digital offset press for all hardcover books, which is GREAT!
    I did sign up and requested the 45 day trial "photographer" account.
    I am curious if Shared Ink offers a size that matches the ONLY current book size from Aperture, the odd 8.5x11.
    In the above review, I saw that Shared Ink offers a 12x12 book.. very nice! Except you will need to design that one in CS2
    So then, all that Apple really needs to do is simply add the ability to select/create custom book sizes. Then we don't need a printing service from Apple, as there are plenty of options out there, and more arriving on the market each month!

  • How to use the table maintenance events for validating the input entries..?

    Hi,
    I have created a Z table with 6 fields in which all are KEY fields. All are of CHAR type. I have created the Table Maintenance Generator for the same. While maintaining the entries in the table, even though I maintain a blank entry for a field it is saving the entry. But, I don't want that way. All the fields are mandatory in my table. One should enter all the fields. Otherwise it should not allow to save the entry. So, I think it can be done using the Table Maintenance Events. can someone tell me how to use the Table Maintenance Events. and which event to use for my reuqirement and what is the logic to be written.
    Or Is there any other way to solve my problem.
    Please share your inputs. Thanks in advance.
    Best regards,
    paddu.

    In the table maintenance generator, Environment --> Modifications --> Events then a screen will be appear here,we need to create the Events.In the EVENTS screen, press new Entries, there give 01(Before Saving the Data in the Database) and give a name(This will become a PERFORM), then click the Editor pushbutton, this will be there at the right side of the entry, then a popup will be appear, you can create an include program, there inside of the include program write ur code.
    Here is documentation for Event 01(Before Saving the Data in the Database )
    Event 01: Before Saving the Data in the Database
    Use
    This event occurs before new, changed or deleted entries are written to the database. Other activities can be performed, for example:
    hidden entry processing
    fill hidden fields
    flag data to be written to hidden tables after the database change.
    To have the changes saved by the central maintenance dialog routines, SY-SUBRC must be set to 0 at the end of the routine.
    Realization
    This event has no standard routine. The following global data is available for the realization of the user routine:
    internal table TOTAL
    field symbols
    field symbols <ACTION> and <ACTION_TEXT>
    <STATUS>-UPD_FLAG
    If internal table data are to be changed before saving, t he changes should be made in both the internal table TOTAL and in the internal table EXTRACT.
    FORM abc.
    DATA: F_INDEX LIKE SY-TABIX. "Index to note the lines found
    LOOP AT TOTAL.
    IF <ACTION> = desired constant.
    READ TABLE EXTRACT WITH KEY <vim_xtotal_key>.
    IF SY-SUBRC EQ 0.
    F_INDEX = SY-TABIX.
    ELSE.
    CLEAR F_INDX.
    ENDIF.
    (make desired changes to the line TOTAL)
    MODIFY TOTAL.
    CHECK F_INDX GT 0.
    EXTRACT = TOTAL.
    MODIFY EXTRACT INDEX F_INDX.
    ENDIF.
    ENDLOOP.
    SY-SUBRC = 0.
    ENDFORM.
    Regards,
    Joy.

  • How to Use a table UI for input ?

    Hi All ,
    I just want to ask how to use a Table UI in webdynpro ABAP to insert , change and delete rows ?? and can we give a drop down facility in table columns ? . This is really urgent .
    Thanks in advance.
    Regards,
    LAS

    Hi LAS,
    Everything is possible. I am providing the logic here which will help you a lot.
    For insert, Change, Delete: 
       Just get the all the elements into temp internal table and get the lead slected index. Now instrt one row in the lead selected index position. then again bind the temporary internal table to your table node. Thats all it works like inserting the row.
    In the same way you can do the change and delete rows also.
    For Dropdown:
      Here i am providing the code for Dropdown. It will help you out.
      Just create the Dropdown view for the columns for which you want dropdown. And do the coding for that.
      Here in my scenario IT is the Table node which holds the information. And i am providing the dorpdown key for the column "BSCHL".
      If you have any dobts just reply to me . i will respond it.
    Code:
      data : ls_outtab               type /kyk/s_fb01_line,
             lt_outtab               type table of /kyk/s_fb01_line,
             lv_node_sd              type ref to if_wd_context_node,
             lv_node_it              type ref to if_wd_context_node,
             lv_node_info            type ref to if_wd_context_node_info,
             lv_node_sapmf05a_0106   type ref to if_wd_context_node,
             lv_node_waers           type ref to if_wd_context_node,
             lv_node_layout          type ref to if_wd_context_node,
             lv_rowcount             type i,
             lv_buzei                type i,
             lv_waers        type waers,
             lt_bschl_set    type wdy_key_value_table,
             bschl_key_item  type wdy_key_value.
    bind to context
      lv_node_sd      = wd_context->get_child_node( name = 'SD' ).
      lv_node_it      = lv_node_sd->get_child_node( name = 'IT' ).
      call method lv_node_it->bind_table
        EXPORTING
          new_items = lt_outtab.
    fill Dropdown Help for posting Key
      bschl_key_item-key    = '40'.
      bschl_key_item-value  = cl_wd_utilities=>get_otr_text_by_alias( '/KYK/FIN_FI/DEBIT_GL_ACCOUNT' ).
      insert bschl_key_item into table lt_bschl_set.
      bschl_key_item-key    = '50'.
      bschl_key_item-value  = cl_wd_utilities=>get_otr_text_by_alias( '/KYK/FIN_FI/CREDIT_GL_ACCOUNT' ).
      insert bschl_key_item into table lt_bschl_set.
      bschl_key_item-key    = '21'.
      bschl_key_item-value  = cl_wd_utilities=>get_otr_text_by_alias( '/KYK/FIN_FI/DEBITVENDOR' ).
      insert bschl_key_item into table lt_bschl_set.
      bschl_key_item-key    = '31'.
      bschl_key_item-value  = cl_wd_utilities=>get_otr_text_by_alias( '/KYK/FIN_FI/CREDITVENDOR' ).
      insert bschl_key_item into table lt_bschl_set.
      lv_node_info = lv_node_it->get_node_info( ).
      lv_node_info->set_attribute_value_set( name = 'BSCHL' value_set = lt_bschl_set ).
    Warm Regards,
    Vijay

  • HT3354 how can i use one table for reference to another

    how can i use a table for a referance to another eg when i type a word in a cell, i will like it to match the word with another table then return the information in the cell i am using

    you can use vlookup() (or any of the lookup family of functions) to locate an item based on a key value:
    Here is an example of something you can do with two tables:
    The table on the right is title "Data" and stores a list of names with age and favorite color.
    The table on the left uses the value in the first column to lookup up information in the table Data
    in the table on the left:
    B2=IFERROR(A2&" is " & VLOOKUP(A2, Data :: A:D, 2, 0)&" years old and likes the color "& VLOOKUP(A2, Data :: A:D, 3, 0), "NOT FOUND")
    I know this look complicated.  so I'll break it up into smalled pieces:
    first the "&" is called the concatenate operator and joins two strings.  like this:
    a string is a set of characters between double quotes.
    so "string 1" & "string 2" becomes "string 1string2"  or "Sam " & "Jones" becomes "Sam Jones"
    you can use cell references instead of strings directly in which case the concatenation is performed on the contents of the cells.
    so if cell A1 contains "Hi " and the cell A2 contains "There"  then A1 & A2 will result in "Hi There"
    so you could add the formula
    A3=A1 & A2
    this is short hand for select cell A3 then type everything including the A3 so that A3 contains "=A1 & A2" (omit the double quote)
    OK.  So the formula I provided concatenates several items together:
    it concatenates A2, then the string " is " then a formula, then the string " years old and likes the color " then a formula
    the two formulas (highlighted in blue) perform a lookup of the value in cell A2 in columns A thru D of the table named "Data".  If if finds the value in cell A2 in the first column of the lookup range in the table Data (column A) then it returns the value from the same row but in the second or third column.
    all that is in a function calld iserror() to trap the condition where the calue you enter in A2 does not exist in the table Data:
    You will find the Numbers users guide and function reference helpful.  You can download then from Apple here:
    http://support.apple.com/manuals/#productivitysoftware

  • How to use dual table in ODI in source side for nested queries?

    Hi,
    Any idea how to use dual table in source for more than once. I want to build a ODI interface for the following source query
    SELECT ACTV_TYP.ACTV_TYP_SRC_CD, ACTV_TYP.ACTV_TYP, PORT_ACTV_TYP.PORT_ACTV_TYP_SRC_CD, PORT_ACTV_TYP.PORT_ACTV_TYP, SFT_DLT_STS.SFT_DLT_STS_SRC_CD, SFT_DLT_STS.SFT_DLT_STS
    FROM
    SELECT LOW_VALUE PORT_ACTV_TYP_SRC_CD, MEANING PORT_ACTV_TYP
    FROM CUSTOMS.DOMAIN_ALLOW_COLUMNS_VALUES
    WHERE TABLE_NAME = 'BRKR_PORTS'
    AND COLUMN_NAME = 'WORK_PORT_TYPE') PORT_ACTV_TYP,
    (SELECT LOW_VALUE SFT_DLT_STS_SRC_CD, MEANING SFT_DLT_STS
    FROM CUSTOMS.DOMAIN_ALLOW_COLUMNS_VALUES
    WHERE TABLE_NAME = 'BANKS'
    AND COLUMN_NAME = 'REC_STATUS') SFT_DLT_STS,
    (SELECT 1 ACTV_TYP_SRC_CD, '?????' ACTV_TYP FROM DUAL
    UNION ALL
    SELECT 2 ACTV_TYP_SRC_CD, '???????' ACTV_TYP FROM DUAL) ACTV_TYP
    Regards

    If the below query is equivalent , it seems you don't need dual table at all , just default the values in the interface.
    You are using dual tables to populate values ACTV_TYP.ACTV_TYP_SRC_CD, ACTV_TYP.ACTV_TYP values. Look at your query in the following manner :
    SELECT '1', '?????', PORT_ACTV_TYP.PORT_ACTV_TYP_SRC_CD, PORT_ACTV_TYP.PORT_ACTV_TYP, SFT_DLT_STS.SFT_DLT_STS_SRC_CD, SFT_DLT_STS.SFT_DLT_STS
    FROM
    SELECT LOW_VALUE PORT_ACTV_TYP_SRC_CD, MEANING PORT_ACTV_TYP
    FROM CUSTOMS.DOMAIN_ALLOW_COLUMNS_VALUES
    WHERE TABLE_NAME = 'BRKR_PORTS'
    AND COLUMN_NAME = 'WORK_PORT_TYPE') PORT_ACTV_TYP,
    (SELECT LOW_VALUE SFT_DLT_STS_SRC_CD, MEANING SFT_DLT_STS
    FROM CUSTOMS.DOMAIN_ALLOW_COLUMNS_VALUES
    WHERE TABLE_NAME = 'BANKS'
    AND COLUMN_NAME = 'REC_STATUS') SFT_DLT_STS
    UNION
    SELECT 2 , '??????', PORT_ACTV_TYP.PORT_ACTV_TYP_SRC_CD, PORT_ACTV_TYP.PORT_ACTV_TYP, SFT_DLT_STS.SFT_DLT_STS_SRC_CD, SFT_DLT_STS.SFT_DLT_STS
    FROM
    SELECT LOW_VALUE PORT_ACTV_TYP_SRC_CD, MEANING PORT_ACTV_TYP
    FROM CUSTOMS.DOMAIN_ALLOW_COLUMNS_VALUES
    WHERE TABLE_NAME = 'BRKR_PORTS'
    AND COLUMN_NAME = 'WORK_PORT_TYPE') PORT_ACTV_TYP,
    (SELECT LOW_VALUE SFT_DLT_STS_SRC_CD, MEANING SFT_DLT_STS
    FROM CUSTOMS.DOMAIN_ALLOW_COLUMNS_VALUES
    WHERE TABLE_NAME = 'BANKS'
    AND COLUMN_NAME = 'REC_STATUS') SFT_DLT_STS
    Now you can use dataset to make UNION.

  • How to get default input values when using promt user for input

    I use "promt user for input" to input some values. The messageboard appears with blank boxes then I will input  new values. I want to make some default values in this blank boxes so that I needn't to enter new values. Is it possible ?

    Right click on he Express Vi terminal and choose open Front panel to convert it into a standard vi. Then open it. Enter a default value for each control, then right-click on the controls and go to data operation > make current value default.
    Message Edité par chilly charly le 11-18-2007 12:52 PM
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • How to use multiple table in single control file?

    Hi,
    How to use multiple table and data file in sigle control file? I have a four table and four csv file i mean data file for that. I am running concurrent program to load the data from csv file to custom table. based on my input data file name, it has to take automatically from one control file.
    Can anyone share with me how can i acheive this?
    Thanks

    Hi,
    Can't we acehive like below. I don't this exactly corrcect.
    OPTIONS (SKIP=1)
    LOAD DATA
    INFILE << file name 1 >>
    APPEND INTO TABLE XXCZ_VA_SAMPLE1
    FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
         PARENT_ITEM               "TRIM(BOTH FROM :PARENT_ITEM)"
    LOAD DATA
    INFILE << file name 2 >>
    APPEND INTO TABLE XXCZ_VA_SAMPLE2
    FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
         ITEM_NUMBER               "TRIM(BOTH FROM :ITEM_NUMBER)"
    )Edited by: orasuriya on Sep 14, 2009 3:03 AM

  • How to Use PM BAPI for equipment Master upload : BAPI_EQUIPMENT_SAVEREPLICA

    Hi ,
      How to use PM BAPI for equipment Master upload : BAPI_EQUIPMENT_SAVEREPLICA.
      May i know what are the input parameters & fields mandatory
      for each Table structures ct_data , ct_datax , it_descript , it_longtext.
      Can any one explain me Step by Step Process.
      B'cos i tried with below code. Equipment is not getting created.
      wa_itab-equipment_ext = '000000000100000001'.
      wa_itab-descript      = 'Test 2 -> Lube Oil Pump'.
      wa_itab-text_language = 'EN'.
      wa_itab-sdescript     = 'Short Description'.
      APPEND wa_itab TO it_itab.
      CLEAR  wa_itab.
      LOOP AT it_itab INTO wa_itab.
        ct_data-ta_guid       = '000000000000000001'.
        ct_data-equipment_ext = wa_itab-equipment_ext.
        ct_data-descript      = wa_itab-descript     .
        ct_data-valid_date    = sy-datum.
        ct_data-equicatgry    = 'M'.
        APPEND ct_data.
        CLEAR  ct_data.
        ct_datax-ta_guid       = '000000000000000001'.
        ct_datax-equipment_ext = 'X'.
        ct_datax-equipment     = 'X'.
        APPEND ct_datax.
        CLEAR  ct_datax.
        it_descript-ta_guid       = '000000000000000001'.
        it_descript-text_language = wa_itab-text_language.
        it_descript-descript      = wa_itab-sdescript    .
        APPEND it_descript.
        CLEAR  it_descript.
        it_longtext-ta_guid        = '000000000000000001'.
        it_longtext-text_language  = wa_itab-text_language.
        it_longtext-text_id        = 'LTXT'.
        it_longtext-text_line      = 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS'.
        APPEND it_longtext.
        CLEAR  it_longtext.
        it_longtext-ta_guid        = '000000000000000001'.
        it_longtext-text_language  = wa_itab-text_language.
        it_longtext-text_id        = 'INTV'.
        it_longtext-text_line      = 'aaaaaaaaaaaaaaa'.
        APPEND it_longtext.
        CLEAR  it_longtext.
        it_longtext-ta_guid        = '000000000000000001'.
        it_longtext-text_language  = wa_itab-text_language.
        it_longtext-text_id        = 'INTV'.
        it_longtext-text_line      = 'bbbbbbbbbbbb'.
        APPEND it_longtext.
        CLEAR  it_longtext.
        it_longtext-ta_guid        = '000000000000000001'.
        it_longtext-text_language  = wa_itab-text_language.
        it_longtext-text_id        = 'INTV'.
        it_longtext-text_line      = 'cccccccccccccccc'.
        APPEND it_longtext.
        CLEAR  it_longtext.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
      call BAPI-function in this system
        CALL FUNCTION 'BAPI_EQUIPMENT_SAVEREPLICA'
          TABLES
            ct_data     = ct_data
            ct_datax    = ct_datax
            it_descript = it_descript
            it_longtext = it_longtext
            return      = return
          EXCEPTIONS
            OTHERS      = 1.
        IF sy-subrc = 0.
          CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
          WRITE : 'Successful'.
        ENDIF.
        IF NOT return IS INITIAL.
          LOOP AT return.
            IF return-type = 'A' OR return-type = 'E'.
              WRITE : 'Error'.
            ENDIF.
          ENDLOOP.
        ENDIF.
        REFRESH  return.
      ENDLOOP.
    Regards
    SUrendar

    Hi ,
      How to use PM BAPI for equipment Master upload : BAPI_EQUIPMENT_SAVEREPLICA.
      May i know what are the input parameters & fields mandatory
      for each Table structures ct_data , ct_datax , it_descript , it_longtext.
      Can any one explain me Step by Step Process.
      B'cos i tried with below code. Equipment is not getting created.
      wa_itab-equipment_ext = '000000000100000001'.
      wa_itab-descript      = 'Test 2 -> Lube Oil Pump'.
      wa_itab-text_language = 'EN'.
      wa_itab-sdescript     = 'Short Description'.
      APPEND wa_itab TO it_itab.
      CLEAR  wa_itab.
      LOOP AT it_itab INTO wa_itab.
        ct_data-ta_guid       = '000000000000000001'.
        ct_data-equipment_ext = wa_itab-equipment_ext.
        ct_data-descript      = wa_itab-descript     .
        ct_data-valid_date    = sy-datum.
        ct_data-equicatgry    = 'M'.
        APPEND ct_data.
        CLEAR  ct_data.
        ct_datax-ta_guid       = '000000000000000001'.
        ct_datax-equipment_ext = 'X'.
        ct_datax-equipment     = 'X'.
        APPEND ct_datax.
        CLEAR  ct_datax.
        it_descript-ta_guid       = '000000000000000001'.
        it_descript-text_language = wa_itab-text_language.
        it_descript-descript      = wa_itab-sdescript    .
        APPEND it_descript.
        CLEAR  it_descript.
        it_longtext-ta_guid        = '000000000000000001'.
        it_longtext-text_language  = wa_itab-text_language.
        it_longtext-text_id        = 'LTXT'.
        it_longtext-text_line      = 'SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS'.
        APPEND it_longtext.
        CLEAR  it_longtext.
        it_longtext-ta_guid        = '000000000000000001'.
        it_longtext-text_language  = wa_itab-text_language.
        it_longtext-text_id        = 'INTV'.
        it_longtext-text_line      = 'aaaaaaaaaaaaaaa'.
        APPEND it_longtext.
        CLEAR  it_longtext.
        it_longtext-ta_guid        = '000000000000000001'.
        it_longtext-text_language  = wa_itab-text_language.
        it_longtext-text_id        = 'INTV'.
        it_longtext-text_line      = 'bbbbbbbbbbbb'.
        APPEND it_longtext.
        CLEAR  it_longtext.
        it_longtext-ta_guid        = '000000000000000001'.
        it_longtext-text_language  = wa_itab-text_language.
        it_longtext-text_id        = 'INTV'.
        it_longtext-text_line      = 'cccccccccccccccc'.
        APPEND it_longtext.
        CLEAR  it_longtext.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
      call BAPI-function in this system
        CALL FUNCTION 'BAPI_EQUIPMENT_SAVEREPLICA'
          TABLES
            ct_data     = ct_data
            ct_datax    = ct_datax
            it_descript = it_descript
            it_longtext = it_longtext
            return      = return
          EXCEPTIONS
            OTHERS      = 1.
        IF sy-subrc = 0.
          CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
          WRITE : 'Successful'.
        ENDIF.
        IF NOT return IS INITIAL.
          LOOP AT return.
            IF return-type = 'A' OR return-type = 'E'.
              WRITE : 'Error'.
            ENDIF.
          ENDLOOP.
        ENDIF.
        REFRESH  return.
      ENDLOOP.
    Regards
    SUrendar

  • How to use Temporary Table in PL-SQL

    In MySQL there is no Temporary table concept.
    So for intermediate calculation I have created a table as below
    create table SequenceTempTable
    SessionId VARCHAR(50),
    Sequence VARCHAR(500),
    CreatedDate DATE
    ) ENGINE=MEMORY;
    Whenever I invoke a SP, I load the data into SequenceTempTable using Session Id as below
    CREATE PROCEDURE `GetSequence`(
    IN Start_Date VARCHAR(25),
    IN End_Date VARCHAR(25)
    BEGIN
    SELECT UUID() INTO v_SessionId;
    INSERT INTO SequenceTempTable values (v_SessionId,'1,2,5,3',now());
    required code
    DELETE FROM SequenceTempTable WHERE SessionId = v_SessionId;
    COMMIT;
    END;
    i.e. I have created a table as temporary table (created once),
    and load the data using Session Id and once session specific intermediate computation done,
    I deleted the session specific data.
    Could you give me examples of How to use Temporary table in PL-SQL code with respect to my above example.
    Because I have gone through creating Temporary table but I stuck with use in PL-SQL. I mean to say Is there any need of creating table in advance before invoking SP.
    And one more thing as in MySQL temp table I created which is using MEMORY engine i.e. this table will always be in MEMORY so there is no need of writing data on disk.
    Regards
    Sanjeev

    Hi Sanjeev
    Read about GTT here
    http://www.oracle-base.com/articles/8i/TemporaryTables.php
    GTT always contains just session specific data. \
    In case you want to use the GTT in the same session again you can use option
    ON COMMIT PRESERVE ROWS;
    Or if it is used just once in the session use can use
    ON COMMIT DELETE ROWS;
    Do remember that for GTT the data of one session can not be accessed in other session.
    Also you can go away with Delete from GTT if not used again in same session.
    Regards
    Arun

  • How to check with table for cursor..?

    How to check with table for cursor..?
    Here I have Table temp_final_plan
    Here i want to update if already exit...below is the procedure....
    CREATE OR REPLACE PROCEDURE spu_final_profit_plan
    AS
    -- Constant declarations
      ln_errnum number := 0;
    -- Variable declarations
       ls_errmsg app_errors.err_msg%TYPE;
       ls_appmsg app_errors.app_msg%TYPE;
       ls_appid  app_errors.app_id%TYPE;
    -- Cursor declaration for final_update_el
    CURSOR cur_final_update_el IS
        select '910' ent,
               '9127316' center,
               post_acct,
               sum(avg_mtd_01) sum_avg_mtd_01,
               sum(avg_mtd_02) sum_avg_mtd_02,
               sum(avg_ytd_01) sum_avg_ytd_01,
               sum(avg_ytd_02) sum_avg_ytd_02
          from mon_act_cypy
         where rec_type = 'A'
           and sum_flag = 'D'
           and yr = '2008'
           and substr(ctr_or_hier, 1, 2) = 'el'
           and ent || sub_ent in
               (select ent || sub_ent
                  from ent_ref
                 where roll_ent || roll_sub_ent = '999100')
         group by post_acct
        having sum(avg_mtd_01) <> 0
            or sum(avg_mtd_02) <> 0
            or sum(avg_ytd_01) <> 0
            or sum(avg_ytd_02) <> 0;
    -- Cursor declaration for final_update
    CURSOR cur_final_update IS
        select b.plan_ent b_plan_ent,
               b.plan_ctr b_plan_ctr,
               a.post_acct a_post_acct,
               sum(a.avg_mtd_01) sum_avg_mtd_01,
               sum(a.avg_mtd_02) sum_avg_mtd_02,
               sum(a.avg_ytd_01) sum_ytd_mtd_01,
               sum(a.avg_ytd_02) sum_ytd_mtd_02
          from mon_act_cypy a,
               plan_unit_tbl b
         where a.ent || a.ctr_or_hier = b.ent || b.ctr_or_hier
           and a.rec_type = 'A'
           and a.sum_flag = 'D'
           and a.yr = '2008'
           and b.hier_tbl_num = '001'
           and a.ent || a.sub_ent in
               (select ent || sub_ent
                  from ent_ref
                 where roll_ent || roll_sub_ent = '999100')
         group by b.plan_ent, b.plan_ctr, a.post_acct
        having sum(a.avg_mtd_01) <> 0
            or sum(a.avg_mtd_02) <> 0
            or sum(a.avg_ytd_01) <> 0
            or sum(a.avg_ytd_02) <> 0;
    -- Begin the procedure body
       BEGIN
    -- Insert / Update final profit plan for final_update query using cursor
       FOR rec_final_update_el IN cur_final_update_el
       LOOP
       EXIT WHEN rec_final_update_el%NOTFOUND;
       IF rec_final_update_el. THEN
          UPDATE temp_final_plan
             SET sum_avg_mtd_01 = rec_final_update_el.sum_avg_mtd_01,
                 sum_avg_mtd_02 = rec_final_update_el.sum_avg_mtd_02,       
                 sum_avg_ytd_01 = rec_final_update_el.sum_avg_ytd_01,       
                 sum_avg_ytd_02 = rec_final_update_el.sum_avg_ytd_02,       
           WHERE ent = rec_final_update_el.ent
             AND center = rec_final_update_el.center
             AND post_acct = rec_final_update_el.post_acct;
       ELSE
          INSERT INTO temp_final_plan VALUES(rec_final_update_el.ent,
                                             rec_final_update_el.center,
                                             rec_final_update_el.post_acct,
                                             rec_final_update_el.sum_avg_mtd_01,
                                             rec_final_update_el.sum_avg_mtd_02,
                                             rec_final_update_el.sum_avg_ytd_01,
                                             rec_final_update_el.sum_avg_ytd_02);
       END IF;
       END LOOP;
    -- Insert / Update final profit plan for final_update query using cursor
       FOR rec_final_update IN cur_final_update
       LOOP
       EXIT WHEN rec_final_update%NOTFOUND;
       IF rec_final_update. THEN
          UPDATE temp_final_plan
             SET sum_avg_mtd_01 = rec_final_update.sum_avg_mtd_01,
                 sum_avg_mtd_02 = rec_final_update.sum_avg_mtd_02,       
                 sum_avg_ytd_01 = rec_final_update.sum_avg_ytd_01,       
                 sum_avg_ytd_02 = rec_final_update.sum_avg_ytd_02,       
           WHERE ent = rec_final_update.b_plan_ent
             AND center = rec_final_update.b_plan_ctr
             AND post_acct = rec_final_update.a_post_acct;
       ELSE
          INSERT INTO temp_final_plan VALUES(rec_final_update.b_plan_ent,
                                             rec_final_update.b_plan_ctr,
                                             rec_final_update.a_post_acct,
                                             rec_final_update.sum_avg_mtd_01,
                                             rec_final_update.sum_avg_mtd_02,
                                             rec_final_update.sum_avg_ytd_01,
                                             rec_final_update.sum_avg_ytd_02);
       END IF;
       END LOOP;
    -- EXCEPTION handling section
       EXCEPTION
    -- Fire OTHERS Exception case by default
       WHEN OTHERS THEN
    -- ROLL BACK Transaction, if any failure
       ROLLBACK;
       ln_errnum := SQLCODE;
       ls_errmsg := SUBSTR(SQLERRM, 1, 100);
    -- Log the ERRORS into APP_ERRORS table using SPU_LOG_ERRORS procedure
       spu_log_errors(ln_errnum, ls_errmsg, ls_appid, ls_appmsg);
    -- End of the stored procedure
    END spu_final_profit_plan;
    [\pre]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    I'm not sure what you mean by, 'How to check with table for cursor..?' but I'll offer a comment on your Code Snippet. I think you want to know how to check if a record exists so you know if you need to perform an INSERT or an UPDATE.
    Here is a snippet of your code. I'll put my comments in "Comment" style in your code.
    -- Insert / Update final profit plan for final_update query using cursor
       FOR rec_final_update_el IN cur_final_update_el
       LOOP
    /* There is no need to test for %NOTFOUND since you are using Cursor FOR Loop! 
    ** This construct automatically exits when the last record is processed. */
       EXIT WHEN rec_final_update_el%NOTFOUND;
    /* Is this where you would like to know how to Check if the record already exist??
    ** I asked this because, 'rec_final_update_el.' is not valid syntax.  Are you looking for
    ** an Cursor Attribute or Method you can check here? 
    ** I would suggest a Primary Key or Unique Index on ENT, CENTER, and POST_ACCT
    ** on the TEMP_FINAL_PLAN table. Then simply perform an INSERT and code an
    ** Exception to UPDATE when you get a DUP_VAL_ON_INDEX exception.  Otherwise,
    ** you will need to simply run an Implicit or Explicit Cursor to test if the row exists and
    ** use this return value to determine if you should INSERT or UPDATE.  */
       IF rec_final_update_el. THEN
          UPDATE temp_final_plan
             SET sum_avg_mtd_01 = rec_final_update_el.sum_avg_mtd_01,
                 sum_avg_mtd_02 = rec_final_update_el.sum_avg_mtd_02,       
                 sum_avg_ytd_01 = rec_final_update_el.sum_avg_ytd_01,       
                 sum_avg_ytd_02 = rec_final_update_el.sum_avg_ytd_02,       
           WHERE ent = rec_final_update_el.ent
             AND center = rec_final_update_el.center
             AND post_acct = rec_final_update_el.post_acct;
       ELSE
          INSERT INTO temp_final_plan VALUES(rec_final_update_el.ent,
                                             rec_final_update_el.center,
                                             rec_final_update_el.post_acct,
                                             rec_final_update_el.sum_avg_mtd_01,
                                             rec_final_update_el.sum_avg_mtd_02,
                                             rec_final_update_el.sum_avg_ytd_01,
                                             rec_final_update_el.sum_avg_ytd_02);
       END IF;
       END LOOP;I hope I've answered your question, but if I haven't please provide more details so we can better understand your request.
    Craig...

  • How to use 2 GL for loss made on asset retirement w/o revenue ?

    how to use 2 GL for loss made on asset retirement w/o revenue.
    hello everyone
    i have some trouble.
    my company want to use 2 GL account for asset retirement
    example  some time use GL 6500001  some time use 6500002
    in standard configuration AO90 , field loss made on asset retirement w/o revenue, there is only one field.
    so i can use only one G/L.
    it' s not good if i must to change configuration (and transport request )every time that user need to change GL.
    now i got one idea.
    i know that table T095 keep account determinaton and GL account data.
    so if i make program that change data from table T095 directly. i donot need to change config everytime.
    but i am not sure that this way will make impact other standard program or not.
    i will wait for better idea from everyone.
    please help.

    Substitution consist of several steps  each with two parts:
    1- Prerequisite
    2- Replacement
    If the prerequisite is satisfied (TRUE), substitution (Replacement) is performed.
    Transaction Code: OBBH.
    Thank you
    Javed

  • How to make a form for input in web interface builder

    Hi expert:
        How to make a form for input in web interface builder?I have already used it to do PS planning, but I don't know how to  draw lines and checkboxes . Thanks in advance.
    Allen

    WAD:
    Open the WAD and create a new template. On the left hand navigation you will have several Web Items available. Under 'Standard' you have 'Analysis' item. Pull that into your template to the right. Under the Properties tab you need to pick the query [form/layout] that you have built in Query Designer.
    You will also find other items such as Button group, Checkbox, drop down, list box etc available. Pick and drag into the template whatever it is you require. Lets say you want a button. Under the Properties tab select the 'Command' that you require. You could use standard commands that are available there. You could also define functions and commands that you require.
    Query Designer:
    Open the QD and drag the characteristics and key figures that you require into the rows and columns of the QD. You would need to specify restrictions under the Filter tab of the QD based on the granularity of data that you require. You would need to remember that the key figures need to be made Input Ready [do this by clicking on KF and on the planning tab select "change by user and planning functions"].
    This shouldgive you a start. After you've explored it yourself a bit we can discuss further and I can certainly provide you additional details/material on these areas.
    Srikant

  • How to use Bapi BAPI_ACC_DOCUMENT_POST for g/l account document posting

    Hi all,
    I am using BAPI_ACC_DOCUMENT_POST bapi for g/l account documents posting.as I am first time using BAPI in my program.can anyone give details about how to use this BAPI for document postings.what importing parameters need to be passed , which exporting parameters need to be passed and which tables need to be used.  
    Thanks in advance.
    Regards,
    Harshada

    Moderator message - Please search before asking - post locked
    Rob

Maybe you are looking for