Problem in using modify statement inside a Perform

Hi Experts,
loop at t_data into wa_data.
IF wa_data1-zbukrs IS INITIAL.
        wa_data1-zstat = 'E'.
        w_messg =  'Company code is blank in upload data'.
        CONCATENATE wa_data1-zbukrs w_messg INTO w_msg
          SEPARATED BY space.
          CONCATENATE w_msg  wa_data1-zmsg INTO w_msg
SEPARATED BY
'|'.
          wa_data1-zmsg = w_msg.
          MODIFY t_data1 FROM wa_data1.
endif.
IF wa_data1-zfwcd IS INITIAL.
         wa_data1-zstat = 'E'.
         w_messg =  'Forwarder code is blank in upload data'.
        CONCATENATE wa_data1-zfwcd w_messg INTO w_msg
          SEPARATED BY space.
          CONCATENATE w_msg  wa_data1-zmsg INTO w_msg
SEPARATED BY
'|'.
          wa_data1-zmsg = w_msg.
          MODIFY t_data1 FROM wa_data1.
endif.
IF wa_data1-zinvno IS INITIAL.
          wa_data1-zmsg = w_msg.
          MODIFY t_data1 FROM wa_data1.
   wa_data1-zstat = 'E'.
         w_messg =  'Invoice number is blank in upload data'.
        CONCATENATE wa_data1-zinvno w_messg INTO w_msg
          SEPARATED BY space.
          CONCATENATE w_msg  wa_data1-zmsg INTO w_msg
SEPARATED BY
'|'.
          wa_data1-zmsg = w_msg.
          MODIFY t_data1 FROM wa_data1.
endif.
endloop.
My doubt is:
        wa_data1-zstat = 'E'.
        w_messg =  'Company code is blank in upload data'.
        CONCATENATE wa_data1-zbukrs w_messg INTO w_msg
          SEPARATED BY space.
          CONCATENATE w_msg  wa_data1-zmsg INTO w_msg
SEPARATED BY
'|'.
          wa_data1-zmsg = w_msg.
          MODIFY t_data1 FROM wa_data1.
i want write the above code to be written in a perform statement
becos iam using the above code in multiple places in my program.
but the problem iam facing is modify not working in perform statement.
Regards,
Raj.

hi Raj,
   use FIELD-SYMBOLS so that you don't have to use MODIFY statement.
FIELD-SYMBOLS: <fs> like line of T_data.
loop at t_data ASSIGNING <fs>.
IF  <fs>-zbukrs IS INITIAL.
<fs>-zstat = 'E'.
w_messg = 'Company code is blank in upload data'.
CONCATENATE <fs>-zbukrs w_messg INTO w_msg
SEPARATED BY space.
CONCATENATE w_msg <fs>-zmsg INTO w_msg
SEPARATED BY   '|'.
<fs>-zmsg = w_msg.
endif.
IF <fs>-zfwcd IS INITIAL.
<fs>-zstat = 'E'.
w_messg = 'Forwarder code is blank in upload data'.
CONCATENATE <fs>-zfwcd w_messg INTO w_msg
SEPARATED BY space.
CONCATENATE w_msg <fs>-zmsg INTO w_msg
SEPARATED BY '|'.
<fs>-zmsg = w_msg.
endif.
endloop.

