Function module that will return week  details

Anyone know Sap FM that will return Week  details(as below)for a given start and end dates (similar to the function module HR_99S_INTERVAL_BETWEEN_DATES which  returns details for a month) independent of factory calendar
I am expecting
Inputs
Start Date  - 01/01/2005
End Date   -  05/05/2006
outputs
WK YEAR BEGDA      ENDDA      
02 2005 01/03/2005 01/09/2005 
03 2005 01/10/2005 01/16/2005 
04 2005 01/01/2005 01/23/2005
Thank, Bill

Hi Bill,
FM is <b>GET_WEEK_INFO_BASED_ON_DATE</b>
Here's a test-program for your requirement:
REPORT zforum09 LINE-SIZE 255.
PARAMETERS:fdate  LIKE sy-datum DEFAULT '20050103',
           tdate  LIKE sy-datum DEFAULT '20060505'.
DATA : BEGIN OF itab OCCURS 0,
       week LIKE scal-week,
       from LIKE sy-datum,
       to LIKE sy-datum,
       END OF itab,
       next LIKE sy-datum.
next = fdate.
WHILE tdate > itab-to.
  CALL FUNCTION 'GET_WEEK_INFO_BASED_ON_DATE'
       EXPORTING
            date   = next
       IMPORTING
            week   = itab-week
            monday = itab-from
            sunday = itab-to.
  next = itab-from + 7.
  APPEND itab.
ENDWHILE.
LOOP AT itab.
  WRITE:/ itab-week+4(2),
          itab-week(4),
          itab-from,
          itab-to.
ENDLOOP.
Regards Andreas

