Confusion regarding Binary data and byte arrays

HI guys,
I have a question...i am going to send some binary data...the format of that data is that first two bytes is the lenght of the data and then follows that data. Here i have one confusion. e.g. i want to say that the lenght of my data is 1000 bytes. How do i do it.
coz if i do something like this.
int k = 1000;//the length of my data
String binaryString = Integer.toBinaryString(k);
byte[] binaryData = binaryString.getBytes();
and then if i say binaryData.lenght, i see a lenght of 10, as the binary string which
is generated is -> 1111101000. i guess its obivious as this byte array is nothing but perhaps a character array with each character occupying one thread...so what exactly is the difference between byte array and binary data. and in the above said condition how do i send the binary data?
Also adding to my confusion is the fact that i have a file which contains binary data, but that data is not 10010101 type of data...its just some absurd characters. How do we explain this.
i would be highly grateful if you could explain me the solution to this problem.
I am not getting as to how to go about it.
its urgent..pls help...

one sec..actually i dont want to 'read' the two bytes. That i know how to do? but The thing is that i want to write a binary stream. right? so in that the first two bytes should be the size of the data, followed by the data itself. So i want to write the first two bytes, which should contain the size of data (as a matter of fact i have that binary data in a byte array). But my question is , that if i say the size of data is 1000 (bytes , since, as i said i am gettting the data as a byte array), how do i write this in my binary stream as 1000 in this case would be an int. right? which is four bytes. So essentially that byte array (which contains binary data) i have to forward to somewhere, say X , but X reads binary data in the following way...it expects the first two bytes to give him info regarding the size of the data to follow and then it starts reading the data from the third byte onwards till the size of the data (which it got by reading first two bytes)...i hope i could communicate my confusion better this time

