How to use multiple transactions

hi experts,
1.how to handle multiple transactions in call transaction and session method.
2.is it possible to handle multiple transactions in call transaction method.
3.can plz send how handle multiple transactions in session method.
thanks in addvance

hi,
Go through this program.
REPORT zra_gl_cr NO STANDARD PAGE HEADING LINE-SIZE 255.
TYPE-POOLS: truxs.
DATA: it_raw TYPE truxs_t_text_data.
DATA:messtab1 LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
DATA:messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF i_mess OCCURS 0,
l_mstring(480),
msgnr(5),
msgv1(15),
END OF i_mess.
DATA:i_mess1 LIKE i_mess OCCURS 0 WITH HEADER LINE.
DATA: l_mstring(480),l_mstring1(480).
DATA: BEGIN OF it_itab OCCURS 0,
saknr(10), "G/L a/c number.
bukrs(4), "Company Code.
ktoks(4), "G/L a/c group.
xplacct(1), "P&L statement account.
xbilk(1), "Balance sheet account.
txt20_ml(20), "G/L a/c short text.
txt50_ml(50), "G/L a/c long text.
waers(5), "Account currency.
MWSKZ(2),
mitkz(1), "Reconciliation a/c for a/c type.
xopvw(1), "Open item management
xkres(1), "Line item display.
zuawa(3), "Sort Key.
fstag(4), "Field status group.
xintb(1), "Post automatically only.
hbkid(5), "House bank.
hktid(5), "Account id.
vzskz(2), "Interest indicator
END OF it_itab.
DATA: hdate LIKE sy-datum.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(15) text-103. " FOR FIELD P_FILE1.
SELECTION-SCREEN POSITION 25.
PARAMETERS : p_file1 LIKE rlgrap-filename.
SELECTION-SCREEN END OF LINE.
INITIALIZATION.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
Perform file_selection will help to select the location of the file
PERFORM file_selection.
START-OF-SELECTION.
Perform data_upload will help to upload the data from the flat file
to the internal table.
PERFORM data_upload.
PERFORM open_group.
Peform bdc_upload will help to upload the data from the internal
table into its respective fields.
PERFORM bdc_fspo.
PERFORM bdc_upload.
PERFORM exp_log.
PERFORM close_group.
Perform display_log will prepare a log for the data that has been
uploaded
PERFORM display_log.
END-OF-SELECTION.
FORM file_selection .
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
def_filename = ' '
def_path = 'C:\'
mask = ',.txt,.xls.'
mode = 'O'
title = 'Open a excel file'
IMPORTING
filename = p_file1
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
ENDFORM. " file_selection
FORM data_upload .
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
I_FIELD_SEPERATOR =
i_line_header = 'X'
i_tab_raw_data = it_raw
i_filename = p_file1
TABLES
i_tab_converted_data = it_itab
EXCEPTIONS
conversion_failed = 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.
ENDFORM. " data_upload
FORM bdc_upload .
LOOP AT it_itab.
perform bdc_dynpro using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
perform bdc_field using 'BDC_OKCODE'
'=ACC_CRE'.
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_KEY-SAKNR'.
perform bdc_field using 'GLACCOUNT_SCREEN_KEY-SAKNR'
it_itab-SAKNR.
perform bdc_field using 'GLACCOUNT_SCREEN_KEY-BUKRS'
it_itab-BUKRS.
perform bdc_dynpro using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
perform bdc_field using 'BDC_OKCODE'
'=2102_GROUP'.
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_COA-KTOKS'.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-KTOKS'
it_itab-KTOKS.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-XPLACCT'
it_itab-XPLACCT.
perform bdc_dynpro using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
perform bdc_field using 'BDC_OKCODE'
'=2102_BS_PL'.
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_COA-XBILK'.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-KTOKS'
it_itab-KTOKS.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-XPLACCT'
it_itab-XPLACCT.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-XBILK'
it_itab-XBILK.
perform bdc_dynpro using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
perform bdc_field using 'BDC_OKCODE'
'=ENTER'.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-KTOKS'
it_itab-KTOKS.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-XBILK'
it_itab-XBILK.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-TXT20_ML'
it_itab-TXT20_ML.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-TXT50_ML'
it_itab-TXT50_ML.
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_COA-BILKT'.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-BILKT'
it_itab-saknr.
PERFORM bdc_dynpro USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=TAB02'.
PERFORM bdc_field USING 'BDC_CURSOR'
'GLACCOUNT_SCREEN_COA-KTOKS'.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-KTOKS'
it_itab-ktoks.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-TXT20_ML'
it_itab-txt20_ml.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-TXT50_ML'
it_itab-txt50_ml.
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_COA-BILKT'.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-BILKT'
it_itab-saknr.
perform bdc_dynpro using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
perform bdc_field using 'BDC_OKCODE'
'=TAB02'.
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_COA-KTOKS'.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-KTOKS'
it_itab-KTOKS.
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_COA-KTOKS'.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-KTOKS'
it_itab-KTOKS.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-XBILK'
it_itab-XBILK.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-TXT20_ML'
it_itab-TXT20_ML.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-TXT50_ML'
it_itab-TXT50_ML.
perform bdc_field using 'GLACCOUNT_SCREEN_COA-BILKT'
it_itab-saknr.
perform bdc_dynpro using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
perform bdc_field using 'BDC_OKCODE'
'=ENTER'.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-WAERS'
it_itab-waers.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-MWSKZ'
it_itab-MWSKZ.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-MITKZ'
it_itab-mitkz.
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_CCODE-XOPVW'.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-XOPVW'
it_itab-XOPVW.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-XKRES'
it_itab-XKRES.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-ZUAWA'
it_itab-ZUAWA.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-XPLACCT'
it_itab-xplacct.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-XBILK'
it_itab-xbilk.
IF it_itab-xbilk = 'X'.
PERFORM bdc_dynpro USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=TAB03'.
PERFORM bdc_field USING 'BDC_CURSOR'
'GLACCOUNT_SCREEN_CCODE-WAERS'.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-WAERS'
it_itab-waers.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-XOPVW'
it_itab-xopvw.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-MITKZ'
it_itab-mitkz.
ENDIF.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-XKRES'
it_itab-xkres.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-ZUAWA'
it_itab-zuawa.
PERFORM bdc_dynpro USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=SAVE'.
PERFORM bdc_field USING 'BDC_CURSOR'
'GLACCOUNT_SCREEN_CCODE-FSTAG'.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-FSTAG'
it_itab-fstag.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-XINTB'
it_itab-xintb.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-HBKID'
it_itab-hbkid.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-HKTID'
it_itab-hktid.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_CCODE-VZSKZ'
it_itab-vzskz.
perform bdc_dynpro using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
perform bdc_field using 'BDC_OKCODE'
'=TAB03'.
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_CCODE-WAERS'.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-WAERS'
it_itab-WAERS.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-MWSKZ'
it_itab-MWSKZ.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-MITKZ'
it_itab-MITKZ.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-ZUAWA'
it_itab-ZUAWA.
perform bdc_dynpro using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
perform bdc_field using 'BDC_OKCODE'
'=ENTER'.
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_CCODE-FSTAG'.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-FSTAG'
it_itab-FSTAG.
perform bdc_dynpro using 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
perform bdc_field using 'BDC_OKCODE'
'=SAVE'.
perform bdc_field using 'BDC_CURSOR'
'GLACCOUNT_SCREEN_CCODE-FSTAG'.
perform bdc_field using 'GLACCOUNT_SCREEN_CCODE-FSTAG'
it_itab-FSTAG.
PERFORM bdc_transaction USING 'FS00'.
CALL TRANSACTION 'FS00' USING bdcdata MODE 'A'
UPDATE 'S'
MESSAGES INTO messtab1.
PERFORM mess1.
REFRESH bdcdata[].
ENDLOOP.
ENDFORM. " bdc_upload
FORM bdc_fspo .
LOOP AT it_itab.
PERFORM bdc_dynpro USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ACC_CRE'.
PERFORM bdc_field USING 'BDC_CURSOR'
'GLACCOUNT_SCREEN_KEY-SAKNR'.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_KEY-SAKNR'
it_itab-saknr.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_KEY-KTOPL'
'1000'.
PERFORM bdc_dynpro USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=2102_GROUP'.
PERFORM bdc_field USING 'BDC_CURSOR'
'GLACCOUNT_SCREEN_COA-KTOKS'.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-KTOKS'
it_itab-ktoks.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-XPLACCT'
it_itab-xplacct.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-XBILK'
it_itab-xbilk.
PERFORM bdc_dynpro USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=SAVE'.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-KTOKS'
it_itab-ktoks.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-XPLACCT'
it_itab-xplacct.
PERFORM bdc_field USING 'BDC_CURSOR'
'GLACCOUNT_SCREEN_COA-TXT50_ML'.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-TXT20_ML'
it_itab-txt20_ml.
PERFORM bdc_field USING 'GLACCOUNT_SCREEN_COA-TXT50_ML'
it_itab-txt50_ml.
*perform bdc_transaction using 'FSP0'.
CALL TRANSACTION 'FSP0' USING bdcdata MODE 'A'
UPDATE 'S'
MESSAGES INTO messtab.
PERFORM mess.
REFRESH bdcdata[].
ENDLOOP.
ENDFORM. " bdc_fspo
FORM mess . "fsp0
LOOP AT messtab.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = messtab-msgid
lang = messtab-msgspra
no = messtab-msgnr
v1 = messtab-msgv1
v2 = messtab-msgv2
v3 = messtab-msgv3
v4 = messtab-msgv4
IMPORTING
msg = l_mstring
EXCEPTIONS
not_found = 1
OTHERS = 2.
CONDENSE l_mstring.
i_mess1-l_mstring = l_mstring(250).
i_mess1-msgnr = messtab1-msgnr.
i_mess1-msgv1 = messtab1-msgv1.
APPEND i_mess1.
ENDLOOP.
ENDFORM. " mess
FORM mess1 . "fs00
LOOP AT messtab1.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = messtab1-msgid
lang = messtab1-msgspra
no = messtab1-msgnr
v1 = messtab1-msgv1
v2 = messtab1-msgv2
v3 = messtab1-msgv3
v4 = messtab1-msgv4
IMPORTING
msg = l_mstring1
EXCEPTIONS
not_found = 1
OTHERS = 2.
CONDENSE l_mstring1.
i_mess-l_mstring = l_mstring1(250).
i_mess-msgnr = messtab1-msgnr.
i_mess-msgv1 = messtab1-msgv1.
APPEND i_mess.
ENDLOOP.
ENDFORM. " mess1
FORM exp_log .
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'c:\temp\error_fsp0.txt'
filetype = 'DAT'
TABLES
data_tab = i_mess1.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'c:\temp\error_fs00.txt'
filetype = 'DAT'
TABLES
data_tab = i_mess.
ENDFORM. " exp_log
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM. "BDC_DYNPRO
FORM bdc_field USING fnam fval.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDFORM. "BDC_Field
Rewards points.
Rgds,
P.Nag

