VERY VERY URGENT Attachment for Opportunity

I want to attach a file using a RFC/BAPI to an opportunity in CRM backend. The file will come in binary format/stream from a .NET iview.
Currently we are trying out the BAPI CRM_ICSS_UPLOAD_SR_ATTACHMENT. The file data that we given in binary format seems to go into CRM tables but when we see the opportunity through the front end transaction we dont see the file in the Attachments tab.
Please help as we want the solution urgently. Once this BAPI works we plan to make a WSDL out of it to be called from the .NET iview.

Hello sanjay,
As already pointed out you would need to use the method
CREATE_WITH_TABLE of the class CL_CRM_DOCUMENTS.
Below is the code sample that should help you achieve this(lt_file_content conatins the file content in binary).
  ls_bo-instid = iv_parent_guid."header guid of oppt
  ls_bo-typeid = 'BUS2000120'.
  ls_bo-catid  = 'BO'.
  ls_file_info-file_size  = lv_length.
  ls_file_info-file_name  = lv_name.
  ls_file_info-mimetype   = lv_content_type.
  ls_file_info-binary_flg = 'X'.
  APPEND ls_file_info TO lt_file_info.
  CALL METHOD cl_crm_documents=>create_with_table
    EXPORTING
      business_object     = ls_bo
      file_access_info    = lt_file_info
      file_content_binary = lt_file_content
      raw_mode            = 'X'
      parent_folder       = ls_doc_info-loio
    IMPORTING
      error               = ls_error.
I hope this helps you.
Best Regards,
Tanmaya