Similar Messages

  • Convert XML data to byte array...

    Hello All,
    In my application, i have an XML file and the corresponding XSD file. This XML file is having some date, which i want to convert into an byte[] and then save it in a file. 
    How i can convert the XML data in the byte[]? Here as an example of the xml file and the byte[] data which i want to save in a file.
    <?xml version="1.0" encoding="utf-8"?>
    <HeadersInfo>
    <header>
    <id>0</id>
    <Name>H1</Name>
    </header>
    <header>
    <id>1</id>
    <Name>H2</Name>
    </header>
    </HeasersInfo>
    In the above example 'id' field is of type 'uint' and 'name' field is of type 'string' with max length of '5'. So in this case my byte array should be as shown below:
    00 00 00 01 48 31 00 00 00
    00 00 00 02 48 32 00 00 00
    Here underlines values are for the 'id' parameter where as values in bold are for 'Name' parameter for all the header values in sequence. Name parameter is null (0x00) padded.
    Thanks in advance,
    IamHuM

    Hi,
    the following example extract the id, name values using LINQ To Xml and writes it to a memory stream using a binary writer and returns the result as a byte array:
    internal static byte[] GetXmlAsByteArray()
    var document = XDocument.Parse("<HeadersInfo>"
    + " <header><id>1</id><Name>H1</Name></header>"
    + " <header><id>2</id><Name>H2</Name></header>"
    // additional testing
    + " <header><id>32767</id><Name>H1234</Name></header>"
    + " <header><id>305419896</id><Name>H56789</Name></header>"
    + "</HeadersInfo>");
    const int NameLength = 5; // Max length for a name
    byte[] zeroBytes = new byte[NameLength]; // Helper to fill name
    using (var ms = new MemoryStream())
    using (var writer = new BinaryWriter(ms))
    // write each header
    foreach (var header in document.Root.Elements("header"))
    int id = (int)header.Element("id");
    string name = (string)header.Element("Name");
    byte[] nameBytes = System.Text.Encoding.UTF8.GetBytes(name);
    Console.WriteLine("id: {0}, Name: {1}", id, name);
    // Write id
    writer.Write(GetUIntBytes((uint)id));
    // Write name NameLength (5) max, otherwise padded
    if (nameBytes.Length > NameLength)
    writer.Write(nameBytes, 0, NameLength);
    else
    writer.Write(nameBytes, 0, nameBytes.Length);
    if (nameBytes.Length < NameLength)
    writer.Write(zeroBytes, 0, NameLength - nameBytes.Length);
    byte[] result = ms.ToArray();
    // dump array
    foreach (var value in result)
    Console.Write("{0:X2} ", value);
    Console.WriteLine();
    return result;
    public static byte[] GetUIntBytes(uint value)
    if (BitConverter.IsLittleEndian)
    // swap bytes
    value = ((value & 0x00ff) << 24)
    | ((value & 0xff00) << 8)
    | ((value & 0x00ff0000) >> 8)
    | ((value & 0xff000000) >> 24);
    return BitConverter.GetBytes(value);
    For a general purpose solution you should create a class and split the example into separate methods to extract the data and write the values (integers, strings).
    Regards, Elmar

  • Adapter development: binary data and adapter specific properties?

    Hi,
    We have succesfully developed our own SFTP adapter based on the J2SSH Maverick library (http://www.sshtools.com/showMaverick.do) and the sample file adapter that comes with XI.
    There are 2 features we would like to implement as well, but lack the necessary documentation and sample code.
    <b>1st Binary data</b>
    We do not succeed in transporting binary data via our SFTP adapter (both text and xml go fine).  While debugging, we see that the binary data are correctly picked up, but the actual payload appearing in message monitoring is much larger.  When we write the message to a file again, the data have changed (size has e.g. increased importantly from 127180 bytes to 218198 bytes).  According to the sample adapter code,  the contenttype "application/octet-stream"  should be specified.  But the standard XI file adapter itself seems to specify "application/octet-stream".
    <b>2nd Adapter specific properties (DynamicConfiguration)</b>
    How can we set adapter specific properties in our own adapter code?  Where are the Java docs of the API?  Is this somewhere documented?
    If you would have more information (or pointers), please post it as a response to this message.
    Kind regards, Guy Crets
    <b>Code snippet:</b>
    XIMessageFactoryImpl mf = new XIMessageFactoryImpl();
    Message msg = mf.createMessageRecord(fromParty, toParty, fromService, toService, action, actionNS);
    msg.setDeliverySemantics(DeliverySemantics.ExactlyOnce);
    // In case of XML documents it is not necessary to set the contentType or encoding
    // But: take care that the encoding definiton in the XML document corresponds to the encoding used
    if (msgText.indexOf("<?xml") != -1)
      // Check whether the payload is a XML document. If not, treat it as binary to demonstrate how
      // binary main documents work
      // First create a XML Payload                    
      XMLPayload xp = null;
      xp = msg.createXMLPayload();
      xp.setText(msgText);
      xp.setName("MainDocument");
      xp.setDescription("XI AF Sample Adapter Input: XML document as MainDocument");
      msg.setDocument(xp);
    // In case of binary documents use the Payload super class methods to fill the XMLPayload object
    else
      // Check whether the payload is a XML document. If not, treat it as binary to demonstrate how
      // binary main documents work
      // First create a XML Payload                    
      XMLPayload xp = null;
      xp = msg.createXMLPayload();
      //xp.setContentType("application/octet-stream");
      xp.setContentType("application/xml");
      xp.setName("MainDocument");
      xp.setDescription("XI AF Sample Adapter Input: Binary as MainDocument");
      xp.setContent(msgData);
      // Finally set the main document in the message
      msg.setDocument(xp);          
    TRACE.debugT(SIGNATURE, XIAdapterCategories.CONNECT_AF, "Message object created and filled.");
    ModuleData md = new ModuleData();
    md.setPrincipalData(msg);

    Hello Moorthy,
    I know this part of the documentation.
    So I set the indicator within the communication channel.
    Now, I have to fill the dynamic configuration during my mapping. My code looks like following:
    DynamicConfigurationKey keyURL =  DynamicConfigurationKey.create("http://sap.com/xi/XI/System/HTTP", <b>XXXXX</b>);
    // access dynamic configuration
    DynamicConfiguration conf = (DynamicConfiguration) param.get (StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    // set value
    conf.put(keyURL, url);
    So what has to be filled instead of XXXXX ?
    Regards,
      Marc

  • Data plug-in for binary data with byte streams of variable length

    Hi there,
    I would like to write a data plug-in to read binary data from file and I'm using DIAdem 10.1.
    Each data set in my file consists of binary data with a fixed structure (readable by using direct access channels) and of a byte stream of variable length. The variable length of each byte stream is coded in the fixed data part.
    Can anyone tell me how my data plug-in must look like to read such kind of data files?
    Many thanks in advance!
    Kind regards,
    Stefan

    Hi Brad,
    thank you for the very quick response!
    I forgot to mention, that the data in the byte stream can actually be ignored, it is no data to be evaluated in DIAdem (it is picture data and the picture size varies from data set to data set).
    So basically, of each data set I would like to read the fixed-structure data (which is the first part of the data set) and discard the variable byte stream (last part of the data set).
    Here is a logical (example) layout of my binary data file:
    | fixedSize-Value1 | fixedSize-Value2 | fixedSize-Value3 (=length of byte stream) | XXXXXXXXXXXXX (byte stream)
    | fixedSize-Value1 | fixedSize-Value2 | fixedSize-Value3 (=length of byte stream) | XXXXXX (byte stream)
    | fixedSize-Value1 | fixedSize-Value2 | fixedSize-Value3 (=length of byte stream) | XXXXXXXXXXXXXXXXXXXX (byte stream)
    What I would like to show in DIAdem is only fixedSize-Value1 and fixedSize-Value2.
    ´
    If I understood right, would it be possible to set the BlockLength of each data set by assigning Block.BlockLength = fixedSize-Value3 and to use Direct Access Channels for reading fixedSize-Value1 and fixedSize-Value2 ?
    Thank you!
    Kind regards,
    Stefan

  • ImageIcon and byte array

    ImageIcon II = new ImageIcon( myUrl );
    Will give me an ImageIcon based upon the URL given.
    I know an alternate constructor ImageIcon II = new ImageIcon( myByteArray );
    Whereby one can get an ImageIcon based on a given ByteArray.
    Is there any way to go the other way?
    I'd like to get a byte array from a given ImageIcon.
    Any suggestions?

    The reason for the post is that I'd like to store a bunch of images (I don't know in advance how big this bunch is going to be so I'm putting the collection in an ArrayList) in one file. I can do this with a ArrayList of byte-arrays or with a Vector/ArrayList of ImageIcons.
    Will an ArrayList of byte arrays containing byte-arrays differ much in size with a ArrayList of ImageIcons? The Serilaized Form section of the API does not give me very useful information in this regard. I'm thinking putting byte arrays in the ArrayList will save me some space, but if this savings isn't very much I'm going to go ahaead and stroe a Vector/ArrayList of ImageIcons.

  • Zip binary data and save zip file to disk at bsp

    Hi,
    I try to compress (zip) binary data (for example a picture) and then give it to a html page. I use the cl_abap_gzip=>compress_binary method and it seems to work. But when I save the zip-file to harddisk over the popup at the html - page, the file could not be opened. WinZip says that it is an unvalid archive.
    Can anybody help me?
    Here my example coding at the OnInitialization Event of the business server page:
    * event handler for data retrieval
    * local variables
    DATA: xsourcefile TYPE xstring.
    DATA: xzippedfile TYPE xstring.
    DATA: source_file_mime_type TYPE string.
    DATA: xzippedcontentlength TYPE i, xzippedcontentlengthstring TYPE
    string.
    * References
    DATA: o_mime_api TYPE REF TO if_mr_api.
    * processing
    * +++ Read File from MIME-Repository (binary) +++
    CALL METHOD cl_mime_repository_api=>if_mr_api~get_api
      RECEIVING
        r_mr_api = o_mime_api.
    CALL METHOD o_mime_api->get
      EXPORTING
        i_url              = 'SAP/ZGSD_SD_ADIS/test.gif'
    *    I_CHECK_AUTHORITY  = 'X'
      IMPORTING
    *    E_IS_FOLDER        =
        e_content          = xsourcefile
        e_mime_type        = source_file_mime_type
    *    E_LOIO             =
    *  CHANGING
    *    C_LANGUAGE         =
      EXCEPTIONS
        parameter_missing  = 1
        error_occured      = 2
        not_found          = 3
        permission_failure = 4
        OTHERS             = 5
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    * +++ create ZIP-File +++
    TRY.
        CALL METHOD cl_abap_gzip=>compress_binary
          EXPORTING
            raw_in                     =  xsourcefile
    *    RAW_IN_LEN                 = -1
    *    COMPRESS_LEVEL             = 6
          IMPORTING
            gzip_out                   = xzippedfile
            gzip_out_len               = xzippedcontentlength.
    * ... Länge Casten !
        xzippedcontentlengthstring = xzippedcontentlength.
    * ... Errorhandling
      CATCH cx_parameter_invalid_range . " Error-Handling
      CATCH cx_sy_buffer_overflow . " Error-Handling
      CATCH cx_sy_compression_error . " Error-Handling
    ENDTRY.
    * +++ Put ZIP-File in Response +++
    response->set_data( xzippedfile ).
    response->set_header_field( name  = if_http_header_fields=>content_type
              value = 'application/octet-stream' ).
    response->set_header_field( name  =
    if_http_header_fields=>content_length
              value = xzippedcontentlengthstring ).
    response->set_header_field( name  = 'Content-Disposition'
    value = 'inline;filename=test.zip' ).
    navigation->response_complete( ).
    Thanks Timo
    PS: I posted this question also at ABAP Forum.

    Hi,
    First you need to define your ext prog in SM69.
    It is simple though, specify:
    Command name: ZZIPBIN
    OS: (your os)
    System command: /yourpath/zzipbin
    Extra params allowed: checked
    Then you need to code this:
    data: table TYPE zeu_t_btcxpm.
    CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
        EXPORTING
          commandname                   = 'ZZIPBIN'
          additional_parameters         = param
          operatingsystem               = sy-opsys
          terminationwait               = 'X'
        TABLES
          exec_protocol                 = table
        EXCEPTIONS
          no_permission                 = 1
          command_not_found             = 2
          parameters_too_long           = 3
          security_risk                 = 4
          wrong_check_call_interface    = 5
          program_start_error           = 6
          program_termination_error     = 7
          x_error                       = 8
          parameter_expected            = 9
          too_many_parameters           = 10
          illegal_command               = 11
          wrong_asynchronous_parameters = 12
          cant_enq_tbtco_entry          = 13
          jobcount_generation_error     = 14
          OTHERS                        = 15.
    See also http://help.sap.com/saphelp_nw2004s/helpdata/en/c4/3a8023505211d189550000e829fbbd/frameset.htm
    Eddy
    PS.
    Put yourself on the SDN world map (http://sdn.idizaai.be/sdn_world/sdn_world.html) and earn 25 points.
    Spread the wor(l)d!

  • How to change the image into byte and byte array into image

    now i am developing one project. i want change the image into byte array and then byte array into image.

    FileInputStream is = new FileInputStream(file);
    byte[] result = IOUtils.toByteArray(is);
    with apache common IO lib

  • Binary Data and JSP

    Hi all I have a basic doubt. How does Servlets is preferred technology to generate binary data than JSP? Any limitation in JSP?

    Okay,
    When you write a JSP file, you type it in text, and all the text you type is sent to the client that requests your page. Everything is sent including carriage returns, spaces, tab characters and anything you have type into the file. Only things that are inside <% and %> do not get sent through. If you have several blank lines at the end of the file they will be sent to the client and may cause issues if you are writing binary data that needs to be handled by an application.
    With Servlets you have to write data to the outputstream you get from the (cant quite remember) response.getOutputStream() method. This ensures that only what you want to send gets sent to the client.
    It sepends on what you need it for. If it doesnt matter what you send through then JSP can be used to write binary data. In one application I had to send through sound files to the client and any extra data would only corrupt the sound, so it had to be sent using servlets.
    Does that help?

  • Regarding Weekend Dates and Holiday Dates - answer please

    Hi have
    Sales order date and amount sold columns in my report.
    The user requirement is they want to see all the sales that are done during the weekend and Holidays but the report should only show the
    sales order date and the amount (the weekend and holiday sale amount should roll up to the next business day total)
    lets say there was a sale on March 16th for $100, March 17th for $100 and for March 18th there is a sale of $100 the March 18th Sales amount should be $300 in the sales amount per day column.
    The orders are taken daily including the holidays and weekends and in the EBS 11 the source system the ordered date is the date the order was taken.
    In obiee 10g the reports and queries are showing all the orders that are placed on the actual day, does not matter its a holiday or weekend.
    the users does not want to see the weekend dates and holidays but they want the amount to be rolled up.
    How to convince the user that there is no capability in OBIEE 10g we cant get the orders by the calendar date.
    is there a function in obiee to roll up the weekend and holiday sales amount?
    They way Iam approaching this is
    imported the BOM_Calendar_date from EBS and doing the mappings in OWB(their ETL tool) filtering by the country USA
    and thinking about writing a function to roll the amount where the weekend holiday column is "NULL"
    if any one has any other idea please let me know.
    TIA

    How does day dim know about holidays? based on client or enterprise calendar you need to let know day dim!.
    You might have to customize day dim or else create custom table for holidays with date_wid as Jul 4 is holiday for this 20130704 is the key for that holiday and join this to day dim.
    Hope this helps, if does mark

  • Binary Data and Servlets

    Hi all I have a basic doubt. How does Servlets is preferred technology to generate binary data than JSP? Any limitation in JSP?

    I just answered this in the JSP forum

  • Object stream and byte array conversion

    Hello everyone,
    I am wondeirng how to convert an ObjectInputStream to a byte array, then convert the array back to ObjectInputStream -- should I convert the array back to ObjectOutputStream other than ObjectInputStream?
    Any sample codes?
    thanks in advance,
    George

    Isn't it the other way around? You can't do this directly:
    ObjectInputStream ois = ...;
    ByteArrayInputStream bais = new ByteArrayInputStream(ois);(but you can do it indirectly), but you can do this:
    ByteArrayInputStream bais = ...;
    ObjectInputStream ois = new ObjectInputStream(bais);

  • URGENT: REGARDING POSTING DATE AND DELETION OF ZEROS IN ALV REPORT

    Hi,
      I had made a report in which i have to display 'POSTING DATE' (iseg-budat) when we execute the report i.e. it should be displayed as  PERIOD :- _______  to _______ .
    2nd problem is i had displayed the material no. ,but there are zeros which are displaying in dere ,i want to remove dem ... example, if the mat.no. is  2321 ,it is displaying 000002321. i want to remove these zeros.
    Its request to all of u dat plz help me as fast as possible as it is most urgent to me and if any body provide me help he or sh e will be definately rewarded..
    Regards,
    ric.s

    Here i am giving you one of the ALV reports i have generated. Check this program. I hope it will be helpful to you.
    REPORT  ZFI_ASSIGNED_FUNDS_FINAL.
    TABLES: FMIT,FMCIT,FPOS,IFMEISA1,FMFCTRT,BSEG,ZREV_BUDGET.
    TYPE-POOLS: SLIS.
    *ALV data declarations
    DATA: FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
          GD_SORT      TYPE SLIS_T_SORTINFO_ALV WITH HEADER LINE,
          GD_TAB_GROUP TYPE SLIS_T_SP_GROUP_ALV,
          GD_LAYOUT    TYPE SLIS_LAYOUT_ALV,
          GD_REPID     LIKE SY-REPID.
    *For ALV top of page
    DATA : IT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
    *For ALV Events
    DATA : IT_EVENT1 TYPE SLIS_T_EVENT.
    *For ALV Events
    DATA : IT_EVENT TYPE SLIS_ALV_EVENT.
    *For top of page heading
    DATA: IT_LINE TYPE SLIS_LISTHEADER.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETER : RADIO RADIOBUTTON GROUP R1.
    IF RADIO EQ 'X'.
      SELECT-OPTIONS: FIPEX  FOR FPOS-FIPEX,                  " SELECTION FOR FUNDS CENTER & COMMITMENT ITEM
                      RFISTL FOR FMIT-RFISTL.
    ENDIF.
    PARAMETER: RADIO1 RADIOBUTTON GROUP R1.
    IF RADIO1 EQ 'X'.
      SELECT-OPTIONS : HKONT FOR BSEG-HKONT,                 " SELECTION FOR COST CENTER & G/L ACCOUNT
                       KOSTL FOR ZREV_BUDGET-KOSTL.
    ENDIF.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS: PERDE  FOR IFMEISA1-PERDE DEFAULT '01' TO '12' OBLIGATORY.
    PARAMETER :     RYEAR  LIKE FMIT-RYEAR OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B2.
    DATA: BEGIN OF IT_TAB OCCURS 0,
             FIKRS LIKE FMFCTR-FIKRS,
             FICTR LIKE CSKS-KOSTL,
             CTR_OBJNR LIKE FMFCTR-CTR_OBJNR,
             RFISTL LIKE FMIT-RFISTL,
             OBJNR LIKE BPPE-OBJNR,
          END OF IT_TAB.
    DATA: BEGIN OF IT_TAB1 OCCURS 0,
             CO_OBJNR LIKE BPIJ-CO_OBJNR,
             POSIT LIKE BPPE-POSIT,
             FIPEX LIKE FMPOSIT-FIPEX,
             FICTR LIKE FMFCTR-FICTR,
             KSTAR LIKE COSP-KSTAR,
             RFISTL LIKE FMIT-RFISTL,
             OBJNR1 LIKE BPPE-OBJNR,
          END OF IT_TAB1.
    DATA: BEGIN OF IT_FMIT OCCURS 0,
            RYEAR LIKE FMIT-RYEAR,
            FIKRS LIKE FMIT-FIKRS,
            RFISTL LIKE ZREV_BUDGET-KOSTL,
            RFIPEX LIKE ZREV_BUDGET-KSTAR,
            HSL01 LIKE FMIT-HSL01,
            HSL02 LIKE FMIT-HSL02,
            HSL03 LIKE FMIT-HSL03,
            HSL04 LIKE FMIT-HSL04,
            HSL05 LIKE FMIT-HSL05,
            HSL06 LIKE FMIT-HSL06,
            HSL07 LIKE FMIT-HSL07,
            HSL08 LIKE FMIT-HSL08,
            HSL09 LIKE FMIT-HSL09,
            HSL10 LIKE FMIT-HSL10,
            HSL11 LIKE FMIT-HSL11,
            HSL12 LIKE FMIT-HSL12,
            HSL13 LIKE FMIT-HSL13,
            HSL14 LIKE FMIT-HSL14,
            HSL15 LIKE FMIT-HSL15,
            HSL16 LIKE FMIT-HSL16,
         END OF IT_FMIT.
    DATA: BEGIN OF IT_FMIT1 OCCURS 0,
            RYEAR LIKE FMIT-RYEAR,
            FIKRS LIKE FMIT-FIKRS,
            RFISTL LIKE ZREV_BUDGET-KOSTL,
            RFIPEX LIKE FMPG-FIPEX,
            TOTAL LIKE FMIT-TSL01,
            TOTAL1 LIKE FMIT-TSL01,
            OBJNR LIKE BPPE-OBJNR,
            POSIT LIKE BPPE-POSIT,
         END OF IT_FMIT1.
    DATA: BEGIN OF IT_BPPE OCCURS 0,
            OBJNR LIKE BPPE-OBJNR,
            POSIT LIKE BPPE-POSIT,
            GJAHR LIKE BPPE-GJAHR,
            WLP01 LIKE BPPE-WLP01,
            WLP02 LIKE BPPE-WLP02,
            WLP03 LIKE BPPE-WLP03,
            WLP04 LIKE BPPE-WLP04,
            WLP05 LIKE BPPE-WLP05,
            WLP06 LIKE BPPE-WLP06,
            WLP07 LIKE BPPE-WLP07,
            WLP08 LIKE BPPE-WLP08,
            WLP09 LIKE BPPE-WLP09,
            WLP10 LIKE BPPE-WLP10,
            WLP11 LIKE BPPE-WLP11,
            WLP12 LIKE BPPE-WLP12,
          END OF IT_BPPE.
    DATA: BEGIN OF IT_BPPE1 OCCURS 0,
            OBJNR LIKE BPPE-OBJNR,
            POSIT LIKE BPPE-POSIT,
            GJAHR LIKE BPPE-GJAHR,
            RFISTL LIKE FMIT-RFISTL,
            FIPEX LIKE FPOS-FIPEX,
            TOTAL2 LIKE BPPE-WLP01,
          END OF IT_BPPE1.
    DATA: BEGIN OF IT_CSKS OCCURS 0,
           KOKRS LIKE CSKS-KOKRS,
           KOSTL LIKE CSKS-KOSTL,
           BUKRS LIKE CSKS-BUKRS,
           OBJNR LIKE CSKS-OBJNR,
         END OF IT_CSKS.
    DATA: BEGIN OF IT_COSP OCCURS 0,
           OBJNR LIKE COSP-OBJNR,
           GJAHR LIKE COSP-GJAHR,
           KSTAR LIKE COSP-KSTAR,
           BEKNZ LIKE COSP-BEKNZ,
           WKG001 LIKE COSP-WKG001,
           WKG002 LIKE COSP-WKG002,
           WKG003 LIKE COSP-WKG003,
           WKG004 LIKE COSP-WKG004,
           WKG005 LIKE COSP-WKG005,
           WKG006 LIKE COSP-WKG006,
           WKG007 LIKE COSP-WKG007,
           WKG008 LIKE COSP-WKG008,
           WKG009 LIKE COSP-WKG009,
           WKG010 LIKE COSP-WKG010,
           WKG011 LIKE COSP-WKG011,
           WKG012 LIKE COSP-WKG012,
         END OF IT_COSP.
    DATA: BEGIN OF IT_COSP2 OCCURS 0,
           OBJNR LIKE COSP-OBJNR,
           GJAHR LIKE COSP-GJAHR,
           KSTAR LIKE COSP-KSTAR,
           FIPEX LIKE FMPG-FIPEX,
           TOTAL LIKE COSP-WKG001,
           TOTAL1 LIKE COSP-WKG001,
           OBJNR1 LIKE BPPE-OBJNR,
           POSIT LIKE BPPE-POSIT,
         END OF IT_COSP2.
    IF RADIO EQ 'X'.
      DATA: BEGIN OF IT_FINAL OCCURS 0,
             FIKRS LIKE FMIT-FIKRS,
             RFISTL LIKE FMIT-RFISTL,
             RFIPEX LIKE FMIT-RFIPEX,
             TEXT LIKE FMCIT-TEXT1,
             ALLOC LIKE FMIT-TSL16,
             USED LIKE FMIT-TSL16,
             REMAIN LIKE FMIT-TSL16,
             BEZEICH LIKE FMFCTRT-BEZEICH,
           END OF IT_FINAL.
    ENDIF.
    IF RADIO1 EQ 'X'.
      DATA: BEGIN OF IT_FINAL1 OCCURS 0,
              GJAHR LIKE ZREV_BUDGET-GJAHR,
              KOSTL LIKE ZREV_BUDGET-KOSTL,
              KSTAR LIKE ZREV_BUDGET-KSTAR,
              TOTAL1 LIKE COSP-WKG001,
              TOTAL3 LIKE COSP-WKG001,
              TEXT LIKE CSKU-KTEXT,
              VARIANCE LIKE COSP-WKG001,
              BEZEICH LIKE FMFCTRT-BEZEICH,
            END OF IT_FINAL1.
    ENDIF.
    DATA: BEGIN OF IT_FISTL OCCURS 0,
           RFISTL LIKE FMIT-RFISTL,
           BEZEICH LIKE FMFCTRT-BEZEICH,
          END OF IT_FISTL.
    DATA: BEGIN OF IT_HKONT OCCURS 0,
           KSTAR LIKE CSKU-KSTAR,
           KTEXT LIKE CSKU-KTEXT,
          END OF IT_HKONT.
    DATA: PERIOD1 TYPE I,
          PERIOD2 TYPE I,
          PERIOD3 TYPE I,
          PERIO TYPE I.
    DATA: BEZEICH LIKE FMFCTRT-BEZEICH.
    CONSTANTS: C_00 TYPE MONAT VALUE '00',
               C_13 TYPE MONAT VALUE '13'.
    DATA : IT_RETURN LIKE DDSHRETVAL OCCURS 0 WITH HEADER LINE.
    DATA: FIPEX1 LIKE COSP-KSTAR.
    A T - S E L E C T I O N  S C R E E N
    AT SELECTION-SCREEN.
      LOOP AT PERDE.
        IF  PERDE-LOW >= C_13 OR PERDE-HIGH >= C_13 .
          MESSAGE E022(ZA)  WITH 'Enter Period values from 1 to 12'.
          EXIT.
        ENDIF.
      ENDLOOP.
      IF NOT PERDE-LOW IS INITIAL.
        PERIOD1 = PERDE-LOW.
      ENDIF.
      IF NOT PERDE-HIGH IS INITIAL.
        PERIOD2 = PERDE-HIGH.
        PERIOD3 = PERIOD2 - PERIOD1.
        PERIOD3 = PERIOD3 + 1.
      ELSE.
        PERIOD3 = 1.
      ENDIF.
      PERIO = PERIOD1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR RFISTL-LOW.
      SELECT FICTR BEZEICH INTO TABLE IT_FISTL FROM FMFCTRT
                                               WHERE SPRAS EQ 'EN'
                                               AND   FIKRS EQ 'NFFM'.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD   = 'RFISTL'
          VALUE_ORG  = 'S'
        TABLES
          VALUE_TAB  = IT_FISTL
          RETURN_TAB = IT_RETURN.
      IF SY-SUBRC = 0.
        READ TABLE IT_RETURN INDEX 1.
        MOVE IT_RETURN-FIELDVAL TO RFISTL-LOW.
      ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR RFISTL-HIGH.
      SELECT FICTR BEZEICH INTO TABLE IT_FISTL FROM FMFCTRT
                                               WHERE SPRAS EQ 'EN'
                                               AND   FIKRS EQ 'NFFM'.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD   = 'RFISTL'
          VALUE_ORG  = 'S'
        TABLES
          VALUE_TAB  = IT_FISTL
          RETURN_TAB = IT_RETURN.
      IF SY-SUBRC = 0.
        READ TABLE IT_RETURN INDEX 1.
        MOVE IT_RETURN-FIELDVAL TO RFISTL-HIGH.
      ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR HKONT-LOW.
      SELECT KSTAR KTEXT INTO TABLE IT_HKONT FROM CSKU WHERE SPRAS EQ 'EN'.
      SORT IT_HKONT BY KSTAR.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD   = 'HKONT'
          VALUE_ORG  = 'S'
        TABLES
          VALUE_TAB  = IT_HKONT
          RETURN_TAB = IT_RETURN.
      IF SY-SUBRC = 0.
        READ TABLE IT_RETURN INDEX 1.
        MOVE IT_RETURN-FIELDVAL TO HKONT-LOW.
      ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR HKONT-HIGH.
      SELECT  KSTAR KTEXT INTO TABLE IT_HKONT FROM CSKU WHERE SPRAS EQ 'EN'.
      SORT IT_HKONT BY KSTAR.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD   = 'HKONT'
          VALUE_ORG  = 'S'
        TABLES
          VALUE_TAB  = IT_HKONT
          RETURN_TAB = IT_RETURN.
      IF SY-SUBRC = 0.
        READ TABLE IT_RETURN INDEX 1.
        MOVE IT_RETURN-FIELDVAL TO HKONT-HIGH.
      ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR KOSTL-LOW.
      SELECT FICTR BEZEICH INTO TABLE IT_FISTL FROM FMFCTRT
                                               WHERE SPRAS EQ 'EN'
                                               AND   FIKRS IN KOSTL.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD   = 'KOSTL'
          VALUE_ORG  = 'S'
        TABLES
          VALUE_TAB  = IT_FISTL
          RETURN_TAB = IT_RETURN.
      IF SY-SUBRC = 0.
        READ TABLE IT_RETURN INDEX 1.
        MOVE IT_RETURN-FIELDVAL TO KOSTL-LOW.
      ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR KOSTL-HIGH.
      SELECT FICTR BEZEICH INTO TABLE IT_FISTL FROM FMFCTRT
                                               WHERE SPRAS EQ 'EN'
                                               AND   FIKRS IN KOSTL.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD   = 'KOSTL'
          VALUE_ORG  = 'S'
        TABLES
          VALUE_TAB  = IT_FISTL
          RETURN_TAB = IT_RETURN.
      IF SY-SUBRC = 0.
        READ TABLE IT_RETURN INDEX 1.
        MOVE IT_RETURN-FIELDVAL TO KOSTL-HIGH.
      ENDIF.
    *START-OF-SELECTION
    START-OF-SELECTION.
      IF RADIO EQ 'X'.                     " FOR FUNDS CENTER AND COMMITMENT ITEM
        PERFORM GET_DATA.
        PERFORM PROCESS_DATA.
      ENDIF.
      IF RADIO1 EQ 'X'.                    " FOR COST CENTER AND G/L ACCOUNT
        PERFORM GET_DATA1.
        PERFORM PROCESS_DATA1.
      ENDIF.
    *END OF SELECTION
      PERFORM BUILD_LAYOUT.
      PERFORM BUILD_EVENTS.
      IF RADIO EQ 'X'.
        PERFORM BUILD_FIELDCATALOG.
        PERFORM BUILD_SORT.
        PERFORM DISPLAY_ALV_REPORT.
      ENDIF.
      IF RADIO1 EQ 'X'.
        PERFORM BUILD_FIELDCATALOG1.
        PERFORM BUILD_SORT1.
        PERFORM DISPLAY_ALV_REPORT1.
      ENDIF.
    *&      Form  GET_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM GET_DATA .
      SELECT FIKRS FICTR CTR_OBJNR INTO TABLE IT_TAB FROM FMFCTR
                                                     WHERE FIKRS EQ 'NFFM'
                                                     AND   FICTR IN RFISTL.
      SELECT CO_OBJNR POSIT INTO TABLE IT_TAB1 FROM BPIJ
                                               FOR ALL ENTRIES IN IT_TAB
                                               WHERE CO_OBJNR EQ IT_TAB-CTR_OBJNR.
      LOOP AT IT_TAB1.
        SELECT SINGLE FIPEX INTO IT_TAB1-FIPEX FROM FMPOSIT WHERE FIKRS EQ 'NFFM'
                                               AND   POSIT EQ IT_TAB1-POSIT
                                               AND   FIPEX IN FIPEX.
        IF SY-SUBRC EQ '0'.
          MODIFY IT_TAB1.
        ELSE.
          DELETE IT_TAB1.
        ENDIF.
      ENDLOOP.
      SELECT OBJNR
             POSIT
             GJAHR
             WLP01
             WLP02
             WLP03
             WLP04
             WLP05
             WLP06
             WLP07
             WLP08
             WLP09
             WLP10
             WLP11
             WLP12
             INTO TABLE IT_BPPE
             FROM BPPE
             FOR ALL ENTRIES IN IT_TAB1
             WHERE OBJNR EQ IT_TAB1-CO_OBJNR
             AND   POSIT EQ IT_TAB1-POSIT
             AND   GJAHR EQ RYEAR
             AND   VORGA IN ('KBFR','KBUE','KBUS').
      LOOP AT IT_BPPE.
        MOVE-CORRESPONDING IT_BPPE TO IT_BPPE1.
        IT_BPPE1-RFISTL = IT_BPPE1-OBJNR+6(4).
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
          EXPORTING
            INPUT  = IT_BPPE1-RFISTL
          IMPORTING
            OUTPUT = IT_BPPE1-RFISTL.
        CALL FUNCTION 'FM_FIPEX_GET_FROM_POSIT'
          EXPORTING
            I_FIKRS = 'NFFM'
            I_POSIT = IT_BPPE1-POSIT
          IMPORTING
            E_FIPEX = IT_BPPE1-FIPEX.
        PERIOD1 = PERIO.
        DO PERIOD3 TIMES.
          CASE PERIOD1.
            WHEN 1.
              IT_BPPE1-TOTAL2 =  IT_BPPE1-TOTAL2 + IT_BPPE-WLP01.
            WHEN 2.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP02.
            WHEN 3.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP03.
            WHEN 4.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP04.
            WHEN 5.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP05.
            WHEN 6.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP06.
            WHEN 7.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP07.
            WHEN 8.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP08.
            WHEN 9.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP09.
            WHEN 10.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP10.
            WHEN 11.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP11.
            WHEN 12.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP12.
          ENDCASE.
          IF PERIOD2 >= PERIOD1.
            PERIOD1 = PERIOD1 + 1.
          ENDIF.
        ENDDO.
        COLLECT IT_BPPE1.
        CLEAR PERIOD1.
        CLEAR IT_BPPE1.
      ENDLOOP.
      SELECT RYEAR
             FIKRS
             RFISTL
             RFIPEX
             HSL01
             HSL02
             HSL03
             HSL04
             HSL05
             HSL06
             HSL07
             HSL08
             HSL09
             HSL10
             HSL11
             HSL12
             HSL13
             HSL14
             HSL15
             HSL16
             INTO TABLE IT_FMIT FROM FMIT
             FOR ALL ENTRIES IN IT_BPPE1
             WHERE RYEAR EQ RYEAR
             AND   FIKRS EQ 'NFFM'
            AND   RFIPEX EQ IT_BPPE1-FIPEX
             AND  RFIPEX IN FIPEX
             AND   RFISTL EQ IT_BPPE1-RFISTL.
      LOOP AT IT_FMIT.
        MOVE-CORRESPONDING IT_FMIT TO IT_FMIT1.
        PERIOD1 = PERIO.
        DO PERIOD3 TIMES.
          CASE PERIOD1.
            WHEN 1.
              IT_FMIT1-TOTAL =  IT_FMIT1-TOTAL + IT_FMIT-HSL01.
            WHEN 2.
              IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL02.
            WHEN 3.
              IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL03.
            WHEN 4.
              IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL04.
            WHEN 5.
              IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL05.
            WHEN 6.
              IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL06.
            WHEN 7.
              IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL07.
            WHEN 8.
              IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL08.
            WHEN 9.
              IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL09.
            WHEN 10.
              IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL10.
            WHEN 11.
              IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL11.
            WHEN 12.
              IT_FMIT1-TOTAL = IT_FMIT1-TOTAL + IT_FMIT-HSL12.
          ENDCASE.
          IF PERIOD2 >= PERIOD1.
            PERIOD1 = PERIOD1 + 1.
          ENDIF.
        ENDDO.
        IT_FMIT1-TOTAL1 = IT_FMIT1-TOTAL * -1 .
        COLLECT IT_FMIT1.
        CLEAR PERIOD1.
        CLEAR IT_FMIT1.
      ENDLOOP.
    ENDFORM.                    " GET_DATA
    *&      Form  PROCESS_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM PROCESS_DATA .
      SORT IT_FMIT1 BY FIKRS RFISTL RFIPEX.
      SORT IT_BPPE1 BY RFISTL FIPEX.
      LOOP AT IT_BPPE1.
        IT_FINAL-RFISTL = IT_BPPE1-RFISTL.
        IT_FINAL-RFIPEX = IT_BPPE1-FIPEX.
        IT_FINAL-ALLOC   = IT_BPPE1-TOTAL2.
        READ TABLE IT_FMIT1 WITH KEY RFISTL = IT_BPPE1-RFISTL  RFIPEX = IT_BPPE1-FIPEX.
        IF SY-SUBRC EQ 0.
          IT_FINAL-USED   = IT_FMIT1-TOTAL1.
        ENDIF.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
          EXPORTING
            INPUT  = IT_FMIT1-RFIPEX
          IMPORTING
            OUTPUT = IT_FMIT1-RFIPEX.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
          EXPORTING
            INPUT  = IT_FMIT1-RFISTL
          IMPORTING
            OUTPUT = IT_FMIT1-RFISTL.
    Changes made on 13/11/2007  *******************************
       SELECT SINGLE TEXT1 INTO IT_FINAL-TEXT FROM FMCIT WHERE SPRAS EQ 'EN'
                                                         AND   FIPEX EQ  IT_FMIT1-RFIPEX.
        SELECT SINGLE TEXT1 INTO IT_FINAL-TEXT FROM FMCIT WHERE SPRAS EQ 'EN'
                                                          AND   FIPEX EQ  IT_BPPE1-FIPEX.
    Changes made on 13/11/2007  *******************************
        SELECT SINGLE BEZEICH INTO IT_FINAL-BEZEICH FROM FMFCTRT
                                                    WHERE SPRAS EQ 'EN'
                                                    AND   FICTR EQ IT_FMIT1-RFISTL.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
          EXPORTING
            INPUT  = IT_FINAL-RFIPEX
          IMPORTING
            OUTPUT = IT_FINAL-RFIPEX.
        IT_FINAL-REMAIN = IT_FINAL-ALLOC - IT_FINAL-USED.
        APPEND IT_FINAL.
        CLEAR IT_FINAL.
      ENDLOOP.
    SORT IT_FINAL BY FIKRS RFISTL RFIPEX.
       LOOP AT IT_FMIT1.
        READ TABLE IT_FINAL WITH KEY RFISTL = IT_FMIT1-RFISTL RFIPEX = IT_FMIT1-RFIPEX.
        IF SY-SUBRC NE 0.
          IT_FINAL-RFISTL = IT_FMIT1-RFISTL.
          IT_FINAL-RFIPEX = IT_FMIT1-RFIPEX.
          IT_FINAL-USED   = IT_FMIT1-TOTAL1.
        IT_FINAL-ALLOC   = '0'.
          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
            EXPORTING
              INPUT  = IT_FMIT1-RFIPEX
            IMPORTING
              OUTPUT = IT_FMIT1-RFIPEX.
          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
            EXPORTING
              INPUT  = IT_FMIT1-RFISTL
            IMPORTING
              OUTPUT = IT_FMIT1-RFISTL.
          SELECT SINGLE TEXT1 INTO IT_FINAL-TEXT FROM FMCIT WHERE SPRAS EQ 'EN'
                                                            AND   FIPEX EQ  IT_FMIT1-RFIPEX.
          SELECT SINGLE BEZEICH INTO IT_FINAL-BEZEICH FROM FMFCTRT
                                                      WHERE SPRAS EQ 'EN'
                                                      AND   FICTR EQ IT_FMIT1-RFISTL.
          IT_FINAL-REMAIN = IT_FINAL-ALLOC - IT_FINAL-USED.
          APPEND IT_FINAL.
          CLEAR IT_FINAL.
        ELSE.
          DELETE IT_FMIT1.
        ENDIF.
      ENDLOOP.
      SORT IT_FINAL BY FIKRS RFISTL RFIPEX.
    ENDFORM.                    " PROCESS_DATA
    *&      Form  GET_DATA1
          text
    -->  p1        text
    <--  p2        text
    FORM GET_DATA1 .
      SELECT KOKRS KOSTL BUKRS OBJNR INTO TABLE IT_CSKS
                                     FROM CSKS
                                     WHERE KOKRS EQ '1000'
                                     AND   KOSTL IN KOSTL
                                     AND   BUKRS EQ 'NFCL'.
      SELECT OBJNR
             GJAHR
             KSTAR
             BEKNZ
             WKG001
             WKG002
             WKG003
             WKG004
             WKG005
             WKG006
             WKG007
             WKG008
             WKG009
             WKG010
             WKG011
             WKG012
             FROM COSP
             INTO TABLE IT_COSP
             FOR ALL ENTRIES IN IT_CSKS
             WHERE OBJNR EQ IT_CSKS-OBJNR
             AND   GJAHR EQ RYEAR
             AND   KSTAR IN HKONT.
      LOOP AT IT_COSP.
        MOVE-CORRESPONDING IT_COSP TO IT_COSP2.
        PERIOD1 = PERIO.
        DO PERIOD3 TIMES.
          CASE PERIOD1.
            WHEN 1.
              IT_COSP2-TOTAL =  IT_COSP2-TOTAL + IT_COSP-WKG001.
            WHEN 2.
              IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG002.
            WHEN 3.
              IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG003.
            WHEN 4.
              IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG004.
            WHEN 5.
              IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG005.
            WHEN 6.
              IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG006.
            WHEN 7.
              IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG007.
            WHEN 8.
              IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG008.
            WHEN 9.
              IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG009.
            WHEN 10.
              IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG010.
            WHEN 11.
              IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG011.
            WHEN 12.
              IT_COSP2-TOTAL = IT_COSP2-TOTAL + IT_COSP-WKG012.
          ENDCASE.
          IF PERIOD2 >= PERIOD1.
            PERIOD1 = PERIOD1 + 1.
          ENDIF.
        ENDDO.
        IT_COSP2-OBJNR1 = IT_COSP2-OBJNR+10(6).
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
          EXPORTING
            INPUT  = IT_COSP2-OBJNR1
          IMPORTING
            OUTPUT = IT_COSP2-OBJNR1.
        CONCATENATE 'FSNFFM' IT_COSP2-OBJNR1 INTO IT_COSP2-OBJNR1.
        IT_COSP2-FIPEX = IT_COSP2-KSTAR.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
          EXPORTING
            INPUT  = IT_COSP2-FIPEX
          IMPORTING
            OUTPUT = IT_COSP2-FIPEX.
        CALL FUNCTION 'FM_POSIT_GET_FROM_FIPEX'
          EXPORTING
          I_FIKRS                = 'NFFM'
          I_FIPEX                = IT_COSP2-FIPEX
      I_FLG_BUFFER_ALL       =
       IMPORTING
       E_POSIT                = IT_COSP2-POSIT
    TABLES
      T_FMPOSIT              =
        EXCEPTIONS
          INPUT_ERROR            = 1
          DATA_NOT_FOUND         = 2
          OTHERS                 = 3
        IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        CONDENSE IT_COSP2-OBJNR1.
        CONDENSE IT_COSP2-POSIT.
        COLLECT IT_COSP2.
        CLEAR PERIOD1.
        CLEAR IT_COSP2.
      ENDLOOP.
      SORT IT_COSP2 BY OBJNR KSTAR.
      SELECT OBJNR
             POSIT
             GJAHR
             WLP01
             WLP02
             WLP03
             WLP04
             WLP05
             WLP06
             WLP07
             WLP08
             WLP09
             WLP10
             WLP11
             WLP12
             INTO TABLE IT_BPPE
             FROM BPPE
             FOR ALL ENTRIES IN IT_COSP2
             WHERE OBJNR EQ IT_COSP2-OBJNR1
             AND   POSIT EQ IT_COSP2-POSIT
             AND   GJAHR EQ RYEAR
             AND   VORGA IN ('KBFR','KBUE','KBUS').
      LOOP AT IT_BPPE.
        MOVE-CORRESPONDING IT_BPPE TO IT_BPPE1.
        PERIOD1 = PERIO.
        DO PERIOD3 TIMES.
          CASE PERIOD1.
            WHEN 1.
              IT_BPPE1-TOTAL2 =  IT_BPPE1-TOTAL2 + IT_BPPE-WLP01.
            WHEN 2.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP02.
            WHEN 3.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP03.
            WHEN 4.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP04.
            WHEN 5.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP05.
            WHEN 6.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP06.
            WHEN 7.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP07.
            WHEN 8.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP08.
            WHEN 9.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP09.
            WHEN 10.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP10.
            WHEN 11.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP11.
            WHEN 12.
              IT_BPPE1-TOTAL2 = IT_BPPE1-TOTAL2 + IT_BPPE-WLP12.
          ENDCASE.
          IF PERIOD2 >= PERIOD1.
            PERIOD1 = PERIOD1 + 1.
          ENDIF.
        ENDDO.
        COLLECT IT_BPPE1.
        CLEAR PERIOD1.
        CLEAR IT_BPPE1.
      ENDLOOP.
    ENDFORM.                                                    " GET_DATA1
    *&      Form  PROCESS_DATA1
          text
    -->  p1        text
    <--  p2        text
    FORM PROCESS_DATA1 .
      LOOP AT IT_COSP2.
        IT_FINAL1-GJAHR = IT_COSP2-GJAHR.
        IT_FINAL1-KSTAR = IT_COSP2-KSTAR.
        IT_FINAL1-TOTAL1 = IT_COSP2-TOTAL.
        SELECT SINGLE KOSTL FROM CSKS INTO IT_FINAL1-KOSTL WHERE KOKRS = '1000'
                                                            AND BUKRS EQ 'NFCL'
                                                            AND OBJNR = IT_COSP2-OBJNR.
        READ TABLE IT_BPPE1 WITH KEY OBJNR = IT_COSP2-OBJNR1 POSIT = IT_COSP2-POSIT.
        IF SY-SUBRC EQ 0.
          IT_FINAL1-TOTAL3 = IT_BPPE1-TOTAL2.
        ENDIF.
        SELECT SINGLE KTEXT INTO IT_FINAL1-TEXT FROM CSKU WHERE SPRAS EQ 'EN'
                                                          AND  KSTAR EQ  IT_COSP2-KSTAR.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
          EXPORTING
            INPUT  = IT_FINAL1-KOSTL
          IMPORTING
            OUTPUT = IT_FINAL1-KOSTL.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
          EXPORTING
            INPUT  = IT_FINAL1-KSTAR
          IMPORTING
            OUTPUT = IT_FINAL1-KSTAR.
        SELECT SINGLE BEZEICH INTO IT_FINAL1-BEZEICH FROM FMFCTRT
                                                    WHERE SPRAS EQ 'EN'
                                                    AND   FICTR EQ IT_FINAL1-KOSTL.
        IT_FINAL1-VARIANCE = IT_FINAL1-TOTAL3 - IT_FINAL1-TOTAL1.
        APPEND IT_FINAL1.
        CLEAR IT_FINAL1.
      ENDLOOP.
      SORT IT_FINAL1 BY KOSTL KSTAR.
      DELETE IT_FINAL1 WHERE KOSTL IS INITIAL.
    ENDFORM.                    " PROCESS_DATA1
    *&      Form  BUILD_FIELDCATALOG
          text
    -->  p1        text
    <--  p2        text
    FORM BUILD_FIELDCATALOG .
      FIELDCATALOG-FIELDNAME   = 'RFISTL'.
      FIELDCATALOG-SELTEXT_M   = 'Funds Center'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'BEZEICH'.
      FIELDCATALOG-SELTEXT_M   = 'Fund Center Description'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'RFIPEX'.
      FIELDCATALOG-SELTEXT_M   = 'Commitment Item'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'TEXT'.
      FIELDCATALOG-SELTEXT_M   = 'Commitment Item Description'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'ALLOC'.
      FIELDCATALOG-SELTEXT_M   = 'Allocated Budget'.
      FIELDCATALOG-DO_SUM      = 'X'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'USED'.
      FIELDCATALOG-SELTEXT_M   = 'Used Budget'.
      FIELDCATALOG-DO_SUM      = 'X'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'REMAIN'.
      FIELDCATALOG-SELTEXT_M   = 'Remaining Budget'.
      FIELDCATALOG-DO_SUM      = 'X'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_FIELDCATALOG1
          text
    -->  p1        text
    <--  p2        text
    FORM BUILD_FIELDCATALOG1 .
      FIELDCATALOG-FIELDNAME   = 'KOSTL'.
      FIELDCATALOG-SELTEXT_M   = 'Cost Center'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'BEZEICH'.
      FIELDCATALOG-SELTEXT_M   = 'Cost Center Description'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'KSTAR'.
      FIELDCATALOG-SELTEXT_M   = 'G/L Account'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'TEXT'.
      FIELDCATALOG-SELTEXT_M   = 'G/L Account Description'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'TOTAL3'.
      FIELDCATALOG-SELTEXT_M   = 'Planned amount'.
      FIELDCATALOG-DO_SUM      = 'X'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'TOTAL1'.
      FIELDCATALOG-SELTEXT_M   = 'Actuals'.
      FIELDCATALOG-DO_SUM      = 'X'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'VARIANCE'.
      FIELDCATALOG-SELTEXT_M   = 'Variance'.
      FIELDCATALOG-DO_SUM      = 'X'.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
    ENDFORM.                    " BUILD_FIELDCATALOG1
    *&      Form  BUILD_LAYOUT
          text
    -->  p1        text
    <--  p2        text
    FORM BUILD_LAYOUT .
      GD_LAYOUT-NO_INPUT          = 'X'.
      GD_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
    ENDFORM.                    " BUILD_LAYOUT
    *&      Form  BUILD_SORT
          text
    -->  p1        text
    <--  p2        text
    FORM BUILD_SORT .
      DATA: GT_SORT TYPE SLIS_SORTINFO_ALV.
      GT_SORT-UP = 'X'.
      GT_SORT-FIELDNAME = 'RFISTL'.
      GT_SORT-TABNAME  = 'IT_FINAL'.
      GT_SORT-SUBTOT  = 'X'.
      APPEND GT_SORT TO GD_SORT.
      CLEAR GT_SORT.
      GT_SORT-UP = 'X'.
      GT_SORT-FIELDNAME = 'BEZEICH'.
      GT_SORT-TABNAME  = 'IT_FINAL'.
      APPEND GT_SORT TO GD_SORT.
      CLEAR GT_SORT.
    ENDFORM.                    " BUILD_SORT
    *&      Form  BUILD_SORT1
          text
    -->  p1        text
    <--  p2        text
    FORM BUILD_SORT1 .
      DATA: GT_SORT TYPE SLIS_SORTINFO_ALV.
      GT_SORT-UP = 'X'.
      GT_SORT-FIELDNAME = 'KOSTL'.
      GT_SORT-TABNAME  = 'IT_FINAL'.
      GT_SORT-SUBTOT  = 'X'.
      APPEND GT_SORT TO GD_SORT.
      CLEAR GT_SORT.
      GT_SORT-UP = 'X'.
      GT_SORT-FIELDNAME = 'BEZEICH'.
      GT_SORT-TABNAME  = 'IT_FINAL'.
      APPEND GT_SORT TO GD_SORT.
      CLEAR GT_SORT.
    ENDFORM.                    " BUILD_SORT1
    *&      Form  BUILD_EVENTS
          text
    -->  p1        text
    <--  p2        text
    FORM BUILD_EVENTS .
      IT_EVENT-NAME = 'TOP_OF_PAGE'.
      IT_EVENT-FORM = 'TOP_OF_PAGE'.
      APPEND IT_EVENT TO IT_EVENT1.
    CLEAR IT_EVENT.
    ENDFORM.                    " BUILD_EVENTS
    *&      Form TOP_OF_PAGE
          ALV TOP-OF-PAGE
    FORM TOP_OF_PAGE.                                           "#EC CALLED
      REFRESH : IT_LIST_TOP_OF_PAGE.
      CLEAR : IT_LINE.
      IT_LINE-TYP  = 'H'.
      IT_LINE-INFO = TEXT-001.
      APPEND IT_LINE TO IT_LIST_TOP_OF_PAGE.
      CLEAR IT_LINE.
      IF RADIO EQ 'X'.
        IT_LINE-TYP  = 'S'.
        IT_LINE-INFO  = TEXT-101.
        IF NOT FIPEX-LOW IS INITIAL.
          CONCATENATE TEXT-101 '-' FIPEX-LOW INTO IT_LINE-INFO SEPARATED BY SPACE.
          IF NOT FIPEX-HIGH IS INITIAL.
            CONCATENATE TEXT-101 '-' FIPEX-LOW 'to' FIPEX-HIGH INTO IT_LINE-INFO SEPARATED BY SPACE.
          ENDIF.
        ENDIF.
        APPEND IT_LINE TO IT_LIST_TOP_OF_PAGE.
        CLEAR IT_LINE-INFO.
        IT_LINE-INFO = TEXT-102.
        IF NOT RFISTL-LOW IS INITIAL.
          CONCATENATE TEXT-102 '-' RFISTL-LOW INTO IT_LINE-INFO SEPARATED BY SPACE.
          IF NOT RFISTL-HIGH IS INITIAL.
            CONCATENATE TEXT-102 '-' RFISTL-LOW 'to' RFISTL-HIGH INTO IT_LINE-INFO SEPARATED BY SPACE.
          ENDIF.
        ENDIF.
        APPEND IT_LINE TO IT_LIST_TOP_OF_PAGE.
      ENDIF.
      IF RADIO1 EQ 'X'.
        CLEAR IT_LINE-INFO.
        IT_LINE-INFO = TEXT-105.
        IF NOT KOSTL-LOW IS INITIAL.
          CONCATENATE TEXT-105 '-' KOSTL-LOW INTO IT_LINE-INFO SEPARATED BY SPACE.
          IF NOT KOSTL-HIGH IS INITIAL.
            CONCATENATE TEXT-105 '-' KOSTL-LOW 'to' KOSTL-HIGH INTO IT_LINE-INFO SEPARATED BY SPACE.
          ENDIF.
        ENDIF.
        APPEND IT_LINE TO IT_LIST_TOP_OF_PAGE.
        CLEAR IT_LINE-INFO.
        IT_LINE-INFO = TEXT-106.
        IF NOT HKONT-LOW IS INITIAL.
          CONCATENATE TEXT-106 '-' HKONT-LOW INTO IT_LINE-INFO SEPARATED BY SPACE.
          IF NOT HKONT-HIGH IS INITIAL.
            CONCATENATE TEXT-106 '-' HKONT-LOW 'to' HKONT-HIGH INTO IT_LINE-INFO SEPARATED BY SPACE.
          ENDIF.
        ENDIF.
        APPEND IT_LINE TO IT_LIST_TOP_OF_PAGE.
      ENDIF.
      CLEAR IT_LINE-INFO.
      IT_LINE-INFO = TEXT-103.
      IF NOT PERDE-LOW IS INITIAL.
        CONCATENATE TEXT-103 '-' PERDE-LOW INTO IT_LINE-INFO SEPARATED BY SPACE.
        IF NOT PERDE-HIGH IS INITIAL.
          CONCATENATE TEXT-103 '-' PERDE-LOW 'to' PERDE-HIGH INTO IT_LINE-INFO SEPARATED BY SPACE.
        ENDIF.
      ENDIF.
      APPEND IT_LINE TO IT_LIST_TOP_OF_PAGE.
      CLEAR IT_LINE-INFO.
      IT_LINE-INFO = TEXT-104.
      IF NOT RYEAR IS INITIAL.
        CONCATENATE TEXT-104 '-' RYEAR INTO IT_LINE-INFO SEPARATED BY SPACE.
      ENDIF.
      APPEND IT_LINE TO IT_LIST_TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY = IT_LIST_TOP_OF_PAGE.
    ENDFORM.                               "TOP_OF_PAGE
    *&      Form  DISPLAY_ALV_REPORT
          text
    -->  p1        text
    <--  p2        text
    FORM DISPLAY_ALV_REPORT .
      GD_REPID = SY-REPID.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM     = GD_REPID
          I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
          IS_LAYOUT              = GD_LAYOUT
          IT_EVENTS              = IT_EVENT1[]
          IT_FIELDCAT            = FIELDCATALOG[]
          IT_SORT                = GD_SORT[]
        TABLES
          T_OUTTAB               = IT_FINAL
        EXCEPTIONS
          PROGRAM_ERROR          = 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.
    ENDFORM.                    "DISPLAY_ALV_REPORT
    *&      Form  DISPLAY_ALV_REPORT1
          text
    -->  p1        text
    <--  p2        text
    FORM DISPLAY_ALV_REPORT1 .
      GD_REPID = SY-REPID.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM     = GD_REPID
          I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
          IS_LAYOUT              = GD_LAYOUT
          IT_EVENTS              = IT_EVENT1[]
          IT_FIELDCAT            = FIELDCATALOG[]
          IT_SORT                = GD_SORT[]
        TABLES
          T_OUTTAB               = IT_FINAL1
        EXCEPTIONS
          PROGRAM_ERROR          = 1
          OTHERS                 = 2.
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSG

  • Confused regarding .VOB, .BUP, and .IFO files

    I am a renowned impulse shopper (for example, I went researching new computers and came home with an iMac 1 day later with no clue how to work it), and I have been reading these discussion pages constantly for the past week. I do not want to go buying unfamiliar stuff to accomplish my goal without getting some advice, based just on what I have gleaned from the discussions. I hope this is ok.
    My goal is to convert my home VHS videos into an editable format within iMovie 08 so that I can edit, then burn them to DVD. Here is what I have so far...I really hope you can provide some advice as to whether I am on the right track?
    For using my VHS player, I was advised to use Dazzle (or Video Capture for Mac), but the website says it converts into MPEG-4. I have read that this is the lesser quality compared to MPEG-2 so I am not sure if there is better equipment or will this be fine? Before being told about Dazzle, I was looking for a cheap DVR that would connect to my computer.
    For the VHS that I have already had Wal-Mart convert to DVD, I have tried to copy them onto my hard drive but they are in a VIDEO_TS folder filled with .VOB, .BUP, and .IFO files. Naturally, I cannot play those files. I read that MPEG Streamclip and iSquint are popular tools for these files, but I must admit to feeling idiotic when reading more about them. I do not know what would be best for my project.
    Thanks so much for any advice and guidance on this very confusing topic. I simply want to understand and buy what I need the first time to achieve my goals using my nice, new shiny iMac!

    My suggestion would be to convert to DV for editing, mpeg2 and h264 are both compressed and are not generally a first choice for editing purposes, h264 is much more efficient than mpeg2, so of the two would I believe be the better option regardless of the fact that you couldn't use mpeg2 with imovie anyway.
    To convert VHS you will need some form of capture hardware such as a stand alone device or a PCI card although if you know someone with a miniDV camera with pass through capability you could also use that.
    As for those DVD's you got done at wal-mart, I don't know if they offer it as a service but you would be better getting them as data DVD's with DV files on them rather than DVD format. For those that you already have mpegstreamclip would be my tool of choice, again converting them to DV.

  • How to handling Binary data and File operation?

    Hello Everyone,
    I think this question might have been asked a lot of time but I was unable to find one solution so, please help needed in this from all you guys..
    I am creating a byte[] of the media files of mp4, and jpg, using the below code,,
    File ff = new File(filename);
            fos = new FileOutputStream(ff);
            int b;
            byte[] f = this.getMediaFile();
            for (b = 0; b < f.length; b++) {
                if (f[b] != -1) {
                    fos.write(f);
    fos.flush();
    fos.close();
    After i convert it i have to store it in the MySql Database as BLOB object, for retrieving byte[] from the database is simple i can do that also successfully with this code.java.sq.Blob obj = (java.sql.Blob) rs.getBlob("file");
    InputStream is = null;
    ByteArrayOutputStream bc = null;
    is = obj.getBinaryStream();
    bc = new ByteArrayOutputStream();
    int b;
    while ((b = is.read()) != -1) {
    System.out.print(b + " ");
    bc.write(b);
    Now the real problem is that when i want to recreate a mp4 audio or video file i am unable to do so, the file created is smaller in size and also it doesn't get played in windows default player nor VLC. I am able to get the image file of jpg format using the BufferedImage & ImageIO.writer();
    How do i do for mp4 file, have no clue for that.
    Pleases help out with this.
    Thanks..                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    if (f[b] != -1) {I don't get that line. What if you try to output the data without that condition, like this:
    fos = new FileOutputStream(ff);
            byte[] f = this.getMediaFile();
            for (int b = 0; b < f.length; b++) {
                 fos.write(f);
    fos.close();

  • VB6 - Confusion regarding Acrobat Version and supported methods

    I've got an app, created in VB6, that uses the javascript method "addWatermarkFromFile".  It works fine on my machine(s) with Acrobat 7 and 9.0.  One of the machines that it has been installed on gets an "Object doesn't support this property or method" error.  The machine has had several version of Acrobat on it in the past, but is now running 9.4.1.  I added a chunk of code to create the AcroExch app and Show it, and the user reports that it launches Acrobat 9.4.1, so I know it's creating an app that should support "addWatermarkFromFile".  Is there anything else I can check?  I don't know much about the OLE mechanisms.  Could a stray acrobat.tlb file cause something like that?

    After further review the problem was NOT related to addWatermarkFromFile, but rather was caused when the app called a javascript function that was implemented by the placement of a .js file in the Javascripts directory.  The user is now, inconveniently, on vacation, but I'm guessing either the script is not being created (unlikely) or that Javascript (or some portion of the javascript functionality) is disabled. 

Maybe you are looking for