Adding field in field catalog and to display in output

Hi, In this below report i have newly added the user group field i.e' usr02-class ' and the field and data is coming up to internal table ' it_usr02 ' in 'REUSE_ALV_GRID_DISPLAY' and in field catalog it is not coming i have debugged and only the class field is not coming. plz suggest me how to add this in fieldcatalog .
REPORT zrpbc_user_log.
Declaration of Tables                                               *
TABLES: usr02,usr03.
DATA:
BEGIN OF it_usr02 OCCURS 0,
  bname        LIKE usr02-bname, "EID
  class        LIKE usr02-class, "User Group
  trdat        LIKE usr02-trdat, "Last Logged in Date
*Start of Change Charm 25971
  name1        LIKE usr03-name1, "First Name
  name2        LIKE usr03-name2, "Last Name
  e_mail       LIKE bapiaddr3-e_mail,"Emailid
*End of Change Charm 25971
END OF it_usr02.
DATA:  w_address TYPE bapiaddr3,
       it_return   TYPE STANDARD TABLE OF bapiret2,
       w_name LIKE bapibname-bapibname.
TYPE-POOLS: slis.
DATA it_fcat TYPE slis_t_fieldcat_alv.
DATA : w_fcat TYPE slis_fieldcat_alv.
Declaration of Constants                                             *
CONSTANTS: c_past_days TYPE i VALUE 90.
Declaration of Variables                                             *
DATA w_repid LIKE sy-repid.
DATA w_no_lines LIKE sy-tabix.
DATA w_idx TYPE sy-tabix.
Selection Screen                                                     *
SELECT-OPTIONS:
  s_trdat FOR usr02-trdat.
INITIALIZATION                                                   *
INITIALIZATION.
  PERFORM initialize_data.
Start of Selection                                                   *
START-OF-SELECTION.
*Get the user details
  PERFORM get_user_details.
End of Selection                                                     *
END-OF-SELECTION.
  PERFORM get_alv_display.
*&      Form  initialize_data
      text
FORM initialize_data .
  "Initialize the select options with the appropriate date range
  s_trdat-low = sy-datum - c_past_days.
  s_trdat-high = sy-datum.
  s_trdat-sign = 'I'.
  s_trdat-option = 'BT'.
  APPEND s_trdat.
ENDFORM.                    " initialize_data
*&      Form  get_user_details
      text
FORM get_user_details .
read data into table it_usr02
  SELECT bname class trdat
  FROM usr02
  INTO TABLE it_usr02
  WHERE
    trdat IN s_trdat AND
    bname LIKE 'E%'.
  LOOP AT it_usr02.
    w_idx = sy-tabix.
    MOVE : it_usr02-bname TO w_name.
*Start of Change Charm 25971
Getting the First ,Last name & Emailid of the user
    CALL FUNCTION 'BAPI_USER_GET_DETAIL'
      EXPORTING
        username = w_name
      IMPORTING
        address  = w_address
      TABLES
        return   = it_return.
    MOVE : w_address-firstname TO it_usr02-name1,
           w_address-lastname  TO it_usr02-name2,
           w_address-e_mail    TO it_usr02-e_mail.
    MODIFY it_usr02 INDEX w_idx.
  ENDLOOP.
*End of Change Charm 25971
ENDFORM.                    " get_user_details
*&      Form  get_alv_display
      text
FORM get_alv_display.
  w_repid = sy-repid.
  PERFORM get_alv_fieldcat.
Create Field-catalogue from internal table
Call for ALV list display
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program = w_repid
      it_fieldcat        = it_fcat
      i_save             = 'A'
    TABLES
      t_outtab           = it_usr02
    EXCEPTIONS
      program_error      = 1
      OTHERS             = 2.
  IF sy-subrc <> 0.
    WRITE: /
    'Returncode'(001),
    sy-subrc,
    'from FUNCTION REUSE_ALV_LIST_DISPLAY'(002).
  ENDIF.
ENDFORM.                    " get_alv_display
*&      Form  get_alv_fieldcat
      text
FORM get_alv_fieldcat .
  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      i_program_name         = w_repid
      i_internal_tabname     = 'IT_USR02'
      i_inclname             = w_repid
    CHANGING
      ct_fieldcat            = it_fcat
    EXCEPTIONS
      inconsistent_interface = 1
      program_error          = 2
      OTHERS                 = 3.
  IF sy-subrc <> 0.
    WRITE: /
    'Returncode'(001),
    sy-subrc,
    'from FUNCTION REUSE_ALV_FIELDCATALOG_MERGE'(002).
  ENDIF.
*Start of Change Charm 25971
  w_fcat-reptext_ddic = 'Firstname'(003).
  MODIFY it_fcat FROM w_fcat TRANSPORTING reptext_ddic
                              WHERE fieldname = 'NAME1'.
  w_fcat-reptext_ddic = 'Lastname'(004).
  MODIFY it_fcat FROM w_fcat TRANSPORTING reptext_ddic
                               WHERE fieldname = 'NAME2'.
*End of Change Charm 25971
ENDFORM.                    " get_alv_fieldcat

Please dont DUPLICATE the Posts. Its against the Forum Rules.
Close any one theard.
Duplicate Post:
In this Report i want to add class field in usr02 table
Regards,
Padma

