Please help in finding the error in this code

Dear Friends,
I am trying to make the value of 'Shift' on the basis of  BLDAT CPUDT & CPUTM of MKPF but I am doing something wrong. Kindly have a look at the following code, especially the IF..ELSEIF section and help me in finding the error.
Regards,
Alok.
SELECT MBLNR MJAHR BKTXT BUDAT BLDAT CPUDT CPUTM USNAM
INTO CORRESPONDING FIELDS OF TABLE I_MKPF1
FROM MKPF
WHERE
BUDAT EQ S_BUDAT AND
TCODE2 EQ 'MFBF'.
********************************************************ALOK 01.02.07
LOOP AT I_MKPF1.
       I_MKPF-MBLNR = I_MKPF1-MBLNR.
       I_MKPF-MJAHR = I_MKPF1-MJAHR.
       I_MKPF-BKTXT = I_MKPF1-BKTXT.
       I_MKPF-BUDAT = I_MKPF1-BUDAT.
       I_MKPF-BLDAT = I_MKPF1-BLDAT.
       I_MKPF-CPUDT = I_MKPF1-CPUDT.
       I_MKPF-CPUTM = I_MKPF1-CPUTM.
       I_MKPF-USNAM = I_MKPF1-USNAM.
IF   ( ( I_MKPF1-CPUTM >= '090000' AND I_MKPF1-CPUTM < '160000' )
AND   ( I_MKPF1-BLDAT = I_MKPF1-CPUDT ) ).
I_MKPF-SHIFT = 'A'.
ELSEIF ( ( I_MKPF1-CPUTM >= '090000' AND I_MKPF1-CPUTM <= '110000' )
   AND  ( I_MKPF1-BLDAT <>  I_MKPF1-CPUDT ) ).
I_MKPF-SHIFT = 'C'.
ELSEIF ( ( I_MKPF1-CPUTM >= '160000' AND I_MKPF1-CPUTM < '000000' )
  AND  ( I_MKPF1-BLDAT = I_MKPF1-CPUDT ) ).
I_MKPF-SHIFT = 'B'.
ENDIF.
APPEND I_MKPF.
CLEAR I_MKPF.
ENDLOOP.

Hi.
IF (  I_MKPF1-CPUTM >= '090000' AND I_MKPF1-CPUTM < '160000' )
       AND ( I_MKPF1-BLDAT = I_MKPF1-CPUDT ) .
I_MKPF-SHIFT = 'A'.
ELSEIF  ( I_MKPF1-CPUTM >= '090000' AND I_MKPF1-CPUTM <= '110000' )
AND ( I_MKPF1-BLDAT <> I_MKPF1-CPUDT ) .
I_MKPF-SHIFT = 'C'.
ELSEIF ( I_MKPF1-CPUTM >= '160000' AND I_MKPF1-CPUTM < '000000' )
AND ( I_MKPF1-BLDAT = I_MKPF1-CPUDT ) .
I_MKPF-SHIFT = 'B'.
ENDIF.
Try the above code ..
Regards
Sudheer

