Template and ABAP code

Hi ppl,
I am a bit confused.If i have to make some field to only 'display'(so that the user has no choice to edit),how can i do it?
-Who provides these templates??These templates that we publish are written in ABAP,right?
-Can we create our own templates and publish??
**When they say,change the template or change the ABAP code..what does it mean?Because to check the templates we goto SE80 and to change the code/add a field/edit a field--we go to SE11.Please let me know the link between SE11 and SE80 or the difference.
Many Thanks
Sam

Sam,
Before changing a template please go through following,it may resolve your issue -
In this BAdI you can change the screen variant that controls the display of the item overviews and search results. As default, the following screen variants are called up:
· Item data overview in the invoice without purchase order reference: Screen variant BBP_IV_NON_PO
Method GET_SCREENVARIANT_INV
· Item data overview in the invoice with purchase order reference: Screen variant BBP_IV
Method GET_SCREENVARIANT_INV
· Item data overview in the confirmation: Screen variant BBP_CF
Method GET_SCREENVARIANT_CONF
· Item data overview in the confirmation for time recording: Screen variant BBP_CF_TIMEREC
Method GET_SCREENVARIANT_CONF
· Item data overview in the purchase order: Screen variant BBP_PO
Method GET_SCREENVARIANT_PO
· Item overview for contracts: Screen variant BBP_CTR_ITEMLIST
Method GET_SCREENVARIANT_CTR
· Item overview for contract selection: Screen variant BBP_CTR_ITEM_SELLIST
Method GET_SCREENVARIANT_CTR
· Search results for creating an invoice and/or confirmation: Screen variant BBP_SEARCH_PO
Method GET_SCREENVARIANT_SEARCH
· Search results for creating a purchase order: Screen variant BBP_SEARCH_SC
Method GET_SCREENVARIANT_SEARCH
· Search results for displaying/changing an invoice: Screen variant BBP_CHANGE_IV
Method GET_SCREENVARIANT_SEARCH
· Search results for displaying/changing a confirmation: Screen variant BBP_CHANGE_CF
Method GET_SCREENVARIANT_SEARCH
· Item overview for creating/displaying/processing/status of a shopping cart: Screen variant BBP_SC
Method GET_SCREENVARIANT_SC
· Worklist for Sourcing: Screen variant BBP_SOCO_WL
Method GET_SCREENVARIANT_SOCO
· Work area in Sourcing: Screen variant BBP_SOCO_GA
Method GET_SCREENVARIANT_SOCO
Activities
If you wish to hide or show fields, proceed as follows: 
1. Determine the screen variant, for example, BBP_IV, using the list above.
2. Copy this screen variant, for example, in ZZ_BBP_IV_1, in Transaction SHD0.
3. Change the new screen variant as required. Note that you can only change the display properties for fields of table controls. You can switch the display on and off (column Invisible in Transaction SHD0). You can recognize the fields of a table control because they have a 1 on the right side of the first column. In addition, the heading for this area contains (Table CTRL.
4. Implement the appropriate method (see the list above). Fill the export parameter EV_SCVARIANT with the new screen variant.
You can create multiple screen variants for a screen and then select these in the BAdI depending on the user or on other criteria.
Thanks and Warm Regards.
Pras

Similar Messages

  • Working with Templates and Automatic Code Changes

    I am working in DW CS6.
    I am creating a new page based on a template and when DW creates the new page, it is automatically changing the paths to the links to .css and .js files.  These changes are breaking the template.  Is there a way to keep the auto-changes from occurring?
    BTW - All the pages were created with a different template and I was able to modify the pages and apply this template to those pages without a problem.  All is beautiful. 
    Original Code in the Template:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <!-- TemplateBeginEditable name="doctitle" -->
    <title>Information Technology (IT):  (DADS)</title>
    <!-- TemplateEndEditable -->
    <link href="../assets/coo.css" rel="stylesheet" type="text/css" media="screen" />
    <link href="../assets/sform.css" rel="stylesheet" type="text/css" media="screen" />
    <script type="text/javascript" language="javascript" src="../assets/jquery-1-fontresizer.js"></script>
    <script src="../assets/jquery-fontresizer.js" type="text/javascript"></script>
    <script type="text/javascript" src="../p7epm/p7EPMscripts.js"></script>
    <link href="../p7tmm/p7TMM02.css" rel="stylesheet" type="text/css" media="all" />
    <script type="text/javascript" src="../p7tmm/p7TMMscripts.js"></script>
    <link href="../p7epm/epm52/p7EPM52p2.css" rel="stylesheet" type="text/css" media="all" />
    Code once I create a page using the template:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/index_wao.dwt" codeOutsideHTMLIsLocked="false" -->
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <!-- InstanceBeginEditable name="doctitle" -->
    <title>Information Technology (IT):  (DADS)</title>
    <!-- InstanceEndEditable -->
    <link href="file://ausimo225/devDADSView/coo/ITnew/assets/coo.css" rel="stylesheet" type="text/css" media="screen" />
    <link href="file://ausimo225/devDADSView/coo/ITnew/assets/sform.css" rel="stylesheet" type="text/css" media="screen" />
    <script type="text/javascript" language="javascript" src="file://ausimo225/devDADSView/coo/ITnew/assets/jquery-1-fontresizer.js"></script>
    <script src="file://ausimo225/devDADSView/coo/ITnew/assets/jquery-fontresizer.js" type="text/javascript"></script>
    <script type="text/javascript" src="file://ausimo225/devDADSView/coo/ITnew/p7epm/p7EPMscripts.js"></script>
    <link href="file://ausimo225/devDADSView/coo/ITnew/p7tmm/p7TMM02.css" rel="stylesheet" type="text/css" media="all" />
    <script type="text/javascript" src="file://ausimo225/devDADSView/coo/ITnew/p7tmm/p7TMMscripts.js"></script>
    <link href="file://ausimo225/devDADSView/coo/ITnew/p7epm/epm52/p7EPM52p2.css" rel="stylesheet" type="text/css" media="all" />

    Always set site links to "Document" unless you NEED "Site Root". If you don't know whether you need them, then you don't need them. When you understand that you need them and why you need them, then you can use "Site Root"!
    Good advice.
    N

  • Link BOR Event with ABAP code (program or function)!

    Hello experts,
    I am trying to link program or function to bor event. Change of data in HR IT0002 trigger event CHANGE of PERSDATA Object. I need to execute some ABAP code (program or function) on CHANGE event, so I have to link event and ABAP code.
    Question: is it possible and how?

    Hi,
    It is very much possible....
    You can use the Workflow & use BO as PERSDATA & this workflow can be triggered on event change.
    & You can write your code ...
    Regards,
    Rahul

  • Sample ABAP code for userexits, and calling bapi's

    Hi,
    Can someone please send me sample ABAP code
    1) to do extractor enhancement using user exit.
    2) ABAP program to call BAPI to read live cache order series data in SNP and write to Idocs through some ports.
    3) ABAP routine to generate file name (based on date/country)in the infopackage to upload flatfiles.
    Thank you very much in advance and appreciate any help.
    Regards
    Prasad

    hai ,
    check this code...
    *& Tables
    tables : tstc,     "SAP Transaction Codes
             tadir,    "Directory of Repository Objects
             modsapt,  "SAP Enhancements - Short Texts
             modact,   "Modifications
             trdir,    "System table TRDIR
             tfdir,    "Function Module
             enlfdir,  "Additional Attributes for Function Modules
             tstct.    "Transaction Code Texts
    *& Variables
    data : jtab like tadir occurs 0 with header line.
    data : field1(30).
    data : v_devclass like tadir-devclass.
    *& Selection Screen Parameters
    selection-screen begin of block a01 with frame title text-001.
    selection-screen skip.
    parameters : p_tcode like tstc-tcode obligatory.
    selection-screen skip.
    selection-screen end of block a01.
    *& Start of main program
    start-of-selection.
    Validate Transaction Code
      select single * from tstc
        where tcode eq p_tcode.
    Find Repository Objects for transaction code
      if sy-subrc eq 0.
        select single * from tadir
           where pgmid    = 'R3TR'
             and object   = 'PROG'
             and obj_name = tstc-pgmna.
        move : tadir-devclass to v_devclass.
        if sy-subrc ne 0.
          select single * from trdir
             where name = tstc-pgmna.
          if trdir-subc eq 'F'.
            select single * from tfdir
              where pname = tstc-pgmna.
            select single * from enlfdir
              where funcname = tfdir-funcname.
            select single * from tadir
              where pgmid    = 'R3TR'
                and object   = 'FUGR'
                and obj_name = enlfdir-area.
            move : tadir-devclass to v_devclass.
          endif.
        endif.
    Find SAP Modifactions
        select * from tadir
          into table jtab
          where pgmid    = 'R3TR'
            and object   = 'SMOD'
            and devclass = v_devclass.
        select single * from tstct
          where sprsl eq sy-langu
            and tcode eq p_tcode.
        format color col_positive intensified off.
        write:/(19) 'Transaction Code - ',
        20(20) p_tcode,
        45(50) tstct-ttext.
        skip.
        if not jtab[] is initial.
          write:/(95) sy-uline.
          format color col_heading intensified on.
          write:/1 sy-vline,
          2 'Exit Name',
          21 sy-vline ,
          22 'Description',
          95 sy-vline.
          write:/(95) sy-uline.
          loop at jtab.
            select single * from modsapt
            where sprsl = sy-langu and
            name = jtab-obj_name.
            format color col_normal intensified off.
            write:/1 sy-vline,
            2 jtab-obj_name hotspot on,
            21 sy-vline ,
            22 modsapt-modtext,
            95 sy-vline.
          endloop.
          write:/(95) sy-uline.
          describe table jtab.
          skip.
          format color col_total intensified on.
          write:/ 'No of Exits:' , sy-tfill.
        else.
          format color col_negative intensified on.
          write:/(95) 'No User Exit exists'.
        endif.
      else.
        format color col_negative intensified on.
        write:/(95) 'Transaction Code Does Not Exist'.
      endif.
    Take the user to SMOD for the Exit that was selected.
    at line-selection.
      get cursor field field1.
      check field1(4) eq 'JTAB'.
      set parameter id 'MON' field sy-lisel+1(10).
      call transaction 'SMOD' and skip first screen.

  • Difference between checking Objects in SU24 and in ABAP code

    Hi all,
    What is the difference between objects checked in SU24 and the objects checked in ABAP Code.
    I think if objects are even checked to No in SU24 and they are in ABAP code then user is able is able to execute that object, is this correct?
    and vice versa, if objects are checked to yes in su24 and not in the ABAP code then user wont be able to excute? is this correct
    or what is the purpose of maintaing objects both in SU24 and in ABAP Code.
    Thanks,
    Sun

    This is what is known in German as a "Schwerer Geburt"... (not sure whether there is an English term which has the same meaning)...
    When you searched, did you read this thread?:
    F110 - S_BTCH_ADM
    >
    Julius Bussche wrote:
    > My understanding of this confusion is ...
    >
    > ... SAP's development systems deem an "unknown" check to be successfull until specifiied for a check (this is different in customer systems - which leads many to believe that adding and removing check indicators from SU24 will add and remove authority-checks....),
    >
    > ...This problem then reproduces itself both in SU53 and ST01 once the SU22 / SU24 error has been made.
    >
    > ...It is one of those things which you need to know or find on your own (not too difficult), otherwise you simple don't know it.
    It is context specific, when the context is known to the customer system where the code is running => You cannot activate a check in SU24 if it is not coded anywhere (please distingish between starting a transaction, using it, and navigating further from that transaction...). The only case where SAP does what you seem to be assuming (or hoping for...) is infact to turn an authority-check off in some cases or to make the calling context known when it is remote (in which case sy-tcode or the entry point context is not known)...
    *It is not to turn the check on when it is not coded anywhere!!!
    Perhaps you would like to phrase your final question just one more time.
    Cheers,
    Julius

  • How to Use CMOD and SMOD in SAP using ABAP Code

    Hello anyone,
      Please help me How to use CMOD and SMOD in SAP using ABAP code.
    Give Me Some Sample Example.
    Mail ID: [email protected]
    Thanks,
    Regards,
    S.Muthu,
    SAP Developer.

    Hi,
    User Exits.
    http://www.erpgenie.com/sap/abap/code/abap26.htm
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sapgenie.com/abap/code/abap26.htm
    http://www.sap-img.com/abap/what-is-user-exits.htm
    http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction
    http://www.easymarketplace.de/userexit.php
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sappoint.com/abap/userexit.pdfUser-Exit
    customer exits
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f1a7e790-0201-0010-0a8d-f08a4662562d
    Menu Exit.
    http://www.sappoint.com/abap/spmp.pdf
    http://www.sappoint.com/abap/userexit.pdf
    http://www.sapdevelopment.co.uk/enhance/mod_sapmenu.htm
    http://www.sapdevelopment.co.uk/enhance/enhancehome.htm
    USER EXIT
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sapgenie.com/abap/code/abap26.htm
    http://www.sap-img.com/abap/what-is-user-exits.htm
    http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction
    http://www.easymarketplace.de/userexit.php
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sappoint.com/abap/userexit.pdfUser-Exit
    http://www.sap-img.com/ab038.htm
    http://help.sap.com/saphelp_46c/helpdata/en/64/72369adc56d11195100060b03c6b76/frameset.htm
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sap-img.com/abap/what-is-user-exits.htm
    http://expertanswercenter.techtarget.com/eac/knowledgebaseAnswer/0,295199,sid63_gci982756,00.html

  • Sequence of ABAP code and events.

    Hello,
      Please tell me the proper sequence of writing ABAP code.
    (Event execution sequence and code writing sequence.)
    - which event should follow which event?
    - which code should be written where?
    - Sequence of Includes (e.g. TOP, PBO, PAI, Subroutine,etc.)
    Regards,
    Sharayu.

    Sequence of Includes:
    TOp Include  (All data declarations/Selection screen declared here)
    Form Include ( All subroutines are placed inside it)
    For a Screen
    PBO
    PAI
    Load of program:When the program is executed
    INITIALIZATION: Fill the default values into the fields or we can assign values to the fields in this event. It triggers first.
    AT SELECTION-SCREEN: It is commonly used for validations like ON-REQUEST ( for search help) , OUTPUT ( modify screens ).
    TOP-OF-PAGE: Header of the report or any data to print on top of the page in list.
    END-OF-PAGE: Footer details like page no: / total no: of pages.
    START-OF-SELECTION: For processing ur code selects, loops, FM'S and all.
    END-OF-SELECTION: Output formating. It is not required to write normally but in some special conditions like to print after the START-OF-SELECTION event.

  • Need case studies and sample code for all concept of ABAP

    Hello,
           Can anybody provide me the case studies and sample code for learning different concepts in ABAP programming like: module pool, ALV, interactive reports, BDC, Smart Form etc.? As I want to do some practical application by which i can learn more.
    Thanks & Regards,
    Vikram Rawal

    In this link You can find Step by Step Scren Shot document :
    http://www.201interviewquestions.com/docs/User%20exits.ppt
    http://erpgenie.com/abaptips/component/option,com_docman/task,doc_details/gid,27/
    <b>
    Reprots</b>
    http://www.sapgenie.com/abap/reports.htm
    http://www.allsaplinks.com/material.html
    http://www.sapdevelopment.co.uk/reporting/reportinghome.htm
    http://www.sapfans.com/forums/viewtopic.php?t=58286
    http://www.sapfans.com/forums/viewtopic.php?t=76490
    http://www.sapfans.com/forums/viewtopic.php?t=20591
    http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
    <b>Dictionary</b>
    http://sapabap.iespana.es/sapabap/manuales/learnabap/
    http://help.sap.com/saphelp_nw2004s/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb6e446011d189700000e8322d00/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ea31446011d189700000e8322d00/frameset.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCDWBDIC/BCDWBDIC.pdf
    <b>ABAP objects</b>
    Please check this online document (starting page 1291).
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf
    Also check this links as well.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    http://www.sapgenie.com/abap/OO/
    http://www.futureobjects.de/content/intro_oo_e.html
    http://www.sap-img.com/abap/business-add-in-you-need-to-understand-abap-oo-interface-concept.htm
    /people/ravikumar.allampallam/blog/2005/02/11/abap-oo-in-action
    <b>
    SAPScripts</b>
    http://esnips.com/doc/1ff9f8e8-0a4c-42a7-8819-6e3ff9e7ab44/sapscripts.pdf
    http://esnips.com/doc/1e487f0c-8009-4ae1-9f9c-c07bd953dbfa/script-command.pdf
    http://esnips.com/doc/64d4eccb-e09b-48e1-9be9-e2818d73f074/faqss.pdf
    http://esnips.com/doc/cb7e39b4-3161-437f-bfc6-21e6a50e1b39/sscript.pdf
    http://esnips.com/doc/fced4d36-ba52-4df9-ab35-b3d194830bbf/symbols-in-scripts.pdf
    http://esnips.com/doc/b57e8989-ccf0-40d0-8992-8183be831030/sapscript-how-to-calculate-totals-and-subtotals.htm
    SAP SCRIPT FIELDS
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/d1/8033ea454211d189710000e8322d00/content.htm
    scripts easy material
    http://www.allsaplinks.com/sap_script_made_easy.html
    Check these step-by-step links
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/ccab6730-0501-0010-ee84-de050a6cc287
    https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/8fd773b3-0301-0010-eabe-82149bcc292e
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/3c5d9ae3-0501-0010-0090-bdfb2d458985
    <b>Smartforms material</b>
    http://www.sap-basis-abap.com/sapsf001.htm
    http://www.sap-press.com/downloads/h955_preview.pdf
    http://www.ossincorp.com/Black_Box/Black_Box_2.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://www.sap-img.com/smartforms/smartform-tutorial.htm
    http://www.sapgenie.com/abap/smartforms.htm
    How to trace smartform
    http://help.sap.com/saphelp_47x200/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
    http://www.help.sap.com/bp_presmartformsv1500/DOCU/OVIEW_EN.PDF
    http://www.sap-img.com/smartforms/smart-006.htm
    http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
    Re: Need FAQ's
    check most imp link
    http://www.sapbrain.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html
    step by step good ex link is....
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    <b>
    BAPI</b>
    http://help.sap.com/saphelp_46c/helpdata/en/9b/417f07ee2211d1ad14080009b0fb56/frameset.htm
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
    Checkout !!
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
    http://techrepublic.com.com/5100-6329-1051160.html#
    http://www.sap-img.com/bapi.htm
    http://www.sap-img.com/abap/bapi-conventions.htm
    http://www.sappoint.com/abap/bapiintro.pdf
    http://www.sapgenie.com/abap/bapi/example.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf
    <b>List of all BAPIs</b>
    http://www.planetsap.com/LIST_ALL_BAPIs.htm
    http://www.sappoint.com/abap/bapiintro.pdf
    http://www.sappoint.com/abap/bapiprg.pdf
    http://www.sappoint.com/abap/bapiactx.pdf
    http://www.sappoint.com/abap/bapilst.pdf
    http://www.sappoint.com/abap/bapiexer.pdf
    http://service.sap.com/ale
    http://service.sap.com/bapi
    http://www.planetsap.com/Bapi_main_page.htm
    http://www.topxml.com/sap/sap_idoc_xml.asp
    http://www.sapdevelopment.co.uk/
    http://www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf
    <b>ALV programs.</b>
    http://www.geocities.com/mpioud/Abap_programs.html
    . How do I program double click in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=11601
    http://www.sapfans.com/forums/viewtopic.php?t=23010
    How can I use ALV for reports that are going to be run in background?
    http://www.sapfans.com/forums/viewtopic.php?t=83243
    http://www.sapfans.com/forums/viewtopic.php?t=19224
    <b>ALV</b>
    http://www.sapfans.com/forums/viewtopic.php?t=58286
    http://www.sapfans.com/forums/viewtopic.php?t=76490
    http://www.sapfans.com/forums/viewtopic.php?t=20591
    http://www.sapfans.com/forums/viewtopic.php?t=66305 - http://www.sapgenie.com/abap/reports.htm
    http://www.allsaplinks.com/material.html
    http://www.sapdevelopment.co.uk/reporting/reportinghome.htm
    <b>Top-of-page in ALV</b>
    selection-screen and top-of-page in ALV
    <b>ALV Group Heading</b>
    http://www.sap-img.com/fu037.htm
    <b>ALV</b>
    http://www.geocities.com/mpioud/Abap_programs.html
    <b>
    RFC Destination</b>
    Re: SM59
    <b>
    ALE/ IDOC</b>http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.sappoint.com/abap/ale.pdf
    http://www.sappoint.com/abap/ale2.pdf
    http://www.sapgenie.com/sapedi/idoc_abap.htm
    http://www.allsaplinks.com/idoc_sample.html
    http://www.sappoint.com/abap.html
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.allsaplinks.com/idoc_sample.html
    <b>Table Control</b>
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/table%20control%20in%20abap.pdf
    <b>
    ABAP transactions</b>
    http://www.easymarketplace.de/transactions-a-e.php?Area=4soi&name=volker&pw=vg&
    Regards,
    Priyanka.

  • Hiding and unhiding of Abap code

    hi friends
    can u please help me in hiding and unhiding of abap code(both hiding and unhiding are required)
    Regards
    Hemanth

    Hi,
    Please check this thread for hiding abap code....
    http://www.sap-img.com/abap/program-to-hide-abap-source-code-and-protects-it.htm
    Regards
    Guru

  • Can not see ABAP code of programs and FM using SE37, SE38, SE80

    Hi, all!
    When I try to open ABAP-code using transactions SE37, SE38, SE80, they don't display it. Instead it current mode hangs, but I can open another one.
    System ECC 6.0, SAP_ABA package SAPKA70021, GUI Patch 17.
    I have 2 laptops, one of them works with these transaction properly, another gives described problem. Other my colleagues don't have such problems.
    Can anybody help me to solve this problem?
    BR,
    Boris

    hi friend,
    I had the same problem the problem than you, the problem isn´t the gui, the probelm is the msxml parser .
    Follow the next sollution and you will solve your problem.
    http://scn.sap.com/thread/1853701
    My original problem was the "SAP signature theme" was black and with a lot of problems, changing to "Enjoy theme" everything appear works perfecly, but when I tryed to display any source code the screen was thinking without end.
    The problem is solved uninstalling any SAP software from your machine also msxml program from SAP and reinstalling first msxml 4.0 and msxml 6.0 after shut down install sap logon behind, when ended everything will work again.
    This my actual version and it works.
    kind regards,
    Miguel Angel Orihuela

  • Need Dropdownbykey and Index code completely in webdynpro ABAP

    Hi Experts,
    I want to populate the data into drop down by key and drop down by indexes ,but I am getting error while binding in DdbIndex property text as type compatible If any one knows  send me the complete code to populate values into Ddbkey and  Index .
    Regards,
    Satya.

    hi Satya,
    May i know the exact error you are getting.Anyhow use the below code for DDBK.
    For displaying static values in DDBK there are two techniques
    1)  by directly binding with dataelement
    2) with hardcoding
    1)Bind an attribute to SELECTED KEY property of DDBK  . And attribute should be type of DATA ELEMENT.
    That Dataelement should contain fixed values in corresponding domain,   then automatically all those fixed values wil be displayed in DDBK
    2) with hardcoding
    creat a node and an attribute with string data type and assign that attribute to selected key property of DDBK / RGBK / inputfield
    goto wddoinit() and implement code like below
    data: lt_valueset type  wdr_context_attr_value_list,
    ls_value type wdr_context_attr_value.
    data:
    node_info type ref to if_wd_context_node_info.
    node_info = wd_context->get_node_info( ).
    node_info = node_info->get_child_node( ' DDBK Node' ).    '' this should be in capital letters
    ls_value_value = 'value1''
    ls_value_text = 'text1'.
    insert ks_value into table lt_valueset.
    ls_value_value = 'value2''
    ls_value_text = 'text2'.
    insert ks_value into table lt_valueset.
    like above you can pass as many values as you want
    node_info->set_attribute_value_set( name = 'DDBK ATTRIBUTE NAME''
    value_set = lt_valueset ).
    Hope above code will be useful.
    Regards
    Srinivas

  • Templates in ABAP

    Hi,
    I want a brief introduction to templates in ABAP.
    I need to write a template which shall generate dynamic code. I am very new to this template concept in ABAP. Could some one please provide me good documents on how to write a template in ABAP or/and provide a simple sample program?
    Regards,
    Ravi

    following is a template for example:
    @--Template for generating CDS_READ_SERVICE--
    *@ DATA: LT_SEGM         TYPE SMMW_CDS_SEGM_TTYP.
    *@ DATA: LT_MAPP         TYPE SMMW_CDS_MAPP_TTYP.
    *@ DATA: WA_SEGM         TYPE SMMW_CDS_SEGM.
    *@ DATA: WA_MAPP         TYPE SMMW_CDS_MAPP.
    *@ DATA: LS_HDR          TYPE MSB_HEADER.
    *@ DATA: LS_MBOINFO      TYPE SMMW_CDS_MBO_INFO.
    *@ DATA: META_OBJ        TYPE SMMW_GUID.
    *@ DATA: msg_strname(40) TYPE C.
    *@ DATA: memodblbin(40)  TYPE C,
    *@       memodbltxt(40)  TYPE C.
    *@ META_OBJ = I_META_OBJECT(32).
    @ get MBO structure,version and sw component name
    *@  CALL FUNCTION 'MSB_GET_MBO_HEADER_INFO'
    *@    EXPORTING
    *@      IM_MBO_VERSION_ID        = META_OBJ
    *@    IMPORTING
    *@      EX_MBO_HEADER            = LS_HDR
    *@    EXCEPTIONS
    *@      MISSING_IMPORT_PARAMETER = 1
    *@      NO_SUCH_MBO              = 2
    *@      MORE_THAN_ONE_MBO        = 3
    *@      OTHERS                   = 4
    *@  IF SY-SUBRC <> 0.
    *@    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *@         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *@  ENDIF.
    @ get MBO information by calling API SMMW_CDS_GET_MBODATA
    *@  CALL FUNCTION 'MMW_CDS_GET_MBODATA'
    *@    EXPORTING
    *@      I_MBO_TRANS                = META_OBJ
    *@    IMPORTING
    *@      SEGM_TAB                   = LT_SEGM
    *@      MAPP_TAB                   = LT_MAPP
    *@      MBO_INFO                   = LS_MBOINFO
    *@    EXCEPTIONS
    *@      MBO_ID_IS_INITIAL          = 1
    *@      PARENT_SEGMENT_NOT_FOUND   = 2
    *@      OTHERS                     = 3
    *@  IF SY-SUBRC <> 0.
    *@    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *@         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *@  ENDIF.
    *@  msg_strname = LS_MBOINFO-MESGSTR_NAME.
    *@  memodblbin  = LS_MBOINFO-BMEMTABLE_NAME.
    *@  memodbltxt  = LS_MBOINFO-TMEMTABLE_NAME.
                       CDS READ SERVICE
       This method has been generated
       Never change it manually, please!!
       Transaction:  \LS_HDR-NAME\
       Template   :  \I_TEMPLATE\
       GenKey     : CDS_READ_SERVICE
       Generated on \SY-DATUM\ \SY-UZEIT\
                 by \SY-UNAME\
    CONSTANTS: LC_INSERT VALUE 'I',
                LC_UPDATE VALUE 'U',
                LC_DELETE VALUE 'D'.
    DATA: LT_OBJ_LIST          TYPE  EXTRACTKEY_TT.
    DATA: WA_OBJ_LIST          TYPE  SMMW_EXTRACTKEY.
    DATA: LV_COUNT             TYPE  INT4.
    DATA: RECORDS_NOT_FOUND    TYPE  BOOL VALUE ' '.
    CONSTANTS: lv_sendbits(32) TYPE x VALUE
    'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF'.
    *@  IF LS_HDR IS NOT INITIAL.
      DATA: MBO_STR TYPE \msg_strname\.
    *@   IF LT_SEGM IS NOT INITIAL.
    *@    LOOP AT LT_SEGM INTO WA_SEGM.
    declaring tables and workareas for segment : \WA_SEGM-SEGM_NAME\
      DATA: LT_T\WA_SEGM-TABLENAME\  TYPE TABLE OF \WA_SEGM-TABLENAME\.
      DATA: WA_T\WA_SEGM-TABLENAME\  TYPE          \WA_SEGM-TABLENAME\.
      DATA: WA_S\WA_SEGM-GEN_NUM\  TYPE          \WA_SEGM-SEGM_STR\.
    *@    ENDLOOP.
    copy the extract key table to a local internal table.
      LT_OBJ_LIST[] = OBJ_LIST[].
      IF LT_OBJ_LIST IS INITIAL.
    *...handle log here........
        EXIT.
      ELSE.
    sort the table to delete adjacent duplicate entries
        SORT LT_OBJ_LIST BY EXTRACTKEY.
    delete the duplicate entries from the table before processing
        DELETE ADJACENT DUPLICATES
          FROM LT_OBJ_LIST
          COMPARING EXTRACTKEY.
        DESCRIBE TABLE LT_OBJ_LIST LINES LV_COUNT.
        IF task EQ LC_DELETE OR task EQ LC_UPDATE.
          IF LV_COUNT GT 1.
    *.....bulk message is only for task 'I' not for task 'U' or 'D'.
    *.....Hadle log here.....
            OBJ_MISS[] = LT_OBJ_LIST[].
            EXIT.
          ENDIF.
        ENDIF.
        IF TASK EQ LC_DELETE.
    prepare MBO message for the Extract keys whose task is DELETE
    *@    LOOP AT LT_SEGM INTO WA_SEGM WHERE HIERARCHY EQ 1.
    @   if the segment is root segment only.
          LOOP AT LT_OBJ_LIST INTO WA_OBJ_LIST.
             WA_S\WA_SEGM-GEN_NUM\-TASK = TASK.
             WA_S\WA_SEGM-GEN_NUM\-\WA_SEGM-KEYFIELD\ =
               WA_OBJ_LIST-EXTRACTKEY.
             WA_S\WA_SEGM-GEN_NUM\-EXTRACTKEY =
               WA_OBJ_LIST-EXTRACTKEY.
             APPEND WA_S\WA_SEGM-GEN_NUM\ TO MBO_STR-\WA_SEGM-SEGM_NAME\.
          ENDLOOP.
    *@    ENDLOOP.
    task is not 'D'.
        ELSE.
    *@    SORT LT_SEGM BY HIERARCHY.
    *@    LOOP AT LT_SEGM INTO WA_SEGM.
    select statement to fill segment: \WA_SEGM-SEGM_NAME\
    *@     IF WA_SEGM-HIERARCHY NE 1.
         IF RECORDS_NOT_FOUND IS INITIAL.
    *@     ELSE.
           DESCRIBE TABLE LT_OBJ_LIST LINES LV_COUNT.
    *@     ENDIF.
           SELECT * INTO TABLE LT_T\WA_SEGM-TABLENAME\
           FROM \WA_SEGM-TABLENAME\
           FOR ALL ENTRIES IN LT_OBJ_LIST
    @    For root segment compare extractkey with synckey
    *@     IF WA_SEGM-HIERARCHY = 1.
           WHERE \WA_SEGM-KEYFIELD\ = LT_OBJ_LIST-EXTRACTKEY.
    @    For other than root segments compare extractkey with
    @    extractkey only.
    *@     ELSE.
           WHERE EXTRACTKEY = LT_OBJ_LIST-EXTRACTKEY.
    *@     ENDIF.
    *@     IF WA_SEGM-HIERARCHY = 1.
           IF SY-SUBRC <> 0.
       all the extractkeys are invalid hence send all to OBJ_MISS.
             OBJ_MISS[] = LT_OBJ_LIST[].
             RECORDS_NOT_FOUND = 'X'.
           ELSEIF LV_COUNT NE SY-DBCNT.
       Not all the keys are invalid.atleast one key is invalid.
    *@     LOOP AT LT_MAPP INTO WA_MAPP
    *@       WHERE SEGM_NAME = WA_SEGM-SEGM_NAME AND IS_SYNCKEY EQ 'X'.
              LOOP AT LT_OBJ_LIST INTO WA_OBJ_LIST.
               READ TABLE LT_T\WA_SEGM-TABLENAME\
               WITH KEY \WA_MAPP-SFLD_NAME\ = WA_OBJ_LIST-EXTRACTKEY
               TRANSPORTING NO FIELDS.
    *@     ENDLOOP.
               IF SY-SUBRC <> 0.
                APPEND WA_OBJ_LIST TO OBJ_MISS.
               ENDIF.
             ENDLOOP.
           ENDIF.
    *@     ENDIF.
       process all the records to set the value for task field.
           IF LT_T\WA_SEGM-TABLENAME\ IS NOT INITIAL.
             IF task EQ LC_UPDATE.
               WA_S\WA_SEGM-GEN_NUM\-SENDBITS = lv_sendbits.
             ENDIF.
             WA_S\WA_SEGM-GEN_NUM\-TASK = TASK.
             LOOP AT LT_T\WA_SEGM-TABLENAME\ INTO WA_T\WA_SEGM-TABLENAME\.
              move-corresponding WA_T\WA_SEGM-TABLENAME\
                 to WA_S\WA_SEGM-GEN_NUM\.
    *@       LOOP AT LT_MAPP INTO WA_MAPP
    *@         WHERE SEGM_NAME = WA_SEGM-SEGM_NAME AND IS_MEMO NE SPACE.
              IF wa_t\wa_segm-tablename\-\wa_mapp-sfld_name\ IS NOT INITIAL.
    *@        IF WA_MAPP-IS_MEMO EQ 'T'.
        select the text memo content from the db table
                SELECT SINGLE CONTENT
                FROM \memodbltxt\
                INTO WA_S\WA_SEGM-GEN_NUM\-\WA_MAPP-SFLD_NAME\
                WHERE tablename = '\WA_SEGM-TABLENAME\' AND
                   tablekey = WA_T\WA_SEGM-TABLENAME\-\WA_SEGM-KEYFIELD\ AND
                   tablefield = '\WA_MAPP-SFLD_NAME\'.
    *@        ELSEIF WA_MAPP-IS_MEMO EQ 'B'.
        select the binary memo content from the db table
                SELECT SINGLE CONTENT
                FROM \memodblbin\
                INTO WA_S\WA_SEGM-GEN_NUM\-\WA_MAPP-SFLD_NAME\
                WHERE tablename = '\WA_SEGM-TABLENAME\' AND
                   tablekey = WA_T\WA_SEGM-TABLENAME\-\WA_SEGM-KEYFIELD\ AND
                   tablefield = '\WA_MAPP-SFLD_NAME\'.
    *@        ENDIF.
              ENDIF.
    *@       ENDLOOP.
              APPEND WA_S\WA_SEGM-GEN_NUM\ TO MBO_STR-\WA_SEGM-SEGM_NAME\.
             ENDLOOP.
           ENDIF.   " table LT_T\WA_SEGM-TABLENAME\ not initial.
    *@     IF WA_SEGM-HIERARCHY NE 1.
          ENDIF.
    *@     ENDIF.
    *@    ENDLOOP.
        ENDIF.
      ENDIF.   " Object list not initial.
    *@    LOOP AT LT_SEGM INTO WA_SEGM WHERE HIERARCHY EQ 1.
      IF MBO_STR-\WA_SEGM-SEGM_NAME\ IS NOT INITIAL.
        MBO_MESSAGE = MBO_STR.
      Filling Header of the MBO message if it is not empty.
        DESCRIBE TABLE MBO_STR-\WA_SEGM-SEGM_NAME\ LINES LV_COUNT.
    *@    ENDLOOP.
        CALL FUNCTION 'SYSTEM_UUID_C_CREATE'
             IMPORTING
               uuid = MBO_COMM_HEADER-MESSAGE_ID.
        MBO_COMM_HEADER-SWCV_NAME    = '\LS_HDR-SWCV_NAME\'.
        MBO_COMM_HEADER-VERSION      = '\LS_HDR-VERSION\'.
        MBO_COMM_HEADER-MBO_NAME     = '\LS_HDR-NAME\'.
       GET TIME STAMP FIELD MBO_COMM_HEADER-SEND_TSTMP.
      This vale SEND_TSTMP filling involves some problem...
        MBO_COMM_HEADER-SEND_USR     = SY-UNAME.
        IF LV_COUNT EQ 1.
          MBO_COMM_HEADER-MESSAGE_TYPE = 'I'.
          READ TABLE OBJ_LIST INDEX 1 INTO WA_OBJ_LIST.
          IF SY-SUBRC = 0.
           MBO_COMM_HEADER-EXTRACT_KEY = WA_OBJ_LIST-EXTRACTKEY.
          ENDIF.
        ELSE.
          MBO_COMM_HEADER-MESSAGE_TYPE = 'B'.
        ENDIF.
      ENDIF.
    *@   ENDIF.
    *@  ENDIF.
    I dont understand the notation *@ here...
    Why is it used??
    Regards,
    Ravi

  • Trouble with SAPconnect / sending email in ABAP-code

    Hi,
    with the code below I try to send an email from ABAP outside
    to an mail-account in the internet.
    I'll get no error/exceptions but the mail will be not send
    to the internet-mail-account.
    In Transaktion SCOT I checked the SAPconnect-Node "INT"-"SMTP".
    There is a mailserver with the right IP und the right Port. So I don't understand
    what could be the problem!?
    Can anybody help me and say me why the code below doesn't works?
    Best wishes!
    * For API
    data: maildata type sodocchgi1.
    data: mailtxt  type table of solisti1 with header line.
    data: mailrec  type table of somlrec90 with header line.
    start-of-selection.
      clear:    maildata, mailtxt,  mailrec.
      refresh:  mailtxt, mailrec.
      maildata-obj_name = 'TEST'.
      maildata-obj_descr = 'Test'.
      maildata-obj_langu = sy-langu.
      mailtxt-line = 'This is a test'.
      append mailtxt.
      mailrec-receiver = '[email protected]'.
      mailrec-rec_type  = 'U'.
      append mailrec.
        call function 'SO_NEW_DOCUMENT_SEND_API1'
             exporting
                  document_data              = maildata
                  document_type              = 'RAW'
                  put_in_outbox              = 'X'
             tables
                  object_header              = mailtxt
                  object_content             = mailtxt
                  receivers                  = mailrec
             exceptions
                  too_many_receivers         = 1
                  document_not_sent          = 2
                  document_type_not_exist    = 3
                  operation_no_authorization = 4
                  parameter_error            = 5
                  x_error                    = 6
                  enqueue_error              = 7
                  others                     = 8.
        if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        endif.
    * Start the send process using the following statement
    submit rsconn01 with mode = 'int' and return.
    Message was edited by:
            sebastian eckes

    SAP is a robust system, which gives many facilities in the form of Function Modules (FMs) for connecting to external systems or for use within the system. With a clever use of these FMs we can achieve a lot of things through ABAP code.
    This article focuses on ways to send E-mails and SAP Mails using ABAP code.
    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.
    In the next article we will understand the main parameters and table interfaces of the FM.
    Import Parameters Name and Description     Field name     Field function
    Object_hd_change (structure) Contains the process to be done when SAP mail is marked for execution.When the Execute Icon in the SAP mail is clicked the corresponding object is executed     vmtyp     ‘D’ for dialog module ‘F’ for function module‘R’ for report‘T’ for transaction‘U’ for transaction with export
         Acnam     Name of the object which is to be executed, like name of transaction/report
         Skips     ‘X’ to execute first screen in background
         Objsns     Indicates sensitivity of the object. ‘P’ for private object‘F’ for functional object‘O’ for confidential object‘C’ for company confidential objectSensitivity level is restricted to ‘O’ for documents in shared folders
         Objla     Language of the document ‘E’ for Englishsy-langu for system language
         Objnam     Name of the document
         Objdes     Short description (Title) of the document
         Objsrt     Name of the sort field. This is used to group documents based on certain criteria
    Object_type Type of document to be sent with mail           ‘RAW’ for raw text (default) ‘DOC’ for word file ‘XLS’ for excel fileAll classes can be used except for folders (‘FOL’) and distribution lists (‘DLI’)
    Outbox_flag           ‘X’ to indicate that mail should also be stored in outbox of the user after sending (default ‘ ‘)
    Owner           Sap login of the user responsible for transmission
    Table Parameters Name and Description     Field Name     Field function
    Objcont Table to hold the body of the mail     Line     Text lines up to 255 characters
    Objhead Table to hold number of lines in the body of the mail, i.e size of the table in lines     Line     Text lines up to 255 characters
    Objpara Table to hold the set/get parameters to be transferred to the processing element     Name     Name of the parameter. Only first three characters are used
         Option     Not used
         Low     Value of the parameter in name
         High     Not used
    Objparb Table to hold information for mails to which a certain processing type is assigned. For a report or transaction with transfer of values to global memory, the table has to contain the parameters with relevant values. The memory id is taken from the first row. For a FM or dialog module, data in table will be transferred as table parameter msgdial     Name     For report or transaction with transfer of values to global memory, the field for first row should hold the name of the memory id used for export and the other rows should hold the parameter names. For FM or dialog module this field should hold the values as per the usage of the module
         Value     For report or transaction with transfer of values to global memory, the field for first row should remain empty and the other rows should hold values of the parameters. For FM or dialog module this field should hold the values as per the usage of the module
    Receivers Table to hold recipient details     Recnam     SAP login of the recipient. Append all the recipients to this table
         Sndcp     X for sending mail as a copy
         Sndex     X for sending as express document. This will prompt a logged on recipient saying that he or she has received an express mail
         Recesc     ‘B’ for SAP user ‘E’ for external email address‘U’ for unix address
    Export Parameters Name and Description     Field name     Field function
    Object_id_new Contains object id of document created during send process            
    Sent_to_all X indicates that document was sent to all recipients. Flag is not activated if sending fails in one or more cases           
    Main Exceptions Name and Description     Description
    Too_much_receivers      Number of recipients is greater than number for which sender is authorised to send
    Object_not_sent     Document was not delivered to any of the recipients
    Object_not_exist     Document class specified does not exist or cannot be sent
    Object_no_authorisation     Document could not be sent as one of the required authorisations does not exist
    Parameter_error     Invalid combination of parameter values transferred to FM
    X_error     Internal error occurred
    Once all the parameters and table interfaces are properly filled, call the function module to send the SAP mail to the recipient inbox.
    Care should be taken to report the status of execution of the function module to the user using one of the exceptions defined (refer function module pattern above)
    Though SAP mail is a very robust method of interacting with users within SAP system, it is always good to receive email in Microsoft inbox. This also works like an additional notification to users in case they do not check SAP mail regularly. The next article covers sending E-mails using ABAP.
    Sending Email to a non-SAP system:
    Though SAP mail is a very robust method of interacting with users within SAP system, it is always good to receive email in Microsoft inbox. This also works like an additional notification to users in case they do not check SAP mail regularly.
    Sending an email to the Microsoft Inbox is a way of interacting with a non SAP system through ABAP code and hence is very interesting. A fair knowledge of UNIX shell scripting is assumed here.
    The ABAP code to send an email to Microsoft inbox revolves around following UNIX script
    Echo "From:" "<"$1">" > <unix file path name>
    Echo "To:" "<"$2">" >> <unix file path name>
    Echo "Subject:" "<"$3">" >> <unix file path name>
    Cat $4 >> <unix file path name>
    Uuencode $5 $6 >> <unix file path name>
    Cat <unix file path name> | /usr/sbin/sendmail –f $fraddr $toaddr
    (Note : the commands in the above script can be case sensitive. Check the actual case on the unix installation in question)
    Let us understand the various parts of the above script.
    $1 = Sender email address
    $2 = Recipient email address
    $3 = Subject of the email
    $4 = Path of unix server file having email body
    Form email body as an internal table in ABAP program, download it to a unix server file
    $5 = Path of unix server file to be sent as email attachment
    $6 = Name to be given to the attachment (like test1.doc, test1.xls). The corresponding Microsoft icon
    will be shown in the email for the type of file attached ( Word document, excel document etc)
    The script builds a temporary file and pipes the file to the sendmail command to achieve the mission.
    This script can be invoked from SAP to send the mail to the intended recipient. Store this small script on the unix server. (Assume script name is sndmail )
    To do this we should define a link in the SAP system between a customized command and this unix script.
    The FM to define a customized command in SAP system has the following pattern.
    call function 'SXPG_CALL_SYSTEM'
    exporting
    commandname =
    PARAMETERS = ' '
    importing
    status =
    tables
    exec_protocol =
    exceptions
    no_permission = 1
    command_not_found = 2
    parameters_too_long = 3
    security_risk = 4
    wrong_check_call_interface = 5
    program_start_error = 6
    program_termination_error = 7
    x_error = 8
    parameter_expected = 9
    too_many_parameters = 10
    illegal_command = 11
    others = 12.
    In the next article we will understand the main parameters and table interfaces of the FM.
    Import Parameters Name and Description     Field name     Field function
    Commandname Name of unix shell script or command to be executed by SAP           Name of unix shell script to be invoked
    Parameters           The parameters to be sent to unix shell script ($1, $2 etc). Send parameters as a concatenated string separated by space and length not exceeding 128 characters For eg in UNIX environment the above shell script would be executed as Sndmail [email protected] [email protected] Trial /home/test.doc testmail.We will be simulating this command using the FM from SAP system
    Table Parameters Name and Description     Field Name     Field function
    Exec_protocol (structure) Table to get messages from unix server after shell script is executed     Length     Length of the message from external program i.e unix
         Message     Log message from external program i.e unix
    Export Parameters Name and Description     Field name     Field function
    Status Contains the status of execution of external program            Scheduling status of external program i.e unix
    Once the above FM is invoked with the necessary parameters the unix program sendmail will send a mail to the inbox of the recipient in Microsoft.
    The restriction on the parameter string length of 128 characters can be removed to make way for very long email addresses and subjects. Build the parameters into an internal table and download it as a file on the unix server. Instead of passing each parameter individually, pass the unix server path of this file as the parameter to the unix shell script (sndmail mentioned above). Modify the shell script to read every line of this parameter file as variables to be used in the shell script.
    In the next article we will see an example of the ABAP code you can use to send SAP Mails.
    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.
    REPORT ZTUNIXMAIL.
    DATA : TO_ADDRESS LIKE SY_LISEL,
    FROM_ADDRESS LIKE SY-LISEL,
    SUBJECT LIKE SY-LISEL,
    ATTACHMENT_NAME LIKE SY_LISEL,
    DATA_FILE_PATH LIKE SXPGCOLIST-PARAMETERS,
    BODY_FILE_PATH LIKE SXPGCOLIST-PARAMETERS.
    DATA : BEGIN OF INT_EMAIL_ATTACH OCCURS 0,
    TXTLINE CHAR(255),
    END OF INT_EMAIL_ATTACH.
    DATA : BEGIN OF INT_EMAIL_BODY OCCURS 0,
    TXTLINE CHAR(255),
    END OF INT_EMAIL_BODY.
    CLEAR : INT_EXEC_PROTOCOL,INT_EMAIL_ATTACH,INT_EMAIL_BODY.
    REFRESH : INT_EXEC_PROTOCOL,INT_EMAIL_ATTACH,INT_EMAIL_BODY.
    INT_EMAIL_ATTACH-TXTLINE = 'Put all attachment text in this table'.
    APPEND INT_EMAIL_ATTACH. CLEAR INT_EMAIL_ATTACH.
    INT_EMAIL_BODY-TXTLINE = 'Put all attachment text in this table'.
    APPEND INT_EMAIL_BODY. CLEAR INT_EMAIL_BODY.
    CONCATENATE TO_ADDRESS
    FROM_ADDRESS
    SUBJECT
    BODY_FILE_PATH
    DATA_FILE_PATH
    ATTACHMENT_NAME
    INTO V_PARAMETERS.
    IF NOT INT_EMAIL_ATTACH[] IS INITIAL.
    OPEN DATASET DATA_FILE_PATH FOR OUTPUT IN TEXT MODE.
    LOOP AT INT_EMAIL_ATTACH.
    TRANSFER INT_EMAIL_ATTACH-TXTLINE TO DATA_FILE_PATH.
    ENDLOOP.
    CLOSE DATASET DATA_FILE_PATH.
    ENDIF.
    IF NOT INT_EMAIL_BODY[] IS INITIAL.
    OPEN DATASET BODY_FILE_PATH FOR OUTPUT IN TEXT MODE.
    LOOP AT INT_EMAIL_BODY.
    TRANSFER INT_EMAIL_BODY-TXTLINE TO BODY_FILE_PATH.
    ENDLOOP.
    CLOSE DATASET BODY_FILE_PATH.
    ENDIF.
    CALL FUNCTION 'SXPG_CALL_SYSTEM'
    EXPORTING
    COMMANDNAME = 'Z_EMAIL' - Command calling unix script
    PARAMETERS = V_PARAMETERS
    importing
    status = ''
    TABLES
    EXEC_PROTOCOL = INT_EXEC_PROTOCOL
    EXCEPTIONS
    NO_PERMISSION = 1
    COMMAND_NOT_FOUND = 2
    PARAMETERS_TOO_LONG = 3
    SECURITY_RISK = 4
    WRONG_CHECK_CALL_INTERFACE = 5
    PROGRAM_START_ERROR = 6
    PROGRAM_TERMINATION_ERROR = 7
    X_ERROR = 8
    PARAMETER_EXPECTED = 9
    TOO_MANY_PARAMETERS = 10
    ILLEGAL_COMMAND = 11
    OTHERS = 12.
    regards,
    srinivas
    <b>*Reward points for useful answers*</b>

  • ABAP Code Date Selection for InfoPackage Scheduler

    Hello Group
    I need to automate the selection of valid condition records for an extraction that have a From and To date range.
    I noticed there is an option (Routine for time interval) to write ABAP code along with a template that is available in the InfoPackage.
    I think the logic for the selection would be any record
    Valid from       <= today
    Valid to           >= today
    Can anyone help with the ABAP code?
    The template is as follows:
    program conversion_routine.
    Type pools used by conversion program
    type-pools: rsarc, rsarr, rssm.
    tables: rsldpsel.
    Global code used by conversion rules
    $$ begin of global - insert your declaration only below this line  -
    TABLES: ...
    DATA:   ...
    $$ end of global - insert your declaration only before this line   -
    form compute_time_dependent_dates
      changing p_datefrom type d
               p_dateto   type d
               p_subrc like sy-subrc.
          Insert source code to current selection field
    $$ begin of routine - insert your code only below this line        -
              p_datefrom =
              p_dateto   =
              p_subrc = 0.
    $$ end of routine - insert your code only before this line         -
    endform.
    Thank You for your help!!
    Frank

    I resolved the problem . I have changed the order of read table l_t_range because I need the header .
    In the loop at datos I add the line l_t_range-iobjnm = 'ZXGE_UNO'.
    The problem wasn't the call RFC it was that I built l_t_range bad. I need the infoObject name.
    This is correct!!
    READ TABLE L_T_RANGE WITH KEY
             FIELDNAME = '/BIC/ZXGE_UNO'.
    LOOP AT DATOS.
          L_T_RANGE-FIELDNAME = '/BIC/ZXGE_UNO'.
          L_T_RANGE-IOBJNM = 'ZXGE_UNO'.
          L_T_RANGE-SIGN = 'I'.
          L_T_RANGE-OPTION = 'EQ'.
          CONCATENATE '00' DATOS-WA+3(4) INTO L_T_RANGE-LOW.
          APPEND L_T_RANGE.
        ENDLOOP.
    *READ TABLE L_T_RANGE WITH KEY+
    +*FIELDNAME = '/BIC/ZXGE_UNO'.+
    +*    L_IDX = SY-TABIX.+
    +*    MODIFY L_T_RANGE INDEX L_IDX
    Thanks a lot
    Ana

  • Do we have a ABAP code / program to delete all objects viz. InfoObjects etc

    I am working on a SAP BI7.0 implementation project and seek help on the following points -
    Do we have a ABAP code / program to delete all objects viz. InfoObjects, InfoProviders, Datasources, Infopackages, DTP, Transformations etc. in ONE shot
    Secondly, does anyone have a template created for capturing information on Transports created for release?
    Please do let me know.
    Thanks in advance,
    Venkat

    It may be hard to delete objects containing data.
    Try
    RSDG_CUBE_DELETE               Deleting InfoCubes
    RSDG_IOBC_DELETE               Deleting InfoCubes
    RSDG_IOBJ_DELETE               Deleting InfoObjects (without automatic transport connection !)
    RSDG_MPRO_DELETE               Deleting InfoCubes
    Also check :
    How to delete multiple InfoObjects in one shot?

Maybe you are looking for

  • Error 3259 unable to download and install 3.0

    At least 7 times this weekend on 2 different laptops both with XP, 3.0 loads completely, but then get an error box saying my connection timed out or there is connection problem. Bull! Everything's connected. 3G downloading AFAP. Have ESET antivirus w

  • Error with JNDI when creating new data source

    Hi : This weekend, while adding new applications to the production environment we ran into a problem where the JNDI tree of the new managed servers was unreachable. The error message we saw was: <1364066840022> <BEA-149231> <Unable to set the activat

  • Where is The "Home" Key in Logc

    I am new and fairly inorant, but very enthusiastic about logic, so please forgive this simpple question. Can some please tell me where is the "Home" key in logic? I would like to go back to 1 1 1 1 at any given time by utilizing this key. I am aware

  • How do you create a new mailbox folder on iPad?

    How do you create a new mailbox folder on iPad? step by step directions appreciated. Thanks for the help.

  • Does this system even have a search function? Also, is there a way to not show account name?

    Ugh, I just downloaded this yesterday, so I'm only really starting to try it out today and wow, did they want to copy off of microsoft or something with the search function? First they get rid of "by file name" for the search, and then search itself