Posting a document by using function Module POSTING_INTERFACE_CLEARING

Hi Gurus,
I have a problem while using the function module POSTING_INTERFACE_CLEARING.
My custom code is using the FM POSTING_INTERFACE_CLEARING to clear a document form one GL account and post a document in another GL account.
after the document is posted 2 line items will created in the 2 GL accounts.
But some of the fields are not being populated in the one of the line item for the document created (Reference fields) but the other line item has the reference fields has values being populated.
I am passing the required values in the custom code to this FM.
Please help me in this.
Edited by: Anand Sirgapuram on Jun 3, 2009 2:34 PM

Hi Anand,
Could you please specify which reference fields are not getting populated?
I think this is the standard behaviour of POSTING_INTERFACE_CLEARING. All the values in the first line item are populated, while in second line item only some of the fields like posting key, account number, account currency, amount, company code and business partner are populated.
If you need to populate other values, I guess you will have to search for some enhancement points inside the FM POSTING_INTERFACE_CLEARING after the 'call transaction' statement.
Regards
Radhika

Similar Messages

  • To post parked PO invoice using function module BAPI_INCOMINGINVOICE_CREATE

    Hi,
    I have a requirement to batch update program to auto post the parked po invoice.
    Is it possible to use the function module BAPI_INCOMINGINVOICE_CREATE to post po invoices as batch job? or Can I go for BDC program?
    Please give me your suggestions.
    Here I am giving the code which I used FM-> BAPI_INCOMINGINVOICE_CREATE.(But it gives the error)
    REPORT  ZSAT_BDC1.
    TABLES: ZIXCP_T03,EKBE,EKPO.
    DATA: BEGIN OF WA_PARK OCCURS 0,
            EBELN LIKE ZIXCP_T03-EBELN,
            XBLNR LIKE ZIXCP_T03-XBLNR,
            BELNR LIKE ZIXCP_T03-BELNR,
          END OF WA_PARK.
    DATA: GT_PARK TYPE STANDARD TABLE OF ZIXCP_T03,
          GWA_PARK TYPE ZIXCP_T03.
    DATA:GT_RSEG TYPE STANDARD TABLE OF RSEG,
         GWA_RSEG TYPE RSEG.
    DATA: GT_HIST TYPE STANDARD TABLE OF EKBE,
          GWA_HIST TYPE EKBE.
    DATA: GT_HEADER TYPE STANDARD TABLE OF RBKP,
          GWA_HEADER TYPE RBKP.
    DATA:GT_BAPI_INCINV_CREATE_HEADER TYPE STANDARD TABLE OF BAPI_INCINV_CREATE_HEADER,
         GWA_BAPI_INCINV_CREATE_HEADER TYPE BAPI_INCINV_CREATE_HEADER,
         GT_BAPI_INCINV_CREATE_ITEM TYPE STANDARD TABLE OF BAPI_INCINV_CREATE_ITEM,
         GWA_BAPI_INCINV_CREATE_ITEM TYPE BAPI_INCINV_CREATE_ITEM,
         GT_BAPIRET2 TYPE STANDARD TABLE OF BAPIRET2,
         GWA_BAPIRET2 TYPE BAPIRET2,
         GV_INVOICEDOCNUMBER TYPE BAPI_INCINV_FLD-INV_DOC_NO,
         GV_FISCALYEAR TYPE BAPI_INCINV_FLD-FISC_YEAR.
    SELECT * FROM ZIXCP_T03
             INTO TABLE GT_PARK
             WHERE STATUS = '041' AND
                   PO_INDICATOR = 'X'.
    IF SY-SUBRC = 0.
      SELECT * FROM EKBE
               INTO TABLE GT_HIST
               FOR ALL ENTRIES IN GT_PARK
               WHERE EBELN = GT_PARK-EBELN
                 and vgabe = 'P'
                 and BEWTP = 'T'.
      IF SY-SUBRC = 0.
        SELECT * FROM RBKP INTO TABLE GT_HEADER
                 FOR ALL ENTRIES IN GT_PARK
                 WHERE BELNR = GT_PARK-BELNR.
        IF SY-SUBRC = 0.
          SELECT * FROM RSEG INTO TABLE GT_RSEG
                   FOR ALL ENTRIES IN GT_PARK
                   WHERE BELNR = GT_PARK-BELNR.
          LOOP AT GT_PARK INTO GWA_PARK.
            READ TABLE GT_HEADER INTO GWA_HEADER WITH KEY BELNR = GWA_PARK-BELNR.
            IF SY-SUBRC = 0.
    *          MOVE-CORRESPONDING GWA_HEADER TO GWA_BAPI_INCINV_CREATE_HEADER.
              GWA_BAPI_INCINV_CREATE_HEADER-INVOICE_IND = 'X'.
              GWA_BAPI_INCINV_CREATE_HEADER-COMP_CODE = GWA_HEADER-BUKRS.
              GWA_BAPI_INCINV_CREATE_HEADER-DOC_DATE =  GWA_HEADER-BLDAT.
              GWA_BAPI_INCINV_CREATE_HEADER-PSTNG_DATE = GWA_HEADER-BUDAT.
              GWA_BAPI_INCINV_CREATE_HEADER-REF_DOC_NO = GWA_HEADER-XBLNR.
              GWA_BAPI_INCINV_CREATE_HEADER-CURRENCY     =  GWA_HEADER-WAERS.
    *          GWA_BAPI_INCINV_CREATE_HEADER-ITEM_TEXT = GWA_HEADER-
              GWA_BAPI_INCINV_CREATE_HEADER-DEL_COSTS_TAXC = GWA_HEADER-MWSKZ1.
              GWA_BAPI_INCINV_CREATE_HEADER-DOC_TYPE  = GWA_HEADER-BLART.
              GWA_BAPI_INCINV_CREATE_HEADER-BLINE_DATE = GWA_HEADER-ZFBDT.
              READ TABLE GT_RSEG INTO GWA_RSEG WITH KEY BELNR = GWA_PARK-BELNR.
              IF SY-SUBRC = 0.
                CLEAR GWA_BAPI_INCINV_CREATE_ITEM.
                REFRESH GT_BAPI_INCINV_CREATE_ITEM.
                LOOP AT GT_RSEG INTO GWA_RSEG
                        WHERE BELNR = GWA_PARK-BELNR.
    *              MOVE-CORRESPONDING GWA_RSEG TO GWA_BAPI_INCINV_CREATE_ITEM.
                  GWA_BAPI_INCINV_CREATE_ITEM-INVOICE_DOC_ITEM = GWA_RSEG-BUZEI.
                  GWA_BAPI_INCINV_CREATE_ITEM-PO_NUMBER = GWA_RSEG-EBELN.
                  GWA_BAPI_INCINV_CREATE_ITEM-PO_ITEM = GWA_RSEG-EBELP.
                  GWA_BAPI_INCINV_CREATE_ITEM-ITEM_AMOUNT = GWA_RSEG-WRBTR.
                  GWA_BAPI_INCINV_CREATE_ITEM-REF_DOC      = GWA_RSEG-LFBNR.
                  GWA_BAPI_INCINV_CREATE_ITEM-REF_DOC_YEAR = GWA_RSEG-LFGJA.
                  GWA_BAPI_INCINV_CREATE_ITEM-REF_DOC_IT   = GWA_RSEG-LFPOS.
                  GWA_BAPI_INCINV_CREATE_ITEM-TAX_CODE  = GWA_RSEG-MWSKZ.
                  APPEND GWA_BAPI_INCINV_CREATE_ITEM TO GT_BAPI_INCINV_CREATE_ITEM.
                  GWA_BAPI_INCINV_CREATE_HEADER-GROSS_AMOUNT = GWA_BAPI_INCINV_CREATE_HEADER-GROSS_AMOUNT + GWA_BAPI_INCINV_CREATE_ITEM-ITEM_AMOUNT.
                ENDLOOP.
                CALL FUNCTION 'BAPI_INCOMINGINVOICE_CREATE'
                  EXPORTING
                    HEADERDATA       = GWA_BAPI_INCINV_CREATE_HEADER
                  IMPORTING
                    INVOICEDOCNUMBER = GV_INVOICEDOCNUMBER
                    FISCALYEAR       = GV_FISCALYEAR
                  TABLES
                    ITEMDATA         = GT_BAPI_INCINV_CREATE_ITEM
                    RETURN           = GT_BAPIRET2.
              ENDIF.
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDIF.
    ENDIF.
    Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 2:38 PM

    Look at BAPI_INCOMINGINVOICE_POST
    Rob

  • Reg function module POSTING_INTERFACE_CLEARING

    Dear experts,
    I have a requirement in tcode FB05(Posting with clearing: Initial screen).  In that i need to select the radio button 'Transfer Posting with Clearing'.  I dont know exactly what happens here. I have to use function module POSTING_INTERFACE_CLEARING to post and clear the document. Can anybody tell me what this function module will do and by guiding me in this regard. Kindly help me in giving sample code as to how to handle this.
    thks in advance,
    ram

    Hello Ram
    Have a look at thread [POSTING_INTERFACE_CLEARING|POSTING_INTERFACE_CLEARING; and the links provided there.
    You may also want to have a look at transaction FCC1 (Payment Cards: Settlement). The report RFCCSSTT is used to settle open items payed with credit cards:
        ... FB05
          PERFORM posting_interface_start.
          PERFORM fb05_posting.
          PERFORM posting_interface_end.
        ... and Settlement
    Regards
      Uwe

  • Generic Data Extraction From SAP R/3 to BI server using Function Module

    Hi,
    I want step by step procedure for Generic Extraction from SAP R/3 application to BI application
    using Functional module.
    If any body have any Document or any PPT then please reply and post it in forum, i will give point for them.
    Thanks & Regards
    Subhasis Pan

    please go thr this link
    [SAP BI Generic Extraction Using a Function Module|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/business-intelligence/s-u/sap%20bi%20generic%20extraction%20using%20a%20function%20module.pdf]
    [Generic Data Extraction Using Function Module |Re: Generic Data Extraction Using Function Module;

  • Why we use function module u0091SSF_FUNCTION_MODULE_NAMEu0092 in smartform driver p

    Why we use function module ‘SSF_FUNCTION_MODULE_NAME’ in smartform driver program?

    Forum Search
    Use the form below to search the forum content. You can choose to search all content or restrict it to certain forums or dates. Also, you can filter the results by a username or user ID.
    Search Forum Content
    Search Terms:        Search Tips
    Category or Forum:      
    Date Range:      
    Results Per Page:      
    Welcome, Clemens Li      Help
    Your Control Panel      Your Control Panel
    Your Reward Points      Your Reward Points
    Your Questions      Your Questions
    Search Results » Messages: 271 - Search Terms: why we require ‘form interface’ section in smartform?      Sort by:
    Pages: 19 1 2 3 4 5 6 7 8 9 10
       1. Why we require ‘FORM INTERFACE’ section in smartform?
          Posted on: Sep 12, 2007 10:47 PM, by user: p d -- Relevance: 100% -- Show all results within this thread
          Why we require ‘FORM INTERFACE’ section in smartform?
       2. What is the driver program & why we require driver program?
          Posted on: Sep 12, 2007 10:48 PM, by user: p d -- Relevance: 17% -- Show all results within this thread
          What is the driver program & why we require driver program?
       3. Re: form interface in smartform
          Posted on: Feb 21, 2006 11:51 AM, by user: Hasmath -- Relevance: 14% -- Show all results within this thread
          hard-coded driver program in the tables section. for this u have to define the same structure in the form interface of the smartforms and can use the same structure for sending the data to the smartform ...
       4. Smartform: Form Interface
          Posted on: Aug 24, 2007 2:34 PM, by user: vivek pandey -- Relevance: 13% -- Show all results within this thread
          Hi, If we want to use a workarea/internaltable in the form interface of Smartform of a user defined structure ...
       5. Form Interface in Smartforms ?
          Posted on: Oct 27, 2006 5:32 PM, by user: SAP BEE -- Relevance: 12% -- Show all results within this thread
          ztest ) on the table and print the value : &gs_vbap-total&. I activate the form ...it is fine ...as well as program !! Now , when i do the print preview of the form , It gives an error : Reference ...
       6. SmartForms form interface - tables
          Posted on: May 18, 2005 2:44 PM, by user: Diliip Gupchup -- Relevance: 12% -- Show all results within this thread
          Hi All, In smart forms how to declare our internal table in form interface? By using types in global itried but it is ...
       7. Calling thru Form Interface of Smartforms
          Posted on: May 4, 2007 3:03 AM, by user: Subhasish Ganguly -- Relevance: 11% -- Show all results within this thread
          In a Smartforms, how can I call a internal table thru 'Form interface' which has been declared in the driver program? ...
       8. Form Interface in SMARTFORMS
          Posted on: Jun 1, 2006 10:56 AM, by user: Rams V -- Relevance: 11% -- Show all results within this thread
          Hi There, Is it mandatory to create a custom structure in ABAP dictionary to use it in SMARTFORM interface? regards, Rams. ...
       9. Line Types and Table types & Smartform form interface
          Posted on: Sep 21, 2005 3:38 PM, by user: Aadarsh K -- Relevance: 10% -- Show all results within this thread
          types ?? 2. In smartforms form interface, in the importing parameter, can tables be passed ?? [we use tables parameter generally, but even if passed in export parameter, no error is being given and ...
      10. regarding complex section in smartforms
          Posted on: Aug 25, 2007 7:49 AM, by user: ravi -- Relevance: 10% -- Show all results within this thread
          learning smartforms on 5.0ecc and i got the documents which is showing the complex section but in 5.0 ecc we have no complex section cud u plz let me know where sud i add the contents of the complex section ...
      11. why is it that some function module require an endselect
          Posted on: Aug 8, 2007 3:40 PM, by user: mathias Mbizvo -- Relevance: 10% -- Show all results within this thread
          why is it that some function module require an endselect and some can work without the endselect...
      12. Complex section in smartforms
          Posted on: Aug 11, 2007 7:29 PM, by user: narendra veduru -- Relevance: 9% -- Show all results within this thread
          Hi I am practicing smartforms in 4.7. I have a tutorial based on 4.6c and they have complex section in the nodes. How do i ...
      13. form interface using currency fields - smartforms urgent!!!!
          Posted on: Aug 17, 2005 1:11 AM, by user: skmysore -- Relevance: 9% -- Show all results within this thread
          called function module. what is the error here? How can i correct this to display data into the form? Please help me it is urgent!!! Thanks Santhosh ...
      14. why do we activate a program
          Posted on: Feb 28, 2007 5:50 AM, by user: Rose -- Relevance: 8% -- Show all results within this thread
          hi, why do we activate a program or tables in sap.Though there is a option known as save why do we activate? ...
      15. Re: what is form interface and global definitions
          Posted on: Jun 5, 2007 8:25 AM, by user: Venkatesh -- Relevance: 8% -- Show all results within this thread
          Function modules. and global definitions are the variable or tables declared with in the smartform. we can pass values to the smartform from the driver programme through the form interface. if helpful ...
    Pages: 19 [ 1 2 3 4 5 6 7 8 9 10 | Next

  • How to Send Internal table to SAP Spool using Function Modules or Methods?

    Hi Experts,
    How to Send Internal table to SAP Spool using Function Modules or Methods?
    Thanks ,
    Kiran

    This is my code.
    I still get the no ABAP list data for the spool, even tho I can see it sp01?
    REPORT  Z_MAIL_PAYSLIP.
    * Declaration Part *
    tables: PERNR, PV000, T549Q, V_T514D, HRPY_RGDIR.
    infotypes: 0000, 0001, 0105, 0655.
    data: begin of ITAB occurs 0,
      MTEXT(25) type C,
      PERNR like PA0001-PERNR,
      ABKRS like PA0001-ABKRS,
      ENAME like PA0001-ENAME,
      USRID_LONG like PA0105-USRID_LONG,
    end of ITAB.
    data: W_BEGDA like HRPY_RGDIR-FPBEG,
          W_ENDDA like HRPY_RGDIR-FPEND.
    data: RETURN like BAPIRETURN1 occurs 0 with header line.
    data: P_INFO like PC407,
          P_FORM like PC408 occurs 0 with header line.
    data: P_IDX type I,
          MY_MONTH type T549Q-PABRP,
          STR_MY_MONTH(2) type C,
          MY_YEAR type T549Q-PABRJ,
          STR_MY_YEAR(4) type C,
          CRLF(2) type x value '0D0A'.
    data: W_CMONTH(10) type C.
    data: TAB_LINES type I,
          ATT_TYPE like SOODK-OBJTP.
    data: begin of P_INDEX occurs 0,
            INDEX type I,
    end of P_INDEX.
    constants: begin of F__LTYPE, "type of line
       CMD like PC408-LTYPE value '/:',  "command
       TXT like PC408-LTYPE value 's',   "textline
    end of F__LTYPE.
    constants: begin of F__CMD, "commands
      NEWPAGE like PC408-LINDA value '',
    end of F__CMD.
    data: P_LIST like ABAPLIST occurs 1 with header line.
    *data: OBJBIN like SOLISTI1 occurs 10 with header line,
    data: OBJBIN like  LVC_S_1022 occurs 10 with header line,
          DOCDATA like SODOCCHGI1,
          OBJTXT like SOLISTI1 occurs 10 with header line,
          OBJPACK like SOPCKLSTI1 occurs 1 with header line,
          RECLIST like SOMLRECI1 occurs 1 with header line,
          OBJHEAD like SOLISTI1 occurs 1 with header line,
          it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          gd_buffer type string,
          l_no_of_bytes TYPE i,
          l_pdf_spoolid LIKE tsp01-rqident,
          l_jobname     LIKE tbtcjob-jobname.
    data: file_length  type int4,
          spool_id     type rspoid,
          line_cnt     type i.
    *-------------------------------------------------------------------* * INITIALIZATION *
    OBJBIN = ' | '.
    append OBJBIN.
    OBJPACK-HEAD_START = 1.
    data: S_ABKRS like PV000-ABKRS.
    data: S_PABRP like T549Q-PABRP.
    data: S_PABRJ like T549Q-PABRJ.
    * SELECTION SCREEN                                                  *
    selection-screen begin of block BL1.
    parameters: PAY_VAR like BAPI7004-PAYSLIP_VARIANT default 'ESS_PAYSLIPS' obligatory.
    selection-screen end of block BL1.
    START-OF-SELECTION.
      s_ABKRS = PNPXABKR.
      S_PABRP = PNPPABRP.
      s_pabrj = PNPPABRJ.
      w_begda = PN-BEGDA.
      w_endda = PN-ENDDA.
    get pernr.
    *                                 "Check active employees
      rp-provide-from-last p0000 space pn-begda  pn-endda.
      CHECK P0000-STAT2 IN PNPSTAT2.
    *                                 "Check Payslip Mail flag
      rp-provide-from-last p0655 space pn-begda  pn-endda.
      CHECK P0655-ESSONLY = 'X'.
      rp-provide-from-last p0001 space pn-begda  pn-endda.
    *                                 "Find email address
      RP-PROVIDE-FROM-LAST P0105 '0030' PN-BEGDA PN-ENDDA.
      if p0105-usrid_LONG ne ''.
        ITAB-PERNR      = P0001-PERNR.
        ITAB-ABKRS      = P0001-ABKRS.
        ITAB-ENAME      = P0001-ENAME.
        ITAB-USRID_LONG = P0105-USRID_LONG.
        append itab.
        clear itab.
      endif.
      "SY-UCOMM ='ONLI'
    END-OF-SELECTION.
    *------------------------------------------------------------------* start-of-selection.
      write : / 'Payroll Area        : ', S_ABKRS.
      write : / 'Payroll Period/Year : ',STR_MY_MONTH,'-',STR_MY_YEAR. write : / 'System Date : ', SY-DATUM.
      write : / 'System Time         : ', SY-UZEIT.
      write : / 'User Name           : ', SY-UNAME.
      write : / SY-ULINE.
      sort ITAB by PERNR.
      loop at ITAB.
        clear : P_INFO, P_FORM, P_INDEX, P_LIST, OBJBIN, DOCDATA, OBJTXT, OBJPACK, RECLIST, TAB_LINES.
        refresh : P_FORM, P_INDEX, P_LIST, OBJBIN, OBJTXT, OBJPACK, RECLIST.
    *                                                  Retrieve Payroll results sequence number for this run
        select single * from HRPY_RGDIR where PERNR eq ITAB-PERNR
                                        and FPBEG ge W_BEGDA
                                        and FPEND le W_ENDDA
                                        and SRTZA eq 'A'.
    *                                                  Produce payslip for those payroll results
        if SY-SUBRC = 0.
          call function 'GET_PAYSLIP'
            EXPORTING
              EMPLOYEE_NUMBER = ITAB-PERNR
              SEQUENCE_NUMBER = HRPY_RGDIR-SEQNR
              PAYSLIP_VARIANT = PAY_VAR
            IMPORTING
              RETURN          = RETURN
              P_INFO          = P_INFO
            TABLES
              P_FORM          = P_FORM.
          check RETURN is initial.
    *                                                 remove linetype from generated payslip
          loop at p_form.
            objbin = p_form-linda.
            append objbin.
            line_cnt = line_cnt + 1.
          endloop.
          file_length = line_cnt * 1022.
    *                                                 create spool file of paylsip
          CALL FUNCTION 'SLVC_TABLE_PS_TO_SPOOL'
            EXPORTING
              i_file_length = file_length
            IMPORTING
              e_spoolid     = spool_id
            TABLES
              it_textdata   = objbin.
          IF sy-subrc EQ 0.
            WRITE spool_id.
          ENDIF.
          DESCRIBE table objbin.
          DATA PDF LIKE TLINE OCCURS 100 WITH HEADER LINE.
          CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
            EXPORTING
              SRC_SPOOLID                    = spool_id
              NO_DIALOG                      = ' '
              DST_DEVICE                     = 'MAIL'
    *      PDF_DESTINATION                =
    *    IMPORTING
    *      PDF_BYTECOUNT                  = l_no_of_bytes
    *      PDF_SPOOLID                    = l_pdf_spoolid
    *      LIST_PAGECOUNT                 =
    *      BTC_JOBNAME                    =
    *      BTC_JOBCOUNT                   =
            TABLES
              PDF                            = pdf
            EXCEPTIONS
              ERR_NO_ABAP_SPOOLJOB           = 1
              ERR_NO_SPOOLJOB                = 2
              ERR_NO_PERMISSION              = 3
              ERR_CONV_NOT_POSSIBLE          = 4
              ERR_BAD_DESTDEVICE             = 5
              USER_CANCELLED                 = 6
              ERR_SPOOLERROR                 = 7
              ERR_TEMSEERROR                 = 8
              ERR_BTCJOB_OPEN_FAILED         = 9
              ERR_BTCJOB_SUBMIT_FAILED       = 10
              ERR_BTCJOB_CLOSE_FAILED        = 11
              OTHERS                         = 12
          IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    *Download PDF file C Drive
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename = 'C:\itab_to_pdf.pdf'
          filetype = 'BIN'
        TABLES
          data_tab = pdf.
    * Transfer the 132-long strings to 255-long strings
    *  LOOP AT pdf.
    *    TRANSLATE pdf USING ' ~'.
    *    CONCATENATE gd_buffer pdf INTO gd_buffer.
    *  ENDLOOP.
    *  TRANSLATE gd_buffer USING '~ '.
    *  DO.
    *    it_mess_att = gd_buffer.
    *    APPEND it_mess_att.
    *    SHIFT gd_buffer LEFT BY 255 PLACES.
    *    IF gd_buffer IS INITIAL.
    *      EXIT.
    *    ENDIF.
    *  ENDDO.
          OBJHEAD = 'Objhead'.
          append OBJHEAD.
    * preparing email subject
          concatenate W_ENDDA(6)
                    ' Payslip-'
                    ITAB-ENAME+0(28)
                    ITAB-PERNR+4(4) ')'
                 into DOCDATA-OBJ_DESCR.
          DOCDATA-OBJ_NAME = 'Pay Slip'.
          DOCDATA-OBJ_LANGU = SY-LANGU.
          OBJTXT = 'Pay Slip.'.
          append OBJTXT.
    *prepare email lines
          OBJTXT = DOCDATA-OBJ_DESCR.
          append OBJTXT.
          OBJTXT = 'Please find enclosed your current payslip.'.
          append OBJTXT.
    * Write Attachment(Main)
    * 3 has been fixed because OBJTXT has fix three lines
          read table OBJTXT index 3.
    *    DOCDATA-DOC_SIZE = ( 3 - 1 ) * 255 + strlen( OBJTXT ).
          clear OBJPACK-TRANSF_BIN.
          OBJPACK-HEAD_START = 1.
          OBJPACK-HEAD_NUM = 0.
          OBJPACK-BODY_START = 1.
          OBJPACK-BODY_NUM = 3.
          OBJPACK-DOC_TYPE = 'RAW'.
          append OBJPACK.
    * Create Message Attachment
          ATT_TYPE = 'PDF'.
          describe table OBJBIN lines TAB_LINES.
          read table OBJBIN index TAB_LINES.
    *    OBJPACK-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + strlen( OBJBIN ).
          OBJPACK-TRANSF_BIN = 'X'.
          OBJPACK-HEAD_START = 1.
          OBJPACK-HEAD_NUM = 0.
          OBJPACK-BODY_START = 1.
          OBJPACK-BODY_NUM = TAB_LINES.
          OBJPACK-DOC_TYPE = ATT_TYPE.
          OBJPACK-OBJ_NAME = 'ATTACHMENT'.
          OBJPACK-OBJ_DESCR = 'Payslip'.
          append OBJPACK.
    * Create receiver list refresh RECLIST.
          clear RECLIST.
          RECLIST-RECEIVER = itab-USRID_long.
          translate RECLIST-RECEIVER to lower case.
          RECLIST-REC_TYPE = 'U'.
          append RECLIST.
    * Send the document
    *SO_NEW_DOCUMENT_ATT_SEND_API1
          call function 'SO_DOCUMENT_SEND_API1'
            exporting
              DOCUMENT_DATA = DOCDATA
              PUT_IN_OUTBOX = 'X'
              COMMIT_WORK = 'X'
    * IMPORTING
    *   SENT_TO_ALL =
    *   NEW_OBJECT_ID =
            tables
              PACKING_LIST  = OBJPACK
              OBJECT_HEADER = OBJHEAD
              CONTENTS_BIN  = pdf
              CONTENTS_TXT  = OBJTXT
    *   CONTENTS_HEX =
    *   OBJECT_PARA =
    *   OBJECT_PARB =
              RECEIVERS = RECLIST
            exceptions
              TOO_MANY_RECEIVERS = 1
              DOCUMENT_NOT_SENT = 2
              DOCUMENT_TYPE_NOT_EXIST = 3
              OPERATION_NO_AUTHORIZATION = 4
              PARAMETER_ERROR = 5
              X_ERROR = 6
              ENQUEUE_ERROR = 7
              others = 8.
          if SY-SUBRC NE 0.
            ITAB-MTEXT = 'Message Not Sent to : '.
          else.
            ITAB-MTEXT = 'Message Sent to : '.
          endif.
    *    else.
    *      ITAB-MTEXT = 'Message Not Sent to : '.
    *    endif.
        else.
          "SY-SUBRC Not = 0
          ITAB-MTEXT = 'Payroll data not found : '.
        endif.
        "end of SY-SUBRC = 0.
        modify ITAB.
      endloop. "end loop at ITAB
      sort ITAB by MTEXT PERNR.
      loop at ITAB.
        at new MTEXT.
          uline.
          write : / ITAB-MTEXT color 4 intensified on.
          write : / 'Emp. Code' color 2 intensified on,
                 12 'Emp. Name' color 2 intensified on,
                 54 'Email ID' color 2 intensified on.
        endat.
        write : / ITAB-PERNR, 12 ITAB-ENAME, 54 ITAB-USRID_LONG.
      endloop.

  • Custom extractors using function modules

    Hey all
    Does anyone has a document regarding how to <b>Develop Custom extractors using function modules?Step by step method would be great</b>
    Also document regarding <b>CTS in BW?</b>
    Appreciate it
    Thanks

    Hi,
    See here:
    Generic Extractors
    Generic data sources
    Generic DS
    /people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
    Best regards,
    Eugene

  • Hi. i used Function module to change Characteristic values of a sales order

    hi. i used Function module to change Characteristic values of a sales order..
    but sales order's Characteristic values didn't change.
    And the Function module doesn't occur any log message.
    please tell me wrong code, and how to solve this problem.
    if i have wrong method, what data can i pass to change the characteristic values
    DATA: LT_E1CUVAL    TYPE TABLE OF E1CUVAL.
      DATA: WA_E1CUVAL    TYPE E1CUVAL.
      DATA: LS_CFG_HEAD   LIKE CUXT_CUCFG_S,
            LS_INSTANCES  LIKE CUXT_CUINS_S,
            LS_VALUES     LIKE CUXT_CUVAL_S,
            LS_E1CUCFG    LIKE E1CUCFG,
            LS_E1CUINS    LIKE E1CUINS,
            LS_E1CUVAL    LIKE E1CUVAL,
            LS_PROFILE    LIKE E1CUCOM,
            LS_VBAP       LIKE VBAP,
            L_CUOBJ       LIKE INOB-CUOBJ,
            L_ATINN       LIKE CABN-ATINN.
      DATA: LT_INSTANCES  LIKE CUXT_CUINS_S OCCURS 0,
            LT_PART_OF    LIKE CUXT_CUPRT_S OCCURS 0,
            LT_VALUES     LIKE CUXT_CUVAL_S OCCURS 0,
            LT_VAR_KEYS   LIKE CUXT_CUVK_S  OCCURS 0,
            LT_KSML       LIKE KSML         OCCURS 0 WITH HEADER LINE,
            BEGIN OF LT_CLINT OCCURS 0,
              CLINT  LIKE KSSK-CLINT,
            END OF LT_CLINT.
      DATA: LT_CUIB       LIKE CUIB_CUOBJ_S OCCURS 0 WITH HEADER LINE.
      DATA: E_ROOT_INSTANCE           TYPE     CUXT_INSTANCE_NO.
      DATA: EV_ROOT_PERSIST_ID     TYPE     IBEXTINST_DATA-EXT_INST_ID.
      DATA: EV_CFG_HAS_CHANGED     TYPE     XFELD.
      DATA: EV_HANDLE_APPL_LOG     TYPE     BALLOGHNDL.
      DATA: L_CUOBJ_NEW           TYPE CUOBJ.
      DATA: L_OWNER               TYPE IBXX_BUSINESS_OBJECT.
      REFRESH LT_E1CUVAL.
      CLEAR LS_VBAP.
      SELECT SINGLE CUOBJ INTO CORRESPONDING FIELDS OF LS_VBAP
                                FROM VBAP WHERE VBELN = I_VBELN
                                            AND POSNR = I_POSNR.
      IF SY-SUBRC <> 0.
        RAISE INSTANCE_NOT_FOUND.
      ENDIF.
      REFRESH LT_CUIB. CLEAR LT_CUIB.
      LT_CUIB-INSTANCE = LS_VBAP-CUOBJ.
      APPEND LT_CUIB.
      CALL FUNCTION 'CUCB_INITIALIZER'
        EXPORTING
          IT_INSTANCES = LT_CUIB[].
      CALL FUNCTION 'CUXI_GET_SINGLE_CONFIGURATION'
        EXPORTING
          I_ROOT_INSTANCE              = LS_VBAP-CUOBJ
        IMPORTING
          E_CFG_HEAD                   = LS_CFG_HEAD
          ES_PROFILE                   = LS_PROFILE
          ET_RETURN                    = ET_RETURN
        TABLES
          E_TAB_INSTANCES              = LT_INSTANCES
          E_TAB_PART_OF                = LT_PART_OF
          E_TAB_VALUES                 = LT_VALUES
          E_TAB_VAR_KEYS               = LT_VAR_KEYS
        EXCEPTIONS
          INVALID_INSTANCE             = 1
          NO_ROOT_INSTANCE             = 2
          INSTANCE_IS_A_CLASSIFICATION = 3
          INTERNAL_ERROR               = 4
          NO_PROFILE_FOUND             = 5
          INVALID_DATA                 = 6
          OTHERS                       = 7.
      IF SY-SUBRC <> 0.
        CASE SY-SUBRC.
          WHEN 1.
            RAISE INSTANCE_NOT_FOUND.
          WHEN 3.
            RAISE INSTANCE_IS_A_CLASSIFICATION.
          WHEN OTHERS.
            RAISE INVALID_DATA.
        ENDCASE.
      ELSE.
        LOOP AT LT_VALUES INTO LS_VALUES.
          IF    LS_VALUES-CHARC = 'SAP_MILLCA_PACKAGING'
             OR LS_VALUES-CHARC = 'PD_CA_PACKING_DM'.
            LS_VALUES-VALUE = '7100010'. "This is test data
            MODIFY LT_VALUES FROM LS_VALUES.
          ELSE.
            DELETE LT_VALUES WHERE CHARC = LS_VALUES-CHARC.
          ENDIF.
          CLEAR LS_VALUES.
        ENDLOOP.
      ENDIF.
    &#50689;&#50629;&#51221;&#48372; &#53945;&#49457; &#48320;&#44221;
      CALL FUNCTION 'CUXI_SET_SINGLE_CONFIGURATION'
        EXPORTING
          I_CFG_HEADER                        = LS_CFG_HEAD
          I_ROOT_INSTANCE                     = LS_VBAP-CUOBJ
        I_PLANT                             =
        I_STRUCTURE_EXPLOSION_DATE          =
        I_STRUCTURE_EXPLOSION_APPL_ID       =
        I_LOGSYS                            =
          IS_PROFILE                          = LS_PROFILE
        IV_ONLY_SINGLE_LEVEL                =
        IV_HANDLE_APPL_LOG                  =
        IV_OBJECT_APPL_LOG                  = 'CIF'
        IV_SUBOBJECT_APPL_LOG               = 'T_CNFG'
        IMPORTING
          E_ROOT_INSTANCE                     = E_ROOT_INSTANCE
          EV_ROOT_PERSIST_ID                  = EV_ROOT_PERSIST_ID
          EV_CFG_HAS_CHANGED                  = EV_CFG_HAS_CHANGED
          EV_HANDLE_APPL_LOG                  = EV_HANDLE_APPL_LOG
          ET_RETURN                           = ET_RETURN
        TABLES
          I_TAB_INSTANCES                     = LT_INSTANCES
          I_TAB_PART_OF                       = LT_PART_OF
          I_TAB_VALUES                        = LT_VALUES
          I_TAB_VAR_KEYS                      = LT_VAR_KEYS
        I_TAB_BLOB                          =
        EXCEPTIONS
          NO_CONFIGURATION_DATA               = 1
          NO_ROOT_INSTANCE                    = 2
          INVALID_INSTANCE                    = 3
          INSTANCE_IS_A_CLASSIFICATION        = 4
          INTERNAL_ERROR                      = 5
          NO_PROFILE_FOUND                    = 6
          INVALID_DATA                        = 7
          OTHERS                              = 8
      IF SY-SUBRC <> 0.
        CASE SY-SUBRC.
          WHEN 1.
            RAISE NO_CONFIGURATION_DATA.
          WHEN 3.
            RAISE NO_ROOT_INSTANCE.
          WHEN 3.
            RAISE INVALID_INSTANCE .
          WHEN 3.
            RAISE INSTANCE_IS_A_CLASSIFICATION.
          WHEN 3.
            RAISE INTERNAL_ERROR.
          WHEN OTHERS.
            RAISE INVALID_DATA.
        ENDCASE.
      ENDIF.
      COMMIT WORK.
    save configuration with next commit
      CLEAR: LS_INSTANCES.
      READ TABLE LT_INSTANCES INTO LS_INSTANCES INDEX 1.
    L_OWNER-OBJECT_TYPE = LS_INSTANCES-OBJ_TYPE.
      L_OWNER-OBJECT_TYPE = 'PVS_POSVAR'.
      L_OWNER-OBJECT_KEY  = LS_INSTANCES-OBJ_KEY.
      CALL FUNCTION 'CUCB_CONFIGURATION_TO_DB'
        EXPORTING
          ROOT_INSTANCE         = LS_VBAP-CUOBJ
          ROOT_OBJECT           = L_OWNER
        IMPORTING
          NEW_INSTANCE          = L_CUOBJ_NEW
        EXCEPTIONS
          INVALID_INSTANCE      = 1
          INVALID_ROOT_INSTANCE = 2
          NO_CHANGES            = 3
          OTHERS                = 4.
      IF SY-SUBRC > 1 AND SY-SUBRC <> 3.
        CLEAR LS_VBAP-CUOBJ.
        RAISE INTERNAL_ERROR.
      ELSEIF SY-SUBRC = 1.
        LS_VBAP-CUOBJ = L_CUOBJ_NEW.
      ENDIF.
    What's wrong?
    help me to solve this problem.
    Thanks a lot.

    <b>SD_SALES_DOCUMENT_READ</b> Reads sales document header and business data: tables VBAK, VBKD and VBPA (Sold-to (AG), Payer (RG) and Ship-to (WE) parties)
    <b>SD_SALES_DOCUMENT_READ_POS</b> Reads sales document header and item material: tables VBAK, VBAP-MATNR
    <b>SD_DOCUMENT_PARTNER_READ</b> partner information including address. Calls SD_PARTNER_READ
    <b>SD_PARTNER_READ</b> all the partners information and addresses
    <b>SD_DETERMINE_CONTRACT_TYPE</b>
    In: at least VBAK-VBELN
    Exceptions: NO CONTRACT | SERVICE_CONTRACT | QUANTITY_CONTRACT
    <b>SD_SALES_DOCUMENT_COPY</b>
    <b>RV_ORDER_FLOW_INFORMATION</b> Reads sales document flow of sales document after delivery and billing
    SD_SALES_DOCUMENT_SAVE create Sales Doc from the copied document
    SD_SALES_DOCUMENT_ENQUEUE to dequeue use DEQUEUE_EVVBAKE
    RV_DELIVERY_PRINT_VIEW Data provision for delivery note printing
    SD_PACKING_PRINT_VIEW
    SD_DELIVERY_VIEW Data collection for printing
    called from RV_DELIVERY_PRINT_VIEW, SD_PACKING_PRINT_VIEW
    RV_BILLING_PRINT_VIEW Data Provision for Billing Document Print
    regards
    vinod

  • Generic Extraction - Using Function Modules

    Hi Friends,
    Can you pl let me know the step by step process for creating generic extraction using function module?
    Thanks in Advance.
    Regards,
    Ari.
    Please search the forum before posting a thread
    Edited by: Pravender on Aug 5, 2010 7:31 PM

    Hi,
    Plz find this doc.
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a0f46157-e1c4-2910-27aa-e3f4a9c8df33.
    And go this link...
    http://www.sdn.sap.com/irj/scn/advancedsearch?query=genericextractionwithfunctionmadule
    Regards.....KP
    Edited by: kundan.sap on Aug 5, 2010 4:35 PM

  • Generick Extarction using Function Module.

    Hi,
    Give me the steps Generic Extraction using function module.Thanks for your help.
    Thanks & Regards,
    Suresh.

    Hi,
    Check the below threads:
    Using function module as the generic extractor
    Generic Delta Update using Function Module
    Document regarding R/3 extractors using function module/user exits
    Generic extractors using FM
    Also refer the document:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/d3219af2-0c01-0010-71ac-dbb4356cf4bf
    Reg
    Pra

  • Updating liveCache Data using Function Module or ABAP program.

    Is it possible to update APO Live Cache using Function Module or ABAP Program.
    Will the aggregation/disaggreagation remain the same if data is modified using Function Module or ABAP Program.
    Regards,
    Vikas

    ello Vikas,
    -> Please click at
    http://help.sap.com/saphelp_nw04/helpdata/en/f2/0271f49770f0498d32844fc0283645/frameset.htm
    & read about 'SAP liveCache'.
    As you know objects stored in liveCache in the class containers can be accessed
    and manipulated only via LCA routines which are methods of LCA objects.
    The registration of the LCA routines is done automatically when
    the liveCache is started by the LC10, check the lcinit.log file.
    The shared procedures in the LiveCache are written in C++ and shipped
    to the customers as binary shared libraries(LCA-Routines) < LCA build >
    together with the LiveCache. The original C++ source code of the
    libraries is not generally available to the customers.
    The LCA routines could be called via "/SAPAPO/OM*" ABAP functions.
    -> For SAP liveCache documentation in English:
    http://help.sap.com/saphelp_nw04/helpdata/en/f2/0271f49770f0498d32844fc0283645/frameset.htm
    < -> Database Administration in CCMS: SAP liveCache -> liveCache Assistant ->
    liveCache: Monitoring -> Problem Analysis-> DB Procedures >
    In transaction LC10 for the LCA connection choose liveCache:Monitoring
    then go to Problem Analysis -> DB Procedures=>
    The system displays an overview of all database procedures loaded into
    liveCache, their input and output parameters, and other details.
    -> Tr. /n/SAPAPO/OM16 ( in further releases /n/sapapo/om19 ) is provided by
    SAP to get information about data stored in the LiveCache. If you would
    like to get your own views, you should write a special report in ABAP using
    "/SAPAPO/OM"-development class functionality.
    -> There are standard function modules in ABAP available to extract/change data from/in liveCache.
    -> In addition to the given information => find more information at:
    SCM 4.0 -> http://help.sap.com/saphelp_scm40/helpdata/en/12/3dfd81126e1c448c870f335f11d016/frameset.htm
    SCM 4.1 ->
    http://help.sap.com/saphelp_scm41/helpdata/en/12/3dfd81126e1c448c870f335f11d016/frameset.htm
    SCM 5.0 ->
    http://help.sap.com/saphelp_scm50/helpdata/en/12/3dfd81126e1c448c870f335f11d016/frameset.htm
    You can go to the Advanced Planner and Optimizer documentation from the above links < Supply Network Planning Run -> Aggregated Planning -> SNP Disaggregation Or SNP aggregation . >.
    If you still have open questions on the posted topic =>
    Could you please give more information on your application scenario.
    Thank you and best regards, Natalia Khlopina

  • Creating a Generic Datasource using Function Module

    Hi Guru's
                  We are tryin to create a Generic datasource using function module, we have found few old how to guides for doing the same but it is not effective and need to be altered. Can anyone suggest me the latest step by step procedure to create the above, also if you have the how to guide kindly paste the link as it will be a great help at this point.
    Thanks in advance
    Regards
    Liquid

    Hi,
    Please goto the Following links  :-
                                                                          PDF
    1)         http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c062a3a8-f44c-2c10-ccb8-9b88fbdcb008?quicklink=index&overridelayout=true
    2)        http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a0f46157-e1c4-2910-27aa-e3f4a9c8df33?quicklink=index&overridelayout=true
                                                     SAP Forum
    3)        Re: DataSouce based on FM
    4)       http://forums.sdn.sap.com/post!reply.jspa?messageID=10050614
    5)       https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a0f46157-e1c4-2910-27aa-e3f4a9c8df33
    6)       Re: Generic datasource with functional module
    7)       Generic Extractor (FM based) - Delta Enabled
    Regards
    Obaid

  • Create virtual infocube using function module

    HI all,  Searched lot of document to create virtual infocube using function module, I am not getting good one, If any one give PDF document step by step process it will be useful for me. thank u

    Hi
    Please refer this document.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/9066d1fa-efc1-2b10-7b96-9ddee3b11b40?quicklink=index&overridelayout=true
    Thanks
    Suganya

  • Using function module PT_ARQ_REQUEST_EXECUTE to approve leave requests

    I'm building a screen to approve or reject multiple leave requests using function module PT_ARQ_REQUEST_EXECUTE as the SAP standard program RPTARQAPP does, and this seems to be working fine.  However, I also need to include a note from the approver which is a bit of long text that ends up in table PTREQ_NOTICE.  This is something that RPTARQAPP does not do.
    I cannot find any way of passing this text into PT_ARQ_REQUEST_EXECUTE.  The only way I can find of doing this is to call FM PT_ARQ_REQUEST_PREPARE first (command = PREPARE_APPROVE), update the CURR_NOTICE field it sends back in structure EX_REQUEST, then pass the changed EX_REQUEST structure into FM PT_ARQ_REQUEST_CHECK (command = CHECK_APPROVE)  and then call PT_ARQ_REQUEST_EXECUTE (command = EXECUTE_APPROVE).  This works fine for a single leave request, but when I try to use this process to approve two leave requests the CHECK FM gives me an error on the second record with a message referring to a time conflict with the first message even though the dates on each are not the same.
    I've searched and there are a few posts about these FMs, but I still can't fix this problem.  Has anyone ever dealt with this situation before and found a solution?

    I've replaced the call to FM PT_ARQ_REQUEST_CHECK with the following and it seems to work pretty well.  Though of course it will need a lot more testing.
    STATICS:
        request TYPE REF TO if_pt_req_request.
      CALL METHOD ca_pt_req_header=>agent->get_request
          EXPORTING
            im_request_id     = p_im_request_id
          IMPORTING
            ex_request        = request
          EXCEPTIONS
            request_not_found = 1.
      CALL METHOD request->set_notice
          EXPORTING
            IM_NOTICE               = p_approver_text.

  • Delta Problem while extracting the data by using function module

    Hi Experts,
    I have extracted the data by using Function module, for delta loads I have given Calday and additive delta in Generic delta settings, in BW side I have initialized the data after that I have given delta update option in infopackage and I made process chain also, every day process chain is running successfully but it is showing zero records, but there is a data in Data source (RSA3), means delta is not working.
    What is the problem,
    Is there any another settings for delta loads,
    Please help me to do this,
    Helpful answer will be appreciated with points,
    Regards,
    Venkat

    Hi,
    Try this delta type :NEW STATUS FOR CHANGED RECORDS.
    More information from Nagesh, this information may help
    1. New status for changed Records.
    2. Additive delta.
    New status for changed records means
    New Order
    order no quantity
    1000 10
    order changed to quntity 8. then 2 records will posted 2 BW in first case.
    1000 -10
    1000 8
    if you come to Additve delta.
    for the same case it will send the same record as
    1000 10
    changed records
    1000 -2
    this is the difference. New status with changed records should be used only in association with ODS not cube becoz we don't have overwrite option.
    Additive delta we can use for ODS and Cubes with update mode Addition.
    Regards,
    Satya

