A very confusing issue about ABAP HR programming

Dear,
  I have a curious problem,when i am using HR_infotype_operation function to insert a record into info type 0016.
EG;  a person 'James' his contract date is between  2010.01.01-2010.12.31. i want to add  one year's contract for him.
Then the contract should be 2011.01.01-2011.12.31 . But when i call  function 'HR_infotype_operation',it inserts an record like this .2011.01.01-2013.12.31 ,it automatically  add three years contract!
     This is my code:
program ztest.
data ls_p0016 type p0016.
DATA ls_return      TYPE bapireturn1.
selection-screen begin of block b1 with frame TITLE text-001.
PARAMETERS per type p0016-pernr.
PARAMETERS cn_begda type p0016-begda.
PARAMETERS cn_endda type p0016-begda.
parameters mod type PSPAR-ACTIO.
selection-screen end of block b1.
  ls_p0016-pernr = per.
  ls_p0016-endda = '99991231'.
  ls_p0016-begda =  cn_begda.
  ls_p0016-cttyp = '01'.
  ls_p0016-ctedt = cn_endda.
  CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
    EXPORTING
      number = per
    IMPORTING
      return = ls_return.
  CALL FUNCTION 'HR_INFOTYPE_OPERATION'
    EXPORTING
      infty         = '0016'
      number        = per
      subtype       = ''
      validityend   = ls_p0016-endda
      validitybegin = ls_p0016-begda
      record        = ls_p0016
      operation     = mod
      dialog_mode   = '1'
      nocommit      = 'X'
    IMPORTING
      return        = ls_return
    EXCEPTIONS
      error_message = 4
      OTHERS        = 1
    commit work.
    CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
    EXPORTING
      number = per
    IMPORTING
      return = ls_return.

Hi,
You use fuction module to get leave in
               WHILE i_pa2001-begda <= date.
                SELECT SINGLE mofid FROM t001p INTO calid WHERE werks = wa_final-werks.
                  CALL FUNCTION 'HOLIDAY_CHECK_AND_GET_INFO'
                    EXPORTING
                      date                    = i_pa2001-begda
                      holiday_calendar_id     = calid
                      with_holiday_attributes = 'X'
                    IMPORTING
                      holiday_found           = lc_holiday_found
                    TABLES
                      holiday_attributes      = ltab_holiday_attributes.
                  CALL FUNCTION 'DAY_IN_WEEK'
                    EXPORTING
                      datum = i_pa2001-begda
                    IMPORTING
                      wotnr = day.
                  IF lc_holiday_found = 'X' OR day = 7.
                  ELSE.
                    sum_d = sum_d + 1.
                  ENDIF.
                  i_pa2001-begda = i_pa2001-begda + 1.
                ENDWHILE.
Above logic give you better  idea about how to used function module and function module name
Rgds
Ravi Lanjewar

