If...elseif statement...

Hi,
I am selecting the data to an itab gi_output.I have 3 checkboxes in my selection screen(p_wgt and p_wgt and p_dimen).so according to the checkboxes selected the data should be deleted from gi_output.
if p_wgt = 'X'.
  delete gi_output where tarag NE '0.000' and magew NE '0.000'
                      and ntgew NE '0.000' and brgew NE '0.000'.
elseif p_ippc = 'X'.
  delete gi_output where vegr1 NE ' '.
elseif p_dimen = 'X'.
   delete gi_output where laeng NE '0.000'
                       and breit NE '0.000'
                       and hoehe NE '0.000'.
elseif p_wgt = 'X' and P_ippc = 'X'.
  delete gi_output where tarag NE '0.000' and magew NE '0.000'
                     and ntgew NE '0.000' and brgew NE '0.000'
                     or vegr1 NE ' '.
when 1 checkbox is selected..my coding is working fine..but when 2 checkboxes are selected (suppose p_wgt and P_ippc),the control is checking 1st if statement(P_wgt = 'X')than after that it is coming out of if statement block....any idea..

Hello,
You need to write all possible combination for check boxes.
if p_wgt = 'X' AND p_ippc = 'X' AND p_dimen = 'X'.
<your deletion code>
endif.
if p_wgt = 'X' AND p_ippc = 'X' .
<your deletion code>
endif.
if p_ippc = 'X' AND p_dimen = 'X'.
<your deletion code>
endif.
if p_wgt = 'X' AND  p_dimen = 'X'.
<your deletion code>
endif.
if p_wgt = 'X' .
<your deletion code>
endif.
if p_ippc = 'X' .
<your deletion code>
endif.
if p_dimen = 'X'.
<your deletion code>
endif.
Regards
Arindam