Maybe you are looking for

  • I need to find a method of opening and then saving to PDF every Framemaker document in a given directory. Can fmbatch be used to do this?

    Does anyone have an fmbatch file which could find all the .fm files in a given directory, open them with FrameMaker and the save them as a PDF file. Or Can someone show me the commands required to do that?

  • BPM Configuration

    Hi Guru's My client wants to implement BPM in Solution manager 7.0. Want to see look feel about it. Is there any Prototype setup document to show what and all we get after implementing BPM. I mean is there any Configuration Blog for BPM? Please reply

  • Error installing sql server 2008 management studio express

    Hello, I need to install sql server 2008 management studio express on a sql server 2k8 R2 instance. First of all, I've downloaded this one from this link: http://www.microsoft.com/en-us/download/details.aspx?id=7593 (for 32 bits). Once I've the downl

  • RPD Business Model Layer Question

    I have multiple fact tables that has the dimension table values like Customer Id, Status, Customer Class in the fact table itself. I added the fact as logical table source to the dimension table in BMM layer. But the problem I have when I try filter

  • How could I do a thread with Labview?

    I'm doing a VI with inside a calling to a SubVI. How could the Top-level VI works meanwhile the subVI is working? The top-level VI has to work like a thread because it takes measures from the serial port calling a C DLL, so when I call the SubVI it h