Similar Messages

  • How can we use multiple transactions by using bdc_insert.

    HI
    How can we use multiple transactions by using bdc_insert.

    Hi,
    In between the Open and Close we have to use the BDC_INSERT for the Tcodes you have to do.
    BDC_OPEN_GROUP
    BSD_INSERT
    TCODE = tcode1
    BDC_INSERT
    TCODE = tcode 2
    BDC_CLOSE_GROUP
    check the SDN for more on this.
    Regards
    Lekha

  • How to handle multiple transaction in session method.

    hi experts.
    please tell me how to<b> write code for multiple transaction</b> in session methods.
    Quest.  -de<b>another question is exactly which method we have to follow , how to</b>decide.
    what r the conditions for selecting which method is suitable for which type of
    transaction.

    hi,
    if you have run time validation while updating the data into SAP R/3 Transaction,then use BDC Call Transaction.
    example : when you load the data into Sales order then you need to load the into Header text of sales order.
    for this ,you have to use Update Mode 'S'.
    it is online update and if you small amount of data ,then prefer this one
    2. If you have huge amount of data and then prefer Session Method.
    we have one more advantage in session method...
    suppose file has 1,00,000 records and the if you use all the records at time,then you will get short dump like system time exceed .
    then you can split the each 10,000 records into one session and will process.
    3. Direct Input method : we prefer this method only few Transaction ,
    this will not applicable to when system has customer fields .
    for session method using multiple transactions.
    Have one BDC_OPEN_GROUP, multiple BDC_INSERT s and one BDC_CLOSE_GROUP.
    You should have multiple BDC_INSERT s for multiple transactions.
    call function BDC_OPENGROUP.
    Build BDC data and cal lBDC_INSERT for transaction 1
    Build BDC data and cal lBDC_INSERT for transaction 2
    Build BDC data and cal lBDC_INSERT for transaction 3
    paas the tcodes to bdc_insert.
    call function BDC_CLOSE_GROUP.

  • How to use multiple ipods on one account

    I have an Ipod classic and just bought my sons two nano's how do I use these on the same account without changing my account info?

    Take a look here:
    How to use multiple iPods with one computer
    Forum Tip: Since you're new here, you've probably not discovered the Search feature available on every Discussions page, but next time, it might save you time (and everyone else from having to answer the same question multiple times) if you search a couple of ways for a topic, both in the relevant forums, in the User Tips Library and in the Apple Knowledge Base before you post a question.
    Regards.

  • How to use multiple JREs (1.5.0_20 and 1.6.0_07) with Internet Explorer 8?

    Hi!
    Question about the problem mentioned in subject.
    I have configured that JNLP opens with 1.5 version, both versions are enabled in Java Control Panel Runtime Settings but when I try to start a desktop java console says:
    Java Web Start 1.5.0_22
    Using JRE version 1.6.0_07 Java HotSpot(TM) Client VM
    And the opening of the desktop creates an exception:
    Java Web Start - Invalid Argument Error
    TooManyArgumentsException[ Too many arguments supplied: {C:\WINDOWS\Temporary, Internet, Files\Content.IE5\....
    I'm trying to open my desktop with 1.5 version and other programs with 1.6 version. What is it that I still need to do? I'm kind of confused with this. Some of my collagues have succeeded with this and some doesn't, with the same configuration.
    So the question is, how to use multiple JREs with IE8 so that one application uses 1.5 version and others 1.6 version?
    Br,
    Katri
    Edited by: ka**** on 09-Mar-2011 01:16
    Edited by: ka**** on 09-Mar-2011 03:16

    ka**** wrote:
    ..Question about the problem mentioned in subject.No "Using multiple JREs (1.5.0_20 and 1.6.0_07) with Internet Explorer 8" is a statement. To transform it to a question would be something like "How to use multiple JREs (1.5.0_20 and 1.6.0_07) with Internet Explorer 8?".
    Once you can come up with an actual question, I might look at this more closely.

  • How to use multiple VCI strings for lap 1300 and 1200 (option 60) in one pool?

    Hi All,
    Hope to you a very happy new year,
    I have two differnt LAP 1300 and 1200 in my network and I need to add theme to the WLC,
    I successed to add one of theme by the option 60 in the DHCP pool at the Core SW,
    So my quetion is below:
    How to use multiple VCI strings for lap 1300 and 1200 (option 60) in one pool?
    Thanks in Advanced,
    Ahmed,

    To add to Scott's post.  Option 60 would be useful if you needed to put certain types of AP on specific controllers.  Otherwise, no real need to use it for the most part.
    Though, I do recall an issue a few years ago that some windows machines had issues getting DHCP if option 43 is being returned.
    Now, on an IOS switch, you can only configure one option 60 per DHCP scope
    HTH,
    Steve
    Please remember to rate useful posts, and mark questions as answered

  • 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 multiple selection parameters in the data model

    Hi, after have looked all the previous threads about how to use multiple selection parameters , I still have a problem;
    I'm using Oracle BI Publisher 10.1.3.3.2 and I'm tried to define more than one multiple selection parameters inside the data template;
    Inside a simple SQL queries they work perfectly....but inside the data template I have errors.
    My data template is the following (it's very simple...I am just testing how the parameters work):
    <dataTemplate name="Test" defaultPackage="bip_departments_2_parameters">
    <parameters>
    <parameter name="p_dep_2_param" include_in_output="false" datatype="character"/>
    <parameter name="p_loc_1_param" include_in_output="false" datatype="character"/>
    </parameters>
    <dataTrigger name="beforeReport" source="bip_departments_2_parameters.beforeReportTrigger"/>
    <dataQuery>
    <sqlStatement name="Q2">
    <![CDATA[
    select deptno, dname,loc
    from dept
    &p_where_clause
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="G_DEPT" source="Q2">
    <element name="deptno" value="deptno"/>
    <element name="dname" value="dname"/>
    <element name="loc" value="loc"/>
    </group>
    </dataStructure>
    </dataTemplate>
    The 2 parameters are based on these LOV:
    1) select distinct dname from dept (p_dep_2_param)
    2) select distinct loc from dept (p_loc_1_param)
    and both of them have checked the "Multiple selection" and "Can select all" boxes
    The package I created, in order to use the lexical refence is:
    CREATE OR REPLACE package SCOTT.bip_departments_2_parameters
    as
    p_dep_2_param varchar2(14);
    p_loc_1_param varchar2(20);
    p_where_clause varchar2(100);
    function beforereporttrigger
    return boolean;
    end bip_departments_2_parameters;
    CREATE OR REPLACE package body SCOTT.bip_departments_2_parameters
    as
    function beforereporttrigger
    return boolean
    is
    l_return boolean := true;
    begin
    if (p_dep_2_param is not null) --and (p_loc_1_param is not null)
    then
    p_where_clause := 'where (dname in (' || replace (p_dep_1_param, '''') || ') and loc in (' || replace (p_loc_1_param, '''') || '))';
    else
    p_where_clause := 'where 1=1';
    end if;
    return (l_return);
    end beforereporttrigger;
    end bip_departments_2_parameters;
    As you see, I tried to have only one p_where_clause (with more than one parameter inside)....but it doesn't work...
    Using only the first parameter (based on deptno (which is number), the p_where_clause is: p_where_clause := 'where (deptno in (' || replace (p_dep_2_param, '''') || '))';
    it works perfectly....
    Now I don't know if the problem is the datatype, but I noticed that with a single parameter (deptno is number), the lexical refence (inside the data template) works.....with a varchar parameter it doesn't work....
    So my questions are these:
    1) how can I define the p_where_clause (inside the package) with a single varchar parameter (for example, the department location name)
    2) how can I define the p_where_clause using more than one parameter (for example, the department location name and the department name) not number.
    Thanks in advance for any suggestion
    Alex

    Alex,
    the missing thing in your example is the fact, that if only one value is selected, the parameter has exact this value like BOSTON. If you choose more than one value, the parameter includes the *'*, so that it looks like *'BOSTON','NEW YORK'*. So you need to check in the package, if there's a *,* in the parameter or not. If yes there's more than one value, if not it's only one value or it's null.
    So change your package to (you need to expand your variables)
    create or replace package bip_departments_2_parameters
    as
    p_dep_2_param varchar2(1000);
    p_loc_1_param varchar2(1000);
    p_where_clause varchar2(1000);
    function beforereporttrigger
    return boolean;
    end bip_departments_2_parameters;
    create or replace package body bip_departments_2_parameters
    as
    function beforereporttrigger
    return boolean
    is
    l_return boolean := true;
    begin
    p_where_clause := ' ';
    if p_dep_2_param is not null then
    if instr(p_dep_2_param,',')>0 then
    p_where_clause := 'WHERE DNAME in ('||p_dep_2_param||')';
    else
    p_where_clause := 'WHERE DNAME = '''||p_dep_2_param||'''';
    end if;
    if p_loc_1_param is not null then
    if instr(p_loc_1_param,',')>0 then
    p_where_clause := p_where_clause || ' AND LOC IN ('||p_loc_1_param||')';
    else
    p_where_clause := p_where_clause || ' AND LOC = '''||p_loc_1_param||'''';
    end if;
    end if;
    else
    if p_loc_1_param is not null then
    if instr(p_loc_1_param,',')>0 then
    p_where_clause := p_where_clause || 'WHERE LOC in ('||p_loc_1_param||')';
    else
    p_where_clause := p_where_clause || 'WHERE LOC = '''||p_loc_1_param||'''';
    end if;
    end if;
    end if;
    return (l_return);
    end beforereporttrigger;
    end bip_departments_2_parameters;
    I've written a similar example at http://www.oracle.com/global/de/community/bip/tipps/Dynamische_Queries/index.html ... but it's in german.
    Regards
    Rainer

  • How to use multiple iPods

    I have multiple iPods & iPhones & I'd like to share my library with them all.  How do I do this??? How can I share content outside of purchased iTunes?

    See this for some tips:  How to use multiple iPods, iPads, or iPhones with one computer, http://support.apple.com/kb/HT1495

  • How To Use Multiple Currencies in single payroll ........

    Dear All
    Can you help me How To Use Multiple Currencies in single payroll?
    with regards
    User600722

    I am not a functional expert. but ML Note 150173.1 (which is quite old) states that this is not possible.
    Srini

  • How to use OMJX transaction? Need to add an additional field on MIGO item

    hi guys
    we need to add a new field on the MIGO screen at the item level. We are trying to explore OMJX to add custom fields.
    We have used append structutre to enhance the GOITEM structure but are not clear on how to use OMJX.
    ANy idea how to use the transaction OMJX.
    Thanks in advance

    With the Business Add-In (BAdI) MB_MIGO_BADI, you can extend the              
    interface of the goods movements transaction (MIGO) with additional           
    tabstrip controls for the detailed information (detail tabstrips) and         
    header information (header tabstrips). It is possible for an external         
    application                                                                   
    o  to display an additional detail tabstrip with own subscreen (max. 10       
       lines) in MIGO                                                             
    o  to display an additional header tabstrip with own subscreen (max. 3        
       lines) in MIGO                                                                               
    The program name, screen number and tab page text can be determined           
    dynamically. Different screens can therefore be controlled according to       
    the mode (for example, change mode, display mode, goods receipt, goods        
    issue).                                                                               
    Pushbuttons                                                                   
    It is not possible to implement pushbuttons in the MIGO menu, but you         
    can, however, implement pushbuttons directly on the external subscreen.       
    The OK code from MIGO is forwarded to the external application so it can      
    react.                                                                               
    Cursor Control                                                                
    So that the cursor stays on the same subscreen after you press Continue,      
    if it was positioned there before, the external application in the own        
    PAI must hold the cursor positioning (on the same screen 'yes'/'no'; if       
    'yes', on which field), to set the cursor in PBO again.                                                                               
    Requirements                                                                               
    If you use the BAdI MB_MIGO_BADI in MIGO to update customer-own data, in      
    addition to the material document, to the database, you should note the       
    following:                                                                    
    o  The BAdI MB_MIGO_BADI is only active in transaction MIGO.                  
    o  If you post goods movements with other transactions (for example, with     
       MB01, MB1C, VL02N), you must ensure that customer data is also             
       updated, if necessary.                                                     
       You can do this by using the BAdI MB_DOCUMENT_BADI (Creating a             
       material document) to post the goods movements with the transactions       
       mentioned above.                                                           
    o  Note that otherwise, posting the goods movements will lead to              
       inconsistencies between SAP system data (for example, in stocks,           
       material documents, FI documents) and customer data.

  • How to use multiple statements inside the "THEN" block of CASE statement?

    Below is the code:
    SET @strTempString = case @strKeyMode
    WHEN 'AUTO/CYCLE'
    THEN  @strRefID + '|' + @strRetID
    WHEN 'CYCLE'
    THEN  @strRefID + '|' + @strRetID
    WHEN 'COMMERCIAL'
    THEN  @strRefID + '|' + @strRetID
    WHEN 'ISNAP'
    THEN  set @strFName = ltrim(rtrim((Left(dbo.CleanTheStringAdv(@strFName + '  ', 2) + '  ', 2))))
    '' + @strRefID + '|' + @strLName + '|' + @strFName + '|' + @strZIPorPolType
    WHEN 'ASNAP'
    THEN  @strRefID + '|' + @strRetID
    WHEN 'MOAT'
    THEN  @strRefID + '|' + @strRetID
    else '0'
    end 
    The first 3 conditions are understandable. How to use multiple statements in 4th case?
    Here I first want to set the value as:
    set @strFName = ltrim(rtrim((Left(dbo.CleanTheStringAdv(@strFName + '  ', 2) + '  ', 2))))
    and then return the string '' + @strRefID + '|' + @strLName + '|' + @strFName + '|' + @strZIPorPolType to @strTempString. 
    Please help me remove the syntax errors.
    Thanks in advance.

    Try below SQL
    DECLARE @strKeyMode varchar(20) = 'ISNAP'
    DECLARE @SQL VARCHAR(MAX)
    DECLARE @strRefID int=1
    DECLARE @strRetID INT=2
    --FIRST WAY
    IF @strKeyMode ='AUTO/CYCLE'
    SELECT CAST(@strRefID as varchar(10))
    ELSE IF @strKeyMode ='CYCLE'
    SELECT @sql = CAST(@strRefID as varchar(10)) + '|' + CAST(@strRetID as varchar(10))
    ELSE IF @strKeyMode='ISNAP'
    SELECT @sql = CAST(@strRefID as varchar(10)) + '|' + CAST(@strRetID as varchar(10))+'test'+'abc'
    ELSE
    SELECT @SQL='ABC'
    print @sql
    ----SECOND WAY
    SELECT @SQL = CASE @strKeyMode
    WHEN 'AUTO/CYCLE' THEN CAST(@strRefID as varchar(10))
    WHEN 'CYCLE' THEN CAST(@strRefID as varchar(10)) + '|' + CAST(@strRetID as varchar(10))
    WHEN 'ISNAP' THEN CAST(@strRefID as varchar(10)) + '|' + CAST(@strRetID as varchar(10))+'test'+'abc'
    ELSE 'No Record'
    END
    PRINT (@SQL)
    --Prashanth

  • How to use multiple classes for each form

    Hi,
    I have created two forms using screen painter and now i want to use different classes for these two forms .
    I have declared the Sbo Connection in main class i.e. Set Application ,Connection Context() but while connecting to other classes
    for executing the code for that form SAP is not connected to that class.How to use multiple classes functionality i don't able to
    do that.Please provide some sample codes for that as it will be more helpful for me to understand.
    Thanks & Regards,
    Amit

    Hi Amit,
    In fact, its more advisable to use separate classes for every form that you use.  Have one common class, say, for eg., clsMain.cs which has all the connection and connectivity to other classes, wherein, the menu event and item event of this main class, will just be calling the menu / item event of other classes.
    The individual functionality of the child classes will be called from the item / menu event of the respective classes.
    Item event in clsMain.cs will be as below.
    private void oApplication_ItemEvent(string FormUID, ref SAPbouiCOM.ItemEvent pVal, out bool BubbleEvent)
                SAPbouiCOM.Form oForm;
                BubbleEvent = true;
                try
                    if ((pVal.FormTypeEx == "My_Form1Type") && (pVal.EventType != SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD))
                        oForm = oApplication.Forms.GetForm("My_FormType", pVal.FormTypeCount);
                        NameSpace.Repots.ClsForm1.ClsForm1_ItemEvent(oApplication, oCompany, oForm, ref pVal, ref BubbleEvent);
                    if ((pVal.FormTypeEx == "My_Form2Type") && (pVal.EventType != SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD))
                        oForm = oApplication.Forms.GetForm("My_FormType", pVal.FormTypeCount);
                        NameSpace.Repots.ClsForm1.ClsForm2_ItemEvent(oApplication, oCompany, oForm, ref pVal, ref BubbleEvent);
    Now, in the individual classes, you can have their respective item events, which will be called from the main class, and the respective functionalities will occur.
    Hope this helps.
    Regards,
    Satish.

  • ...how to use BATCHMAN transaction in Controlling?

    ...how to use BATCHMAN transaction in Controlling?...
    need to upload statistical keyfigure values from an Excel file, but do not know which should be the header row on Excel file.
    thank you.

    To access the Transfer of External Data function (transaction BATCHMAN), choose:
    Accounting ® Real Estate Management ® Controlling ® Actual Postings ® Transfer of External Data.
    For further information please check the following link:
    http://help.sap.com/saphelp_erp2005/helpdata/en/32/e7ee431feb6d45957a83e0179cbbff/frameset.htm
    regards,
    Lily

  • I Don't know how to use SBO Transaction Notification  procedure

    Hi all
    I don't know how to use SBO Transaction Notification  procedure
    can any body give me description why we use,where we use,how we use some example
    Awaiting soon reply
    Rajkumar G.

    example is for testing, if on delivery is filled ref no of vendor or not
    if @object_type = '20'  and (@transaction_type= 'A' or @transaction_type= 'U')
    begin
         if 1 = (select count(docentry) from opdn with(nolock) where docentry =@list_of_cols_val_tab_del and (numatcard is null or len(numatcard) = 0) )
         begin
              select @error =1
              select @error_message = 'vendor ref no isnt filled'
         end
    end
    next example is for creating BP as vendor and testing, if dont begin for specific sign
    if @object_type = '2' and @transaction_type= 'A'
    begin
    if left(@list_of_cols_val_tab_del, 1) = N'x' or left(@list_of_cols_val_tab_del, 1) = N'X'
         begin
              if 1 = (select count(cardcode) from ocrd where cardcode = @list_of_cols_val_tab_del and cardtype in ('S', N'S') )
                   begin
         select @error =1
              select @error_message = 'Vendor code cannot begin to X sign.'
    end
         end
    end
    is it clear?

Maybe you are looking for

  • Private inner class and static private inner

    Hi, I understand the concept and usage of inner classes in general. When should we go for a private inner class and when for a static private inner class? I tried searching but it wasn't of much help. Basically I need to design a caching solution in

  • How to make object appear in all slides?

    I'd like to place a logo in the top right of a slide and have it appear in all slides.  If I adjust the logo in one slide, it will adjust the same in all slides. Any ideas how to accomplish that?

  • Microsoft Office Crashing on Clients

    After upgrading to Leopard Server my clients can not run Microsoft Office. I can run it as local admin, but when I log in the client on the same machine it crashes. Is there a setting or permission I need to give my clients in WGM to make it work?

  • Coherence and Multicast Issues

    We are using Coherence 3.7.1 as a part of EAR application. These are deployed on WL Servers using multicast. We have observed if multicast is disabled on a node while deployment but enabled later, id does not joins the cluster,  A redeployment is req

  • List DC OS Versions and Roles in a Forest.

    Hi Guys I need to get info on all DC's in my forest, like OS version, Role, OU, What domain it resides in etc. DSquery does not give me all the info, neither does ADUC, neither does Hyena, and powershell is not sufficient it ignores 2003 DC's. ADUC h