Similar Messages

  • Function Module that will retrieve the parameters for a given function Modu

    Hi
    We have a requirement where we will be calling Function Module that will be maintained in a table entry. How we will determine what is the parameters that is required by this function module. Is there a FM that will suffice the requirement.
    Thanks in advance
    arghadip

    Hi,
    You have to write a custom code for that. Use the table FUPARAREF to retrieve the parameters for a function module. Give function module name as input.
    Pls reward points if solved your issue.
    Regards,
    Renjith Michael.

  • Function Module that will retrieve the Field Catalogs of a Display Variant

    Hello Experts,
    Are there any function modules that I can use to retrieve the field catalogs (fields to be displayed in ALV report) by passing the display variant name?
    An RFC needs to apply this to determine which field(data) to be passed to XI (calling system) depending on user login.
    Thanks in advance!

    These are the various FM available for Variants (field Layout)
    REUSE_ALV_VARIANT_ALL_MAINTAIN Maintain all display variants for one object
    REUSE_ALV_VARIANT_DEFAULT_GET  Read default display variant (description only, w/o field catalog)
    REUSE_ALV_VARIANT_EXISTENCE    Checks whether a display variant exists
    REUSE_ALV_VARIANT_F4           Display variant selection dialog box
    REUSE_ALV_VARIANT_MAINTAIN     Definition of a display variant outside the list context
    REUSE_ALV_VARIANT_SAVE         Save a display variant
    REUSE_ALV_VARIANT_SELECT       Read a display variant
    Regards,
    Amit

  • Name of function module that will remove  sign ( + or - ) of any quantty

    Dear Sir,
      Can Any Body help On this matter .
    My requirement is that in my quantity field some amount will come like
    9812636-
    758934-
    436478
    46378564-
    i want to remove the minus sign if it is in negative if it ia in possitive then it's ok.
    but to multilpy with -1 is not solution bcz it is debit and credit calculation so  i want a function module for further processing .

    Sample Program:
    DATA :
    v_num type i,
    v_no1 type i,
    v_no2 type i.
    v_no1 = -1.
    v_no2 = 2.
    v_num = v_no1 * v_no2.
    v_num = ABS( v_num ).
    write : v_num.

  • Function Module which will take Wekk No & Return date range (from & To dat)

    Hello everyone,
    I need a Function Module which will take Week No as an input Parameter & return me the date range
    (From date & To date of that week) .
    Thanks in advance!
    Cheers!
    Moderator message: date calculation questions = FAQ, please search before posting.
    Edited by: Thomas Zloch on Nov 2, 2010 5:25 PM

    Hi,
         Please write the below logic..
    data : v_date11 type sy-datum,
              monday    type sy-datum,
              sunday  type sy-datum,
              v_count1 type i .
    *v_count1 = 20 * 7.            "   Say U want details for 20th week , or give a parameter for week and multiply with 7*
    v_date11 = '20100101'.     "   take the starting day of the year ....
    v_date11 = v_date11 + v_count1.   " add to the date
    CALL FUNCTION 'GET_WEEK_INFO_BASED_ON_DATE'   <-- call this FM
    EXPORTING
       DATE          = v_date11
    IMPORTING
      WEEK          = WEEK
       MONDAY        = MONDAY <-- will have the week starting day
       SUNDAY        = SUNDAY
    Regards,
    Srini.

  • What is the Function MOdule that returns the fields in database table order

    Hello Folks
      I have a dynamic internal table with fields ( which are not in order). I want to display them in the order of which they are present in the database table? Is there any function module that returns the fields in database order?
    FAQ. Please search before posting your question.
    Edited by: Suhas Saha on Oct 10, 2011 10:19 PM

    Hi,
    You can use this BAPI.
    <b>BAPI_SALESORDER_GETLIST</b>
    Reward if useful.
    Regards,
    Vimal

  • Please Help regard function that will return values of each JComboBox items

    I'd like to create a function that will return values of each item on the JComboBox at a time when
    I click on each item of a comboBox. I had this following codes, but didn't work.
    Please help me !!!Please correct it... thanks a million
    String wp;
    String text;
    String A[] = {"WARNIGNS","CAUTIONS","NOTES"};
    JComboBox ABC = new JComboBox();
    for (int i=0;i<A.length;i++) {
    ABC.addItem (A);
    text = Get_It(); //assigns each value of JComboBox's item to variable text when clicks at each item
    //of a comboBOx
    private String Get_It(){
    ABC.addActionListener(new ActionListener (){
    public void actionPerformed(ActionEvent e){
    wp = (String)CBweapon.getSelectedItem() ;
    return wp;

    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    public class AlertFrame extends JFrame {
    String s_alert[] ={"WARNIGNS","CAUTIONS","NOTES"};
    JComboBox CBweapon;
    String wpText;
    public AlertFrame() {
    super("Alerts");
    Container contentPane = getContentPane();
    contentPane.setLayout(null);
    setSize(600,600);
    CBweapon = new JComboBox();
    for (int i=0;i<s_weapon.length;i++) {
    CBweapon.addItem (s_weapon);
    contentPane.add(CBweapon);
    CBweapon.setActionCommand("");
    //set position for components
    CBweapon.setBounds(370 + insets.left,295+ insets.top, 150,30);
    System.out.println(getit()); //calling getit() function
    //this function will be return a String of JcomboBOx value if click on each item of combobox
    private String getit(){
    CBweapon.addActionListener( new ActionListener (){
    public void actionPerformed(ActionEvent e){
    wpText = (String)CBweapon.getSelectedItem() ;
    return wpText;
    public static void main(String args[]) {
    AlertFrame af = new AlertFrame();
    af.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    **I have no errors on compile or run, but it didn't return a string value to System.out.println(getit());
    It maybe because of the "void" of public void actionPerformed(ActionEvent e){
    wpText = (String)CBweapon.getSelectedItem() ;
    Please help me

  • RFC enabled function module which will be called from XI

    Hi Abappers,
    I have to send confirmation of the sales orders created by inbound Idocs ORDERS05 to XI. For this I have to use outbound Idoc ALEAUD01. But since I also need to send NETWR(from VBAK) and there is no field in this Idoc for that,
    I have to develop an RFC enabled function module for which a RFC lookup will be performed from XI. This function module has to return NETWR values for sales orders. Can anyone please tell me how to go about with this function module.
    Thanks in advance.

    Hi Priyanka,
    Add a parameter in <b>tables tab</b> of function module with reference to NETWR. It'll work.
    Regards,
    Younus
    Reward Helpful Answers!!!!

  • How to call a procdure that will return me list of values(JSF,ADF BC)

    hi all,
    any one can help me how to call a procedure that will return me list of value with using adf and jsf

    I did this with a LoginModule that returned a list of user roles. Below is the Java call
    stmt = conn.prepareCall(authquery);
            stmt.registerOutParameter(1, OracleTypes.CURSOR);
            stmt.setString(2,username);
            stmt.setString(3,new String(password));
            // realm is null if not set
            stmt.setString(4,_application_realm);
            stmt.execute();
            rolesResultSet = (ResultSet)stmt.getObject(1); 
            stmt.close();authquery is the name of a procedure that returned a ref Cursor
    CREATE OR REPLACE PACKAGE "DBPROCLM" IS
      TYPE principal_ref IS REF CURSOR;
      function get_user_authentication(p_username in varchar2, p_password in varchar2, p_realm varchar2) return principal_ref;
    END;
    CREATE OR REPLACE PACKAGE BODY "DBPROCLM" IS
      FUNCTION get_user_authentication (p_username in varchar2, p_password in varchar2, p_realm varchar2)
      RETURN principal_ref
      AS
        var_username varchar2(100);
        var_userid number(10);
        var_password varchar2(100);
        role_cursor principal_ref;
        FAILED_AUTHENTICATION exception;
      BEGIN
        select userid, username, password into var_userid, var_username, var_password from sec_users where username = p_username;
        if (var_password = p_password) then
          begin
            if (p_realm is null) then
              open role_cursor for
                select rolename from user_roles_view where userid = var_userid;
            else
              open role_cursor for
                select rolename from user_roles_view where userid = var_userid and realm=p_realm;
            end if; -- p_realm check
          end;
          -- if password doesn't match, raise Excpetion for LM to
          -- abort the authentication process
        else raise FAILED_AUTHENTICATION;
        end if;
        RETURN role_cursor;
      END get_user_authentication;
    END;You only ned to expose the call to teh procedure in a method (e.g. on ADF BC Application Module) and create a method binding for it.
    Frank

  • Function module to get the BOM details for a material-plant combination

    hi
    Is there any function module to get the BOM details such as
            BOM Usage       -STLAN
            Alternative BOM -STLAL
            Items                -POSNR
            Required Quantity-EMENG
            Resulting Quantity-MENGE
            Unit of measure    -BMEIN
            Base unit of measure-MEINS
    for a given material-plant combination
    if so please suggest me some FMs.................
    Awaiting for ur reply..............

    try the below fm it may be useful for you
    DATA : BEGIN OF I_BOM OCCURS 0.
            INCLUDE STRUCTURE STPOX.
    DATA : END OF I_BOM.
    CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
        EXPORTING
          CAPID                 = 'PP01'
          DATUV                 = SY-DATUM
          MEHRS                 = 'X'
          MTNRV                 = P_MATNR
          WERKS                 = P_WERKS
        TABLES
          STB                   = I_BOM
        EXCEPTIONS
          ALT_NOT_FOUND         = 1
          CALL_INVALID          = 2
          MATERIAL_NOT_FOUND    = 3
          MISSING_AUTHORIZATION = 4
          NO_BOM_FOUND          = 5
          NO_PLANT_DATA         = 6
          NO_SUITABLE_BOM_FOUND = 7
          CONVERSION_ERROR      = 8
          OTHERS                = 9.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    just befor use it check your application area.for my case it is PP01. you can find it in CS12 when you are exploding the bom the value you are giving in BOM application that is the value for CAPID.
    Just go to se37 and checkout the fm it has lot of options here I am using the minimum things.
    regards
    shiba dutta

  • Impact on using function modules that are flagged as obsolete

    Hi Gurus,
    I'm working on a SAP 4.7 instance and we are soon to be going Unicode enabled. I noticed when running transaction UCCHECK that there are a number of function modules such as "POPUP_TO_CONFIRM_WITH_MESSAGE" and "POPUP_TO_DECIDE" as well as others that are flagged as obsolete, I'm not sure why these are not picked up in UCCHECK. However, can someone tell me what the impact would be if these obsolete functions were left as is and not changed?
    Thanks in advance
    C

    Thanks for your responses, I agree with you both.
    my view was that after we go unicode enabled all function modules that are flagged for deletion will still perform as they do now, however, as Praveen says this may not be the case in later versions.
    Thanks
    C

  • Function module that can give balances by segment?

    Hi SAPs,
    I need help to get standard SAP function module that can give me GL balances by segment, period and fiscal year. I tried the existing function module for GL balances - BAPI_GET_ACCBALANCES - but it does not support segment. Please let me know if you found any. I need to use it for group reporting requirement.
    Thanks

    Hi ,
    We have  aggregate functions in SQL. Some of the functions are as follows.
    MAX(col ) Determines the maximum value of the value in the column col in the resulting set or in the current group.
    MIN( col ) Determines the minimum value of the content of the column col in the resulting set or in the current group.
    AVG(  col ) Determines the average value of the content of the column col in the resulting set or in the current group. The data type of the column has to be numerical.
    SUM( col ) Determines the sum of the content of the column col in the resulting set or in the current group. The data type of the column has to be numerical.
    COUNT( col ) Determines the number of different values in the column col in the resulting set or in the current group.
    For further details , type the function name name and press F1 for further help.
    Eg: select count(mantr) from mara into workarea where condition.
    Reward points if helpful.
    Thanks and Regards.

  • Reg: Function Module thats used to check the status of JOBS and mail it

    Hi Experts,
    Is there any Standard Function module thats going to find the status of the jobs and mail this status to specied email ID in .xls format. While checking status function module should give whether job is - Aborted, Successful, Running, Waiting, Locked, Error, Warning, Starting Date, Ending Date of the Job.
    Please help me,

    Hello Nagaraj,
    You can find out the status of a job with the SHOW_JOBSTATE function module. You provide this function module with a job name and job number. It returns one of the six possible statuses of the job:
    ABORTED TYPE C,
    FINISHED TYPE C,
    PRELIMINARY TYPE C,
    READY TYPE C,
    RUNNING TYPE C,
    SCHEDULED TYPE C.
    Following is the link for the same:
    http://help.sap.com/saphelp_sm32/helpdata/en/fa/096e10543b11d1898e0000e8322d00/content.htm
    Warm Regards,
    Riki Dash

  • Function module that can give the last value or the highest value of a key

    hi,
    Is there any function module that can give the last value or the highest value of a key feild in a z table.
    regards,
    johnson

    Hi ,
    We have  aggregate functions in SQL. Some of the functions are as follows.
    MAX(col ) Determines the maximum value of the value in the column col in the resulting set or in the current group.
    MIN( col ) Determines the minimum value of the content of the column col in the resulting set or in the current group.
    AVG(  col ) Determines the average value of the content of the column col in the resulting set or in the current group. The data type of the column has to be numerical.
    SUM( col ) Determines the sum of the content of the column col in the resulting set or in the current group. The data type of the column has to be numerical.
    COUNT( col ) Determines the number of different values in the column col in the resulting set or in the current group.
    For further details , type the function name name and press F1 for further help.
    Eg: select count(mantr) from mara into workarea where condition.
    Reward points if helpful.
    Thanks and Regards.

  • Is there any function module that brings out profile planner

    Hello experts,
    Is there any function module that brings out profile planner (I want to set planner profile as u201CSAP800u201D. I am using 7KE1 transaction.
    Example: I know, the FM - K_KOKRS_SET_BATCHINPUT will set the controlling area to 'CTIC' for the entire batch input process.
    Thanks in advance.

    look at these fms..
    CACS_PROFILE_PARTNER_READ
    CACS_PROFILE_SHOW

Maybe you are looking for