Generic function module for delta - which FM ?

Hi all,
I want to create a custom generic datasource in R3 which uses a function module for delta extraction. This is straight forward for full extract (copy FM RSAX_BIW_GET_DATA_SIMPLE - I already did this and have a full extraction working to BW). However I need to extract delta - and the above function module does not have example code for that (I have seen some forum posts that it 'can' be used - but this looks like a pseudo get around where the delta field name is passed in I_T_SELECT).
FM RSVD_BW_GET_DELTA_DATA seems to be an example code of a FM which can allow delta (i.e. manually codes how to fill date/time stamp information). However when I code this and try test in RSA3 it seems to try to populate the delta selection field before calling my function module! I need it to call my function and allow the function to specifiy the date criteria.
Can anyone help with an example of how this should best  be done ?
Or can it only be done in a pseudo form using 'RSAX_BIW_GET_DATA_SIMPLE' example FM.
Note: I have setup the RSO2 datasource to allow delta.
Also - I have spent several hours searching the forum - but please answer with a link if you think it does answer exactly this problem.
Thanks for any help
Martin

Hi again,
Have had a few requests for the code I used - I created a new custom function copied from 'RSAX_BIW_GET_DATA_SIMPLE'. AEDAT has been set as the delta date for this data source in transaction RSO2.
Main sample code is -
1. Code to receive selection criteria and store in internal ranges -
FUNCTION zbw_sodetail_get_detail.                                   
""Global interface:                                               
*"   IMPORTING                                                  
*"       VALUE(I_REQUNR) TYPE  SRSC_S_IF_SIMPLE-REQUNR        
*"       VALUE(I_DSOURCE) TYPE  SRSC_S_IF_SIMPLE-DSOURCE      
*"       VALUE(I_MAXSIZE) TYPE  SRSC_S_IF_SIMPLE-MAXSIZE      
*"       VALUE(I_INITFLAG) TYPE  SRSC_S_IF_SIMPLE-INITFLAG    
*"       VALUE(I_READ_ONLY) TYPE  SRSC_S_IF_SIMPLE-READONLY   
*"       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 STRUCTURE  ZBW_SODETAIL OPTIONAL           
*--- Sales order item create date                                      
   LOOP AT i_t_select INTO l_s_select WHERE fieldnm = 'ERDAT'.         
      MOVE-CORRESPONDING l_s_select TO r_erdat.                        
      APPEND r_erdat.                                                  
   ENDLOOP.                                                                               
*--- Sales order item change date - DELTA only - auto filled before    
   this function is called.                                          
   C (Initialise Delta) - Low = blank, High = today - safety limit   
   D (Delta) - low = , High =   .       *from roosgendlm             
   LOOP AT i_t_select INTO l_s_select WHERE fieldnm = 'AEDAT'.         
      MOVE-CORRESPONDING l_s_select TO r_aedat.                        
      APPEND r_aedat.                                                  
   ENDLOOP.                                                                               
2. Code to use selection criteria to get initial or delta. Note that for delta the delta date field to be used is automatically populated with the date of the last delta run (from table roosgendlm) -
   SELECT VBAK~KNUMV
          VBAPVBELN VBAPPOSNR VBAPMATNR VBAPARKTX VBAP~SPART
          VBAPWERKS VBAPERDAT VBAPAEDAT VBAPNETWR VBAP~WAERK
          VBAPABGRU VBAPZPROMISE VBAP~CUOBJ
          VBEP~EDATU
      INTO CORRESPONDING FIELDS OF TABLE ZBW_SODETAIL_ITAB
      FROM VBAK JOIN VBAP ON VBAKVBELN = VBAPVBELN
                JOIN VBEP ON VBAPVBELN = VBEPVBELN
                         AND VBAPPOSNR = VBEPPOSNR
   WHERE VBAP~VBELN IN R_VBELN        "Order number
     AND VBAP~POSNR IN R_POSNR        "Order item number
     AND VBAP~ERDAT IN R_ERDAT        "Order item date created
    AND ( VBAP~ERDAT IN R_AEDAT OR   "Created date in      Delta range
              VBAP~AEDAT IN R_AEDAT OR   "Order item change    Delta range
              VBAK~AEDAT IN R_AEDAT ).   "Order header change  Delta range
Note that if the data source is called in initial or full extract mode the delta change date (aedat) will automatically be blank.
I have been using this successfully.
I hope this helps
Martin.

