Check the code - URGENT!

HI All,
To fetch the fallowing required fields from the related tables by the selection criteria Material No and Posting dates. Using ALV.
I have written code for that but its not showing any results..plz go through my code and if possible rectify it.
I am also attaching the selection criteria details and table with required field.
Field Name Description Required level Reference Table
MATNR Material No. Selection Criteria. (MARC)
BUDAT Posting Date Selection criteria. (MKPF)
MAKTX material Description Layout (MAKT)
BEDAT PO Date Layout (EKKO)
EBELN Purchase Order No. Layout (EKPO)
MENGE Purchase Order Qty. Layout (EKPO)
BPRME Order Price Unit Layout (EKPO)
NETWR PO Net Value Layout (EKPO)
BSTMG GR QTY Layout (MSEG)
DMBTR GR Value Layout (MSEG)
BPRBM Invoice Qty Layout (EKBE)
REFWR Invoice value Layout (EKBE)
here is my code:-
TABLES: marc,
        mkpf,
        mseg,
        ekko,
        ekpo,
        ekbe,
        rseg.
TYPE-POOLS: slis.
DATA: BEGIN OF itab OCCURS 0,
      matnr LIKE marc-matnr,
      budat LIKE ekbe-budat,
      maktx LIKE makt-maktx,
      bedat LIKE ekko-bedat,
      ebeln LIKE mseg-ebeln,
      menge LIKE mseg-menge,
      bprme LIKE mseg-bprme,
      netwr LIKE ekpo-netwr,
      bstmg LIKE mseg-bstmg,
      dmbtr LIKE mseg-dmbtr,
      bprbm LIKE rseg-bprbm,
      refwr LIKE ekbe-refwr,
END OF itab.
DATA: i_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
wa_fieldcat TYPE slis_fieldcat_alv.
DATA v_repid TYPE sy-repid.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_matnr FOR marc-matnr,
                s_budat FOR mkpf-budat.
SELECTION-SCREEN END OF BLOCK b1.
INITIALIZATION.
  v_repid = sy-repid.
START-OF-SELECTION.
SELECT werks smbln bstmg dmbtr matnr ebeln FROM mseg INTO
CORRESPONDING FIELDS OF TABLE itab
   WHERE matnr IN s_matnr.
**ENDSELECT.
SELECT SINGLE lifnr FROM ekko INTO CORRESPONDING FIELDS OF itab
   WHERE ebeln = mseg-ebeln.
SELECT ebeln menge FROM ekpo INTO CORRESPONDING FIELDS OF itab
   WHERE ebeln = mseg-ebeln.
ENDSELECT.
SELECT ebeln belnr refwr budat FROM ekbe INTO CORRESPONDING FIELDS OF
itab
WHERE budat IN s_budat AND
       ebeln = mseg-ebeln.
ENDSELECT.
SELECT SINGLE matnr FROM marc INTO itab
WHERE matnr = mseg-matnr.
**APPEND itab.
**END-OF-SELECTION.
SELECT matnr ebeln menge bprme bstmg dmbtr FROM mseg INTO
CORRESPONDING FIELDS OF TABLE itab
   WHERE matnr IN s_matnr.
SELECT matnr maktx FROM makt INTO CORRESPONDING FIELDS OF TABLE itab
WHERE matnr = mseg-matnr.
SELECT ebeln bedat FROM ekko INTO CORRESPONDING FIELDS OF TABLE itab
WHERE ebeln = mseg-ebeln.
SELECT ebeln netwr FROM ekpo INTO CORRESPONDING FIELDS OF TABLE itab
WHERE ebeln = mseg-ebeln.
SELECT ebeln bprbm FROM rseg INTO CORRESPONDING FIELDS OF TABLE itab
WHERE ebeln = mseg-ebeln.
SELECT budat ebeln refwr FROM ekbe INTO CORRESPONDING FIELDS OF TABLE itab
WHERE budat IN s_budat AND
       ebeln = mseg-ebeln.
  SELECT matnr ebeln menge bprme bstmg dmbtr FROM mseg INTO CORRESPONDING FIELDS OF TABLE itab WHERE matnr IN s_matnr.
  SELECT matnr maktx FROM makt INTO CORRESPONDING FIELDS OF TABLE itab FOR ALL ENTRIES IN itab WHERE matnr = itab-matnr.
  SELECT ebeln bedat FROM ekko INTO CORRESPONDING FIELDS OF TABLE itab FOR ALL ENTRIES IN itab WHERE ebeln = itab-ebeln.
  SELECT ebeln netwr FROM ekpo INTO CORRESPONDING FIELDS OF TABLE itab FOR ALL ENTRIES IN itab WHERE ebeln = itab-ebeln.
  SELECT ebeln bprbm FROM rseg INTO CORRESPONDING FIELDS OF TABLE itab FOR ALL ENTRIES IN itab WHERE ebeln = itab-ebeln.
  SELECT budat ebeln refwr FROM ekbe INTO CORRESPONDING FIELDS OF
    TABLE itab FOR ALL ENTRIES IN itab
  WHERE budat IN s_budat AND
  ebeln = itab-ebeln.
  APPEND itab.
  PERFORM build_fieldcatlog.
  PERFORM display_alv_report.
