Creating a fm with end date and start date

hi gurus,
I want to create a FM where my importing parameters will be date.
like we give in select-options. if i give my importing parameters
as sdate and edate.
how my coding will work.
Eg I want to select emp joining between jan to may. i can pass in importing parameter but what query shud i write so that it will work like a select-option works in a report.
plz help me in solving this.
points will be awarded
regards
puneet

Hi,
U can do like this.
Declare a range for date and pass ur low and high values to the range in the function module source code.
RANGES: r_date FOR sy-datum.
Let us assume ur importing parameters are low_date, high_date.
If high_date is not mandatory field then do like this.
CLEAR: r_date, r_date[].
MOVE: 'I' TO r_date-sign.
IF NOT high_date IS INITIAL.
   MOVE  'BT' TO r_date-option.
ELSE.
   MOVE 'EQ' TO r_date-option.
ENDIF.
MOVE: low_date TO r_date-low,
             high_date TO r_date-high.
            APPEND r_date.
If high_date also mandatory field then do like this.
CLEAR: r_date, r_date[].
MOVE: 'I' TO r_date-sign.
           'BT' TO r_date-option.
            low_date TO r_date-low,
            high_date TO r_date-high.
            APPEND r_date.
If both are not mandatory fields then do like this.
CLEAR: r_date, r_date[].
SELECT....
INTO TABLE ...
FROM..
WHERE date IN r_date.
Hope this will solve ur problem.
U can also use Between operator in the select statement, But it is relatively slow in performance.
Thanks,
Vinod.
Edited by: Vinod Kumar Vemuru on Mar 9, 2008 4:55 PM
Edited by: Vinod Kumar Vemuru on Mar 9, 2008 4:56 PM

