Check condition on remote table fields

Hi guys,
and good morning all
Oracle table is defined:
CREATE TABLE KUPCI
POZIVNI        VARCHAR2(3 BYTE),
MSISDN         VARCHAR2(6 BYTE),
I need to check some field on oracle table. I want to do this as part of my abap include code:
IF itab-dat = <oracle_table_field1> or itab-tel = <oracle_table_field2>.
    ACTION 1.
else.
   ACTION 2.
how to do this?
thanks,
nihad
Edited by: nihad omerbegovic on Apr 9, 2009 7:45 AM

Hello, will this program update oracle table KUPCI?
I want sap table zbt_kupci and oracle KUPCI to be updated on click of button PROVJERA.
Can u check this code please?
REPORT ZTEST2_SCREEN .
TABLES: ZBT_BONUS.
TYPES : BEGIN OF TY_ITAB,
KLIJENT TYPE mandt,
POZIVNI(3) TYPE C,
TELEFON(6) TYPE C,
IME(25) TYPE C,
PREZIME(35) TYPE C,
NOVI(1) TYPE C,
DATUM TYPE dats,
KORISNIK(12) TYPE C,
END OF TY_ITAB.
data: begin of itab_ora occurs 0,
      ID TYPE NUM,
      SIF(13),
      POZIVNI(3),
      MS(6),
      SER(20),
      ID2(13),
      IME(25),
      PREZIME(35),
      NAZ(160),
      AD(160),
      DAT(9),
      NOV(1),
      end of itab_ora.  "same structure like ora table
DATA : WA_ITAB TYPE TY_ITAB.
data : wk_answer.
data: begin of itab occurs 0,
        man(3) type c,
        poz(3) type c,
        tel(6) type c,
        name(25) type c,
        surname(35) type c,
        novi(1) type c,
        dat type dats,
        usnam(12) type c,
     end of itab.
CALL SCREEN 100.
*&      Module  USER_COMMAND_0100  INPUT
*       text
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
when 'PROVJERA' .
call function 'POPUP_TO_CONFIRM_STEP'
exporting
defaultoption = 'Y'
textline1 = 'Da li zelite snimiti podatke?'(004)
textline2 = 'Sigurni?'(005)
titel = 'PROVJERA PODATAKA'(006)
start_column = 25
start_row = 6
cancel_display = 'X'
importing
answer = wk_answer.
case wk_answer.
when 'J'.
wa_itab-KLIJENT = ZBT_BONUS-MANDT.
wa_itab-pozivni = ZBT_BONUS-POZIVNI.
wa_itab-telefon = ZBT_BONUS-TELEFON.
wa_itab-ime = ZBT_BONUS-IME.
wa_itab-prezime = ZBT_BONUS-PREZIME.
wa_itab-novi = ZBT_BONUS-NOVI_KORISNIK.
wa_itab-datum = ZBT_BONUS-DATUM.
wa_itab-korisnik = SY-UNAME.
EXEC SQL.
  CONNECT TO 'ORADB'
ENDEXEC.
EXEC SQL.
*PERFORMING app_tab.
  SELECT * FROM KUPCI INTO :ITAB_ORA
ENDEXEC.
  APPEND ITAB_ORA.
exec sql.
Read itab_ora where itab_ora-pozivni = wa_itab-pozivni and
itab_ora-ms = wa_itab-telefon.
if sy-subrc <> 0.
update KUPCI using wa_itab.
endexec.
INSERT INTO ZBT_BONUS VALUES WA_ITAB.
COMMIT WORK.
Thanks,
Nihad

