Getting error in calling two different Bapi

Hi ALL ,
I want to create web-dynpro application
Requirement : Main View contain one tabstrip 'T' which will display data from all the values.
I am using one search Button 'B'and passing one number 777
For example :for search number 777 record should come like this
Search -- 777 -ITC NUMBER --Input filed
For Payment & Transfer view I am calling BAPI 'A'.
Loan Transfer I am calling Bapi 'B'.
Desired Output :
A            A                     B
payment    transfer          laontransfer
cash        JRM account        open
cheque     CTC Employee        closed
For this I am using following Views
1)Main View  2) Payment 3) Transfer 4)Loan Transfer
Error : I am not getting any records in field 'Loan Transfer ' which I am calling from Bapi 'B'.
Can anyone please help me out ??
Like this :
A            A                      B
payment    transfer          laontransfer
cash        JRM account       
cheque     CTC Employee

Hi ,
Can anyone please let me know the approach of calling different BAPI s
in web dynpro application.
Requirement : I want to connect Input from both the Bapi to single element.
Regards
Rahul

Similar Messages

  • Unable to update or restore new iPad Mini 2.  Get error 3014 on two different Macs.

    Unable to update or restore new iPad Mini 2.  Get error 3014 on two different Macs.  This is a new out of the box iPad Mini 2. Am on a managed network, but have not had this problem previously.

    First thing to do is make sure you have the latest version of iTunes on your computer.
    This Apple support page will provide more information:
    Error 3194, Error 17, or "This device isn't eligible for the requested build" - Apple Support

  • Getting error while calling two BAPIs

    Dear ABAPers,
    I'm stuck into a problem.
    I have a situation where I'm using BAPI, WS_DELIVERY_UPDATE to update a delivery.
    Then after this I have post a GR so for that I'm using BAPI_GOODSMVT_CREATE.
    Now my problem is when I'm calling BAPI_GOODSMVT_CREATE it gives me an error
    "CODE is not supported by BAPI2017_GOODSMVT_CREATE". I check my code thoroughly, but didn't find anything in that
    which was wrong.
    Again, if I try to do the same, in debugging mode, its processes me in the way it should, without any error.
    Also, If I use a hard coded DELAY of 2 mins, in my program after WS_DELIVERY_UPDATE, it again processes perfectly.
    Now I've put COMMIT AND WAIT and FM DEQUEUE_ALL after WS_DELIVERY_UPDATE, but still not working, and this I'm getting
    error from BAPI_GOODSMVT_CREATE - "No Items Transfered".
    Please help me sort this issue.
    Regards,
    Varun

    Hi varunchopra,
    the SAP documentation is not 100 % clear here: They say, with COMMIT WORK all high-priority ("VB1") update function modules are executed in the order of their registration and in a shared database LUW.  With WAIT addition, the calling program will continue after the update work process has executed the VB1 function modules.
    Probably BAPI_WS_DELIVERY_UPDATE will also trigger one or more VB2 update functions that will keep the objects locked.
    Ten years ago we used this code in a similar situation to wait for the update task for a material being changed:
    FORM WAIT_UPDATE.
      USING P_MAX_WAIT_SECONDS TYPE I
      CHANGING P_SUBRC LIKE SY-SUBRC.
      DATA:
      L_ENDTIME LIKE SY-UZEIT,
      L_TABIX LIKE SY-TABIX,
      L_TRIES TYPE I,
      L_SUCCESS LIKE SY-SUBRC,
      L_ANSW TYPE C,
      L_TRY_AGAIN LIKE RMCLS-XFLAG VALUE 'X'.
      GET TIME.
      L_ENDTIME = SY-UZEIT.
      ADD P_MAX_WAIT_SECONDS TO L_ENDTIME.
      WHILE L_TRY_AGAIN = 'X'.
        LOOP AT ITAB.
          PERFORM CHECK_LOCK_EMMARCE
            USING ZAUF-WERKS ITAB-MATNR CHANGING P_SUBRC.
          GET TIME.
          IF P_SUBRC <> 0 OR SY-UZEIT >= L_ENDTIME.
            EXIT.                          "Loop
          ENDIF.                           " sy-subrc = 0.
        ENDLOOP.                           " AT itab.
        IF P_SUBRC = 0.
          CLEAR: L_TRY_AGAIN.
        ELSE.
          IF SY-UZEIT >= L_ENDTIME .
            PERFORM POPUP_TO_CONFIRM_WAIT
              USING P_MAX_WAIT_SECONDS CHANGING L_ENDTIME P_SUBRC.
            IF P_SUBRC <> 0.
              CLEAR L_TRY_AGAIN.
            ELSE.
              CLEAR P_SUBRC.
            ENDIF.                         " p_subrc <> 0.
          ENDIF.                           " sy-uzeit >= l_endtime.
        ENDIF.                             " p_subrc = 0.
      ENDWHILE.                            " l_try_again = 'X'.
    ENDFORM.                               " WAIT_UPDATE
    The coding of CHECK_LOCK_EMMARCE was derived from SM12 lock overview and used FUNCTION 'ENQUE_READ'. Today I would just try to lock the object with ENQUEUE function - if you get foreign lock error, the updatze task lock is not yet released.
    Monitor SM12 during test run to identify which lock object  must be checked.
    The you have to decide: If you put a WAIT UP TO 1 SECONDS in the wait loop, you may lose up to 1 second per delivery. If you just LOOP until the locks are released you may put some non-necessary load on the machine.
    This way will be faster than any unconditional wait - which may sometimes not be long enough.
    Regards,
    Clemens

  • How to call two different servlet-url in the same application

    Hi,
    I want to call, consecutively these methods in my application.
    response.sendRedirect(servlet-url1)
    reponse.sendRedirect(servlet-url2)
    but the second method dont answer,
    I think, the first method redirect s with response ,
    but how to call two different servlet ?
    thanks

    if you call the first redirect, the servlet is getting aborted, so you can redirect to the first servlet, working the stuff in it, and then in the second servlet you can redirect to the third servlet

  • Use two different Bapis into one interactive form

    Hello. I'm creating a form in which I need the result from two different bapis, but the interactive form element in the layout of the view allows me only one data source node.
    The form i want to create is one in which appears some data from one employee (so I use BAPI_EMPLOYEE_GETDATA). The problem is that I also want to show the qualifications shown as result of the BAPI_QUALIFIC_GETLIST bapi. Those qualifications should correspond to the employee.
    I have one solution in my mind. That one is: I could create a node containing the structure with all the elements I need from the two bapis. Then I could copy there the results from the context nodes that are mapped to the bapis.
    I believe this is a common situation. Not only to my specific example but to many other forms.So, I think there should be a way to do it without programming it myself. Or perhaps a better solution than mine. My worry comes to my mind because all the facilities Web Dynpro and LifeCycle offer to create interactive forms and common web applications.
    Thanks to anyone with some answers.}
    Of course, I'll reward for them!

    Hello Alejandro Monteverde,
    There is one and only one data sink for an interactive form and that is the data source node for you. There is no possibility that we can define a second or third datasource node for our application. Having the above statement in mind, the only way we can fulfill our requirement is to have a common parent node as the datasource node which in turn may have any number of nodes (in your case you would probabaly think of segregating the results from two BAPIs to map to two different nodes). A third node can be added tomorrow if you need so.
    The solution that you have mentioned will also work equally good. In your approach you will have all the related information will be contained within one node. Fair enough.
    Its a matter of how do you want to best represent your data structure.
    Thanking you,
    Krishanu

  • Getting error while calling this BAPI:Field MATNR has been transferred inco

    Hi,
    I have a rquirement to upload material master data into sap for Plant 1251.(For plant 1251 we need to upload both Basi veiw and Extended View).
    I am getting the following error while calling this BAPI.Field MATNR has been transferred inconsistently or is blank
    the errror is :Field MATNR has been transferred inconsistently or is blank.
    I have written the below logic in the program to upload material master data into SAP.
    Please help me out to resolve this issue.
    Thanks in advance.
    Program logic which i have wriiten in the program is
    LOOP AT it_rpt.
        CLEAR lwa_return.
        v_tabix  = sy-tabix.
        IF ( it_rpt-werks EQ p_werks AND
           it_rpt-matnr IS INITIAL ).
    retrieve internal number
          PERFORM get_internal_number USING lc_mtart
                                            lc_mbrsh
                                   CHANGING it_rpt-matnr.
        ENDIF.
        IF NOT it_rpt-matnr IS INITIAL.
          PERFORM convert_field_input CHANGING it_rpt-matnr.
        ENDIF.
    Header data
        CLEAR lwa_headdata.
        lwa_headdata-material                = it_rpt-matnr.
        lwa_headdata-ind_sector              = lc_mbrsh.
        lwa_headdata-matl_type               = lc_mtart.
        lwa_headdata-basic_view              = 'X'.
        IF NOT it_rpt-vkorg IS INITIAL.
          lwa_headdata-sales_view            = 'X'.
        ENDIF.
        lwa_headdata-purchase_view           = 'X'.
        lwa_headdata-mrp_view                = 'X'.
        lwa_headdata-storage_view            = 'X'.
        lwa_headdata-forecast_view           = 'X'.
        lwa_headdata-work_sched_view         = 'X'.
        lwa_headdata-account_view            = 'X'.
        lwa_headdata-cost_view               = 'X'.
    *Client data
        CLEAR: lwa_clientdata, lwa_clientdatax.
        IF it_rpt-werks EQ c_1251.
          lwa_clientdata-matl_group          = it_rpt-matkl.
          lwa_clientdata-old_mat_no          = it_rpt-bismt.
          lwa_clientdata-base_uom            = it_rpt-meins.
          lwa_clientdata-manu_mat            = it_rpt-mfrpn.
          lwa_clientdata-mfr_no              = it_rpt-mfrnr.
        ENDIF.
        lwa_clientdata-division              = it_rpt-spart.
        lwa_clientdata-unit_of_wt            = lc_gewei.
        lwa_clientdata-trans_grp             = lc_tragr.
        IF it_rpt-werks EQ c_1251.
          lwa_clientdatax-matl_group         = 'X'.
          lwa_clientdatax-old_mat_no         = 'X'.
          lwa_clientdatax-base_uom           = 'X'.
          lwa_clientdatax-manu_mat           = 'X'.
          lwa_clientdatax-mfr_no             = 'X'.
        ENDIF.
        lwa_clientdatax-unit_of_wt           = 'X'.
        lwa_clientdatax-trans_grp            = 'X'.
        lwa_clientdatax-division             = 'X'.
    Material Description
        IF it_rpt-werks EQ c_1251.
          lt_matdesc-langu           = sy-langu.
          lt_matdesc-matl_desc       = it_rpt-maktx.
          APPEND lt_matdesc.
        ENDIF.
    *Plant data
        CLEAR lwa_plantdata.
        lwa_plantdata-plant                  = it_rpt-werks.
        lwa_plantdata-availcheck             = lc_mtvfp.
        lwa_plantdata-mrp_type               = lc_dismm.
        lwa_plantdata-mrp_group              = lc_disgr.
        lwa_plantdata-auto_p_ord             = 'X'.
        lwa_plantdata-proc_type              = 'F'.
        IF it_rpt-werks EQ c_1251.
          it_rpt-prctr  = lc_prctr.                 "1252
        ELSEIF it_rpt-werks EQ c_1261.
          it_rpt-prctr  = lc_prctr1.                "1262
        ENDIF.
        lwa_plantdata-profit_ctr             = it_rpt-prctr.
        lwa_plantdata-period_ind             = lc_perkz.
        lwa_plantdata-max_stock              = it_rpt-stawn.
        lwa_plantdata-countryori             = it_rpt-herkl.
        lwa_plantdata-sloc_exprc             = it_rpt-lgfsb.
        CLEAR lwa_plantdatax.
        lwa_plantdatax-plant                 = it_rpt-werks.
        lwa_plantdatax-availcheck            = 'X'.
        lwa_plantdatax-mrp_type              = 'X'.
        lwa_plantdatax-mrp_group             = 'X'.
        lwa_plantdatax-auto_p_ord            = 'X'.
        lwa_plantdatax-proc_type             = 'X'.
        lwa_plantdatax-profit_ctr            = 'X'.
        lwa_plantdata-period_ind             = 'X'.
        lwa_plantdatax-max_stock             = 'X'.
        lwa_plantdatax-countryori            = 'X'.
        lwa_plantdatax-sloc_exprc            = 'X'.
    *Valuation data
        CLEAR lwa_valuationdata.
        lwa_valuationdata-val_area           = it_rpt-werks.
        lwa_valuationdata-price_ctrl         = lc_vprsv.
        lwa_valuationdata-price_unit         = lc_peinh.
        lwa_valuationdata-val_class          = it_rpt-bklas.
        CLEAR lwa_valuationdatax.
        lwa_valuationdatax-val_area          = it_rpt-werks.
        lwa_valuationdatax-price_ctrl        = 'X'.
        lwa_valuationdatax-price_unit        = 'X'.
        lwa_valuationdatax-val_class         = 'X'.
    *Storage location
        CLEAR lwa_storagelocation.
        lwa_storagelocation-plant            = it_rpt-werks.
        lwa_storagelocation-stge_loc         = it_rpt-lgort.
        CLEAR lwa_storagelocationx.
        lwa_storagelocationx-plant           = it_rpt-werks.
        lwa_storagelocationx-stge_loc        = it_rpt-lgort.
    *Tax Classifications
        IF it_rpt-werks EQ c_1251.
          it_rpt-tatyp = lc_tatyp.       "u2018MWSTu2019
        ELSEIF it_rpt-werks EQ c_1261.
          it_rpt-tatyp = lc_tatyp1.      "u2018UTXJu2019
        ENDIF.
        lt_taxclass-tax_type_1              = it_rpt-tatyp.
        lt_taxclass-taxclass_1              = lc_taxkm.
        lt_taxclass-tax_ind                 = lc_taxim.
        APPEND lt_taxclass.
    *Sales data
        CLEAR: lwa_salesdata, lwa_salesdatax.
        IF it_rpt-werks EQ c_1251.
          it_rpt-vkorg = lc_vkorg.
        ELSEIF it_rpt-werks EQ c_1261.
          it_rpt-vkorg = lc_vkorg1.
        ENDIF.
        lwa_salesdata-sales_org           = it_rpt-vkorg.
        lwa_salesdata-distr_chan          = lc_vtweg.
        lwa_salesdata-cash_disc           = lc_sktof.
        lwa_salesdata-item_cat            = lc_mtpos.
        lwa_salesdatax-sales_org          = it_rpt-vkorg.
        lwa_salesdatax-distr_chan         = lc_vtweg.
        lwa_salesdatax-cash_disc          = 'X'.
        lwa_salesdatax-item_cat           = 'X'.
    *Forecast parameters
        CLEAR: lwa_forecast, lwa_forecastx.
        lwa_forecast-plant                = it_rpt-werks.
        lwa_forecast-fore_model           = lc_prmod.
        lwa_forecast-fore_pds             = lc_anzpr.
        lwa_forecast-hist_vals            = lc_peran.
        lwa_forecastx-plant               = it_rpt-werks.
        lwa_forecastx-fore_model          = 'X'.
        lwa_forecastx-fore_pds            = 'X'.
        lwa_forecastx-hist_vals           = 'X'.
    Purchasing long text
        IF it_rpt-werks EQ c_1251.
          IF it_rpt-tdline1 <> ' '.
            lv_tdobject = 'MATERIAL'.
            lv_tdid     = 'BEST'.
            lv_tdname   =  it_rpt-matnr.
            PERFORM fill_longtext TABLES lt_longtext
                                  USING  lv_tdobject
                                         lv_tdname
                                         lv_tdid
                                         sy-langu
                                         it_rpt-tdline1.
          ENDIF.
    Basic long text
          IF it_rpt-tdline2 <> ' '.
            lv_tdobject = 'MATERIAL'.
            lv_tdid     = 'GRUN'.
            lv_tdname   =  it_rpt-matnr.
            PERFORM fill_longtext TABLES lt_longtext
                                  USING  lv_tdobject
                                         lv_tdname
                                         lv_tdid
                                         sy-langu
                                         it_rpt-tdline2.
          ENDIF.
    *Units of measure
          CLEAR : lt_uom,lt_uomx.
          lt_uom-alt_unit     = it_rpt-meins.
          lt_uom-alt_unit_iso = it_rpt-meins.
          lt_uom-unit_of_wt   = it_rpt-gewei.
          APPEND lt_uom.
          lt_uomx-alt_unit      = it_rpt-meins.
          lt_uomx-alt_unit_iso  = it_rpt-meins.
          lt_uomx-unit_of_wt    = 'X'.
          APPEND lt_uomx.
        ENDIF.
        CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
          EXPORTING
            headdata             = lwa_headdata
            clientdata           = lwa_clientdata
            clientdatax          = lwa_clientdatax
            plantdata            = lwa_plantdata
            plantdatax           = lwa_plantdatax
            forecastparameters   = lwa_forecast
            forecastparametersx  = lwa_forecastx
            storagelocationdata  = lwa_storagelocation
            storagelocationdatax = lwa_storagelocationx
            valuationdata        = lwa_valuationdata
            valuationdatax       = lwa_valuationdatax
            salesdata            = lwa_salesdata
            salesdatax           = lwa_salesdatax
          IMPORTING
            return               = lwa_return
          TABLES
            materialdescription  = lt_matdesc
            unitsofmeasure       = lt_uom
            unitsofmeasurex      = lt_uomx
            materiallongtext     = lt_longtext
            taxclassifications   = lt_taxclass
            returnmessages       = it_messages.
    Regards,
    Reddy

    Can you check with below code .
    CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
            EXPORTING
              INPUT        =  it_rpt-matnr       
    IMPORTING
              OUTPUT       =  it_rpt-matnr
            EXCEPTIONS
              LENGTH_ERROR = 1
              OTHERS       = 2.
          IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    Move  it_rpt-matnr to    lwa_headdata-material  .
    Regard's
    Smruti

  • Getting error in call library node when establishing communication with MAX1452 on serial port using dll

    I want to communicate with MAX1452 in labview on PC serial port. Maxim provides dll file which has functions to communicate with device.It says first two functions should be findcom port and initialization sequence where findcom port returns PC's serial port address while initialization sequence helps device to learn baud rate.Iam not getting exception error in call library node.i have kept dll file in the same location as VI.

    Labview verison is 7.1 and os is win xp.
    The data types are according to the dll functions defined in functions definitions( attached previously).
    I'd put dll in the same directory where the code resides.
    Attachments:
    Code.vi ‏23 KB

  • Same error code for two different errors

    I have a simple state machine with a few states, two of which are read ini file and read GPIB data. I also have an error handling state where I would like to handle all errors. Errors are checked for on each iteration of the loop, passed by shift register. However, I can't just unbundle the error cluster and wire the error code to a case structure because if the ini file doesn't exist (error code 7) I want to exit the program. But if I get error 7 from the gpib (Nonexistent GPIB interface) I want the program to continue running. What is the best way to track where the error is coming from so I know how to handle it when two error codes for different errors have the same error code value?
    Message Edited by for(imstuck) on 01-27-2010 03:47 PM
    CLA, LabVIEW Versions 2010-2013

    Another option is to check the existence of the file before opening the config file, then exit the program if nessecary. Relying on error codes might be a bad option.
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Getting error while calling ejb business methods from servlet

    Hi
    Iam getting error when i try to call a ejb method from servlet.Error is
    "com.netscape.server.eb.UncheckedException: unchecked exception nested exception is:java.lang.NullPointerException".
    I build the application and deployed it successfully.Iam using IAS 6.O with windows NT 4.0.
    This is just a method which takes values from database and return as an array of bean to servlet.
    Any help on this.Thanks Shank

    Hi
    I was using the session bean.Your suggestion helped me a lot.Perfect.
    I debug my program and found that from ejbCreate()exception is getting.
    I was getting the datasource object thro ejb create() initialisation.
    Somehow the look up jndi which i mentioned was not interpretting from ejb-jar.xml ias-ejb-jar.xml and datasource ref .Due to this iam getting jndi Namenotfound exception which in turns to null pointer as datasource is getting null.
    when i hardcoded in the ejb the the jndi name for datasource it is working fine.Bit worried all the existing ejbs working with the xml referenced datasource and jndi,but when i added a new ejb with same properties it is failing to get the jndi name.
    Piece of code from ias-ejb-jar.xml
    <resource-ref>
              <res-ref-name>myDataSource</res-ref-name>
              <jndi-name>jdbc/nb/myData</jndi-name>
    </resource-ref>
    Piece of code from ejb-jar.xml
    <resource-ref>
              <res-ref-name>myDataSource</res-ref-name>
              <res-type>javax.sql.DataSource</res-type>
              <res-auth>Container</res-auth>
    </resource-ref>
    Thanks a lot meka

  • Getting error while calling Web service in PB 12.5

    Hi All,
    I am trying to call web service through my PB 12.5 but getting error like "Window sdk for .net framework 4.0 was not installed. please install befor use this feature." though I had installed window sdk . net framework 4.0.
    one more thing do we required .wsdl file to call web service or only path is ok?
    please help me out here.
    Thanks,
    Pralhad

    Hi Pralhad,
    From the Application Techniques manual, Building a Web Services Client, it states the following:
    The WSDL file for you specify in the wizard or painter must have:
    Services/Binding entries
    The Targetnamespace
    attribute defined in its Schema element
    No circular references (an example of a “circular reference” is a structure
    that includes itself as a child class member)
    If PowerBuilder encounters a problem parsing the WSDL file, it reports the
    error in an error message box.
    Thank you.
    Beverly Duquette

  • Getting error while calling reports through form

    Hi I want to call a report from a form i put the following code on when-button-pressed but i am getting the following error.I can generate and run the reports.The object REPORTS is created under forms report object
    FRM-41211: Integration error: SSL Failure running another report
    DECLARE
    repid REPORT_OBJECT;
    report_prop VARCHAR2(20);
    v_rep VARCHAR2(100);
    BEGIN
    repid := find_report_object('REPORTS');
    set_report_object_property(repid,report_other,'p1=15 p2=19 paramform=yes');
    v_rep := RUN_REPORT_OBJECT(repid);
    END;
    rgds
    shyam

    Hi
    I can able to run the reports from the browser there was a syntax error, but not able to call from a form
    I am getting error but i can run another forms without any problem
    FRM-92101: There Was a failure in the FormsServer during startup
    oracle.forms.net.connectionexception:forms session aborted:unable to communicate with the runtime process
    rgds
    rosh

  • Getting Error Page after two VO substitution - urgent, please help

    Hi All,
    I substituted two VOs in the CWB Allocation page. Did everything (I think) according to Oracle doc, but when trying to open that page I am getting ERROR PAGE and 'You have encountered an unexpected error. Please contact the System Administrator for assistance. '
    Please, help. I understand it is something fundamentally wrong, but it does not give me any error messages to even start working on.
    Thanks a lot.
    SR

    Hi Arvind,
    I have turned Diagnostics to Yes on my user level, but I am getting the same:
    Error Page
    You have encountered an unexpected error. Please contact the System Administrator for assistance.
    And there is no link on this page except the Logout link, which, of course, just logs me out of apps.

  • Getting DISTINCT count from two different columns

    Hi all,
    I have following query which gives currency code from two different tables. I would like to get the distinct count of currency codes from these two different columns.
    SELECT eb.person_seq_id, eb.bonus_amount, eb.currency_cd, ed.currency_cd_host
    FROM fr_emp_bonuses eb, fr_emp_details ed, fr_periods p
    WHERE eb.person_seq_id = ed.person_seq_id AND ed.period_seq_id = eb.period_seq_id
    AND ed.period_seq_id = p.period_seq_id AND p.period_status = 'CURRENT'
    AND eb.bonus_amount >= 0 AND eb.person_seq_id = 3525125;
    This query gives following result
    3525125     240000     USD     INR
    3525125     0      USD     INR
    3525125     60000      USD     INR
    3525125     50000      USD     INR
    There are two distinct currency codes (USD, INR) and total amount is 350000. So I am looking for a query to give me the following result
    3525125     350000 2
    Thanks in advance

    Hi,
    Here's one way:
    WITH     original_query     AS
         SELECT  eb.person_seq_id
         ,     eb.bonus_amount
         ,     eb.currency_cd
         ,     ed.currency_cd_host
         FROM     fr_emp_bonuses         eb
         ,     fr_emp_details          ed
         ,     fr_periods          p
         WHERE      eb.person_seq_id    = ed.person_seq_id
         AND      ed.period_seq_id    = eb.period_seq_id
         AND      ed.period_seq_id    = p.period_seq_id
         AND      p.period_status         = 'CURRENT'
         AND      eb.bonus_amount     >= 0
         AND     eb.person_seq_id    = 3525125
    ,     unpivoted_data     AS
         SELECT     person_seq_id
         ,     bonus_amount
         ,     currency_cd
         FROM     original_query
        UNION ALL
            SELECT  person_seq_id
         ,     0               AS bonus_amount
         ,     currency_cd_host     AS currency_cd
         FROM     original_query
    SELECT       person_seq_id
    ,       SUM (bonus_amount)          AS total_bonus_amount
    ,       COUNT (DISTINCT currency_cd)     AS distinct_currency_cds
    FROM       unpivoted_data
    GROUP BY  person_seq_id
    ;There may be a shorter, more efficient way to get the same results, but without knowing more about your tables, I can't tell.
    The tricky thing is getting two columns (currency_cd and currencuy_cd_host in this case) counted together. You can't simply say
    COUNT (DISTINCT eb.currency_cd) +
    COUNT (DISTINCT ed.currency_code_host)That happens to get the correct result with the sample data you posted, but what if you had data like thEe following?
    currency_cd     currency_cd_host
    INR          USD
    USD          INRHere, the count of distinct currency_cds is 2, and the count of distinct currency_cd_hsots is also 2. Does that mean the grand total is 2 + 2 = 4? No, the 2 codes in one column arte the same 2 codes as in the other column. We need to get both currency_cd and currency_cd_hsot into the same column, and then do COUNT (DISTINCT ...) on that combined column. A UNION, as shown above, will certainly do that, starting with your query as you posted it. The query you posted isn't necessarily the best frist step towards this result, however, so there may be a much better approach, depending on your tables.
    Edited by: Frank Kulash on Feb 1, 2012 6:21 PM
    Here's a slightly shorter, and probably more efficient way to get the same results:
    WITH     cntr     AS
         SELECT     LEVEL     AS n
         FROM     dual
         CONNECT BY     LEVEL     <= 2
    SELECT       eb.person_seq_id
    ,       SUM (eb.bonus_amount)          AS total-amount
    ,       COUNT ( DISTINCT CASE
                        WHEN  c.n = 1
                        THEN  eb.currency_cd
                        ELSE  ed.currency_cd_host
                      END
              )               AS distinct_currency_cds
    FROM       fr_emp_bonuses    eb
    ,       fr_emp_details    ed
    ,       fr_periods          p
    ,       cntr              c
    WHERE        eb.person_seq_id  = ed.person_seq_id
    AND        ed.period_seq_id  = eb.period_seq_id
    AND        ed.period_seq_id  = p.period_seq_id
    AND        p.period_status   = 'CURRENT'
    AND        eb.bonus_amount   >= 0
    AND       eb.person_seq_i   = 3525125
    --       NOTE: no join condition involving c; we really do want a cross-join
    GROUP BY  eb.person_seq_id
    ;

  • Getting error  while calling triggering event in processFormRequest

    hi all,
    i am clicking my custom button after selecting value from a lov on create quote and getting error "Row 1 Error - Please note that following required fields have not been entered: CustPartyId "
    if 1st i m entering a value in DFF filed and then selecting value from lov and cliking my custom button this error is not coming.
    please help.
    thanks

    hi all,
    i am clicking my custom button after selecting value from a lov on create quote and getting error "Row 1 Error - Please note that following required fields have not been entered: CustPartyId "
    if 1st i m entering a value in DFF filed and then selecting value from lov and cliking my custom button this error is not coming.
    please help.
    thanks

  • Calling two different layouts in  a script

    Hi all,
            I have one requirement. I have created a form for Medruck and assigned it in nace tcode for purchase order.  My requirement is if version number is ' 0 ' one page should be called and if version number is not zero another page layout should be called. I have created 2 different page layouts in my SAP Script i.e. one page named first layout and second named other layout. if version number is 0 first layout should be called and version number ne 0 other layout page should be called. Is it possible to do it?  if so, how shall i do this... 
    Kindly help me...
    Thanks and regards,
    subbu.

    Hi,
    Can you tell us for what is version concept for.For which program we have to check the version .
    For example see the below scenario.
    -> we have to call the different pages for different company codes . Do as follows.
    sort itab by bukrs.
    call function 'OPEN_FORM'.
    loop at itab.
    at new bukrs .
      if itab-bukrs = '01'.
         call function 'START_FORM'.
          expoting
                page = 'FIRST'.
      else.
         call function 'START_FORM'.
          expoting
                page = 'SECOND'.
      endif.
    endat.
          call function 'WRITE_FORM'.
    AT END of bukrs.
          call function 'END_FORM'.
    endat.
    Endloop.
       call function 'CLOSE_FORM'.
    Thanks,
    NN.

Maybe you are looking for

  • Open Dataset - File Creation with [] as delimiter

    All, I need to create a file in the App Server with each field needs to separated with a Square Symbol  ( I don't have any info what is this Square Symbol ) and also i cannot able to recreate the same that over here. But i can see that in notepad and

  • Microsoft office:Mac

    I've tried to install student-teacher edition to my daughter's G4 iBook. When I complete the installation and attempt to use one of the applications I get a message that says 'This software is an upgrade to an earlier version of the software.' I've a

  • How to install ssd in iMac9,1

    I see that OWC and other vendors offer solid state drives for my iMac, but they don't explain or show how to install this device.  Does it replace my internal hard drive or work with it somehow?  I am interested in speeding up my computer's performan

  • IPod touch 4t generation,white,8gb.... Cracked. NEEDS to be fixed. But cheap not $100

    I NEED it fixed ASAP.... Cannot be cracked

  • Repeating Audio Button with Slide Persist

    I'm creating a pictionary for Native American lanquages designed for childen. I need to create slides with an image, an audio button that will repeat the audio on multiple clicks and, lastly, file navigation buttons. How do I get the button to repeat