Similar Messages

  • Generic function module for input two Infocubes and output one infocube-APO

    Hi All,
    My requirement is we have to pick data from two infocubes(Billing and Backlog) and send to One info cube.
    can you please send me an;y generic function module is available in APO or explain me how to solve my requirement.
    waiting for your response.
    Thanks for Advance.
    Shubhojit.

    Hi,
    I recommend using a multi-cube also but if you insist in JOINing two cubes then you can do that in an ABAP SELECT statement. You need to join the fact table and the dimension tables for all dimensions (for all InfoCubes). Please only retrieve data whose OBJVERS="A".
    Please post again if you need more help.
    Regards,
    Emmanuel

  • Z function modules for OLE

    Hi all,
    Is there any Z function modules for OLE, which will download the data directly to Excel with 2 sheets.
    Regards,
    Shalini

    Hi Shalini Reddy
    there is no FM  but code is there... u can see...
    *& Report  YOLE_FOR_EXCEL
    REPORT  yole_for_excel.
    *REPORT ZTEST_BYW.
    OLE specific include file
    INCLUDE ole2incl.
    INCLUDE excel__c.
    data definitions of OLE objects with type ole2_object
    PARAMETERS: p_filenm(80) LOWER CASE OBLIGATORY
    DEFAULT 'd:\temp\report_tsl.xls'.
    DATA: g_tmp_workbook TYPE ole2_object.
    DATA: g_tmp_worksheets TYPE ole2_object.
    DATA: g_tmp_worksheet1 TYPE ole2_object.
    DATA: g_tmp_worksheet2 TYPE ole2_object.
    DATA: g_pc_template LIKE rcgfiletr-ftappl
    VALUE 'd:\temp\mmr_rpt_tsl_tmp.xls'.
    DATA: g_excel TYPE ole2_object.
    DATA: g_workbooks TYPE ole2_object.
    DATA: g_workbook TYPE ole2_object.
    DATA: g_worksheets TYPE ole2_object.
    DATA: g_worksheet TYPE ole2_object.
    DATA: g_cell TYPE ole2_object.
    DATA: g_cell1 TYPE ole2_object.
    DATA: g_cell2 TYPE ole2_object.
    DATA: g_cellrange TYPE ole2_object.
    DATA: g_font TYPE ole2_object.
    DATA: g_interior TYPE ole2_object.
    DATA: g_borders TYPE ole2_object.
    DATA: g_first_ws VALUE 'Y'.
    DATA: g_row TYPE i.
    DATA: g_col TYPE i.
    definition of loop counter
    DATA: i TYPE i VALUE '5'.
    DATA: BEGIN OF t_sheet1 OCCURS 1,
    col1(10),
    col2(20),
    END OF t_sheet1.
    DATA: BEGIN OF t_sheet2 OCCURS 1,
    col1(10),
    col2(20),
    END OF t_sheet2.
    START-OF-SELECTION.
      PERFORM prepare_data.
      PERFORM download_to_excel.
    END-OF-SELECTION.
    call method of excel 'QUIT'.
    it is now possible to leave the EXCEL application
    remark: you have to go to the EXCEL application and answer the
    popup dialog screen
    *& Form PREPARE_DATA
    FORM prepare_data.
      t_sheet1-col1 = 'A1'.
      t_sheet1-col2 = 'A2'.
      APPEND t_sheet1.
      t_sheet1-col1 = 'B1'.
      t_sheet1-col2 = 'B2'.
      APPEND t_sheet1.
      t_sheet2-col1 = 'Y1'.
      t_sheet2-col2 = 'Y2'.
      APPEND t_sheet2.
      t_sheet2-col1 = 'Z1'.
      t_sheet2-col2 = 'Z2'.
      APPEND t_sheet2.
    ENDFORM. " PREPARE_DATA
    *& Form DOWNLOAD_TO_EXCEL
    FORM download_to_excel.
      PERFORM open_excel.
      PERFORM add_worksheet1.
      PERFORM add_worksheet2.
      PERFORM open_template_file.
      PERFORM close_excel.
      WRITE: / 'End of program'.
    ENDFORM. " DOWNLOAD_TO_EXCEL
    *& Form FILL_CELL
    *& FORM routine, which fills the specified cell in the EXCEL sheet
    *& with the given value
    FORM fill_cell USING i_row TYPE i
    i_col TYPE i
    i_value
    i_fontbold
    i_digit
    i_wraptext
    i_horizon_align
    i_vertical_align.
      DATA: l_str TYPE string.
      CALL METHOD OF g_excel 'CELLS' = g_cell
        EXPORTING #1 = i_row
        #2 = i_col.
      SET PROPERTY OF g_cell 'VALUE' = i_value.
      IF i_fontbold = 'X'.
        GET PROPERTY OF g_cell 'Font' = g_font.
        SET PROPERTY OF g_font 'Bold' = 1.
      ENDIF.
      IF NOT i_wraptext IS INITIAL.
        SET PROPERTY OF g_cell 'WrapText' = 1.
      ENDIF.
      IF NOT i_horizon_align IS INITIAL.
        IF i_horizon_align = 'L'.
          SET PROPERTY OF g_cell 'HorizontalAlignment' = xlleft.
        ELSEIF i_horizon_align = 'R'.
          SET PROPERTY OF g_cell 'HorizontalAlignment' = xlright.
        ELSEIF i_horizon_align = 'C'.
          SET PROPERTY OF g_cell 'HorizontalAlignment' = xlcenter.
        ENDIF.
      ENDIF.
      IF NOT i_vertical_align IS INITIAL.
        IF i_vertical_align = 'T'.
          SET PROPERTY OF g_cell 'VerticalAlignment' = xltop.
        ELSEIF i_vertical_align = 'B'.
          SET PROPERTY OF g_cell 'VerticalAlignment' = xlbottom.
        ELSEIF i_vertical_align = 'C'.
          SET PROPERTY OF g_cell 'VerticalAlignment' = xlcenter.
        ENDIF.
      ENDIF.
    To set number format for cell
      IF i_digit <> ''.
        IF i_value IS INITIAL AND i_digit <> '%'.
          SET PROPERTY OF g_cell 'VALUE' = ''.
        ELSE.
    Set number format for cell with number
          IF i_digit = '1'.
            SET PROPERTY OF g_cell 'NumberFormat' = '#,###.0 '.
          ELSEIF i_digit = '2'.
            SET PROPERTY OF g_cell 'NumberFormat' = '#,##0.00 '.
          ELSEIF i_digit = '%'.
            SET PROPERTY OF g_cell 'NumberFormat' = '#,##0.00% '.
          ELSE.
            SET PROPERTY OF g_cell 'NumberFormat' = '#,### '.
          ENDIF.
        ENDIF.
      ENDIF.
      ADD 1 TO i_col.
    ENDFORM.                    "FILL_CELL
    *& Form OPEN_EXCEL
    FORM open_excel.
      DATA: l_cnt TYPE i.
    create object excel of OLE class 'EXCEL.APPLICATION'
      CREATE OBJECT g_excel 'EXCEL.APPLICATION'.
      CALL METHOD OF g_excel 'WORKBOOKS' = g_workbooks.
      CALL METHOD OF g_workbooks 'ADD' = g_workbook.
      GET PROPERTY OF g_workbook 'Worksheets' = g_worksheets.
      GET PROPERTY OF g_excel 'ACTIVESHEET' = g_worksheet.
      SET PROPERTY OF g_excel 'DISPLAYALERTS' = 0.
      GET PROPERTY OF g_worksheets 'Count' = l_cnt.
      l_cnt = l_cnt - 1.
    Delete unwanted worksheets
      DO l_cnt TIMES.
        GET PROPERTY OF g_excel 'ACTIVESHEET' = g_worksheet.
        CALL METHOD OF g_worksheet 'DELETE'.
      ENDDO.
    ENDFORM. " OPEN_EXCEL
    *& Form CLOSE_EXCEL
    FORM close_excel.
      SET PROPERTY OF g_excel 'VISIBLE' = 1.
      CALL METHOD OF g_workbook 'SAVEAS'
        EXPORTING #1 = p_filenm.
    quit Excel and free all OLE objects
    call method of g_excel 'QUIT'.
      FREE OBJECT g_interior.
      FREE OBJECT g_borders.
      FREE OBJECT g_font.
      FREE OBJECT g_cell.
      FREE OBJECT g_cell1.
      FREE OBJECT g_cell2.
      FREE OBJECT g_cellrange.
      FREE OBJECT g_excel.
      FREE OBJECT g_workbooks.
      FREE OBJECT g_workbook.
      FREE OBJECT g_worksheets.
      FREE OBJECT g_worksheet.
    ENDFORM. " CLOSE_EXCEL
    *& Form ADD_WORKSHEET
    FORM add_worksheet USING i_name.
    Add new worksheet
      IF g_first_ws <> 'N'.
        g_first_ws = 'N'.
        GET PROPERTY OF g_excel 'ACTIVESHEET' = g_worksheet.
      ELSE.
        CALL METHOD OF g_worksheets 'Add' = g_worksheet.
      ENDIF.
      SET PROPERTY OF g_worksheet 'NAME' = i_name.
      g_row = 1.
      g_col = 1.
    ENDFORM. " ADD_WORKSHEET
    *& Form ADD_WORKSHEET1
    FORM add_worksheet1.
      PERFORM add_worksheet USING 'Test 1'.
    fill line in EXCEL sheet with headerlines of table columns
      g_col = 1.
      PERFORM fill_cell USING g_row g_col 'My First Worksheet' 'X' ''
      PERFORM merge_cell USING g_row 1 g_row 4.
      PERFORM set_border USING g_row 1 g_row 4 4 ''.
      ADD 1 TO g_row.
      g_col = 1.
      PERFORM fill_cell USING g_row g_col 'ID'(001) 'X' '' '' '' ''.
      PERFORM fill_cell USING g_row g_col 'Name'(002) 'X' '' '' '' ''.
      PERFORM fill_cell USING g_row g_col 'Telephon'(003) 'X' '' '' '' ''.
      PERFORM fill_cell USING g_row g_col 'Rabatt'(004) 'X' '' '' '' ''.
    loop at customr table and print values into EXCEL sheet
      ADD 1 TO g_row.
      LOOP AT t_sheet1.
        g_col = 1.
        PERFORM fill_cell USING g_row g_col t_sheet1-col1 '' '' '' '' ''.
        PERFORM fill_cell USING g_row g_col t_sheet1-col2 '' '' '' '' ''.
        ADD 1 TO g_row.
      ENDLOOP.
      g_col = 4.
      PERFORM set_border USING 1 1 g_row g_col '' 4.
    ENDFORM. " ADD_WORKSHEET1
    *& Form ADD_WORKSHEET2
    FORM add_worksheet2.
      PERFORM add_worksheet USING 'Test 2'.
    fill line in EXCEL sheet with headerlines of table columns
      g_col = 1.
      PERFORM fill_cell USING g_row g_col 'My Second Worksheet' 'X' ''
      PERFORM merge_cell USING g_row 1 g_row 4.
      PERFORM set_border USING g_row 1 g_row 4 1 'X'.
      PERFORM set_color USING g_row 1 g_row 4 'LT'.
      ADD 1 TO g_row.
      g_col = 1.
      PERFORM fill_cell USING g_row g_col 'ID'(001) 'X' '' '' '' ''.
      PERFORM fill_cell USING g_row g_col 'Name'(002) 'X' '' '' '' ''.
      PERFORM fill_cell USING g_row g_col 'Telephon'(003) 'X' '' '' '' ''.
      PERFORM fill_cell USING g_row g_col 'Rabatt'(004) 'X' '' '' '' ''.
    loop at customr table and print values into EXCEL sheet
      ADD 1 TO g_row.
      LOOP AT t_sheet2.
        g_col = 1.
        PERFORM fill_cell USING g_row g_col t_sheet2-col1 '' '' '' '' ''.
        PERFORM fill_cell USING g_row g_col t_sheet2-col2 '' '' '' '' ''.
        ADD 1 TO g_row.
      ENDLOOP.
      g_col = 4.
      PERFORM set_border USING 1 1 g_row g_col 2 'X'.
      ADD 4 TO g_row.
      g_col = 1.
      PERFORM fill_cell USING g_row g_col 'This is a wrap text' 'X' ''
      'X' 'C' 'T'.
      PERFORM fill_cell USING g_row g_col 'Vertical - Bottom' 'X' ''
      '' 'L' 'T'.
      ADD 4 TO g_row.
      g_col = 1.
      PERFORM fill_cell USING g_row g_col 'Amount 1' 'X' '' '' '' ''.
      PERFORM fill_cell USING g_row g_col '100.04' '' 'X' '' '' ''.
      ADD 1 TO g_row.
      g_col = 1.
      PERFORM fill_cell USING g_row g_col 'Amount 2' 'X' '' '' '' ''.
      PERFORM fill_cell USING g_row g_col '200.01' '' 'X' '' '' ''.
      ADD 1 TO g_row.
      g_col = 1.
      PERFORM fill_cell USING g_row g_col 'Total' 'X' '' '' '' ''.
      PERFORM fill_cell USING g_row g_col '=SUM(B13:B14)' 'X' 'X' '' '' ''.
      PERFORM fill_cell USING g_row g_col '0.00' 'X' 'X' '' '' ''.
      PERFORM copy_cell USING g_row 2 17 5 25 8.
    ENDFORm. " ADD_WORKSHEET2
    *& Form MERGE_CELL
    FORM merge_cell USING i_row1 i_col1
    i_row2 i_col2.
      CALL METHOD OF g_excel 'Cells' = g_cell1
        EXPORTING #1 = i_row1
        #2 = i_col1.
      CALL METHOD OF g_excel 'Cells' = g_cell2
        EXPORTING #1 = i_row2
        #2 = i_col2.
      CALL METHOD OF g_excel 'Range' = g_cellrange
        EXPORTING #1 = g_cell1
        #2 = g_cell2.
      CALL METHOD OF g_cellrange 'Merge'.
    ENDFORM. " MERGE_CELL
    *& Form SET_BORDER
    FORM set_border USING i_row1 i_col1
    i_row2 i_col2
    i_thickness
    i_allborders.
      CALL METHOD OF g_excel 'Cells' = g_cell1
        EXPORTING #1 = i_row1
        #2 = i_col1.
      CALL METHOD OF g_excel 'Cells' = g_cell2
        EXPORTING #1 = i_row2
        #2 = i_col2.
      CALL METHOD OF g_excel 'Range' = g_cellrange
        EXPORTING #1 = g_cell1
        #2 = g_cell2.
      IF i_allborders IS INITIAL.
        CALL METHOD OF g_cellrange 'BorderAround'
        EXPORTING #1 = 1 "Continuous line
        #2 = i_thickness. "Thickness: 1 - Normal, 4 - Thick
      ELSE.
        GET PROPERTY OF g_cellrange 'Borders' = g_borders.
        SET PROPERTY OF g_borders 'LineStyle' = '1'.
        SET PROPERTY OF g_borders 'Weight' = i_thickness.
      ENDIF.
    ENDFORM. " SET_BORDER
    *& Form SET_COLOR
    FORM set_color USING i_row1 i_col1
    i_row2 i_col2
    i_color.
      DATA: l_colorindex TYPE i.
      CASE i_color.
        WHEN 'BK'.
          l_colorindex = 1. "Black
        WHEN 'BR'.
          l_colorindex = 53. "Brown
        WHEN 'OG'.
          l_colorindex = 52. "Olive Green
        WHEN 'DG'.
          l_colorindex = 51. "Dark Green
        WHEN 'DT'.
          l_colorindex = 49. "Dark Teal
        WHEN 'DB'.
          l_colorindex = 11. "Dark Blue
        WHEN 'ID'.
          l_colorindex = 55. "Indigo
        WHEN 'G4'.
          l_colorindex = 56.                                    "Gray 80%
        WHEN 'DR'.
          l_colorindex = 9. "Dark Red
        WHEN 'OR'.
          l_colorindex = 46. "Orange
        WHEN 'DY'.
          l_colorindex = 12. "Dark Yellow
        WHEN 'GR'.
          l_colorindex = 10. "Green
        WHEN 'TL'.
          l_colorindex = 14. "Teal
        WHEN 'BL'.
          l_colorindex = 5. "Blue
        WHEN 'BY'.
          l_colorindex = 47. "Blue Gray
        WHEN 'G3'.
          l_colorindex = 16.                                    "Gray 50%
        WHEN 'RD'.
          l_colorindex = 3. "Red
        WHEN 'LO'.
          l_colorindex = 45. "Light Orange
        WHEN 'LI'.
          l_colorindex = 43. "Lime
        WHEN 'SG'.
          l_colorindex = 50. "Sea Green
        WHEN 'AQ'.
          l_colorindex = 42. "Aqua
        WHEN 'LB'.
          l_colorindex = 41. "Light Blue
        WHEN 'VL'.
          l_colorindex = 13. "Violet
        WHEN 'G2'.
          l_colorindex = 48.                                    "Gray 40%
        WHEN 'PK'.
          l_colorindex = 7. "Pink
        WHEN 'GD'.
          l_colorindex = 44. "Gold
        WHEN 'YL'.
          l_colorindex = 6. "Yellow
        WHEN 'BG'.
          l_colorindex = 4. "Bright Green
        WHEN 'TQ'.
          l_colorindex = 8. "Turquoise
        WHEN 'SB'.
          l_colorindex = 33. "Sky Blue
        WHEN 'PL'.
          l_colorindex = 54. "Plum
        WHEN 'G1'.
          l_colorindex = 15.                                    "Gray 25%
        WHEN 'RS'.
          l_colorindex = 38. "Rose
        WHEN 'TN'.
          l_colorindex = 40. "Tan
        WHEN 'LY'.
          l_colorindex = 36. "Light Yellow
        WHEN 'LG'.
          l_colorindex = 35. "Light Green
        WHEN 'LT'.
          l_colorindex = 34. "Light Turquoise
        WHEN 'PB'.
          l_colorindex = 37. "Pale Blue
        WHEN 'LV'.
          l_colorindex = 39. "Lavender
        WHEN 'WH'.
          l_colorindex = 2. "White
        WHEN OTHERS.
          l_colorindex = 2. "White
      ENDCASE.
      CALL METHOD OF g_excel 'Cells' = g_cell1
        EXPORTING #1 = i_row1
        #2 = i_col1.
      CALL METHOD OF g_excel 'Cells' = g_cell2
        EXPORTING #1 = i_row2
        #2 = i_col2.
      CALL METHOD OF g_excel 'Range' = g_cellrange
        EXPORTING #1 = g_cell1
        #2 = g_cell2.
      GET PROPERTY OF g_cellrange 'Interior' = g_interior.
      SET PROPERTY OF g_interior 'ColorIndex' = l_colorindex.
    ENDFORM. " SET_COLOR
    *& Form COPY_CELL
    FORM copy_cell USING i_crow i_ccol
    i_prow1 i_pcol1
    i_prow2 i_pcol2.
      CALL METHOD OF g_excel 'Cells' = g_cell
        EXPORTING #1 = i_crow
        #2 = i_ccol.
      CALL METHOD OF g_cell 'Copy'.
      CALL METHOD OF g_excel 'Cells' = g_cell1
        EXPORTING #1 = i_prow1
        #2 = i_pcol1.
      CALL METHOD OF g_excel 'Cells' = g_cell2
        EXPORTING #1 = i_prow2
        #2 = i_pcol2.
      CALL METHOD OF g_excel 'Range' = g_cellrange
        EXPORTING #1 = g_cell1
        #2 = g_cell2.
      CALL METHOD OF g_worksheet 'Paste'
        EXPORTING #1 = g_cellrange.
    ENDFORM. " COPY_CELL
    *& Form OPEN_TEMPLATE_FILE
    FORM open_template_file.
      CALL METHOD OF g_workbooks 'Open' = g_tmp_workbook
        EXPORTING #1 = g_pc_template
        #2 = 2
        #3 = 0
        #4 = 1
        #5 = 0
        #6 = 0
        #7 = 1.
      CALL FUNCTION 'FLUSH'
        EXCEPTIONS
          OTHERS = 0.
      GET PROPERTY OF g_tmp_workbook 'Worksheets' = g_tmp_worksheets.
      GET PROPERTY OF g_tmp_worksheets 'Item' = g_tmp_worksheet1
      exporting #1 = 1.
      GET PROPERTY OF g_tmp_worksheets 'Item' = g_tmp_worksheet2
      exporting #1 = 2.
      CALL METHOD OF g_tmp_worksheet1 'Copy'
        EXPORTING #1 = g_worksheet.
      CALL METHOD OF g_tmp_worksheet2 'Copy'
        EXPORTING #1 = g_worksheet.
    call method of g_tmp_workbook 'Close'.
      CALL FUNCTION 'FLUSH'
        EXCEPTIONS
          OTHERS = 0.
    ENDFORM. " OPEN_TEMPLATE_FILE

  • Functional module for automatic creation of pur requisition & pur order

    hello,
    what is the functional module for automatic creation of puchase requisition and automatic creation of purchase order which we will assign in action box in service order processing management.
    please let me know as early as possible
    regards,
    rajesh kumar raju

    Hi,
             Please check with following.
    IDOC_INPUT_ACC_PURCHASE_REQUI
    IDOC_INPUT_ACC_PURCHASE_ORDER
    /ISDFPS/OR_PURCHASE_ORDER_CR
    BS01_PURCHASE_DOCUMENT_CREATE
    CO_MP_CREATE_PURCHASE_ORDER
    Thanks & Regards
    Sadhu Kishore

  • How to create the INBOUND Function Module for INBOUND IDOCs

    Hi Friends,
    Can any Suggest me How to proceed to Create an INBOUND Function Module for Processing the INBOUND IDOCS
    which are recieved from XI Server ?
    I am working in SAP-ISU
    Here i will recieve the INBOUND IDOCs for the Meter Reading Orders.
    We have a Standard INBOUND FUNCTION MODULE
    IDOC_INPUT_ISU_MR_UPLOAD
    which Uploads the Meter Reading Results.
    I copied the Same function Module into ZIDOC_INPUT_
    and working on it.
    Can any one suggest me, whether i am going in correct way or not.
    In IDOC_INPUT_ISU_MR_UPLOAD Inbound fun module,
    BAPI_MTRREADDOC_UPLOAD is used to Update or Insert the Meter Reading Results,
    My requirment is to Insert and Update the Meter Reading Orders which are Inbounded from XI.
    Can I Use the Same BAPI
    BAPI_MTRREADDOC_UPLOAD
    to Update the below fields,
    EABL-SERNR
    EABL-ZWNUMMER
    EABLG-ABLESGR
    EABL-V_ZWSTAND
    EABL-N_ZWSTAND
    EABL-ABLHINW
    EABL-ZSKIPC
    EABL-ADAT
    EABL-ATIMTATS
    EABL-ADATTATS
    EABL-ATIM
    EABL-ZMESSAGE
    EABL-ABLESER(Meter reader number)
    Kindly Suggest me,
    Thanks in Advance,
    Ganesh

    Hello Ganesh
    I think you are going completely astray with you z-function module for IDoc processing.
    If you look at TABLES parameter METERREADINGRESULTS (type BAPIEABLU ) of BAPI_MTRREADDOC_UPLOAD you will find many of the requested fields already:
    EABL-SERNR => BAPIEABLU-SERIALNO
    EABL-ZWNUMMER =>REGISTER
    EABLG-ABLESGR
    EABL-V_ZWSTAND
    EABL-N_ZWSTAND
    EABL-ABLHINW
    EABL-ZSKIPC
    EABL-ADAT
    EABL-ATIMTATS => ACTUALMRTIME
    EABL-ADATTATS => ACTUALMRDATE
    EABL-ATIM
    EABL-ZMESSAGE
    EABL-ABLESER(Meter reader number)
    Field EABL-ZMESSAGE appears to be custom field (at least I cannot find it on ECC 6.0). If this field was added using include CI_EABL then you probably can get these values into the BAPI using the EXTENSIONIN parameter.
    Check routine CHECK_UPLOADRECORDS in the BAPI which allows two extension structures:
    - BAPI_TE_EABL
    - BAPI_TE_EOSB
    Not surprisingly BAPI_TE_EABL contains the include CI_EABL.
    Regards
      Uwe

  • 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

  • Error in XXL_FULL_API function module for download report to excel

    Hi all,
    I am using XXL_FULL_API function module for download report to excel, In this FM we have to fill a table called sema        = t_gxxlt_s. in this table we have a fields called
    i_sema-col_no  = 19.
      i_sema-col_src = 19.
      i_sema-col_typ = 'STR'.
      i_sema-col_ops = 'DFT'
    here in 'col_typ' if we put STR in excel it will come as a text but i wnat the time field what i have to pass ?
    and for filed 'col_ops' also ??
    Thaks,
    Sridhar

    Hi sridhar joshi,
    Please check this program
    REPORT Excel.
    TABLES:
      sflight.
    * header data................................
    DATA :
      header1 LIKE gxxlt_p-text VALUE 'Suresh',
      header2 LIKE gxxlt_p-text VALUE 'Excel sheet'.
    * Internal table for holding the SFLIGHT data
    DATA BEGIN OF t_sflight OCCURS 0.
            INCLUDE STRUCTURE sflight.
    DATA END   OF t_sflight.
    * Internal table for holding the horizontal key.
    DATA BEGIN OF  t_hkey OCCURS 0.
            INCLUDE STRUCTURE gxxlt_h.
    DATA END   OF t_hkey .
    * Internal table for holding the vertical key.
    DATA BEGIN OF t_vkey OCCURS 0.
            INCLUDE STRUCTURE gxxlt_v.
    DATA END   OF t_vkey .
    * Internal table for holding the online text....
    DATA BEGIN OF t_online OCCURS 0.
            INCLUDE STRUCTURE gxxlt_o.
    DATA END   OF t_online.
    * Internal table to hold print text.............
    DATA BEGIN OF t_print OCCURS 0.
            INCLUDE STRUCTURE gxxlt_p.
    DATA END   OF t_print.
    * Internal table to hold SEMA data..............
    DATA BEGIN OF t_sema OCCURS 0.
            INCLUDE STRUCTURE gxxlt_s.
    DATA END   OF t_sema.
    * Retreiving data from sflight.
    SELECT * FROM sflight
             INTO TABLE t_sflight.
    * Text which will be displayed online is declared here....
    t_online-line_no    = '1'.
    t_online-info_name  = 'Created by'.
    t_online-info_value = 'KODANDARAMI REDDY'.
    APPEND t_online.
    * Text which will be printed out..........................
    t_print-hf     = 'H'.
    t_print-lcr    = 'L'.
    t_print-line_no = '1'.
    t_print-text   = 'This is the header'.
    APPEND t_print.
    t_print-hf     = 'F'.
    t_print-lcr    = 'C'.
    t_print-line_no = '1'.
    t_print-text   = 'This is the footer'.
    APPEND t_print.
    * Defining the vertical key columns.......
    t_vkey-col_no   = '1'.
    t_vkey-col_name = 'MANDT'.
    APPEND t_vkey.
    t_vkey-col_no   = '2'.
    t_vkey-col_name = 'CARRID'.
    APPEND t_vkey.
    t_vkey-col_no   = '3'.
    t_vkey-col_name = 'CONNID'.
    APPEND t_vkey.
    t_vkey-col_no   = '4'.
    t_vkey-col_name = 'FLDATE'.
    APPEND t_vkey.
    * Header text for the data columns................
    t_hkey-row_no = '1'.
    t_hkey-col_no = 1.
    t_hkey-col_name = 'PRICE'.
    APPEND t_hkey.
    t_hkey-col_no = 2.
    t_hkey-col_name = 'CURRENCY'.
    APPEND t_hkey.
    t_hkey-col_no = 3.
    t_hkey-col_name = 'PLANETYPE'.
    APPEND t_hkey.
    t_hkey-col_no = 4.
    t_hkey-col_name = 'SEATSMAX'.
    APPEND t_hkey.
    t_hkey-col_no = 5.
    t_hkey-col_name = 'SEATSOCC'.
    APPEND t_hkey.
    t_hkey-col_no = 6.
    t_hkey-col_name = 'PAYMENTSUM'.
    APPEND t_hkey.
    * populating the SEMA data..........................
    t_sema-col_no  = 1.
    t_sema-col_typ = 'STR'.
    t_sema-col_ops = 'DFT'.
    APPEND t_sema.
    t_sema-col_no = 2.
    APPEND t_sema.
    t_sema-col_no = 3.
    APPEND t_sema.
    t_sema-col_no = 4.
    APPEND t_sema.
    t_sema-col_no = 5.
    APPEND t_sema.
    t_sema-col_no = 6.
    APPEND t_sema.
    t_sema-col_no = 7.
    APPEND t_sema.
    t_sema-col_no = 8.
    APPEND t_sema.
    t_sema-col_no = 9.
    APPEND t_sema.
    t_sema-col_no = 10.
    t_sema-col_typ = 'NUM'.
    t_sema-col_ops = 'ADD'.
    APPEND t_sema.
    CALL FUNCTION 'XXL_FULL_API'
      EXPORTING
    *   DATA_ENDING_AT          = 54
    *   DATA_STARTING_AT        = 5
       filename                = 'TESTFILE'
       header_1                = header1
       header_2                = header2
       no_dialog               = 'X'
       no_start                = ' '
        n_att_cols              = 6
        n_hrz_keys              = 1
        n_vrt_keys              = 4
       sema_type               = 'X'
    *   SO_TITLE                = ' '
      TABLES
        data                    = t_sflight
        hkey                    = t_hkey
        online_text             = t_online
        print_text              = t_print
        sema                    = t_sema
        vkey                    = t_vkey
    EXCEPTIONS
       cancelled_by_user       = 1
       data_too_big            = 2
       dim_mismatch_data       = 3
       dim_mismatch_sema       = 4
       dim_mismatch_vkey       = 5
       error_in_hkey           = 6
       error_in_sema           = 7
       file_open_error         = 8
       file_write_error        = 9
       inv_data_range          = 10
       inv_winsys              = 11
       inv_xxl                 = 12
       OTHERS                  = 13
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    please refer this link
    http://www.thespot4sap.com/Articles/Download_to_excel.asp
    Best regards,
    raam

  • Function Module for creation of variant in BADI

    I need to create a variant to store shipment no's which are coming in BADI. And variant need to be passed to a report which has to be run  Background. can anyone help me out how to do it. Can anyone know the function module for this.

    Hi Anirban,
    Use the bapi BAPI_BUSPROCESSND_CREATEMULTI to achieve the same.
    <b>Reward points if it helps.</b>
    Regards,
    Amit Mishra

  • Function module for getting the all PO waiting for release

    Hi,
    Is there any standard Function module for gettting all the PO's which all waiting for release.
    Regards
    Bala.

    hi Bala,
    ECC 6.0 Exits for VA01
    go through the above link i think that will help u...
    Regards,
    sindhu.

  • Function Module for getting person under position

    Hi all,
    I have a requirement where I need to get all the person under a position and need to forward the workitem to those person. Is there any Function module is available which will give the person for that position?. Please help in this regard.
    Regards,
    V Kumar

    Hi,
    Use the function module "HR_HCP_GET_EMPL_FOR_POSITION" to get the pernrs under a position. Pass the values 01 for PLVAR, S to the OTYPE and the position to OBJID for the import parameter IM_OBJECTTAB.
    Or Use the database table HRP1001 to get the all the persons under a position.
    Hope this will help.
    Thanks,
    Samson

  • Bom explosion function module for bypassing phantom materials

    hi,
    function module "cS_BOM_EXPL_MAT_V2" is used to explode the componensts of first level only.
    In my case there are components at first level are phantom assemblies so i want to drill down further to arrive at E or F part which may be at 2nd or 3rd level.
    please suggest any BAPI or function module for the above requirement.
    Thanks.
    Kumar

    Dear Kumar,
    check with following input values for the Functional Module
    FTREL                                                    
    ALEKZ                                                    
    ALTVO                                                    
    AUFSW                                                    
    AUMGB                                                    
    AUMNG                                      0.000         
    AUSKZ                                                    
    AMIND                                                    
    BAGRP                                                    
    BEIKZ                                                    
    BESSL                                                    
    BGIXO                                                    
    BREMS                                                    
    CAPID                           PP01                     
    CHLST                                                    
    COSPR                                                    
    CUOBJ                           000000000000000000       
    CUOVS                                                    
    CUOLS                                                    
    DATUV                           13.05.2008               
    DELNL                                                    
    DRLDT                                                    
    EHNDL                                                    
    EMENG                                      2.000         
    ERSKZ                                                    
    ERSSL                                                    
    FBSTP                                                    
    KNFBA                                                    
    KSBVO                                                    
    MBWLS                           X                        
    MKTLS                           X                        
    MDMPS                                                    
    MEHRS                           X                        
    MKMAT                                                    
    MMAPS                                                    
    SALWW                                                    
    SPLWW                                                    
    MMORY                           1                        
    MTNRV                           S7690339                 
    NLINK                                                    
    POSTP                                                    
    RNDKZ                                                    
    RVREL                                                    
    SANFR                                 
    SANIN                                 
    SANKA                                 
    SANKO                                 
    SANVS                                 
    SCHGT                                 
    STKKZ                                 
    STLAL                           1     
    STLAN                           1     
    STPST                           0     
    SVWVO                           X     
    WERKS                         5501  
    NORVL                                 
    MDNOT                                 
    PANOT                                 
    QVERW                                 
    VERID                                 
    VRSVO                           X     
    I'm using this FM with the above input parameters and I'm getting the necessary details perfectly.
    Please check & revert back.
    Regards
    Mangalraj.S

  • Standard BAPI or Function Module for FB01posting

    Hi Experts,
    My requirement is as follows.
    Invoice details would be sent across from Middleware to SAP and for which I have developed a Custom Remote Enabled Function Module. The Function Module needs to post the data using FB01 Transaction.
    I had planned for recording a BDC for FB01 and post the data, however, we are on the verge of getting upgraded from 4.7 to ECC 6.0. To avoid problems that we might face for change of screens in ECC 6.0, I would prefer using a BAPI or Function Module for FB01 posting, if available, instead of BDC.
    Data coming from Middleware are as follows.
    HEADER:
    BKPF-BLDAT :  Document Date
    BKPF-BUDAT : Posting Date
    BKPF-XBLNR: Reference (Invoice#)
    BKPF-BLART : Document Type
    BKPF-BUKRS : Company Code
    BKPF-BKTXT : DocHeader Text
    BKPF-WAERS : Currency
    LINE ITEM:
    BSEG-LIFNR : Vendor no
    BSEG-WRBTR - Total amt -Debit/Credit -Vendor
    BSEG-ZUONR : Assignment field
    BSEG-EMPFB : Alternative Payee
    BSEG-UZAWE : Payment Method Supplement
    BSEG-ZTERM : Pmt terms
    BSEG-KOSTL : Costcenter
    BSEG-HKONT : GL AccountNumber
    BSEG-WRBTR : Amount for GL
    BSEG-SGTXT : Line item text
    The Vendor Line Item would be one where as GL line items could me more than one.
    Can any of you suggest me a standard BAPI or Func Mod?
    Points will be awarded for valuable inputs.
    Thanks to all!!!!

    You can use RFBIBL00 program for FB01 postings. Go through the program help on how to use this program.
    This program requires a file to be on application server in a certain format.
    You may also refer the program RFBIBLT0 on how the file format should be.
    Hope this helps.
    Thanks,
    SKJ

  • Function Module for incoming payments

    Hi All,
    I'm currently working on integrating the IVR system with SAP ECC 6.0 - IS-U module. I would like to know if there is any function module or BAPI which I can use to receive the payment information and the credit card information to update the document. The approach we are taking here is to receive the payment information using a web service and we want to update the FICA document with payment method and credit card information so that it can be pciked up using the payment run for clearing.
    I'm unable to find any details as most of them are using IVR with CRM system .
    Also I would like to know if it is OK to use the function modules given for Bilelr Direct for receiving the payments from IVR. We already have a working Bilelr direct functionaliy.
    Thanks and Regards
    Arvind

    Srinivas,
    Thank you so much for your reply. You answer was really helpful. I need to research these functio modules more to find out how to use them. Also I just want to check if you worked for Intelligrpup Inc. If yes then we have worked together for office max project for a very brief period.

  • How to debug mapping function module during delta extraction?

    Hi experts,
    Somehow our delta is not working properly, and i would like to debug our mapping function module. How can i debug it during a delta extraction?
    Some info:
    Our source system is CRM and our extractor is extracting one order document (contracts in this case). I know that when we modify a contract, a bdoc is generated and then passed throught the mapping function then the extracted data to the delta queue. I just need to debug when the bdoc is being mapped to see what's wrong with the extracted data.
    Thanks in advance,
    Van

    Hi,
    Since you are using a Function Module for the Extraction. Edit the Function Module and give "BREAK-POINT" before the loop command. Check and activate the Function Module.
    Now Extract the datasource using RSA3. Now you can debug it. After checking remove the "BREAK-POINT" from the function module. Also Check and activate the same.
    Regards
    Jayaram M

  • Function module for assigning BP Number to the Postion ID in org model

    Hi Experts,
    Is there any function module for assigning BP Number to the Postion ID in organizational model.
    The requirement is:
    1)There are some employees which are reporting to a Manager who has a position ID.
    2) Each of these employees should be assigned to the given position ID.
    This can be done by First Locate the BP Record in SAP via the Vantive Person ID  and retrieve the SAP BP Number.
    <b>Then assign the SAP BP Number found to the Position ID.</b>
    My question is <b>Is there any function module for assigning BP Number to the Postion ID .</b>
    Looking forward for reply.
    Thanks & Regards,
    Renju.

    Hi,
       Org. management uses API classe objects with static methods as APIs. You may be able to achieve this using
    CL_CRM_ORGMAN_SERVICES->MAPPING_ORGUNIT_TO_BP
    Reward if helpful!
    Regards,
    Sudipta.