Similar Messages

  • Java code help needed for If-elseif statement

    HI All,
    Apologies for posting such a trivial thing but I am a novice in Java.
    All I need is to code an If elseIF statement.
    I tried the code below
    String w = "SAPA";
    String x = "SAPB";
    if (a==w) ;
    {Channel channel = LookupService.getChannel("BS_PROD","CC_RFC_LOOKUP");}
    else if (a==x)
    { Channel channel = LookupService.getChannel("BS_PROD","CC_RFC_LOOKUP_ECQ"); }
    It came back with the error
    Source code has syntax error:  D:/usr/sap/XRD/DVEBMGS02/j2ee/cluster/server0/./temp/classpath_resolver/Map695b77619ad011dd8d0b001a4b52813a/source/com/sap/xi/tf/_MM_TRANSMISSION_CHECK_TO_GENIUS_.java:324: 'else' without 'if' else if (a==x) ^ 1 error
    Appreciate if you could let me know the correct code.
    Many thanks
    Shirin

    HI Aamir,
    After I removed the semi-colon iIt came back with the following error
    Source code has syntax error:  D:/usr/sap/XRD/DVEBMGS02/j2ee/cluster/server0/./temp/classpath_resolver/Map1d9b43e09ad111dd84b7001a4b52813a/source/com/sap/xi/tf/_MM_TRANSMISSION_CHECK_TO_GENIUS_.java:328: cannot resolve symbol symbol : variable channel location: class com.sap.xi.tf._MM_TRANSMISSION_CHECK_TO_GENIUS_ accessor = LookupService.getRfcAccessor(channel); ^ 1 error
    Just for reference my entire Jave UDF looks like this:
    //write your code here
    String w = "SAPA";
    String x = "SAPB";
      String content = "";
    MappingTrace importanttrace;
    importanttrace = container.getTrace() ;
    //Filling the string with our RFC-XML (With Values)
    String m = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><ns0:ZIFMS_GET_NEXT_NUMBER xmlns:ns0=\"urn:sap-com:document:sap:rfc:functions\"><I_NR_RANGE_NR>01</I_NR_RANGE_NR><I_OBJECT>ZIFMS_INT</I_OBJECT></ns0:ZIFMS_GET_NEXT_NUMBER>";
    RfcAccessor accessor = null;
    ByteArrayOutputStream out = null;
    try
    //1. Determine a channel (Business System, Communication channel)
    if (a==w)
    {Channel channel = LookupService.getChannel("BS_PROD","CC_RFC_LOOKUP");}
    else if (a==x)
    { Channel channel = LookupService.getChannel("BS_PROD","CC_RFC_LOOKUP_ECQ"); }
    //2. Get a RFC accesor for a channel.
    accessor = LookupService.getRfcAccessor(channel);
    //3. Create a xml input stream representing the FM request message.
    InputStream inputstream = new ByteArrayInputStream(m.getBytes());
    //4. Create xml Payload
    XmlPayload payload = LookupService.getXmlPayload(inputstream);
    //5. Execute Lookup
    Payload result = accessor.call(payload);
    InputStream in = result.getContent();
    //This are the extra step which i dont know what it mean
    //out = new ByteArrayOutputStream(1024);
    //byte[] buffer = new byte1024;
    //for (int read = in.read(buffer); read > 0; read = in.read(buffer))
    //out.write(buffer,0,read);
    //content = out.toString();
    try {
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document document = builder.parse(in);
    NodeList list = document.getElementsByTagName( "E_NUMBER" );
    Node node = list.item(0);
    if (node != null)
    node = node.getFirstChild();
    if (node != null)
    content = node.getNodeValue();
    } catch (Exception e) {
    importanttrace.addWarning("Error while closing accesor" + e.getMessage());
    catch (LookupException e)
    importanttrace.addWarning("Error While lookup" + e.getMessage());
    //This exception is not to be catch at this step as there is no try step before this
    //catch (IOException e)
    //importanttrace.addWarning("Error" + e.getMessage());
    finally
    if(out!=null)
    try{
    out.close();
    } catch (IOException e) {
    importanttrace.addWarning("Error while closing system" + e.getMessage());
    //7. close the accessor in order to free resources
    if (accessor!=null) {
    try{
    accessor.close();
    } catch (Exception e) {
    importanttrace.addWarning("Error while closing accesor" + e.getMessage());
    return content;

  • ELSEIF in calculated key figure

    Dear gurus
    We have recently upgraded to NW2004s, and would need some help on the formula for my calculated key figure. This calculated key figure is meant to replicate IF... ELSEIF statement, depending on what the user enters. The logic that we have are as below :
    IF Var=1, then display key figure A
    ELSEIF Var=2, then display key figure B
    ELSEIF Var=3, then display key figure C
    ELSEIF Var=4, then display key figure D
    where Var is a Formula Variable, Processing By User Entry/Default value.
    The formula that we have originally, in BW3.5 is :
    <i>(Var == 1) * 'Amount in TC' + (Var== 2) * 'Amount in Comp Code' + (Var == 3) * 'Amount in Parall USD' + (Var == 4) * 'Amount in Hard Cur' </i>
    This formula has served us well in BW 3.1 to BW 3.5, and never had any problems with it. However, when we migrated over to BW 7.0, we could not get values for this formula (eventhough we have data in our cubes). The only data that get is when we key in Var=1, but when we try with Var=2, 3 or 4, no data is displayed in our key figure.
    We tried to debug, but somehow we could not figure out how the new BW7.0 calculates these type of key figures, and whether is there a change in the formula variable. We believe that the problem may lie in the way that BW 7.0 interprets the formula above, and only obtains the first portion of the formula (Var==1).
    We would appreciate any helps, and of course, points will be awarded if problem can be solved.
    Thanks a lot

    Dear all
    With some luck in searching, I manage to find an OSS note which depicts this error and resolve it. For those who have the same problem, please use this OSS Note 994194.
    Cheers

  • Best way to ensure combinations from the ValidationSet parameter attribute are processed correctly in PowerShell without using multiple IF statements?

    I have an advanced function I have been working on that looks something like this:
    Function Do-Something
    [cmdletbinding()]
    Param
    [Parameter(Mandatory=$true,
    [ValidateSet('Yes', 'No', 'Y', 'N', IgnoreCase = $true)]
    [string[]]$Param1,
    [Parameter(Mandatory=$true,
    [ValidateSet('Yes', 'No', 'Y', 'N', IgnoreCase = $true)]
    [string[]]$Param2,
    [Parameter(Mandatory=$true,
    [ValidateSet('Yes', 'No', 'Y', 'N', IgnoreCase = $true)]
    [string[]]$Param3
    Begin {}
    Process
    My question is, how do I get the values such as "Yes", "Y", "No", and "N" that's located in the [ValidateSet()] validation attribute processed correctly without having to use multiple "If" and "ElseIf"
    statements. 
    For instance, I want to avoid the following, because I know there is a faster and more efficient way (less typing) to do it:
    If ($param1 -match "Yes" -or "Y" -and $param2 -match "Yes" -or "Y" -and $param3 -match "Yes" -or "Y")
    #Do something here
    ElseIf  ($param1 -match "No" -or "N" -and $param2 -match "Yes" -or "Y" -and $param3 -match "Yes" -or "Y")
    #Do something
    I was reading that splatting may help me here, but I am new to the splatting technique and need some help with this one.
    I appreciate any help that anyone can offer. 
    Thanks

    Is this what you are trying to ask how to do?  Your posted script is written incorrectly and will not work at all. 
    Function Do-Something{
    [cmdletbinding()]
    Param (
    [Parameter(Mandatory=$true)]
    [ValidateSet('Yes','No','Y','N')]
    [string]$p1,
    [Parameter(Mandatory=$true)]
    [ValidateSet('Yes','No','Y','N')]
    [string]$p2
    Begin{
    Process{
    # parse the strings to booleans
    $p1a=if($p1 -match 'Yes|Y'){$true}else{$false}
    $p2a=if($p2 -match 'Yes|Y'){$true}else{$false}
    if($p1a){Write-Host 'P1 is good' -ForegroundColor green}
    if($p2a){Write-Host 'P2 is good' -ForegroundColor green}
    if($p1a -and $p2a){
    Write-Host 'All conditions met' -ForegroundColor green
    }else{
    Write-Host 'Conditions not met' -ForegroundColor red
    PS C:\scripts> Do-Something Y n
    P1 is good
    Conditions not met
    PS C:\scripts> Do-Something n n
    Conditions not met
    PS C:\scripts> Do-Something y y
    P1 is good
    P2 is good
    All conditions met
    This handles case and creates a tracking Boolean fo reach parameter so you can just build simple logic.
    ¯\_(ツ)_/¯

  • Php if/elseif and mysql

    I was wondering if you could help we with this.
    PART 1
    i have a table of students info. I give the students praise
    points for doing well in the lesson.
    I want to compare two students's praise points, if one is
    bigger (Higher) than the other i want to be taken to a win page, if
    it is a draw to a draw page and a loss to a loss page.
    i have a record set on the page that i am using to display
    student1's info in a table on the left and student2s info on the
    right (Student2s praise points are not visible and i dopnt want
    them to be)
    I want to click on a button/link that compares the praise
    points.
    PART 2
    If the result is a win, i want the feild win in the database
    for that student to be increaded by 3 points, if it is a draw then
    by 1 and if it is a loss nothing to happen.
    So i think i need an if/elseif statement and an INSERT
    STATEMENT? im not sure.
    can anyone help?
    Text
    PART 1

    LoadModule libphp4 /usr/lib/apache/libphp4.so
    AddModule mod_php4.c
    AddType application/x-httpd-php .php
    The weird thing is that this aint working for me, although it's correct
    When I open a .php file with apache, he doesn't recognize its extension and my browser asks me to open or save it...
    However when I deleted the .php in the url  (localhost/info instead of localhost/info.php) he DID load the phpinfo page.
    Now after al lot of testing that doesn't even work anymore (although I'm pretty sure that my config files are exactly the same as when that did work)
    (and I'm using rc.d/httpd)
    There are NO errors at all in my apache logs.

  • IF elseif endif

    i m writing a report using if elseif condition...i m getting following error
    if v_x = 'X'.
    elseif v_y = 'X'.
    elseif v_z = 'X'.
    select ...into itab...
    loop at itab.
    select single....
    append itab2.
    endloop.
    elseif v-c = 'X'.
    else.
    endif.
    Above code is showing error as " NO Open IF Statement"
    at the elseif statement.pls hlp

    if p_upload eq 'X'.
        call function 'UPLOAD'
        if sy-subrc ne 0.
          message e000 with 'unable to read file'.
        else.
          if v_line gt 0.
            loop at i_itab.
              select single vbeln lifsk vdatu..
              if sy-subrc eq 0.
              endif.
            endloop.
          else.
          endif.
        endif.
      elseif p_del_gi eq 'X'.
          LOOP AT i_vbelv into wa_vbelv.
          select single kunnr auart lifsk vdatu..
           if sy-subrc = 0.
          endif.
        endloop.
      elseif p_req_dl eq 'X'.
        select vbeln lifsk vdatu into (vbak-vbeln, vbak-lifsk, vbak-vdatu)
        endselect.
      else.
        select vbeln lifsk vdatu into (vbak-vbeln, vbak-lifsk, vbak-vdatu)
        endselect.
      endif.
    Edited by: Matt on May 11, 2009 9:48 AM
    Edited by: Matt on May 11, 2009 9:48 AM - add  tags and removed unnecessary lines taking the post over the character limit.

  • Procedure Confirmed with Comparing Dates

    Trying to compare two dates, and there's so many ways I'm
    just getting a bit
    confused.
    I have a date stored in my database in a timestamp field with
    this format:
    2006-03-05 19:13:05
    I have a term defined in months (in the database) of how long
    the account is
    valid:
    term: 12
    I can now almost get the expired date, with this code, where
    $vDate is the
    untouched date from my database, and $term is the term in
    months.
    $blog2 = date("M jS Y",strtotime($vDate,'+'.$term.'
    Month'));
    But it only increments the months, not the years.
    Now, here's my problem:
    I can create an array with expired and current dates, but
    then I have to
    construct a moderately complex if/elseif statement to check
    year, then
    month, then day.
    Is there a better way? IE, can anybody think of a method in
    which I can
    compare the dates more efficiently? I'm going in circles.
    Everytime I
    think I've almost got it, I lose something.
    Any suggestions?
    TIA,
    Jon

    David, thank you for replying.
    I was just looking at doing it with SQL, but here is my
    question/problem:
    I am doing this for a client database of hosting customers -
    a one-stop list
    so we can see who's due. I'm worried about having two sql
    queries per
    customer. Currently it wouldn't be a big deal, but hopefully
    in the future
    it would be.
    Can you confirm this would be an issue? If it is an issue,
    can you take a
    peek at my code below? Can you confirm I'm either bass
    ackwards or on the
    right track to do this in PHP? As I stated, if there's an
    easy SQL solution
    that won't cause extra load on the server, cool.
    I'm doing it as such now (my previous method was not
    working):
    $dates1 = create_Dates($renewDate);
    //Create_dates function listed below
    $status = account_expire($dates1);
    echo $status;
    //account_expire function below:
    //Create Dates function:
    function create_Dates($date){
    $date = strtotime($date);
    $dates['eM'] = date("m",$date);
    $dates['eD'] = date("j",$date);
    $dates['eY'] = date("Y",$date);
    $dates['cM'] = date("m");
    $dates['cD'] = date("j");
    $dates['cY'] = date("Y");
    return $dates;
    //and this long bore is my if/else to check dates:
    function account_expire($dateAray){
    //exploding an array would be best
    $eM = $dates['eM'];
    $eD = $dates['eD'];
    $eY = $dates['eY'];
    $cM = $dates['cM'];
    $cD = $dates['cD'];
    $cY = $dates['cY'];
    //this is where we begin calculating
    if($eY > $cY){ //07 > 06
    $status = 'Paid';
    return $status;
    elseif($eY < $cY){
    $status = 'EXPIRED';
    return $status;
    elseif($eY == $cY){
    if($eM > $cM){
    $status = 'Paid';
    return $status;
    elseif($eM < $cM){
    $status = 'EXPIRED';
    return $status;
    elseif($eM == $cM){
    if($eD > $cD){
    $status = 'EXPIRED';
    return $status;
    elseif($eD <= $cD){
    $status = 'Paid';
    return $status;
    >
    > Use the MySQL DATE_ADD() function:
    >
    >
    http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html
    >
    > SELECT registered, DATE_ADD(registered, INTERVAL 12
    MONTH) AS expiry
    > FROM myTable
    >
    > If your expiry dates are always 12 months ahead, that
    can be hard coded
    > into your SQL. If the terms are variable, do a SELECT
    query first to get
    > the term, then do a second query using the first result.

  • Array questions

    Hi, everyone.
    I'm writing a lab program which counts the number of occurances of English letters in a line of English text.
    The program has the following requirements
    Assume that we input only lowercase English text
    The program should be able to count the number of occurances of English letters in a text and print out both the number of occurances and the letters. Don't print out letters that don't exist in the text.
    I write my code as following:
    import java.util.*;
    public class Translator
    public static void main(String[]args)
         Scanner sc = new Scanner(System.in);
         System.out.println("Please enter text:");
         String text = sc.nextLine();
         char[] input = text.toCharArray();
        public static void countLetters(char [] input)
            System.out.println("Letter           Number of occurances");
            int[] alphabet = new int[26];
            for (int i=0; i<input.length; i++)
                if (input=='a')
    alphabet[0] += 1;
    else if(input[i]=='b')
    alphabet[1] += 1;
    else if (input[i]=='c')
    alphabet[2] += 1;
    else if (input[i]=='d')
    alphabet[3] += 1;
    else if (input[i]=='e')
    alphabet[4] += 1;
    else if (input[i]=='f')
    alphabet[5] += 1;
    else if (input[i]=='g')
    alphabet[6] += 1;
    else if (input[i]=='h')
    alphabet[7] += 1;
    else if (input[i]=='i')
    alphabet[8] += 1;
    else if (input[i]=='j')
    alphabet[9] += 1;
    else if (input[i]=='k')
    alphabet[10] += 1;
    else if (input[i]=='l')
    alphabet[11] += 1;
    else if (input[i]=='m')
    alphabet[12] += 1;
    else if (input[i]=='n')
    alphabet[13] += 1;
    else if (input[i]=='o')
    alphabet[14] += 1;
    else if (input[i]=='p')
    alphabet[15] += 1;
    else if (input[i]=='q')
    alphabet[16] += 1;
    else if (input[i]=='r')
    alphabet[17] += 1;
    else if (input[i]=='s')
    alphabet[18] += 1;
    else if (input[i]=='t')
    alphabet[19] += 1;
    else if (input[i]=='u')
    alphabet[20] += 1;
    else if (input[i]=='v')
    alphabet[21] += 1;
    else if (input[i]=='w')
    alphabet[22] += 1;
    else if (input[i]=='x')
    alphabet[23] += 1;
    else if (input[i]=='y')
    alphabet[24] += 1;
    else alphabet[25] +=1;
    System.out.println("a");
    for(int i=0; i<input.length; i++)
    if (alphabet[i] > 0)
    System.out.println(input[i] +" "+alphabet[i]);
    Though having gotten no syntext error complain from the compiler, no matter what I input, the program returns nothing. At first I assumed that it's the first for loop's problem, so that I typed in some System.out.println() methods at the end of some elseif statements. But I still got nothing after this trial. So that I guess it's the char[] input = text.toCharArray();'s problem.
    Have the input[i] elements really stored any character (I tried to convert the input string into char array) after I typed char[] input = text.toCharArray();'s problem. ?
    My another question is: since the input[i] stores character, when I am trying to print out the letters that exist in the text through the last System.out.println() method in my code, I can use input[i] to represent the letter which I want to print. Is it right?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    I figure out now that the problem is caused by the last for loop. I modify it as following:
    for(i=0; i<26; i++)
                if (alphabet[i] > 0)
                System.out.println('a'+i +"          "+alphabet);
    }After the modification, now I can get the right answer. The only problem I have now is trying to convert the interger number produced by 'a'+i back into character. I tried to replace 'a'+i with toChar('a'+i), but it doesn't work. Can you give me some explanation? Thank you very much!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • ColdFusion 11: custom serialisers. More questions than answers

    G'day:
    I am reposting this from my blog ("ColdFusion 11: custom serialisers. More questions than answers") at the suggestion of Adobe support:
    @dacCfml @ColdFusion Can you post your queries at http://t.co/8UF4uCajTC for all cfclient and mobile queries.— Anit Kumar Panda (@anitkumar85) April 29, 2014
    This particular question is not regarding <cfclient>, hence posting it on the regular forum, not on the mobile-specific one as Anit suggested. I have edited this in places to remove language that will be deemed inappropriate by the censors here. Changes I have made are in [square brackets]. The forums software here has broken some of the styling, but so be it.
    G'day:
    I've been wanting to write an article about the new custom serialiser one can have in ColdFusion 11, but having looked at it I have more questions than I have answers, so I have put it off. But, equally, I have no place to ask the questions, so I'm stymied. So I figured I'd write an article covering my initial questions. Maybe someone can answer then.
    ColdFusion 11 has added the notion of a custom serialiser a website can have (docs: "Support for pluggable serializer and deserializer"). The idea is that whilst Adobe can dictate the serialisation rules for its own data types, it cannot sensibly infer how a CFC instance might get serialised: as each CFC represents a different data "schema", there is no "one size fits all" approach to handling it. So this is where the custom serialiser comes in. Kind of. If it wasn't a bit rubbish. Here's my exploration thusfar.
    One can specify a custom serialiser by adding a setting to Application.cfc:
    component {     this.name = "serialiser01";     this.customSerializer="Serialiser"; }
    In this case the value - Serialiser - is the name of a CFC, eg:
    // Serialiser.cfccomponent {     public function canSerialize(){         logArgs(args=arguments, from=getFunctionCalledName());         return true;     }     public function canDeserialize(){         logArgs(args=arguments, from=getFunctionCalledName());         return true;     }     public function serialize(){         logArgs(args=arguments, from=getFunctionCalledName());         return "SERIALISED";     }     public function deserialize(){         logArgs(args=arguments, from=getFunctionCalledName());         return "DESERIALISED";     }     private function logArgs(required struct args, required string from){         var dumpFile = getDirectoryFromPath(getCurrentTemplatePath()) & "dump_#from#.html";         if (fileExists(dumpFile)){             fileDelete(dumpFile);         }         writeDump(var=args, label=from, output=dumpFile, format="html");     } }
    This CFC needs to implement four methods:
    canSerialize() - indicates whether something can be serialised by the serialiser;
    canDeserialize() - indicates whether something can be deserialised by the serialiser;
    serialize() - the function used to serialise something
    deserialize() - the function used to deserialise something
    I'm being purposely vague on those functions for a reason. I'll get to that.
    The first [issue] in the implementation here is that for the custom serialisation to work, all four of those methods must be implemented in the serisalisation CFC. So common sense would dictate that a way to enforce that would be to require the CFC to implement an interface. That's what interfaces are for. Now I know people will argue the merit of having interfaces in CFML, but I don't really give a [monkey's] about that: CFML has interfaces, and this is what they're for. So when one specifies the serialiser in Application.cfc and it doesn't fulfil the interface requirement, it should error. Right then. When one specifies the inappropriate tool for the job. What instead happens is if the functions are omitted, one will get erratic behaviour in the application, through to outright errors when ColdFusion goes to call the functions and cannot find it. EG: if I have canSerialize() but no serialize() method, CF will error when it comes to serialise something:
    JSON serialization failure: Unable to serialize to JSON.
    Reason : The method serialize was not found in component C:/wwwroot/scribble/shared/git/blogExamples/coldfusion/CF11/customerserialiser/Serialiser .cfc.
    The error occurred inC:/wwwroot/scribble/shared/git/blogExamples/coldfusion/CF11/customerserialiser/testBasic.c fm: line 4
    2 : o = new Basic();
    3 :
    4 : serialised = serializeJson(o);5 : writeDump([serialised]);
    6 :
    Note that the error comes when I go to serialise something, not when ColdFusion is told about the serialiser in the first place. This is just lazy/thoughtless implementation on the part of Adobe. It invites bugs, and is just sloppy.
    The second [issue] follows immediately on from this.
    Given my sample serialiser above, I then run this test code to examine some stuff:
    o = new Basic(); serialised = serializeJson(o); writeDump([serialised]); deserialised = deserializeJson(serialised); writeDump([deserialised]);
    So all I'm doing is using (de)serializeJson() as a baseline to see how the functions work. here's Basic.cfc, btw:
    component { }
    And the test output:
    array
    1
    SERIALISED
    array
    1
    DESERIALISED
    This is as one would expect. OK, so that "works". But now... you'll've noted I am logging the arguments each of the serialisation methods receives, as I got.
    Here's the arguments passed to canSerialize():
    canSerialize - struct
    1
    XML
    My reaction to that is: "[WTH]?" Why is canSerialize() being passed the string "XML" when I'm trying to serialise an object of type Basic.cfc?
    Here's the docs for canSerialize() (from the page I linked to earlier):
    CanSerialize - Returns a boolean value and takes the "Accept Type" of the request as the argument. You can return true if you want the customserialzer to serialize the data to the passed argument type.
    Again, back to "[WTH]?" What's the "Accept type" of the request? And what the hell has the request got to do with a call to serializeJson()? You might think that "Accept type" references some HTTP header or something, but there is no "Accept type" header in the HTTP spec (that I can find: "Hypertext Transfer Protocol -- HTTP/1.1: 14 Header Field Definitions"). There's an "Accept" header (in this case: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"), and other ones like "Accept-Encoding", "Accept-Language"... but none of which contain a value of "XML". Even if there was... how would it be relevant to the question as to whether a Basic.cfc instance can be serialised? Raised as bug: 3750730.
    serialize() gets more sensible arguments:
    serialize - struct
    1
    https://www.blogger.com/nullserialize - component scribble.shared.git.blogExamples.coldfusion.CF11.customerserialiser.Basic
    2
    JSON
    So the first is the object to serialise (which surely should be part of the question canSerialize() is supposed to ask, and the format to serialise to. Cool.
    canDeserialize() is passed this:
    canDeserialize - struct
    1
    JSON
    I guess it's because it's being called from deserializeJson(), so it's legit to expect the input value is indeed JSON. Fair enough. (Note: I'm not actually passing it JSON, but that's beside the point here).
    And deserialize() is passed this:
    deserialize - struct
    1
    SERIALISED
    2
    JSON
    3
    [empty string]
    The first argument is the value to work on, and the second is the type of deserialisation to do. I have no idea what the third argument is for, and it's not mentioned directly or indirectly on that docs page. So dunno what the story is there.
    The next issue isn't a code-oriented one, but an implementation one: how the hell are we expected to work with this?
    The only way to work here is for each function to have a long array of IF/ELSEIF statements which somehow identify each object type that is serialisable, and then return true from canSerialise(), or in the case of serialize(), go ahead and do the serialisation. So this means this one CFC needs to know about everything which can be serialised in the entire application. Talk about a failure in "separation of concerns".
    You know the best way of determining if an object can be seriaslised? Ask it! Don't rely on something else needing to know. This can be achieved very easily in one of two ways:
    Check to see if the object implements a "Serializable" interface, which requires a serialize() method to exist.
    Or simply take the duck-typing approach: if a CFC implements a serialize() method: it can be serialised. By calling that method. Job done.
    Either approach would work fine, keeps things nicely encapsulated, and I see merits in both. And either make far more sense than Adobe's approach. Which is like something from the "OO Failures Special Needs" class.
    Deserialisation is trickier. Because it relies on somehow working out how to deserialise() an object. I'm not sure of the best approach here, but - again - how to deserialise something should be as close to the thing needing deserialisation as possible. IE: something in the serialised data itself which can be used to bootstrap the process.
    This could simply be a matter of specifying a CFC type at a known place in the serialised data. EG: Adobe stipulates that if the serialised data is JSON, and at the top level of the JSON is a key eg: type, and the value is an extant CFC... use that CFC's deserialize() method. Or it could look for an object which contains a type and a method, or whatever. But Adobe can specify a contract there.
    The only place I see a centralised CFC being relevant here is for a mechanism for handling serialised data that is neither a ColdFusion internal type, nor identifiable as above. In this case, perhaps they could provide a mechanism for a serialisation router, which basically has a bunch of routes (if/elseifs if need be) which contains logic as to how to work out how to deserialise the data. But it should not be the actual deserialiser, it should simply have the mechanism to find out how to do it. This is actually pretty much the same in operation as the deserialize() approach in the current implementation, but it doesn't need the canDeserialize() method (it can return false at the end of the routing), and it doesn't need to know about serialising. And also it's not the main mechanism to do the deserialisation, it's just the fall back if the prescribed approach hasn't been used.
    TBH, this still sounds a bit jerry-built, and I'm open for better suggestions. This is probably a well-trod subject in other languages, so it might be worth looking at how the likes of Groovy, Ruby or even PHP (eek!) achieve this.
    There's still another issue with the current approach. And this demonstrates that the Adobe guys don't actually work with either CFML applications or even modern websites. This approach only works for a single, stand-alone website (like how we might have done in 2001). What if I'm not in the business of building websites, but I build applications such as FW/1 or ColdBox or the like? Or any sort of "helper" application. They cannot use the current Adobe implementation of the customserializer. Why? Because the serialisation code needs to be in a website-specific CFC. There's no way for Luis to implement a custom serialiser in ColdBox (for example), and then have it work for someone using ColdBox. Because it relies on either editing Application.cfc to specify a different CFC, or editing the existing customSerializer CFC. Neither of which are very good solutions. This should have been immediately apparent to the Adobe engineer(s) implementing this stuff had they actually had any experience with modern web applications (which generally aren't just a single monolithic site, but an aggregation of various other sub applications). Equally, I know it's not a case of having thought about this and [I'm just missing something], because when I asked them the other day, at first they didn't even get what I was asking, but when I clarified were just like "oh yeah... um... err... yeah, you can't do that. We'll... have to... ah yeah". This has been raised as bug 3750731.
    So I declare the intent here valid, but the implementation to be more alpha- / pre-release- quality, not release-ready.
    Still: it could be easily deprecated and rework fairly easily. I've raised this as bug 3750732.
    Or am I missing something?
    Adam

    Yes, you can easily add additional questions to the Lookup.WebClient.Questions Lookup to allow some additional choices. We have added quite a few additional choices, we have noticed that removing them once people have selected them causes some errors.
    You can also customize the required number of questions to select when each user sets them up as well as the number required to be correct to reset the password, these options are in the System Configuration settings.
    If you need multi-language versions of the questions, you will also need to modify the appropriate language resource file in the xlWebApp.war file to provide the necessary translations for the values entered into the Lookup.

  • Problem with php code. Please help!

    Hello!
    I'm using the following syntax to bring content into my
    websites' layout template:
    Code:
    <?php //check in the root folder first
    if(file_exists('./' . $pagename . '.php'))
    include './' . $pagename . '.php';
    //if it wasn't found in the root folder then check in the
    news folder
    elseif(file_exisits('./news/' . $filename . '.php'))
    include './news/' . $pagename . '.php';
    // if it couldn't be found display message
    else
    echo $pagename . '.php could not be found in either the root
    folder or the news folder!';
    } ?>
    What it's essentially saying is, if you can't find the .php
    file in the _root folder, look for it in the /news/ folder.
    It works perfectly if loading something from the _root folder
    but I get an error if I need to bring something from the /news/
    folder.
    Can anyone see any potential problems with my code?
    Thank you very much and I hope to hear from you.
    Take care,
    Mark

    I've never seen the code written like that before, but I'm
    assuming it's
    legal?
    Perhaps try:
    <?php
    $newsroot = $_SERVER['DOCUMENT_ROOT']."/news";
    if (!file_exists("$pagename.php")) {
    elseif (!file_exists("$newsroot/$pagename.php")) {
    else
    Or the other thing you can try is replacing the elseif
    statement with:
    elseif (!file_exists("news/$pagename.php"))
    If not - I'm sure Gary will be on here soon...
    Shane H
    [email protected]
    http://www.avenuedesigners.com
    =============================================
    Proud GAWDS Member
    http://www.gawds.org/showmember.php?memberid=1495
    Delivering accessible websites to all ...
    =============================================
    "Spindrift" <[email protected]> wrote in
    message
    news:e5mled$272$[email protected]..
    > Hello!
    >
    > I'm using the following syntax to bring content into my
    websites' layout
    > template:
    >
    > Code:
    >
    > <?php //check in the root folder first
    > if(file_exists('./' . $pagename . '.php'))
    > {
    > include './' . $pagename . '.php';
    > }
    > //if it wasn't found in the root folder then check in
    the news folder
    > elseif(file_exisits('./news/' . $filename . '.php'))
    > {
    > include './news/' . $pagename . '.php';
    > }
    > // if it couldn't be found display message
    > else
    > {
    > echo $pagename . '.php could not be found in either the
    root folder or
    > the
    > news folder!';
    > } ?>
    >
    > What it's essentially saying is, if you can't find the
    .php file in the
    > _root
    > folder, look for it in the /news/ folder.
    >
    > It works perfectly if loading something from the _root
    folder but I get an
    > error if I need to bring something from the /news/
    folder.
    >
    > Can anyone see any potential problems with my code?
    >
    > Thank you very much and I hope to hear from you.
    >
    > Take care,
    >
    > Mark
    >

  • Error: 'else' without 'if'

    Heres my code, and I am getting this error even tho i have {} pairs correctly placed.
    This is for a DOS clone that I am implementing in a game.
              String command = ""; /*This holds what the user inputs for command line*/
              String help = "/help"; //The next strings are commands
              String exit = "exit";
              String dir = "dir";
              String path = "path";
              String cmdPath = "C:\\"; //This string is the current path
              String open = "open";
              String cd = "cd";
              String decrypt = "decrypt";
              Boolean toolsDat = true;
              String[] cDrive = new String[2];  /*This is an array to hold file names*/
                                                   // in the C drive.
              cDrive[0] = "message.txt"; //7 long so its stays
              cDrive[1] = "tools.dat";
    while (!command.equals(exit)) { //The main loop for the commands
                   int fileOpen = -1; //this will act as 'i' used in a for loop to check what
                                         // file is being opened: cDrive[fileOpen]
                   command = reader.readLine(cmdPath + ">"); //shown b4 cursor
                   if (command.equals(help)) {
                        writer.println(exit + " >exits MainFrame access");
                        writer.println(dir + " >shows files in current directory");
                        writer.println(open + " >opens file; ex.:");
                        writer.println("\tC:\\WINDOWS>open\n\tType in file name: file1.txt");
                        writer.println(cd + " >change directory; ex.:");
                        writer.println("\tcd .. >go up a directory;");
                        writer.println("\tOR\n\tC:\\WINDOWS>cd\n\tEnter folder name: system");
                        writer.println(path + " >displays current path");
                        writer.println();
                        writer.println("File and Folder names go as following: If name < 8 long, then it's normal, or");
                        writer.println("If name > 7 long, then name is 6 long followed by ~1");
                        writer.println("File and Folder names are case sensitive.\n\tWindows is not WINDOWS is not windows");
                        writer.println();
                   else if (command.equals(dir)) {
                        writer.println("dir of: " + cmdPath);
                        if (cmdPath.equals("C:\\")) { //will have to add if's to get all
                                                      // folders
                             for (int i = 0; i < cDrive.length; i++) {
                                  writer.println(cDrive);
                        writer.println();
                   else if (command.equals(path)) {
                        writer.println("Current path: " + cmdPath);
                        writer.println();
                   else if (command.equals(open)) {
                        String fileName = reader.readLine ("Type in file name: ");
                        for (int i = 0; i < 2; i++) {
                             if (cDrive[i].equals(fileName))
                                  fileOpen = i;
                        if (fileOpen == 0) {
                             writer.println("\tDear...");
                             decrypt = "decrypt";
                        else if (fileOpen == 1) {
                             writer.println("Cannot Access File: " + fileName);
                             writer.println("Ran...");
                             writer.println("101...");
                   else if (command.equals(decrypt)); {
                        if (toolsDat.equals(false)) {}
                        else if (toolsDat.equals("true")) {
                             String fileDecrypt = reader.readLine("Enter file name: "); /*This always appears no matter what command I type in during eecution.*/
                             if (fileDecrypt.equals("tools.dat")) {
                                  cDrive[1] = "tools.exe";
                                  writer.println("tools.dat has been decrypted");
                   else {
                        if (command.equals(exit)) {}
                        else
                             writer.println("Bad command\n"); //This never appearsd during execution, even when it is supposed to appear which is the String command doesn't match any of the defined commands.
    Sorry about the friggin tabs. when i copy and paste from my program, if there is 2 tabs, here there will be 4 tabs. weird.
    thank you.

    Hopefully the following will help. I added in some semi-colons, changed the spelling of a few type errors, and I think the if, else, and elseif statements should be working correctly now. Please reply back if you need further assistance.
                    String command = ""; /*This holds what the user inputs for command line*/
              String help = "/help"; //The next strings are commands     
              String exit = "exit";     
              String dir = "dir";     
              String path = "path";     
              String cmdPath = "C:\\"; //This string is the current path
              String open = "open";     
              String cd = "cd";     
              String decrypt = "decrypt";     
              Boolean toolsDat = true;     
              String[] cDrive = new String[2];  /*This is an array to hold file names*/                          
              // in the C drive.          
              cDrive[0] = "message.txt"; //7 long so its stays     
              cDrive[1] = "tools.dat";
              while (!command.equals(exit)) { //The main loop for the commands
                   int fileOpen = -1; //this will act as 'i' used in a for loop to check what
                                              // file is being opened: cDrive[fileOpen]
                   command = reader.readLine(cmdPath + ">"); //shown b4 cursor
                   if (command.equals(help)) {          
                   writer.println(exit + " >exits MainFrame access");
                   writer.println(dir + " >shows files in current directory");
                   writer.println(open + " >opens file; ex.:");
                   writer.println("\tC:\\WINDOWS>open\n\tType in file name: file1.txt");
                   writer.println(cd + " >change directory; ex.:");
                   writer.println("\tcd .. >go up a directory;");     
                   writer.println("\tOR\n\tC:\\WINDOWS>cd\n\tEnter folder name: system");     
                   writer.println(path + " >displays current path");          
                   writer.println();          
                   writer.println("File and Folder names go as following: If name < 8 long, then it's normal, or");
                   writer.println("If name > 7 long, then name is 6 long followed by ~1");
                   writer.println("File and Folder names are case sensitive.\n\tWindows is not WINDOWS is not windows");
                   writer.println();
                   else if (command.equals(dir)) {
                        writer.println("dir of: " + cmdPath);
                        if (cmdPath.equals("C:\\")) { //will have to add if's to get all
                                                      // folders               
                            for (int i = 0; i < cDrive.length; i++) {
                                 writer.println(cDrive);
                   writer.println();
                   else if (command.equals(path)) {
                   writer.println("Current path: " + cmdPath);
                   writer.println();
                   else if (command.equals(open)) {
                   String fileName = reader.readLine ("Type in file name: ");
                   for (int i = 0; i < 2; i++) {
                        if (cDrive[i].equals(fileName)){
                        fileOpen = i;     
                   if (fileOpen == 0) {               
                        writer.println("\tDear...");
                        decrypt = "decrypt";
                   else if (fileOpen == 1) {
                        writer.println("Cannot Access File: " + fileName);
                        writer.println("Ran...");               
                        writer.println("101...");          
                   else if (command.equals(decrypt)) {     
                   if (toolsDat.equals(false)) {
                   else if (toolsDat.equals("true")) {
                        String fileDecrypt = reader.readLine("Enter file name: "); /*This always appears no matter what command I type in during eecution.*/
                        if (fileDecrypt.equals("tools.dat")) {
                        cDrive[1] = "tools.exe";
                        writer.println("tools.dat has been decrypted");
                   else {
                   if (command.equals(exit)) {
                   else {
                        writer.println("Bad command\n"); //This never appears during execution, even when it is supposed to appear which is the String command doesn't match any of the defined commands.

  • Hiding/Unhiding FIelds in HR-ABAP using LDB

    Hi All,
    I am working on HR Report and using LBD - PNP, it is showing a default selection screen.
    My requirement is that i want to hide few fields from display screen and add some standard fields on
    selection screen. Well i am able to hide the fields using
    LOOP at Screen... Endloop.
    I want to add couple of field that we can get after selecting it from 'Further Selection' Button and
    selecting Employee Group (PNPPERSG) and Employee Subgroup (PNPPERSK). Can any one assist how to get these
    fields displayed on screen using LOOP at Screen ... Endloop or any other possible solution.
    Thanks & Regards,

    Thanks for quick n loads of suggestions, Yah we can use existing HR Category or create new one. I am bit intrested in handling it in coding as for every report if standard HR report category doesn't work than i have to create and maintain new HR category. Same is the case with if we create variant of selection screen. (Neeed to create as many variant as many programs.)
    The coding i am using is:
      LOOP AT SCREEN.
        IF   SCREEN-GROUP1 = 'XDA' OR SCREEN-GROUP1 = 'MSL' OR SCREEN-GROUP1 = 'MCD' OR
    SCREEN-GROUP1 = 'SRT'
        OR SCREEN-GROUP1 = 'ORG' OR SCREEN-GROUP1 = 'YA1' OR SCREEN-GROUP1 = 'YA2' OR SCREEN-GROUP1 = 'YB1'
        OR SCREEN-GROUP1 = 'YB2' OR SCREEN-GROUP1 = 'YB3'  OR SCREEN-GROUP1 = 'ZB2'
        or screen-group1 = 'ZBK' OR SCREEN-GROUP1 = 'XPS' OR SCREEN-GROUP1 = 'PER' OR SCREEN-GROUP1 = 'ZB1'
        OR SCREEN-GROUP1 = 'DS2' OR SCREEN-NAME = '%_PNPBUKRS_%_APP_%-TEXT' OR SCREEN-NAME = '%_PNPBUKRS_%_APP_%-OPTI_PUSH'
        OR SCREEN-NAME = 'PNPBUKRS-LOW' OR SCREEN-NAME = '%_PNPBUKRS_%_APP_%-VALU_PUSH'
        or SCREEN-NAME = '%_PNPXBWBK_%_APP_%-TEXT' OR SCREEN-NAME = '%_PNPXBWBK_%_APP_%-OPTI_PUSH'
        OR SCREEN-NAME = 'PNPXBWBK-LOW' OR SCREEN-NAME = '%_PNPXBWBK_%_APP_%-VALU_PUSH'
        OR SCREEN-NAME = '%_PNPXPGPK_%_APP_%-TEXT' OR SCREEN-NAME = '%_PNPXPGPK_%_APP_%-OPTI_PUSH'
        OR SCREEN-NAME = 'PNPXPGPK-LOW' OR SCREEN-NAME = '%_PNPXPGPK_%_APP_%-VALU_PUSH'
        OR SCREEN-NAME = '%_PNPSTAT2_%_APP_%-TEXT' OR SCREEN-NAME = '%_PNPSTAT2_%_APP_%-OPTI_PUSH'
        OR SCREEN-NAME = 'PNPSTAT2-LOW' OR SCREEN-NAME = '%_PNPSTAT2_%_APP_%-VALU_PUSH' .
          SCREEN-ACTIVE = '0'.
          MODIFY SCREEN.
        *ELSEIF ( SCREEN-NAME = '%_PNPPERSK_%_APP_%-TEXT' OR SCREEN-NAME = '%_PNPPERSK_%_APP_%-OPTI_PUSH'*
                 *OR SCREEN-NAME = 'PNPPERSK-LOW' OR SCREEN-NAME = '%_PNPPERSK_%_APP_%-VALU_PUSH' ).*
          *SCREEN-ACTIVE = '1'.*
          *MODIFY SCREEN.*
       ENDIF.
      ENDLOOP.
    Here the fields i want to display is with ELSEIF statement it come under GROUP1 = SEL. In above code i was able to hide field PNPSTAT2 but not able to show PNPPERSK.
    These field PNPPERSK can be selected if we use 'Futher Selection' Button on initial selection screen.
    I appreciate if some one can assit me solving that.... Thanks again for quick response :).
    Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 4:16 PM

  • How can replace IF condition for a Select query in my reports?

    IF s_bukrs-LOW = '4312' OR s_bukrs-LOW = '4313' OR s_bukrs-LOW = '4349'  .
    ELSEIF s_bukrs-LOW = '4310' OR s_bukrs-LOW = '4311' OR s_bukrs-LOW = '4587'.
    ENDIF.
    What if I want to use select query in place of IF condition, in my report for a Z -table in which I have made entries of ZZUSEREXIT-my progam name ,VAR1-4310,VAR2-4311,VAR3-4312,VAR4-4313,VAR5-4349,VAR6-4587?

    HI
    U can do this by two ways-
    (1) Using Two SELECT statementsie. one for IF statements and second for ELSEIF statements.
    Like--
        SELECT < field name>,
    WHERE s_bukrs-LOW = '4312' OR s_bukrs-LOW = '4313' OR s_bukrs-LOW = '4349' 
    SELECT < field name>,
    WHERE s_bukrs-LOW = '4310' OR s_bukrs-LOW = '4311' OR s_bukrs-LOW = '4587'.
    (2) U can do this in using IF with select statements.
    This will help u

  • MySQL database - Recordset's echoing problem

    Gary, David & any other PHP wizards, listen up -
    Today I decided to use a MySQL database to hold my articles
    in, and then
    call them with a recordset when applicable. Everything works
    really, really
    nicely except for one thing.
    If you go here:
    http://sourtea.com/articles2.php
    And select "Read this article" for any of the articles,
    scroll down to the
    bottom where the comment form is and you'll see some PHP code
    being
    echo'ed - which isn't supposed to be.
    I've noticed in IE - it's always displayed with all articles,
    but on
    Firefox, it seems to only happen with the first article you
    open up, then
    all the others are fine.
    I'm calling the recordsets inside of my php cases, for
    example:
    <?php
    break;
    case 10:
    ?>
    <?php echo $row_getArticles['textfields']; ?>
    <?php
    break;
    case 20:
    ?>
    And so on.
    Now, everything in the "textfields" row is the physical HTML
    and PHP code
    that will write and display the article and the comment form.
    It seems that something is getting scrambled, or that I need
    to write the
    PHP code differently inside the table...
    Help?
    Thanks for your time,
    Shane H
    [email protected]
    http://www.avenuedesigners.com
    =============================================
    Web Dev Articles, Photography, and more:
    http://sourtea.com
    =============================================
    Proud GAWDS Member
    http://www.gawds.org/showmember.php?memberid=1495
    Delivering accessible websites to all ...
    =============================================

    Hi Joe -
    I did cut and paste the code from DW into the table. I just
    finished up,
    actually, with another solution. I entered the code for the
    comment form
    into a .txt file, and used it as a PHP include for the
    articles.
    Also, for the action of the form (since it's the same form
    being used for
    three different pages) - I set a variable when it calls a
    certain Recordset,
    and then did an "if, elseif" statement inside the .txt file
    where it will
    echo out the appropriate page, depending upon which article
    the user is at.
    For example (from my code):
    <form id="contact_form" action="articles.php?ref=<?php
    if($var == 10) { echo
    '10'; } elseif($var == 20) { echo '20'; } elseif($var == 30)
    { echo '30'; }
    ?>" method="post">
    That's was really the only problem I had to overcome because
    I'm using the
    same form for all three articles (assigning the proper
    action).
    Thanks for the help, Joe - though, I'm not sure if your
    suggestion would
    have worked! Maybe I'll try it sometime...
    Shane H
    [email protected]
    http://www.avenuedesigners.com
    =============================================
    Web Dev Articles, Photography, and more:
    http://sourtea.com
    =============================================
    Proud GAWDS Member
    http://www.gawds.org/showmember.php?memberid=1495
    Delivering accessible websites to all ...
    =============================================
    "Joe Makowiec" <[email protected]> wrote in
    message
    news:[email protected]...
    > On Wed 30 Aug 2006 02:08:30p, Shane H wrote in
    macromedia.dreamweaver:
    >
    >> Thanks for the prompt reply. Is there a way around
    this (e.g., being
    >> able to include the PHP code in the row)?
    >
    > Is the PHP code being pulled in from the database? I'm
    not where I can
    > test it right now, but I believe that it won't be
    executed. The only way
    > would be to have it in the page itself.
    >
    > For example:
    >
    > <input
    > name="namefield"
    > class="contactfield"
    > id="namefield"
    > value="&lt;?php if(isset($_POST['namefield'])) echo
    htmlentities($_POST
    > ['namefield']);?&gt;"
    > tabindex="1"
    > accesskey="1"
    > type="text">
    >
    > You can't have that in the data. You could do this:
    >
    > <input
    > name="namefield"
    > class="contactfield"
    > id="namefield"
    > value="<?php if(isset($_POST['namefield'])) echo
    htmlentities($_POST
    > ['namefield']);?>"
    > tabindex="1"
    > accesskey="1"
    > type="text">
    >
    > Or maybe you cut and pasted code, and got the character
    entities &lt;
    > &gt; rather than <>?

  • Selection screen for custom table

    We have developed a custom table and user want to have a selection selection screen similar to SE16. There are 9 fields in the table and user can enter data to the selection screen with any combination. My question is how do I filter based on the user input ? DO I need to write multiple SQL for different combination of selection screen parameter within IF ELSEIF statement ? If so then there will be huge number of SQL within IF & ELSEIF statment for 9 selection parameter. Please suggest if you have any better ideas.

    Even after using select-option along with IN statement in where clause , it did not work.
    I used following selection screen defination :
    SELECTION-SCREEN: BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
    SELECT-OPTIONS: P_PCBUS FOR MARA-ZZPC_BUSINESS NO-EXTENSION NO INTERVALS,
                    P_PCBUS1 FOR MARA-ZZPC_BUS_SUB1 NO-EXTENSION NO INTERVALS,
                    P_PLNFMT FOR MARA-ZZPLNG_FORMAT NO-EXTENSION NO INTERVALS,
                    P_PRDB FOR MARA-ZZPROD_BRAND NO-EXTENSION NO INTERVALS,
                    P_SEASCD FOR MARA-ZZSEASON_CODE NO-EXTENSION NO INTERVALS,
                    P_SNP FOR MARA-ZZSUP_NET_PATH NO-EXTENSION NO INTERVALS,
                    P_MAT_DC FOR MARA-MATNR NO-EXTENSION NO INTERVALS,
                    P_MAT_MG FOR MARA-MATNR NO-EXTENSION NO INTERVALS.
    SELECTION-SCREEN: END OF BLOCK B2.
    and SQL statement :
    SELECT ZZPC_BUSINESS
          FROM ZTB_RTL_TO_WHS
          INTO TABLE TA_ZZPCBUS
          WHERE ZZPC_BUSINESS =  P_PCBUS
          AND  ZZPC_BUS_SUB1  IN  P_PCBUS1
          AND   ZZPROD_BRAND   IN  P_PRDB
          AND  ZZPLNG_FORMAT   IN  P_PLNFMT
          AND  ZZSEASON_CODE   IN  P_SEASCD
          AND  ZZSUP_NET_PATH  IN  P_SNP
          AND  ZZD_MATNR       IN  P_MAT_DC
          AND  ZZM_MATNR       IN  P_MAT_MG.
    While executing program, I only enterd value for the field P_PCBUS. Though record present for that value, I rcvd SY-SUBRC = 4.
    ANy Idea?
    Edited by: J. Bakshi on Jul 14, 2009 10:17 AM

Maybe you are looking for