Function module in SRM

Hi,
Please help me in finding out the dates and  weeks 15 days before the current date.
Thanks in advance,
Priyadharshini.

Try this ->
DATE_GET_WEEK                  Calendar fucntion: Returns week for a date
DATE_GET_MONTH_LASTDAY
DATE_GET_PERIOD
Regards
- Atul

Similar Messages

  • Problem in Update PO Function module in SRM

    Hi all,
    I am updating the existing PO with the Function Module 'bbp_po_app_update_po' in SRM system.When i execute this in my program , I am not getting any errors.
    After this function module call, I committed using 'Commit work and wait'. But my records are not updated. This function module Contains ''BBP_PD_PO_UPDATE''
    function module. It returns the value e_changed = 'X'. But records not updated in table. Please Advice.

    Hi
    I have built a FM to update the PO with a new line item I am getting the same error "update was terminated" when I executed this FM. I am giving here the code can you suggest something.
    FUNCTION Z_ADD_CR_TO_PO.
    *"*"Local Interface:
    *"  IMPORTING
    *"     REFERENCE(CR_NUMBER) TYPE  CRMT_OBJECT_ID_DB
    *"  TABLES
    *"      MESSAGES STRUCTURE  BBP_PDS_MESSAGES
    DATA: lv_text(80)     TYPE c.
    DATA: ls_header_d     LIKE bbp_pds_po_header_d,
          lt_item_d       LIKE bbp_pds_po_item_d OCCURS 0 WITH HEADER LINE,
          lt_account_d    LIKE bbp_pds_acc OCCURS 0 WITH HEADER LINE,
          lt_partner_d    LIKE bbp_pds_partner OCCURS 0 WITH HEADER LINE,
          lt_orgdata_d    LIKE bbp_pds_org OCCURS 0 WITH HEADER LINE,
          lt_status       like   bbp_pds_status occurs 0 with header line ,
          wa_status       type bbp_pds_status,
          new_item_data       LIKE bbp_pds_po_item_d  ,
          new_account_data    LIKE bbp_pds_acc ,
          new_partner_data    LIKE bbp_pds_partner ,
          new_orgdata_data    LIKE bbp_pds_org,
          new_longtext_data   LIKE bbp_pds_longtext,
          new_tax_data        LIKE bbp_pds_tax,
          ls_header_c     LIKE bbp_pds_po_header_ic,
          lt_item_c       LIKE bbp_pds_po_item_icu OCCURS 0 WITH HEADER LINE,
          lt_account_c    LIKE bbp_pds_acc OCCURS 0 WITH HEADER LINE,
          lt_partner_c    LIKE bbp_pds_partner OCCURS 0 WITH HEADER LINE,
          lt_orgdata_c    LIKE bbp_pds_org OCCURS 0 WITH HEADER LINE,
          lt_messages     LIKE bbp_pds_messages OCCURS 0,
          lv_counter      TYPE i,
          lt_longtext_d   LIKE bbp_pds_longtext OCCURS 0 WITH HEADER LINE,
          lt_longtext_c   LIKE bbp_pds_longtext  OCCURS 0 WITH HEADER LINE,
          ls_new_header   LIKE bbp_pds_po_header_d,
          lt_tax like bbp_pds_tax occurs 0 with header line,
          lt_tax_c like bbp_pds_tax occurs 0 with header line,
          changed type c,
          newpoheader type BBP_PDS_PO_HEADER_D.
    DAtA :   new_item_guid type crmd_orderadm_i-guid,
              lin type i,
              new_number type i.
    tables : crm_jest.
    data : status_table type crm_jest occurs 0 with header line,
            original_status like   bbp_pds_status occurs 0 with header line.
    data : wa_req_details like zchg_req_details.
    data:   no_items(4)  .
    data : lineno(4).
    IF sy-batch = 'X'.
      MESSAGE i088(sf) WITH 'Beginn des Performancetests'(102).
    ENDIF.
    CALL FUNCTION 'BBP_PD_PO_GETDETAIL'
      EXPORTING
        i_object_id       = cr_number
        i_attach_with_doc = ' '
        i_with_itemdata   = 'X'
        i_read_be_data    = ' '
      IMPORTING
        e_header          = ls_header_d
      TABLES
        e_item            = lt_item_d
        e_account         = lt_account_d
        e_partner         = lt_partner_d
        e_longtext        = lt_longtext_d
        e_orgdata         = lt_orgdata_d
        e_status          = lt_status
        e_tax             = lt_tax.
    IF sy-batch = 'X'.
      MESSAGE i088(sf) WITH 'GetDetail abgeschlossen'(105).
    ENDIF.
    original_status[] = lt_status[].
    describe table lt_status lines  lineno.
    *preapring header data....
    *Header Data ...
    MOVE ls_header_d TO ls_header_c.
    *CLEAR ls_header_c-object_id.
    *MOVE 'A' TO ls_header_c-guid.
    CONCATENATE 'Kopie von PO '(099) ' mit '(101) no_items ' Positionen'(100)
                INTO ls_header_c-description  .
    LOOP AT lt_partner_d WHERE p_guid = ls_header_d-guid.
      MOVE-CORRESPONDING lt_partner_d TO lt_partner_c.
      lt_partner_c-p_guid = ls_header_c-guid.
    *  CLEAR lt_partner_c-partner_guid.
      APPEND lt_partner_c.
    ENDLOOP.
    LOOP AT lt_orgdata_d WHERE p_guid = ls_header_d-guid.
      MOVE-CORRESPONDING lt_orgdata_d TO lt_orgdata_c.
    *  CLEAR lt_orgdata_c-guid.
      lt_orgdata_c-p_guid = ls_header_c-guid.
      APPEND lt_orgdata_c.
    ENDLOOP.
    LOOP AT lt_longtext_d WHERE guid = ls_header_d-guid.
      MOVE-CORRESPONDING lt_longtext_d TO lt_longtext_c.
    *  CLEAR lt_orgdata_c-guid.
      lt_longtext_c-guid = ls_header_c-guid.
      APPEND lt_longtext_c.
    ENDLOOP.
    DATA: ls_header_u TYPE  bbp_pds_po_header_u .
    MOVE-CORRESPONDING ls_header_c TO ls_new_header.
    MOVE-CORRESPONDING ls_new_header TO ls_header_u.
    ls_header_u-be_log_system = 'ESAPD12125'.
    loop at lt_status.
    status_table-objnr = lt_status-p_guid.
    status_table-stat = lt_status-stat.
    status_table-inact = lt_status-inact.
    modify crm_jest from status_table.
    endloop.
    * Item data ...
    * Fill the new item into item table
    describe table lt_item_d lines lin.
    new_number = lin + 1.
    CALL FUNCTION 'GUID_CREATE'
    IMPORTING
       EV_GUID_16       = new_item_guid.
    new_item_data-guid = new_item_guid.
    new_item_data-number_int = new_number.
    *move ls_header_u-guid to new_item_data-parent.
    new_item_data-description = 'test item'.
    new_item_data-category_id = lt_item_d-category_id.
    new_item_data-quantity = '2'.
    new_item_data-unit = lt_item_d-unit.
    new_item_data-subtype = lt_item_d-subtype.
    new_item_data-price = '10'.
    new_item_data-price_unit = lt_item_d-price_unit.
    new_item_data-deliv_date = sy-datum.
    new_item_data-product_type = lt_item_d-product_type.
    new_item_data-gross_price = '10'.
    *new_item_data-be_obj_item = new_number.
    new_item_data-be_object_type = lt_item_d-be_object_type.
    new_item_data-be_object_id = lt_item_d-be_object_id.
    new_item_data-be_plant = lt_item_d-be_plant.
    new_item_data-be_pur_group = lt_item_d-be_pur_group.
    new_item_data-be_pur_org = lt_item_d-be_pur_org.
    new_item_data-be_co_code = lt_item_d-be_co_code.
    new_item_data-be_doc_type = lt_item_d-be_doc_type.
    new_item_data-be_log_system = 'ESAPD12125'.
    new_item_data-src_object_type = 'ZBUS9000'.
    append  new_item_data to lt_item_d.
    *filling partner data for the new item.
    loop at lt_partner_d where p_guid = lt_item_d-guid.
    move-corresponding lt_partner_d to new_partner_data.
    clear new_partner_data-p_guid.
    clear new_partner_data-partner_guid.
    move new_item_guid to new_partner_data-p_guid.
    append new_partner_data to lt_partner_d.
    clear new_partner_data.
    endloop.
    *filling the account data for the new item.
    new_account_data-p_guid = new_item_guid.
    new_account_data-distr_perc = '100'.
    new_account_data-acc_no = '0001'.
    new_account_data-acc_cat = 'NET'.
    *new_account_data-g_l_acct = wa_req_details-gl_account.
    *new_account_data-network = wa_req_details-acc_number.
    new_account_data-g_l_acct = '0000402611'.
    new_account_data-network = '000090001903'.
    new_account_data-activity = '0010'.
    new_account_data-co_area = '1000'.
    append new_account_data to lt_account_d.
    *filling the tax data
    new_tax_data-p_guid = new_item_guid.
    new_tax_data-tax_code = 'U1'.
    new_tax_data-tax_code_origin = 'F'.
    new_tax_data-currency = 'USD'.
    append new_tax_data to lt_tax.
    *filling Org data for the new item.
    loop at lt_orgdata_d where p_guid = lt_item_d-guid.
    move-corresponding lt_orgdata_d to new_orgdata_data.
    clear new_orgdata_data-p_guid.
    clear new_orgdata_data-guid.
    move new_item_guid to new_orgdata_data-p_guid.
    append new_orgdata_data to lt_orgdata_d.
    clear new_orgdata_data.
    endloop.
    no_items = new_number.
    *updation of data to new tables.
    loop at lt_item_d.
    lv_counter = lv_counter + 1.
    MOVE-CORRESPONDING lt_item_d TO lt_item_c.
    MOVE ls_header_u-guid TO lt_item_c-parent.
    append lt_item_c.
      LOOP AT lt_partner_d WHERE p_guid = lt_item_d-guid.
        MOVE-CORRESPONDING lt_partner_d TO lt_partner_c.
    *    CLEAR: lt_partner_c-partner_guid.
        MOVE lt_item_c-guid TO lt_partner_c-p_guid.
        APPEND lt_partner_c.
      ENDLOOP.
      LOOP AT lt_account_d WHERE p_guid = lt_item_d-guid.
        MOVE-CORRESPONDING lt_account_d TO lt_account_c.
    *    CLEAR lt_account_c-guid.
        MOVE lt_item_c-guid TO lt_account_c-p_guid.
        APPEND lt_account_c.
      ENDLOOP.
      LOOP AT lt_orgdata_d WHERE p_guid = lt_item_d-guid.
        MOVE-CORRESPONDING lt_orgdata_d TO lt_orgdata_c.
    *    CLEAR lt_orgdata_c-guid.
        MOVE lt_item_c-guid TO lt_orgdata_c-p_guid.
        APPEND lt_orgdata_c.
      ENDLOOP.
      LOOP AT lt_longtext_d WHERE guid = lt_item_d-guid.
        MOVE-CORRESPONDING lt_longtext_d TO lt_longtext_c.
    *    CLEAR lt_orgdata_c-guid.
        lt_longtext_c-guid = lt_item_c-guid.
        APPEND lt_longtext_c.
      ENDLOOP.
        LOOP AT lt_tax WHERE p_guid = lt_item_d-guid.
        MOVE-CORRESPONDING lt_tax TO lt_tax_c.
    *    CLEAR lt_orgdata_c-guid.
       MOVE lt_item_c-guid TO lt_tax_c-p_guid.
        APPEND lt_tax_c.
      ENDLOOP.
    *endif.
    endloop.
    *ENDDO.
    CALL FUNCTION 'BBP_PD_PO_UPDATE'
      EXPORTING
        i_park     = 'X'
        i_header   = ls_header_u
      IMPORTING
        E_CHANGED  = changed
        ES_HEADER  = newpoheader
      TABLES
        i_item     = lt_item_c
        i_account  = lt_account_c
        i_partner  = lt_partner_c
        i_longtext = lt_longtext_c
        i_orgdata  = lt_orgdata_c
        e_messages = lt_messages
        i_tax      = lt_tax_c.
    messages[] = lt_messages[].
    *CALL FUNCTION 'BBP_PD_PO_SAVE'.
    CALL FUNCTION 'BBP_PD_PO_SAVE'
    EXPORTING
    **   IV_WORKITEM_ID               =
    **   IV_USERTYPE                  =
       IV_HEADER_GUID               = newpoheader-guid.
    * IV_CREATE_HIST_VERSION       = 'X'.
    CALL FUNCTION 'BBP_PROCDOC_RESET_BUFFER'.
    commit work and wait.
    ENDFUNCTION.

  • Function module for srm document flow

    Hi Friends,
                  If there is any function module which give me the complete document flow for the document.

    Hi Nilesh,
    Are you talking about shopping cart?
    pl. go to transaction BBP_PD in EBP GUI.
    this transation can give you which all tables are updated when a SC is created.
    BR
    Dinesh

  • Function module in SRM for adding number to date excluding weekends

    Hi Experts,
    Please help to get the standard FM in SRM for adding number to date and getting next date excluding weekends.
    Thanks in Advance.
    Thanks,
    Sahil

    This kind of custom FM can be created easily.
    But if you want to use standard FM then "DATE_CONVERT_TO_FACTORYDATE" FM is good but you need a factory calendar id which has all working days and weekend days specified (also public holidays if required). Then call this FM in loop for a count of days and it will give working day after "entered date + number of days"
    So if calendar has only weekdays and weekends specified, it will add number of days in specified date excluding weekends.
    Thanks,
    Murtuza

  • Table/function module regarding srm pr no and r/3 pr no

    Dear Friends,
                      If there is any table which stores
            or gives relationship between srm Purchase
            Requisition no and R/3 Purchase Requisition no.
            or if any fuction mosule is available which gives
            both.

    Hi Nilesh,
    If you want to check the backend data for SRM follow-on documents, you can access tables:
    BBP_PDBEH
    BBP_PDBEI
    Kind regards,
    Yann

  • Function Module to send Vendor Master Data from SRM to ECC

    Hi Guys
    I heard there is a function module in SRM which can send Vendor Master Data from SRM to ECC please confirm for me if there is such a function Module and what is it called. Thanks

    Hi,
    Vendor Master data is replicated to SRM from ECC. Standard Transactions (BBPGETVD,..) will be used to replicate the data from ECC.
    Vendor Master will exists in ECC, so there is no point in sending the same back from SRM to ECC. If the requirement is the other way around, we can use the transaction BBPGETVD in SRM system.
    Hope this helps.
    Regards,
    Hemanth

  • Function module to change the SRM Purchase order data

    Hi
    Is there any function module in SRM which calls the BBP_DOC_CHANGE_BADI method BBP_PO_CHANGE  so that we could change the PO data via dubugging which changes the PO in SRM as well as in the backend in Extended classic scenario.
    Thanks
    Krishna.

    BBP_PD_PO_CHANGE <- that one
    BBP_PD_PO_SAVE
    COMMIT WORK.
    The others to persist the change into the database

  • Function module as extractor in srm

    Hi ,
    i have to create a function module in srm which will be used as extractor for a datasource in srm.
    can anyone letme know is there any standard Function module from where i can copy or simply i can use RSAX_BIW_GET_DATA_SIMPLE.
    Thnx
    Regrds

    hi Nishu
    here are some remarks concerning your coding.
    FUNCTION Z_BIW_GET_DATA_SIMPLE.
    ""Local Interface:
    *" IMPORTING
    *" VALUE(I_REQUNR) TYPE SRSC_S_IF_SIMPLE-REQUNR OPTIONAL
    *" VALUE(I_DSOURCE) TYPE SRSC_S_IF_SIMPLE-DSOURCE OPTIONAL
    *" VALUE(I_MAXSIZE) TYPE SRSC_S_IF_SIMPLE-MAXSIZE OPTIONAL
    *" VALUE(I_INITFLAG) TYPE SRSC_S_IF_SIMPLE-INITFLAG OPTIONAL
    *" VALUE(I_READ_ONLY) TYPE SRSC_S_IF_SIMPLE-READONLY OPTIONAL
    *" TABLES
    *" I_T_SELECT TYPE SRSC_S_IF_SIMPLE-T_SELECT OPTIONAL
    *" I_T_FIELDS TYPE SRSC_S_IF_SIMPLE-T_FIELDS OPTIONAL
    *" E_T_DATA OPTIONAL
    *" EXCEPTIONS
    *" NO_MORE_DATA
    *" ERROR_PASSED_TO_MESS_HANDLER
    Example: DataSource for table SFLIGHT
    TABLES: ZQUOTATION.
    Auxiliary Selection criteria structure
    DATA : L_S_SELECT TYPE SRSC_S_SELECT.
    DATA : GIT_QTN type table of ZQUOTATION with header line .
    DATA : GIT_TAB type table of BBP_PDS_CND with header line .
    Maximum number of lines for DB table
    STATICS: S_S_IF TYPE SRSC_S_IF_SIMPLE,
    counter
    S_COUNTER_DATAPAKID LIKE SY-TABIX,
    cursor
    S_CURSOR TYPE CURSOR.
    Select ranges
    RANGES: L_R_CARRID FOR SFLIGHT-CARRID,
    L_R_CONNID FOR SFLIGHT-CONNID.
    Initialization mode (first call by SAPI) or data transfer mode
    (following calls) ?
    IF I_INITFLAG = SBIWA_C_FLAG_ON.
    Initialization: check input parameters
    buffer input parameters
    prepare data selection
    Check DataSource validity
    CASE I_DSOURCE.
    WHEN '0SAPI_SFLIGHT_SIMPLE'. --><b> is it the name of the datasource your create in tx rso2</b> <b>if not then change it</b>
    WHEN OTHERS.
    IF 1 = 2. MESSAGE E009(R3). ENDIF.
    this is a typical log call. Please write every error message like this
    LOG_WRITE 'E' "message type
    'R3' "message class
    '009' "message number
    I_DSOURCE "message variable 1
    ' '. "message variable 2
    RAISE ERROR_PASSED_TO_MESS_HANDLER.
    ENDCASE.
    APPEND LINES OF I_T_SELECT TO S_S_IF-T_SELECT.
    Fill parameter buffer for data extraction calls
    S_S_IF-REQUNR = I_REQUNR.
    S_S_IF-DSOURCE = I_DSOURCE.
    S_S_IF-MAXSIZE = I_MAXSIZE.
    Fill field list table for an optimized select statement
    (in case that there is no 1:1 relation between InfoSource fields
    and database table fields this may be far from beeing trivial)
    APPEND LINES OF I_T_FIELDS TO S_S_IF-T_FIELDS.
    ELSE. "Initialization mode or data extraction ?
    Data transfer: First Call OPEN CURSOR + FETCH
    Following Calls FETCH only
    First data package -> OPEN CURSOR
    IF S_COUNTER_DATAPAKID = 0.
    Fill range tables BW will only pass down simple selection criteria
    of the type SIGN = 'I' and OPTION = 'EQ' or OPTION = 'BT'.
    why don't you use the open cursor and the fetch and then do your call function.
    select * from ZQUOTATION
    into table GIT_QTN .
    LOOP AT GIT_QTN .
    CALL FUNCTION 'BBP_PDCND_GETDETAIL'
    EXPORTING
    i_p_guid = GIT_QTN-GUID1
    I_P_KIND = 'B'
    I_OBJECT_TYPE = GIT_QTN-OBJECT_TYPEH
    IV_VERSION_TYPE = ' '
    iv_header_guid = GIT_QTN-HEADER
    IV_WITH_DELETED_RECORDS = ' '
    IMPORTING
    ET_CONDITIONS = GIT_TAB
    E_COM =
    TABLES
    E_T_DATA =
    <b>why don't you use a temporary table</b>
    MOVE-CORRESPONDING GIT_TAB TO E_T_DATA.
    ENDLOOP.
    LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'CARRID'.
    MOVE-CORRESPONDING L_S_SELECT TO L_R_CARRID.
    APPEND L_R_CARRID.
    ENDLOOP.
    LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'CONNID'.
    MOVE-CORRESPONDING L_S_SELECT TO L_R_CONNID.
    APPEND L_R_CONNID.
    ENDLOOP.
    Determine number of database records to be read per FETCH statement
    from input parameter I_MAXSIZE. If there is a one to one relation
    between DataSource table lines and database entries, this is trivial.
    In other cases, it may be impossible and some estimated value has to
    be determined.
    OPEN CURSOR WITH HOLD S_CURSOR FOR
    SELECT (S_S_IF-T_FIELDS) FROM SFLIGHT
    WHERE CARRID IN L_R_CARRID AND
    CONNID IN L_R_CONNID.
    ENDIF. "First data package ?
    Fetch records into interface table.
    named E_T_'Name of extract structure'.
    FETCH NEXT CURSOR S_CURSOR
    APPENDING CORRESPONDING FIELDS
    OF TABLE E_T_DATA
    PACKAGE SIZE S_S_IF-MAXSIZE.
    IF SY-SUBRC <> 0.
    CLOSE CURSOR S_CURSOR.
    RAISE NO_MORE_DATA.
    ENDIF.
    S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.
    ENDIF. "Initialization mode or data extraction ?
    ENDFUNCTION.
    <b>i don't know if it should work but here is a proposal try it. It looks something like :
    if it doesn't work try to get the help of someone within your project.
    FUNCTION Z_BIW_GET_DATA_SIMPLE.
    ""Local Interface:
    *" IMPORTING
    *" VALUE(I_REQUNR) TYPE SRSC_S_IF_SIMPLE-REQUNR OPTIONAL
    *" VALUE(I_DSOURCE) TYPE SRSC_S_IF_SIMPLE-DSOURCE OPTIONAL
    *" VALUE(I_MAXSIZE) TYPE SRSC_S_IF_SIMPLE-MAXSIZE OPTIONAL
    *" VALUE(I_INITFLAG) TYPE SRSC_S_IF_SIMPLE-INITFLAG OPTIONAL
    *" VALUE(I_READ_ONLY) TYPE SRSC_S_IF_SIMPLE-READONLY OPTIONAL
    *" TABLES
    *" I_T_SELECT TYPE SRSC_S_IF_SIMPLE-T_SELECT OPTIONAL
    *" I_T_FIELDS TYPE SRSC_S_IF_SIMPLE-T_FIELDS OPTIONAL
    *" E_T_DATA OPTIONAL
    *" EXCEPTIONS
    *" NO_MORE_DATA
    *" ERROR_PASSED_TO_MESS_HANDLER
    Example: DataSource for table SFLIGHT
    TABLES: ZQUOTATION.
    Auxiliary Selection criteria structure
    DATA : L_S_SELECT TYPE SRSC_S_SELECT.
    *DATA : GIT_QTN type table of ZQUOTATION with header line .
    *temporary TABLE
      data : e_t_data_tmp like your structrure occurs 0.
    Maximum number of lines for DB table
    STATICS: S_S_IF TYPE SRSC_S_IF_SIMPLE,
    counter
    S_COUNTER_DATAPAKID LIKE SY-TABIX,
    cursor
    S_CURSOR TYPE CURSOR.
    Select ranges
    RANGES: L_R_GUID1 FOR ZQUOTATION-GUID1.
    Initialization mode (first call by SAPI) or data transfer mode
    (following calls) ?
    IF I_INITFLAG = SBIWA_C_FLAG_ON.
    Initialization: check input parameters
    buffer input parameters
    prepare data selection
    Check DataSource validity
    CASE I_DSOURCE.
    WHEN 'ZDS_ZQUOTATION'.  --> create a datasource with this name to test the extractor.
    WHEN OTHERS.
    IF 1 = 2. MESSAGE E009(R3). ENDIF.
    this is a typical log call. Please write every error message like this
    LOG_WRITE 'E' "message type
    'R3' "message class
    '009' "message number
    I_DSOURCE "message variable 1
    ' '. "message variable 2
    RAISE ERROR_PASSED_TO_MESS_HANDLER.
    ENDCASE.
    APPEND LINES OF I_T_SELECT TO S_S_IF-T_SELECT.
    Fill parameter buffer for data extraction calls
    S_S_IF-REQUNR = I_REQUNR.
    S_S_IF-DSOURCE = I_DSOURCE.
    S_S_IF-MAXSIZE = I_MAXSIZE.
    Fill field list table for an optimized select statement
    (in case that there is no 1:1 relation between InfoSource fields
    and database table fields this may be far from beeing trivial)
    APPEND LINES OF I_T_FIELDS TO S_S_IF-T_FIELDS.
    ELSE. "Initialization mode or data extraction ?
    Data transfer: First Call OPEN CURSOR + FETCH
    Following Calls FETCH only
    First data package -> OPEN CURSOR
    IF S_COUNTER_DATAPAKID = 0.
    Fill range tables BW will only pass down simple selection criteria
    of the type SIGN = 'I' and OPTION = 'EQ' or OPTION = 'BT'.
          LOOP AT s_s_if-t_select INTO l_s_select WHERE fieldnm = 'GUID1'.
            MOVE-CORRESPONDING l_s_select TO l_r_GUID1.
            APPEND l_r_GUID1.
          ENDLOOP.
          OPEN CURSOR WITH HOLD s_cursor FOR
           SELECT * from ZQUOTATION
              WHERE GUID1 in l_r_GUID1.
    Endif.
        FETCH NEXT CURSOR s_cursor
                   APPENDING CORRESPONDING FIELDS
                   OF TABLE e_t_data_tmp
                   PACKAGE SIZE s_s_if-maxsize.
        IF sy-subrc <> 0.
          CLOSE CURSOR s_cursor.
          RAISE no_more_data.
        ENDIF.
        s_counter_datapakid = s_counter_datapakid + 1.
      ENDIF.              "Initialization mode or data extraction ?
      REFRESH e_t_data.
      CLEAR e_t_data.
    DATA : GIT_TAB type table of BBP_PDS_CND with header line .
    loop at e_t_data_tmp into e_t_data.
    CALL FUNCTION 'BBP_PDCND_GETDETAIL'
    EXPORTING
    i_p_guid = GIT_QTN-GUID1
    I_P_KIND = 'B'
    I_OBJECT_TYPE = GIT_QTN-OBJECT_TYPEH
    IV_VERSION_TYPE = ' '
    iv_header_guid = GIT_QTN-HEADER
    IV_WITH_DELETED_RECORDS = ' '
    IMPORTING
    ET_CONDITIONS = GIT_TAB
    E_COM =
    TABLES
    E_T_DATA =.
        move-corresponding e_t_data_tmp to e_t_data.
        append e_t_data.
    ENDLOOP.
    ENDFUNCTION.</b>
    hope this could help
    regards
    Boujema
    Message was edited by:
            Boujema Bouhazama
    Message was edited by:
            Boujema Bouhazama

  • Function module to get approver.

    Dear all,
    Are there any function modules within SRM 4.00 which allows me to get the SC approver by a confirmation number or even a PO number? Thanks.

    Hi,
    You can use the function module BBP_PDH_WFL_APPROVER_GET.
    See the foll thread for more details:
    Re: How to get the approvers of a document (PO)
    Re: How to get the approvers of a document (PO)
    BR,
    Disha.
    <b>Pls reward points for useful answers.</b>

  • Regarding RFC function module

    Hi ,
    Our requirement is like this , we  have to send the material long text from r/3 to srm system
    for this we have developed a rfc function module with srm system as destination  .But when we are using this in the program while rfc funtion module is invoked that time it is going to srm system and asking for credentials. how can i supress this .
    Thanks in advance.

    Hello;
    In your RFC destination, you can use a default user.
    If you want to use the current user, go check
    <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/22/042860488911d189490000e829fbbd/frameset.htm">http://help.sap.com/saphelp_nw2004s/helpdata/en/22/042860488911d189490000e829fbbd/frameset.htm</a>
    It explains how to setup up trusted/trusting system and the use of SSO.
    Regards

  • Generic Data source on Function module

    Hi All,
    We are working on generic data source based on a function module for the first time and we do not know how to start with.
    Our requirement is to fetch mode of communication field from SRM. We have identified a function module in SRM which does this job. But when we try to create a generic data source on this function module it is throwing an error.
    Are the import parameters for a general function module and function module for a BI generic data source different?
    If so could someone please guide us in creating the function module so that we can create a generic data source on top of it.
    The function module should serve the same purpose as the function module BAPI_BUPA_ADDRESS_GETDETAIL.
    Thanks,
    Shravani

    Shivani,
    My suggestion would be creating Z-program to store the values in a custom table and use this for extraction.
    Further if still want to use the FM itself, post the error details you are getting.. or try to analyse the FM and find the base table so that you can directly use in extraction.
    Hope this helps,
    anil

  • Stock function modules

    Hi SRM experts,
    does anyone know what function modules does SRM have for:
    - checking if material is subject to inventory management?
    - checking if material has availability in stock?
    Thanks in advance,
    Cristiano Soares

    Hi Cristiano,
    Regarding to if material has availability, I think that one possibility would be use via RFC the BAPI_MATERIAL_AVAILABILITY module function. You could implement a BADI (for example BBP_DOC_CHECK_BADI) and you could include there the RFC call.
    I hope this is useful.
    BR
    Jorge Vigo

  • QUERY ON SRM Function Module.............Urgent plz help

    Hi
    I have a requirment for getting wbs element in SRM system (SRM 3.0 ) from R/3 4.6c based on status of wbs element like TECO, ISBD, CLSD.
    Please can anybody suggest any standard FM / Metabapi exist in SRM for resolving this issue.
    Regards
    MJT

    Hi
    Have you tried the following Function modules ?
    - META_WBS_GETLIST (BAPI Function module)
    - B31I_WBS_GETLIST    (BAPI Function module) 
    - NOR3_WBS_GETLIST  (BAPI Function module)   
    - BBP_BW_GET_WBS_ELEM_E (Non-BAPI)
    Do let me know. Hope this will definitely help.
    Regards
    - Atul

  • Query regarding function module SPOOL_RQ_READ_BAPI_EXPORTS (EBP-SRM Module)

    query regarding function module SPOOL_RQ_READ_BAPI_EXPORTS (EBP-SRM Module)
    shopping cart
    Hi in FM SPOOL_RQ_READ_BAPI_EXPORTS
    i want to relate the internal tables requisition_items and requisition_services.
    but in am not getting the key on which they should be joined
    here i have to take the quantity and other fields from requisition_services
    right now i am using the joining condition as
    requisition_items-pckg_no = requisition_services-pckg_no.
    any help in this regard is welcome.
    Thanks and regards,
    Vithalprasad

    Hi Kathirvel,
    Thank you for reply. I am making changes for standard code only.
    " Call FM SPOOL_DPO_READ_BAPI_EXPORTS to read PO data exported to backend.
    Use this data to call FM B46B_DPO_TRANSFER and copy errors tab from
    ' lt_bapi_return ' to ' et_messages' retrun tab in 'doc_check' badi. "
    Thank you.
    Regards, Sunu

  • Function Module Execution (ERP / SRM)

    Hi All,
    I have a RFC FM called "BAPI_DOCUMENT_CHECKIN2" on ERP back end System.
    I execute with below parameters :
    CALL FUNCTION 'BAPI_DOCUMENT_CHECKIN2'
    EXPORTING: documenttype = lf_doctype
    documentnumber = lf_docnumber
    documentpart = lf_docpart
    documentversion = lf_docversion
    hostname = ''
    statusintern = ''
    statusextern = lf_status
    statuslog = ''
    IMPORTING: return = ls_return
    TABLES: documentfiles = lt_files.
    I give parameters:
    lt_files-storagecategory = 'Z_xxxL_xxx'. "
    lt_files-docfile = '
    10.x.x.xxx\mdmtest\srinivas\srinipaddu.txt'.
    Now "srinipaddu.txt" gets attached in the DMS system (IP:10.x.x.xxx: Belongs to the XI box and not either backend erp or SRM box below)
    Second Scenario:
    Now this same FM which is not present in the SRM BOX is called up using below syntax (Destination)
    call function 'BAPI_DOCUMENT_CHECKIN2' DESTINATION 'abapdest' EXPORTING: documentnumber = lf_docnumber
    documenttype = lf_doctype
    documentpart = lf_docpart
    documentversion = lf_docversion
    hostname = ''
    statusintern = ''
    statusextern = lf_status
    statuslog = ''
    IMPORTING: return = pr_ls_return
    TABLES: documentfiles = pr_lt_files.
    Now the FM gets executed but the file in the specified folder is not getting attached in DMS system.
    Is this right or should i do any changes here
    help me out

    Hi,
           Try the function module GUI_RUN.
    Check this link.
    [http://abaplovers.blogspot.com/2008/05/sap-abap-function-module-to-run.html]
    Regards,
    Haritha.

Maybe you are looking for