Similar Messages

  • Searching for the fields of a table(very very urgent)

    Hi all,
    i am in graet trouble now.i am searching for the fields like
    1)country of origin where the finished good is created.
    2) customer sales order number
    3)customer sales order line number
    i am writing a report for delivery order.in this report i have to refer customer PO & customer SO .
      i mean, my company has a customer ( seagate) & seagate has a customer (let maxtor).initially maxtor will give a PO to seagate then seagate will raise a SO againest maxtor.
       Then seagate will send PO number(of maxtor), PO line number,SO number(seagate), SO line number(seagate) to our company.
       Then i have to write a report for sales order & delivery order.in these reports i have to refer seagate PO number & seagate SO number for reference.
    i got PO number as vbkd-bstkd but not getting any field for reference Sales order.plz advice me on this. it is very very urgent.
    ur idea is highly appreaciated.
    Thank u very much.
    Regards
    pabitra

    check out tables VBAK(sales order header), VBAP(sales items)

  • How to enable DFF for each line level on a Table Region - very very urgent

    Hi,
    I have a Master- Detail Page, Detail is Table region. I need to enable DFF (Context Based) for each line. If any one has done similar requirement please share how to do this. Its very very urgent.
    It is a standard page.
    Thanks,
    Edited by: user8996062 on Jun 29, 2011 2:58 AM

    Can any one please help me on this it is very urgent.
    Thanks,

  • Very very urgent Discoverer reports for non oracle applications

    Hi,
    My client is using discoverer 10g with R12.He is using different non oracle applications like BRM Application (database is oracle only) for that they wants to develop discoverer reports.It is possible to integrate with non oracle applications with discoverer.
    Can you please suggest me.It is very very urgent.
    Thanks & Regards.

    Hi
    You're really not supposed to manage a non-Apps mode EUL and an Apps mode data within the same URL. Having said that, I have a hunch you just might be able to do it and there are 2 ways. You can either make the data available to user who login using E-Business Suite credentials or you can make it available to users who have database credentials. The first one is straightforward and you do it just like any other data. Let me give you some hints regarding the second method.
    First of all I ahve not personally tried this and you may find that because Discoverer was initially set up in Apps mode that somewhere down the line it will make the suers connect this way. However, the following is worth a try.
    I would a new schema in the Oracle E-Business database to manage the link to BRM and create a database link from this user to a user in the BRM database. You will also need to create user accounts within the database for anyone who needs to login and run BRM reports.
    Next, I would create views in this new schema pointing at data across the BRM link, thus allowing Discoverer to think these are local objects.
    In Discoverer Administrator, you would need to log in to Discoverer using the owner of the EUL - NOT using SYSADMIN or any of the other E-Business Suite accounts. You should log in with the Oracle Applications checkbox unchecked. You can now create new business areas on the BRM data. You should also be able to assign users to Discoverer privileges and users to business areas.
    Using the same URL you would have Apps users connect using the E-Business Suite item on the drop-down for logging in and you would have BPM users choose the Business Intelligence Discoverer item.
    Let me know how you get on
    Michael

  • Fields for table-----very very urgent

    Hi all,
    my company is following BAPI instead of IDOC for it's EDI immplementation.so i am writing a report for 856 signal(shipment notice).the procedure is like this.
    after shipment creation,i will download all the PO,SO & shipment data to a text file(edi format).then we will transfer this file to 3rd party EDI software.then that software will send that signal or file to our customer.
    i need some datas to download. but i am not getting those fields.you can find these fields in the 856 document of EDI.those field descriptions are like
    1)packaging code
    2)SCAC code
    3)shipment method of payment
    4)waybill number
    5)duns number
    6)entity identification code for customer
    7)measurement reference code for packing item (pallet)
    8)measurement qualifier for packing item like pallet
    9)title transfer date & title transfer time
    it is very very urgent.plz suggest.helpful answers will be rewarded.
    any suggestion will be highly appreaciated.
    Regards
    pabitra

    <b> ALV_GRID_DISPLAY, how to ovewrite subtotal obtained by ALV sort</b>
    I want to overwrite the subtotal value in column C (Currently 60 ) which i got using standard ALV sort.
    Example: using ALV_LIST_DISPLAY function module & sort functionality:
    Column-A____Column-B_____Column-C____Column-D
    K1____________2_____________10__________20
    K1____________2_____________20__________40
    K1____________3_____________30__________90
    subtotal:________7____________60_________150
    Note : Each row in Column C is calculated as D/B.
    I would like to extend the calculation in subtotals also.
    But subtotals give me the sum of values in C.
    In column C,I want 150/7 (subtotal of D / subtotal of B)
    I.E., Column C = 150 / 7 = 21.42.
    Any inputs regarding my problem would be much appreciated.
    Thanks in advance !!

  • USER-EXIT for DELIVERY--very very urgent

    Hi all,
    can u plz tell me the user-exit for delivery i.e this exit should be called after the delivery order is created.
    plz suggest some specific exit.it is very very urgent.
    Regards
    pabitra

    Rout ,
    u cannt find out user exits after the Creation.
    V02V0001            Sales area determination for stock transport order
    V02V0002            User exit for storage location determination
    V02V0003            User exit for gate + matl staging area determination (headr)
    V02V0004            User Exit for Staging Area Determination (Item)
    V50PSTAT            Delivery: Item Status Calculation
    V50Q0001            Delivery Monitor: User Exits for Filling Display Fields
    V50R0001            Collective processing for delivery creation
    V50R0002            Collective processing for delivery creation
    V50R0004            Calculation of Stock for POs for Shipping Due Date List
    V50S0001            User Exits for Delivery Processing
    V53C0001            Rough workload calculation in time per item
    V53C0002            W&S: RWE enhancement - shipping material type/time slot
    V53W0001            User exits for creating picking waves
    VMDE0001            Shipping Interface: Error Handling - Inbound IDoc
    VMDE0002            Shipping Interface: Message PICKSD (Picking, Outbound)
    VMDE0003            Shipping Interface: Message SDPICK (Picking, Inbound)
    VMDE0004            Shipping Interface: Message SDPACK (Packing, Inbound)
    *        FORM-Routinen für Userexits
             include mv50afzz.
             include mv50afz1.
             include mv50afz2.
             include mv50afz3.          "Userexit neu zu Release 3.0A
             include mv50afzk.          "Userexit 4.6A (KOMKG/KOMPG)
             include mv50afzl.          "Userexit 4.6A Liefergruppen
                                                                   "n_693000
             include mv50afzp.          "Userexit for pricing screen input
    Regards
    Prabhu

  • UPDATE ROUTINE --- CUBE --- ODS Very Very URGENT

    Hi Collegues/Friends ,
    First I need to thank for the intiators of this site , as I came to know that for many
    problems we will get different best solutions ... Hoping the same I am posting a question
    which is very very very urgent as the client is running after me for this .
    My Requirement is as Follows. ..
    I Moving the data from Cube to ODS . While i need to write a routine for an extra field in
    ODS based on Billing Quantity in Base Unit of Measure . The Key Field in the ODS Is UNIQKEY
    Transaction and It is a Characterstic in the Cube and we have MAterial as another
    Characteristic  and core element as navigational attribute .
    In the Cube for every UNIQKEY transaction- there are more than One line items. 
    My data fields in the ODS are Billing Quantity in Base Unit of MEasure and and EXTRA FIELD
    : No of Items in Transaction . But the thing is that I have only Billing Quantity in Base
    Unit of Measure in cube as a key figure
    BAsing on the UNIQKEY transcation and Billing Quantity In Base Unit Of Measure I need to
    populate the No of Items in Transaction... For this i need to write a routine .
    Let suppose say that for the Materials the core elements are as follows
    Material  Core element
    10         1 -- fuel -- In liters
    20         2 -- Cigar - in PAck
    30         3 -- Coke - in Cans
    Now Lets see how the records are there in InfoCUbe
    Uniqkey  /  Material  / Core element /Billin Quantiy
    A          /   10      /     1        /    22
    B          /   30      /     3        /    2
    C          /   10      /    1         /  15
    C          /   30      /     3        /     2
    D          /   20      /     2        /    10
    D          /   30      /     3        /    2
    And IN the ODS -- I need to Populate the No OF items in Transaction.
    the Logic behind this as follows .
    1.if Materail is of type  1(Mean if the core element - 1)
    I need to Populate the No of items in tnx = 1
    2.If Material id of type 2 or 3 I need to populate the billing quantity to the no of
    transcations.
    3. If the Uniqkey tanscation contains two line items as  suppose that you have 20 litres of
    fuel and 2 cans of coke, then No of Items in the transaction should be 3 and Billing
    Quantity in BUoM 22
    billing quantity in BUoM = 20 litres for the first line item and 2 for the second line
    item...
    then as the first line item is fuel, field No OF Items in the Transcation should be 1
    (replacing the 20) + 2 = 3
    so the final result in the ODS should be billing quantity in BUoM = 22 and The Items in the
    Transcation = 3
    For this I have Written a Rouinte like this for that field
    PROGRAM UPDATE_ROUTINE.
    $$ begin of global - insert your declaration only below this line  -
    TABLES: /BI0/PMATERIAL.
    DATA: TITEMS LIKE /BIC/AZPOCODS00-/BIC/ZTITEMS,
           CORE_ELEMENT like /BI0/PMATERIAL-RPA_WGH1.
    $$ end of global - insert your declaration only before this line   -
    FORM compute_data_field
      TABLES   MONITOR STRUCTURE RSMONITOR "user defined monitoring
      USING    COMM_STRUCTURE LIKE /BIC/CS8ZPOCTUS04
               RECORD_NO LIKE SY-TABIX
               RECORD_ALL LIKE SY-TABIX
               SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
      CHANGING RESULT LIKE /BIC/AZPOCODS00-/BIC/ZTITEMS
               RETURNCODE LIKE SY-SUBRC "Do not use!
               ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
    $$ begin of routine - insert your code only below this line        -
    fill the internal table "MONITOR", to make monitor entries
    check not COMM_STRUCTURE-material is initial.
      select SINGLE RPA_WGH1
            INTO CORE_ELEMENT
            from /BI0/PMATERIAL
            where
            material = COMM_STRUCTURE-material
            and  OBJVERS <>'D'.
       IF CORE_ELEMENT EQ '1'.
       TITEMS = '1'.
         CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
           EXPORTING
             input         = titems
          IMPORTING
            OUTPUT        = titems
       ELSE.
       TITEMS = COMM_STRUCTURE-BILL_QTY.
       ENDIF.
    result value of the routine
      RESULT = TITEMS..
    if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    $$ end of routine - insert your code only before this line         -
    Does it satisfy all the conditions ?? mentioned above if . As far As i know as the only key
    field in the transcation it will satisfy the first two conditions .
    I want to know or If possioble anybody pls take some pain for me to send the code or any
    Ideas for satisfying all the conditions.
    Hope I will get immediate replies....
    Mail me to [email protected]

    Reddy,
    Please do not post in all sections ... makes it hard to follow up on posts..
    Arun

  • Error during GR(very very urgent)

    Hi all,
    i am using a developed program for GR.i used this program before.there was no error.but now i am facing error like
    <b>PO ordered quqntity exceeded by 18,000 EA.</b>.i am using <b>BAPI_GOODSMVT_CREATE</b> for goods transfer.
    In the selection screen, i am putting
    PO number- PO1
    material number- MAT
    GR quantity- 18,000
    delivery order-111
    i want to receive the material MAT of quantity 18,000 from that PO.initially i have ordered PO quntity as 1 lakh. Till now i have received 42,000 materials,now i try to receive 18,000 materials.but it is showing this type of error.
    This error is fired from the return parameter of that BAPI only.error having message class-M7 & error no-022
    is comming.
    i am giving my coding below.plz suggest where is the problem.it is very very urgent.recently my company has added some patches to update the SAP.is this the cause for that error.plz suggest.
    any idea will be highly appreaciated.
    Regards
    REPORT zmui001
           LINE-SIZE 140
           LINE-COUNT 65
           NO STANDARD PAGE HEADING.
    *-- DATA DECLARATION--
    *-- tables
    TABLES : ekpo,
                ekbe,
             marv.
    *--Includes
    INCLUDE : <icon>.                   " Include for Icons
    *-- Types
    TYPES : BEGIN OF t_mseg,
              ebeln LIKE ekko-ebeln,
              name1 LIKE lfa1-name1,
              lifnr LIKE lfa1-lifnr,
              eknam LIKE t024-eknam,
              mblnr LIKE mkpf-mblnr,
              matnr LIKE ekpo-matnr,
              maktx LIKE makt-maktx,
              lgort LIKE mseg-lgort,
              charg LIKE mseg-charg, "chg: 10/17/2005
              menge LIKE mseg-menge,
              budat LIKE mkpf-budat,
              bldat LIKE mkpf-bldat, " chg : 08/18/2003
              xblnr LIKE mkpf-xblnr,
              END OF t_mseg.
    DATA:  BEGIN OF t_ekbe,
              ebeln LIKE ekbe-ebeln,
              ebelp LIKE ekbe-ebelp,
              bwart LIKE ekbe-bwart,
              matnr LIKE ekbe-matnr,
              menge LIKE ekbe-menge,
              END OF t_ekbe,
              BEGIN OF t_ekpo,
              ebeln LIKE ekpo-ebeln,
              ebelp LIKE ekpo-ebelp,
              matnr LIKE ekpo-matnr,
              menge LIKE ekpo-menge,
              END OF t_ekpo.
    TYPES : BEGIN OF t_options.
            INCLUDE STRUCTURE itcpo.
    TYPES : END OF t_options.
    *--Internal tables
    DATA: BEGIN OF i_item OCCURS 50.    "Create Material Document Item
            INCLUDE STRUCTURE bapi2017_gm_item_create.
    DATA: END OF i_item .
    DATA: BEGIN OF i_return OCCURS 20.  "Return parameter
            INCLUDE STRUCTURE bapiret2.
    DATA: END OF i_return.
    DATA: BEGIN OF i_part OCCURS 0,     " Internal table for split data
            part(20),
          END OF i_part.
    DATA: BEGIN OF i_return1 OCCURS 20.  "Return parameter
            INCLUDE STRUCTURE bapiret1.
    DATA: END OF i_return1.
    *-- Work areas
    DATA: BEGIN OF wa_header .       "Material Document Header Data
            INCLUDE STRUCTURE bapi2017_gm_head_01.
    DATA: END OF wa_header .
    DATA: BEGIN OF wa_return .       "Output Structure
            INCLUDE STRUCTURE bapi2017_gm_head_ret.
    DATA: END OF wa_return .
    *-- Work areas
    DATA: wa_mseg TYPE t_mseg,
             wa_ekbe LIKE t_ekbe,
             wa_ekpo  LIKE t_ekpo,
          wa_options TYPE t_options,
           i_ekbe LIKE STANDARD TABLE OF  t_ekbe,
            i_ekbe2 LIKE STANDARD TABLE OF  t_ekbe,
           i_ekpo  LIKE STANDARD TABLE OF  t_ekpo.
    *---Variables
    DATA: v_first,         " variable to get first digit
          v_set TYPE c,
          v_found TYPE p,
          v_menge TYPE p,
          v_ebeln LIKE ekko-ebeln,
          v_lifnr LIKE ekko-lifnr,
          v_belnr LIKE ekbe-belnr,
          v_postdate LIKE mkpf-budat,
          v_bukrs LIKE marv-bukrs,
          v_datum LIKE sy-datum,
          v_lgort LIKE mard-lgort,   " Stge. location
          v_bwart LIKE mseg-bwart,   " Movement type
          v_infnr LIKE eina-infnr,   " Info record no.
          v_ltsnr LIKE eina-ltsnr.
    *---Constants
    CONSTANTS: c_comma TYPE c VALUE ',',   " For splitting data at commas
               c_01(2) TYPE c VALUE '01',  " For movement code in Bapi
               c_b     TYPE c VALUE 'B',   " For mvt. Indicator in Bapi
               c_save(4) TYPE c VALUE 'SAVE', " For button text
               c_clear(5) TYPE c VALUE 'CLEAR', " For clear button
               c_mvmt(4) TYPE c VALUE 'MVMT',
               c_ok(2)   TYPE c VALUE 'OK',
               c_error(5) TYPE c VALUE 'Error'.
    *--SELECTION SCREEN DESIGN--
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME.
    PARAMETERS:     p_bar(75) ,  " Scanned data from barcode
                p_ebeln LIKE ekko-ebeln, " PO number
                p_matnr LIKE ekpo-matnr, " Material number
                p_menge LIKE ekpo-menge, " Quantity
               p_lifnr LIKE ekko-lifnr, " Vendor code
                p_frbnr LIKE mkpf-frbnr, " Reference doc for goods mvt
                p_status(5) TYPE c.
    SELECTION-SCREEN END OF BLOCK blk1.
    SELECTION-SCREEN PUSHBUTTON 15(10) v_save USER-COMMAND mvmt.
    SELECTION-SCREEN PUSHBUTTON 40(10) v_clear USER-COMMAND clear.
      INITIALIZATION -
    INITIALIZATION.
      v_save = c_save .
      v_clear = c_clear.
    *--AT SELECTION_SCREEN--
    AT SELECTION-SCREEN .
      IF sy-ucomm = c_clear.
        PERFORM f_clear.
      ELSE.
        IF sy-ucomm <> c_mvmt.
           if not  sy-tabix is initial and  sy-ucomm <> c_mvmt.
    *--- Extracting the data by splitting the scanned values.
          PERFORM f_get_split_data.
    *--- Validating the input data.
          PERFORM f_check_inputs.
        ELSE .
    *--- Validating the input data.
          PERFORM f_check_inputs.
    *-- Determining the posting date and period check.
          PERFORM f_get_posting_date.
    *---Post goods movement
          PERFORM f_post_receipt.
        ENDIF.
      ENDIF.
               SUBROUTINES                                               *
    *&      Form  f_check_inputs
        Validating the input parameters
    FORM f_check_inputs.
    *-- Validating material no.
      SELECT SINGLE matnr INTO p_matnr
        FROM mara
          WHERE matnr = p_matnr.
      IF sy-subrc = 4.
        p_status =  c_error.
        MESSAGE e003(zm) WITH 'Material no.'.
      ENDIF.
    *-- Validating JHT reference no.
      SELECT SINGLE ebeln
                    lifnr
                    bukrs
                    INTO (p_ebeln, v_lifnr , v_bukrs)
                    FROM ekko
            where unsez = p_unsez. chg:07072003
              WHERE ebeln = p_ebeln.
      IF sy-subrc = 4.
        p_status =  c_error.
        MESSAGE e003(zm) WITH 'Purchase order no.'.
      ENDIF.
    *-- Validating material po combination
      SELECT SINGLE *
           FROM ekpo
             WHERE ebeln = p_ebeln
               AND matnr = p_matnr.
      IF sy-subrc = 4.
        p_status =  c_error.
        MESSAGE e003(zm) WITH 'Purchase order no.' ' and Material no.'.
      ENDIF.
    *--- Checking for DO entry . (chng : 30/06/2003)
      IF  p_frbnr IS INITIAL.
        MESSAGE e018(m7) WITH 'Delivery no.'.
        p_status =  c_error.
        PERFORM f_clear.
      ENDIF.
    *-- Validating material po do combination
      SELECT SINGLE a~belnr
                    INTO v_belnr
                    FROM ekbe AS a
                      INNER JOIN mkpf AS b
                       ON   abelnr = bmblnr
                       AND agjahr = bmjahr
                      WHERE a~ebeln = ekpo-ebeln
                        AND  a~ebelp = ekpo-ebelp
                        AND  b~xblnr = p_frbnr.
      IF sy-subrc = 0.
        MESSAGE e019(zm) WITH v_belnr.
        p_status = c_error.
        PERFORM f_clear.
      ENDIF.
      p_status =  c_ok.
    ENDFORM.                    " f_check_inputs
    *&      Form  f_get_split_data
       Extracting the data by splitting the Scanned data
    FORM f_get_split_data.
    *-- Splitting the data at commas
      SPLIT p_bar AT c_comma INTO TABLE i_part.
    *-- Assigning the parts to variables.
      LOOP AT i_part.
        v_first = i_part-part+0(1).
        TRANSLATE  v_first TO UPPER CASE.
        CASE v_first .
         WHEN 'V'.
           p_lifnr =  i_part-part+1(10).
          WHEN 'P'.
            p_matnr = i_part-part+1(18).
          WHEN 'Q'.
            p_menge = i_part-part+1(13).
          WHEN 'K'.
            p_ebeln = i_part-part+1(10).
          WHEN 'D'.
            p_frbnr = i_part-part+2(16).
          WHEN OTHERS.
            CONTINUE.
        ENDCASE.
      ENDLOOP.
    ENDFORM.                    " f_get_split_data
    *&      Form  f_get_posting_date
    Determing the posting date for document
    FORM f_get_posting_date.
    *-- get the current period for todays date.
      DATA: l_period LIKE t009b-poper.
      CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
        EXPORTING
          i_date               = sy-datum
          i_periv              = 'K4'
       IMPORTING
         e_buper               = l_period
      E_GJAHR              =
       EXCEPTIONS
         input_false          = 1
         t009_notfound        = 2
         t009b_notfound       = 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.
    *-- Determining whether the open period
      SELECT SINGLE *
                    FROM marv
                    WHERE bukrs = v_bukrs.
      IF sy-subrc = 0.
        IF l_period = marv-lfmon .
          v_postdate = sy-datum.
        ELSE.
          CALL FUNCTION 'BAPI_CCODE_GET_FIRSTDAY_PERIOD'
               EXPORTING
                    companycodeid       = v_bukrs
                    fiscal_period       = marv-lfmon
                    fiscal_year         = marv-lfgja
               IMPORTING
                    first_day_of_period = v_postdate
                    return              = i_return1.
          IF NOT i_return[] IS INITIAL.
            LOOP AT i_return1.
              MESSAGE i016(zm) WITH i_return-message.
            ENDLOOP.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDFORM.                    " f_get_posting_date
    *&      Form  f_post_receipt
    Post the goods receipt for entered data.
    FORM f_post_receipt.
      PERFORM f_fill_item.
      PERFORM f_fill_header.
      PERFORM f_execute_transfer.
      PERFORM f_clear.
    ENDFORM.                    " f_post_receipt
    *&      Form  f_fill_item
      Updating the item data for the GR
    FORM f_fill_item.
    Checking for IQC cycle is done here.(chng : 23/07/2003)
      PERFORM f_check_iqc.
    *---- Assigning movement type as per IQC cycle.(chng : 23/07/2003)
      IF v_lgort IS INITIAL.
        MOVE '101'   TO i_item-move_type.
        SELECT SINGLE lgort INTO i_item-stge_loc
        FROM ekpo
         where ebeln  = v_ebeln and  " chg :07/07/2003
           WHERE ebeln  = p_ebeln AND
               matnr = p_matnr .
      ELSE.
        MOVE v_lgort TO i_item-stge_loc.
        MOVE v_bwart TO i_item-move_type.
      ENDIF.
      MOVE p_matnr TO i_item-material.
      MOVE p_menge TO i_item-entry_qnt.
    move v_ebeln to i_item-po_number. " 07/07/2003
      MOVE p_ebeln TO i_item-po_number.
      MOVE v_lifnr TO i_item-vendor.
      MOVE c_b TO i_item-mvt_ind.
    select single ebelp into i_item-po_item " chg :29/07/2003
       from ekpo
          where ebeln  = p_ebeln
            and   matnr = p_matnr
           and elikz = ''.
      SELECT ebeln
                ebelp
                matnr
                menge
                INTO CORRESPONDING FIELDS OF TABLE i_ekpo
                FROM ekpo
                WHERE ebeln = p_ebeln
                   AND matnr = p_matnr
                   AND loekz = '' .
      SORT i_ekpo BY ebeln ebelp matnr.
      LOOP AT i_ekpo INTO wa_ekpo.
        IF v_found = 0.
          SELECT ebeln  ebelp
                bwart  menge
                INTO CORRESPONDING FIELDS OF TABLE i_ekbe
                FROM ekbe
                WHERE ebeln = p_ebeln
                AND ebelp = wa_ekpo-ebelp
                AND matnr = p_matnr.
                          and elikz = '' .  CHG -- 03/19/2004
          IF sy-subrc = 0.
            LOOP AT i_ekbe INTO wa_ekbe .
              IF wa_ekbe-bwart = '101'.
                v_menge = v_menge + wa_ekbe-menge.
              ENDIF.
              IF wa_ekbe-bwart = '102'.
                v_menge = v_menge - wa_ekbe-menge.
              ENDIF.
              IF wa_ekbe-bwart = '122'.
                v_menge = v_menge - wa_ekbe-menge.
              ENDIF.
            ENDLOOP.
    chng: 03/19/2004 compare po qty against receipt
            v_menge = v_menge + p_menge .
            IF wa_ekpo-menge >= v_menge .
              v_found = 1.
              MOVE wa_ekpo-ebelp TO i_item-po_item.
            ENDIF.
          ELSE .
            v_found = 1.
            MOVE wa_ekpo-ebelp TO i_item-po_item.
          ENDIF.
        ENDIF.
        CLEAR : wa_ekbe, i_ekbe, v_menge.
      ENDLOOP.
      IF v_found = 0 .
        MESSAGE e003(zm) WITH ' delivery items'.
      ENDIF.
      APPEND i_item.
      CLEAR : i_item, v_found .
    ENDFORM.                    " f_fill_item
    *&      Form  f_check_iqc
    Checking the storage location for the (chng : 23/07/2003)
    FORM f_check_iqc.
      CALL FUNCTION 'Z_M_GET_IQC_STATUS'
           EXPORTING
                matnr          = p_matnr
                lifnr          = v_lifnr
           IMPORTING
                lgort          = v_lgort
                bwart          = v_bwart
                ltsnr          = v_ltsnr
                infnr          = v_infnr
           EXCEPTIONS
                non_iqc_vendor = 1
                OTHERS         = 2.
      IF sy-subrc <> 0.
        CLEAR : v_lgort , v_bwart , v_ltsnr.
      ENDIF.
    ENDFORM.                    " f_check_iqc
    *&      Form  f_fill_header
      Updating data in the header
    FORM f_fill_header.
      MOVE v_postdate TO wa_header-pstng_date.
      MOVE sy-datum TO wa_header-doc_date.
      MOVE p_frbnr TO wa_header-ref_doc_no.
    ENDFORM.                    " f_fill_header
    *&      Form  f_execute_transfer
          Executing the goods movement.
    FORM f_execute_transfer.
      CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
           EXPORTING
                goodsmvt_header  = wa_header
                goodsmvt_code    = c_01
           IMPORTING
                goodsmvt_headret = wa_return
           TABLES
                goodsmvt_item    = i_item
                return           = i_return.
      IF i_return[] IS INITIAL .
        COMMIT WORK.
    *---  UPdating Info record for IQC cycle ind.(chng : 23/07/2003)
        IF NOT v_ltsnr IS INITIAL.
          UPDATE eina SET ltsnr = v_ltsnr
          WHERE infnr = v_infnr.
        ENDIF.
        REFRESH : i_item.
        CLEAR : wa_header,v_ltsnr , v_infnr,v_bwart,v_lifnr.
        MESSAGE i012(migo) WITH wa_return-mat_doc.
        PERFORM f_do_print.
      ELSE.
        REFRESH : i_item.
        CLEAR : wa_header,v_ltsnr , v_infnr,v_bwart,v_lifnr.
        PERFORM write_errors.
      ENDIF.
    ENDFORM.                    " f_execute_transfer
    FORM write_errors.
      WRITE: 0(90) sy-uline ,
             /0'|',
              3 'System messages for GR posting',
              90 '|',
             /0(90) sy-uline .
      LOOP AT i_return.
        CASE  i_return-type.
          WHEN 'E'.
            MESSAGE i016(zm) WITH i_return-message.
          WHEN 'W'.
            MESSAGE i017(zm) WITH i_return-message.
          WHEN 'I'.
           WRITE: /0'|',
                  icon_yellow_light AS ICON ,
                  '|',
                  10 i_return-message,
                  90 '|'.
            MESSAGE i018(zm) WITH i_return-message.
          WHEN 'S'.
           WRITE: /0'|',
                  icon_green_light AS ICON ,
                  '|',
                  10 i_return-message,
                  90 '|'.
            MESSAGE i018(zm) WITH i_return-message.
          WHEN OTHERS.
           WRITE: /0'|',
                  icon_red_light AS ICON ,
                  '|',
                  10 i_return-message,
                  90 '|'.
            MESSAGE e016(zm) WITH i_return-message.
        ENDCASE.
       AT LAST .
         WRITE:/0(90) sy-uline .
       ENDAT.
      ENDLOOP.
    ENDFORM.                    " write_errors
    *&      Form  f_clear
    Clearing the input parameters
    FORM f_clear.
      CLEAR : p_ebeln ,
              p_bar,
              p_matnr,
              p_frbnr,
              v_lifnr,
              p_menge,
              p_status.

    Hi all,
    can anyone suggest any idea?
    Regrds
    pabitra

  • How to test Scenario with AS2 adapter..!!!Very Very Urgent..!!

    Hi All,
    We have provided the partner details like AS2ID,URL,Port and certificates.
    They ask me to do some sample testing whether files are reaching to partner system or not.
    I done all the required steps in IR and ID...
    1. Can anyone suggest me how to do the testing
    2. Where to monitor for AS2 messges?
    3. How to see the our output files whether we are sending the correct files or not?
    4. Outbound -- How we will come to know whether file reached to partner or not?If we set sync Mdn.. where we can see the MDN..?
    5. Inbound-- How we will come to know whether file has sent to us or not?
    Someone pls explain step by step how to do the testing using AS2 adapters for both Outbound and Inbound.
    Its Very Very urgent.
    Waiting for your replys..
    Regards
    Deepthi.

    Hi Deepthi,
    1. Can anyone suggest me how to do the testing
    A) Like message monitoring in RWB we have a particular link to monitor the message through differnt seeburger adapter.
    I dont remember the link right now.
    2. Where to monitor for AS2 messges?
    A) Through the same link.
    3. How to see the our output files whether we are sending the correct files or not?
    A) u mean to check the output file data or strucutre if strucutre is not proper then u will get the error message and ur mapping fails.
    4. Outbound -- How we will come to know whether file reached to partner or not?If we set sync Mdn.. where we can see the MDN..?
    I have no idea.
    5. Inbound-- How we will come to know whether file has sent to us or not?
    File is sent over wan so when it will be pickd up by XI.
    Thnx
    Chirag

  • How to use a DropDownList in Java Swing.Its very very Urgent

    Hi Sir,
    Here i need to know how to do (or) create a dropdownlist by using Java Swing.I know that there is JMenuBar & JMenuItems without using that when i click a JButton for example the dropdownlist should come from the top to bottom.I have already posted this quesion once.And i found that it has been removed.So i hope that this time i will get a better answer.Pls.do provide the code as well sir.So that i will be very thankful to u.Since i am involved in a project which contains this
    feature.It is very very Urgent.So pls.do provide the code i will be waiting for the reply.
    Thanx,
    m.ananthu

    use JComboBox
    JComboBox liste = new JComboBox(new Object[]{"azerty","qwerty});the api documentation :
    http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JComboBox.html
    the turotial on combobox :
    http://java.sun.com/docs/books/tutorial/uiswing/components/combobox.html

  • Consignment price (very very urgent)

    Hi all,
    i am writting a report on consignment stock.i am taking material from MKOL table where as i am taking consignment price from MKOP(konpr) table if TCURM-konsi = ''.
    that means if tcurm-konsi is initial then it will extract the pricing data from MKOP.
    i checked the TCURM table in which konsi field is 'X'.that means tcurm-konsi is not initial.so it will not go for MKOP data.
    IN the mean while , i checked MKOP table but there is no records present at all.it is fully empty.
    Now, if not TCURM-konsi is initial.
    then from which tables, i will get the related pricing data for consignment.
    so, from which table i have to take the consignment price & per unit price as well.
    any idea will be highly appreaciated.
    it is very urgent.plz advice me on this.
    Thanks & regards
    pabitra

    Hi ravi kanth,
    Thank u very much.i have already used that FM ME_READ_INFORECORD to get the price.but the price is comming wrongly.The price for all the materials are same.i am getting same price for every material but in MB54, the price is different.
    can u plz provide some code for the condition
    if tcurm-konsi = 'x'.
    i am really confused. i have already followed the steps ,what the program RM07MKBS is doing. but getting the same price for every material.plz suggest.
    it is very very urgent.
    Regards
    pabitra

  • To insert the xml data's generated dynamically it to orac very very urgent

    I AM WORKING IN A PROJECT WHICH RECEIVES THE DATA FROM FLAT FILES
    AND CONVERT IT TO XML FILE>
    I am in need to convert the xml file generated dynamically through out the year map it to correct datafield it the database and insert it in to oracle data base using java and jsp, servlets.
    i also need mechanism to be explained detailed and some sample codeings
    of converting the data from database to xml because
    and i also need to convert the data taken from sql server7.0 put it in xml file and once again read parse and insert in to oracle database.
    some sample codeings of the mechanisma and explaninations.
    I am in very very urgent-

    Hello sir,
    Thanks for the guidence.
    I need to insert data's into database columns where i should fetch data from xml file.
    please
    urgent.

  • JSP Question..Very Very Urgent....Please help....

    Hi...
    I am working on customizing existing JSP Page. The idea is to retrieve the customer name as show in 1 and send is as run time parameter to SQL query and use the result of select statement to pass it to 2.
    <INPUT TYPE="HIDDEN" NAME="soldtoCustPartyName" VALUE="<%= soldtoCustPartyName %>">.............1
    The above line of code gives the customer name. We need to find the site id for the above customer and pass it to the following line of code. site id will replace the hardcoded number '7945'.
    pageContext.setAttribute("party_site_id", new BigDecimal(7945), PageContext.REQUEST_SCOPE);...............2
    Hence we create database connection to find out site id. The query will return the site id depending upon the customer name as in 1. SQL statement will be something like:
    select site_id from ..... where fixed conditions and sitename = (from 1).
    How can we create SQL statement to take run time values.
    For eg. we do the following to execute Query after connecting to the databse..
    Statement statement = connection.createStatement();
    ResultSet rs = null;
    rs = statement.executeQuery("SELECT party_id from apps.hz_party_sites where cust_name='IBM'");
    <% rs.next(); %>
    <% out.print(rs.getInt("party_id")); %>
    How can the above query be modified to take run time value for cust_name.
    THIS IS VERY VERY URGENT.....PLEASE HELP.......

    Where are these run time values coming from? The user is entering the values into a form with that input?
    If so, then the user will need to submit the form, you need a servlet to process the form, take the value from the parameter with the same name as the input, insert it into the SQL statement, and run the database query, get the results and store them in the context you want.

  • PCUI 4.0 Cookbook/Documentation very very urgent

    Dearest experts
    I have been having problems trying to access the pcui and have tried going through the forum but its still not helping. I need it case management implementation. I know there's a documentation link that was created but there is not pcui 4.0 documentation.
    I therefore request for the pcui cookbook, or any documentation required for setting up my pcui. your co-operation will be greatly rewarded in the form of marks.It is very very urgent
    my email address is <removed by SDN Forum Moderator>

    Hello,
    I close this Topic because the Documents requested are available via the Topic Links to CRM Documentation.
    Regards
    Gregor Wolf
    SDN CRM Forum Moderator

  • Pls...help...printing the whole delivery order...very very urgent

    Can anybody help me in this code.
    I would like to print out delivery order,but when i printed,it just printed out the whole delivery order in the bottom of A4 paper.Can anybody modify the source code and give me proper one?
    I would it to fit on A4 paper.
    These are the soource code,Pls help,it's very urgent.Thanks for any help.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.*;
    import java.sql.*;
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import java.awt.print.*;
    import java.awt.geom.*;
    public class ConfirmDeliveryOrderDialog extends JDialog implements ActionListener,Printable
    private ResultSetTableModel retrieveDOInfoModel;
    private JTable newDOTable;
    private JScrollPane newDOSp;
    private JLabel comT1,comT2,comT3,doT,doID,doIDNo,receivedDate,actualReceivedDate,deliveryTo,deliveryToCustomerInfo,
    companyAddress,companyAddressInfo,tel,telNo,dispatchDate,actualDispatchDate,total,totalQuantity,
    inputTotalQuantity,totalKg,inputTotalKg,remark,inputRemark;
    private Line2D line,line1;
    private Graphics2D g;
    private Container cp;
    private JButton printBtn,exitBtn;
    private Connection con;
    private Statement retrieveDOInfoStmt;
    private ResultSet retrieveDOInfoRs;
    int quan,Kg;
    boolean centered = true;
    public ConfirmDeliveryOrderDialog(JDialog parent)
    super(parent,"New Delivery Order",true);
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con = Laundry.getConnection();
    retrieveDOInfoStmt = con.createStatement();
    String retrieveDOInfo = "SELECT ItemName,ItemTypeName,WashingType,CleaningType,ItemCategory,QuantityOrKg AS [Quantity/Kg] " +
    "FROM DoDetail,DOInfo " +
    "WHERE DODetail.DOID = DOInfo.DOID " +
    "AND DOInfo.CompanyID = " + Laundry.companyDetails.get(0) +
    "AND DODetail.DOID = " + EnterDeliveryOrderNumberDialog.DOInfo.get(0);
    retrieveDOInfoRs = retrieveDOInfoStmt.executeQuery(retrieveDOInfo);
    if(Laundry.SCROLLABLE)
    retrieveDOInfoModel = new ScrollingResultSetTableModel(retrieveDOInfoRs);
    else
    retrieveDOInfoModel = new CachingResultSetTableModel(retrieveDOInfoRs);
    newDOTable = new JTable(retrieveDOInfoModel);
    newDOSp = new JScrollPane(newDOTable);
    newDOTable.getTableHeader().setReorderingAllowed(false);
    newDOTable.setPreferredScrollableViewportSize(new Dimension(550,350));
    retrieveDOInfoStmt.close();
    con.close();
    cp = getContentPane();
    cp.add(newDOSp, BorderLayout.CENTER);
    catch(SQLException ext)
    JOptionPane.showMessageDialog(null,"SQL Exception:","ERROR",JOptionPane.ERROR_MESSAGE);
    while (ext != null)
    JOptionPane.showMessageDialog(null,"SQL State:" + ext.getSQLState() + "\nMessage:" + ext.getMessage() + "\nVendor:" + ext.getErrorCode(),"ERROR",JOptionPane.ERROR_MESSAGE);
    ext = ext.getNextException();
    catch(ClassNotFoundException ex)
    JOptionPane.showMessageDialog(null,"Exception:" + ex,"ERROR",JOptionPane.ERROR_MESSAGE);
    ex.printStackTrace();
    catch(Exception e)
    JOptionPane.showMessageDialog(null,"Exception:" + e,"ERROR",JOptionPane.ERROR_MESSAGE);
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con = Laundry.getConnection();
    retrieveDOInfoStmt = con.createStatement();
    String retrieveDOInfo = "SELECT SUM(QuantityOrKg) AS [Total Quantity] " +
    "FROM DOInfo,DODetail " +
    "WHERE DOInfo.DOID = DODetail.DOID " +
    "AND DOInfo.CompanyID = " + Laundry.companyDetails.get(0) +
    "AND DODetail.DOID = " + EnterDeliveryOrderNumberDialog.DOInfo.get(0) +
    "AND ItemCategory = 'Piece' " +
    "GROUP BY DODetail.DOID ";
    retrieveDOInfoRs = retrieveDOInfoStmt.executeQuery(retrieveDOInfo);
    while(retrieveDOInfoRs.next())
    quan = retrieveDOInfoRs.getInt("Total Quantity");
    retrieveDOInfoStmt.close();
    con.close();
    catch(SQLException ext)
    JOptionPane.showMessageDialog(null,"SQL Exception:","ERROR",JOptionPane.ERROR_MESSAGE);
    while (ext != null)
    JOptionPane.showMessageDialog(null,"SQL State:" + ext.getSQLState() + "\nMessage:" + ext.getMessage() + "\nVendor:" + ext.getErrorCode(),"ERROR",JOptionPane.ERROR_MESSAGE);
    ext = ext.getNextException();
    catch(ClassNotFoundException ex)
    JOptionPane.showMessageDialog(null,"Exception:" + ex,"ERROR",JOptionPane.ERROR_MESSAGE);
    ex.printStackTrace();
    catch(Exception e)
    JOptionPane.showMessageDialog(null,"Exception:" + e,"ERROR",JOptionPane.ERROR_MESSAGE);
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con = Laundry.getConnection();
    retrieveDOInfoStmt = con.createStatement();
    String retrieveDOInfo = "SELECT SUM(QuantityOrKg) AS [Total Kg] " +
    "FROM DOInfo, DODetail " +
    "WHERE DOInfo.DOID = DODetail.DOID " +
    "AND DODetail.DOID = " + EnterDeliveryOrderNumberDialog.DOInfo.get(0) +
    "AND DOInfo.CompanyID = " + Laundry.companyDetails.get(0) +
    "AND ItemCategory = 'Kg' " +
    "GROUP BY DODetail.DOID ";
    retrieveDOInfoRs = retrieveDOInfoStmt.executeQuery(retrieveDOInfo);
    while(retrieveDOInfoRs.next())
    Kg = retrieveDOInfoRs.getInt("Total Kg");
    retrieveDOInfoStmt.close();
    con.close();
    catch(SQLException ext)
    JOptionPane.showMessageDialog(null,"SQL Exception:","ERROR",JOptionPane.ERROR_MESSAGE);
    while (ext != null)
    JOptionPane.showMessageDialog(null,"SQL State:" + ext.getSQLState() + "\nMessage:" + ext.getMessage() + "\nVendor:" + ext.getErrorCode(),"ERROR",JOptionPane.ERROR_MESSAGE);
    ext = ext.getNextException();
    catch(ClassNotFoundException ex)
    JOptionPane.showMessageDialog(null,"Exception:" + ex,"ERROR",JOptionPane.ERROR_MESSAGE);
    ex.printStackTrace();
    catch(Exception e)
    JOptionPane.showMessageDialog(null,"Exception:" + e,"ERROR",JOptionPane.ERROR_MESSAGE);
    comT1 = new JLabel("Deluxe Laundry Sdn Bhd");
    comT1.setFont(new Font("Sanserif",Font.BOLD,12));
    comT2 = new JLabel("Lot 1641, Jln Sungai Tua, Batu Caves, 68100 Selangor Darul Ehsan");
    comT2.setFont(new Font("Sanserif",Font.PLAIN,10));
    comT3 = new JLabel("Tel : 03-61863093 03-61863091 Fax : 03-61863096");
    comT3.setFont(new Font("Sanserif",Font.PLAIN,10));
    Box comBox = Box.createVerticalBox();
    comBox.add(Box.createVerticalStrut(5));
    comBox.add(comT1);
    comBox.add(Box.createVerticalStrut(2));
    comBox.add(comT2);
    comBox.add(Box.createVerticalStrut(2));
    comBox.add(comT3);
    comBox.add(Box.createVerticalStrut(2));
    Box comNBox = Box.createHorizontalBox();
    comNBox.add(Box.createHorizontalStrut(10));
    comNBox.add(comBox);
    comNBox.add(Box.createHorizontalStrut(300));
    //line = new Line2D.Float();
    //line.setLine(10,50,600,50);
    //Graphics2D dfl = (Graphics2D)g;
    //dfl.drawLine(10,50,600,50);
    doT = new JLabel("Delivery Order");
    doT.setFont(new Font("Sanserif",Font.BOLD,17));
    doID = new JLabel("DO ID : ");
    doID.setFont(new Font("Sanserif",Font.BOLD,12));
    doIDNo = new JLabel("");
    doIDNo.setText("" + EnterDeliveryOrderNumberDialog.DOInfo.get(0));
    doIDNo.setFont(new Font("Sanserif",Font.PLAIN,12));
    receivedDate = new JLabel("Received Date : ");
    receivedDate.setFont(new Font("Sanserif",Font.BOLD,12));
    actualReceivedDate = new JLabel("");
    actualReceivedDate.setText("" + EnterDeliveryOrderNumberDialog.DOInfo.get(1));
    actualReceivedDate.setFont(new Font("Sanserif",Font.PLAIN,12));
    JPanel jp = new JPanel();
    jp.setLayout(new GridLayout(2,3));
    jp.add(doID);
    jp.add(doIDNo);
    jp.add(receivedDate);
    jp.add(actualReceivedDate);
    Box doBox = Box.createHorizontalBox();
    doBox.add(Box.createHorizontalStrut(200));
    doBox.add(doT);
    doBox.add(Box.createHorizontalStrut(50));
    doBox.add(jp);
    doBox.add(Box.createHorizontalStrut(100));
    //line1 = new Line2D.Float();
    //line1.setLine(10,0,600,0);
    //Graphics2D df2 = (Graphics2D)g;
    //df2.drawLine(10,100,600,100);
    deliveryTo = new JLabel("Delivery To :");
    deliveryTo.setFont(new Font("Sanserif",Font.BOLD,12));
    deliveryToCustomerInfo = new JLabel("");
    deliveryToCustomerInfo.setText("" + Laundry.companyDetails.get(1));
    deliveryToCustomerInfo.setFont(new Font("Sanserif",Font.PLAIN,12));
    Box deliveryToBox = Box.createHorizontalBox();
    deliveryToBox.add(Box.createHorizontalStrut(10));
    deliveryToBox.add(deliveryTo);
    deliveryToBox.add(Box.createHorizontalStrut(10));
    deliveryToBox.add(deliveryToCustomerInfo);
    deliveryToBox.add(Box.createHorizontalStrut(500));
    companyAddress = new JLabel("");
    companyAddress.setFont(new Font("Sanserif",Font.BOLD,12));
    companyAddressInfo = new JLabel("");
    companyAddressInfo.setText("" + Laundry.companyDetails.get(2));
    companyAddressInfo.setFont(new Font("Sanserif",Font.PLAIN,12));
    Box companyAddressBox = Box.createHorizontalBox();
    companyAddressBox.add(Box.createHorizontalStrut(98));
    companyAddressBox.add(companyAddress);
    companyAddressBox.add(Box.createHorizontalStrut(10));
    companyAddressBox.add(companyAddressInfo);
    companyAddressBox.add(Box.createHorizontalStrut(500));
    tel = new JLabel("Tel :");
    tel.setFont(new Font("Sanserif",Font.BOLD,12));
    telNo = new JLabel("");
    telNo.setText("" + '0'+Laundry.companyDetails.get(3));
    telNo.setFont(new Font("Sanserif",Font.PLAIN,12));
    Box telBox = Box.createHorizontalBox();
    telBox.add(Box.createHorizontalStrut(10));
    telBox.add(tel);
    telBox.add(Box.createHorizontalStrut(10));
    telBox.add(telNo);
    telBox.add(Box.createHorizontalStrut(500));
    dispatchDate = new JLabel("Dispatch Date :");
    dispatchDate.setFont(new Font("Sanserif",Font.BOLD,12));
    actualDispatchDate = new JLabel("");
    actualDispatchDate.setText("" + EnterDeliveryOrderNumberDialog.DOInfo.get(2));
    actualDispatchDate.setFont(new Font("Sanserif",Font.PLAIN,12));
    Box dispatchBox = Box.createHorizontalBox();
    dispatchBox.add(Box.createHorizontalStrut(10));
    dispatchBox.add(dispatchDate);
    dispatchBox.add(Box.createHorizontalStrut(10));
    dispatchBox.add(actualDispatchDate);
    dispatchBox.add(Box.createHorizontalStrut(500));
    remark = new JLabel("Remark :");
    remark.setFont(new Font("Sanserif",Font.BOLD,12));
    inputRemark = new JLabel("");
    inputRemark.setText("" + EnterDeliveryOrderNumberDialog.DOInfo.get(3));
    inputRemark.setFont(new Font("Sanserif",Font.PLAIN,12));
    Box remarkBox = Box.createHorizontalBox();
    remarkBox.add(Box.createHorizontalStrut(10));
    remarkBox.add(remark);
    remarkBox.add(Box.createHorizontalStrut(10));
    remarkBox.add(inputRemark);
    remarkBox.add(Box.createHorizontalStrut(500));
    Box infoBox = Box.createVerticalBox();
    infoBox.add(Box.createVerticalStrut(5));
    infoBox.add(deliveryToBox);
    infoBox.add(Box.createVerticalStrut(5));
    infoBox.add(companyAddressBox);
    infoBox.add(Box.createVerticalStrut(5));
    infoBox.add(telBox);
    infoBox.add(Box.createVerticalStrut(5));
    infoBox.add(dispatchBox);
    infoBox.add(Box.createVerticalStrut(5));
    infoBox.add(remarkBox);
    infoBox.add(Box.createVerticalStrut(5));
    Box northBox = Box.createVerticalBox();
    northBox.add(Box.createVerticalStrut(5));
    northBox.add(comNBox);
    northBox.add(Box.createVerticalStrut(5));
    northBox.add(doBox);
    northBox.add(Box.createVerticalStrut(5));
    northBox.add(infoBox);
    northBox.add(Box.createVerticalStrut(5));
    Shape firstShape = new Rectangle(350,100,10,5);
    //Font font = new Font("Sanserif",Font.PLAIN,5);
    String text = "Checked By";
    //g.drawString(text,365,105);
    //g.setFont(new Font("Sanserif",Font.PLAIN,5));
    //g.fill(firstShape);
    //g.draw(firstShape);
    //Box joinBox = Box.createHorizontalBox();
    //joinBox.add(northBox);
    //joinBox.add(Box.createHorizontalStrut(10));
    //joinBox.add(g);
    printBtn = new JButton("Print");
    printBtn.addActionListener(this);
    exitBtn = new JButton("Exit");
    exitBtn.addActionListener(this);
    JPanel jp3 = new JPanel();
    jp3.add(printBtn);
    jp3.add(exitBtn);
    total = new JLabel("Total");
    totalQuantity = new JLabel("Quantity");
    totalQuantity.setFont(new Font("Sanserif",Font.PLAIN,12));
    inputTotalQuantity = new JLabel("");
    inputTotalQuantity.setFont(new Font("Sanserif",Font.PLAIN,12));
    inputTotalQuantity.setText("" + quan);
    totalKg = new JLabel("Kg");
    totalKg.setFont(new Font("Sanserif",Font.PLAIN,12));
    inputTotalKg = new JLabel("");
    inputTotalKg.setFont(new Font("Sanserif",Font.PLAIN,12));
    inputTotalKg.setText("" + Kg);
    Box totalBox = Box.createHorizontalBox();
    totalBox.add(Box.createHorizontalStrut(270));
    totalBox.add(total);
    totalBox.add(Box.createHorizontalStrut(50));
    totalBox.add(totalQuantity);
    totalBox.add(Box.createHorizontalStrut(50));
    totalBox.add(inputTotalQuantity);
    totalBox.add(Box.createHorizontalStrut(30));
    totalBox.add(totalKg);
    totalBox.add(Box.createHorizontalStrut(50));
    totalBox.add(inputTotalKg);
    totalBox.add(Box.createHorizontalStrut(30));
    Box southBox = Box.createVerticalBox();
    southBox.add(Box.createVerticalStrut(10));
    southBox.add(totalBox);
    southBox.add(Box.createVerticalStrut(5));
    southBox.add(jp3);
    cp = getContentPane();
    cp.add(northBox, BorderLayout.NORTH);
    cp.add(southBox, BorderLayout.SOUTH);
    setSize(600,400);
    setLocation(100,100);
    public void actionPerformed(ActionEvent ae)
    if(ae.getSource() == printBtn)
    PageFormat page = new PageFormat();
    Paper paper = new Paper();
    paper.setSize(595.275590551181,841.8897637795276);
    paper.setImageableArea(70.8661417322835,70.8661417322835,453.5433070866141,700.1574803149607);
    page.setPaper(paper);
    page.setOrientation(PageFormat.PORTRAIT);
    PrinterJob printJob = PrinterJob.getPrinterJob();
    if(page == null)
    page = printJob.defaultPage();
    printJob.setPrintable(this,page);
    if(printJob.printDialog())
    try
    printJob.print();
    setVisible(false);
    JOptionPane.showMessageDialog(null,"Please Generate Normal Or Express JobList","JobList",JOptionPane.INFORMATION_MESSAGE);
    catch(PrinterException e)
    JOptionPane.showMessageDialog(this,e);
    else if(ae.getSource() == exitBtn)
    EnterDeliveryOrderNumberDialog.removeDOInfo();
    setVisible(false);
    public int print(Graphics g, PageFormat pf, int page) throws PrinterException
    if(page >= 1)
    return Printable.NO_SUCH_PAGE;
    Graphics2D g2 = (Graphics2D)g;
    g2.translate(pf.getImageableX(), pf.getImageableY());
    if(centered)
    g2.translate(pf.getImageableWidth(), pf.getImageableHeight());
    Dimension d = getSize();
    double scale = Math.min(pf.getImageableWidth() / d.width, pf.getImageableHeight() / d.height);
    if (scale < 1.0)
    g2.scale(scale, scale);
    if (centered)
    g2.translate(-d.width, -d.height);          
    paint(g2);
    return Printable.PAGE_EXISTS;

    Hi Thanx, your code helped. I have got another question. How do i implement a method from another method class into the applet. say, i want to implemen set frequency from the below code into my applet you wrote above?
    class Histogram
         int frequency[];
         String alphabet;
         Histogram(String alphabet)
              this.alphabet=alphabet;
              frequency=new int[alphabet.length()];
         void scan(String message)
              for(int i=0;i<message.length;i++)
                   frequncy[alphabet.IndexOf(message.charAt(i))]++;
         void setfrequency(int frequency[])
              for(int i=0;i<alphabet.length;i++)
              this.frequency=frequency[i];
         double entropy()
              int total=0;
              double probablity;
              log2=Math.log(2.0);
              for(int i=0;i<alphabet.length;i++)
                   total+=freguency[i];

Maybe you are looking for

  • Mini DVI to Video Curving

    Hi, I just bought a mini-DVI to video cable and am hooking my macbook up to my tv through a composite video cable. It's not working properly and the picture on the tv curves at the edges, almost like it's projecting an image onto a regular tv that ha

  • Time Capsule and Windows 7 backup tool

    So I own a TC that works excellent with my Mac Books. Now that I have my Mac's all backed up with TC I want to cover myself on my W7 machine. After doing some reading I found that W7 has a backup tool thank can backup to an external drive or network

  • Problem with Pages 09 after latest Snow Leopard Update

    I upgraded Snow Leopard with the latest update this afternoon, and now I am having all sorts of problems with Pages. Most importantly, the Pages templates are all messed up, with formatting all screwed up and the typesetting a mess. Has anyone else e

  • Problem copying cusor, please check code.

    The function below is supposed to accept a database and a read cursor, and create a write cursor pointing to the the same record. It is supposed to work for databases with duplicate keys allowed (a requirement - although the combination of key and da

  • How do I get rid on unwanted outlines on GIFs with transparency?

    Ignore the crude cutout. This is for demonstrating purposes only. The following is a screen shot of a GIF. The black background is a seperate layer put behind the cutout just to make absolutely positive that there is no white outline around the image