Similar Messages

  • Please help me find the error in the annex VI,access

    Hello, everyone, this is a program about ACCESS, please help me find the error in the annex VI, why do I always run time error. Thank you very much.
    Attachments:
    write access test.vi ‏22 KB

    Thank you for your reply, I have an attachment process map, could you help me change it, I just want to put my number in the array can continue to update the database. And I want to create a table.
    this is my msn :[email protected]
    Waiting for your reply on line
    谢谢你的回复,我的附件中有程序图,能不能帮我改一下,我只是希望,把我的数组中的数能够持续的更新在数据库中。并且创建一个我想要的表。

  • Why doesn't my iPhone 4 have an 'Internet tethering' options? Is it carrier related or iOs related? Please help me find the solution for this. thanx

    Why doesn't my iPhone 4 have an 'Internet tethering' options? Is it carrier related or iOs related? Please help me find the solution for this. thanx

    Personal Hot spot
    http://support.apple.com/kb/HT3574
    Understanding
    http://support.apple.com/kb/HT4517
    Trouble Shooting
    http://support.apple.com/kb/TS2756

  • Please help in finding the bug in this BDC for FB01

    Please find the bug in the following BDC for FB01 of mine. It picks up the entries from the very first record of the excel file, every time.
    report ZFI_BDC
           no standard page heading line-size 255.
    data: bdcdata1 like bdcdata occurs 0 with header line.
    data : vf_index type i.
    DATA: BEGIN OF ENTRIES occurs 0,
            BLDAT(8),
            BUKRS(4),
            BLART(2),
            WAERS(5),
            BUDAT(8),
            RECNO(5),
            NEWBS(2),
            NEWKO(17),
            NEWNUM(1),
            WRBTR(13),
            GSBER(4),
            SECCO(4),
            zuonr(18),
            SGTXT(50),
            NEWBS_2(2),
            NEWKO_2(17),
            NEWNUM_2(1),
            WRBTR_2(13),
            GSBER_2(4),
            SECCO_2(4),
            zuonr_2(18),
            SGTXT_2(50),
            no type i,
    END OF ENTRIES.
    DATA: BEGIN OF ENTRIES2 OCCURS 0 ,
            BLDAT(8),
            BUKRS(4),
            BLART(2),
            WAERS(5),
            BUDAT(8),
            RECNO(5),
            NEWBS(2),
            NEWKO(17),
            NEWNUM(1),
            WRBTR(13),
            GSBER(4),
            SECCO(4),
            zuonr(18),
            SGTXT(50),
            NEWBS_2(2),
            NEWKO_2(17),
            NEWNUM_2(1),
            WRBTR_2(13),
            GSBER_2(4),
            SECCO_2(4),
            zuonr_2(18),
            SGTXT_2(50),
            no type i,
    END OF ENTRIES2.
    DATA: TEMP(8),
          DOCDATE(8),
          SPLGL(1),
          PKEY(2),
          GL(17),
          VCHAMT(13),
          BUSAREA(4),
          SECCODE(4),
          zzuonr(18),
          COSTCEN(10),
          AUFNR(3),
          SGTXT(50),
          item(50)           TYPE c,
          DS TYPE I,
          DS2 TYPE I.
    data : vf_start_col type i value '1',      "start column
           vf_start_row type i value '1',      "start row
           vf_end_col   type i value '256',    "maximum column
           vf_end_row   type i value '65536',  "maximum row
           p_text(20).                         "stores error messages
    Internal Table
    data : it_excel type  kcde_cells occurs 0 with header line.
    */ Field symbol
    field-symbols : <fs>.
    parameters: p_file   LIKE rlgrap-filename MEMORY ID M01,
                NOHEADER AS CHECKBOX.
    parameters: COMPANY(4) TYPE C DEFAULT 'SCL',
                GROUP(12) TYPE C DEFAULT 'BDCTEST',
                USER(12) TYPE C DEFAULT SY-UNAME,
                KEEP(1) TYPE C DEFAULT 'X',
                POSTDATE LIKE SY-DATUM DEFAULT SY-DATUM,
                DOC_TYPE(2) TYPE C DEFAULT 'SA',
                HOLDDATE LIKE SY-DATUM.
    ***********************************************upload data from excel
    CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
      EXPORTING
        filename                      = p_file
        i_begin_col                   = VF_START_COL
        i_begin_row                   = VF_START_ROW
        i_end_col                     = VF_END_COL
        i_end_row                     = VF_END_ROW
      tables
        intern                        = IT_EXCEL
    EXCEPTIONS
       INCONSISTENT_PARAMETERS       = 1
       UPLOAD_OLE                    = 2
       OTHERS                        = 3 .
    IF sy-subrc <> 0.
              WRITE: / 'EXCEL UPLOAD FAILED :', p_file, SY-SUBRC.
    else.
      sort it_excel by row col.
          loop at it_excel.
         IF NOHEADER = 'X'
        AND It_EXCEL-row = 1.
          CONTINUE.
        ENDIF.
         vf_index = it_excel-col.
       assign component vf_index of structure ENTRIES to <fs>.
            move  it_excel-value to <fs>.
          at end of row.
            append ENTRIES.
            clear ENTRIES.
          endat.
          endloop.
      endif.
    start-of-selection.
    DS = 1.
    LOOP AT ENTRIES.
    ENTRIES-NO = DS.
    MODIFY ENTRIES.
    DS = DS + 1.
    *ON CHANGE OF ENTRIES-zuonr.
    *DS = 1.
    *ENTRIES-NO = DS.
    *MODIFY ENTRIES.
    *DS = DS + 1.
    *ENDON.
    ENDLOOP.
    LOOP AT ENTRIES where no = 1.
        MOVE-CORRESPONDING  ENTRIES TO ENTRIES2.
    APPEND ENTRIES2.
    CLEAR ENTRIES2.
      ENDLOOP.
    DS2 = 1.
    LOOP AT ENTRIES2.
    ENTRIES2-NO = DS2.
    MODIFY ENTRIES2.
    DS2 = DS2 + 1.
    *ON CHANGE OF ENTRIES2-zuonr.
    *DS2 = 1.
    *ENTRIES2-NO = DS2.
    *MODIFY ENTRIES2.
    *DS2 = DS2 + 1.
    *ENDON.
    ENDLOOP.
    LOOP AT ENTRIES.
    REFRESH BDCDATA1.
      WRITE: /  ENTRIES-RECNO,
                ENTRIES-NEWBS,
                ENTRIES-NEWKO,
                ENTRIES-NEWNUM,
                ENTRIES-WRBTR,
                ENTRIES-GSBER,
                ENTRIES-SECCO,
                ENTRIES-ZUONR,
                ENTRIES-SGTXT.
    ENDLOOP.
    WRITE: / 'THIS IS THE BDC PROGRAM FOR SAMTEL'.
    TEMP = POSTDATE.
    DOCDATE = TEMP+6(2).
    DOCDATE2(2) = TEMP4(2).
    DOCDATE4(4) = TEMP0(4).
    *delete ENTRIES where no = 1.
    delete ENTRIES2 where no = 2.
    clear ENTRIES.
    clear ENTRIES2.
    LOOP AT ENTRIES .
    if ENTRIES-no = 2.
    perform bdc_dynpro      using 'SAPMF05A' '0100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF05A-NEWKO'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BKPF-BLDAT'            "DOCDATE.
                                   ENTRIES-BLDAT.
    perform bdc_field       using 'BKPF-BLART'            "DOC_TYPE.
                                   ENTRIES-BLART.
    perform bdc_field       using 'BKPF-BUKRS'            "COMPANY.
                                   ENTRIES-BUKRS.
    perform bdc_field       using 'BKPF-BUDAT'            "DOCDATE.
                                   ENTRIES-BUDAT.
    perform bdc_field       using 'BKPF-WAERS'            "INR'.
                                   ENTRIES-WAERS.
    perform bdc_field       using 'RF05A-NEWBS'
                                  ENTRIES-NEWBS.
    perform bdc_field       using 'RF05A-NEWKO'
                                  ENTRIES-NEWKO.
    perform bdc_dynpro      using 'SAPMF05A' '0300'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'BSEG-SGTXT'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BSEG-WRBTR'
                                  ENTRIES-WRBTR.
    perform bdc_field       using 'BSEG-SGTXT'
                                  ENTRIES-SGTXT.
    perform bdc_dynpro      using 'SAPLKACB' '0002'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'COBL-GSBER'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTE'.
    perform bdc_field       using 'COBL-GSBER'
                                  ENTRIES-GSBER.
    perform bdc_dynpro      using 'SAPMF05A' '0300'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF05A-NEWKO'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BSEG-WRBTR'
                                  ENTRIES-WRBTR.
    perform bdc_field       using 'BSEG-SGTXT'
                                  ENTRIES-SGTXT.
    perform bdc_field       using 'RF05A-NEWBS'
                                  ENTRIES-NEWBS.
    perform bdc_field       using 'RF05A-NEWKO'
                                  ENTRIES-NEWKO.
    perform bdc_dynpro      using 'SAPLKACB' '0002'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'COBL-GSBER'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTE'.
    perform bdc_field       using 'COBL-GSBER'
                                  ENTRIES-GSBER.
    perform bdc_dynpro      using 'SAPMF05A' '0301'.
    *perform bdc_field       using 'BDC_CURSOR'
                                 'BSEG-SGTXT_2'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BSEG-WRBTR'
                                  ENTRIES-WRBTR_2.
    perform bdc_field       using 'BSEG-GSBER'
                                  ENTRIES-GSBER_2.
    perform bdc_field       using 'BSEG-SGTXT'
                                  ENTRIES-SGTXT_2.
    perform bdc_dynpro      using 'SAPMF05A' '0301'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'BSEG-WRBTR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BU'.
    perform bdc_field       using 'BSEG-WRBTR'
                                  ENTRIES-WRBTR_2.
    perform bdc_field       using 'BSEG-GSBER'
                                  ENTRIES-GSBER_2.
    perform bdc_field       using 'BSEG-SGTXT'
                                  ENTRIES-SGTXT_2.
    call transaction 'F-02' using bdcdata1 mode 'A'.
    else.
    perform bdc_dynpro      using 'SAPMF05A' '0100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF05A-NEWKO'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BKPF-BLDAT'            "DOCDATE.
                                   ENTRIES-BLDAT.
    perform bdc_field       using 'BKPF-BLART'            "DOC_TYPE.
                                   ENTRIES-BLART.
    perform bdc_field       using 'BKPF-BUKRS'            "COMPANY.
                                   ENTRIES-BUKRS.
    perform bdc_field       using 'BKPF-BUDAT'            "DOCDATE.
                                   ENTRIES-BUDAT.
    perform bdc_field       using 'BKPF-WAERS'            "INR'.
                                   ENTRIES-WAERS.
    perform bdc_field       using 'RF05A-NEWBS'
                                  ENTRIES-NEWBS.
    perform bdc_field       using 'RF05A-NEWKO'
                                  ENTRIES-NEWKO.
    perform bdc_dynpro      using 'SAPMF05A' '0300'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'BSEG-SGTXT'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BSEG-WRBTR'
                                  ENTRIES-WRBTR.
    perform bdc_field       using 'BSEG-SGTXT'
                                  ENTRIES-SGTXT.
    perform bdc_dynpro      using 'SAPLKACB' '0002'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'COBL-GSBER'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTE'.
    perform bdc_field       using 'COBL-GSBER'
                                  ENTRIES-GSBER.
    perform bdc_dynpro      using 'SAPMF05A' '0300'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF05A-NEWKO'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BSEG-WRBTR'
                                  ENTRIES-WRBTR.
    perform bdc_field       using 'BSEG-SGTXT'
                                  ENTRIES-SGTXT.
    perform bdc_field       using 'RF05A-NEWBS'
                                  ENTRIES-NEWBS_2.
    perform bdc_field       using 'RF05A-NEWKO'
                                  ENTRIES-NEWKO_2.
    perform bdc_dynpro      using 'SAPLKACB' '0002'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'COBL-GSBER'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTE'.
    perform bdc_field       using 'COBL-GSBER'
                                  ENTRIES-GSBER_2.
    perform bdc_dynpro      using 'SAPMF05A' '0301'.
    **perform bdc_field       using 'BDC_CURSOR'
                                 'BSEG-SGTXT_2'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BSEG-WRBTR'
                                  ENTRIES-WRBTR_2.
    perform bdc_field       using 'BSEG-GSBER'
                                  ENTRIES-GSBER_2.
    perform bdc_field       using 'BSEG-SGTXT'
                                  ENTRIES-SGTXT_2.
    perform bdc_dynpro      using 'SAPMF05A' '0301'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'BSEG-WRBTR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BU'.
    perform bdc_field       using 'BSEG-WRBTR'
                                  ENTRIES-WRBTR_2.
    perform bdc_field       using 'BSEG-GSBER'
                                  ENTRIES-GSBER_2.
    perform bdc_field       using 'BSEG-SGTXT'
                                  ENTRIES-SGTXT_2.
    call transaction 'F-02' using bdcdata1 mode 'A'.
    endif.
    ENDLOOP.
    clear entries.
    refresh entries.
           Start new screen                                              *
    form bdc_dynpro using program dynpro.
       clear bdcdata1.
      bdcdata1-program  = program.
      bdcdata1-dynpro   = dynpro.
      bdcdata1-dynbegin = 'X'.
    append bdcdata1.
    endform.
           Insert field                                                  *
    form bdc_field using fnam fval.
       clear bdcdata1.
        bdcdata1-fnam = fnam.
        bdcdata1-fval = fval.
    append bdcdata1.
    endform.

    Alok,
    1) Write upload data from excel in Start of selection
    2) I could not find any need for table entries2 in the logic.
    3) I feel the data mapping from the uploaded file is wrong. Can you look into http://www.sapdevelopment.co.uk/file/file_upexcelalt1.htm for the proper usage. Actually, this logic will work. Similar way you can map the data to your internal table <b>entries</b>
    4) BDC part I feel its ok.
    Let me know if you have still error after these steps.
    Rgds,
    TM

  • Please Find the error in this code

    Hi ,  I am new to ajax.My problem is that i cannot insert a value in to a textfield which is fetched from a database(MySql).  I have two jsp pages.Definition1.jsp and definition.jsp. I am giving the code below.[b]But it does not work[/b]. I don't know where is the problem. I am using Mozilla Firefox..  [b]Definition1.jsp[/b]  <html>  <%@ page language="java"%>  <%@page contentType="text/html" %>   <script language="Javascript" type="text/javascript">   function createRequestObject() { var tmpXmlHttpObject;   if (window.XMLHttpRequest) {   tmpXmlHttpObject = new XMLHttpRequest();       } else if (window.ActiveXObject) {   tmpXmlHttpObject = new ActiveXObject("Microsoft.XMLHTTP"); }  return tmpXmlHttpObject; }  //call the above function to create the XMLHttpRequest object var http = createRequestObject();  function makeGetRequest(wordId) { //make a connection to the server ... specifying that you intend to make a GET request  //to the server. Specifiy the page name and the URL parameters to send http.open('get','definition.jsp?id='+wordId);       //assign a handler for the response http.onreadystatechange = processResponse;       //actually send the request to the server http.send(null); }  function processResponse() { //check if the response has been received from the server if(http.readyState == 4){       //read and assign the response from the server           var result2 = http.responseText;  var result = http.responseXML.documentElement;                  //do additional parsing of the response, if needed            //in this case simply assign the response to the contents of the <div> on the page.  document.getElementById('description').innerHTML = result2;//[b]this works correctly[/b]           alert(result.getElementByTagName('p')[0].childNodes[0].nodeValue);//nothing happends here            document.getElementById('name').value=result.getElementsByTagName('p')[0].childNodes[0].nodeValue;           [u][b]//above code does not works and this is my problem[/b][/b[/u]] } }   </script> <body>  <form> <input type="text" id="name" size=10 value=" "></input>  </form> <h1>Have you heard these terms before?</h1>  Ceraunophobia More about Ceraunophobia<br> Astraphobia More about Astraphobia<br>   <div id="description">  </div>  </body>  </html>     [b]Definition.jsp[/b]    <%@ page language="java"%><%@ page import="java.sql.*,java.io.*,java.util.*,javax.servlet.*"%> <?xml version="1.0" encoding="UTF-8"?>  <% response.setContentType("text/xml"); response.setHeader("Cache-Control", "no-cache"); response.setHeader("pragma","no-cache"); Class.forName("com.mysql.jdbc.Driver").newInstance(); Connection con=DriverManager.getConnection("jdbc:mysql://itserver:3306/manzor?user=root&password="); Statement st= con.createStatement(); Statement st1= con.createStatement();  ResultSet rs,rs1; String id=request.getParameter("id");  rs=st.executeQuery("select * from user where USERTYPE='"+id+"'");  if(rs.next()){    %>  // p tag is here , can't display it //<p> <p> <%=rs.getString(1)%></p>  //<p>  <%  }  %>[code]  [/code]  please help
    Message was edited by:
    manu_am
    Message was edited by:
    manu_am

    I'm not an AWT expert, but here's my best guess to the problem...
    I'm not sure that the ActionListener is the correct event listener to use here.
    I don't think the straight TextArea throws action events, I could be wrong here I mainly have experience with swing.
    What event are you trying to react to here? Also is there any reason for not using Swing? Then you can use the JTextArea.
    Hope I'm of some help :)

  • Please help to find the error  in the following code

    REPORT ZTESTSAMPLE.
    CLASS C1 DEFINITION.
    PUBLIC SECTION.
    METHODS M1.
    ENDCLASS.
    CLASS C1 IMPLEMENTATION.
    METHOD M1.
    WRITE: /'HELLO'.
    endmethod.
    endclass.
    DATA OREF TYPE REF TO C1.
    *CREATE OBJECT OREF.
    OREF->M1().

    Hi,
    here is the solution
    CLASS C1 DEFINITION
    CLASS c1 DEFINITION.
    PUBLIC SECTION.
    METHODS m1.
    ENDCLASS. "C1 DEFINITION
    CLASS C1 IMPLEMENTATION
    CLASS c1 IMPLEMENTATION.
    METHOD m1.
    WRITE: /'HELLO'.
    ENDMETHOD. "M1
    ENDCLASS. "C1 IMPLEMENTATION
    DATA : oref TYPE REF TO c1.
    START-OF-SELECTION.
    CREATE OBJECT : oref.
    CALL METHOD oref->m1.
    reward if helpful

  • I am currently getting finder error screen saying "Quartz-filter plugin" error, Please report to apple. Can anyone please help me find a resolution for this error?

    I am currently getting finder error screen saying "Quartz-filter plugin" error, Please report to apple. Can anyone please help me find a resolution for this error?

    If it were me I would schedule an appointment at the store where you bought it and meet with the Manager of the store in person. Print this post and bring it with you along with your iMac.
    And change the password on your Apple ID and then see if there are in purchases in your account that you did not make. If there are then someone did get your ID and password. If not someone got your Credit Card information from somewhere and used it.

  • Please try to find out error in this program

    Hi abapers,
      when i execute this report , i got the error. please anybody find the error "Runtime Errors         GETWA_NOT_ASSIGNED"
    Short text
        Field symbol has not yet been assigned." this error i got..
    please help me..
    REPORT  ZBLOCKED_ALV_CLS.
    *Data Objects to avoid tables work area.
    DATA: V_KUNNR TYPE KNA1-KUNNR,
          V_LIFNR TYPE LFA1-LIFNR.
    *Logiv to maintain frist block.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
      SELECT-OPTIONS: CUSTOMER FOR V_KUNNR.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
      SELECT-OPTIONS: VENDOR FOR V_LIFNR.
    SELECTION-SCREEN END OF BLOCK B2.
    TYPES: BEGIN OF TY_VBAK,
           VBELN TYPE VBELN_VA,
           ERDAT TYPE ERDAT,
           END OF TY_VBAK.
    TYPES: BEGIN OF TY_EKKO,
           EBELN TYPE EBELN,
           AEDAT TYPE ERDAT,
           END OF TY_EKKO.
    DATA: WA_VBAK TYPE TY_VBAK,
          WA_EKKO TYPE TY_EKKO,
          I_VBAK TYPE STANDARD TABLE OF TY_VBAK,
          I_EKKO TYPE STANDARD TABLE OF TY_EKKO.
    TYPE-POOLS: SLIS.
    DATA: REPID TYPE SY-REPID.
    DATA: LAYOUT TYPE SLIS_LAYOUT_ALV,
          FCAT TYPE SLIS_FIELDCAT_ALV,
      F_VBAK LIKE STANDARD TABLE OF FCAT,
      F_EKKO LIKE STANDARD TABLE OF FCAT,
      I_EVENTS TYPE SLIS_T_EVENT.
    START-OF-SELECTION.
    REPID = SY-REPID.
    * REPID TYPE SY-REPID.
    PERFORM: GET_DATA,
             COL_HEAD.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
      EXPORTING
        I_CALLBACK_PROGRAM             = SY-REPID.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        IS_LAYOUT                        = LAYOUT
        IT_FIELDCAT                      = F_VBAK
        I_TABNAME                        = 'I_VBAK'
        IT_EVENTS                        = I_EVENTS
    *   IT_SORT                          =
    *   I_TEXT                           = ' '
      TABLES
        T_OUTTAB                         = I_VBAK
    * EXCEPTIONS
    *   PROGRAM_ERROR                    = 1
    *   MAXIMUM_OF_APPENDS_REACHED       = 2
    *   OTHERS                           = 3
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        IS_LAYOUT                        = LAYOUT
        IT_FIELDCAT                      = F_EKKO
        I_TABNAME                        = 'I_EKKO'
        IT_EVENTS                        = I_EVENTS
    *   IT_SORT                          =
    *   I_TEXT                           = ' '
      TABLES
        T_OUTTAB                         = I_EKKO
    * EXCEPTIONS
    *   PROGRAM_ERROR                    = 1
    *   MAXIMUM_OF_APPENDS_REACHED       = 2
    *   OTHERS                           = 3
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.
    *&      Form  GET_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM GET_DATA .
    SELECT VBELN ERDAT FROM VBAK INTO TABLE I_VBAK WHERE KUNNR IN CUSTOMER.
      SELECT EBELN AEDAT FROM EKKO INTO TABLE I_EKKO WHERE LIFNR IN VENDOR.
    ENDFORM.                    " GET_DATA
    *&      Form  COL_HEAD
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM COL_HEAD .
    PERFORM BUILD_CAT USING:
          'VBELN' 'VBAK' 'VBELN' 'I_VBAK' 'SD',
          'ERDAT' 'VBAK' 'ERDAT' 'I_VBAK' 'SD',
          'EBELN' 'EKKO' 'EBELN' 'I_EKKO' 'MM',
          'AEDAT' 'EKKO' 'AEDAT' 'I_EKKO' 'MM'.
    ENDFORM.                    " COL_HEAD
    *&      Form  BUILD_CAT
    *       text
    *      -->P_0238   text
    *      -->P_0239   text
    *      -->P_0240   text
    *      -->P_0241   text
    *      -->P_0242   text
    FORM BUILD_CAT  USING    VALUE(P_0238)
                             VALUE(P_0239)
                             VALUE(P_0240)
                             VALUE(P_0241)
                             VALUE(P_0242).
      CLEAR FCAT.
      IF P_0242 = 'SD'.
        FCAT-REF_FIELDNAME = P_0238.
        FCAT-REF_TABNAME = P_0239.
        FCAT-FIELDNAME = P_0240.
        FCAT-TABNAME = P_0241.
        APPEND FCAT TO F_VBAK.
    ENDIF.
    IF P_0242 = 'MM'.
        FCAT-REF_FIELDNAME = P_0238.
        FCAT-REF_TABNAME = P_0239.
        FCAT-FIELDNAME = P_0240.
        FCAT-TABNAME = P_0241.
        APPEND FCAT TO F_VBAK.
    ENDIF.
    ENDFORM.                    " BUILD_CAT
    Thanks,
    Vinay.
    Edited by: abapvinay on Apr 19, 2011 4:56 AM

    Hi,
    You have passed as shown below :
    IF p_0242 = 'SD'.
        fcat-ref_fieldname = p_0238.
        fcat-ref_tabname = p_0239.
        fcat-fieldname = p_0240.
        fcat-tabname = p_0241.
        APPEND fcat TO f_vbak.
      ENDIF.
      IF p_0242 = 'MM'.
        fcat-ref_fieldname = p_0238.
        fcat-ref_tabname = p_0239.
        fcat-fieldname = p_0240.
        fcat-tabname = p_0241.
        APPEND fcat TO f_vbak. " Change this to F_EKKO
      ENDIF.
    Hope this helps
    Regards,
    Madhukar Shetty

  • Please help me fix the error

    I am not done with the program but I get errors that I am not sure how to fix them. I was wondering if anyone can help me solve the problem.
    This program is a quiz program and has to handle 3 subjects. The user is able to select from these 3 categories. The program presents 3 questions and has to provide 4 option for each question. One would be to exit from the quiz. If the user responds to a question correctly, the program displays a positive feedback message. If the user responds incorrectly to the question, the program displays the correct answer. Exiting the questions menu returns the student to the topics menu. At the end of the quiz, the program displays the total number of correct and incorrect answers for each topic. Have a counter to count the correct answers.
    Plese help me fix the problem with the code
    import java.util.Scanner;
    import java.io.*;
    public class Test
    int correctAnswer = 0;
    String str;
    String q;
    Scanner scan = new Scanner (System.in);
    System.out.println("key in m for Math category, s for Science category, a for Art category, or x to exit the test");
    String str = scan.nextLine();
    while (str != 'x')
    if( str == m)
    System.out.println (" What is the area if Triangle? a) l*W b)S^2 c)1/2 b * h");
    q = scan.nextLine();
    if (q == c)
    System.out.println(" your answer is correct");
    correctAnswer = correctAnswer+1
    else System.out.println(" your answer is not correct");
    System.out.println ("What is the premiter? a)The distance of all the sides b)the parallel distance c)The angle of a shape");
    q = scan.nextLine();
    if (q == a)
    System.out.println(" your answer is correct");
    correctAnswer = correctAnswer+1
    else System.out.println(" your answer is not correct");
    System.out.println ("What is a right angle? a)100 degree b)180 degree c)90 degree");
    q = scan.nextLine();
    if (q == c)
    System.out.println(" your answer is correct");
    correctAnswer = correctAnswer+1
    else System.out.println(" your answer is not correct");
    if( str == s)
    System.out.println (" What is Diffusion? a)No movement between Molecules b)Movement of molecules high to low c)Movement of molecules high to low");
    q = scan.nextLine();
    if (q == c)
    System.out.println(" your answer is correct");
    correctAnswer = correctAnswer+1
    else System.out.println(" your answer is not correct");
    System.out.println ("What is the element sign for carbon dioxide? a)CO2 b)CO c)O2");
    q = scan.nextLine();
    if (q == a)
    System.out.println(" your answer is correct");
    correctAnswer = correctAnswer+1
    else System.out.println(" your answer is not correct");
    System.out.println ("What is the normal body temperature? a)98.5 b)99.0 c)102.1");
    q = scan.nextLine();
    if (q == a)
    System.out.println(" your answer is correct");
    correctAnswer = correctAnswer+1
    else System.out.println(" your answer is not correct");
    if( str == a)
    System.out.println ("which artist painted the Monalisa? a)Michael Angelo b)Leonardo De Vinci c)Pablo Picasso ");
    q = scan.nextLine();
    if (q == a)
    System.out.println(" your answer is correct");
    correctAnswer = correctAnswer+1
    else System.out.println(" your answer is not correct");
    System.out.println ("which artist painted the Sister Chapple? a)Michael Angelo b)Leonardo De Vinci c)Pablo Picasso ");
    q = scan.nextLine();
    if (q == a)
    System.out.println(" your answer is correct");
    correctAnswer = correctAnswer+1
    else System.out.println(" your answer is not correct");
    System.out.println ("which artist paint the Monalisa? a)Michael Angelo b)Leonardo De Vinci c)Pablo Picasso");
    q = scan.nextLine();
    if (q == b)
    System.out.println(" your answer is correct");
    correctAnswer = correctAnswer+1
    else System.out.println(" your answer is not correct");
    }}

    Here's a better version, fixing what I mentioned above. I haven't test compiled it, but it should work now. As a note, you might want to look into the ++ operator as well. And when you post code, enclose it in the "code" tags (see the code button above your posting). That makes it easier to read.
    Anyway, here it is:
    import java.util.Scanner;
    import java.io.*;
    public class Test {
         int correctAnswer = 0;
         String str;
         String q;
         Scanner scan = new Scanner (System.in);
         static public void main(String [] args) {
              System.out.println("key in m for Math category, s for Science category, a for Art category, or x to exit the test");
              String str = scan.nextLine();
              while (!str.equals("x")) {
                   if( str.equals("m")) {
                        System.out.println (" What is the area if Triangle? a) l*W b)S^2 c)1/2 b * h");
                        q = scan.nextLine();
                        if (q.equals("c")) {
                             System.out.println(" your answer is correct");
                             correctAnswer = correctAnswer+1;
                        } else {
                              System.out.println(" your answer is not correct");
                        System.out.println ("What is the premiter? a)The distance of all the sides b)the parallel distance c)The angle of a shape");
                        q = scan.nextLine();
                        if (q.equals("a")) {
                             System.out.println(" your answer is correct");
                             correctAnswer = correctAnswer+1;
                        } else {
                              System.out.println(" your answer is not correct");
                        System.out.println ("What is a right angle? a)100 degree b)180 degree c)90 degree");
                        q = scan.nextLine();
                        if (q.equals("c")) {
                             System.out.println(" your answer is correct");
                             correctAnswer = correctAnswer+1;
                        } else { System.out.println(" your answer is not correct");
                   if( str.equals("s")) {
                        System.out.println (" What is Diffusion? a)No movement between Molecules b)Movement of molecules high to low c)Movement of molecules high to low");
                        q = scan.nextLine();
                        if (q.equals("c")) {
                             System.out.println(" your answer is correct");
                             correctAnswer = correctAnswer+1;
                        } else {
                             System.out.println(" your answer is not correct");
                        System.out.println ("What is the element sign for carbon dioxide? a)CO2 b)CO c)O2");
                        q = scan.nextLine();
                        if (q.equals("a") {
                             System.out.println(" your answer is correct");
                             correctAnswer = correctAnswer+1;
                        } else {
                             System.out.println(" your answer is not correct");
                        System.out.println ("What is the normal body temperature? a)98.5 b)99.0 c)102.1");
                        q = scan.nextLine();
                        if (q.equals("a")) {
                             System.out.println(" your answer is correct");
                             correctAnswer = correctAnswer+1;
                        } else {
                             System.out.println(" your answer is not correct");
                   if( str.equals("a")) {
                        System.out.println ("which artist painted the Monalisa? a)Michael Angelo b)Leonardo De Vinci c)Pablo Picasso ");
                        q = scan.nextLine();
                        if (q.equals("a")) {
                             System.out.println(" your answer is correct");
                             correctAnswer = correctAnswer+1;
                        } else {
                             System.out.println(" your answer is not correct");
                        System.out.println ("which artist painted the Sister Chapple? a)Michael Angelo b)Leonardo De Vinci c)Pablo Picasso ");
                        q = scan.nextLine();
                        if (q.equals("a")) {
                             System.out.println(" your answer is correct");
                             correctAnswer = correctAnswer+1;
                        } else {
                              System.out.println(" your answer is not correct");
                        System.out.println ("which artist paint the Monalisa? a)Michael Angelo b)Leonardo De Vinci c)Pablo Picasso");
                        q = scan.nextLine();
                        if (q.equals("b")) {
                             System.out.println(" your answer is correct");
                             correctAnswer = correctAnswer+1;
                        } else {
                             System.out.println(" your answer is not correct");
    }

  • Please Help me with the error P6

    I recently installed the Primavera P6 but when I started
    using it for the first time I get the following error
    message :
    C:\Program files\Primavera\Project
    Management\Languages\comCaptions.en-us
    <br
    />Please help me with this error ;
    Thanks

    Hi,
    This sounds like an issue
    that might best be handled by support. You can find
    information on contacting support here:<br
    /><br
    />http://www.primavera.com/customer/support.asp<br
    />
    Thanks,
    Sean

  • Please help me with the error ASAP

    I am trying to write an ABAP statement for the below requirement.
    Function has two import parameters. 1. key and 2. date.
                                Export parameter: export_rec like TAB.
    Req:  I need to select a record from a table where key = input parameter and input date lies between the from and to date fields in the table. (since table is time dependent).
    EXPORT_REC like TAB,
    I_T_TAB like TAB OCCURS 0 WITH HEADER LINE.
    SELECT  SINGLE * FROM I_T_TAB INTO EXPORT_REC WHERE KEY = IMPORT_ PARAMETER AND IMPORT_PARAM_DATE BETWEEN FROM_DATE AND TO_DATE.
    But, I am getting errors. It says the I_T_TAB is not defined in the Abap dictionary as table, view or projection.
    I defined it as an internal table. But, even then I am getting this error.
    Can anyone please help me out with this issue,
    Thanks,
    Regards,
    aarthi
    [email protected]

    Hi aarthi,
    SELECT can be used to fetch data only from database tables/views. in your case you used SELECT from an INTERNAL table,which is not allowed.
    SELECT  *
           FROM <DBTABLE NAME>
           INTO TABLE EXPORT_REC
           WHERE KEY = IMPORT_ PARAMETER AND   
           IMPORT_PARAM_DATE BETWEEN FROM_DATE AND TO_DATE.
    HERE Instead of <DBTABLE NAME>,you have to give your Database table,which stores these values.
    then your data will comes into EXPORT_REC.
    and remember to give EXPORT_REC in TABLES parameters of that FUNCTION MODULE and give associated Type for that.
    Regards
    Srikanth

  • Help in finding the error

    Hi All,
    I have executed the folloowing scripts
    create or replace function aj_dump_csv( p_query in varchar2,
    p_separator in varchar2
    default ',',
    p_dir in varchar2 ,
    p_filename in varchar2 )
    return number
    AUTHID CURRENT_USER
    is
    l_output utl_file.file_type;
    l_theCursor integer default dbms_sql.open_cursor;
    l_columnValue varchar2(2000);
    l_status integer;
    l_colCnt number default 0;
    l_separator varchar2(10) default '';
    l_cnt number default 0;
    begin
    l_output := utl_file.fopen( p_dir, p_filename, 'w' );
    dbms_sql.parse( l_theCursor, p_query, dbms_sql.native );
    for i in 1 .. 255 loop
    begin
    dbms_sql.define_column( l_theCursor, i,
    l_columnValue, 2000 );
    l_colCnt := i;
    exception
    when others then
    if ( sqlcode = -1007 ) then exit;
    else
    raise;
    end if;
    end;
    end loop;
    dbms_sql.define_column( l_theCursor, 1, l_columnValue,
    2000 );
    l_status := dbms_sql.execute(l_theCursor);
    loop
    exit when ( dbms_sql.fetch_rows(l_theCursor) <= 0 );
    l_separator := '';
    for i in 1 .. l_colCnt loop
    dbms_sql.column_value( l_theCursor, i,
    l_columnValue );
    utl_file.put( l_output, l_separator ||
    l_columnValue );
    l_separator := p_separator;
    end loop;
    utl_file.new_line( l_output );
    l_cnt := l_cnt+1;
    end loop;
    dbms_sql.close_cursor(l_theCursor);
    utl_file.fclose( l_output );
    return l_cnt;
    end dump_csv;
    The above script runs successfully
    then I run the following script
    create or replace procedure aj_test_dump_csv
    as
    l_rows number;
    begin
    l_rows := dump_csv( 'select *
    from all_users
    where rownum < 25',
    ',', 'C:\Documents and Settings\amit_jaiswal01\My Documents\amit\Stuff\Pl-SQL', 'aj_from_rec.csv' );
    end;
    I get the error script executed with compile errors
    Can anyone help?
    Regards.

    Run the two scripts seperately.
    SQL> create or replace procedure aj_test_dump_csv
    as
    l_rows number;
    begin
    l_rows := aj_dump_csv( 'select *
    from all_users
    where rownum < 25',
    ',', 'C:\Documents and Settings\amit_jaiswal01\My Documents\amit\Stuff\Pl-SQL', 'aj_from_rec.csv' );
    end;
    If this gives you any error, then run the below statement to view the error,
    SQL>SHOW ERROR
    Copy the error message which you get and update us.

  • Can someone please help me find the correct driver for my audio ca

    Hello, it's famke again...Still trying to find drivers.. My sound card is apparently also missing drivers... I've tried many drivers from different sites matching the information i've taken off the card...but for some reason i always get a big red slash through my audigy sound control panel after trying to install the driver and reboot my system... I'm convinced i haven't been able to find the correct driver... The information off the card is...Soundblaster Audigy 2ZS M:SB0350... If anyone can help out i would greatly appreciate this...Famke.

    I'm new to this, but I also had trouble for a while in finding and installing the right drivers. Eventually I got it to work with the link below. Follow the steps and select everything it suggests (I did and it worked for me). You might want to try it and see if it works for you too. Good Luck. http://www.creative.com/language.asp...wnloads/su.asp

  • Please help to find the correct answers

    Hi,
    Please send an url to study about the below questions with short and easily understandable explanation with simple example.Please help to improve my knowledge for the below concepts.
    1.     String
    2.     String Buffer
    3.     String Builder
    4.     finally
    5.     final
    6.     finalize
    7.     static
    8.     Abstract Class
    9.     Interface
    10.     Inheritance
    11.     Overloading
    12.     Overriding
    13.     Wrapper class
    14.     Collection
    15.     Array
    16.     Array List
    17.     Linked List
    18.     Vector
    19.     Hash Table
    20.     Hash Map
    21.     Hash Set
    22.     Tree Set
    23.     Set
    24.     List
    25.     Map
    26.     Itterator
    27.     Enumeration
    28.     Comparator
    29.     Comparable
    30.     Auto Boxing and Un Boxing
    31.     Generics
    32.     JDBC Drivers
    33.     Statement
    34.     Prepared Statement
    35.     Callable Statement
    36.     ResultSet
    37.     Stub and Skelton
    38.     Marshalling and UnMarshalling
    39.     Sterilization
    40.     Synchronization
    41.     Thread
    42.     Servlet Life Cycle
    43.     Generic Servlet
    44.     HttpServlet
    45.     RequestDispacher
    46.     Forward
    47.     Redirect
    48.     ServletContext
    49.     ServletConfig
    50.     Filter
    51.     Throttle Filter
    52.     GZip Filter
    53.     Session Handling
    54.     Jsp Life Cycle
    55.     JSP Action tags
    56.     JSP Include Directives
    57.     JSP: plug-in
    58.     MVC Pattern
    59.     Implementation of struts using mvc with flow
    60.     Hibernate
    61.     EJB
    62.     Session Bean
    63.     Entity Bean
    64.     Inner Join
    65.     Outer Join
    66.     Left outer Join
    67.     Right Outer Join
    68.     Stored Procedure and how to call in java
    Thanks in advance,
    Regards,
    Saravanan.K

    Note: This thread was originally posted in the [CLDC and MIDP|http://forums.sun.com/forum.jspa?forumID=76] forum, but moved to this forum for closer topic alignment.
    To the Original Poster: the forum does not function as your personal homework solving process. If you have specific questions about these subjects that's fine.
    Meanwhile I suggest you read [The Java Tutorials|http://java.sun.com/docs/books/tutorial/]
    Edited by: dcminter on 08-Sep-2009 15:02

  • Can't find the error on this small code :S

    Hi , i've just compiled this code and i can't find what is wrong! :(
    The compiler is ok, but the output print its not what i was expect.
    If u insert 121 (capicua) the answer is: This number its not a capicua :S
    what is wrong?
    thanks!!
    Note: Don't create another code plz.
    import java.io.*;
    public class Capicua {
         public static void main (String[] args) throws Exception {
              int digit, num;
              int inverted = 0;
                   BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
                   System.out.print(" Insert number: ");
                   num=Integer.parseInt(br.readLine().trim());
                   while(num > 0) {
                   digit = num % 10;
                   num = num /10;
                   inverted = inverted * 10 + digit;
                   if(num == inverted) {
                        // to be capicua the number inserted must
                        //be equals to the inverted
                        System.out.println("Its Capicua!");      
                   }else{
                        System.out.println("This number is not a Capicua!");
    }

    Please use code tags (see button above posting box) when posting code. It makes it much easier to read.
    So, it appears that capicua means palindrome--the number reads the same backwards and forwards. Is that correct?
    There are ways of doing this without converting the 121 to a number, but I won't explain that unless you want.
    I think your problem is this line:
    if (num == inverted)
    You have changed "num" within your while loop. Therefore, num is no longer the original input 121.
    Try adding println statements like this to watch what happens:
    while(num > 0) {
      digit = num % 10;
      num = num /10;
      inverted = inverted * 10 + digit;
      System.out.println("digit = " + digit);
      System.out.println("num = " + num);
      System.out.println("inverted = " + inverted);
    }

Maybe you are looking for

  • Help with album display

    Is it possible to restrict the text at the bottom of the album display to artist name only?

  • Showtime anytime error when trying to login

    When I try to sign on I  sometimes get,  tus 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.springframework.web.util.NestedServletException: Re

  • Need the classes for fm REUSE_ALV_HIERSEQ_LIST_DISPLAY  does.

    I have a requirement where  I need to display header and item using alv classes..  (the same functionality that REUSE_ALV_HIERSEQ_LIST_DISPLAY function module does).  If any one worked on this please guide.

  • Screen says ok to disconnect

    the top says disk mode and it mainly says ok to disconnect with a check mark... help please? (: ipod nano   Windows XP     Windows XP  

  • Automatic STO for materials with split valuation

    Hey Gurus, Our client uses plant-to-plant STO to do transfers among internal plants. The current process: Run MRP in receiving plants --> MRP generates PReq --> Release PReq --> Assign Preq and create STO(from here, buyers manually check stock at iss