Similar Messages

  • CRM-ISU: Need to change the END date and Start Date for contract items

    Hi,
    There is an old contract item for which  I need to change the end date
    and there is a new contract item for which I need to change the start date.
    I need to change the contract item end date and start date using some function module in IS-U system (may be as RFC to CRM).Pleaselet me know if any body is ware of this functionality?
    I am aware of a FM EECRM_CONTRACT_DATE_CHANGE which may be used for changing End Date
    but how to change the start date of a new contract item?
    Please let me know if any body is aware of this?
    Thanks

    Hi,
    Hope you can solve it by this [Link1|Re: Function modules; [link2|CRM material;.
    Regards,
    Surjith

  • Newbie:how to create a page with 4 textfields and send data to MySql DB

    Dear all,
    i have created a page called page1 with 1 submit button named 'submitButton' and 4 textfields named:
    'date'
    'item'
    'contact'
    'phone'
    I have created a MySql DB table with the schema named 'association' and table named todolist3. Fields created in the table are :
    'Date' - >INTEGER->Primary
    'Item' ->VARCHAR(100)
    'Contact' ->VARCHAR(45)
    'Phone_contact' ->INTEGER
    what i want to do is to send the data from the 4 textfields to the database when i click the submit button. Below is the code i out in submit button. please kindly help as i have tested different ways but none of them works. thank you!!!
    public String submitButton_action() {
    try {
    if ( todolist3DataProvider.canAppendRow() )
    String item1=(String)item.getText();
    String contact1=(String)contact.getText();
    Integer phone1=(Integer)phone.getText();
    Integer date1=(Integer)date.getText();
    RowKey rowKey = todolist3DataProvider.appendRow();
    todolist3DataProvider.setCursorRow(rowKey);
    todolist3DataProvider.setValue("todolist3.Date", date1);
    todolist3DataProvider.setValue("todolist3.Item",item1);
    todolist3DataProvider.setValue("todolist3.Contact",contact1);
    todolist3DataProvider.setValue("todolist3.Phone_contact",phone1);
    } else {
    error("submitButton_action() -- cannot append todolist3 record");
    } catch (Exception e) {
    error("Page1::submitButton_action-- something's wrong trying to append todolist3 record");
    return null;
    }

    Hi,
    I think that you have forgotten to commit changes. Modify your code to look like this:
    RowKey rowKey = todolist3DataProvider.appendRow();
    todolist3DataProvider.setCursorRow(rowKey);
    todolist3DataProvider.setValue("todolist3.Date", date1);
    todolist3DataProvider.setValue("todolist3.Item",item1);
    todolist3DataProvider.setValue("todolist3.Contact",contact1);
    todolist3DataProvider.setValue("todolist3.Phone_contact",phone1);
    // commit your changes !!!
    todolist3DataProvider.commitChanges();
    } else {
    // ....best regards
    Grzegorz

  • How do i save a calender i have created with the photo and the dates saved on separate pages?

    how do i save a calender i have created in photoshop with the photo and the dates saved as two separate pages?  when i save as pdf or jpeg they are authomatically saving 1 pg with the photo and dates on one page.  This is causing problems when i print.

    Hi there, in case your printer cannot print very large, you can also crop down two versions and print them as separate documents.
    1) Create a guide where you would like to split the pages by clicking on the ruler (hit command R if they are not showing) and dragging to the desired area.
    Creating the guide will make it so you can be precise in the way you split up your page, and so that no part of the image will be repeated or lost.
    2) Select the Crop Tool and fit the crop area to the top half of your calendar, using the guide you've just made to snap to the right spot. Hit return to finalize the crop.
    3) Go to File > Save As. Name the file something like calendar_top and select the desired file format. Hit "Save."
    4) Once you get back to your calendar file, Go to the History panel and select "Drag Guide." This will take you back to the step before you cropped the image.
    5) Repeat the steps as before for the bottom half of the calendar, once again using the guide to help you make your crop area.
    So then you would just print each of the two pages individually. The images will not be contained within one document, but if you have Acrobat you could combine the files.
    I hope this helps!

  • Create a record based on From date and To Date in CRM 2015 Plugins

    Hi all
    in my account screen i have two date field from date and Todate and i have one child entity member when i am creating a
    new account then based on from date and to date number of child record should be created
    for example in account screen
    if from date=2/1/2015 and 
       To date=31/03/2015
    then number of child record should be created
    in this manner 
    from date      to date 
    2/1/2015       31/01/2015
    01/02/2015     28/02/2015
    1/03/2015      31/03/2015

    Hi,
    OK. It seems you want to create 3 records (custom child entity) where the first has the same From Date as the Account and goes up to the end of the month, and the other records go from there.
    This logic can be implemented via a Plugin that could run on the create and update of these fields on Accounts. From the Plugin, you can set up the logic and fill the records with the necessary information.

  • Basic Start/Finish Date and Requirment Date in Maintenance Order

    Sir,
    We want to know the link between Order Start/finish date and requirement date in Maintenance Order.
    As we are facing problem during change in dates.
    When we change either start date or finish date in the order, the system automatically change the requirment date as of ondate of all the materials which has been earlier issued and also consider the today date.
    Like in Maintenance Order
    Basic Start Date - 01.04.2009
    Basic End Date  - 31.05.2009
    We have issued materials on the order at different date by putting offset value for the requirement date.
    Now if we increase the Basic End Date of order to n30.062.009 or whatelse, the system automatically changes the requirement dates of all the materials issue based on current date. Suppose we changed the Basic End date on 10.11.2009, the system changes all the requirement dates by calulating offset value from 10.11.2009. However these materials has been issued earlier.
    I want to know if there is any remedy to stop to change the requirement dates automatically.
    With Regards
    Mudit Gupta

    HI
    In general the requirement date will get changed only when the IMG settings in OPU7 permits the requirments dates should be adjusted towards the order basic start and end dates
    kinldy check and adjust as per the requirement
    regards
    thyagarajan

  • How to Create an R/3 source system and load data from there

    Hello All,
    Till now I have only worked with Flat files. I want to create an R/3 source system and extract data from there on to my Info Providers.
    Does anyone has detailed steps for that. I am using BW 3.5 system
    Thanks n Regards,
    Abhishek

    1. Type Transaction WE30. Check iDoc types
    2. Type Transaction SM59. Maintain RFC destinations
    a.) Open the RFC Destinations. b.) Find your Source System and double click on it. c.) Technical setting should contain information regarding yoursource system d.) Logon Information should contain source system client and name & password for you remote logon. We use RFC_SAB for BW logon to R/3 and RFC_AAE for R/3 logon to BW. Password for both is always xxxxxxx. e.) Execute your 'Test Connection' & 'Remote Logon'. You should NOT be prompted for a password, if you are then the logon info is incorrect. f.) Repeat above to verify RFCs for other systems (CRM etc)
    3. Type Transaction WE21. iDoc Processing Ports.
    a.) Select 'Ports' and then 'Transactional RFC'. b.) Click on the Port # for you source system. c.) Verify description & SAP R/3 version.(BW 2.1C should be release 4.x) d.) RFC Destination should be one created in SM59. If non-existent then create one
    4. Type Transaction SE16. Data browser (for R/3  BW Connections)
    5. Type Transaction SM30. Msg Types & Assignment to iDocs
    Enter 'EDIMSG' in the Table/View field. Click on the 'Enter Conditions' option for Restrict Data Range. Click 'Maintain'. Select Message Type. Then enter 'RSSEND' in "From' field. Verify that the Basic Type matches what is in your RSBASIDOCtable for each of your connections. If any are missing any entries you must create them as follows: Create another session and type Transaction WE30. Enter IDoc Type (ZSBAXXX) in Obj. Name field (Suggestion: Start new type with 'ZS' + Transfer Structure Prefix + (3)#'s) Select Create. Select "Create from Copy'. Enter 'RSSEND" in 'Copy From' field Enter Description (i.e. IDoc Type for BW Development) Execute (Green Check). Repeat for other missingentries.
    6. Go to the SM30 main screen. Clients Overview
    Enter 'T000' in the Table/View field. Click 'Maintain'. Verify correct Client and Description. If incorrect enter.
    8. On BW Type Transaction WE20. Partner Profiles
    9. On R/3 Type Transaction WE20. Partner Profiles
    10. Check all is correct

  • Hi I created a EPUB with indesign cc and I'm trying to submitted it to iTunes Producer

    Hi I created a EPUB with indesign cc and I'm trying to submitted it to iTunes Producer and only thing that happens is the little wheel keep spinning and spinning and spinning can you help? And is there a way to  decrease the size of my EPUB I'm getting a message saying that it is over 200 MB?

    You haven't said if you're on a mac or PC. I understand that on a PC you can directly open an EPUB. But, as I am on a Mac I need a utility. I use a little app called EPUB Unzip and then to zip it back up you'll need EPUB zip. Just search on Google for them. They are open source (free). Or you can use Sigil to get into the EPUB without unzipping. Sigil is good, but does change the file structure a little bit, and for that reason some people don't like it. For a reflowable EPUB it doesn't matter much. Though I don't think I'd open a fixed layout EPUB with it. Sigil is also open source—it's very easy to use, too.
    You'll also want an EPUB validation app. I use Pagina EPUBcheck 3.01 (open source). Or you can use the free online checker here: EPUB Validator (beta) though it's for SMALL files. I like Pagina because it suggests fixes for errors—even though those fixes may be completely greek to you and me.
    Finally, I really suggest you get a subscription to Lynda.com and watch everything Anne Marie Concepcion has ever done on EPUB. While not the be all and end all, her knowledge is a very good place to start. Lynda.com is $25 per month but you can quit anytime (though um, I haven't, because well it's kind of addicting). So, even if you only use it for a month, you'll learn a ton and it'll be well worth it.
    Lest I sound like some kind of freakin' expert, let me assure you this is a long and painful process, with little help out there for us "non-programmer" types who've been thrown in the lion's den. I am still learning everyday, by my own wits it sometimes seems.  Even today I am learning (most painfully yet) how to program a fixed layout read-abound book by trial and error, because even after BEGGING Adobe ON BENDED KNEES we don't have support for read-aloud and according to insiders hereabout they have NO PLANS to give us that. Yes. I am going to continue to whine about it, frequently.
    It's late, and I've already had a glass or two of wine. (Not that you'd notice. ) Good luck on your journey. (Only 8 more circles of hell to traverse, so I've heard.) 

  • How to create a contract with one supplier and two dealers?

    Hi Gurus,
    I have a contract with a supplier (eg. Apple), but the products and services are supplied by two dealers.
    The supplier is the manufacturer and with whom the negotiation of prices is made.
    The dealers are those who make the delivery of the products and services and who the payment is done.
    How can I create a contract with these characteristics in SRM 7.0?
    I don't want to create two contracts with same products and services for two suppliers (Dealer_1 and Dealer_2).
    How can this be handled through business partner type "Vendor"?
    In "Partner" section in "Header" --> "Basic data", I can only add 1 vendor.
    The system is:
    Component software: SRM_SERVER
    Release: 700
    Level: 0008
    Support package: SAPKIBKV08
    Thanks in advance and best regards,
    Alonso Valenzuela

    Hi Wadim,
    I have a similar requirement to create order lines in an existing contract with reference using  BAPI_CUSTOMERCONTRACT_CHANGE.  The order lines get created in the contract. However, the condition types from the order line which i'm referencing are not getting referenced and are not getting added in the Contract's line after referencing.
    Did you come across any such issue ? If yes , could you suggest the solution ?
    Regards,
    Venkat.

  • Problem creating a table with a subquery and a dblink

    Hello!!
    I have a little problem. When I create a table with a subquery and a dblink, for example:
    CREATE TABLE EXAMPLE2 AS SELECT * FROM EXAMPLE1@DBLINK
    the table definition is changed. Fields with a type of CHAR or VARCHAR2 are created with a size three times bigger than the original table in the remote database. Field of type DATE and NUMBER are not changed. For example if the original table, in the database 1, has a field of type CHAR(1) it is create in the local database with a type of CHAR(3), and a VARCHAR2(5) field is created with VARCHAR2(15).
    Database 1 has a WE8DEC character set.
    Database 2 has a AL32UTF8 character set.
    Could it be related to the difference in character sets?
    What can I do to make Oracle use the same table definition when creating a table in this way?
    Thanks!!

    That is related to character sets, and probably necessary if you want all the data in the remote table to be able to fit in the new table.
    When you declare a column VARCHAR2(5), by default, you're allocating 5 bytes of storage. In a single-byte character set, which I believe WE8DEC is, that also happens to equate to 5 characters. In a multi-byte character set like AL32UTF8, though, 1 character may require up to 3 bytes of storage, so you'd need to allocate 15 bytes to store that data. That's what's going on here.
    You could still store all the data if you create the table locally by explicitly requesting 5 characters of storage by declaring the column VARCHAR2(5 CHAR). You could also set the NLS_LENGTH_SEMANTICS parameter to CHAR rather than BYTE before creating the table, but I believe that both of these will only apply when you're explicitly defining columns as part of your CREATE TABLE. I don't believe either will apply to CTAS statements.
    Justin

  • Basic start date and finish date changing in the past

    Hello Gurus,
    I set the scheduling parameters as " Do not adjust basic dates, dep rqmts to order start " and also assigned the priority to populate the basic finish date. System does calculate the finish date based on the priority and start date as current date but it does allow me to change both dates in past or future which should not happen.
    Please do note that I activated the defaulted date as current date as well. Even I removed this mark and did not work.
    Please let me know if there is any way to restrcit the changing it alteast in the past.
    Mahee

    This can be prevented using one the following ways depending upon your needs
    ---> Set the "start in past" field to appropriate value using transaction OPU7 for order type /Plant combination
    ---> Make the "Basic start date  and Basic end date" fields as "Display only" through the Field selection config for the order type.
    ---> Use the user exit on "SAVE" of the order to check for the same
    Regards
    Narasimhan

  • Dateofbirth and start date not same for infotype 2

    Hi Gurus,
    Recently we have applied supportpacks for 4.6c  in development.I am testing for hiring action.What i observed is end date for these infotypes changed to 31.12.1999 instead of 12.31.1999 and in infotype 2 employee dateofbirth  and start date is not same which is suppose to be same.Startdate of infotype 2 is taken as employee hire date.Infotype 2 has timeconstraint 1.when i am trying to enter  date of birth, for some dates it give me an error invalid date. what could be the cause?Help is appreciated
    Thanks

    Hi,
    Please go to SU3 and check for the Date Format under the Defaults tab.
    Hope this helps,
    Reward points if helpful,
    Thank You,

  • Can message filters cause messages with blank subject and 1969 dates

    I have done many things to try to trace why I get messages with blank subjects and 1969 dates.
    downloaded TB
    created all new folders
    moved only persdict and msfFilterRules to the new profile.
    At this try
    set the option NOT to download messages on startup
    went off line and compacted all folders.
    emptied the inbox and all subfolders.
    Exited TB.
    deleted all files under pop.verizon.net except msgFilters rules.
    Deleted all msf files for local folders in my profile.
    opened TB.
    a few times
    --With Firefox went to verizon webmail and moved a few messages to the Verizon inbox.
    --moved to TB window
    -- Clicked <get messages>
    -- still received blank messages with 1969 dates
    -- deleted those messages
    -- emptied trash
    went to the filter rules and unclicked all filters that send files to local folders
    left 2 rules in place
    (1) if a sender was in my address list send the message to inbox folder called "Known sender"
    (2) if the subject was NOT a weird string like "&*%$@!+=?><" send the message to inbox folder called "Suspicious" This filter is because there is not an ELSE function in TB it is extremely unlikely that a message would have such a subject.
    [These two filters should move all messages except junk to the two folders.]
    I then tried the above procedure of going to Verizon, moving messages to Verizon Inbox, etc. a few times.
    I did NOT get the messages with blank subject and 1969 date!!
    Questions:
    (1) Is this just a fluke?
    (2) From understanding the internals of TB is it reasonable that some now-unchecked message filter(s) had caused there to be the oddball messages?
    (3) if It is a filter rule, how can I find out which one it is?

    I looked though all the condition specification options I do not see how using header info in a condition specification would '''change '''the header info.
    I looked at the possible actions on filters.
    I only see "tag" and "Star" as ones that might change header info.
    However, I found out that when I unchecked the first 17 of 19 filters and just had the two I explained above I would sometimes get a message with the 1969 date.
    Since then I deleted those two rules and made new versions and moved them to the bottom where the earlier versions had been. I have not had the 1969 messages since!!
    I have put a new filter at the top of the list that checks whether the date is before 1/1/971. If teh date is before 1/1/1971 the filter tags the message as important and moves it into the inbox folder named "Suspicious".
    I have not seen any 1969 messages since then.
    Since the problem was intermittent and because I was not able to create conditions whereby The 1969 dates would or would not occur, the problem may not be 'fixed'. I'll watch it for a while
    Meanwhile, I'll continue to manually go though the webmail on Verizon and as a test only download mail that I do not want to save for the long term. Messages I want to keep I'll move messages I want to keep for the long term into foldrs on Verizon. '''If '''after a while, I do not get any more of the 1969 messages, I'll move messages I want to keep into the Verizon inbox and download them into TB

  • Has anyone been able to create a HtmlDataTable with dynamic col and rows?

    Has anyone been able to create a HtmlDataTable with dynamic col and rows?
    If so please explain. I am successfully able to dynamically add columns using the getChildren method of the htmldatatable object
    BUT for each new column created no data is displayed.
    I am only able to display data for columns originally created when i clicked and dragged the dataTable icon from the pallette in netbeans visual web kit.
    Any help on this is greatly appreciated. I have been searching the web and these forums for around 8 hours and no one seems to have a working example of this. Lots of similar posts asking how to do it though :(
    Thanks in advance.

    This might be useful: http://balusc.xs4all.nl/srv/dev-jep-dat.html

  • How to start Designing Master Data and transactional Data

    Can anyone tell me how to really start to design Master Data and transactional Data in Sales? What are the steps if is it possible to share? Thanks!

    Hi Lei,
    first step is to read all necessary document on help.sap.com about Business Content for SD. Here you can see all the parts covered directly by SAP with the Business Content.
    Then you can start the GAP analysis: you check if all your requirements are fully covered by BC or not, in this second case you can start developing your own InfoObjects.
    Start always by Business Content.
    Take a look also at this doc:
    <a href="https://websmp110.sap-ag.de/form/sapnet?_FRAME=CONTAINER&_OBJECT=011000358700002719062002E">https://websmp110.sap-ag.de/form/sapnet?_FRAME=CONTAINER&_OBJECT=011000358700002719062002E</a>
    Ciao.
    Riccardo.

Maybe you are looking for

  • Reload data from DSO to Cube after error

    Dear Friends, i got a error last night durring upload of sales data to ODS and then into cube. ODS is updated sucessfully. but due to my mistake cube was inactive. and cube was not updated with ODS data. and i got a error. now i fix the problem. now

  • Compress an image before upload

    Hi, Is there a way to compress an image using Flex? the scenario I have is: the user takes a picture from a mobile device camera, I then upload it to the cloud. I'd like to be able to shrink the image in size before I upload it as it takes ages. Many

  • FD33 Open sales value against credit for return

    Dear Gurus, In a particular situation, we had to cancel the sale of a customer for an entire month. Among list of all invoices, we had few cases where returns/PGRs were done and Credit For Returns were issued. All invoices without returns were easily

  • PropertyNotFoundException on a custom component

    Hello, I'm experiencing some issue while using a custom component in a FXML file. I try to instanciate my comp and tu set a text with the command : <fx:include source="MyComponent.fxml" text="myText" /> I have linked my component to a controller usin

  • Flash not working anywhere in Firefox IE is fine

    Ok, so, I'm getting really irritated with Flash. I talked to a friend who was having flash problems and they said they downloaded Firefox and it fixed the problem. Well, after doing EVERYTHING else first, I thought, what the heck, maybe it might actu