Similar Messages

  • Problem in using aggregate functions inside case statement

    Hi All,
    I am facing problem while using aggregate functions inside case statement.
    CASE WHEN PSTYPE='S' THEN MAX(DECODE(POS.PBS,1,ABS(POS.PPRTQ),0)) ELSE SUM(DECODE(POS.PBS,1,ABS(POS.PPRTQ),0)) END,
    how can I achieve above requirement ? Con anyone help me.
    Thanks and Regards
    DG

    Hi All,
    Below is my query:
            SELECT
            CASE WHEN p_reportid IN ('POS_RV_SN','POS_PB') THEN POS.PACCT
            ELSE POS.PACCT || '-' || DECODE(POS.SYSTEMCODE,'GMI1','1', 'GMI2','2', 'GMI3','4', 'GMI4','3', '0') ||POS.PFIRM|| NVL(POS.POFFIC,'000') END,
            CASE WHEN p_reportid IN ('POS_RV_SN','POS_PB') THEN POS.PACCT||POS.PCUSIP||DECODE(POS.PBS,1,'+',2,'-')
            ELSE POS.PFIRM||POS.POFFIC||POS.PACCT||POS.PCUSIP||DECODE(POS.PBS,1,'+',2,'-') END,POS.SYSTEMCODE,CASE WHEN POS.PSTYPE='S' THEN POS.PSYMBL ELSE POS.PFC END,POS.PEXCH||DECODE(POS.PSUBEX,'<NULL>',''),
            POS.PCURSY,
            CASE WHEN POS.PSBCUS IS NULL THEN SUBSTR(POS.PCTYM,5,2) || SUBSTR(POS.PCTYM,1,4) ELSE POS.PSBCUS || SUBSTR(POS.PCTYM,5,2) || SUBSTR(POS.PCTYM,1,4) END ,
            NVL(POS.PSUBTY,'F') ,POS.PSTRIK,*SUM(DECODE(POS.PBS,1,ABS(POS.PPRTQ),0)) ,SUM(DECODE(POS.PBS,2,ABS(POS.PPRTQ),0))* ,
            POS.PCLOSE,SUM(POS.PMKVAL) ,
            TO_CHAR(CASE WHEN INSTR(POS.PUNDCP,'.') > 0 OR LENGTH(POS.PUNDCP) < 15 THEN POS.PUNDCP ELSE TO_CHAR(TO_NUMBER(POS.PUNDCP) / 100000000) END),
            POS.UBS_ID,POS.BBG_EXCHANGE_CODE,POS.BBG_TICKER ,POS.BBG_YELLOW_KEY,POS.PPCNTY,POS.PMULTF,TO_CHAR(POS.BUSINESS_DATE,'YYYYMMDD'),
            POS.SOURCE_GMI_LIB,
            --DECODE(POS.SYSTEMCODE,'GMI1','euro','GMI2','namr','GMI3','aust','GMI4','asia','POWERBASE','aust','SINACOR','namr',POS.SYSTEMCODE),
            DECODE(p_reportid,'RVPOS_SING','euro','RVPOS_AUSTDOM','aust','RVPOS_AUSTEOD','euro','RVPOS_GLBLAPAC','asia','POS_RV_SN','namr','POS_PB','aust',POS.SYSTEMCODE),
            POS.RIC,
            CASE WHEN PSUBTY = 'S' THEN POS.TYPE ELSE NULL END,
            DECODE(POS.UBS_ID,NULL,POS.PCUSP2,POS.ISIN),POS.UNDERLYING_BBG_TICKER,POS.UNDERLYING_BBG_EXCHANGE,POS.PRODUCT_CLASSIFICATION,
            CASE WHEN PSUBTY = 'S' THEN POS.PSDSC2 ELSE NULL END,
            CASE WHEN PSUBTY = 'S' THEN C.SSDSC3 ELSE NULL END,
            NVL(C.SSECID,POS.PCUSIP),
            NULL,
            POS.PYSTMV,
            POS.PMINIT,
            POS.PEXPDT,
            CASE WHEN POS.PSUBTY='S' THEN  SUBSTR(C.ZDATA2,77,1) ELSE NULL END,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL
            FROM POSITIONS_WRK POS LEFT OUTER JOIN
            (SELECT * FROM CDS_PRODUCTS CP INNER JOIN FUTURE_MASTER FM ON
            (CP.STRXCH=FM.ZEXCH AND CP.SFC=FM.ZFC AND CP.BUSINESS_DATE = FM.BUSINESS_DATE )) C ON POS.PCUSIP = C.SCUSIP
            AND NVL(POS.PCUSP2,'X') = NVL(C.SCUSP2,'X')
            WHERE
            POS.PEXCH NOT IN ('A1','A2','A3','B1','B3','C2','D1','H1','K1','L1','M1','M3','P1','S1')
            AND (POS.PSBCUS IS NOT NULL OR POS.PCTYM IS NOT NULL OR POS.PSTYPE ='S')
            AND POS.BUSINESS_DATE = run_date_char
            GROUP BY
            POS.UBS_ID,POS.SYSTEMCODE,POS.RECIPIENTCODE,POS.BUSINESS_DATE,POS.PACCT,POS.PFIRM,POS.POFFIC,POS.PCUSIP,POS.PBS,CASE WHEN POS.PSTYPE='S' THEN POS.PSYMBL ELSE POS.PFC END,
            POS.PEXCH,POS.PSUBEX,POS.PCURSY,
            CASE WHEN POS.PSBCUS IS NULL THEN SUBSTR(POS.PCTYM,5,2) || SUBSTR(POS.PCTYM,1,4) ELSE POS.PSBCUS || SUBSTR(POS.PCTYM,5,2)  || SUBSTR(POS.PCTYM,1,4) END,
            NVL(POS.PSUBTY,'F') ,POS.PSTRIK,POS.PCLOSE,TO_CHAR(CASE WHEN INSTR(POS.PUNDCP,'.') > 0 OR LENGTH(POS.PUNDCP) < 15 THEN POS.PUNDCP ELSE TO_CHAR(TO_NUMBER(POS.PUNDCP) / 100000000) END),
            POS.BBG_EXCHANGE_CODE,POS.BBG_TICKER,POS.BBG_YELLOW_KEY,POS.PPCNTY,POS.PMULTF,POS.PSUBTY,POS.SOURCE_GMI_LIB,RIC,
            CASE WHEN PSUBTY = 'S' THEN POS.TYPE ELSE NULL END,
            DECODE(POS.UBS_ID,NULL,POS.PCUSP2,POS.ISIN),POS.UNDERLYING_BBG_TICKER,POS.UNDERLYING_BBG_EXCHANGE,POS.PRODUCT_CLASSIFICATION,
            CASE WHEN PSUBTY = 'S' THEN POS.PSDSC2 ELSE NULL END,
            CASE WHEN PSUBTY = 'S' THEN C.SSDSC3 ELSE NULL END,
            NVL(C.SSECID,POS.PCUSIP),
            POS.PYSTMV,
            POS.PMINIT,
            POS.PEXPDT,
            CASE WHEN PSUBTY = 'S'  THEN  SUBSTR(C.ZDATA2,77,1) ELSE NULL END;Now, could you plz help me in replacing the bold text in the query with the requirement.
    Thanks and Rgds
    DG
    Edited by: BluShadow on 16-May-2011 09:39
    added {noformat}{noformat} tags.  Please read: {message:id=9360002} for details on how to post code/data                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How do we use if statement in labview?moreover can i use if statement inside for loop?

    how do we use if statement in labview?moreover can i use if statement inside for loop?

    The if statement in LabVIEW is the Case structure. You can find that on the Structures palette right next to the For Loop. If you're still on the same subject about terminating a for loop early, then what you do is enclose your functions inside the loop with a case statment and make one of the case's empty except for one or more constants that you might have to wire. Hopefully, the attached picture will explain what I mean. Also, as I mentioned in one of your other posts, I think this technique is not as good as using a while loop. The array in the attached example is the same size no matter what and you may have to handle stripping extra or invalid elements.
    Attachments:
    For_Loop_with_Case.jpg ‏21 KB

  • Database Updation and Insertion using Modify Statement

    Hi All,
    I am using Modify statment for data insertion and updation
    MODIFY zmpit_ven_bgg_rg FROM TABLE t_ven_bgg .
    But I am getting error
    The type of the database table and work area (or internal table) "T_VEN_BGG" are not compatible.
    I have defined my internal table of below type :
    TYPES : BEGIN OF ty_ven_bgg,
            mandt             TYPE mandt,
            lifnr                 TYPE lfa1-lifnr,
            bgg                 TYPE zmpit_ven_bgg_rg-matkl,
            ind                  TYPE zmpit_ven_bgg_rg-active_ind,
            created_by      TYPE zmpit_ven_bgg_rg-created_by,
            created_on      TYPE zmpit_ven_bgg_rg-created_on,
            last_changed_by TYPE zmpit_ven_bgg_rg-last_changed_by,
            last_changed_on TYPE zmpit_ven_bgg_rg-last_changed_on,
            remarks              TYPE zmpit_ven_bgg_rg-remarks,
            ind1(1)                TYPE c,
                 END OF ty_ven_bgg.
    Here, ind1 is not field  of the table.
    I have added a new field Remarks in the table and thus i included it in the Internal table also.
    Above Modify statement was working fine without Remarks field. I am not able to understand the error
    as work area is also of type ty_ven_bgg.
    Please suggest some solution.
    Regards,
    Nibha

    Hi,
    Though you have creaated one more internal tsble without the indc field, but you can do it using the same intrenal table by simply using
    1. MOVE-CORRESPONDING <internal table> to <ztable>.
    2.MODIFY <ztable>.
    will solve your problem
    Secondly declare the internal table using DATA after structure has been declared using TYPES.
    This is better approach to follow.
    Pooja

  • Best practice: Using break statement inside for loop

    Hi All,
    Using break statment inside FOR loop is a best practice or not?
    I have given some sample code:
    1. With break statement
    2. With some boolean variable that decide whether to come out of the loop or not.
    for(int i = 0; i < 10; i++){
    if(i == 5){
    break;
    boolean breakForLoop = false;
    for(int i = 0; i < 10 && !breakForLoop; i++){
    if(i == 5){
    breakForLoop = true;
    The example may be a stupid one. But i want to know which one is good?
    Thanks and Regards,
    Ashok kumar B.

    Actually, it's bad practice to use break anywhere other than in conjunction with a switch statement.Presumably, if you favour:
    boolean test = true;
    while (test)
      test = foo && bar;
      if (test)
    }overfor (;;)
      if (! ( foo && bar) ) break;
    }then you also favour
    boolean test = foo && bar;
    if (test)
    }overif (foo && bar)
    }Or can you justify your statement with any example which doesn't cause more complexity, more variables in scope, and multiple assignments and tests?

  • 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 know no of records(in Internal Table) modified after using Modify statement

    Hi Experts ,
    I am using statement Modify internal table transporting XYZ FIELD.
    I just wanted to know how many Records/Count (assuming more then 1 ) get updated just after successful execution of this command.
    Is there any system field exist?
    if yes please let me know?
    Warm Regards,
    Santosh

    Hello Santosh,
    Try like below and it works for me.
    Count will have the number rows changed.
    DATA: itab_mara TYPE STANDARD TABLE OF mara,
          itab_mara1 TYPE STANDARD TABLE OF mara,
          str_mara TYPE mara,
          str_mara1 TYPE mara,
          diff LIKE IREF-IIND,
          count TYPE int2.
    SELECT * FROM mara INTO TABLE itab_mara UP TO 10 ROWS.
      itab_mara1[] = itab_mara[].
      str_mara-lvorm = 'X'.
    MODIFY itab_mara FROM str_mara TRANSPORTING lvorm WHERE VPSTA = 'KVB'.
    LOOP AT itab_mara INTO str_mara.
      READ TABLE itab_mara1 INTO str_mara1 WITH KEY matnr = str_mara-matnr.
    CALL FUNCTION 'COMPARE_STRUCTURE_DATA'
      EXPORTING
        i_ddic_name       = 'MARA'
        i_rec_old         = str_mara
        i_rec_new         = str_mara1
       I_CHECK_MODE      = 'Y'
    IMPORTING
       E_IS_DIFF         = diff.
    IF diff = 'X'.
      count = count + 1.
    ENDIF.
    ENDLOOP.
    WRITE:/ count.
    Regards,
    Thanga

  • Problem with using Key Figure inside IDT

    Hii Experts,
    I have created an Universe using Information Design Tool(IDT), in which i had created the Key figures whose value are calculated  based up on Date i supply and that value is Being Calculated fine according to my need.
    But Problem is that when i am going to use that Key figures value in further Calculation, its returning wrong value....
    Can anyone please help me, how can i use the Key figure's value in another key figure for further calculation inside the IDT.
    Thanks
    Prakash

    Hi Prakash,
    Can you explain what are you doing exactly and what you wan to do?
    Can you provide the expression you wrote? Which database are you using?
    Thank you
    Didier

  • Please help me urgently (Problem in using delete statement)

    Hello,
    I want to run delete query where table name should come from a variable .I have written the following procedure but its not working .Could you please help me
    DECLARE
    processtemplatename VARCHAR2(64);
    CURSOR T1Cursor IS
    select Process_template_name from ProcessTemplate
    where PROCESS_template_ID in
    ( select PROCESS_template_ID from PROCESSINSTANCE
    where process_instance_id in
    (select process_instance_id from processinstance where STATUS = 'PI_COMPLETED' OR STATUS = 'PI_REMOVED' ));
    BEGIN
    OPEN T1Cursor;
    LOOP
    FETCH T1Cursor INTO processtemplatename;
    EXIT WHEN T1Cursor%NOTFOUND;
    DELETE FROM processtemplatename WHERE process_instance_id in
    ( select process_instance_id from PROCESSINSTANCE where STATUS = 'PI_COMPLETED' OR STATUS = 'PI_REMOVED' );
    END LOOP;
    CLOSE T1Cursor;
    END;
    I am getting the error
    ERROR at line 19:
    ORA-06550: line 19, column 27:
    PL/SQL: ORA-00942: table or view does not exist
    ORA-06550: line 19, column 15:
    PL/SQL: SQL Statement ignored
    even when i used
    DECLARE
    processtemplatename VARCHAR2(64);
    BEGIN
    processtemplatename := 'example1';
    DELETE FROM processtemplatename WHERE process_instance_id in
    ( select process_instance_id from PROCESSINSTANCE where STATUS = 'PI_COMPLETED' OR STATUS = 'PI_REMOVED' );
    END;
    I am still getting the same error message
    Thanks,
    Salam.

    And BTW you do not need that clumsy CURSOR c.. OPEN c.. FETCH c INTO... CLOSE c etc. It is "reserved" for more complex cases when you cannot use:
    <pre>
    FOR P IN
         select Process_template_name
              from ProcessTemplate
              where PROCESS_template_ID in
                   (select PROCESS_template_ID
                        from PROCESSINSTANCE
                        where process_instance_id in
                             (select process_instance_id
                                  from processinstance
                                  where STATUS = 'PI_COMPLETED'
                                       OR STATUS = 'PI_REMOVED'
    LOOP
         EXECUTE IMMEDIATE
              'DELETE FROM ' || P.Process_template_name ||
                   ' WHERE process_instance_id in
                        (select process_instance_id
                             from PROCESSINSTANCE
                             where STATUS = ''PI_COMPLETED'' OR STATUS = ''PI_REMOVED''
    END LOOP;
    </pre>

  • Problem in using read statement.

    i am using the read statement as follows :
    read table tekpo with key werks = '1001'.
    it is not reading the corresponding record.
    though it reads or not it is returning the sy-subrc value 0.
    plz let me know why it is happening as soon as possible.
    points will be awarded.

    Hi Srinivas rao,
    You can use this example program and make the changes in your program as well:
    DATA: BEGIN OF LINE,
             COL1 TYPE I,
             COL2 TYPE I,
          END OF LINE.
    DATA ITAB LIKE SORTED TABLE OF LINE WITH UNIQUE KEY COL1.
    FIELD-SYMBOLS <FS> LIKE LINE OF ITAB.
    DO 4 TIMES.
      LINE-COL1 = SY-INDEX.
      LINE-COL2 = SY-INDEX ** 2.
      APPEND LINE TO ITAB.
    ENDDO.
    READ TABLE ITAB WITH TABLE KEY COL1 = 2 ASSIGNING <FS>.
    <FS>-COL2 = 100.
    READ TABLE ITAB WITH TABLE KEY COL1 = 3 ASSIGNING <FS>.
    DELETE ITAB INDEX 3.
    IF <FS> IS ASSIGNED.
      WRITE '<FS> is assigned!'.
    ENDIF.
    LOOP AT ITAB ASSIGNING <FS>.
      WRITE: / <FS>-COL1, <FS>-COL2.
    ENDLOOP.
    The output is:
             1         1
             2       100
             4        16
    I think you have satisfied.
    Thanks and regards
    Vipin Das

  • Problems in using SQL statement

    Is that a way that i could use java sql statement for COUNT or SUM SQL Statement
    String query = "SELECT S.Name,COUNT(TS.NoOfPoints) AS Points FROM TeamS,TeamStatistics TS WHERE S.TeamID = TS.TeamID ORDER BY TS.NoOfPoints DESC";
    i am trying to count the num of points for each team.
    I have eror message,execute the sql statement
    is the sql statement correct.

    String query= "SELECT S.TeamName,COUNT(TS.NoOfPoints) FROM Team T,TeamStatistics TS GROUP BY T.TeamName HAVING T.TeamID = TS.TeamID";
    Statement statement = connection.createStatement();
    ResultSet rs = statement.executeQuery(query);
    while(rs.next())
    System.out.println(rs.getString("TeamName"));
    System.out.println(rs.getString("NoOfPoints"));
    The sql doesn't work, i really dun konw what to do

  • Problem with using Callable Statements via JDBC/JSP

    Hi Pals,I have this scenario;
    If a stored procedure has being created for me on Oracle database and i need
    to execute the stored procedure via my JSP ,where i capture some parameters in
    my JSP,send this parameters to the Stored Procedure . Then the Stored procedure decides if its an Update or Insert depending on the PL/SQL(Stored Procedure) code on database.
    How do i go about this using The CallableStatement java API and obviously JDBC.
    All suggestions will be appreciated and codes as well.
    Cheers.

    This is a basic question about how a CallableStatement works in JDBC. Read the documentation on CallableStatement in the JDK. If you are having trouble understanding something in the JDK, come back here and ask a specific question.

  • Problem in modifying a table through modify statement

    Hi,
    I am trying to update a 'Z' table in which there are 5 fields comprising of primary key. Out of them 2 key fields are defined as a part of seconadry index with 'Unique' option selected.
    As per the requirement, I am trying to update the table using modify statement so whenever this statement occurs it will check the primary keys and accordingly try to modify a record or insert a new record.
    But as there is Unique Index defined on 2 of the key fields the Modify query is

    Hi,
    Your syntax for MODIFY is not correct.
    As other friends suggested you can have index and you can modify the internal table.
    Whenever we are modifying internal table inside LOOP, we can omit index as system will take current row by default. So MODIFY statement should be written as follows:
    MODIFY T_ITPO5 from W_ITPO5 transporting AUFNR
    You can LOOP FROM INDEX also for the same to improve performance.
    data: wv_index like sy-tabix.
    sort T_ITPO5 by aufnr.
    sort T_ITPO4 by aufnr.
    wv_index = 1.
    LOOP AT T_ITPO5 INTO W_ITPO5.
         LOOP AT T_ITPO4 INTO W_ITPO4 from wv_index.
         if W_ITPO4-aufnr eq W_ITPO5-aufnr.
              IF ITPO4-NTGEW 0 .
                  CALL FUNCTION 'ZGET_ITEM_WEIGHT'
                    EXPORTING
                       P_BUID = W_ITPO4-WERKS
                       P_ITEMID = W_ITPO4-MATNR
                       P_QTY = 1
                       P_UOM = W_ITPO4-MEINS
                       P_UOM1 = 'KG'
                   IMPORTING
                      P_RETVAL = W_ITPO4-WTKG.
    TOTWT1 = W_ITPO4-WTKG * W_ITPO4-MENGE.
    IF W_ITPO4-BWART = '261'.
    W_ITPO5-I_QTY = W_ITPO5-I_QTY + TOTWT1.
    ELSEIF W_ITPO4-BWART = '101' OR W_ITPO4-BWART = '531'.
    W_ITPO5-I_QTY = W_ITPO5-I_QTY - TOTWT1.
    ENDIF.                    " IF W_ITPO4-BWART = '261'.
    endif.
    elseif W_ITPO4-aufnr gt W_ITPO5-aufnr.
       move sy-tabix to wv_index.
       exit.
    endif.                      " if W_ITPO4-aufnr eq W_ITPO5-aufnr.
    ENDLOOP.
    MODIFY T_ITPO5 FROM W_ITPO5 transporting aufnr.
    ENDLOOP.

  • Problem using insert statement....?

    I am facing problem while using insert statement.
    It is not updating the database table though the same code is working very well on another server.
    Please tell what could be the problem.......?

    Hi Vijendra ,
    You need to check few parameters while creating the table
    1. Table Manitainance
    2.Buffering
    Also , as per you , if ur insert statement is working perfectly fine in another serve..
    , it is highlt possible that table created has 'mandt ' filed , which means this table is client dependent.
    Also , another reason is that , you may not this table at all in the new server .
    So , check onall thiese parameters.
    Ihope this solves ur problem.
    Regards.
    Note: Rewad if useful

  • Error in modify statement

    Hi,
    When i am trying to update a z table by using modify statement, i am getting the following error:
                                                                                    Short text                                                                               
    SQL error in the database when accessing a table.                                              
    What happened?                                                                               
    When writing a data record to the database (i.e. when                                          
         updating the database), only part of the data field was                                        
         written (updated). The rest was truncated.                                                     
    Error analysis                                                                               
    An exception occurred that is explained in detail below.                                       
         The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught                  
          in                                                                               
    procedure "FILLTABLE" "(FORM)", nor was it propagated by a RAISING clause.                     
         Since the caller of the procedure could not have anticipated that the                          
         exception would occur, the current program is terminated.                                      
         The reason for the exception is:                                                               
         The problem has arisen because, within the database interface,                                 
         one of the data buffers made available for the INSERT (UPDATE)                                 
         is longer than the maximum defined in the database.                                            
         On the other hand, it may be that the length in the NAMETAB                                    
         does not match the maximum length defined in the database.                                     
         (In this case, the length in the NAMETAB is longer.)                                                                               
    Please guide me how this error can be resolved.
    Thanks and Regards

    Hi,
    The error message is as follows:
    Short text                                                                               
    SQL error in the database when accessing a table.                                                
    What happened?                                                                               
    When writing a data record to the database (i.e. when                                            
         updating the database), only part of the data field was                                          
         written (updated). The rest was truncated.                                                       
    Error analysis                                                                               
    An exception occurred that is explained in detail below.                                         
         The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught                    
          in                                                                               
    procedure "FILLTABLE" "(FORM)", nor was it propagated by a RAISING clause.                       
         Since the caller of the procedure could not have anticipated that the                            
         exception would occur, the current program is terminated.                                        
         The reason for the exception is:                                                                 
         The problem has arisen because, within the database interface,                                   
         one of the data buffers made available for the INSERT (UPDATE)                                   
         is longer than the maximum defined in the database.                                              
         On the other hand, it may be that the length in the NAMETAB                                      
         does not match the maximum length defined in the database.                                       
         (In this case, the length in the NAMETAB is longer.)                                             
    Moderator message - Please respect the 2,500 character maximum when posting. Post only the relevant portions of dump
    Edited by: Rob Burbank on May 1, 2010 5:59 PM

Maybe you are looking for

  • Why can I not sign in to icloud on my pc?

    I can not sign into icloud on my pc I have vista sp2 system  I can sign in if I log in as a visitor. The little wheel just keeps spinning

  • ITunes can't connect to the store

    Hi everyone! It's since a couple of weeks ago that I have trouble connecting to the iTunes Store from my iTunes. I had the latest version of iTunes 10, and it worked all just fine. Then all of a sudden one day, for no evident reason, it says it can't

  • How do I fix the "Invalid Signature" problem?

    I keep getting this error message everytime I try to update my software to 10.6.3. I've even tried the suggestion of a manual download and it still says the same thing. Does it make any difference to say that my iTunes and accompanying music are save

  • How much hard disk space remains?

    Sorry, the Missing Manuel for Lion isn't available until the end of the month, but I have a lot of basic questions. With Snow Leopard when i opened a Finder window at the very bottom of the window pain was information on how much memmory was being us

  • TABLE CONTROL IN TAB STRIP CONTROL

    hi experts, I have a problem with table control in tab strip control  i have table control in first tab and some text fields in second tab . i enter data into table control in  first tab and enter into second tab and i fill data into second tab also