Maybe you are looking for

  • Error in emagent.trc

    Hi got error in emagent.trc 2010-03-05 15:27:38,062 Thread-1900551 ERROR pingManager: nmepm_pingReposURL: Cannot connect to https://192.168.21.243:1159/em/upload: retStatus=-1 2010-03-05 15:27:38,104 Thread-1900551 ERROR ssl: 9: Common Name = "localh

  • Posting date for rebate credit note document

    Hi friends, This is with reference to settlement of rebate agreement. There is a background job executed say today, but the posting date was backdated to 31/08/2011. The financial posting period for current month starts from 27th of Aug and the posti

  • Please organize osx launchpad icons in CS6 collection(there are too many adobe icons)

    Adobe applications create too many icons in launchpad on osx. Is there a way to automate organising them in a more elegant fashion? Launchpad gets full of red adobe icons(2 pages of them) especially if you have master collection installed. Please put

  • Qosmio X300-13R - After few seconds the image darkens on webcam

    We have laptop Toshiba Qosmio-X300-13R with the chamber built in webcamera. But there is a question. I start the native utility or Skype, the first seconds all is visible, and then the image darkens and looks narrowly in the monitor that like it is v

  • Cannot select last lines on page?

    I'm using Pages 09 and I am writing a novel. I have put the novel in the correct size/format for printing (so it isn't A4), and I want to make one or two minor tweaks and changes before I finish. However, I can't select the last 6-7 lines or page num