Similar Messages

  • Help or tutorials about ABAP UI programming such as Tree and dock container

    Hi,
    I'm looking for help, tutorials or any ressources I can explore to undertsand how to work in ABAP with controls, containers, tree and so on.
    Each time I do a search on help.sap.com, I found help on a detailed object such as tree or docking container but I never found a global view. I would like to understand the big picture, have an averview of all involved concept. For example, if I want the user screen to be splitted in 2 parts, one that will display a tree, the other one that will display "simple" screen painter trees that will change depending on what user choose using the tree on the left. How do I need to proceed ?
    I'm sorry if I have not a more precise question because I don't found where to begin.
    Thanks for help
    Regards
    Morgan

    Hi Morgan,
    You can start going thorugh the concepts from help.sap.com. Have a look at the following link:
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/1b/337930a63011d2bd6b080009b4534c/frameset.htm
    You will get the entire set of Example codes in the Transaction Code : ABAPDOCU.
    You can also look for examples for Dialog Programing in SE38 using the DEMODYNPRO*.
    Have a look at the Package : SLIS. This is a one point of all examples and demo of SAP Control Framework and ALV Functionality.
    Hope this helps.
    Thanks,
    Samantak.

  • Abap Interface program

    Can any one tell me a short description about Abap interface program also the difference between inbound and outbound interfaces ??

    Hi
    Interfaces
    Interfaces only describe the external point of contact of a class (protocols), they do not contain any implementation.
    Interfaces are usually defined by a user. The user describes in the interface which services (technical and semantic) it needs in order to carry out a task.
    The user never actually knows the providers of these services, but communicates with them through the interface.
    In this way the user is protected from actual implementations and can work in the same way with different classes/objects, as long as they provide the services required. This is known as polymorphism with interfaces.
    Interfaces
    In ABAP interfaces are implemented in addition to, and independently of classes. An interface only has a declaration part,
    and do not have visibility sections. Components (Attributes, methods, constants, types) can be defined the same way as in classes.
    · Interfaces are listed in the definition part lof the class, and must always be in the PUBLIC SECTION.
    · Operations defined in the interface atre impemented as methods of the class. All methods of the interface
    must be present in the implementation part of the class.
    · Attributes, events, constants and types defined in the interface are automatically available to the class
    carrying out the implementation.
    · Interface components are addressed in the class by display.

  • Confusing issues with ORM.

    I am having some very confusing issues with ORM.
    CF 9,0,0,251028 , developers edition locally hosted, Window XP 5.1
    First I created a test in it's own directory using the book club database. Created a CFC called Books and everything ran fine.
    But when I move the test to the root of one of my projects it gives a "Mapping for component Books not found."
    I set the correct [this.ormenabled = "true"; and this.datasource = "cfbookclub"] in the application.cfc and the test cfm is in the same directory (project root) as the app.cfc and Books.cfc.
    I can cfquery the books database from the test cfm just fine.
    The main project is in Mach-ii, but the test does not invoke any mach-ii elements, index.cfm is not run - just the test cfm.
    I have event commented down the application.cfc so that all is left is
    this.name="myApplication";
    this.ormenabled = "true";
    this.datasource = "cfbookclub";
    Also - as a "crazy try anything" I did:
    this.ormsetting.cfclocation ="books.cfc";
    and created an ORM directory and tried:
    this.ormsetting.cfclocation ="orm";
    and
    this.ormsetting.cfclocation ="C:\ColdFusion9\wwwroot\eBusiness\books.cfc";
    Further info:
    My test.cfm is essentially:
    <cfset books = EntityLoad("Books")>
    The header on Books.cfc is:
    <cfcomponent persistent="true" entityname="Books" table="books">
    Any help would be appreciated.
    Sam.

    its important to use the same exact cameras on multi camera shoots. also important to take color meter and see what the lights give you. sodium vapor and tungsten and flourescent all need different " color correction" gels to make them equal 32k or 56k .. and its not just orange and blue correction ...its also green and magenta etc...
    professionally , you cant do all that at the " lens " with cc filters..you need to actually get to the lights physically ( with scissor lifts or cranes ( manlifts ) and gel the lights too ).
    Once you have your lights corrected and ready to shoot...all cameras need to shoot "color swatches - usually Kodak .. with a single light source that equals what your camera is set to ( color temp )...and that is used to get your balance correct in post.
    That said it sounds like you are screwed...
    To have someone try to correct that professionally would cost more than you can afford, or you would have used that " money " to correct your color etc in the beginning... in other words, if you could afford to send everything to a pro lab and try color correcting all that stuff, you wouldnt have this problem to begin with IMO.
    My suggestion:
    Since wrestling is a gritty sport and " manly " and full of emotion that is basically " tough " and " hard " ....trash the color altogether and make everything black and white... maybe increase your contrast a tiny bit ...or maybe add a slight " tone " to it....( not sepia which looks just " old " , but maybe slight blue tint ? ) ...something to make it look as gritty and hard as you can...
    Then tell client you did it on purpose !  Is part of your concept to begin with... wow them with your creativity !

  • Performance issue in abap program

    hi,
    how can we improve the performance of  abap program

    hi,
    read the follwing links
    ABAP provides few tools to analyse the perfomance of the objects, which was developed by us.
    Run time analysis transaction SE30
    This transaction gives all the analysis of an ABAP program with respect to the database and the non-database processing.
    SQL Trace transaction ST05
    by using this tool we can analyse the perfomance issues related to DATABASE calls.
    Perfomance Techniques for improve the perfomance of the object.
    1) ABAP/4 programs can take a very long time to execute, and can make other processes have to wait before executing. Here are some tips to speed up your programs and reduce the load your programs put on the system:
    2) Use the GET RUN TIME command to help evaluate performance. It's hard to know whether that optimization technique REALLY helps unless you test it out.
    3) Using this tool can help you know what is effective, under what kinds of conditions. The GET RUN TIME has problems under multiple CPUs, so you should use it to test small pieces of your program, rather than the whole program.
    4) Generally, try to reduce I/O first, then memory, then CPU activity. I/O operations that read/write to hard disk are always the most expensive operations. Memory, if not controlled, may have to be written to swap space on the hard disk, which therefore increases your I/O read/writes to disk. CPU activity can be reduced by careful program design, and by using commands such as SUM (SQL) and COLLECT (ABAP/4).
    5) Avoid 'SELECT *', especially in tables that have a lot of fields. Use SELECT A B C INTO instead, so that fields are only read if they are used. This can make a very big difference.
    6) Field-groups can be useful for multi-level sorting and displaying. However, they write their data to the system's paging space, rather than to memory (internal tables use memory). For this reason, field-groups are only appropriate for processing large lists (e.g. over 50,000 records). If you have large lists, you should work with the systems administrator to decide the maximum amount of RAM your program should use, and from that, calculate how much space your lists will use. Then you can decide whether to write the data to memory or swap space.
    Use as many table keys as possible in the WHERE part of your select statements.
    7)Whenever possible, design the program to access a relatively constant number of records (for instance, if you only access the transactions for one month, then there probably will be a reasonable range, like 1200-1800, for the number of transactions inputted within that month). Then use a SELECT A B C INTO TABLE ITAB statement.
    8) Get a good idea of how many records you will be accessing. Log into your productive system, and use SE80 -> Dictionary Objects (press Edit), enter the table name you want to see, and press Display. Go To Utilities -> Table Contents to query the table contents and see the number of records. This is extremely useful in optimizing a program's memory allocation.
    9) Try to make the user interface such that the program gradually unfolds more information to the user, rather than giving a huge list of information all at once to the user.
    10) Declare your internal tables using OCCURS NUM_RECS, where NUM_RECS is the number of records you expect to be accessing. If the number of records exceeds NUM_RECS, the data will be kept in swap space (not memory).
    11) Use SELECT A B C INTO TABLE ITAB whenever possible. This will read all of the records into the itab in one operation, rather than repeated operations that result from a SELECT A B C INTO ITAB... ENDSELECT statement. Make sure that ITAB is declared with OCCURS NUM_RECS, where NUM_RECS is the number of records you expect to access.
    12) If the number of records you are reading is constantly growing, you may be able to break it into chunks of relatively constant size. For instance, if you have to read all records from 1991 to present, you can break it into quarters, and read all records one quarter at a time. This will reduce I/O operations. Test extensively with GET RUN TIME when using this method.
    13) Know how to use the 'collect' command. It can be very efficient.
    14) Use the SELECT SINGLE command whenever possible.
    15) Many tables contain totals fields (such as monthly expense totals). Use these avoid wasting resources by calculating a total that has already been calculated and stored.
    Some tips:
    1) Use joins where possible as redundant data is not fetched.
    2) Use select single where ever possible.
    3) Calling methods of a global class is faster than calling function modules.
    4) Use constants instead of literals
    5) Use WHILE instead of a DO-EXIT-ENDDO.
    6) Unnecessary MOVEs should be avoided by using the explicit work area operations
    see the follwing links for a brief insifght into performance tuning,
    http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_Introduction.asp
    http://help.sap.com/saphelp_nw2004s/helpdata/en/d1/801f7c454211d189710000e8322d00/frameset.htm
    regards
    Rohan

  • ABAP MAPPING PROGRAM TRANSPORTATION ISSUE

    Hi Experts,
    Our issue is as following:
    Already one ABAP mapping program is there in our DEV and in QA also.
    Now we have changes the code according to some requirement.
    Now we need to reflect the same in QA also.
    For that I have certain doubts.
    1) after releasing the request number in R/3, will it effect there in integration builder of the QA?
    2) Is there any need to do in ADMINISTRATION to reflect the same?
    Please revert urgenly.
    Regards
    sreeni

    hi barry,
    thanks a lot . we have released it into integration it is working fine.
    thanks once again and i wll reward points also.
    I think you can tell my one more doubt is as:
    I have one new ABAP mapping program which is not used till now in any interface mapping in ID of XI.
    now want use this my integration builder ID in as mapping program.
    in this case is any requirement to enable the same in Integration ADMINISTRATION tab.
    plz clarify me.
    regards
    sreeni

  • I need  information  about  oops  concept  programming  in abap

    Hi  ,
    I need  information  about  oops  concept  programming  in abap
    Thanks,
    Asha

    Of course, the best place to start is help.sap.com.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    There are a couple good books out there as well.  You can get them at www.amazon.com
    Regards,
    Rich Heilman

  • A very urgent deployment issue about DBAdapter

    Hello All,
    I have a very urgent deployment issue about DBAdapter.
    That DBAdapter is connect to DB2 AS400 Database. I have a developing database (jdbc:as400://server01/TEST) and a production database (jdbc:as400://server01/PROD).
    During developing, I used DBAdapter wizard to create it, and import some tables, and set the Adapter to use jabc/DB2DS as connection information for easily deployment later.
    Then I deploy to Production. I configured Data-source.xml and oc4j-ra.xml rightly; I set DB connection point to production database. But the DBAdapter still write into developing Database.
    I checked the DBAdapter, the imported tables are something like this, TEST.table1, TEST.table2. And there are a lot "TEST" located in DB2Writer_toplink_mapping.xml, DB2Writer.xml, TEST.schema, DB2Writer.table1.ClassDescriptor.xml.
    This TEST is refrer to the TEST in connect String jdbc:as400://server01/TEST.
    I think this might be the reason cause the problem. As to production database, "TEST" should replaced by "PROD". If I changed it manually, I have to change every time when switch between TEST and PROD. And I also don't know if it is safe to do it? (I tried, and bring some toplink mapping problem)
    By the way, for Oracle Database, because we use 2 instances for testing and production with same schema name, and do not have this issue.
    Anyone could help and many thanks.
    Kerr
    Message was edited by:
    Kerr

    Hi Kerr,
    The idea is to set up all connections in the BPEL or ESB services with logical names, e.g. typically of the form eis/DB/MyFinancialSystem or eis/DB/MyLogisticsSystem. This way, you do not have to modify code when deploying it onto different environments that serve different purposes.
    When moving your services through their lifecyle, on every environment you deploy these to you will have the same logical connections configured on each instance, e.g. for DEV, QA, SIT, UAT and PROD. Only, in case of QA the actual physical connection is configured to point to the QA instance of the systems that your services interact with whereas in case of UAT it points to the UAT instance of the same system.
    Maybe your problem is caused by connecting as user "SomeUser" when running the DB Adapter wizard during development and actually selecting objects from a different schema than you used to connect with, e.g. "Test" in your case.
    Hth,
    Sjoerd

  • What   about issues in abap

    hi,
           any one can explain about issues in abap.suppose i am in suport project , how the issues plz give me one are two saple issues

    Hi Radha krishna,
    In fact we can't dispose this information, but any way i would like to inform you. In support project we will get the tickets which are raised by user. Based on the domain and based on the problem those tickets will be solved by corresponding team. Suppose user raised one ticket then decide whether it is related functional issue or technical issue. Based on that we can solve.
    Hope this helps you. Reply for queries, shall post the updates.
    Regards. 
    Kumar.

  • I found the operating system very confusing and hard to use. No tutorial. Manual and online help were outdated.  Tool bars, programs and documents randomly appeared and disappeared. Programs I installed completely disappeared. Anyone else experience this?

    I found the operating system very confusing and hard to use. No tutorial. Manual and online help were outdated.  Tool bars, programs and documents randomly appeared and disappeared. Programs I installed completely disappeared. Anyone else experience this?

    No need to apologize, Jim.  I think your rant was justified.  For years people have been telling me how easy the Mac was to use.  Imagine my frustration when I finally learned from friends and users that it takes weeks or months to make the transition from Windows to Mac.
    Still, I agree that I acted to too hastily when I returned my mini-mac to the store only three days after I bought it.
    I'm going to try again, this time with an iMac.  This time I'll keep it.  Since this thread is for the mini-Mac only, I'll probably be starting a new one for the iMac.
    Why did I decide to try again?  Well, I do like the faster speed and compact hardware of the Macs.  I also like the fact that I can install Windows and use that for my programs until I transition completely to Mac, IF I make the complete transition.
    Thank you all for your suggestions and advice.  I have paid attention to what you said.
    Andy

  • I bought a Macbook Pro about 2 months back, its been working fine till now, but today i discovered a very unusual issue, whenever i plug in my earphones, the left one doest work, the earphones are okay i checked them with my iphone, and they work fine.

    I bought a Macbook Pro about 2 months back, its been working fine till now, but today i discovered a very unusual issue, whenever i plug in my earphones, the left one doest work, the earphones are okay i checked them with my iphone, and they work fine.
    PLease help.

    System Preference > Sound > Output
    Balance
    Move the pointer to the middle.
    Best.

  • Very confused with iTunes Store issues

    Dear all,
    I am a Mac user who owns several mac computers and several iOS devices.
    I have become very confused over my rights concerning my specific Apple iD.
    I understand that when purchasing DRM free music from iTunes (256 bit - it appears as Purchased AAC audio file) on my main Mac computer, then I can play this music to as many computers I have, not only 5. Is this correct?
    I remember at some point that on one of my other Mac computers ( my secondary computer - a Mac Mini) I was able to listen to my music purchased, in the past, on my main computer, by having it streamed (not downloaded) from the iCloud onto my secondary computer. Somehow this has been lost recently. Now I am faced with the task to authorise my secondary computer, which I cannot do, because I have 5 computers already authorised.
    What am I doing wrong?
    Has iTunes 11 changed anything in this respect?
    Any help will be most appreciated.
    Merry Christmas and best regards
    Andreas

    Limnos wrote:
    err = -50 when downloading from store - https://discussions.apple.com/thread/3697501 - delete incomplete downloads from downloads folder as per http://support.apple.com/kb/TS3297
    iTunes Store: "Error (-50)" when downloading purchased content - http://support.apple.com/kb/TS1583
    iTunes Customer Service Contact - http://www.apple.com/support/itunes/contact.html
    I had tried all these, deleting 'Downloads' folder in 'iTunes Media', creating a new user (administrator) account and downloading movie with the new account, following error -50 trouble shooting steps, but none of them worked. I did contact iTunes customer service. In addition to what listed above, they also suggested I download the movie using another computer and transfer the file to my macbook air, which has nothing to do with my problem at all.

  • Error while executing sender ABAP proxy program in ECC

    Hi,
    We have lot of proxy to file scenarios, most of them are working fine. I am having issue with 2 interfaces, when I execute sender ABAP proxy program, we are getting following errors in ECC:
    <SAP:Category>XIProtocol</SAP:Category>
      <SAP:Code area="PARSING">GENERAL</SAP:Code>
    <SAP:Stack>com.sap.aii.af.service.cpa.CPAObjectNotFoundException: Couldn't retrieve inbound binding for the given P/S/A values: FP=;TP=;FS=ED1CLNT290;TS=;AN=CustTrPowersellS_Out;ANS=urn:maines-net:OTC_079E:PowersellCustomerTerms; at com.sap.aii.af.service.cpa.impl.lookup.CommonLookup.getInboundBinding(CommonLookup.java:237) at com.sap.aii.af.service.cpa.impl.lookup.CommonLookup.getInboundBinding(CommonLookup.java:167) at com.sap.aii.af.service.cpa.InboundRuntimeLookup.<init>(InboundRuntimeLookup.java:88) at com.sap.aii.af.service.cpa.impl.lookup.AbstractLookupManager.getBinding(AbstractLookupManager.java:519) at com.sap.aii.adapter.soap.web.MessageServlet.getBinding(MessageServlet.java:875) at com.sap.aii.adapter.soap.web.MessageServlet.doPost(MessageServlet.java:439) at   etc etc
    Configuration should be fine because many scenarios are working. Can you please help me where could be the error?
    Let me know if you need more info.
    Regards,
    N@v!n

    Hi Naveen,
    We saw your solution about this issue. We are also facing same issue. I wanted to know where we have to update scenario as simple scenario or integrated scenario.
    And could you please tel me what is the main diff between in these two.
    As we are are using PI 7.31 java stack so for this version what we have to use.
    Thanks,
    Shivdeep Kumar

  • Weird weird issue about 27" intel (late 2009) display

    i toured the whole discussions to see if anyone else shares my problem but obviously not...
    i will now paste the e-mail i sent to [email protected] (which was directly rejected) about my problem out of this world!
    read below...
    Hello Apple People,
    i decided to write an email to apple directly for I'm not satisfied with the dealer here in istanbul / turkey.
    i am not so sure if this issue ever happened to some other iMac users…my screen is alive!
    i bought my iMac 27" (late 2009) from a friend. after i took it home and spent a couple of days i noticed that there was something unusual on the bottom right corner of my screen.
    it was like a triangular white detail under the glass cover…i thought that it was sort of a label or etc.
    after a couple of days i saw it growing and occupying a bigger area!
    for the warranty was expired i took it to a technical service store to take the glass out and see what it was…
    it was sort of a plastic tape probably used for insulating the ips panel to keep it safe from dust or etc.
    the tech guy first offered me to paint it black with a permanent pen if it was only a visual disturbance but after my high tone "no" , grabbed a blade, trimmed and peeled it off for it was on the screen blocking the portion. then i took it home…
    2 days later it was there again…bigger…
    i assume its made of a material that enlarges or expands itself by the heat produced within the machine…then i took the glass of as the tech guy did and gently trimmed it myself and peeled it off…
    2 days later…it was there, even bigger….this material is alive and growing! to get rid of the problem it caused i have done the same once more…nothing changes…it runs on the screen and blocking my pixels on the bottom right corner…
    i do believe it is going to grow since theres no material left by my butching. and as we lose the material we do lose the function. the inner screen behind the panel gets dirty because the mutant isolation tape doesn't do its only work but kidding with me. this may sound stupid but the issue is extremely annoying.
    although my iMac is out of warranty, i do believe it has nothing to do with the usage. the material itself has production faults.
    as an enthusiastic apple user, i now ask apple to solve my problem from the core and replace this mutantly behaving screen for my mental health and satisfaction as a loyal customer.
    no other issue would make me go mad, but this one is sitting in front of me everyday smiling psychopaticly on my face. by the way i believe my 1TB HDD also needs a replacement, cause it sort of screams and working very soundly. The HDD replacement program seems to cover this second problem of mine.
    please help me with my weird issues, for i can not work with my old beloved  machine anymore.
    Thanks in advance.
    serial number: W8*****5RU
    <Personal Information Edited by Host>

    Greetings ThunderHo,
    Welcome to the Apple Support Communities!
    I understand that you are seeing some strange graphical issues on your iMac. In this situation, it may be necessary to have your computer evaluated for repair. For more information about this process, please refer to the attached link.
    Apple - Support - Service Answer Center
    Cheers,
    Joe

  • Can any body send me some issues about mail sending .

    can any body send me some issues about mail sending .
    thanks alot !
    mail to :<i><b>[email protected]</b></i>

    HI
    GOOD
    GO THROUGH THIS CODE
    REPORT ZTSAPMAIL.
    DATA: X_OBJECT_TYPE LIKE SOOD-OBJTP.
    DATA: BEGIN OF X_OBJECT_HD_CHANGE.
    INCLUDE STRUCTURE SOOD1.
    DATA: END OF X_OBJECT_HD_CHANGE.
    DATA: BEGIN OF X_OBJCONT OCCURS 10.
    INCLUDE STRUCTURE SOLI.
    DATA: END OF X_OBJCONT.
    DATA: BEGIN OF X_OBJHEAD OCCURS 0.
    INCLUDE STRUCTURE SOLI.
    DATA: END OF X_OBJHEAD.
    DATA: BEGIN OF RAW_HEAD.
    INCLUDE STRUCTURE SORH.
    DATA: END OF RAW_HEAD.
    DATA: BEGIN OF X_RECEIVERS OCCURS 0.
    INCLUDE STRUCTURE SOOS1.
    DATA: END OF X_RECEIVERS.
    PARAMETERS: RECEIVER LIKE X_RECEIVERS-RECNAM. " Name
    *BUILD MESSAGE HEADER
    MOVE 'Sort field goes here' TO X_OBJECT_HD_CHANGE-OBJSRT. " Sort field
    MOVE 'Name of the object goes here' TO X_OBJECT_HD_CHANGE-OBJNAM. " Name
    MOVE 'Document title goes here' TO X_OBJECT_HD_CHANGE-OBJDES. " Title
    MOVE 'F' TO X_OBJECT_HD_CHANGE-OBJSNS. " Functional OBJECT
    MOVE 'E' TO X_OBJECT_HD_CHANGE-OBJLA. " Language
    Object type of the new document
    MOVE 'RAW' TO X_OBJECT_TYPE.
    CLEAR X_OBJCONT.
    MOVE 'Contents of mail' TO X_OBJCONT-LINE.
    APPEND X_OBJCONT.
    CLEAR X_OBJCONT-LINE. APPEND X_OBJCONT.
    MOVE 'More contents' TO X_OBJCONT-LINE.
    APPEND X_OBJCONT.
    MOVE 'Still more contents'
    to x_objcont-line.
    APPEND X_OBJCONT.
    MOVE ' ' TO X_OBJCONT-LINE.
    APPEND X_OBJCONT.
    Specific header (Dependent on the object type, here RAW)
    REFRESH X_OBJHEAD.
    DESCRIBE TABLE X_OBJCONT LINES RAW_HEAD-RAWSIZ.
    MOVE RAW_HEAD TO X_OBJHEAD.
    APPEND X_OBJHEAD.
    *RECEIVERS table
    CLEAR X_RECEIVERS.
    REFRESH X_RECEIVERS.
    MOVE RECEIVER TO X_RECEIVERS-RECNAM. " Name
    MOVE 'B' TO X_RECEIVERS-RECESC. " Receiver type
    MOVE 'X' TO X_RECEIVERS-SNDCP. " Send as a copy
    MOVE 'X' TO X_RECEIVERS-SNDEX. " EXPRESS DOCUMENT
    APPEND X_RECEIVERS.
    CALL FUNCTION 'SO_OBJECT_SEND'
    EXPORTING
    folder_id = 'OUTBOX'
    forwarder = x_forwarder
    object_fl_change = x_object_fl_change
    OBJECT_HD_CHANGE = X_OBJECT_HD_CHANGE
    object_id = x_object_id
    OBJECT_TYPE = X_OBJECT_TYPE
    OUTBOX_FLAG = 'X'
    OWNER = SY-UNAME
    store_flag = x_store_flag
    importing
    object_id_new = x_object_id_new
    sent_to_all = x_sent_to_all "May need to use
    TABLES
    OBJCONT = X_OBJCONT
    OBJHEAD = X_OBJHEAD
    objpara = x_objpara
    objparb = x_objparb
    RECEIVERS = X_RECEIVERS.
    Firstly SAP Mail
    A SAP mail is a mail internal to the SAP system. It is a very good forum to exchange information with other users. Using a SAP mail in ABAP code facilitates exchange of automatic messages at various stages of the business process. It is easy to use and saves many hassles involved in using workflows for exchanging messages.
    The ABAP code to send a sap mail is built around the FM SO_OBJECT_SEND which has the following pattern.
    call function 'SO_OBJECT_SEND'
    exporting
    EXTERN_ADDRESS = ' '
    FOLDER_ID = ' '
    FORWARDER = ' '
    OBJECT_FL_CHANGE = ' '
    OBJECT_HD_CHANGE = ' '
    OBJECT_ID = ' '
    OBJECT_TYPE = ' '
    OUTBOX_FLAG = ' '
    OWNER = ' '
    STORE_FLAG = ' '
    DELETE_FLAG = ' '
    SENDER = ' '
    CHECK_ALREADY_SENT = ' '
    importing
    object_id_new =
    sent_to_all =
    tables
    OBJCONT =
    OBJHEAD =
    OBJPARA =
    OBJPARB =
    receivers =
    PACKING_LIST =
    ATT_CONT =
    ATT_HEAD =
    NOTE_TEXT =
    exceptions
    active_user_not_exist = 1
    communication_failure = 2
    component_not_available = 3
    folder_not_exist = 4
    folder_no_authorization = 5
    forwarder_not_exist = 6
    note_not_exist = 7
    object_not_exist = 8
    object_not_sent = 9
    object_no_authorization = 10
    object_type_not_exist = 11
    operation_no_authorization = 12
    owner_not_exist = 13
    parameter_error = 14
    substitute_not_active = 15
    substitute_not_defined = 16
    system_failure = 17
    too_much_receivers = 18
    user_not_exist = 19
    x_error = 20
    others = 21.
    THANKS
    MRUTYUN

Maybe you are looking for

  • Saving OLB on database

    Hi all I need to save and then load my object library on database. When I try it, it doesn't give any error but doesn't work; when I click on recovery list's button, it says this error: ROS ERROR: ORACLE DATABASE ERROR-942. I am using forms 6i on ora

  • Selecting just text fields throughout the entire document when editing forms in Acrobat Pro XI

    I edit PDF's all day and it is seriously time consuming to edit the properties of text fields when you can only select a few at a time due to other elements (checkboxes, radio buttons etc.) prohibiting you from simply "Selecting All" elements and edi

  • B.T phone socket. Not fixed properly in my new fla...

    Hi, I just moved out for the first time into a brand new flat and nearing the end of my snagging list. And my B.T socket which I think it is the master one with openreach and the B.T logo written on it, one corner of the socket is protruding from th

  • App Store on my iPad 2 has stopped working,

    Hi Yesterday "Featured" and "Top Charts" in the App Store on my iPad 2 has stopped working just a blank screen, the rest are fine ???, ATB HiPad2

  • How to restore  entire system with time machine

    I downloaded an anti-virus program and decided to zap it.  Removed all files in my Download Folder, and also in Applications. I still have some items I can't locate to delete; such as an icon in tool-bar and annoying dialog boxes telling me "no cooki