LOOP AT itab.
*WRITE:/ itab-menge, itab-werks, itab-smbln, itab-bstmg, itab-matnr,
*itab-ebeln, itab-lifnr, itab-menge, itab-belnr, itab-refwr, itab-budat.
ENDLOOP.
*&      Form  build_fieldcatlog
      text
-->  p1        text
<--  p2        text
FORM build_fieldcatlog .              "Form BUILD_FIELDCATLOG, Start
  wa_fieldcat-fieldname = 'maktx'.
  wa_fieldcat-seltext_m = 'maktx.'.
  APPEND wa_fieldcat TO i_fieldcat.
  CLEAR wa_fieldcat.
  wa_fieldcat-fieldname = 'bedat'.
  wa_fieldcat-seltext_m = 'bedat.'.
  APPEND wa_fieldcat TO i_fieldcat.
  CLEAR wa_fieldcat.
  wa_fieldcat-fieldname = 'EBELN'.
  wa_fieldcat-seltext_m = 'ebeln.'.
  APPEND wa_fieldcat TO i_fieldcat.
  CLEAR wa_fieldcat.
  wa_fieldcat-fieldname = 'MENGE'.
  wa_fieldcat-seltext_m = 'menge.'.
  APPEND wa_fieldcat TO i_fieldcat.
  CLEAR wa_fieldcat.
  wa_fieldcat-fieldname = 'bprme'.
  wa_fieldcat-seltext_m = 'bprme.'.
  APPEND wa_fieldcat TO i_fieldcat.
  CLEAR wa_fieldcat.
  wa_fieldcat-fieldname = 'netwr'.
  wa_fieldcat-seltext_m = 'netwr.'.
  APPEND wa_fieldcat TO i_fieldcat.
  CLEAR wa_fieldcat.
  wa_fieldcat-fieldname = 'BSTMG'.
  wa_fieldcat-seltext_m = 'bstmg.'.
  APPEND wa_fieldcat TO i_fieldcat.
  CLEAR wa_fieldcat.
  wa_fieldcat-fieldname = 'dmbtr'.
  wa_fieldcat-seltext_m = 'dmbtr.'.
  APPEND wa_fieldcat TO i_fieldcat.
  CLEAR wa_fieldcat.
  wa_fieldcat-fieldname = 'bprbm'.
  wa_fieldcat-seltext_m = 'bprbm'.
  APPEND wa_fieldcat TO i_fieldcat.
  CLEAR wa_fieldcat.
  wa_fieldcat-fieldname = 'REFWR'.
  wa_fieldcat-seltext_m = 'refwr.'.
  APPEND wa_fieldcat TO i_fieldcat.
  CLEAR wa_fieldcat.
ENDFORM.                    "build_fieldcatlog
" build_fieldcatlog        "Form BUILD_FIELDCATLOG, End
*&      Form  display_alv_report
      text
FORM display_alv_report.      "Form DISPLAY_ALV_REPORT, Start
  v_repid = sy-repid.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program     = v_repid
      it_fieldcat            = i_fieldcat[]
      i_callback_top_of_page = 'TOP-OF-PAGE'
      i_save                 = 'A'
    TABLES
      t_outtab               = itab.
ENDFORM.                    "display_alv_report
TOP-OF-PAGE.
  WRITE:/ 'Purchase request Print program'.
END-OF-PAGE.

hi,
put a break point in ur select statement and check whether sy-subrc eq to 0 or 4. i think ur select staement is not executing.
and generally matnr is of 18 character length so use call FM 'CONVERSION_ALPHA_EXIT_INPUT'  as
p_matnr like mara-matnr.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
  EXPORTING
    input         = p_matnr
IMPORTING
   OUTPUT        = matnr
use this for ebeln also if ur select statement doesn't work.
if helpful reward some points.
with regards,
Suresh Aluri.

