Add number of week ...

.. to the small calendar that can be opened in every date field would be just a small change.
Business worlds - at least ours - is always talking in week numbers.
Thanks
Franz

And please add it also in the marketing documents on row level.
Our current solution is with a query with is running every minute update the weeknumbers on rowlevel which causes error messages.
Regards,
Marc

Similar Messages

  • Is it possible to change the number of weeks to be displayed in the month view in calendar (mavericks)?

    I'd like to know if it's possible to change the number of weeks to be displayed in the month view in calendar? Thanks!

    No.
    There are up to six calendar weeks that might be used to display the 31 possible days in a month.
    So the month view displays six weeks.

  • Need to add number of days to users end date.

    Hi,
    I have a code where we are adding number of days(30) to current date and then updating user's end date in IDM DB.
    Now we have a requirement where we need to add number of days(30) to existing end date of user instead of adding to current date.
    *public String incrementDate(int daysToAdd)
         // Start date
         log.info("NotifyLastDayOfService::incrementDate(): Enter");
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
         Calendar c = Calendar.getInstance();
         c.add(Calendar.DATE, daysToAdd); // number of days to add
         String newDate = sdf.format(c.getTime());
         log.info("NotifyLastDayOfService::incrementDate(): Exit");
         return newDate;
    Have any body implemented this scenario?
    Please suggest.
    Thanks,
    Kalpana.

    Hi Nayan,
    Here is the code:
    System.out.println("----inside increment date method-----");     
              HashMap<String, String> hm = new HashMap<String, String>();
              HashMap<String,Date> modifyMap=new HashMap<String,Date>();
              SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
              tcResultSet usrList = null;
         String enddate = null;
         hm.put("Users.Key",usrKey );
         try {
         usrList = this.usrIntf.findUsers(hm);
         usrList.goToRow(0);
         Date endDate =usrList.getDate("Users.End Date");
         System.out.println("-----users end date-----"+endDate);
         String userEndDate=sdf.format(endDate);
         System.out.println("-----String value of users end date-----"+userEndDate);
         Calendar cal=null;
         System.out.println("-----Calender date-----"+cal);
         cal.setTime(endDate);
         System.out.println("-----end date-----"+endDate);
    cal.add(Calendar.DATE, Integer.parseInt(daysToAdd)); // number of days to add
    Date newEnddate = cal.getTime();
    System.out.println("-----new end date-----"+newEnddate);
    //usrList.setEndDate(Edate);
    modifyMap.put(userEndDate,newEnddate);
    usrIntf.updateUser(usrList, modifyMap);
    System.out.println("updated user's end date in OIM DB");
    //System.out.println("-----updated user's end date in OIM DB-----");
    logger.info("NotifyLastDayOfService::incrementDate(): Exit");
         System.out.println("-----new date-----");
         } catch (tcAPIException e) {
         logger.error("Error in finding end date for user" + e);
         } catch (tcColumnNotFoundException e) {
         logger.error("Error in finding end date for user" + e);
    In th log file, I can see that the code is not executing this line:
    cal.setTime(endDate);
    end date is of type Date and stores users end date from DB. Please help in resolving this issue.
    Thakns,
    Kalpana.

  • How can i do if i want to add number to the filenames of my pic in my macpro

    how can i do if i want to add number to the filenames of my pics in my macpro? if someone can help

    You could look into utilities like A Better Finder Rename or similar apps on the page I linked to.

  • Add number of business days to date field

    Hello, I noticed that there is not much discussion in the forum surrounding u201Cbusiness daysu201D so I hope this post/discussion/solution contributes to the content of this forum.
    I am using the following 3 formulas to try to Add number of business days (based upon a table field) to a specified date:
    1. Variable name = SetVar
    //Set Variable for Add Business Days:
    DateVar Array Holidays;
    DateVar Target:= CDate({TMS_MOVEMENT_EVT.EVT_DATE}); // Put your field name in here
    NumberVar Add:=  {DTCI_DOD_TRANS.TRANS}; // put the number of days here to add (a positive number)
    NumberVar Added := (0);
    2. Variable name = AddBizDays
    //Adding Business Days:
    EvaluateAfter({@SetVar});
    WHILE Added < Add
    Do (target := target +1;
        if dayofweek (target) in 2 to 6 and not (target in holidays)
            then Added:=Added+1
            else Added:=Added);
    Target
    3. Variable name = HOLIDAYS
    //Holiday Array Formula for the report Header:
    BeforeReadingRecords;
    DateVar Array Holidays := [
    Date (2003,12,25),   // you can put in as many lines for holidays as you want. 
    Date (2003,12,31)
    0
    I am successfully getting my data needed to make the necessary calculations and variable assignmentsu2026 I believe that my ISSUE is that I am not sure where to place these formulas into my report so they assign the variables and execute properly when previewing my report. I am curious if that is my issue, and if so, can someone provide me direction on where to put each of these formulas in my report.
    Currently, when I try to preview the report, I get the following Crystal Reports Error:  -u201CA number, currency amount, Boolean, date, time, date-time, or string is expected here.u201D
    Then Crystal automatically opens the AddBizDays formula and highlights the word added, see below RE: u201CWHILE Addedu201D
    For reference, my report has 3 groups, and I am displaying all of my output information (and locating my formulas) in the group footer #3 report section. I have moved them around to other report sections/groups/placements, but to no success.
    Thanks so much.
    Best, Matt

    I worked this out... FYI - for the benefit of all forum users:
    ADDING BUSINESS DAYS TO A CERTAIN DATE (excluding weekends and holidays)
    1. Variable name = AddBizDays
    //Adding Business Days:
    WhileReadingRecords;
    DateVar Array Holidays;
    DateVar Target:= CDate(); // Put your field name in here
    NumberVar Add:=  ; // put the number of days here to add (a positive number)
    NumberVar Added := (0);
    WHILE Added < Add
    Do (target := target +1;
        if dayofweek (target) in 2 to 6 and not (target in holidays)
            then Added:=Added+1
            else Added:=Added);
    Target
    2. Variable name = HOLIDAYS
    //Holiday Array Formula for the report Header:
    BeforeReadingRecords;
    DateVar Array Holidays := [
    Date (2003,12,25), // you can put in as many lines for holidays as you want.
    Date (2003,12,31)
    0
    ...too bad i don't get forum points for sharing this solution.
    Special thanks to KenHamady.com -- for sharing this solution.
    Sincerely,
    Matt

  • Is it possible to add number of days to date?

    I am working on a form where I need to add number of days to a date and come up with a date.
    Header 1
    Header 2
    example date:  March 1, 2013
    + 30
    = march 31 2013                
    1. is this possible? Header1/cell 1 is a date field. Header 2/cell 1 is a dropdown field (30, 60, 90,120, custom),.
    Header2 cell2 not sure what field to use date or text?
    thank you

    Never mind I figured it out. Thanks

  • Outlook 2010 Calendar - Number of weeks displayed in Month view

    Is there any way to change the default number of weeks (6) that are displayed in the Month view?  On wide screens it leaves very few lines able to be viewed per day.  I know I can change the number temporarily by highlighting the number
    of weeks I want in the smaller month view in the To-Do Bar, but that view doesn't persist.  I also know that I can minimize the ribbon.
    I my old Outlook 2003 the default was 5 weeks which was at least a bit better.

    The real answer is given: No, this is not configurable as it depends on how many weeks a month spans; rarely this is 4 weeks, most often this is 5 weeks, sometimes this is 6 weeks. It is called the "'Month" view, not the "4-weeks view" or anything like
    that.
    Your feature request is of course valid and to submit it as such, it is best to contact Microsoft Support by phone. You may need to provide credit card information to open a case but it of course won't be charged for a feature request. You'll get a reference
    ID so you can track the status of your request.
    You may want to refine your request with a business case as well and give a clear example of what you want it to look like and what exactly should be configurable.
    For instance, the default Multi-Week View should show; last week, this week and the next 2 weeks.
    Robert Sparnaaij
    [MVP-Outlook]
    Outlook guides and more: HowTo-Outlook.com
    Outlook Quick Tips: MSOutlook.info

  • How to calculate Number of weeks in Year ?? urgent

    hi gurus,
    i have to calculate the number of weeks in year. could you please suggest me is there any function module for that or do we need to create variable to get the number of weeks?
    regards

    Get some pointers frm
    http://sap.ittoolbox.com/groups/technical-functional/sap-dev/help-on-function-day_get_week-1067350
    Re: printing calender
    Calculating the number of days of a year including leap year
    Re: How to calculate No.of Weeks?

  • Matrix : how add number in column (V_-1)

    hi,
    i have created a matrix using screen painter but how can i add number under the # column (V_-1) ? do it in screen painter or coding ? As i notice, by the default, the number is increment as the record increase .
    e.g in the Matrix (it is inside a new screen)
    V_-1      V_0            V_1
           Doc Num       Value
    1                 1              1
    2                2                88
    3               3                  409
    Thanks

    Hi
    You have to write code for this , each time when you add or delete row you have to assign the row no through code.
    Dim oMatrix As SAPbouiCOM.Matrix = form.Items.Item("matrix").Specific
                        Dim oEdit As SAPbouiCOM.EditText
                        For iRowCount As Integer = 1 To oMatrix.RowCount
                            oEdit = oMatrix.GetCellSpecific("V_-1", iRowCount)
                            Try
                                oEdit.Value = iRowCount.ToString.Trim
                            Catch ex As Exception
                            End Try
                           ... Or
                            form.DataSources.UserDataSources.Item("RowNo").ValueEx = iRowCount.ToString
                        Next
          form.DataSources.UserDataSources.Item("RowNo").ValueEx = iRowCount.ToString for this to work you have to add a user data source ("RowNo") to your form and bind it with your column
    Hope this helps you
    Regards
    Arun

  • Create Char. Number of week

    hi,
    I need to create a new char., named "Number of week". Number of week means, that it has the values: 1, 2, 3, 4 and 5.and from 0CALDAY it should display which week of the month it is. if it is 2008-10-10, then this record should be assigned to 2 week.
    1 week: 1 - 7day;
    2 week: 8 - 14day;
    3 week: 15 - 21day;
    4 week: 22 - 28day;
    5 week: 29 - 31day.
    how to create this characteristic? thanks

    Hi Andrius
      U can use time characteristic  /BI0/OICALWEEK - calweek and
       U can use this function module u will pass the calday as input and u will get week as output
          data : l_calday type /bi0/calday.
            l_calday = <source_fields>-/bi0/calday.
            call function 'DATE_GET_WEEK'
                    exporting
                    date = l_calday
                    importing
                    week = RESULT
                    exceptions
                    date_invalid = 1
                    others = 2.
    Regards
    vamsi

  • Number of weekly working hours 48 exceeded error in Planned Working Time

    Hi,
    I have a group of employees called labors who work all 7 days a week, 10 hours a day so I have created the work schedule accordingly. When I maintain the Planned Working Time infotype, the system gives a warning message "Number of weekly working hours 48 exceeded". In table T77S0, value of PERCK is set to D & DAYWK is set to 700. Please guide me to solve the problem

    Hi,
    VJ for which country are you implementing this? Some countries have regulations that a person's working time may not exceed XX hours.
    cheers
    Ajay

  • Finding the number of weeks or months in a Date range

    I have a couple of text boxes that a user inputs a start date and an end date. What I want to know is there a way to tell the number of months or the the number of days in this date range?
    For example:
    Start Date = 02/12/2004
    End Date = 03/12/2004
    The number of weeks = 4 //May not be accurate, just showing an example.
    The number of months = 2

    For month, I would define it as the dates that fall in the actual calendar month. If my start date input from the user is 1/21/04, then I want to define a time period of 1/21/04 through 1/31/04 to be included in the first month. I know that it is not an actual month, but I am trying to make graphs based on monthly performance.
    For weeks, I want the days to run Sunday through Saturday. If the first date starts on a Wednesday, then I want my first week to include days only Wednesday through Saturday.

  • How To Add Number Days in jsp

    Hi,
    I want to add number of days in a date string using jsp.
    <%--
        Document   : try5
        Created on : May 20, 2008, 6:00:20 PM
        Author     : thamaraiselvan
    --%>
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
        </head>
        <body>
            <%
            String datetxt="2008-05-20";
            %>
        </body>
    </html>How to add 30,90,180,365 days in that String datetxt value.
    Thanks Alot....

    Hi,
    How to format a string value into a Date.
    I typed the following code .but its gives a exception.
    <%--
        Document   : try5
        Created on : May 20, 2008, 6:00:20 PM
        Author     : thamaraiselvan
    --%>
    <%@page contentType="text/html" pageEncoding="UTF-8" import="java.sql.*,java.util.Date,java.util.Calendar,java.text.SimpleDateFormat" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <title>JSP Page</title>
        </head>
        <body>
            <%
            try
            String datetxt="2008-05-20";
            int e=30;
           // calendar.set(Calendar.DAY,calendar.get(Calendar.DAY)+30);
           // Calendar cal = Calendar.getInstance();
            //Date today = cal.getTime();
            SimpleDateFormat fmt =new SimpleDateFormat("yyyy-MM-dd");
            String thamu = fmt.format(datetxt);
            out.println(thamu);
            catch(Exception e)
                out.println(e);
            %>
        </body>
    </html>Exception Like This :
    java.lang.IllegalArgumentException: Cannot format given Object as a Date .
    After Formatting to date i want to add 180 days from '2008-05-20' .
    Please Help me...
    Thanks Alot....

  • To add number of senders mail addresses

    in the following code how   there is one sender address how do i make it to  3 senders i mean add the number of senders
    REPORT  ZSPOOL5 NO STANDARD PAGE HEADING.
    PARAMETER: P_EMAIL1 LIKE SOMLRECI1-RECEIVER,
               P_SENDER LIKE SOMLRECI1-RECEIVER,
               P_DELSPL AS CHECKBOX.
    *ranges:
    *DATA DECLARATION
    DATA: GD_RECSIZE TYPE I.
    Spool IDs
    TYPES: BEGIN OF T_TBTCP.
            INCLUDE STRUCTURE TBTCP.
    TYPES: END OF T_TBTCP.
    DATA: IT_TBTCP TYPE STANDARD TABLE OF T_TBTCP INITIAL SIZE 0,
          WA_TBTCP TYPE T_TBTCP.
    Job Runtime Parameters
    DATA: GD_EVENTID LIKE TBTCM-EVENTID,
          GD_EVENTPARM LIKE TBTCM-EVENTPARM,
          GD_EXTERNAL_PROGRAM_ACTIVE LIKE TBTCM-XPGACTIVE,
          GD_JOBCOUNT LIKE TBTCM-JOBCOUNT,
          GD_JOBNAME LIKE TBTCM-JOBNAME,
          GD_STEPCOUNT LIKE TBTCM-STEPCOUNT,
          GD_ERROR    TYPE SY-SUBRC,
          GD_RECIEVER TYPE SY-SUBRC.
    DATA:  W_RECSIZE TYPE I.
    DATA: GD_SUBJECT   LIKE SODOCCHGI1-OBJ_DESCR,
          IT_MESS_BOD LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
          IT_MESS_ATT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
          GD_SENDER_TYPE     LIKE SOEXTRECI1-ADR_TYP,
          GD_ATTACHMENT_DESC TYPE SO_OBJ_NAM,
          GD_ATTACHMENT_NAME TYPE SO_OBJ_DES.
    Spool to PDF conversions
    DATA: GD_SPOOL_NR LIKE TSP01-RQIDENT,
          GD_DESTINATION LIKE RLGRAP-FILENAME,
          GD_BYTECOUNT LIKE TST01-DSIZE,
          GD_BUFFER TYPE STRING.
    Binary store for PDF
    DATA: BEGIN OF IT_PDF_OUTPUT OCCURS 0.
            INCLUDE STRUCTURE TLINE.
    DATA: END OF IT_PDF_OUTPUT.
    CONSTANTS:C_DEV LIKE  SY-SYSID VALUE 'DEV',
              C_NO(1)  TYPE C   VALUE ' ',
              C_DEVICE(4) TYPE C   VALUE 'LOCL'.
    *START-OF-SELECTION.
    START-OF-SELECTION.
    Write statement to represent report output. Spool request is created
    if write statement is executed in background. This could also be an
    ALV grid which would be converted to PDF without any extra effort
      WRITE 'Hello World'.
      NEW-PAGE.
      COMMIT WORK.
    NEW-PAGE PRINT OFF.
      IF SY-BATCH EQ 'X'.
        PERFORM GET_JOB_DETAILS.
        PERFORM OBTAIN_SPOOL_ID.
    Alternative way could be to submit another program and store spool
    id into memory.
    *submit ZSPOOLTOPDF2
           to sap-spool
           spool parameters   %_print
           archive parameters %_print
           without spool dynpro
           and return.
    Get spool id from program called above
    IMPORT w_spool_nr FROM MEMORY ID 'SPOOLTOPDF'.
        PERFORM CONVERT_SPOOL_TO_PDF.
         PERFORM PROCESS_EMAIL.
        IF P_DELSPL EQ 'X'.
          PERFORM DELETE_SPOOL.
        ENDIF.
        IF SY-SYSID = C_DEV.
          WAIT UP TO 5 SECONDS.
          SUBMIT RSCONN01 WITH MODE   = 'INT'
                          WITH OUTPUT = 'X'
                          AND RETURN.
        ENDIF.
      ELSE.
        SKIP.
        WRITE:/ 'Program must be executed in background in-order for spool',
                'request to be created.'.
      ENDIF.
          FORM obtain_spool_id                                          *
    FORM OBTAIN_SPOOL_ID.
      CHECK NOT ( GD_JOBNAME IS INITIAL ).
      CHECK NOT ( GD_JOBCOUNT IS INITIAL ).
      SELECT * FROM  TBTCP
                     INTO TABLE IT_TBTCP
                     WHERE      JOBNAME     = GD_JOBNAME
                     AND        JOBCOUNT    = GD_JOBCOUNT
                     AND        STEPCOUNT   = GD_STEPCOUNT
                     AND        LISTIDENT   <> '0000000000'
                     ORDER BY   JOBNAME
                                JOBCOUNT
                                STEPCOUNT.
      READ TABLE IT_TBTCP INTO WA_TBTCP INDEX 1.
      IF SY-SUBRC = 0.
       MESSAGE S004(ZDD) WITH GD_SPOOL_NR.
        GD_SPOOL_NR = WA_TBTCP-LISTIDENT.
       MESSAGE S004(ZDD) WITH GD_SPOOL_NR.
      ELSE.
        MESSAGE S005(ZDD).
      ENDIF.
    ENDFORM.                    "obtain_spool_id
          FORM get_job_details                                          *
    FORM GET_JOB_DETAILS.
    Get current job details
      CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
        IMPORTING
          EVENTID                 = GD_EVENTID
          EVENTPARM               = GD_EVENTPARM
          EXTERNAL_PROGRAM_ACTIVE = GD_EXTERNAL_PROGRAM_ACTIVE
          JOBCOUNT                = GD_JOBCOUNT
          JOBNAME                 = GD_JOBNAME
          STEPCOUNT               = GD_STEPCOUNT
        EXCEPTIONS
          NO_RUNTIME_INFO         = 1
          OTHERS                  = 2.
    ENDFORM.                    "get_job_details
          FORM convert_spool_to_pdf                                     *
    FORM CONVERT_SPOOL_TO_PDF.
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
        EXPORTING
          SRC_SPOOLID              = GD_SPOOL_NR
          NO_DIALOG                = C_NO
          DST_DEVICE               = C_DEVICE
        IMPORTING
          PDF_BYTECOUNT            = GD_BYTECOUNT
        TABLES
          PDF                      = IT_PDF_OUTPUT
        EXCEPTIONS
          ERR_NO_ABAP_SPOOLJOB     = 1
          ERR_NO_SPOOLJOB          = 2
          ERR_NO_PERMISSION        = 3
          ERR_CONV_NOT_POSSIBLE    = 4
          ERR_BAD_DESTDEVICE       = 5
          USER_CANCELLED           = 6
          ERR_SPOOLERROR           = 7
          ERR_TEMSEERROR           = 8
          ERR_BTCJOB_OPEN_FAILED   = 9
          ERR_BTCJOB_SUBMIT_FAILED = 10
          ERR_BTCJOB_CLOSE_FAILED  = 11
          OTHERS                   = 12.
      CHECK SY-SUBRC = 0.
    Transfer the 132-long strings to 255-long strings
      LOOP AT IT_PDF_OUTPUT.
        TRANSLATE IT_PDF_OUTPUT USING ' ~'.
        CONCATENATE GD_BUFFER IT_PDF_OUTPUT INTO GD_BUFFER.
      ENDLOOP.
      TRANSLATE GD_BUFFER USING '~ '.
      DO.
        IT_MESS_ATT = GD_BUFFER.
        APPEND IT_MESS_ATT.
        SHIFT GD_BUFFER LEFT BY 255 PLACES.
        IF GD_BUFFER IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
    ENDFORM.                    "convert_spool_to_pdf
          FORM process_email                                            *
    FORM PROCESS_EMAIL.
      DESCRIBE TABLE IT_MESS_ATT LINES GD_RECSIZE.
      CHECK GD_RECSIZE > 0.
      PERFORM SEND_EMAIL USING P_EMAIL1.
    perform send_email using p_email2.
    ENDFORM.                    "process_email
          FORM send_email                                               *
    -->  p_email                                                       *
    FORM SEND_EMAIL USING P_EMAIL.
      CHECK NOT ( P_EMAIL IS INITIAL ).
      REFRESH IT_MESS_BOD.
    Default subject matter
      GD_SUBJECT         = 'Subject'.
      GD_ATTACHMENT_DESC = 'Attachname'.
    CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
      IT_MESS_BOD        = 'Message Body text, line 1'.
      APPEND IT_MESS_BOD.
      IT_MESS_BOD        = 'Message Body text, line 2...'.
      APPEND IT_MESS_BOD.
    If no sender specified - default blank
      IF P_SENDER EQ SPACE.
        GD_SENDER_TYPE  = SPACE.
      ELSE.
        GD_SENDER_TYPE  = 'INT'.
      ENDIF.
    Send file by email as .xls speadsheet
      PERFORM SEND_FILE_AS_EMAIL_ATTACHMENT
                                   TABLES IT_MESS_BOD
                                          IT_MESS_ATT
                                    USING P_EMAIL
                                          'Example .xls documnet attachment'
                                          'PDF'
                                          GD_ATTACHMENT_NAME
                                          GD_ATTACHMENT_DESC
                                          P_SENDER
                                          GD_SENDER_TYPE
                                 CHANGING GD_ERROR
                                          GD_RECIEVER.
    ENDFORM.                    "send_email
          FORM delete_spool                                             *
    FORM DELETE_SPOOL.
      DATA: LD_SPOOL_NR TYPE TSP01_SP0R-RQID_CHAR.
      LD_SPOOL_NR = GD_SPOOL_NR.
      CHECK P_DELSPL <> C_NO.
      CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
        EXPORTING
          SPOOLID = LD_SPOOL_NR.
    ENDFORM.                    "delete_spool
    *&      Form  SEND_FILE_AS_EMAIL_ATTACHMENT
          Send email
    FORM SEND_FILE_AS_EMAIL_ATTACHMENT TABLES IT_MESSAGE
                                              IT_ATTACH
                                        USING P_EMAIL
                                              P_MTITLE
                                              P_FORMAT
                                              P_FILENAME
                                              P_ATTDESCRIPTION
                                              P_SENDER_ADDRESS
                                              P_SENDER_ADDRES_TYPE
                                     CHANGING P_ERROR
                                              P_RECIEVER.
      DATA: LD_ERROR    TYPE SY-SUBRC,
            LD_RECIEVER TYPE SY-SUBRC,
            LD_MTITLE LIKE SODOCCHGI1-OBJ_DESCR,
            LD_EMAIL LIKE  SOMLRECI1-RECEIVER,
            LD_FORMAT TYPE  SO_OBJ_TP ,
            LD_ATTDESCRIPTION TYPE  SO_OBJ_NAM ,
            LD_ATTFILENAME TYPE  SO_OBJ_DES ,
            LD_SENDER_ADDRESS LIKE  SOEXTRECI1-RECEIVER,
            LD_SENDER_ADDRESS_TYPE LIKE  SOEXTRECI1-ADR_TYP,
            LD_RECEIVER LIKE  SY-SUBRC.
      DATA:   T_PACKING_LIST LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
              T_CONTENTS LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
              T_RECEIVERS LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE,
              T_ATTACHMENT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
              T_OBJECT_HEADER LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
              W_CNT TYPE I,
              W_SENT_ALL(1) TYPE C,
              W_DOC_DATA LIKE SODOCCHGI1.
      LD_EMAIL   = P_EMAIL.
      LD_MTITLE = P_MTITLE.
      LD_FORMAT              = P_FORMAT.
      LD_ATTDESCRIPTION      = P_ATTDESCRIPTION.
      LD_ATTFILENAME         = P_FILENAME.
      LD_SENDER_ADDRESS      = P_SENDER_ADDRESS.
      LD_SENDER_ADDRESS_TYPE = P_SENDER_ADDRES_TYPE.
    Fill the document data.
      W_DOC_DATA-DOC_SIZE = 1.
    Populate the subject/generic message attributes
      W_DOC_DATA-OBJ_LANGU = SY-LANGU.
      W_DOC_DATA-OBJ_NAME  = 'SAPRPT'.
      W_DOC_DATA-OBJ_DESCR = LD_MTITLE .
      W_DOC_DATA-SENSITIVTY = 'F'.
    Fill the document data and get size of attachment
      CLEAR W_DOC_DATA.
      READ TABLE IT_ATTACH INDEX W_CNT.
      W_DOC_DATA-DOC_SIZE =
         ( W_CNT - 1 ) * 255 + STRLEN( IT_ATTACH ).
      W_DOC_DATA-OBJ_LANGU  = SY-LANGU.
      W_DOC_DATA-OBJ_NAME   = 'SAPRPT'.
      W_DOC_DATA-OBJ_DESCR  = LD_MTITLE.
      W_DOC_DATA-SENSITIVTY = 'F'.
      CLEAR T_ATTACHMENT.
      REFRESH T_ATTACHMENT.
      T_ATTACHMENT[] = IT_ATTACH[].
    Describe the body of the message
      CLEAR T_PACKING_LIST.
      REFRESH T_PACKING_LIST.
      T_PACKING_LIST-TRANSF_BIN = SPACE.
      T_PACKING_LIST-HEAD_START = 1.
      T_PACKING_LIST-HEAD_NUM = 0.
      T_PACKING_LIST-BODY_START = 1.
      DESCRIBE TABLE IT_MESSAGE LINES T_PACKING_LIST-BODY_NUM.
      T_PACKING_LIST-DOC_TYPE = 'RAW'.
      APPEND T_PACKING_LIST.
    Create attachment notification
      T_PACKING_LIST-TRANSF_BIN = 'X'.
      T_PACKING_LIST-HEAD_START = 1.
      T_PACKING_LIST-HEAD_NUM   = 1.
      T_PACKING_LIST-BODY_START = 1.
      DESCRIBE TABLE T_ATTACHMENT LINES T_PACKING_LIST-BODY_NUM.
      T_PACKING_LIST-DOC_TYPE   =  LD_FORMAT.
      T_PACKING_LIST-OBJ_DESCR  =  LD_ATTDESCRIPTION.
      T_PACKING_LIST-OBJ_NAME   =  LD_ATTFILENAME.
      T_PACKING_LIST-DOC_SIZE   =  T_PACKING_LIST-BODY_NUM * 255.
      APPEND T_PACKING_LIST.
    Add the recipients email address
      CLEAR T_RECEIVERS.
      REFRESH T_RECEIVERS.
      T_RECEIVERS-RECEIVER = LD_EMAIL.
      T_RECEIVERS-REC_TYPE = 'U'.
      T_RECEIVERS-COM_TYPE = 'INT'.
      T_RECEIVERS-NOTIF_DEL = 'X'.
      T_RECEIVERS-NOTIF_NDEL = 'X'.
      APPEND T_RECEIVERS.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
        EXPORTING
          DOCUMENT_DATA              = W_DOC_DATA
          PUT_IN_OUTBOX              = 'X'
          SENDER_ADDRESS             = LD_SENDER_ADDRESS
          SENDER_ADDRESS_TYPE        = LD_SENDER_ADDRESS_TYPE
          COMMIT_WORK                = 'X'
        IMPORTING
          SENT_TO_ALL                = W_SENT_ALL
        TABLES
          PACKING_LIST               = T_PACKING_LIST
          CONTENTS_BIN               = T_ATTACHMENT
          CONTENTS_TXT               = IT_MESSAGE
          RECEIVERS                  = T_RECEIVERS
        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.
    Populate zerror return code
      LD_ERROR = SY-SUBRC.
    Populate zreceiver return code
      LOOP AT T_RECEIVERS.
        LD_RECEIVER = T_RECEIVERS-RETRN_CODE.
      ENDLOOP.
    ENDFORM.                    "send_file_as_email_attachment

    hi ,
    just loop at LD_SENDER_ADDRESS which is there in fm
    'SO_DOCUMENT_SEND_API1'

  • Custom field to add number of packages shipped along with Delivery

    Hi Sap Experts,
    We have scenario, we have created sales order with quantity 1(Like soft copy or hard copy of CD).
    Now we want to create delivery with sales order and quantity is 1(Copy from sales order).
    Our requirement is some time we have to send additional things like hard copy of manual or complement gift which we are not entering in sales order.
    Exp: Sales order- quantity 1.
    Want to deliver quantity 1(+ manual+ complement gift, these items are not part of standard order)
    For more clarity, we have to add one field and want to enter number (How many items we have send along with main materials and these items are not relevant for pricing also).
    So requirement is add one additional field in delivery header/item.
    Customer doesn’t want to use Free of goods or BOM which we have propose him. How to customize standard table and standard program.
    Kindly suggest.
    Regards,
    Kotli

    Hi All,
    We don't want to use BOM options.
    I have also checked "No. of packages'` at header level but my requirement is at item level.So we are also exploring the option of  APPEND  standard table and add this field.
    Kindly let me know  if we can do it without Appending standard table.
    Regards,
    Field to add to enter number of items which are  shipped to customer 

Maybe you are looking for

  • Can't omit both the rowset and the row element?

    consider the simple document below. Notice that row-element and rowset-element are both empty, so neither type of element will be generated. Also notice that the xsql:query tag is embedded in other tags. I get "oracle.xml.sql.OracleXMLSQLException: T

  • Problem with Adobe Forms - Layout designer just closed.

    Dear All, When I start to edit some PDF form in SFP transaciton I get crash all of SAP GUI programms on my PC. It all  just has closed and that's all. No errors, no message. This is heppened whith installed: Adobe Life cycle Designer 7.0 Adobe Life c

  • Which is the better low-cost 24" Alum refurb'd iMac and why?

    OK, I admit I don't pay enough attention. I have a couple year old 24" White iMac with 2.4GHz processor and 500Gb drive, and I'm thinking of "upgrading" to an Alum iMac for no particular reason. So I've been looking at the refurbs in the Apple store.

  • ItemEditEnd called multiple times

    Hi. Am using a datagrid and using an item editor and item render for that. Item Renderer --> To give background color and Item Editor - to show a date picker. While implementing this, my need is to open a popup when we enter date. But, am getting the

  • Wait time in Test Stand

    I have an application in TS where I need to measure a leak rate. How do I set a "wait time" in Test Stand sequence so I can measure the same test point after certain elapsed time.