My First Pgm.

Hello.
I am writing my first program with the SDK.  I seem to have got some stuff working with the UI API and now I am trying the DI API.  I can connect to the API OK and "oCompany.CompanyName" returns the correct company name so I am sure I am connected to the API and company OK.
My first piece of code that accesses the DI API looks like this :
Dim readings As SAPbobsCOM.Recordset
readings = ocompany.GetBusiness(ObjectSAPbobsCOM.BoObjectTypes.BoRecordset)
readings.DoQuery("Select U_insID,U_read_val from [@VGL_READNGS]")
Dim contract As Integer
contract = readings.Fields.Item(0).Value
While Not (readings.EoF)
   Dim LastUnbilledReading As Integer
   Dim FirstUnbilledReading As Integer
       blah blah blah
If I use the debug feature in VS.net and step through the code, I can see quite a delay at the line contact=readings.Fields.Item(0).Value
and then suddenly the code exits the procedure and returns to the form that called it.
I have put all manner of try/catchs around each line and interrogated getlasterror (I've removed them from above for sake of brevity) but I cannot see what I am doing wrong.  My user defined file is not a registered object, but I don't think that is the problem. 
Can anyone shed some light or suggest where I might look ?
Thanks,
Ray

Hi Ray,
I've tried your code,and it works correctly.
Is the datatype of U_insID integer ?
You can see the code like this:
        Dim readings As SAPbobsCOM.Recordset
        readings = oAddOn1Start.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
        readings.DoQuery("Select CODE,NAME from [@CADMEN_WORKBOARD]")
        Dim contract As Integer
        contract = readings.Fields.Item(0).Value
        While Not (readings.EoF)
            Dim LastUnbilledReading As Integer
            Dim FirstUnbilledReading As Integer
            ' blah blah blah
            readings.MoveNext()
        End While

Similar Messages

  • How to edit a program dynamically called from another program

    Hi all,
    Can anyone help me in coding for a program which call's another
    report dynamically from selection screen(for instance z_dynam_called)
    and retreive the whole content of the dynamically called program(z_dynam_called)
    into an internal table and replace the contents of the internal table  with some new code and put it back in z_dynam_called and save it.
    Thanks in advance.
    Needful will be rewarded with points

    Hi,
    Follow this:
    1) U can pass data from one program to another in a single login using SAP memory......
    2) u can create a DBtable update dat table using ur first pgm and fetch from second program.....
    3) U can pass the report output using EXPORT TO MEMORY addition and get it back using IMPORT FROM MEMORY..........
    Eg:
    Export the selected rows to the next program
    EXPORT final TO MEMORY ID 'ABC'.
    CALL TRANSACTION 'XXX'.
    XXX is the tcode for the other program where u want to import the values.
    In the second program
    INITIALIZATION.
    IMPORT the internal table from the first program
    IMPORT final FROM MEMORY ID 'ABC'.
    Thanks and Regards,
    Reward If Helpful

  • Doubt in Submit...return

    Hi all,
    i am trying a simple program .See below
    REPORT  Ztest.
    data: begin of itab occurs 0,
          za(3) type c,
          end of itab.
    export itab[] to memory id 'ZPARA'.
    submit ztestcall and return.
    write:/ itab-za.
    In the pgm ztestcall, i have written,
    report ztestcall.
    data: begin of itab occurs 0,
          za(3) type c,
          end of itab.
    itab-za = 'ABC'.
    append itab.
    itab-za = 'XYZ'.
    append itab.
    import itab[] from memory id 'ZPARA'.
    Now, when i execute the first pgm ztest, the contents of itab is not getting populated...
    It will be very helpful if u help me out in this.
    TIA,
    sinthu

    Hi,
    REPORT Ztest.
    data: begin of itab occurs 0,
    za(3) type c,
    end of itab.
    export itab[] to memory id 'ZPARA'. <u><b>==> here u r exporting empty records.</b></u>
    submit ztestcall and return.
    write:/ itab-za. <u><b>==> Use READ TABEL ITAB or LOOP AT ITAB. after that u display the records</b></u>
    In the pgm ztestcall, i have written,
    report ztestcall.
    data: begin of itab occurs 0,
    za(3) type c,
    end of itab.
    itab-za = 'ABC'.
    append itab.
    itab-za = 'XYZ'.
    append itab.
    import itab[] from memory id 'ZPARA'. <u><b>==> Here u import the empty records from itab using Memory ID 'ZPARA'</b></u>
    Thats why u are not getting any value.
    May be u can try this program:
    REPORT Ztest.
    data: begin of itab occurs 0,
    za(3) type c,
    end of itab.
    itab-za = 'ABC'.
    append itab.
    itab-za = 'XYZ'.
    append itab.
    export itab[] to memory id 'ZPARA'.
    submit ztestcall and return.
    In the pgm ztestcall,
    report ztestcall.
    data: begin of itab occurs 0,
    za(3) type c,
    end of itab.
    import itab[] from memory id 'ZPARA'.
    loop at itab.
      write: / itab.
    endloop.
    - Selvapandian Arunachalam

  • Use dropdownlist to select image (database driven)

    Im building a web application in flash builder which will be database driven. The database will contain id (of product), name (of product), photofile (text string i.e photo1.jpg). i have the data/services up and running, i just need to get it so when the user selects a name from the dropdownlist the corresponding photofile is selected into the picture frame.
    I know to turn the photofile text into a picture it will be something like this but not sure what code to insert into the <s:Image tag;
    private function getPhotoURL(item:Object):String{
                                    return "http://............./assets/"+item.photofile;
    I don't know how to bind everything together, any help would be appreciated.

    I have 2 programs:
    First Pgm:
    <?php require_once('Connections/abc.php'); ?>
    <?php
    mysql_select_db($database_abc, $abc);
    $query_Recordset1 = "SELECT * FROM replyarticle";
    $Recordset1 = mysql_query($query_Recordset1, $abb) or
    die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    $totalRows_Recordset1 = mysql_num_rows($Recordset1);
    ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <a href="thumb.php?id=<?php echo
    $row_Recordset1['postid'];?>"><img src= "idea.GIF"
    width="20" height="19" border="0" /></a></p>
    </body>
    </html>
    <?php
    mysql_free_result($Recordset1);
    ?>
    Second pgm: thumb.php
    <?php require_once('Connections/abc.php'); ?>
    <?php
    $colname_Recordset1 = "-1";
    if (isset($_GET['id'])) {
    $colname_Recordset1 = (get_magic_quotes_gpc()) ? $_GET['id']
    : addslashes($_GET['id']);
    mysql_select_db($database_abc, $abc);
    $query_Recordset1 = sprintf("SELECT * FROM replyarticle WHERE
    postid = %s", $colname_Recordset1);
    $Recordset1 = mysql_query($query_Recordset1, $abb) or
    die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    $totalRows_Recordset1 = mysql_num_rows($Recordset1);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=" />
    <title>Untitled Document</title>
    </head>
    <body>
    <?php
    $img= $row_Recordset1['book_no']; ?>
    <?php
    $img_name=$img;
    header("Content-type: image/jpeg");
    list($w,$h)=getimagesize($img_name);
    $src_img=imagecreatefromjpeg($img_name);
    imagejpeg($src_img);
    imagedestroy($src_img);
    mysql_free_result($Recordset1);
    ?>
    </body>
    </html>
    Micha, am I working on what you said?

  • S my code is rite

    am getting dump error for the following code, can anyone tell me if my code is correct
    error is telling like alv_grid s empty
    this is my first pgm in oops concepts so i dont know how to correct this
    tables: mara.
    data: itab like table of mara with header line,
    w_itab like line of itab.
    data:c_container type scrfname value 'test',
    alv_grid type ref to cl_gui_alv_grid,
    c_custom_container type ref to cl_gui_custom_container.
    data:i_fcat type lvc_t_fcat,
           w_fcat like line of i_fcat.
    select matnr from mara into corresponding fields of table itab.
    CREATE OBJECT C_CUSTOM_CONTAINER
      EXPORTING
        PARENT                      = c_custom_container
        CONTAINER_NAME              = c_container
      w_fcat-fieldname = 'MATNR'.
      w_fcat-ref_table = 'MARA'.
      w_fcat-ref_field = 'MATNR'.
      w_fcat-coltext = text-002.
      w_fcat-seltext = 'Material Number'.
      w_fcat-col_pos = 1.
      append w_fcat to i_fcat.
      clear w_fcat.
    CALL METHOD ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY
      CHANGING
        IT_OUTTAB                     = itab[]
        IT_FIELDCATALOG               = i_fcat

    first error
    give test in upper case
    data:c_container type scrfname value 'TEST',   "<-------------
    U have to create one screen , say 100
    call screen 100.
    then create one custom container and give the names as TEST
    Message was edited by:
            Chandrasekhar Jagarlamudi

  • Issue in my first JDBC pgm

    Hi All,
    This is my first JDBC Pgm...
    I got the driver mysql driver and placed the same in the lib of the jdk...
    when i compile teh java file without the Statement and Resultset it compiles fine.. but when i compile tis file,
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import javax.sql;
    public class LoadDriver {
    public static void main(String[] args) {
    try {
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/employee?user=root&password=admin");
    Statement stmt = conn.createStatement();
    String query = "SELECT NAME FROM employee";
    ResultSet rs = stmt.executeQuery(query);
    while (rs.next()) {
              String s = rs.getString("COF_NAME");
              float n = rs.getFloat("PRICE");
              System.out.println(s + " " + n);
    catch (Exception ex) {
    // handle the error
    I am gettting compile error.. sttien that unknown symbol statemetn and resultset..
    Do I miss any import statemet ??
    Thanks,
    Udhan
    I got struck here can any one help me..

    No, adding the mysql driver jar to the JDK lib folder does not help. In fact, it is not a good practice to add third-party JARs to the JDK installation.
    Place the JAR in some convenient location like C:\myjars. Let's assume it is renamed to mysql.jar
    While executing, you need to set this JAR in the runtime classpath so that your program is able to use the driver classes.
    java -cp "C:\myjars\mysql.jar;." LoadDriverThis is not an issue at compile time because you do not make use of {or import} driver specific classes anywhere in the code, but at runtime, this class needs to be available in the classpath for loading.

  • ABAP for the first day of the month

    Hello BW users,
    I have a scenario which uses an ODS with cumulative key figures with Addition update type. An infocube gets data from ODS by start routine in cube's update rule. I update this ODS first then infocube. All the loads are Full and are loaded daily. This is a snapshot scenario and I load the ods on itself then load from another infocube let's say Cube1. After successful load, I update infocube on itself again then update from the same infocube, Cube1, as in ODS. Infocube load sequence is same as ODS. In the scenario ODS and infocube are wanted to be updated daily. Therefore, I have to delete the ODS's (since it is addition update type) and infocube's overlapping data in the process chain that automates the load. At this point I need two things:
    1- ABAP program that is going to give me the first day of each month.
    2- ABAP program that is going to delete the overlapping data in ODS when I load it daily. Since I can do that for infocube in process chain with standard process type of Delete overlapping requests from infocube I need it only for ODS. Because there is no standard process type to delete overlapping requests in ODS (since its update type is Addition).
    I appreciate your help. Thank you in advance.
    Sincerely,

    1- ABAP program that is going to give me the first day of each month.
    if sy-datun+6(2) = 01.
    SY-FDAYW should give you the day
    endif.
    2- ABAP program that is going to delete the overlapping data in ODS
    REPORT  <PGM NAME>.
    TABLES: RSODSACTREQ , rsseldone.
    Parameters : odsname type RSINFOCUBE default '<>ODS NAME'.
    DATA: temp_REQUEST LIKE RSODSACTREQ-REQUEST,
          temp_REQUEST1 LIKE RSODSACTREQ-REQUEST,
          temp_RNR LIKE rsseldone-RNR.
    DATA: BEGIN OF itab OCCURS 0,
          REQUEST LIKE RSODSACTREQ-REQUEST,
          TIMESTAMP LIKE RSODSACTREQ-TIMESTAMP,
          END OF itab.
    DATA: BEGIN OF itab1 OCCURS 0,
          RNR LIKE rsseldone-RNR,
          seldate LIKE rsseldone-seldate,
          seltime LIKE rsseldone-seltime,
          END OF itab1.
    SELECT REQUEST TIMESTAMP FROM RSODSACTREQ INTO TABLE itab
      WHERE ODSOBJECT = '<ODS NAME>'.
    SORT itab DESCENDING BY TIMESTAMP .
    READ TABLE itab INDEX 1.
    temp_REQUEST = itab-REQUEST.
    SELECT RNR seldate seltime FROM rsseldone INTO TABLE itab1
      WHERE source = '<Info Source Name for the ODS>'.
      SORT itab1 DESCENDING BY seldate seltime .
      READ TABLE itab1 INDEX 1.
      temp_RNR = itab1-RNR.
    *If   temp_REQUEST = temp_RNR .
    CALL FUNCTION 'RSSM_PROCESS_REQUDEL_ODSO'
      EXPORTING
        I_ODS             = odsname
        I_REQUEST         = temp_REQUEST
        I_JOBNAME         = 'i_jobname'
        I_VARIANT         =
        I_INSTANCE        =
      IMPORTING
        E_ERROR           =
        E_T_MSG           = itab1
      E_T_RNRLIST       =    ITAB1.
    *else.
    *raise exception.
    *endif.
    clear itab.
    refresh itab.
    SELECT REQUEST TIMESTAMP FROM RSODSACTREQ INTO TABLE itab
      WHERE ODSOBJECT = '<ODS NAME>'.
    SORT itab DESCENDING BY TIMESTAMP.
    READ TABLE itab INDEX 1.
    temp_REQUEST1 = itab-REQUEST.
    if temp_REQUEST = temp_REQUEST1.
    raise exception .
    endif.

  • Error while creating first database instance

    Hi,
    after installing MaxDB i got the following message:  "ERROR in 'C:\Program Files\sdb\programs\pgm\dbmcli -R "C:\Program Files\sdb\MAXDB1"  -R "C:\Program Files\sdb\MAXDB1" db_create  -a MAXDB1 DBM,*** .ing!1'
    ERR
    -24996,ERR_PARAM: wrong parameters
    1,Invalid first database manager operator"
    Does anyone know what's wrong?
    Regards
    Paul

    Hi Paul,
    the password for the DB looks strange.
    Please try to start with a simpler password (like 'DBM').
    Does the db_create work then?
    KR Lars

  • Submit "and skip first screen"

    hello!
    is there an option for submit-command like "and skip first screen" for call transaction?
    i would like to start a programm without displaying the selection screen (parameters are provided by submit with ...).
    the parameters of the new programm aren't set/get parameters (sap-standard-pgm) therefore call transaction won't work.
    thanks
    matthias

    Hi,
    In ur question itself u have given a solution
    1. Combination of variant and WITH
    DATA: RANGE_LANGU    TYPE RANGE OF SY-LANGU,
          RANGE_LANGU_WA LIKE lINE OF RANGE_LANGU.
    PARAMETERS: MSG_FR LIKE T100-MSGNR,
                MSG_TO LIKE T100-MSGNR.
    MOVE: 'I'  TO RANGE_LANGU_WA-SIGN,
          'BT' TO RANGE_LANGU_WA-OPTION,
          'D'  TO RANGE_LANGU_WA-LOW,
          'I'  TO RANGE_LANGU_WA-HIGH.
    APPEND RANGE_LANGU_WA TO RANGE_LANGU.
    MOVE: 'EQ'  TO RANGE_LANGU_WA-OPTION,
          'E'   TO RANGE_LANGU_WA-LOW.
    APPEND RANGE_LANGU_WA TO RANGE_LANGU.
    <b>SUBMIT REPORT00
           USING SELECTION-SET 'VARIANT1'
           WITH  MSG   BETWEEN MSG_FR AND MSG_TO
           WITH  LANGU IN RANGE_LANGU.</b>
    In REPORT00, all parameters and SELECT-OPTIONS take their values from the variant VARIANT1.Only MSG and LANGU take the values that are explicitly passed.
    Examples
    2. Combination of variant, WITH SELECTION-TABLE, and explicit WITH clauses.
    DATA: SELTAB     TYPE TABLE OF RSPARAMS,
          SELTAB_WA  LIKE LINE OF SELTAB.
    MOVE: 'LANGU'  TO SELTAB_WA-SELNAME,
          'S'      TO SELTAB_WA-KIND,      " SELECT-OPTION
          'I'      TO SELTAB_WA-SIGN,
          'BT'     TO SELTAB_WA-OPTION,
          'D'      TO SELTAB_WA-LOW,
          'I'      TO SELTAB_WA-HIGH.
    APPEND SELTAB_WA TO SELTAB.
    MOVE: 'E'      TO SELTAB_WA-SIGN,
          'EQ'     TO SELTAB_WA-OPTION,
          'F'      TO SELTAB_WA-LOW,
          SPACE    TO SELTAB_WA-HIGH.
    APPEND SELTAB_WA TO SELTAB.
    CLEAR SELTAB_WA.
    MOVE: 'ARBGB' TO SELTAB_WA-SELNAME,
          'P'     TO SELTAB_WA-KIND,      " PARAMETER
          'XX'    TO SELTAB_WA-LOW.
    APPEND SELTAB_WA TO SELTAB.
    <b>SUBMIT REPORT00
           USING SELECTION-SET 'VARIANT1'
           WITH  ARBGB CP 'A*'
           WITH  SELECTION-TABLE SELTAB
           AND RETURN.</b>
    In REPORT00, all parameters and SELECT-OPTIONS take their contents from the variant VARIANT1except LANGU, which takes its contents from SELTAB, and ARBGB, which takes the value that was explicitly passed.
    I got this from ABAP help.
    Hope this helps.
    Thanks & Regards,
    Judith.

  • Simple java pgm - question

    Hallo,
    to the following pgm I had question:
    static void printPrimes (int max) (= wavy bracket;
    boolean(should be angular brackets) sieve = new booolean (angular br max+1
    angular br)
    int i,j;
    for (i=2; i = max;i++)sieve(angluarbr i angular br)= true
    i= 2
    while (i= <= max;) (=wavy bracket Out.println (i+ " "); // is prime
    for (j=i; j <= j+i) sieve(angular br j angularb.) = false;
    while (i <= maxAmpersandAmpersand !sieve (angular br angular br)I++;
    ) wavy br ) wavy br.
    I hope this is still kind of readable.
    Q's are:
    after the first "for" there is a new i=2, which seems to staty at 2 all the time; the following while does not change this value ( the beginning for i++ does not change this) and so seems to print 2 at all times (??)
    then the inner loop seems to count up all the doubbles of the new prime number and thrwoes it out as false at the end of it;
    the i values (increased with i++ seemsto refere at all times to the unit numbers and only indirect to the un it values, which are written/ assigned to it (??)
    I seem to wonder how the pgm can print out anythings else the 2's.
    I would appreciate any help to that.
    ml
    griz

    I hope this is still kind of readable.No, it's not. http://forum.java.sun.com/help.jspa?sec=formatting
    Why are you omitting the braces and brackets? And why don't you type "program"? Aren't we worth the additional time it takes?
    Q's are:
    after the first "for" there is a new i=2, which
    seems to staty at 2 all the time; the following
    while does not change this value Why should it? You don't tell it to.
    ( the beginning for
    i++ does not change this)It does. It just gets re-set to 2 after the for loop-
    and so seems to print 2 at
    all times (??)Yeah. What else?
    then the inner loop seems to count up all the
    doubbles of the new prime number and thrwoes it out
    as false at the end of it; That part is definitely unreadable.

  • New iMac with 10.6.2 - but when tried to install Flash MX 2004  pgm crashes

    HI,
    First, perhaps there's a list somewhere of pgms that won't run under snow leopard?
    We just got a new iMac 21.5" with 10.6.2
    Trying to migrate pgms we had on our old G4 - like Flash MX 2004. After a clean install - it keeps crashing. Console log shows:
    1/8/10 7:56:40 PM [0x0-0x28028].com.macromedia.flash.7[318] Authentication Service: Started
    1/8/10 7:56:41 PM ReportCrash[325] Saved crash report for Flash[324] version ??? (???) to /Users/mahlenius/Library/Logs/DiagnosticReports/Flash_2010-01-08-195640Jude.crash
    1/8/10 7:56:41 PM ReportCrash[325] Saved crash report for Flash[326] version ??? (???) to /Users/mahlenius/Library/Logs/DiagnosticReports/Flash_2010-01-08-195641Jude.crash
    1/8/10 7:56:41 PM [0x0-0x28028].com.macromedia.flash.7[318] translate: MACHRCV_PORTCHANGED - invalid pointer, rcv buffer not swapped
    It would seem that I probably will have to spend a lot more $ just to get pgms to run on this new system.
    Any clues on getting this to run?
    thanks
    'mark

    Flash MX 2004 is quite ancient. Latest shows it's viable for OS X 10.3. For compatibility info, start with http://www.macintouch.com/specialreports/snowleopard/slcompat.html

  • Error when launch MaxDB studio for first time

    Dear, Experts
    I faced with one issue for launch MaxDB studio for first time.
    It reported:
    Connect user failed
    SAP DBTech JDBC: Cannot connect to jdbc:sapdb://.../.UMDB [Restart required].
    Creating default user management failed
    Could not create database ".UMDB": [C:\sapdb\clients\DatabaseStudio\pgm\dbmcli.exe] > ERR, -24832, ERR_SHMNOTAVAILABLE ...
    Could you please help me on this?
    Thank you in advance.
    Best Regards

    If not solved yet...
    What says appsrv.log ? Which user are you using to start the appserver ? Which user have you specified when sreating the database ?
    Nicolas.

  • ABAP pgm using append, sum, modify

    I am new to ABAP programming. Can somebody please help me out with the following program or give me some hints as to how to proceed?
    1. ABAP inputs: The pgm will have following parameters:
       P_ITEM - input string of 20 characters (select options)
       P_QTY - input number (select options)
       P_RATE - input number with 2 decimal points (select options) 
    2. Main processing logic:
       1. Accept 5 items each with qty and rate.
       2. store in internal table.
       3. calculate their price.
       4. sort on price in ascending order.
       5. display o/p as per section 3.
    3. Output format:
       ITEM     QTY     RATE     PRICE
       TOTAL
    Hints: For this ABAP make use of APPEND, SUM, MODIFY
    Thank you.

    This can be coded, but it does make much sense.  There is no "tie" between the selection-screen fields.  If you are assuming that the first value in P_ITEM corresponds to the first value in P_QTY and P_RATE, then you can do it, but this is not really a good way of coding.  Here is a sample anyway. 
    Add values to all three select-options and hit execute.
    report zrich_0004
           no standard page heading.
    data: begin of itab occurs 0,
          item(20) type c,
          qty type i,
          rate type p decimals 2,
          price type p decimals 2,
          end of itab.
    select-options: s_item for itab-item,
                    s_qty  for itab-qty,
                    s_rate for itab-rate.
    start-of-selection.
      clear itab. refresh itab.
      loop at s_item.
        clear itab.
        itab-item = s_item-low.
        read table s_qty index sy-tabix.
        if sy-subrc = 0.
          itab-qty = s_qty-low.
        endif.
        read table s_rate index sy-tabix.
        if sy-subrc = 0.
          itab-rate = s_rate-low.
        endif.
        itab-price = itab-qty * itab-rate.
        append itab.
      endloop.
      sort itab ascending by price.
      loop at itab.
        write:/ itab-item, itab-qty, itab-rate, itab-price.
      endloop.
    Welcome to SDN!  Please remember to award points for helpful answers and mark your posts as solved when solved completely.
    Regards,
    Rich Heilman

  • SOLVED Cannot view .pgm and .ppm images

    Hi,
    I tried to view some .pgm and .ppm images produced by my APT weather satellite image receiver but gqview could not open them. Tried mirage but have same problem. Only gimp opens these type of images.
    Last time I tried to view .pgm images was probably more than 3 weeks ago so the problem may have developed after some recent -Syu. Any ideas please?
    Looks like the pgm and ppm (at least) file formats spec has changed. I compared with a pgm file saved by gimp and there is a hash-prefixed comment line below the P5. I inserted one in the files produced by my app and now gqview (and others) open them OK. Example:
    P5
    #comment (anything)
    800 600
    255
    data.........
    works ok but:
    P5
    800 600
    255
    data.........
    can only be opened by gimp.
    But still there is another strange problem,  when I "open as text" an uncommented .pgm file in gvim, it seems to go into a long loop trying to open the file and has to be stopped with a user interrupt. With a commented file it has no problem!!??
    Last edited by neok (2008-11-01 17:51:30)

    Can you attach a screenshot?
    *http://en.wikipedia.org/wiki/Screenshot
    *https://support.mozilla.org/kb/how-do-i-create-screenshot-my-problem
    *Use a compressed image type like PNG or JPG to save the screenshot
    *Make sure that you do not exceed the maximum size of 1 MB
    If images are missing then check that you do not block images from some domains.
    *Tap the Alt key or press F10 to show the Menu Bar
    Check the permissions for the domain in the currently selected tab in "Tools > Page Info > Permissions"
    Check "Tools > Page Info > Media" for blocked images
    *Select the first image link and use the cursor Down key to scroll through the list.
    *If an image in the list is grayed and "<i>Block Images from...</i>" has a checkmark then remove this checkmark to unblock images from this domain.
    Make sure that you do not block (third-party) images, the <b>permissions.default.image</b> pref on the <b>about:config</b> page should be 1.
    Make sure that you haven't enabled a High Contrast theme in the Windows/Mac Accessibility settings.
    Make sure that you allow pages to choose their own colors.
    *Tools > Options > Content : Fonts & Colors > Colors : [X] "Allow pages to choose their own colors, instead of my selections above"
    Note that these settings affect background images.
    See also:
    *http://kb.mozillazine.org/Website_colors_are_wrong
    There are extensions like Adblock Plus (Firefox/Tools > Add-ons > Extensions) and security software (firewall, anti-virus) that can block images and other content.
    See also:
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    *http://kb.mozillazine.org/Images_or_animations_do_not_load
    *http://kb.mozillazine.org/Websites_look_wrong

  • Cannot open image pgm file from the labview support's code

    I use the face data base from http://cbcl.mit.edu/software-datasets/FaceData2.html
    and I want to open the .pgm face image with the instructions by http://digital.ni.com/public.nsf/allkb/897F7AA54F2419CE86257377004EA947
    but now it comes to the error and I don't know why.
    I follow the instructions to get the header for 13bytes first using read the binary.vi
    Then, I read the rest of the data using read the binary.vi
    Then, I reshape the binary data to 2D-array.
    Finally, I convert the array to image and using IMAQ to show.
    I have bring the
    1.error_message
    2.source code
    in the attached files. 
    And the face pmg I have open it with gimp and work correctly.
    The face pmg image file I testing is https://drive.google.com/file/d/0ByMlz1Uisc9ORUIxZzloQkk5UG8/view?usp=sharing
    Attachments:
    PGM_Error.png ‏540 KB
    read_PGM.vi ‏43 KB

    Looks like the biggest issue is that the datatype of the "type" integer going to the seond read from binary was not U8 and so the byte spec didn't match up. 
    Attachments:
    read_PGM-2.vi ‏17 KB

Maybe you are looking for

  • Absence Quota creation during Time evaluation - Orgnaisational Assg change

    Hello Experts, I have one emplyee for whom the Transfer action has been run - his personal subarea has been changed from 1633 to 1654 obviously the ps grouping for time quota type changed form 35 to 40. so function QUOTA is creating different quota f

  • Syncing issues with Outlook - conflict resolution

    I am having problems with syncing my bb to Outlook 2007.  I found part of my answer in old messages on the forum and changed the length of time for appointments on the bb to forever.  But as someone noted the bb will eventually fillup.  It wiped out

  • TS3274 buttom not function in I-pad

    I already reinstall the I-Pad but the still having problem at the both  of buttom for manually adjusted volume of i-pad and the buttom to shut down /swift off buttom for my I-pad. both of them are not function why is it broken or setting problem can

  • Premiere export option are grayed, only two options aren't gray, and neither are what i need please help!

    i am new to premiere pro, i recently edited a whole short film, effects, music, everything, but it will not give me an option to export. the only export options are: AAF and FINAL CUT PRO XML, can anyone please help me figure out how to fix this? i r

  • FlexBuilder web service consumer

    I'm using well-tested web services that I imported into FlexBuilder. Everything goes smoothly, but occasionally I face a problem of not receiving anything back from the WS. This seems to be some kind of a configuration issue, because exactly the same