Similar Messages

  • Adding objects into query Panel and no display report

    Hi Folks,
    I had an issue with WEBI .
    Iam running the report with few objects at first time , all objects are displayed in the  table format of report.
    I saved and closed the report .
    Later  i opened the report and edited the report by adding new objects into query panel and runing it.
    but this time  i did not find the new objects in display table in report as like DeskI.
    If we find the solution for this , it will be great help to me.
    Thanks
    Mahesh

    The objects will be in the data tab. Objects are not automatically added to your report in Webi, they are made available in the data panel, and you can choose which objects to add.

  • Adding a new field in a standard ALV reort

    HI,
    I have a requirement of adding a new field to Standard ALV report. The TCODE is CN50N. When you execute it and gives the project as input it will display an ALV report. i want to add another filed to that ALV report. The program it 's using is RPSISKB000. How to do it???
    regards
    sandeep

    Hi,
         Check in the ALV output whether these fields are already there and not displaying in the ALV output, if the fields are not at all printing in the ALV output,then copy the Program to Z program and change it.
    write the Code to add the new fields to the internal table and change the Field catalaog to come your fields in the ALV output then print it
    Regards

  • Adding Hyperlinks in Report shuould take action in PDF Output

    Hi All,
    I had a requirement with reports
    Explanation of the requirement.
    I had a report aaa.rdf which gives a (one)employee monthly details.
    which need to be output in PDF.
    now the requuirement is
    I had added labels "next-month" and "previous-month" labels at either side of report title.
    I need the code to kept in these labels such that when this report is executed and taken into PDF file, when user
    user clicks on the "next-month" or "previous-month" in that PDF file, the action to take is it should re-ran the same report(aaa.rdf) and should display the output in PDF in the same window but now the output should show the
    coressponding next-month or previous-month results respectively of that employee.
    please let me know if this make sense.
    please guide for the above requirement.
    this is very very urgent your help will be appreciated.
    Thanks in advance
    RRM

    Hi,
    it is not too late ....
    It's possible to add such Hyperlinks to the pdf-Output of a report.
    With use of the built-in rw.set_hyperlink('hyperlink') in a format trigge you can realize that. "hyperlink" is for example then something like:
    '/reports/rwservlet?destype=cache&desformat=pdf&report=drilldetail.jsp&userid=scott/tiger@josi&p_deptno='||:deptno
    In your case it's a call to the same report you run before and you had to set your month-parameter in the call depending your current month (next or previous).
    With srw.set_hyperlink_attrs('string') it's possible to add additional attributes like for example
         srw.set_hyperlink_attrs('target=_new')
    which opens a new browser window.
    This works for HTML & PDF.
    Regards
    Rainer

  • ALV display using dynamic field catalog and dynamic internal table

    hi ,
    please guide me for ALV display using dynamic field catalog and dynamic internal table.
    Thank you.

    Hi Rahul,
    maybe thread dynamic program for alv is helpful for you. More information about the [SAP List Viewer (ALV)|http://help.sap.com/saphelp_nw70/helpdata/EN/5e/88d440e14f8431e10000000a1550b0/frameset.htm]. Also have a look into the example programs SALV_DEMO_TABLE*.
    Regards Rudi

  • Adding value of one field into another field and should  display it

    Hai Experts,
    i have problem try help me plz,
    my problem is:
    i have some fields like A,B,C,D,E.in my ddic table and i designed a screen with same fields
    so here i want have values on gallons
    ex : think
    E = order value
    C = gallons
    and when i enter each value in order value it should go sum with gallons and should display on screen ,it should not save in table,when i open screen next time it should not show any values

    Hi  ,
    U Can try the   UserEXIT  PBAS0001 component  EXIT_SAPFP50M_001 . The code in the Include Program  ZXPADU01  looks  something  like  this .
    DATA: I0002 TYPE P0002.
      CLASS CL_HR_PNNNN_TYPE_CAST DEFINITION LOAD.
      CASE INNNN-INFTY.
        WHEN '0002'.
          CALL METHOD CL_HR_PNNNN_TYPE_CAST=>PRELP_TO_PNNNN
            EXPORTING
              PRELP = INNNN
            IMPORTING
              PNNNN = I0002.
          MOVE I0002-VORNA  TO I0002-RUFNM.
          CALL METHOD CL_HR_PNNNN_TYPE_CAST=>PNNNN_TO_PRELP
            EXPORTING
              PNNNN = I0002
            IMPORTING
              PRELP = INNNN.
      ENDCASE.
    U can also  implement  the  same in the BADI  HRPAD00INFTY   method  BEFORE_OUTPUT . The  same   code  should  work

  • Adding a new field in searh and result [ comb of 2 other fields ]

    Hi ,
    I have to add a new field in Opportunity Search and later OpportunitySearch Result. This field belongs to Opportunity Details -> parties Involved view , and is a combination of 2 fields there..Partner function and Main Partner (unchecked ). Details are as below..
    Can you please suggest easiest way for achieving this..
    Details of the Opportunity Search where I need to add a new search field
    Component : BT111S_OPPT
    Context Node : SEARCH
    View : BT111S_OPPT/Search
    Details of the new search field (Present In the Opportunity Details, there is a viewset for Parties Involved ) ..The new search field should be Employee Responsible but not the Main Partner ( kind of a substitute OR Secondary Employee Responsible )..2 employee responsible is permitted in partner determination..
    Component : BTPartner
    Context Node:  BTPartner
    View : BTPartner/Partner
    Attribute : Partner_fct
    Generic Object Type = 1Order
    +
    Component : BTPartner
    Context Node : BTPartner
    View : BTPartner/ Partner
    Attribute: MainPartner ( Not checked = 0 )
    Is there a simpler way without coding to achieve the above?
    The route that we have thought of is ...Let me know if there is an alternate simpler way...and If I am missing anything
    1.Create a custom field using EEWB ( I am not well aware of AET, and not aware how to enable this in our 
       environment as we upgraded to 7.0 recently ) For CRM Opportunity Transaction Type.
    2.This will be linked to the table CRMD_ORDERADM_H and the related structure
    3.Ask the technical team to populate this field from structure COM_DYNP_PARTNER_UI-PARTNER_FCT and COM_DYNP_PARTNER_UI-MAINPARTNER = 0 [(In Transaction crmd_order F1 on employee responsible points to structure COM_DYNP_PARTNER_UI and Mainpartner is a Boolean and hence main partner = 0 means that it is not the main partner ).
    4.Add the same field in the search-result as well.
    Thanks.
    Regards,
    Monica.

    Hello,
    I have looked at wiki below [http://wiki.sdn.sap.com/wiki/display/CRM/Howtoaddanexistingfieldtoasearchpageofadifferent+component]
    Kindly suggest ways to acheive adding new field in Opportunity Search ( employee responsible which is not the main contact like I mentioned ) which belongs to another component ...Can it be done without coding eg. adding to design layer.
    Can you please give steps to do the same.
    Thanks.
    Regards,
    Monica

  • Adding z field to field catalog

    Hi,
    For doing material determination i wanted to add a new field ( a " Z " field ) and construct the access sequence and generate the fields. For this I added this " Zxyz " field into KOMPD structure.
    But while constructing the access sequence i get an error saying
    " Select a doucument field for zxyz ".
    What I can do.
    Thanks

    Hope you must have followed these steps:
    1. Added the z-field in the structure KOMPD via t-code se11/se84.
    The field been added is 'Maintain in Original Language'
    The dummy entry was removed and the structure is activated.
    2. Made changes in the appropriate user-exit, in the program FV45PF0K_KOMKD_KOMPD_FUELLEN
    [USEREXIT_MOVE_FIELD_TO_KOMPD(SAPMV45A)
    After the changes activated the program.
    3. Add the z-field to the field Catalog for Material Determination.
    4. create the condition table with validity period 'X' and generate
    5. Create the access sequence already described in the previous post
    6. Define condition type and assign the access sequence
    7. Create Procedure
    8. And finally assign the procedure to the sales document.
    Check the initial 4 steps.
    Also, can you let us know the exact error message and the t-code where you are getting the same.
    Regards,
    Gauravjit.
    Reward points if the solution is helpful

  • Characteristic KNDNR is no longer in the  field catalog and will be deleted

    Hi ,
    we are doing System Landscape optimisation project  and the issue is as follows
    In account based copa when i run the KE30 report , i am getting the message in the target  system
    'Characteristic KNDNR is no longer in the  field catalog and will be deleted'
    In the source system (production system), the customer characteristic is available as a variable in the characteristic list as an option and can be selected in the KE32 t code.
    the customer is available in the KE30 report (source system) and it can be drilled down on the basis of the customer but it  is not possible in the target system
    in the Target system (to be production system) the customer characteristic is not available as a variable for selection in the KE32 report under the characteristic list.
    i checked the ke3e t code in both the source and the target system and the characteristic KNDNR is not available as a variable
    I checked the KEA5 and KEA0  t code in both the source and the target system , the customer characteristic is not available
    thanks in advance
    kind regards
    sap student

    Hi,
    Are you trying to create a report from a Form? When are you getting this information? At the time of creating the form (KE34) or report (KE31)?
    I have not seen this message though, can suggest to check if the required characteristic is there in KEA0, KEA5 and also if adding that in KEQ3 helps.
    Regards,
    R C Sabat

  • How to create a report in Form line Style and can display Image field?

    Hi,
    In Report builder 10g, I would like to create a Report with Form Line Style and this report included a Image field.
    I can choose this Style only when Select Report type is Paper Layout. Because, If I choose Create both Web & Paper Layout or Create Web Layout only then in the next Style tab 03 option Form, Form letter and Mailing Label be Disabled.
    But in Paper Layout, my report can not display Image field.
    I tried with Web layout and all the other Styles (Except 03 mentioned be Disabled) then all Styles are displayed Imager field OK.
    How to create a report in Form line Style and can display Image field?
    I was change File Format property of my Image field from text to Image already in Property Inspector. But report only showed MM for my Image field.
    Thanks & regards,
    BACH
    Message was edited by:
    bachnp

    Here you go..Just follow these steps blindly and you are done.
    1) Create a year prompt with presentation variable as pv_year
    2) Create a report say Mid report with year column selected 3 times
    - Put a filter of pv_year presentation variable on first year column with a default value say @{pv_year}{2008}
    - Rename the second time column say YEAR+1 and change the fx to CAST(TIME_DIM."YEAR" AS INT)+1
    - Rename the second time column say YEAR-1 and change the fx to CAST(TIME_DIM."YEAR" AS INT)-1
    Now when you will run Mid Report, this will give you a records with value as 2008 2009 2007
    3) Create your main report with criteria as Year and Measure col
    - Change the fx for year column as CAST(TIME_DIM."YEAR" AS INT)
    - Now put a filter on year column with Filter based on results of another request and select these:
    Relationship = greater than or equal to any
    Saved Request = Browse Mid Report
    Use values in Column = YEAR-1
    - Again,put a filter on year column with Filter based on results of another request and select these:
    Relationship = less than or equal to any
    Saved Request = Browse Mid Report (incase it doesn't allow you to select then select any other request first and then select Mid Report)
    Use values in Column = YEAR+1
    This will select Year > = 2007 AND Year < = 2009. Hence the results will be for year 2007,2008,2009
    This will 100% work...
    http://i56.tinypic.com/wqosgw.jpg
    Cheers

  • Adding a Custom field in Catalog

    Hi,
    We are implementing a new catalog and we are using the SRM 4.0.
    We need to add one more custom field to get the Information related to CAS number in the Front end.
    How can we add the new field in the SRM and match with the corresponding Vendor catalog field.
    Any inputs would be very helpful.
    Thanks and regards,
    Ramachandra DN

    Hi Ramachandra
    please see this KATHIR's article on your similar  requirement.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/bpx-community/supplier-relationship-management/ccm:%20Working%20with%20Custom%20Characteristics%20&%20Mapping%20to%20SRM.pdf
    regards
    Muthu

  • Adding Custom Field to Shopping Cart and PO, Classic Scenario

    We are running SRM 7.0 with ECC 6.0 as the backend and using the Classic scenario. I want to add a custom field to the shopping cart and have the data transfer over to a custom field (of the same name) on the purchase order to the ECC side. I have already added the field to the shopping cart and have the data saving successfully there on the SRM side. What I am having trouble with is getting the data from the custom field to go over to ECC on the purchase order.
    I have extended the Shopping Cart and Purchase Order item structures through configuration on SRM. This has added the fields to the INCL_EEW_PD_ITEM_CSF_SC and INCL_EEW_PD_ITEM_CSF_PO structures, as described in note 672960 (do i need to extend the PO structure on SRM if using the Classic scenario?). I have also extended the CI_EKPODB and CI_EKPODBX structures on ECC as described in note 458591. So the placeholders are there.
    I feel like there must be something I am missing. The OSS note 458591 suggests that just adding the fields to the needed structures will cause the data to transfer, but this does not appear to be the case.
    I have an implementation of BBP_CREATE_BE_PO_NEW that I can use, but do not see where to add the data in the output parameters of that BADI. Is there a BADI I need to implement on the ECC side?
    Any help in this issue would be greatly appreciated.

    Dug around a little bit more and stumbled onto this article which solved it for me: [How to transfer custom fields from SRM to ECC|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/20b36c12-685f-2c10-4fb4-ba2e0b969c27?quicklink=index&overridelayout=true]
    In BADI BBP_CREATE_BE_PO_NEW I had to add some code to fill in the CS_PO1_DOCUMENT-EXTENSIONIN parameter table with the structure for the BAPI_TE_MEPOITEM structure on the ECC side. The tricky part is creating a string representation of that structure with the correct offset. And it isn't as easy as just counting up the number of characters in SE12. For example, looking at my BAPI_TE_MEPOITEM structure in SE12, my custom field appears to start on character 157, but in reality, I had to offset the writing of my value to character 143. I guess it depends on what types are in there.
    But once that gets figured out, it works well. As long as the custom field is added correctly to the CI_EKPODB append structure (which is appended to BAPI_TE_MEPOITEM), the data gets tranferred over in the ExtensionIn table, and SAP automatically knows what to do with the data as long as you have everything in ExtensionIn aligned correctly.
    Thanks for the help everyone!

  • Adding 'Your Reference'(VBKD-IHREZ) field to Field catalog in Output determ

    The requirement is maintaining the condition table using Sales Org/Sales Doc Type/Your reference in output determination process. But the field 'Your reference(VBKD-IHREZ)' is not in the field catalog. Can someone tell me how to add the VBKD-IHREZ to field catalog?
    Thanks in Advance.

    Hey,
    You can find intructions for adding fields to field catalog from this link: http://www.sap-basis-abap.com/sd/how-to-add-new-fields-to-field-catalog.htm

  • Adding New fields to field catalog

    Hi friends, i have comeup with a requirement. its related to output determination. the output have to be sent based on certain criteria. for this we decided to create a new condition table(Acess) and add it in the Access sequence. To create a condition table we need to select the fields from the "Field Catalog". so for this the field should be avilable in the field catalog. Since the field we are going to use is a new Zfield the field is not avilable in the "Output field Catalog".
               What to be done to make the field avilable in the 'Output field catalog'
    Can anyone give some input on this? Thanks in advance.

    Hi Srini,
    Following are the activities.
    1. Find out what are the output communication structures involved in that output condition table. To find that, go to field catalog, and enter a new field called "test". Then it will give you a message "The field test is not a part of the communication structures KOMB, KOMPBV* KOMKBV*where * equals 1, 2 or 3 based on whether the output is for order, delivery or billing documents. For delivery document it is KOMPBV2, KOMKBV2 and KOMB.
    2. Now having known the communication structures for the field catalog, go to all these structures in SE11 and append these structures with a new field say ZZ_SOLD TO PARTY with the relevant data element and domain.
    3. To populate the field while doing transactions, you have to represent this field by a foreign key which is a field from transaction say LIKP_KUNAG for a delivery output.This coding takes place in a user exit. The correct user exit has to be found. Once this is done, the new field is ready for input and it will be available in the list of allowed fields in the field catalogue.
    4.Now you can create a condition table using the new field and use it as one of the accesses in access seq.
    Please assign reward points if this info is helpful to you.

  • How do I define Field-Catalog and Event-Catalog in OOPs ALV

    Hi All,
    This is the piece of the code on which I'm working upon. This program is giving an exception "No Field-Catalog Found". 
    I'm new to OOPs ALV. Could anybody please tell me how to define the field-catalog and event-catalog in this.
    module PBO output.
          IF g_custom_container IS INITIAL.
              CREATE OBJECT g_custom_container EXPORTING CONTAINER_NAME = 'CCCONTAINER'.
              CREATE OBJECT g_grid             EXPORTING I_PARENT       = g_custom_container.
          CALL METHOD g_grid->set_table_for_first_display
              EXPORTING I_STRUCTURE_NAME = 'IT_MATERIAL'
                        is_layout = layout
              CHANGING IT_OUTTAB         = gt_it_material.
          ENDIF.
      endmodule.
    Regards,
    Saurabh

    hi,
    chk this sampl ceode.
    TYPE-POOLS: slis.
    CLASS lcl_event_receiver DEFINITION DEFERRED.
    TABLES : zmpets_shipactiv, zmpets_chargebk, zmpets_shiphdr.
    DATA : BEGIN OF int_crb OCCURS 0,
           sel TYPE char1,
           icon TYPE icon_d,
           pernr LIKE zmpets_cil-pernr,
           vorna LIKE pa0002-vorna,
           movreason LIKE zmpets_shiphdr-movreason,
           shipdocnum LIKE zmpets_chargebk-shipdocnum,
           createdon LIKE zmpets_chargebk-createdon,
           chargeamount LIKE zmpets_chargebk-chargeamount,
           version LIKE zmpets_shipactiv-version,
           activity LIKE zmpets_shipactiv-activity,
           vendor LIKE zmpets_shiphdr-vendor,
          smtp_addr LIKE adr6-smtp_addr,
           empperid LIKE zmpets_167doc-empperid,
           celltab TYPE lvc_t_styl,
           END OF int_crb.
    DATA : int_crb_ver LIKE int_crb OCCURS 0 WITH HEADER LINE.
    DATA : int_crb_mail LIKE int_crb OCCURS 0 WITH HEADER LINE.
    DATA : int_shipactiv LIKE zmpets_shipactiv OCCURS 0 WITH HEADER LINE.
    DATA: gt_fieldcatalog TYPE lvc_t_fcat.
    DATA : wf_flag TYPE i.
    DATA : wf_res TYPE c.
    DATA : wf_tabix TYPE sy-tabix.
    DATA: BEGIN OF int_sin OCCURS 0,
          shipdocnum LIKE zmpets_chargebk-shipdocnum,
            shipdocnum LIKE zmpets_shipactiv-petsdocnumber,
          END OF int_sin.
    DATA: objpack   LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
    DATA: objhead   LIKE solisti1 OCCURS 1 WITH HEADER LINE.
    DATA: objbin    LIKE solisti1 OCCURS 10 WITH HEADER LINE.
    DATA: objtxt    LIKE solisti1 OCCURS 10 WITH HEADER LINE.
    DATA: reclist   LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
    DATA: doc_chng  LIKE sodocchgi1.
    DATA: tab_lines LIKE sy-tabix.
    DATA l_num(3).
    DATA: ok_code            LIKE          sy-ucomm,
          w_repid            LIKE          sy-repid,
          wl_sno             TYPE          i         VALUE 0,
          w_max              TYPE          i         VALUE 100,
          wf_layout          TYPE          lvc_s_layo,
          cont_on_main       TYPE          scrfname   VALUE  'GRID_CONTROL',
          cont_on_dialog     TYPE          scrfname   VALUE 'GRID_CONTROL',
          grid1              TYPE          REF TO cl_gui_alv_grid,
          grid2              TYPE          REF TO cl_gui_alv_grid,
          custom_container1  TYPE          REF TO cl_gui_custom_container,
          custom_container2  TYPE          REF TO cl_gui_custom_container,
          event_receiver     TYPE          REF TO lcl_event_receiver,
          lt_exclude         TYPE          ui_functions,
          ls_celltab         TYPE          lvc_s_styl,
          lt_celltab         TYPE          lvc_t_styl.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-001.
    PARAMETERS : p_cash AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK b3.
    PERFORM fieldcatalog_init USING gt_fieldcatalog[].
    Selection-Screen----
    SELECTION-SCREEN  BEGIN OF BLOCK b1 WITH FRAME TITLE text-002.
    SELECT-OPTIONS:s_chdate FOR zmpets_chargebk-createdon,
                   s_pernr FOR zmpets_shiphdr-pernr,
                   s_mvrsn FOR zmpets_shiphdr-movreason,
                   s_sin FOR zmpets_chargebk-shipdocnum NO INTERVALS
    NO-EXTENSION.
    SELECTION-SCREEN  END OF BLOCK b1.
    PERFORM f_clear_fields.
    CALL SCREEN 100.
          CLASS lcl_event_receiver DEFINITION
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS:
        handle_toolbar
            FOR EVENT toolbar OF cl_gui_alv_grid
                IMPORTING e_object e_interactive,
        handle_user_command
            FOR EVENT user_command OF cl_gui_alv_grid
                IMPORTING e_ucomm.
      PRIVATE SECTION.
    ENDCLASS.                    "lcl_event_receiver DEFINITION
          CLASS lcl_event_receiver IMPLEMENTATION
    CLASS lcl_event_receiver IMPLEMENTATION.
      METHOD handle_toolbar.
    § 2.In event handler method for event TOOLBAR: Append own functions
      by using event parameter E_OBJECT.
        DATA: ls_toolbar  TYPE stb_button.
    append a separator to normal toolbar
        CLEAR ls_toolbar.
        MOVE 3 TO ls_toolbar-butn_type.
        APPEND ls_toolbar TO e_object->mt_toolbar.
        CLEAR ls_toolbar.
    new button -
        MOVE 'PROCESSED' TO ls_toolbar-function.
        MOVE icon_execute_object TO ls_toolbar-icon.
        MOVE 'Process the Record'(110) TO ls_toolbar-quickinfo.
        MOVE ' Process '(200) TO ls_toolbar-text.
        MOVE ' ' TO ls_toolbar-disabled.
        APPEND ls_toolbar TO e_object->mt_toolbar.
      ENDMETHOD.                    "handle_toolbar
      METHOD handle_user_command.
    § 3.In event handler method for event USER_COMMAND: Query your
      function codes defined in step 2 and react accordingly.
        DATA: lt_rows TYPE lvc_t_row.
        CASE e_ucomm.
          WHEN 'PROCESSED'.
            CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
                     EXPORTING
                      defaultoption        = 'N'
      textline1     = 'Do you want to process the selected documents?'
              TEXTLINE2            = ' '
                       titel                = 'Process Documents'
              START_COLUMN         = 25
              START_ROW            = 6
              CANCEL_DISPLAY       = 'X'
                    IMPORTING
                      answer               = wf_res.
    *--IF THE USER CONFIRMS 'YES',
            IF wf_res = 'J'.
              PERFORM f_modify_activity.
              CALL METHOD grid1->refresh_table_display.
           PERFORM SENDINGMAIL.
            ENDIF.
        ENDCASE.
      ENDMETHOD.                           "handle_user_command
    ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION
    MODULE pbo_100 OUTPUT
    MODULE pbo_100 OUTPUT.
      SET PF-STATUS 'MAIN100'.
      SET TITLEBAR 'MAIN100'.
      w_repid = sy-repid.
      IF custom_container1 IS INITIAL.
    *get the data from charge back table
        PERFORM select_table_chb.
    create a custom container control for our ALV Control
        CREATE OBJECT custom_container1
            EXPORTING
                container_name = cont_on_main
            EXCEPTIONS
                cntl_error = 1
                cntl_system_error = 2
                create_error = 3
                lifetime_error = 4
                lifetime_dynpro_dynpro_link = 5.
        IF sy-subrc NE 0.
    add your handling, for example
          CALL FUNCTION 'POPUP_TO_INFORM'
            EXPORTING
              titel = w_repid
              txt2  = sy-subrc
              txt1  = 'The control could not be created'(510).
        ENDIF.
        CREATE OBJECT grid1
                  EXPORTING i_parent = custom_container1.
    Set a titlebar for the grid control
        wf_layout-grid_title = 'Charge Back'(100).
    allow to select multiple lines
        wf_layout-sel_mode = 'C'.
        wf_layout-stylefname = 'CELLTAB'.
    Exclude all edit functions in this example since we do not need them:
        PERFORM exclude_tb_functions CHANGING lt_exclude.
        CALL METHOD grid1->set_table_for_first_display
                   EXPORTING
                I_BUFFER_ACTIVE               =
                I_CONSISTENCY_CHECK           =
                I_STRUCTURE_NAME              =
                IS_VARIANT                    =
                I_SAVE                        =
                I_DEFAULT                     = 'X'
                     is_layout                     = wf_layout
                IS_PRINT                      =
                IT_SPECIAL_GROUPS             =
                  it_toolbar_excluding          = lt_exclude
                IT_HYPERLINK                  =
                IT_ALV_GRAPHICS               =
              CHANGING
                it_outtab                     = int_crb[]
                it_fieldcatalog               = gt_fieldcatalog.
        CREATE OBJECT event_receiver.
        SET HANDLER event_receiver->handle_user_command FOR grid1.
        SET HANDLER event_receiver->handle_toolbar FOR grid1.
        CALL METHOD grid1->set_toolbar_interactive.
      ENDIF.                               "IF grid1 IS INITIAL
      CALL METHOD cl_gui_control=>set_focus
        EXPORTING
          control = grid1.
    ENDMODULE.                    "pbo_100 OUTPUT
    MODULE pai_100 INPUT
    MODULE pai_100 INPUT.
      CASE ok_code.
        WHEN 'EXIT'.
          PERFORM f_clear_fields.
          LEAVE PROGRAM.
        WHEN 'CANCEL'.
          PERFORM f_clear_fields.
          LEAVE TO SCREEN 0.
        WHEN 'BACK'.
          PERFORM f_clear_fields.
          LEAVE TO SCREEN 0.
      ENDCASE.
      CLEAR ok_code.
    ENDMODULE.                    "pai_100 INPUT
    **&      Form  select_table_chb
          text
    FORM select_table_chb.
      IF p_cash = 'X'.
    *Consider the pending documents also.
    *get the documents which are not processed yet,
    *Doctype -> 06 = Charge Back document type.
        SELECT zmpets_shiphdrpernr pa0002vorna
         zmpets_shiphdrmovreason zmpets_chargebkshipdocnum
         zmpets_chargebkcreatedon zmpets_chargebkchargeamount
         zmpets_shipactivversion zmpets_shipactivactivity
    zmpets_shiphdr~vendor
       adr6~smtp_addr
    zmpets_167doc~empperid
                 INTO CORRESPONDING FIELDS OF TABLE int_crb_ver
                 FROM zmpets_chargebk
                 JOIN zmpets_shiphdr
               ON zmpets_chargebkshipdocnum = zmpets_shiphdrshipdocno
                 JOIN zmpets_shipactiv
         ON zmpets_chargebkshipdocnum = zmpets_shipactivpetsdocnumber
                 JOIN pa0002
                 ON zmpets_shiphdrpernr = pa0002pernr
                    JOIN lfa1
                    ON lfa1lifnr = zmpets_shiphdrvendor
                    JOIN adr6
                    ON adr6addrnumber = lfa1adrnr
                 JOIN zmpets_167doc
                 ON zmpets_167docpernr = pa0002pernr
                           WHERE zmpets_shipactiv~doctype = '06'
                        zmpets_shipactiv~activity NE '30'
                      ZMPETS_CHARGEBK~CREATEDON IN s_chdate
                      AND ZMPETS_SHIPHDR~pernr IN s_pernr
                      AND ZMPETS_SHIPHDR~MOVREASON IN s_mvrsn
                      AND ZMPETS_CHARGEBK~SHIPDOCNUM IN s_sin
                           AND zmpets_chargebk~loekz NE 'X'
                           AND zmpets_shipactiv~loekz NE 'X'
                           AND zmpets_shiphdr~loekz NE 'X'.
        IF sy-subrc <> 0.
    *Message is 'No Pending Documents Available.'.
          MESSAGE s196(zm050).
        ELSE.
          LOOP AT int_crb_ver.
    *Not yet processed. set to red
            int_crb_ver-icon = '@0A@'.
            MODIFY int_crb_ver.
          ENDLOOP.
          PERFORM f_filter_data_pending.
        ENDIF.
      ELSE.
    *Get the document details from pa0002,zmpets_shipactiv,ZMPETS_CHARGEBK
    *table.
    *Consider document type as '01'  during the selection.
    *Doctype -> 06 = Charge Back document type.
        SELECT zmpets_shiphdrpernr pa0002vorna zmpets_shiphdr~movreason
        zmpets_chargebkshipdocnum zmpets_chargebkcreatedon
    zmpets_chargebkchargeamount zmpets_shipactivversion
    zmpets_shipactivactivity zmpets_shiphdrvendor
    *adr6~smtp_addr
    zmpets_167doc~empperid
                 INTO CORRESPONDING FIELDS OF TABLE int_crb_ver
                 FROM zmpets_chargebk
                 JOIN zmpets_shiphdr
                 ON zmpets_chargebkshipdocnum = zmpets_shiphdrshipdocno
                 JOIN zmpets_shipactiv
           ON zmpets_chargebkshipdocnum = zmpets_shipactivpetsdocnumber
                 JOIN pa0002
                 ON zmpets_shiphdrpernr = pa0002pernr
                JOIN lfa1
                    ON lfa1lifnr = zmpets_shiphdrvendor
                    JOIN adr6
                    ON adr6addrnumber = lfa1adrnr
                     JOIN zmpets_167doc
                     ON zmpets_167docpernr = pa0002pernr
                           WHERE zmpets_chargebk~createdon IN s_chdate
                           AND zmpets_shiphdr~pernr IN s_pernr
                           AND zmpets_shiphdr~movreason IN s_mvrsn
                           AND zmpets_chargebk~shipdocnum IN s_sin
                          AND zmpets_shipactiv~activity NE '30'
                           AND zmpets_shipactiv~doctype = '06'
                           AND zmpets_chargebk~loekz NE 'X'
                           AND zmpets_shipactiv~loekz NE 'X'
                           AND zmpets_shiphdr~loekz NE 'X'.
        IF sy-subrc <> 0.
    *Message is 'No Charge Back Documents Available.'.
          MESSAGE s201(zm050).
        ELSE.
          PERFORM f_filter_data.
        ENDIF.
      ENDIF.
    ENDFORM.                    "select_table_chb
    *&      Form  UPDATE_RECORDS
          text
    -->  p1        text
    <--  p2        text
    FORM update_records TABLES p_et_index_rows
                                    STRUCTURE lvc_s_row.
      DATA: ls_selected_line LIKE lvc_s_row,
              lf_row_index TYPE lvc_index.
      LOOP AT p_et_index_rows INTO ls_selected_line.
        lf_row_index = ls_selected_line-index.
      ENDLOOP.
    ENDFORM.                    " UPDATE_RECORDS
    **&      Form  fieldcatalog_init
          text
         -->P_GT_FIELDCATALOG[]  text
    FORM fieldcatalog_init  USING lt_fieldcatalog TYPE lvc_t_fcat.
      DATA: ls_fieldcatalog TYPE lvc_s_fcat.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname = 'SEL'.
      ls_fieldcatalog-tabname  = 'INT_CRB'.
      ls_fieldcatalog-datatype = 'C'.
      ls_fieldcatalog-col_pos  = 1.
      ls_fieldcatalog-edit     = 'X'.
      ls_fieldcatalog-reptext  = 'Select for Processing'.
      ls_fieldcatalog-coltext  = 'Select for Processing'.
      ls_fieldcatalog-seltext  = 'Select for Processing'.
      ls_fieldcatalog-tooltip  = 'Select for Processing'.
      ls_fieldcatalog-checkbox = 'X'.
      ls_fieldcatalog-key = 'X'.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname = 'ICON'.
      ls_fieldcatalog-tabname   = 'INT_CRB'.
      ls_fieldcatalog-datatype  = 'CHAR'.
      ls_fieldcatalog-col_pos    = 2.
      ls_fieldcatalog-intlen     = '4'.
      ls_fieldcatalog-reptext   =  'Status'.
      ls_fieldcatalog-coltext   =  'Status'.
      ls_fieldcatalog-seltext   =  'Status'.
      ls_fieldcatalog-tooltip   =  'Status'.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname = 'PERNR'.
      ls_fieldcatalog-tabname   = 'INT_CRB'.
      ls_fieldcatalog-datatype  = 'NUMC'.
      ls_fieldcatalog-col_pos   = 2.
      ls_fieldcatalog-intlen    = '8'.
      ls_fieldcatalog-reptext   =  'Employee Number'.
      ls_fieldcatalog-coltext   =  'Employee Number'.
      ls_fieldcatalog-seltext   =  'Employee Number'.
      ls_fieldcatalog-tooltip   =  'Employee Number'.
      ls_fieldcatalog-key = 'X'.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname  = 'VORNA'.
      ls_fieldcatalog-tabname    = 'INT_CRB'.
      ls_fieldcatalog-col_pos    =  3 .
      ls_fieldcatalog-datatype   = 'CHAR'.
      ls_fieldcatalog-outputlen      = '20'.
      ls_fieldcatalog-reptext    = 'Employee Name'.
      ls_fieldcatalog-coltext    = 'Employee Name'.
      ls_fieldcatalog-seltext    = 'Employee Name'.
      ls_fieldcatalog-tooltip    = 'Employee Name'.
    ls_fieldcatalog-key      = 'X'.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname  = 'MOVREASON'.
      ls_fieldcatalog-tabname    = 'INT_CRB'.
      ls_fieldcatalog-col_pos    =  4.
      ls_fieldcatalog-datatype   = 'NUMC'.
      ls_fieldcatalog-outputlen  = '10'.
      ls_fieldcatalog-reptext    = 'Move Reason'.
      ls_fieldcatalog-coltext    = 'Move Reason'.
      ls_fieldcatalog-seltext    = 'Move Reason'.
      ls_fieldcatalog-tooltip    = 'Move Reason'.
    ls_fieldcatalog-key      = 'X'.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname = 'SHIPDOCNUM'.
      ls_fieldcatalog-tabname   = 'INT_CRB'.
      ls_fieldcatalog-datatype  = 'NUMC'.
      ls_fieldcatalog-outputlen = '10'.
      ls_fieldcatalog-col_pos   =  5.
      ls_fieldcatalog-reptext   = 'Shipping Document Number'.
      ls_fieldcatalog-coltext   = 'Shipping Document Number'.
      ls_fieldcatalog-seltext   = 'Shipping Document Number'.
      ls_fieldcatalog-tooltip   = 'Shipping Document Number'.
    ls_fieldcatalog-key = 'X'.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname = 'CREATEDON'.
      ls_fieldcatalog-tabname   = 'INT_CRB'.
      ls_fieldcatalog-col_pos   = 6.
      ls_fieldcatalog-datatype  = 'DATS'.
      ls_fieldcatalog-outputlen = '8'.
      ls_fieldcatalog-reptext   = 'Created On'.
      ls_fieldcatalog-coltext   = 'Created On'.
      ls_fieldcatalog-seltext   = 'Created On'.
      ls_fieldcatalog-tooltip   = 'Created On'.
    ls_fieldcatalog-DO_sum      = 'X'.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname = 'CHARGEAMOUNT'.
      ls_fieldcatalog-tabname   = 'INT_CRB'.
      ls_fieldcatalog-col_pos   = 7.
      ls_fieldcatalog-datatype  = 'CURR'.
      ls_fieldcatalog-outputlen = '13'.
      ls_fieldcatalog-reptext   = 'Charge Back Amount'.
      ls_fieldcatalog-coltext   = 'Charge Back Amount'.
      ls_fieldcatalog-seltext   = 'Charge Back Amount'.
      ls_fieldcatalog-tooltip   = 'Charge Back Amount'.
    ls_fieldcatalog-DO_sum      = 'X'.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
    ENDFORM.                    "fieldcatalog_init
    *&      Form  f_modify_activity
    Modify the activity to 79 in zmpets_shipaciv table.
    -->  p1        text
    <--  p2        text
    FORM f_modify_activity .
      REFRESH int_crb_mail.
      int_crb_mail[] = int_crb[].
    *All the document number which is to be processed is stored in
    *the internel table 'INT_SIN'.
      LOOP AT int_crb INTO int_crb.
        IF int_crb-sel ='X'.
          MOVE int_crb-shipdocnum TO int_sin.
          APPEND int_sin.
          CLEAR int_sin.
    *Removing the processed documents.
          DELETE int_crb.
        ENDIF.
        CLEAR int_crb.
      ENDLOOP.
    *Get the details from shipactiv table.
      IF int_sin[] IS NOT INITIAL.
        SELECT * FROM zmpets_shipactiv
            INTO TABLE int_shipactiv
              FOR ALL ENTRIES IN int_sin
                    WHERE petsdocnumber = int_sin-shipdocnum.
    *Modify the activity code, version, actual date and last changed date.
        SORT int_shipactiv BY petsdocnumber version DESCENDING.
        CLEAR wf_tabix.
        LOOP AT int_shipactiv.
          wf_tabix = sy-tabix.
          AT NEW petsdocnumber.
            READ TABLE int_shipactiv INDEX wf_tabix.
            int_shipactiv-activity = '030'.
            int_shipactiv-version = int_shipactiv-version + 1.
            int_shipactiv-actdate = sy-datum.
            int_shipactiv-lastchangedby = sy-uname.
            int_shipactiv-lastchangedt = sy-datum.
    *Modify the data base table
            MODIFY zmpets_shipactiv FROM int_shipactiv.
          ENDAT.
          CLEAR int_shipactiv.
          AT LAST.
    *Message is 'Data Processed Successfully.'.
            MESSAGE s203(zm050).
          ENDAT.
        ENDLOOP.
    *-send mail to the vendor and employee that the shipment is cleared for
        LOOP AT int_crb_mail WHERE sel = 'X'.
          PERFORM f_send_mail.
        ENDLOOP.
        REFRESH int_crb_mail.
       CALL SELECTION-SCREEN 1000.
      ELSE.
    *Message is 'No Data Selected for Processing.'.
        MESSAGE s200(zm050).
      ENDIF.
    ENDFORM.                    " f_modify_activity
    *&      Form  f_clear_fields
          text
    -->  p1        text
    <--  p2        text
    FORM f_clear_fields .
      CLEAR int_crb.
      CLEAR int_crb_ver.
      CLEAR int_sin.
      REFRESH int_crb.
      REFRESH int_crb_ver.
      REFRESH int_sin.
      CLEAR int_shipactiv.
      REFRESH int_shipactiv.
      CLEAR wf_flag.
      CLEAR wf_tabix.
    ENDFORM.                    " f_clear_fields
    *&      Form  f_filter_data
          text
    -->  p1        text
    <--  p2        text
    FORM f_filter_data .
    *Take the latest Version Data.
    *take all the activities, including the activity '30'.
    then put the details in internal table 'INT_CRB'.
      SORT int_crb_ver BY shipdocnum version DESCENDING.
      CLEAR wf_tabix.
      CLEAR int_crb.
      REFRESH int_crb.
      LOOP AT int_crb_ver.
        wf_tabix = sy-tabix.
        AT NEW shipdocnum.
          READ TABLE int_crb_ver INDEX wf_tabix.
          MOVE-CORRESPONDING int_crb_ver TO int_crb.
          APPEND int_crb.
          CLEAR int_crb.
        ENDAT.
      ENDLOOP.
      IF int_crb[] IS INITIAL.
    *Message is 'No Records Available.'.
        MESSAGE s202(zm050).
      ELSE.
        CLEAR wf_tabix.
        LOOP AT int_crb.
          wf_tabix = sy-tabix.
          REFRESH lt_celltab.
          ls_celltab-fieldname = 'SEL'.
          IF int_crb-activity = '030'.
            ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
    *status becomes green. ie processed
            int_crb-icon = '@08@'. "Green
          ELSE.
            ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
    *status set to red. ie not yet processed
            int_crb-icon = '@0A@'. "Red
          ENDIF.
          INSERT ls_celltab INTO TABLE lt_celltab.
          INSERT LINES OF lt_celltab INTO TABLE int_crb-celltab.
          MODIFY int_crb INDEX wf_tabix.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " f_filter_data
    *&      Form  f_filter_data
          text
    -->  p1        text
    <--  p2        text
    FORM f_filter_data_pending.
    *Take the latest Version Data.
    *take all the activities, including the activity '30'.
    *then filter it with out the activities '30' and having the lastest
    *version. then put the details in internal table 'INT_CRB'.
      SORT int_crb_ver BY shipdocnum version DESCENDING.
      CLEAR wf_tabix.
      CLEAR int_crb.
      REFRESH int_crb.
      LOOP AT int_crb_ver.
        wf_tabix = sy-tabix.
        AT NEW shipdocnum.
          READ TABLE int_crb_ver INDEX wf_tabix.
          IF int_crb_ver-activity NE '030'.
            MOVE-CORRESPONDING int_crb_ver TO int_crb.
            APPEND int_crb.
            CLEAR int_crb.
          ENDIF.
        ENDAT.
      ENDLOOP.
      IF int_crb[] IS INITIAL.
    *Message is 'No Records Available.'.
        MESSAGE s202(zm050).
      ENDIF.
    ENDFORM.                    " f_filter_data_pending
    *&      Form  EXCLUDE_TB_FUNCTIONS
          text
         <--P_LT_EXCLUDE  text
    FORM exclude_tb_functions CHANGING pt_exclude TYPE ui_functions.
      DATA ls_exclude TYPE ui_func.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_delete_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_append_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_move_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_cut.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_paste.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_paste_new_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_undo.
      APPEND ls_exclude TO pt_exclude.
    ENDFORM.                               " EXCLUDE_TB_FUNCTIONS
    *&      Form  f_send_mail
          text
    -->  p1        text
    <--  p2        text
    FORM f_send_mail .
    *store the vendor name, vendor email id , employee name and employee
    *email id in the internal table int_crb
    Creation of the document to be sent
      CLEAR doc_chng.
      REFRESH objpack.
      REFRESH objhead.
      REFRESH  reclist.
      REFRESH objtxt.
    File Name
      doc_chng-obj_name = 'SHIPMENT'.
    Mail Subject
      CONCATENATE 'Shipment Document No.' int_crb_mail-shipdocnum
      'Cleared.'
      INTO doc_chng-obj_descr SEPARATED BY ' '.
    Mail Contents
      objtxt-line = 'Hi,'.
      APPEND objtxt.
      objtxt-line = ' '.
      APPEND objtxt.
      CONCATENATE 'Shipment Document Number ' int_crb_mail-shipdocnum
    ' cleared for move.' INTO objtxt-line SEPARATED BY ' '.
      APPEND objtxt.
      objtxt-line = ' '.
      APPEND objtxt.
      CLEAR  objtxt.
      objtxt-line = 'Regards '.
      APPEND objtxt.
      objtxt-line = ' '.
      APPEND objtxt.
      objtxt-line = 'SAP '.
      APPEND objtxt.
      CLEAR  objtxt.
      APPEND objtxt.
      DESCRIBE TABLE objtxt LINES tab_lines.
      READ TABLE objtxt INDEX tab_lines.
      doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN(
    objtxt ).
    Creation of the entry for the compressed document
      CLEAR objpack-transf_bin.
      objpack-head_start = 1.
      objpack-head_num = 0.
      objpack-body_start = 1.
      objpack-body_num = tab_lines.
      objpack-doc_type = 'RAW'.
      APPEND objpack.
    Completing the recipient list
    target recipent
      CLEAR reclist.
      reclist-receiver = int_crb_mail-empperid. "employee email ID
      "wf_empperid.
      reclist-express  = 'X'.
      reclist-rec_type = 'U'.
      APPEND reclist.
    copy recipents
    CLEAR reclist.
    reclist-receiver = 'anversha.shahul@'."int_crb_mail-smtp_addr
    reclist-express  = 'X'.
    reclist-rec_type = 'U'.
    reclist-copy     = 'X'.
    APPEND reclist.
    Sending the document
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = doc_chng
        TABLES
          packing_list               = objpack
          object_header              = objhead
       contents_bin               = objbin
          contents_txt               = objtxt
          receivers                  = reclist
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          operation_no_authorization = 4
          OTHERS                     = 99.
      COMMIT WORK.
      SUBMIT rsconn01
                    WITH mode = 'INT'
                    WITH output = ' '
                      AND RETURN.
    ENDFORM.                    " f_send_mail
    rgds
    anver
    pls mark hlpful answers

Maybe you are looking for

  • Mac Mini Early 2009 No display

    Hi, I have a new Mac mini and when I try to hook up tomy Sony SXRD HDTV, I get a blank/black screen. I do get to see the blue/gray screen with apple logo and gears moving but nothing after that. I have tried both miniDVI and miiDP and no luck. I trie

  • Howto setup portal content folder path?

    we want to deploy our par-file (portlet archive) into the portal catalog folder path /portal_content/other_vendors/every_user/com.name.etc.etc.par How to setup this path so that the par-file is correctly build and deployed to this path? The path can

  • Photo:getDevelopSettings() returning inconsistent results for new fields

    If you're using photo:getDevelopSettings(), see this report of an annoying bug with "new" develop fields such as "Contrast 2012" and "Blacks 2012": http://feedback.photoshop.com/photoshop_family/topics/sdk_photo_getdevelopsettings_returni ng_inconsis

  • Access OID Groups in Portal

    I've setup item access privileges on a page. I have created a new OID group and attempted to give this group access to this item. I can choose the group, but when it's added, it does not show the group name, rather a number, i.e., (D8F909F2393035B7E0

  • Serialization of complex hierarchies using PortableObject or PofSerializer

    Hi, I am starting with Coherence and I am having a hard time trying to introduce POF serialization in a complex hierarchy of classes... classes containing another classes that extend abstract classes that extend another abstract classes... All of the