Function module for adding number of months to the date

Hi,
Is there any function module to get the date by adding number of months...
Regards,
Yadagiri

Normally all SAP FM will return that value. As 1 month in general means 30 days only.
You can check the code in this link for logig of 31 -
add month in the date to find next date
Regards,
Amit

Similar Messages

  • Function module for converting number to exponential???

    Hi All
      please tell me Function module for converting number to exponential.
    Deepak

    try:
    REPORT Zconvertf.
    parameters p1 type p decimals 2 default '4711.99'.
    data f1 type f.
    move p1 to f1.
    write: / p1, f1.
    hope that helps
    Andreas

  • Function module for sundays in a month

    hai all,
    i need a function module for calculating noof sundays in a month

    Hi Satya,
    Please check this code which is checked for syntax also. Just copy and paste the same in abap editor and check the output.
    Calculation of number of sundays ****
    DAta : month1(2) type c,
           week1 type i,
           date1 type sy-datum,
           val1 type sy-datum,
           day1 type SCAL-INDICATOR,
           no_sundays type i.
    week1 = 5.
    date1 = '20060502'.
    *- Function Module to fetch the Last day of the Month
    CALL FUNCTION 'LAST_DAY_OF_MONTHS'
    EXPORTING
    DAY_IN = date1
    IMPORTING
    LAST_DAY_OF_MONTH = VAL1.
    *- Function Module to get the day of the week
    CALL FUNCTION 'DATE_COMPUTE_DAY'
    EXPORTING
    DATE = VAL1
    IMPORTING
    DAY = DAY1.
    *- Calculation of number of sundays
    month1 = val1+6(2).
    write : / month1.
    if month1 = 31.
    if DAY1 <= 2 or DAY1 = 7.
    no_sundays = week1.
    else.
    no_sundays = week1 - 1.
    endif.
    elseif month1 = 30.
    if DAY1 = 1 or DAY1 = 7.
    no_sundays = week1.
    else.
    no_sundays = week1 - 1.
    endif.
    elseif month1 = 29.
    if DAY1 = 7.
    no_sundays = week1.
    else.
    no_sundays = week1 - 1.
    endif.
    elseif month1 = 28.
    no_sundays = 4.
    endif.
    write : / no_sundays.
    If found helpful, please do reward.

  • How to config Check Digits function module for Student Number Validation

    Hi SLCM Experts,
    In the SAP-SLCM, How to use check digits function module for validate student number.  Just only config it or need to customizing program.
    *Any idea to student number validation in SLCM?*
    Best Regards,
    Suvatchai K.

    Hi ,
    Can you expalin it further ?
    You configure the St. no in piq_matr . And set it  as external or internal no. range which suits your business .
    What is the validation you are looking for ?
    Regards
    Gajalakshmi

  • Function Modul for Order Number from VA02

    Hallo
    i have a delivery number and want read the order number from VA02.
    Of course, select the database from LIKP --> LIPS --> VBKD is possible but 
    maybe it has function modul for read the order number from transaction VA02.
    THX ANU

    Hi,
    I think is better recover the data directly from DB tables (in table LIPS you have the fields VGBEL, VGPOS, VGTYP ) if you only want the order number.
    With the delivery number you only need to acces 1 table. If you use a FM, you will recover this data and a few fields that is not interesting for you. The access to table LIPS is using table index (delivery number)
    Regards,
    Pepe

  • Any BAPI/Function Module for adding new record with dates in PA0027

    Hi all,
    I am tryig to find is there any BAPI/Function module for updating new record with Start Date and End date for specified Personal Number in PA0027 Table.
    In PA0027 table i will be passing start date and end date for selected personal number, it needs to add new record with this details in the table checking the condition that this start date and end dates should not be between any of of start date and end dates for the specified personal number.
    thanks for ur time.
    Murali

    Hi Raj/Suresh thanks for ur answers.
    but i am having a problem,i gave this values.
    INFTY               -
                0027
    NUMBER              -
                00000010
    SUBTYPE             -
                010
    OBJECTID
    LOCKINDICATOR
    VALIDITYEND         -
                03/12/2006
    VALIDITYBEGIN       -
                03/01/2006
    RECORDNUMBER        -
                000
    RECORD              -
                P0027
    OPERATION           -
                CHK
    TCLAS               -
                A
    DIALOG_MODE         -
                0
    NOCOMMIT            -
                Y
    VIEW_IDENTIFIER
    SECONDARY_RECORD
    i am getting short dump saying that
    The source field is too short.
    The current program, "SAPLHRMM", tried to assign a field to a field symbo
    However, the field is shorter than the type of the field symbol, which
    is not allowed.
    The statement in question is in the form ASSIGN f TO <fs> CASTING or
    ASSIGN f TO <fs> with a field symbol that was created using the
    STRUCTURE addition.
    I tried  operation - Chage,Create (same thing for all inputs)
    is this correct funtion moduel for my requirment?
    what ever i am passing the start and end dates this should check in the table records with this personal number and if this start date and end dates are not between of any start and end dates then it should add new record with this dates.
    Thanks for ur time.
    Murali.

  • Function module for finding number of records in table

    Do we have any function module to find number of records in a table?
    Thanks,
    Shweta

    use the EM_GET_NUMBER_OF_ENTRIES. You just have to write your table name into the input table IT_TABLES in the TABNAME field

  • Function Module for getting Number ranges between two number

    Hi guys,
    Is there any Function module which provide us the number range between two numbers?
    For Ex:If i give 1 and 10 to FM it must give me 1
    2
    3
    4.....upto 10.
    is there any FM for doing this,but i'm not able to find exact Fm for same.
    I can write small piece of code for getting number ranges, but if i get FM it could save little work.

    Hi
    But why do u need a fm, can't you do it by yourself?
    DATA: FROM_NUMBER TYPE I VALUE 1,
          TO_NUMBER   TYPE I VALUE 15.
    DATA: NUMBER            TYPE I.
    DATA: BEGIN OF T_NUMBER OCCURS 0,
                  NR TYPE I,
              END    OF T_NUMBER.
    NUMBER = FROM_NUMBER.
    DO.
      IF NUMBER <= TO_NUMBER.
        T_NUMBER-NR = NUMBER.
        APPEND T_NUMBER.
      ELSE.
        EXIT.
      ENDIF.
      NUMBER = NUMBER + 1.
    ENDDO.
    LOOP AT T_NUMBER.
      WRITE: / T_NUMBER-NR.
    ENDLOOP.
    Max

  • Function Module for adding components to Production Order

    Is there a function module that can add components to an existing production order ?I believe CO_BC_INSERT_CMP_OF_ORDERS can do the trick but seems this alone would not suffice .Your feedback is very much appreciated

    Sudhir,
    U r right. we need to call the function module CO_BC_INSERT_CMP_OF_ORDERS with flg_banf_create  = X and apt entries in the component details table resbb_ins. Doing this is enough. I guess u have a problem passing correct data in the internal table. For the data you do not know, you will have to pass default data.
    Hope this helps.

  • Function module to find number of table entries in Data base table

    Hi All
       I have the urgent requirement to find out the number of table entries in a table  using the function Module.
    if u know the Function Module name please let me know
    Thanks & Regards
    Rajmohan.G

    You can calculate the total number of records like this.
    TABLES : ztable.
    DATA cnt type I.
    Select count( * ) into cnt FROM ztable.
    Regards,
    Santosh

  • Function Module for adding Leading Zero's to a specific field

    Hi,
    Can anyone please provide a Function that will do the following:
    1. Take the value of the field
    2. Take the field type
    3. Output the value of the field with leading zero's.
    Anything similar would be very helpful.
    Thank You & Best Regards,
    John

    Sure use the function  CONVERSION_EXIT_ALPHA_INPUT, this will add leading zeros to a character based field of any length.
    data: lv_c(10) type c value '123'.
    call function 'CONVERSION_EXIT_ALPHA_INPUT'
              exporting
                      input = lv_c
              importing
                     output = lv_c.
    write:/ lv_c.
    Regards,
    Rich Heilman

  • Function modules for the following

    Hi,
    I want to know the function modules for the following purposes.
    1) Check whether a date is valid or not
    2) Calculate the no of days between two dates.
    Expecting an early response.
    Thanks n Regards,
    Amit

    Hi,
    PARAMETERS: p_list LIKE t009b-bumon AS LISTBOX
                         VISIBLE LENGTH 11 OBLIGATORY ,
                p_list1 LIKE t009b-bdatj OBLIGATORY.
    SELECTION-SCREEN POSITION POS_HIGH.
    PARAMETERS: p_list2 LIKE t009b-bumon AS LISTBOX
                          VISIBLE LENGTH 11 OBLIGATORY,
                p_list3 LIKE t009b-bdatj OBLIGATORY.
    Calling Function Module for calculating no of days between the
    selected period
        CALL FUNCTION 'NUMBER_OF_DAYS_PER_MONTH_GET'
             EXPORTING
                  par_month = p_list
                  par_year  = p_list1
             IMPORTING
                  par_days  = ws_n_days.
        CALL FUNCTION 'NUMBER_OF_DAYS_PER_MONTH_GET'
             EXPORTING
                  par_month = p_list2
                  par_year  = p_list3
             IMPORTING
                  par_days  = ws_n_days1.
    For Concatenating the month and year into the date format
        CONCATENATE  p_list1  p_list ws_i INTO ws_c_date1.
        CONCATENATE p_list3  p_list2 ws_n_days1 INTO ws_c_date2.
      date = ws_c_date1 - ws_c_date2.
    In the above sample code the selection screen has month and year as input.
    Also check this link
    http://www.sapdevelopment.co.uk/tips/date/datehome.htm
    Check FM
    <b>RP_CALC_DATE_IN_INTERVAL</b> Add/subtract years/months/days from a date
    <b>SD_DATETIME_DIFFERENCE</b> Give the difference in Days and Time for 2 dates
    <b>Also for checking valid date:</b>
    U can specify the date field as
    Select-options:  s_date like likp-date(similar to ur requirement)
    This itself ceck for the valid date no seperate validation needed.
    Thanks & Regards,
    Judith.

  • Function module for Mass uploadnotifications in Quality Management

    Hi  Experts,
    I need function module for quality management which MASS UPLOAD THE QM NOTIFICATIONS.
    Thanks

    Hi,
    For updation use BAPI_QUALNOT_ADD_DATA.
    Hope it helps.
    Regards
    Hiren K.Chitalia

  • How to findout the Function module for a particular object

    Hello friends,
       Related to my thread, there was one thread in the forum,to find out the function module for a particular object.I tried the solution provided my our experts but couldn't got the results.Thats why i am putting this thread again.
      I want to find out the function modules used for the particular object, i.e. Production order.
       solution i tried is, first go to T.C SE37, then in function module field put the object name like Production order and enter, than it will show another screen, there also put object name in function module field and than press enter, it will show all the function modules available for that object.
        So could you guys help me out to find out where i am wrong in the process of finding out the function module for a particular object.
                           Plz don't bother abt the point.Helpful answers will definitely get awarded.
                                Thanking you guys for your valuable support till now and hoping to get in future too.

    Dear
    When the problem is solved please give points too. Otherwise why people will help others, give time and share their valuable knowledge. This will build up self confidence.
    If not solved and closing, then mention the difficulties what u exactly looking for. Simpy closing is not enough because who ever is providing solution will not able to know the real problem.
    How to give points I believe u already know that and need not explain.
    I had seen many times this problem with others too. Even if the problem is totally resolved they give 2 in stead of 10.
    Edited by: BNR on Sep 21, 2008 6:10 PM

  • Function module for uploading file in background

    hi friends
    i am working on Inbound IDOC interface where in which i am creating a function module for that,
    in which based on the idoc received , the interface has to choose the file from the shared folder and it has to move its contents to an internal table
    can anybody suggest me what function module can i use.
    we cant use GUI_upload,or cl_gui_frontend_services=>gui_upload
    because this requires an user to interact in mines it is not the case
    thanks in advance
    with regards
    s.janagar

    hi,
    check this thread,you will get idea how to transfer data from file to internal table.
    [https://forums.sdn.sap.com/click.jspa?searchID=17706879&messageID=6281020]

Maybe you are looking for