Similar Messages

  • Check box in a table field

    Hi experts ,
    I have a requirement of having one of the table field as checkbox .when i kept it as checkbox it is not getting reflected in sm30 .i need to have a check box displayed in the field of the table in sm30 .

    Hey i too came across this problem and i guess changing Screen could be a troublesome task.
    Other option is:
    First Regenerate that particular table.
    TCODE: SE14 --> Enter table name --> Click on Activate and adjust database button.
    If it wont works then last option is:
    Delete the Table Maintenance generator for that particular table and again create it with same details, make sure you dont change anything while recreating it (even the screen number must be same).
    Open table in  (Change mode) --> Utilities --> Table maintenance generator --> Delete it and again create with same parameters.
    This will surely work,
    <REMOVED BY MODERATOR>
    Regards Pankaj.
    Edited by: Alvaro Tejada Galindo on Jun 12, 2008 7:31 PM

  • Choose From List Condition on Detail table field rather than Master table

    Dear All,
    I have a master detail udo having udts @master @detail
    I need to filter my cfl object on bases of field in @detail table.
    Can you tell how do I do this.

         Try
                Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
                Dim oCons As SAPbouiCOM.Conditions
                Dim oCon As SAPbouiCOM.Condition
                oform = sbo_app.Forms.Item("formuid")
                oCFLs = oform.ChooseFromLists
                Dim oCFL As SAPbouiCOM.ChooseFromList
                Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
                oCFLCreationParams = sbo_app.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
                ' Adding 2 CFL, one for the button and one for the edit text.
                oCFLCreationParams.MultiSelection = False
                oCFLCreationParams.ObjectType = "yourobjectname"
                oCFLCreationParams.UniqueID = "CFL1"
                oCFL = oCFLs.Add(oCFLCreationParams)
                ' Adding Conditions to CFL1
                oCons = oCFL.GetConditions()
                oCon = oCons.Add()
            'here which field u want to filter
                oCon.Alias = "CardType"
         'here condition
                oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
                oCon.CondVal = "C"
                oCFL.SetConditions(oCons)
                ' oCFLCreationParams.UniqueID = "CFL2"
                'oCFL = oCFLs.Add(oCFLCreationParams)
            Catch
                MsgBox(Err.Description)
            End Try

  • Checking Condition

    Hi Experts,
      I am checking a condition in lfa1 table field lovem depending on the result X or not.  I need pass a value 1 or 0 to a field in output file structure in that i am passing all fields from one z table zvend along with one extra field to check flag 1 or 0. zvend table contains lifnr field as primary key means as a common field between lfa1 and zvend  
    Read table LFA1  where LIFNR = ZVENDPLT-LIFNR. If LFA1-LOEVM = 'X' send '1' Else send '0' to DELETE_LOC field and dont pass lovem field.
    Plz need your help.
    Thanks
      Basu

    Hi,
    Do something like this..
    Loop at ZVENDPLT.
    Read table LFA1  where LIFNR = ZVENDPLT-LIFNR.
    If LFA1-LOEVM = 'X'.
    Move '1' to DELETE_LOC.
    else.
    move '0' to DELETE_LOC.
    endif.
    EndLoop.
    Regards,
    Sarvesh

  • How to find table / field where condition records are saved?

    Hi,
    We want Sales Order Rate ( Condition type ZR00 calculated with backward pricing ), as a column in a Z report.
    I am not able to find out the table / field where system saves condition records for this condition type. I can only see structure.
    Please help to trace down the field where this data is stored.
    Regards
    Trupti

    Hi Vishal,
    KNUM is the internal number under which system saves the conditions that apply to a Sales Order.
    So first to derive this KNUM from sales order we use Table VBAK
    AFter this we use this KNUM and the condition type in table KONV to get the value for that perticular condition type.
    Please check following.
    SE16> VBAK> enter any sales order in field VBELN and note down number in field KNUM.
    SE16 --> KONV --> enter this KNUM and the condition type --> you would receive condition record value for this condition type, for that sales order.
    KNUMH is a similar field in the table A503( in our case), but we also wanted link of the sales order to this record.
    Thanks for your help anyways!!
    points provided.

  • Read table and checking condition in PAI

    Hi,
    I have a requirement where I need to check and compare with (Custom table) Bankn with Partner Bank`s bankn.
    I have wrote a code in PAI like this.
    MODULE CHECK_BANKN INPUT.
       Data: l_bankn like (Custom table)-bankn.
       select bankn from (Custom Table) into l_bankn
           where recno = g_recno.
       IF NOT g_head-bankn IS INITIAL.
      Read table i_bvtyp with key bankn = i_bvtyp-bankn .
         IF l_bankn <> i_bvtyp-bankn.--------->" Comparison of (custom table) Bankn with internal table I_BVTYP-BANKN
           MESSAGE w022 WITH text-w06.
         ENDIF.
       ENDIF.
    ENDMODULE.
    My Read Table statement is seems to be wrong and my checking condition is also wrong.
    So, how to resolve this?
    regards,
    Kiran

    Hi Kiran,
    If you observe your read statement, you are comparing the field with it's own table field.
       Read table i_bvtyp with key bankn = i_bvtyp-bankn .
    Untill unless you read I_BVTYP, i_bvtyp-bankn will be initial and you cannot find the matching record with Null-Value.
    So, I think you need compare with l_bankn.
       Read table i_bvtyp with key bankn = i_bankn .
    Then you can directly raise a message using SY-SUBRC value.
       Read table i_bvtyp with key bankn = i_bankn
          if SY-SUBRC <> 0 .
              <MESSAGE>    
         endif.
    Regards,
    Vijay

  • How to check which Table & Field is populating Data source

    Hi,
    My requirment is to check from which Table and Which field the data is extracted in the data source
    Data Source : 0MAT_PLANT_ATTR
    Field in Data Source :  MINBE
    Now i want to check from where (Table/Field) in R/3 is populating the Field MINBE in Data source 0MAT_PLANT_ATTR
    How can i do that

    Hi,
    Since you have the extract structure and the extractor, you can try Extractor Checker RSA3.Execute ST05 (activating SQL Trace), switch on the trace and execute the extractor checker. Once the extractor checker presents the results
    switch off trace. The clcik on Display trace and you will see all the tables that were hit by the extractor checker to retrieve data and present it to you.
    Note: Set the break point in the Extractor Function module.
    View the ST05 Extended Trace list. The Object name shows the Tables accessed.
    Hope this helps.
    Thanks,
    JituK

  • Checking the initiality of the fields while creating  entries for a table

    While creating entries using table maintenance generator(TMG) i need to check the initiality of the fields.Are there any such events?
    I know i can go and change in the screen by making it mandatory or by writing a module in the PAI of the screen of table maintenance generator. Both of cases i have to change the TMG which is generated by SAP system. I want to know is there a way to achieve this with out changing the TMG possible events?

    hi rahul,
    as far as i know, you have to do your initial valifdation in TMG and you have to change your TMG. However, if you have checked the initial flag while defining the field, you will not have initial value for that particular field.... (if the field is key field, by default it is not initial)
    hope this helps....
    thanks and regards,
    tanmaya

  • How to check two internal table fields

    Hi all,
    I need to check two internal table fields are equal or not means which statement i can use.
    Not internal table ,table contents i need to check i.e
    it1-pernr = it2-pernr.
    like this
    if i put loop it'll check one table field for one loop.
    if i put two loop means some fields reflecting 2 in it1 then it'll pring 4 times like that.i want to print whatever in internal table only .
    pernr(0001) two times there in it1 means
    it1-pernr = it2-pernr then
    it's printing
    0001
    0001
    0001
    0001
    like this but actually in it1 only two records.
    Anybody know solution.tell me.
    Thanks
    Regards,
    Nandha

    Hi,
    code for your view
    data : begin of it1 occurs 0,
           z_pernr like pa9012-pernr,
           z_fac_c like pa9012-zz_fac_c,
           end of it1.
    data : it2 like Zsc1 occurs 0 with header line,
    It1 data
    pernr   FAC C
    0001   5555
    0001   5555
    0002   4444
    0003   3333
    0006   8888
    It2 data
    pernr   FAC C
    0001   5555
    0001   5555
    0005   6666
    0003   3333
    output(My code)
    loop at it2 .
    loop at it1 where pernr = it2-pernr.
      write:/01 it1-1pernr,
            10 it1-z_fac_c.
    endloop.
    endloop.
    out put i need.
    0001   5555
    0001   5555
    0002   4444
    0003   3333
    Thanks,
    Nandha

  • What is table field name for order status report  of rate per unit and  bal

    hi  i want to make FS for order status report i almost get all table and field but i don't get only two field  rate per unit and balance value  table field didn't get please help me searching in field and table
      i want to develop my status report

    Hi,
    Check tables VBAK and VBAP wherein you will get all header and item details.
    VBUK and VBUP for header and line item statuses.
    KONV would give you rates/pricing details for each condition type determines in the sales order.
    VBAK-KNUMV = KONV-KNUMV is how you relate both of them.
    Hope that helps.
    Regards,
    Amit

  • Check condition on sub total line of ALV list

    Hi All ,
    Is it possible to check  condition on the value of subtotal line in ALV list ,
    I,e If the value of subtotal line is say greator than 100 I need to change the color of that line or change the text on the subtotal line .
    I know how to change the subtotal text but i want to change with respect to value of the subtotal ,
    Any input if this can be achieved will be great .
    Thanks in adv .
    Vinay
    Edited by: vinay kolla on Jul 29, 2009 4:43 AM

    Hi,
    I donu2019t think there is any direct way to check  the subtotal value in LIST display, try the following logic.
    1. Use the event BEFORE_LINE_OUTPUT to check the subtotal value and accordingly change the text or colour of the line.
    2. To use events in ALV, first get the events into a table through the FM REUSE_ALV_EVENTS_GET as shown
         CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
          EXPORTING
          i_list_type = 0
         IMPORTING
          et_events   = z_i_events.
      SORT z_i_events BY name.
      CLEAR z_wa_events.
      READ TABLE z_i_events WITH KEY name = slis_ev_before_line_output
                            INTO z_wa_events BINARY SEARCH.
      IF sy-subrc = 0.
        MOVE 'BEFORE_LINE_OUTPUTu2019 TO z_wa_events-form.
        MODIFY z_i_events FROM z_wa_events INDEX sy-tabix.
      ENDIF.
    3. Create a form with the name BEFORE_LINE_OUTPUT and do the coding to check the subtotals there.
    Form BEFORE_LINE_OUTPUT USING RS_LINEINFO TYPE SLIS_LINEINFO.
    *The structure RS_LINEINFO will have u2018Xu2019 in the field rs_lineinfo-subtot for subtotals.
    If RS_LINEINFO-SUBTOT = u2018Xu2019.
    *Here try to find the totals by looping at your final internal table till rs_lineinfo-tabindex.
    *Then based on this u can give the colour to the line.
    *I think there is no other way to check the subtotal value.
    Endif.
    Endform.
    Edited by: venkatesh PH on Jul 29, 2009 5:31 AM

  • How to update Ztable from Excel file and how to check conditions ,

    HI this uday,
    pls help me how can i update Ztable from Excel file and how to check conditions .
    regards
    uday
    Moderator message: please (re)search yourself before asking.
    Edited by: Thomas Zloch on Jul 13, 2010 12:00 PM

    Hi
    Use Fm : ALSM_EXCEL_TO_INTERNAL_TABLE.
    L_INTERN : internal table with your fields .
    make sure that the fields in the Excel should be formatted (as numeric , characher ) depending upon the data types .
    LOOP AT L_INTERN INTO WA_LINTERN .
            MOVE WA_LINTERN-COL TO L_INDEX.
            ASSIGN COMPONENT  L_INDEX OF STRUCTURE WA_INREC TO <FS> .
            IF SY-SUBRC = 0.
              MOVE WA_LINTERN-VALUE TO <FS>.
            ENDIF.
            AT END OF  ROW .                                    "#EC *
              APPEND WA_INREC TO IT_DATA.  "
              CLEAR WA_INREC.
            ENDAT.
         ENDLOOP.
    Regards
    Swapnil

  • Function Module for creating condition record (XKOMV table record)

    Hi,
    I have a requirement as like below,
    In the repair order i need to sum the GRWR condition type's  conditional values for all the line items (Except deliverable line item) and then i need to create an condition type GRWR under the deliverable line item with the above calculated conditional values,
    the table XKOMV will be having details about all the line item's condition types, in this table i need to add one more new record with the condition type of GRWR and the above calculated conditional values under the deliverable line item.
    for the above logic i am using the user exit
    USEREXIT_SAVE_DOCUMENT_PREPARE
    All the above things need to be done when the user click the save button in the transaction (VA01/VA02).
    Problem here is table XKOMV contains somany fields so manually we can't create xkomv record, is there any Function module to create condition type record?
    Regards,
    Manikumar
    Edited by: Manikumar Shanmugam on Mar 8, 2008 3:53 PM

    Hi,
       You can use Function module PRICING_CHECK to check condition record. Do a where-used list on it to see how to call it.
    Regards
    Kiran Sure

  • Checking conditions in SELECT statement

    Hi All,
    I am relative new to ABAP and I would like to ask a question about checking conditions in SELECT statement in the "WHERE" part.
    There are two checkboxes at the selection screen and each should disable one of  conditions (marked with two stars) in the SELECT mentioned below.
    My question is, whether there exists an option how to solve this problem without using solution like:
    IF checkobx1.
    SELECT (without one condition)
    ELSEIF checkbox2.
    SELECT(without other condition).
    ELSE.
    SELECT (with both conditions)
      SELECT  qprueflos qherkunft qaufnr qsa_aufnr qmatnr qwerkvorg
              qpastrterm  qpaendterm
              qverid qobjnr vobjnr AS objnr_fa vauart
        FROM qals AS q INNER JOIN vkaufk AS v
        ON qaufnr = vaufnr
        INTO CORRESPONDING FIELDS OF TABLE gt_qals
        WHERE q~prueflos IN s_pruefl
          AND q~stat35     EQ space
          AND q~werk       EQ loswk
          AND q~herkunft IN s_herk
          AND q~offennlzmk EQ 0
          AND q~offen_lzmk EQ 0
          AND q~pastrterm IN s_startt
          AND q~paendterm LE s_endt
          AND v~auart IN s_auart.    "('ZCPA', 'ZCPK', 'ZCBA').

    Hi,
    With this, I think u can directly read into WHERE clause
    IF checkbox1.
        v_where = '& BETWEEN ''&'' AND ''&'' '.
        REPLACE '&' WITH key_field INTO v_where.
        REPLACE '&' WITH field_LOW INTO v_where.
        REPLACE '&' WITH field_HIGH INTO v_where.
        CONDENSE v_where.
    ELSEIF  checkbox2.
        v_where = '& BETWEEN ''&'' AND ''&'' '.
        REPLACE '&' WITH key_field INTO v_where.
        REPLACE '&' WITH field_LOW INTO v_where.
        REPLACE '&' WITH field_HIGH INTO v_where.
        CONDENSE v_where.
    ENDIF.
    select * into corresponding fields of table ITAB
                 from (table_name)
                where (v_where).
    In this key_field is your fieldname in the where clause and field_low, field_high are range of values.
    If i write static query it looks like this
    RANGES: MATNR1 FOR MARA-MATNR.
      MATNR1-LOW = MATNR_LOW.
      MATNR1-HIGH = MATNR_HIGH.
      MATNR1-SIGN = 'I'.
      MATNR1-OPTION = 'BT'.
      APPEND MATNR1.
    select * into corresponding fields of table itab
    from mara where matnr BETWEEN 'M100' AND 'M200'.
    Hope it helps u
    thanks\
    Mahesh
    Edited by: Mahesh Reddy on Jan 30, 2009 11:23 AM

  • Purchase requisition table field FRGDT

    hi all,
    i would like to ask that, the field FRGDT under table EBAN stated as pruchase requisition release date, however, when i check, that under CDPOS table, the UDATE of  having the final release indicator changed is totally different as FRGDT.
    so what actually FRGDT is referring to? can any one please advice. thanks

    For your first question, you could do the below.
    Assuming that the DataSource is delta capable, you can populate the new field data using 'Repair Full Load':
    1. Create a View based on the base tables and EKET. Include the new fields along with the DSO key(s). Create a generic extractor based on the view. Write CMOD code to populate your new field. The CMOD code is as below. Test the extractor in RSA3 to make sure the records are being extracted. Replicate the DS in BW.
    2. Create transformation for your Datastore with this new datasource. Create a full load Infopackage. Under the Scheduler tab of Infopackage, select 'Indicate request as repair request'. Schedule the IP. This will populate all historical data for your new fields without harming the deltas.
    NOTE: If the record size if huge, you would want to limit the size using some filter criteria. For example, load the data only for a couple of years.
    Once DSO is loaded and data activated, Infocube will automatically pick these delta records.
    CASE i_datasource.
    data: v_dat01 like EKET-DAT01.
    l_tabix LIKE sy-tabix.
    when '2LIS_02_SCL'.
    LOOP AT c_t_data INTO wa_t_data.
    l_tabix = sy-tabix.
    SELECT SINGLE DAT01 into v_dat01 from EKET where <condition>.
    if sy-subrc = 0.
    wa_t_data-DAT01 = v_dat01.
    MODIFY c_t_data FROM wa_t_data INDEX l_tabix.
    endif.
    For your second question, building a generic extractor will be ideal. Hope this helps.
    -Mann

Maybe you are looking for

  • ? Photoshop Elements 8 Organizer won't open on Windows Vista ?

    I installed Photoshop Elements 8 onto a Windows Vista computer and registered. The Organizer opened with broken thumbnails throughout and I could not update the thumbnails. Therefore, I closed the Organizer and opened it again, hoping it would clear

  • UnsupportedOperationException Error while removing object from List

    Hi, I need to remove a set of objects from List if it contains similar objects as the other one. Follwing is the code snippet of the above scenario... List selectedPaxList = new ArrayList(); TreeSet seatAssignedPaxlist= new TreeSet(); selectedPaxList

  • New VZAM Update. Question As Well?

    I just saw that there is a new VZAM v.7635 [2642k] for the Pantech. I did not look to see about the other models, but I am sure there is. After I hit the Run Setup.exe file it told me to close VZAM, which is to be expected, but afterwards it told me

  • Sending Idoc to oracle table Emp usering JDBC Adapter

    Hi Guys, Can you help me in these when we are pass a message through idoc to Oracle through jdbc adacpter reaciver what sort of  syntax Parameter need to write in SQLSyntaxParameters Box in ID. Regd's Raj

  • Multispeaker Surround with SB Live Plati

    Hello, I have following configuration: SB Li've Platinum DTT3500 Digital Win XP Prof I have change the operating system from win 98 to win xp pro. After this I've install following driver: 5.2.2.252 date 24.07.2002. Now I can't choose the multispeake