Similar Messages

  • Please check the code

    I AM TRYING TO REPLICATE THE ADDRESS OF EQUIPMENT FROM ECC TO CRM.
    I AM ABLE TO REPLICATE THE IDENTIFICATION NUMBER.
    WHILE USING THE SAME FUNCTION MODULE FOR ADDRESS, THE ADDRESS IS NOT GETTING REPLICATED.
    PLEASE CHECK THE CODE AND TELL ME WHAT PRE-REQUISITES MUST BE TAKEN INTO CONSIDERATION AND IS THERE ANY MISTAKE FROM ME.
    FULL POINTS WILL BE REWARDED.
    ITS VERY VERY URGENT.
    METHOD IF_EX_CRM_EQUI_LOAD~ENLARGE_COMPONENT_DATA.
    **Data declarations
    DATA:
        ls_equi          type crmt_equi_mess,
        ls_comp          type ibap_dat1,
        ls_comp_det1     TYPE IBAP_COMP3,
        ls_address_data  type ADDR1_DATA,
        ls_object      type comt_product_maintain_api,
        ls_object1     type comt_product,
        lv_object_id   type IB_DEVICEID,
        lv_object_guid type IB_OBJNR_GUID16.
    **Map Sort field from ECC to CRM
    Read table it_equi_dmbdoc-equi into ls_equi index 1.
    lv_object_id  = ls_equi-equnr.
    move is_object to ls_object.
    move ls_object-com_product to ls_object1.
    lv_object_guid = ls_object1-product_guid.
    move is_component to ls_comp.
    ls_comp_det1-deviceid    = lv_object_id.
    ls_comp_det1-object_guid = lv_object_guid.
    ls_comp_det1-EXTOBJTYP   = 'CRM_OBJECT'.
    ls_comp_det1-ibase       = ls_comp-ibase.
    ls_address_data-roomnumber = '1000'.
    ls_address_data-floor = '10'.
    ls_address_data-country = 'US'.
    CALL FUNCTION 'CRM_IBASE_COMP_CHANGE'
      EXPORTING
       i_comp                       = ls_comp
       I_COMP_DET             = ls_comp_det1
       I_ADDRESS_DATA     = ls_address_data
      I_ADDRESS_ADMIN           =
      I_PARTNER                 =
      I_DATE                    =
      I_TIME                    =
    EXCEPTIONS
      DATA_NOT_CONSISTENT       = 1
      IBASE_LOCKED              = 2
      NOT_SUCCESFUL             = 3
      OTHERS                    = 4
    *IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
    ENDMETHOD.

    Hi S B,
    May I the procedure for the replication of serialnumber into device ID that is Identification field In Ibase.
    And one more thing need this to be codded in the standard badi or needed an copy of the implementation .
    plz help me as u already have done the requirement.
    u will be twice rewarded.
    Thanking u in advance for the reply.
    Sree.

  • I didnt konw how to make a new account for my iTues card so i did it with a diffrent email but that email doesnt exist and when i tried to make it on a real email i just sai invalid code check the code and try again and can u please help me

    please help me it is a card of 25 dollars and i dont want it to go to waist i by mistake thought you used a frake email so i made one up i thought i was going to have a new one but then it said it was going to send a verifaction to my email so then i tried to use a real email and put in the code but it just kept on saying invalid code. check the code and try again. and i dont know what to do can u please please help me it was a gift and i really dont want it to go to waist please i need help

    for #1
    Frequently asked questions about Apple ID - Apple Support
    I have multiple Apple IDs. Is there a way for me to merge them into a single Apple ID?
    Apple IDs cannot be merged. You should use your preferred Apple ID from now on, but you can still access your purchased items such as music, movies, or software using your other Apple IDs.
    If you are wondering how using multiple Apple IDs relate to iCloud, see Apple IDs and iCloud.
    for #2
    Apple does not accept unsolicited ideas see Apple - Legal - Unsolicited Idea Submission Policy

  • Apple TV keeps asking my for my Credit Card verification code and I punch it in, still asks me for it, and restarted everything, went to my computer, checked the code, all is set, still can't rent a movie. Please help!

    Apple TV keeps asking my for my 3digit  Credit Card verification code and I punch it in, it still asks me for it, and went to my computer on iTunes store, checked the code, all is set and saved, go back to Apple TV still can't rent a movie, I still get the same Verification Required message without any further information after I punch in my 3digits. When I hit submit, the page goes back to the same place to type the code again, and yes the code is 100% accurate. I tried restoring the apple tv, every thing is up to date on all devices and signed in and out of my itunes store on my Mac, still no luck. Please help!

    This issue actually started a week ago... see: https://discussions.apple.com/message/23399558#23399558
    to determine if there are the same problems you are experiencing.  I have spent over 6 hours on this issue trying to isolate if it is a hardware, software, network, iTunes account, or Apple device issue.  My initial results indicate it is a software specific issue related to the Apply TV hardware device.

  • How to check the code source of some function in the portal.

    hi all.
    i have some problem  in the portal.
    i use the ESS in the portal, and now some people can not check their salary.
    i want to check the code source, but i do not know it uses which program.
    can some one tell me the way to check the program.
    best regards.

    If you want to access the source code of any ESS component, you will need access to NWDI. NWDI NWDI = NetWeaver Development Infrastructure, it provide the tools and process to build new / modify existing applications built using NWDS. There are plenty of threads discussing how to set up NWDI, you may search for the same.
    However if the payslip problem is only for some users, it could also be a pdf issue, have you tried running the payslip for those select users within ECC?
    Thanks,
    GLM

  • Check the code pls. getting attachment but some data missing

    HI all,
    PLs check the  code. I am getting mail in the attachment is having only " 12".  i am not getting 13 and 14.
    where i am doing wrong. ?
    TABLES:adr6.
    TYPES: BEGIN OF t_test,
    x(3),
    y(3),
    z(3),
    END OF t_test.
    DATA: itab TYPE STANDARD TABLE OF t_test,
    wa TYPE t_test.
    SELECT-OPTIONS : s_rcvr FOR adr6-smtp_addr LOWER CASE VISIBLE LENGTH 30
    NO INTERVALS OBLIGATORY.
    wa-x = 12.
    wa-y = 13.
    wa-z = 14.
    APPEND wa TO itab.
    *LOOP at itab INTO wa.
    WRITE:/ wa-x, wa-y, wa-z.
    *ENDLOOP.
    PERFORM send_email.
    **& Form send_email
    *text
    *--> p1 text
    *<-- p2 text
    FORM send_email .
      DATA : lo_mail_docu TYPE REF TO cl_document_bcs,
      lo_sender TYPE REF TO if_sender_bcs VALUE IS INITIAL,
      lo_recipient TYPE REF TO if_recipient_bcs VALUE IS INITIAL ,
      lo_send_request TYPE REF TO cl_bcs VALUE IS INITIAL ,
      l_oref TYPE REF TO cx_root,
      l_message_body TYPE bcsy_text VALUE IS INITIAL,
      l_message_line LIKE LINE OF l_message_body,
      l_doc_subject TYPE so_obj_des,
      l_file_subject TYPE so_obj_des,
      l_mail_subject TYPE string,
      l_text TYPE string.
      DATA itab_bin TYPE TABLE OF solix.
      CONCATENATE 'Error' ' Log ' INTO l_doc_subject SEPARATED BY space.
      l_mail_subject = l_doc_subject.
      CALL FUNCTION 'SCMS_TEXT_TO_BINARY'
        TABLES
          text_tab   = itab
          binary_tab = itab_bin.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      CONCATENATE 'Attached is the' 'log file generated '
      INTO l_message_line-line SEPARATED BY space.
      APPEND l_message_line TO l_message_body.
      APPEND '' TO l_message_body. APPEND '' TO l_message_body.
      TRY.
          lo_mail_docu = cl_document_bcs=>create_document(
          i_type = 'RAW'
          i_text = l_message_body
          i_subject = l_doc_subject ).
          lo_mail_docu->add_attachment(
          EXPORTING
          i_attachment_type = 'TXT'
          i_attachment_subject = l_file_subject
          i_att_content_hex = itab_bin ).
          lo_send_request = cl_bcs=>create_persistent( ).
          CALL METHOD lo_send_request->set_message_subject
            EXPORTING
              ip_subject = l_mail_subject.
          LOOP AT s_rcvr .
            lo_recipient = cl_cam_address_bcs=>create_internet_address( s_rcvr-low ).
            lo_send_request->add_recipient(
            EXPORTING
            i_recipient = lo_recipient
            i_express = '' ).
          ENDLOOP.
          lo_send_request->set_document( lo_mail_docu ).
          lo_send_request->set_send_immediately( 'X' ).
          lo_send_request->send( ).
        CATCH : cx_send_req_bcs INTO l_oref,
        cx_document_bcs INTO l_oref,
        cx_address_bcs INTO l_oref.
      ENDTRY.
      COMMIT WORK.
      FREE : lo_mail_docu, lo_send_request, lo_sender, lo_recipient, l_oref.
      REFRESH : l_message_body, itab_bin.
      CLEAR : l_message_line, l_doc_subject, l_mail_subject, l_file_subject,
      l_text.
    ENDFORM.                    "send_email
    Thanks
    krupali

    HI Jelena,
    I think we cannot commenting the
    CALL FUNCTION 'SCMS_TEXT_TO_BINARY'  because we are transfering the data in binary format.
    Have you got the mail with full ITAb data ?
    have you tried it ?
    I have tried by commenting the
    CALL FUNCTION 'SCMS_TEXT_TO_BINARY'  but getting syntax error.
    Any other idea please  ?
    Thanks in advance
    krupali.

  • Im trying to redeem my prepaid illustrator card and it keeps coming up with an 'invalid code" I've check the code but I've typed the right code in. Help?

    Im trying to redeem my prepaid illustrator card and it keeps coming up with an 'invalid code" I've check the code but I've typed the right code in. Help?

    Redemption Code http://helpx.adobe.com/x-productkb/global/redemption-code-help.html

  • How to check the code of spawned report

    Hi All,
    I've to modify a standard report from PA module.The report name is "PRC: Distribute Usage and Miscellaneous Costs"
    The executable method is SPAWNED.The executable name is PASDUC.
    Please let me know how to check the code of this report and in which path can I locate the report.
    Regards,
    Mahi.

    Does this mean can I tell to my client that "This is being a spawned program, any customizations to this report needs full report development efforts"?I believe yes.
    Before I state this to my client I want to verify with this forum. Please suggest me in either case.Would your client trust my reply on here :) ?
    I would suggest you log a SR and confirm this with Oracle support, that would be a better proof.
    Thanks,
    Hussein

  • URGENT check the code for vendor ageing (Give Solution)

    hi this is the code which i am using to calculate the
    ageing but not able to get the result.
    every time the result is 0.plz suggest me the solution.
    its very urgent.
    *& Report  Z_VENDOR AGEING                                                    *
    *&  in this repoet I am calculating the vendor ageing
        which is depending on formula
        AGEING = Current Date(or any date entered by user) – Bline Date(BSIK-zfbdt) 
    REPORT  z_vendor  NO STANDARD PAGE HEADING
                      LINE-SIZE 200
                      LINE-COUNT 65(3).
    TABLES : bsik.
    DATA : BEGIN OF t_out OCCURS 0,
           bukrs LIKE bsik-bukrs,
           saknr LIKE bsik-saknr,
           bldat LIKE bsik-bldat,
           wrbtr LIKE bsik-wrbtr,
           lifnr LIKE bsik-lifnr,
           zfbdt like bsik-zfbdt,
           ageing type i,
           END OF t_out.
    parameters : p_date1 type d.
    SELECT-OPTIONS : s_bukrs FOR bsik-bukrs,
                     s_saknr FOR bsik-saknr,
                     s_lifnr FOR bsik-lifnr.
    SELECT bukrs saknr bldat wrbtr lifnr zfbdt
           FROM bsik
           INTO  TABLE t_out
           WHERE saknr IN s_saknr
           AND bukrs IN s_bukrs
           AND lifnr IN s_lifnr.
    CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
      EXPORTING
        i_datum_bis                   = p_date1
        i_datum_von                   = t_out-zfbdt
      I_KZ_EXCL_VON                 = '0'
      I_KZ_INCL_BIS                 = '0'
      I_KZ_ULT_BIS                  = ' '
      I_KZ_ULT_VON                  = ' '
      I_STGMETH                     = '0'
      I_SZBMETH                     = '1'
    IMPORTING
       E_TAGE                        = t_out-ageing
    EXCEPTIONS
      DAYS_METHOD_NOT_DEFINED       = 1
      OTHERS                        = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LOOP AT t_out.
      WRITE : / t_out-saknr,
                t_out-lifnr,
                t_out-wrbtr,
                t_out-zfbdt,
                t_out-ageing.
    ENDLOOP.

    hi sanjeev,
    still problem there.
    dont worry. just copy this code.
    try this code.
    TABLES : bsik.
    DATA : BEGIN OF t_out OCCURS 0,
    bukrs LIKE bsik-bukrs,
    saknr LIKE bsik-saknr,
    bldat LIKE bsik-bldat,
    wrbtr LIKE bsik-wrbtr,
    lifnr LIKE bsik-lifnr,
    zfbdt like bsik-zfbdt,
    ageing type i,
    END OF t_out.
    parameters : p_date1 type d.
    SELECT-OPTIONS : s_bukrs FOR bsik-bukrs,
    s_saknr FOR bsik-saknr,
    s_lifnr FOR bsik-lifnr.
    SELECT bukrs saknr bldat wrbtr lifnr zfbdt
    FROM bsik
    INTO <b>corresponding fields of</b> TABLE t_out
    WHERE saknr IN s_saknr
    AND bukrs IN s_bukrs
    AND lifnr IN s_lifnr.
    <b>loop at t_out.</b>
    CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
    EXPORTING
    i_datum_bis = p_date1
    i_datum_von = t_out-zfbdt
    I_KZ_EXCL_VON = '0'
    I_KZ_INCL_BIS = '0'
    I_KZ_ULT_BIS = ' '
    I_KZ_ULT_VON = ' '
    I_STGMETH = '0'
    I_SZBMETH = '1'
    IMPORTING
    E_TAGE = t_out-ageing
    EXCEPTIONS
    DAYS_METHOD_NOT_DEFINED = 1
    OTHERS = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    <b>modify t_out.</b>
    clear t_out.
    <b>endloop.</b>
    LOOP AT t_out.
    WRITE : / t_out-saknr,
    t_out-lifnr,
    t_out-wrbtr,
    t_out-zfbdt,
    t_out-ageing.
    endloop
    rgds
    anver
    Message was edited by: Anversha s

  • Urgent-Please check the code

    Hi There,
    Could you please have a look at the code below and suggest whether I am using If else in good manner or not?
    User will enter Start date and end date at begbalance level and account value is also calculated at begbalance then we need to copy that value to months starting from the Start date month so I need to convert the integer value of month to string month.but it is giving error.
    var monthsdiff,endyear,startyear,startmonth,endmonth;
    fix("budget","begbalance",..........)
    Fix("hsp_inputvalue")
    "Account1"
    startmonth=@INT(@MOD("Date-start",10000)/100);
    Monthsidff=..........;
    if(startmonth=1)
    &startmon= "JAN";
    elseif(startmonth=2)
    &startmon= "FEB";
    elseif(startmonth=3)
    &startmon= "MAR";.........till dec
    endif
    if(endmonth=1)
    &endmon= "JAN";
    elseif(endmonth=2)
    &endmon= "FEB";
    elseif(endmonth=3)
    &endmon= "MAR"...till dec
    endif
    fix(&startmon)
    if(startyear==&CurrYear and endyear==&CurrYear)
    "Account1"=("Account1"/12) *monthsdiff;
    endfix
    else
    "Account1"->"may"=("Account1"/12) * monthsdiff;
    endfix
    endif
    endfix
    endfix
    here Curryear is 2011.
    Thanks
    Edited by: user10760185 on Sep 20, 2011 2:19 AM

    It looks like you are trying to assign a value to a substitution variable in your calc, you can't do that. ^^^Until quite recently, yes, but now if you read Robb Salzmann's blog and grab his CDF: http://codingwithhyperion.blogspot.com/2011/08/create-and-update-substitution.html
    Btw, beyond Robb's code being a cool hack, I'm not entirely sure I'd want to change sub var values on the fly but it at least appears to be possible.
    Regards,
    Cameron Lackpour

  • Please check the code why it is not working

    I am a new java servlets and jsp learner. I am running below example of session in Tomcat and "AccessCount" supposed to be increased by one value whenever servelet is refereshed. But I am always getting 0 value even after refereshing it.
    I will appreciate your help.
    =======================================================
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.net.*;
    import java.util.*;
    /** Simple example of session tracking. See the shopping
    * cart example for a more detailed one.
    public class ShowSession extends HttpServlet {
    public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    String title = "Session Tracking Example";
    String heading;
    HttpSession session = request.getSession(true);
    // Use getAttribute instead of getValue in version 2.2.
    Integer accessCount = (Integer)session.getAttribute("accessCount");
    if (accessCount == null) {
    accessCount = new Integer(0);
    heading = "Welcome, Newcomer";
    } else {
    heading = "Welcome Back";
    accessCount = new Integer(accessCount.intValue() + 1);
    // Use setAttribute instead of putValue in version 2.2.
    session.setAttribute("accessCount", accessCount);
    out.println("<html><h1>" + title + "</h1>" +
    "<BODY BGCOLOR=\"#FDF5E6\">\n" +
    "<H1 ALIGN=\"CENTER\">" + heading + "</H1>\n" +
    "<H2>Information on Your Session:</H2>\n" +
    "<TABLE BORDER=1 ALIGN=\"CENTER\">\n" +
    "<TR BGCOLOR=\"#FFAD00\">\n" +
    " <TH>Info Type<TH>Value\n" +
    "<TR>\n" +
    " <TD>ID\n" +
    " <TD>" + session.getId() + "\n" +
    "<TR>\n" +
    " <TD>Creation Time\n" +
    " <TD>" +
    new Date(session.getCreationTime()) + "\n" +
    "<TR>\n" +
    " <TD>Time of Last Access\n" +
    " <TD>" +
    new Date(session.getLastAccessedTime()) + "\n" +
    "<TR>\n" +
    " <TD>Number of Previous Accesses\n" +
    " <TD>" + accessCount + "\n" +
    "</TABLE>\n" +
    "</BODY></HTML>");
    /** Handle GET and POST requests identically. */
    public void doPost(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    doGet(request, response);
    ========================================================

    Change the code
    HttpSession session =
    request.getSession(true);AS
    HttpSession session =
    request.getSession(false);If you pass "false", then the Session is not created.
    If you pass "true" the session is always created
    new.
    Thanks and regards,
    Pazhanikanthan. PI dont think that's correct -
    1. request.getSession(false) returns a Session object if one exists.
    2. request.getSession(true) creates a new Session object if it doesnt exist or returns the reference to the existing object if the request is part of an valid session.
    OP, check with default session-timeout values in web.xml
    Ram.

  • Can we get Arraylist from String.Please check the code

    Hi all,
    I have just pasted my code over here.Can anyone of you find the solution for obtaining the Array list from the String.
    For Example :
    ArrayList al = new ArrayList();
    al.add(new byte[2]);
    al.add("2");
    String stringVar = "" + (ArrayList) al;
    Here I can convert the arraylist into string.But can we do he vice versa like obtaining the above arraylist from the string?If please advice me.
    URGENT!!!!

    cudIf you run the code you posted you will observe that the string form of the list does not contain all the information of the list: in particular the array elements are missing. It follows that the "vice versa" conversion you seek is simply not possible.
    A variation on this theme is the following:import java.util.ArrayList;
    public class ListEg {
        public static void main(String[] args) {
            ArrayList al = new ArrayList();
            al.add("foo");
            al.add("bar, baz");
            String stringVar = "" + (ArrayList) al;     
            System.out.println(stringVar);
    }If you think about the output you should be able to conclude that lists with different contents can easily have the same string form.
    Just something to chew on.

  • Please check the code reg mail implementation and give guide lines to me

    Hi experts
    I written some code for implementing the mail in webdynpro using java mail API,i did not get the out put ,Is any configuration i have to do in webdynpro or WAS
    Can any body review my code and tell me where i mistaken in the implementation .Is there any thing i want to configure .Here with i am sending my code in the action of Send button
    public void onActionSendMail(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionSendMail(ServerEvent)
        // get the values entered by the user  in the form
        try{
        String toAddress=wdContext.currentContextElement().getTo();
        String ccAddress=wdContext.currentContextElement().getCC();
        String bccAddress=wdContext.currentContextElement().getBCC();
        String subject=wdContext.currentContextElement().getSubject();
        String messageBody=wdContext.currentContextElement().getMessage();
        //set the properties of host and port no
        Properties p = new Properties();
        p.put("mail.transport.protocol","smtp");
        p.put("mail.smtp.host","12.38.145.108");
         p.put("mail.smtp.port","25");
         //get the session object or connection to the mail server or host
         Session sess=Session.getDefaultInstance(p,null);
         //create a MimeMessage and add recipients
         MimeMessage message = new MimeMessage(sess);
         if(toAddress !=null && toAddress.length()>0){
              message.addRecipient(Message.RecipientType.TO, new InternetAddress(toAddress));
         }else
              wdComponentAPI.getMessageManager().reportSuccess("Please Enter the To Address");
         if(bccAddress !=null && bccAddress.length()>0)
         message.addRecipient(Message.RecipientType.BCC, new InternetAddress(bccAddress));
         if(ccAddress !=null && ccAddress.length()>0)
         message.addRecipient(Message.RecipientType.CC, new InternetAddress(ccAddress));
        if(subject!=null && subject.length()>0)
         message.setSubject(subject);
         message.setFrom(new InternetAddress("[email protected]"));
         if((messageBody!=null) && (messageBody.length()>0))
              message.setContent(messageBody,"text/plain");
         }else
              message.setContent("","text/plain"); 
         Transport.send(message);
        catch(Exception e)
             e.printStackTrace();
    Please mail to :  [email protected]
    Thanks and regards
    kalyan

    Hi Venkat,
       The code seems ok to me. you don't need to configure WAS to use JavaMail APIs. However, if this code doesnot work then check with the code given below as this is working fine.
    Properties prop = new Properties();
              prop.put("mail.smtp.host", host);
              prop.put("mail.smtp.auth", "false");
              Session session = Session.getInstance(prop, null);
              session.setDebug(true);
              try {
                   MimeMessage msg = new MimeMessage(session);
                   msg.setFrom(new InternetAddress(from));
                   InternetAddress[] address =
                        { new InternetAddress(to1)};
                   msg.setRecipients(Message.RecipientType.TO, address);
                   msg.setSubject(subject);
                   msg.setSentDate(new Date());
                   MimeBodyPart msg1Body = new MimeBodyPart();
                   msg1Body.setText(msg1);
                   MimeBodyPart msg2Body = new MimeBodyPart();
                   msg2Body.setText(msg2);
                   Multipart mp = new MimeMultipart();
                   mp.addBodyPart(msg1Body);
                   mp.addBodyPart(msg2Body);
                   msg.setContent(mp);
                   Transport.send(msg);
              } catch (AddressException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
                   System.out.print("AddressException : " + e.getMessage());
              } catch (MessagingException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
                   System.out.print("MessagingException : " + e.getMessage());
              } catch (Exception e) {
                   System.out.print("Exception : " + e.getMessage());
    where host is 12.38.145.108 in your case. May be you chk if your mail server  is using another port. 25 is the default port for the smtp. This may be the case that your code is not working.
    Regards:
    Abhinav Sharma
    PS : Do reward points if it helps

  • Please check the Code snippet and detail the difference

    Please go through the two code snippets given below...
    Can some one please let me know if using generics is a better way to denote the signature and if yes, why is it so?
    Thank you
    Two classes:
    class SimpleStr {
         String name = "SimpleStr";
         public SimpleStr(String name) {
              this.name = name;
         public String getName() {
              return this.name;
         public String toString() {
              return getName();
    class MySimpleStr extends SimpleStr {
         String name = "MySimpleStr";
         public MySimpleStr(String name) {
              super(name);
              this.name = name;
         public String getName() {
              return this.name;
         public String toString() {
              return getName();
    Code Snippet 1:
    class AnotherSimpleStr {
         public <S extends SimpleStr>S getInfo() {
              return (S)new MySimpleStr("val3");
    Code Snippet 2:
    class AnotherSimpleStr {
         public SimpleStr getInfo() {
              return new MySimpleStr("val3");
    }

    Also, please see the code below, the getInfo() method is not taking care of Type safety right??!!!!
    class AnotherSimpleStr {
         public <S extends SimpleStr>S getInfo() {
              return (S)new Object();
         public <S extends SimpleStr>S getInfoAgain(Class<S> cls) {
              return (S)new MySimpleStr("Val");
    }

  • Plz check the code

    Hi all,
    Friends please tell me what is the problem with this code.....
    It is not giving what i want.......
    I want only that row in the table to have orange background which contains the value 'check'..
    but what it does is that it sets all the other rows as orange too....
    but when i select all the rows in the table.....it does show the color of the cell which contains 'check' and the color of the rest of the cells which are set to highlight color...
    please chk the following code and let me know if there is any error...
    public class ErrorEntryCellRenderer extends DefaultTableCellRenderer {
        /** Creates a new instance of ErrorEntryCellRenderer */
        public ErrorEntryCellRenderer() {
        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
            Component retValue;
            retValue = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
            if(value instanceof String) {
                if(((String)value).equalsIgnoreCase("check")) {
                    setBackground(Color.ORANGE);
                    validate();
            return retValue;
    }Thank you..
    Message was edited by:
    vaibhavpingle

    it doesnt work then...it does not paint any thing......
    i did the following changes
    public Component getTableCellRendererComponent(JTable table, Color c, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
            Component retValue;
            retValue = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
            if(value instanceof String) {
                if(((String)value).equalsIgnoreCase("check")) {
                    setBackground(Color.ORANGE);
                    validate();
                } else {
                    setBackground(c);
                    validate();
            return retValue;
        }

Maybe you are looking for

  • MacBook Pro Stalls/Running slow since Mavericks Installation

    On the advice of the more experienced here is a new thread. Since installing Mavericks my MBP has gone from pretty much an instant response to requests, to stalling, the spinning pinwheel, longer startup and shutdown times, as well as slower access t

  • I bought a new Macbook Air, and got an error when trying to register it with my Apple ID

    So, I bought a new Macbook Air and tried to register it with my Apple ID, however I get an error about the product being already registered. I haven't registered it yet. How can I fix this?

  • Unable to display Ship to part country in smartforms

    Hi , The problem is iam unable to dispaly the ship to party country name in the smartform Delivery note. Just wanted to let you know that the address number for both ship to and sold to party have different numbers. And i have also mentioned the foll

  • Not dowenload iOS 7.1

    iOS 7.1 not install in my ipd 2 so many time I try to dowenload but all the time I found the err

  • Mini scripting in Java?

    What I want to be able to do is the following. Lets say we have the following simple method String echo(String str) {      return str; }So I want to be able to give Java a piece of String like "echo(\"Hello\")" and get back "Hello". So in essence I w