How to check whether a Record Exists or not in Ztable

Hi all,
I have Req like this
In ZTable i have 2 fields  * Legacy System , Legacy Material No*
Environment Value is coming in one of the field in Idoc
The logic is if the Environment Value is UK and a Record Exists on the ZTable for Legacy Sysyetm = Leg1 means i have send Legacy Material No , else  Send 01
Please suggest me the process for this
REgards
Vamsi
Edited by: Vamsi Krishna on May 19, 2009 5:31 PM

Hi Michal / Aamir,
Thanks for your replies.
The ZTable is at R/3 side only, iam using RFC Lookup for this, but iam bit confuse on how to construct the logic to check whether there is a record Exists or not on Ztable
Logic shld be If the Environment value is UK and a record exists on the Ztable for Legacy system "ABC" means then send Legacy material number else send 01
In Table we will have the fields Legacy System   Legacy Material No  & Environment value is coming from Idoc itself( Ex: UK or US)
Regards

Similar Messages

  • How to check whether portal user exists or not using UM API.

    Hi Experts,
    Let us say i need to create an user account "PortalUser",i know how to create an user,setting first name,lastname,password for that.
    but here before creating the portal user, i need to check whether that user exists or not.If user already exists ,then i  need to skip the below for creating the user.
    IUserFactory userFact = UMFactory.getUserFactory();
    IGroupFactory groupFact = UMFactory.getGroupFactory();
    IRoleFactory roleFact = UMFactory.getRoleFactory();
    IUser tuser = userFact.getUserByLogonID("PortalUser");
    IUserMaint newUser = userFact.newUser("PortalUser");
    newUser.setFirstName("PortalUser");
    newUser.setLastName("Test");
    newUser.setEmail("PortalUser.Testatgmaildotcom");
    //Locale PortalLanguage = new Locale(Lang.toLowerCase(), "");
    Locale PortalLang=new Locale("en");
    newUser.setLocale(PortalLang);
    newUser.save();
    newUser.commit();
    IUserAccount userAcc = UMFactory.getUserAccountFactory().newUserAccount("PortalUser", newUser.getUniqueID());
    userAcc.setPassword("test1test$");
    userAcc.save();
    userAcc.commit();     
    Thanks in advance.
    Thanks
    Sony.

    Hi,
    Try this code,
    IUserFactory factory = UMFactory.getUserFactory();
    IUser user = factory.getUserByLogonID(userId);
    lastName = user.getLastName();
    firstName = user.getFirstName();
    refer this pdf,its very helpful
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/events/webinars-nw-rig/using%20the%20user%20management%20api%20with%20ep%20applications%20-%20webinar%20powerpoint.pdf
    Regards,
    Sunaina Reddy T

  • How to check whether a file exists or not

    i am in an image uploading utility. i hav succesfully uploaded the image to the server directory (say /uploads). but when displaying the uploaded image, i wanna show the picture only if the image exits (bcoz for some records there is no image). so i hav used this code
    if(new File("uploads/1.jpg").exists())
         out.print("image exists");
    but its not working for me. i got it working fine when i give the full path "D:/Tomcat/webapps/diary/admin/uploads/1.jpg". but i think giving this absolute path is not an efficient method bcoz its a web application, bcoz i may not be able get the absolute path always. so how can i do this by specifieing the relative path
    help me ASAP if u can
    aleens

    Haii ameen
    This is one way to rectify your problem..
    if(new File("uploads/1.jpg").exists())
    out.print("image exists");
    instead of this u can write like
    <%
    ServletConfig cf=getServletConfig();
    ServletContext c=cf.getServletContext();
    if(new File(c.getRealPath("uploads")+"/test.txt").exists())
    out.print("image exists");
    %>If u are not clear of what it is done let me know..i will xplain to you furthur...
    Happy New Year
    Shanu

  • How to check whether a file exist in the program folder or not?

    Hi guys,
    how to check whether a file exist in the program folder or not? Let is say i recieve a file name from user then i want to know if the file is there not and act on that base.
    abdul

    Look at the class java.io.File and the .exists() method:
    http://java.sun.com/j2se/1.4/docs/api/java/io/File.html

  • How to check whether transport path exist between two systems in sld??

    Hi,
         I have two systems namely 'A' and 'B' and created business systems for both of them.Then i created transport path between the two systems.How i check whether what i have done is right in SLD.

    <b>WRT to CMS</b>
    am not sure with this but u can try:
    1. Start CMS: http://<host>:<J2EE Engine http port>/webdynpro/dispatcher/sap.com/tcSLCMS~WebUI/Cms.
    2. Goto lansdscape configurator and check there
    Message was edited by:
            Prabhu  S

  • Plz help me for checking the Header record exists or not

    Hi
    How we check the whether the Header record exists or not.. if it is not exists i have raise an exception.. i wanna do this using UDF
    Plz help me  its urgent..
    venkat

    Maybe you should read all the responses in your earleir threads and read the rules of engagement also,
    /thread/117188 [original link is broken]
    Regards
    Bhavesh

  • How to check whether a node exist in a Particular Level. (xmltype)

    hi,
    please help me to check whether a particular node exists in one level.
    for eg
    I have the following xml
    <map>
         <entry>
              <key>
                   heading1
                   </key>
              <map>
                   <entry>
                        <key> sub1 heading1</key>
                        <value> sub1 heading1 value  </value>
                   </entry>
                   <entry>
                        <key> sub2 heading1 </key>
                        <value> sub2 heading1 value  </value>
                   </entry>
              </map>
         </entry>
         <entry>
              <key>
                   heading2
                   </key>
              <map>
                   <entry>
                        <key> sub1 heading2</key>
                        <value> sub1 heading2 value  </value>
                   </entry>
                   <entry>
                        <key> sub2 heading2 </key>
                        <value> sub2 heading2 value  </value>
                   </entry>
              </map>
         </entry>
    </map>i need to check how many heading exists in this xml.
    I am checking like
            i:=1;
         l_section := ip_xml.extract('//map/entry');
         WHILE l_section.existsnode('entry[' || i|| ']') = 1 LOOP
              // extract the key name within entry tag
                  // print the key name.
    i:=i+1;
         end loop;but iam getting all the key name like
    heading1
    sub1 heading1
    sub2 heading1
    heading2
    sub1 heading2
    sub2 heading2
    I need only heading1 and heading2. how can I check whether a particular node exist in particular level.
    first level , second level etc. Please help

    but iam getting all the key nameThat's because you're using a descendant axis : //map/entry
    SQL> DECLARE
      2 
      3   ip_xml  xmltype := xmltype('<map>
      4       <entry>
      5            <key>
      6                 heading1
      7                 </key>
      8            <map>
      9                 <entry>
    10                      <key> sub1 heading1</key>
    11                      <value> sub1 heading1 value  </value>
    12                 </entry>
    13                 <entry>
    14                      <key> sub2 heading1 </key>
    15                      <value> sub2 heading1 value  </value>
    16                 </entry>
    17            </map>
    18       </entry>
    19       <entry>
    20            <key>
    21                 heading2
    22                 </key>
    23            <map>
    24                 <entry>
    25                      <key> sub1 heading2</key>
    26                      <value> sub1 heading2 value  </value>
    27                 </entry>
    28                 <entry>
    29                      <key> sub2 heading2 </key>
    30                      <value> sub2 heading2 value  </value>
    31                 </entry>
    32            </map>
    33       </entry>
    34  </map>');
    35 
    36  BEGIN
    37 
    38    for r in (
    39      select heading, headno
    40      from xmltable( '/map/entry/key'
    41                     passing ip_xml
    42                     columns heading varchar2(30) path '.'
    43                           , headno  for ordinality )
    44    )
    45    loop
    46      dbms_output.put_line('Heading '||r.headno||' = '||r.heading);
    47    end loop
    48    ;
    49 
    50  END;
    51  /
    Heading 1 =
                   heading1
    Heading 2 =
                   heading2
    PL/SQL procedure successfully completed

  • How to check whether a table exists in database

    test9997 is table already made in database with 3 columns :1st-varchar,2nd-number,3rd-number
    declare
    var1 varchar2(20);
    var2 number(20);
    var3 number(20);
    begin
    plvar1 :='this is again pl/sql';
    plvar2 := 12;
    plvar3 := 13;
    IF (???? condition for existence of table say test1111??????) then
    create table test1111(
    var1 varchar2(20);
    var2 number(20);
    var3 number(20);
    insert into test1111(plvar1,plvar2,plvar3);
    else
    insert into test1111(plvar1,plvar2,plvar3);;
    end if;
    end;
    in the above code i want to check existence of a table and insertion or updation will be based on it after creation if it doesnt exist.
    how to do it
    please help asap

    You're in the wrong forum (this one is for issues with the SQL Developer tool). You'll get more answers in the SQL And PL/SQL forum.
    Have fun,
    K.

  • Want to check whether cost center exists or not during payroll process ?

    Dear All,
    Requirement is to throw an error for an employee during payroll run if the cost center does not exist.
    I guess this may be achieved by PCR only.  There is an operation OUTWPCOSTC which can help.
    Issue is that there are parameters like VALEN and VAOFF which need to be taken care of while using OUTWPCOSTC.
    Also, when cost center is not assigned, its value in WPBP is BLANK.  How to query a BLANK value in PCRs?
    Can any help on this with an complete example?
    Regards,
    Ankit

    Hi Ankit,
    Try with PCR
    VALEN 1
    OUTWPCOSTC
    Update the PCR in sub schema COPY  Z002                  Edit basic data
    000040 WPBP                        Read Work Center/Basic Pay Data
    000050 GON                         Continue if Data is Complete
    000060 ACTIO ZQ14 GEN              Check if cost centre exits
    000070 BLOCK END                   Edit basic data
    This will help you while runing the Payroll.
    Thanks & Regards
    Vikram Mali

  • How to Check whether laptop is OEM or Not ?

    I had bought a  Envy 15 notebook through flipkart. But due to technical problem I had refreshed my pc using HP recovery. At last I cant activate windows 8. When I contacted Microsoft technical support I had given my product ID and they told me that it was not a product of OEM. Whats the solution for this problem ?

    Hi,
    It will blow air out. You can use you hand or a piece of tissue to check. Normally fan will only work when machine is getting warmer. You may run machine for 10 or 15 mins then check. BUT making beeping noise at startup is not a good news, what is the actual noise ? How many times ?
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • How to check whether file exist or not?

    hello,
    i wanted to know that how can i check whether a file exist or not independent of underlying Operating system?
    please help .
    Thank you.

    Use exists() on a File instance.

  • How to check whether Output ES is working or not.

    I am able to see Output ES in the services list of the admin console of my server. Please let me know how to check whether this is working or not.
    Regards,
    Shabeer

    LiveCycle ES2 (and LiveCycle ES) ship with three undersold and unadvertised web applications that are VERY useful. Each is referred to as an Installation Verification Sample (or IVS) but they are great testing tools you can use during development and QA. There is
    1) Assembler IVS,
    2) Forms IVS, and
    3) Output IVS
    Output IVS looks like this...
    The pattern for deploying and using all three IVSs is very similar as what I am about to describe for Output IVS. The following directions apply to the JBoss turnkey on Windows.
    1) go to C:\Adobe\Adobe LiveCycle ES2\deploy and locate adobe-output-ivs-jboss.ear
    2) copy adobe-output-ivs-jboss.ear to C:\Adobe\Adobe LiveCycle ES2\jboss\server\lc_turnkey\deploy
    3) if necessary, start LiveCycle
    4) open a browser and go to http://localhost:8080/OutputIVS/
    5) click Check/Change your preferences
    6) add Admin Credentials
    7) click Save
    8) click Test your form designs
    9) Select an .xdp from Form designs
    10) Click Use EJB (or Use Web Service if you feel so inclined) to invoke LiveCycle Output ES2
    Steve

  • Check whether master record conversions exist

    Dear All,
    I have copied the requests from developement server to quality server for SD IMG configrations.
    When i am doing consistency check in Developement server there is no error.
    However when i check the same in quality server I am getting the following error.
    Check whether master record conversions exist
    Dist. channel is missing for condition conversion 1000 10
    Dist. channel missing for customer/material conversion 1000 10
    Check whether master record conversions exist
    Division is missing for condition conversion 1000 10
    Division missing for customer conversion 1000 10
    Can some body help me to solve this problem.This very urgent and will really appreciate your timely support.
    Thanking you,
    Best regards,
    R.Srinivasan
    Check whether master record conversions exist
    Division is missing for condition conversion 1000 10
    Division missing for customer conversion 1000 10

    Experiencing the same problem also.
    Right now, i'm re transporting the DEV config for Define Dist Channel, Define Division, Assign Dist channel to sales org, Assign Division to sales org, and Set up sales area. I hope once i transport them again in this order, the issue will be resolved is QAS.
    Anyone know what i should do?

  • Please help me how to check a material does existed group code in system (w

    Hi all,
    Please help me...
    I have inputted quantity for  tx MC 94  but when I input them into  tx MC94, I met  a message " Structure  not yet maintained for  this conbination characterstics". Step by step to show a error message as below:
    Step 1: Launch MC 94
    step 2: Enter Planning
    Step 3: Enter  Prod.Code. Material (ex: enter material code :0101010260008, this code is existed  Prod.Code )
    Step 4: Click on "Inactive Version " button
    ==> A error message is showed.
    Please help me how to check a material does existed group code in system (which table to  check  it)?
    How to record the message" Structure  not yet maintained for  this conbination characterstics" to catch up it in my program?
    Thank in advance.

    Karenloria,
    1. Check in MC8C, which Infostructure is used for Planning type "Planning" or the one you are entering in the intial screen of MC94.
    2. Using transaction MC63 for the infostructure identified in step 1, check the planning hierarchy maintained. If this product is not maintined maintain using MC62.
    You can also check using SE16 transction the current infostructe records(Plan) for the table name = infostructure identified in step 1.
    Regards,
    Prasobh

  • How to check whether the Application Server directory exits or not

    Hi,
    I have a selection screen in which I give the Application server file name(UNIX file) as input. Here, I would like to check whether the Server directory exists or not.
    Let us say, the path I gave in the selection screen is /usr/sap/tmp/testfile.txt . Here, the file name is testfile.txt and the server directory is /usr/sap/tmp . I would like to check whether this directory /usr/sap/tmp exists in the server or not. I am not bothered about the file name as I am going to write data into the file. I am mainly concerned about whether the directory exists in the server or not. and one more thing... this is the Application Server path not the Local path.
    Can anyone help me on the same how to check whether the server directory exists or not.
    Thanks in advance.
    Best Regards,
    Pradeep.

    Also you can use the FM EPS_GET_DIRECTORY_LISTING for this purpose.
      Store the directory name
        l_dpath = p_file+0(l_no).
      Validate the directory of the application server
        CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
          EXPORTING
            dir_name               = l_dpath
          TABLES
            dir_list               = l_i_dlist
          EXCEPTIONS
            invalid_eps_subdir     = 1
            sapgparam_failed       = 2
            build_directory_failed = 3
            no_authorization       = 4
            read_directory_failed  = 5
            too_many_read_errors   = 6
            empty_directory_list   = 7
            OTHERS                 = 8.
      If any problem occurs with the directory then display proper
      error message
        IF sy-subrc <> 0.
        Display error message
          MESSAGE e018 WITH 'Problem with directory entered'(008).
        ENDIF. " sy-subrc <> 0
    Regards,
    Joy.

Maybe you are looking for

  • Condition types for capital purchase

    Dear All, we have a capital purchase process for which JCI1 & JCI2 conditions are created for 1st year and 2nd year similarly we have condition type for ECESS JCC1 & JCC2 but i need SHECESS conditon types for the same please help Regards

  • House move connection fee demand.

    Hi...  I'm new to the forum and I'm hoping a kindly Moderator can help me with a problem which is causing me a lot of frustration and angst! I've been with BT for many years, and recently completed the house move procedure online.   Initially I was t

  • Business Objects Rapid Marts with third-party ETL tool

    Hi, I understand BO Rapid Marts are natively developed by BO Data Integrator. Can we use any other ETL tool in combination with BO Rapid Marts?

  • How to upgrade from Leopard Server 10.5.8 to Lion Server?

    In anticipation of Lion, I finally retired my G5 2.7GHZ Mac Desktop running Mac OS X Server 10.5.8 and moved the start up drive to an 2 GHZ Intel Core 2 Duo MacMini. It is running fine. I would like to now upgrade to Lion Server, but without spending

  • Recieving email notifications for classes

    Heya all, Ok i have a adobe connect pro account and i hold classes everyday and 2 timezones so my appointments are alot.I have so many projects that i need to be reminded via email when a class is going to start .........either a notification on the