Fetching preceding documents from VBFA by passing subsequent document

Hi Folks,
Here my requirement is to fetch preceding documents  by giving subsequent documents as input to tableVBFA(document flow). As there is no index present on the field VBELN and POSNN it takes long time to retrieve data based on these fields.Creating secondary index is not possible. I have also tried with function module 'SD_VIEW_VBFAVG'  as it takes single VBELN input, i have to place this in a loop in order to get preceding documents for range of VBELN.  Please let me know if there is any other way of doing this. Immediate help is appreciated.
thanks in advance.
Akanksha.

hi,
u try to use this FM  WB2_VBFA_ARRAY_READ.
take care
Tarapada. D.

Similar Messages

  • BAPI used to fetch / display Documents from Repository

    Hi
    Please let me know the BAPI used to fetch / dispaly Data from DMS Repository.
    Also, do let me know the inputs required.
    I have tried - BAPI_DOCUMENT_CHECKOUTVIEW (but while executing is always displays - 300
    The Knowledge Provider is using document type LGL as a storage system)
    Inputs given -
    Documenttype - LGL
    Documentnumber - 10000000003
    DocumentPart - 000
    DocumentVersion - 00
    Originaltype - 0 (im not sure if zero is correct)
    Getstructure - 1
    Original Path - blank
    HostName - blank
    Get Header - X
    Thanks
    Prashant

    Thanks Arun.
    Able to download file using these BAPI's from SE37.
    One query - It is downloading files in name of user (original files name not getting downloaded)
    Eg:, My file name was demo.docx but  is downloaded as myusername.doc
    Further, i hope these bapi can be called via RFC (using Java Code).
    Thanks Again.
    Regards
    HI Arun
    Further to my earlier Mail, I'm not able to upload the same using Java Code, getting the error -
    Type ::::::::E
    Message ::::::::File d:\dms\z_IPI_PRASHANT01.doc cannot be created
    While Checking the Trace in SM59, got the following error -
    Trace file opened at 20111010 142232 India Standard Time, SAP-REL 701,0,134
    ======> cannot open SAPGUI
    ABAP Programm: SAPLSYSE (Transaction: )
    User: IPI_PRASHANT (Client: 220)
    Destination: SAPFTP (handle: 3, , )
    SERVER> RFC Server Session (handle: 1, 43220900, {5D1DF3E0-ACBD-F11F-8EA0-00A0D1
    SERVER> Caller host:
    SERVER> Caller transaction code:  (Caller Program: java)
    SERVER> Called function module: RFC_START_PROGRAM
    Error RFCIO_ERROR_SYSERROR in abrfcpic.c : 1742
    FUNCTION: 'exec_sapgui'
    cannot open SAPGUI
    PROG =sapftp erpdev sapgw00 43232164 IDX=4
    Please helpe in getting this sorted out.
    I have been tring the same now for more than a month.
    Regards
    Edited by: Prashantroy on Oct 10, 2011 2:37 PM

  • ME51N - How to fetch the attachments from Documents icon

    Hi Experts,
    In the ME51N while creating the Purchase Requisition the creator will attach a PDF document in the DOCUMENT icon... How can i fetch the document and attach in the workflow... I have tried to find this DRAD table but i didnt found any entry...
    Please kindly help me how can i achieve this...
    Thanks,
    Srikag.

    Hi,
    In the ME51N while creating the Purchase Requisition the creator will attach a PDF document in the DOCUMENT icon
    Default configuration for document repository is in SAP database. There are possible ways of re-linking it to SAP content server.
    How can i fetch the document and attach in the workflow..
    You need to look for relevant tables in the database to get appropriate linkage using which your configure the same in your workflow item.
    Hope this helps.
    Regards,
    Deepak Kori

  • Problem for searching Sales order no. ref. to delivery no. from VBFA

    Hi,
    I want to search Sales order no. ref. to delivery no., as generally ref. to devilery no. as a VBELV filed for Table VBFA , I am selecting  VBFA where VBTYP_N = C that is Order ,  but in my present case when I am looking for the available entry in VBFA ref. to delivery no. I am not getting Any  VBTYP_N = C , insted of this I am getting VBTYP_N = Q, i.e transfer order and also in VBELN  it is just giving the date of delivery , as 20090430,
       Can u help on this ,  I want to get SO no. ref. delivery no. and then want to search customer PO and Date . for that SO.
    regards,
      zafar

    Hi Zafar,
    VBFA is a document flow table. I'll tell you the way to fetch preceding or subsequent document out of this table:
    Document flow for order to delivery is as below:
    Sales order > Delivery>shipment-->billing
    So sales order is preceding document of delivery so put delivery in VBELN(SUBSEQUENT DOCUMENT) and fetch the VBELV i.e. preceding document for the same. Also put document category as 'J' i.e. delivery.
    hope it helps.
    Vivek Gupta

  • Invoice Qty from VBFA

    Hello folks!:
    I have made a query and created a new field related to the invoice qty. All at item level and referenced to the sales order.
    This new field is configured to pull the invoice qty from the document flow:
    FACPOS = ' '.
    select  RFMNG  into FACPOS
    from vbfa
    where vbelv = vbap-vbeln
      and posnn = vbap-posnr
      and vbtyp_n = 'M'.
    endselect.
    Then the report shows the sales order qty and the invoice qty per item. Everything looks perfect at this time. The problem starts when the invoice is partially created from partial deliveries (which is very often) and then a partially invoice is made. Due to the fact that the data is generated from the VBFA table, it will always going to bring the latest invoice qty and not the sum of all the invoices.
    Example:
    Order for 6 pcs of product A
    Delivery for 4 pcs and Invoice for 4 pcs
    Pending 2 pcs
    Report shows: Invoice qty 4 pcs
    Then another invoice is created for 2 pcs
    Nothing left from the sales order
    Report shows: Invoice qty 2 pcs <----
    PROBLEM
    PROBLEM: The report only shows as a total of the invoice qty just the 2 pcs from the last invoice. I actually want to add up all the invoice qty's generated per line item in the document flow.
    1. Any idea on how to configure the code so that I can have the sum of all the invoices in the document flow per item?
    2. Is there a special function that can do this?
    Pls let me know
    Regards

    Hi,
    Pass the sales order number in VBFA for the field "VBELV".
    Execute.
    Here there is a chance of two cases.
    1)If the billing document is created w.r.t. order:In this case,you will get the invoice number from VBELN field.
    Pass the same to VBRP table as VBELN and then fetch "FKIMG".
    This will give you the quantity.
    2)If the billing document is created w.r.t. a delivery:In this case,take VBELN and again pass it to VBELN into VBFA table as VBELV and then fetch VBELN
    Pass the same to VBRP table as VBELN and then fetch "FKIMG".
    Regards,
    Krishna.

  • Get sales documetn of the invoice from VBFA table

    In my user exit, i use to get the sales document from the table.

    Hi Kranthi Kumar ,
    If u want to know the sales document no of a invoice document from VBFA.
    u have a fields VBELV (Preceding sales and distribution document) for this document if you want to know whether it is a
    invoice or delivery or etc you can know using the field VBTYP_V (Document category of preceding SD document).
    Similarly,
    u have a fields VBELN (Subsequent sales and distribution document) for this document if you want to know whether it is a
    invoice or delivery or etc you can know using the field VBTYP_N (Subsequent category of preceding SD document).
    for ex if vbeln is a invoice docu then preceding document(VBELV) is a delivery.
    check again the VBELV docu no in VBELN field
    which is a delivery
    check the preceeding docu for that delivery docu in VBELV which obviously would be a sales order.
    *Else if you want to know directly the corresponding sales document go to VF02  enter that particular invoice number and then go to the document flow.(F5).
    Hope its useful.
    Revert back to me for any other queries on the same.
    Reward points if useful.
    Thanks ,
    Surya Pydikondala.

  • I NEED FIELDS FROM VBFA TABLE

    HI ALL,
    I NEED FIELDS FROM VBFA TABLE
    THE FIELDS I WANT IS :
    CUSTOMER-ID
    CUSTOMER NAME
    CONTACT NAME
    PROJECTID
    ORDER NO
    SALES MAN ID
    ORDER PROCESS DATE
    INVOICE DATE
    GROSS AMOUNT
    NET AMOUNT POSTAL CODE.
    THANKS & REGARDS,
    R.VINOD.

    Hi Vinod..
    Try this Code. I made all the modifications in your code .. It will solve ur issues..
    REPORT zsdr_omvsa40.
    TYPE-POOLS
    TYPE-POOLS: slis.
    TABLE DECLARATIONS
    TABLES : vbak, vbkd,
    zzvbak,
    kna1, vbrk, vbrp, knvp .
    INTERNALTABLE DECLARATION *
    DATA: BEGIN OF i_vbak OCCURS 0,
    vbelv LIKE vbfa-vbelv, " Sales Order no
    vbeln like vbfa-vbeln, "Invoice No
    erdat LIKE vbak-erdat, " Date on Which Record Was Created
    kunnr LIKE vbak-kunnr,
    ps_psp_pnr LIKE vbak-ps_psp_pnr, " Work Breakdown Structure Element
    END OF i_vbak.
    *DATA : BEGIN OF i_zzvbak OCCURS 0,
    *vbeln LIKE zzvbak-vbeln,
    *zssidc LIKE zzvbak-zssidc, "Salesman ID
    *END OF i_zzvbak.
    DATA : BEGIN OF i_vbrk OCCURS 0,
    vbeln LIKE vbrk-vbeln,
    fkdat LIKE vbrk-fkdat, "Invoice Date
    END OF i_vbrk.
    DATA : BEGIN OF i_kna1 OCCURS 0,
    kunnr LIKE kna1-kunnr , " Customer Number 1
    name1 LIKE kna1-name1, " Customer Name
    pstlz LIKE kna1-pstlz , " Postal Code
    END OF i_kna1.
    DATA : BEGIN OF i_vbrp OCCURS 0,
    vbeln LIKE vbrp-vbeln,
    aubel LIKE vbrp-aubel,
    netwr LIKE vbrp-netwr , " Net Value in Document Currency
    kzwi1 LIKE vbrp-kzwi1, " Subtotal 1 from pricing procedure for condition
    erdat LIKE vbrp-erdat, "Billing document.
    END OF i_vbrp.
    DATA : BEGIN OF i_knvp OCCURS 0,
    parvw LIKE knvp-parvw , " Partner Function
    kunnr LIKE knvp-kunnr ,
    parnr LIKE knvp-parnr , " Number of contact person
    END OF i_knvp .
    DATA : BEGIN OF i_data OCCURS 0,
    erdat LIKE vbak-erdat, " Date on Which Record Was Created
    vbeln LIKE vbak-vbeln, " Sales Order no
    fkdat LIKE vbrk-fkdat, " Invoice date.
    kunnr LIKE kna1-kunnr , " Customer Number
    ps_psp_pnr LIKE vbak-ps_psp_pnr, " Work Breakdown Structure Element
    name1 LIKE kna1-name1, " Customer Name
    netwr LIKE vbrp-netwr , " Net Value in Document Currency
    kzwi1 LIKE vbrp-kzwi1, " Subtotal 1 from pricing procedure for condition
    parvw LIKE knvp-parvw , " Partner Function
    parnr LIKE knvp-parnr , " Number of contact person
    *zssidc LIKE zzvbak-zssidc, "Salesman ID
    pstlz LIKE kna1-pstlz , " Postal Code
    END OF i_data.
    ALV Declaraton
    DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
    gd_tab_group TYPE slis_t_sp_group_alv,
    gd_layout TYPE slis_layout_alv,
    it_listheader TYPE slis_t_listheader,
    gd_repid LIKE sy-repid.
    Selection - Screen
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS creation FOR vbak-erdat . " Sales Order Date
    SELECT-OPTIONS period FOR vbrk-fkdat . " Invoice Date
    SELECT-OPTIONS order FOR vbak-vbeln . " Sales order no
    SELECT-OPTIONS name FOR kna1-name1 . " Customer Name
    SELECT-OPTIONS contact FOR knvp-parnr . " Contact Name.
    *SELECT-OPTIONS ssid FOR zzvbak-zssidc . " Salesman ID
    SELECT-OPTIONS project FOR vbak-ps_psp_pnr . " Work Breakdown Structure Element
    SELECTION-SCREEN : END OF BLOCK b1.
    START-OF-SELECTION
    START-OF-SELECTION.
      PERFORM data_retrieval.
      PERFORM build_fieldcatalog.
    PERFORM BUILD_LAYOUT.
    PERFORM top_of_page.
      PERFORM fill_listheader USING it_listheader.
      PERFORM display_alv_report.
    END-OF-SELECTION.
    *TOP-OF-PAGE.
    TOP-OF-PAGE.
    END-OF-PAGE.
    *& Form BUILD_FIELDCATALOG
    text
    FORM build_fieldcatalog.
      fieldcatalog-fieldname = 'KUNNR'.
      fieldcatalog-seltext_m = 'Sold to Party'.
      fieldcatalog-col_pos = 0.
      fieldcatalog-outputlen = 10.
      fieldcatalog-emphasize = 'X'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR fieldcatalog.
      fieldcatalog-fieldname = 'NAME1'.
      fieldcatalog-seltext_m = 'Hlev Customer'.
      fieldcatalog-col_pos = 1.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR fieldcatalog.
      fieldcatalog-fieldname = 'PARNR'.
      fieldcatalog-seltext_m = 'Contact name'.
      fieldcatalog-col_pos = 2.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR fieldcatalog.
      fieldcatalog-fieldname = 'PS_PSP_PNR'.
      fieldcatalog-seltext_m = 'Project ID'.
      fieldcatalog-col_pos = 3.
      fieldcatalog-do_sum = 'X'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR fieldcatalog.
      fieldcatalog-fieldname = 'VBELN'.
      fieldcatalog-seltext_m = 'Sales Document Type'.
      fieldcatalog-col_pos = 4.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR fieldcatalog.
      fieldcatalog-fieldname = 'ZSSIDC'.
      fieldcatalog-seltext_m = 'SSID'.
      fieldcatalog-col_pos = 5.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR fieldcatalog.
      fieldcatalog-fieldname = 'ERDAT'.
      fieldcatalog-seltext_m = 'so date'.
      fieldcatalog-col_pos = 6.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR fieldcatalog.
      fieldcatalog-fieldname = 'FKDAT'.
      fieldcatalog-seltext_m = 'inv date'.
      fieldcatalog-col_pos = 7.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR fieldcatalog.
      fieldcatalog-fieldname = 'KWZI1'.
      fieldcatalog-seltext_m = 'gross amt'.
      fieldcatalog-col_pos = 8.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR fieldcatalog.
      fieldcatalog-fieldname = 'NETWR'.
      fieldcatalog-seltext_m = 'net amt'.
      fieldcatalog-col_pos = 9.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR fieldcatalog.
      fieldcatalog-fieldname = 'PSTLZ'.
      fieldcatalog-seltext_m = 'Postal code'.
      fieldcatalog-col_pos = 10.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR fieldcatalog.
    ENDFORM. "BUILD_FIELDCATALOG
    *& Form DATA_RETRIEVAL
    text
    FORM data_retrieval.
      SELECT VBFAvbelv VBFAvbeln
             VBAKerdat VBAKkunnr VBAK~ps_psp_pnr
             INTO TABLE i_vbak
      FROM VBFA
      INNER JOIN vbak
      ON VBFAVBELV = VBAKVBELN
      WHERE VBAK~erdat IN creation
      AND VBFA~vbelV IN ORDER
      AND VBAK~ps_psp_pnr IN project
      AND VBFA~VBTYP_N = 'M'  "Subsequent doc is Invoice
      AND VBFA~VBTYP_V = 'C'  "Prec doc is Sales order
      IF NOT i_vbak[] IS INITIAL.
    **Change of ORDER in SELECTS HERE
        SELECT vbeln fkdat FROM vbrk INTO TABLE i_vbrk
        FOR ALL ENTRIES IN i_vbak
        WHERE vbeln = i_vbak-vbeln
        AND fkdat IN period.
        IF NOT i_vbrk[] IS INITIAL.
          SELECT vbeln aubel netwr kzwi1 FROM vbrp INTO TABLE i_vbrp
          FOR ALL ENTRIES IN i_vbrk
          WHERE VBELN = i_vbrk-vbeln.
        endif.
        SELECT kunnr name1  pstlz  FROM kna1 INTO TABLE i_kna1 FOR ALL ENTRIES IN i_vbak
        WHERE kunnr = i_vbak-kunnr
        AND name1 IN name.
    *SELECT vbeln zssidc FROM zzvbak INTO TABLE i_zzvbak FOR ALL ENTRIES IN i_vbak
    *WHERE vbeln = i_vbak-vbeln
    *AND zssidc IN ssid .
    select netwr kzwi1 erdat from vbrp into table i_vbrp for all entries in i_vbak
    where erdat = i_vbak-erdat.
        SELECT kunnr parnr parvw FROM knvp INTO CORRESPONDING FIELDS OF TABLE i_knvp FOR ALL ENTRIES IN i_vbak
        WHERE kunnr = i_vbak-kunnr
        AND parvw = 'AP'
        AND parnr IN contact.
      ENDIF .
      SORT I_VBAK BY VBELN .
      SORT I_VBRK BY VBELN .
      LOOP AT i_vbrp.  "Invoice Item data
        MOVE i_vbrp-netwr TO i_data-netwr .
        MOVE i_vbrp-kzwi1 TO i_data-kzwi1.
        READ table I_VBAK WITH KEY VBELN = I_VBRP-VBELN BINARY SEARCH.  "Sales Order info
        IF SY-SUBRC = 0.
          MOVE I_VBAK-VBELV TO I_DATA-VBELN.   "Sales Order no
          MOVE I_VBAK-erdat TO I_DATA-erdat.   " Date on Which Record Was Created
          MOVE I_VBAK-kunnr TO I_DATA-KUNNR.    "Customer No
          MOVE I_VBAK-ps_psp_pnr TO I_DATA-ps_psp_pnr. " Work Breakdown Structure Element
        endif.
        READ TABLE I_VBRK WITH KEY VBELN = I_VBRP-VBELN BINARY SEARCH.   "Invoice header info
        IF SY-SUBRC = 0.
          MOVE i_vbrk-fkdat TO i_data-fkdat.
        endif.
        READ TABLE I_KNA1 WITH KEY KUNNR = I_VBAK-KUNNR BINARY SEARCH.   "Customer info
        IF SY-SUBRC = 0.
          MOVE i_kna1-kunnr TO i_data-kunnr.
          MOVE i_kna1-name1 TO i_data-name1.
          MOVE i_kna1-pstlz TO i_data-pstlz .
        endif.
        READ TABLE I_KNvp WITH KEY KUNNR = I_VBAK-KUNNR BINARY SEARCH.   "Partner info
        IF SY-SUBRC = 0.
          MOVE i_knvp-parnr TO i_data-parnr.
        endif.
        APPEND i_data.
      ENDLOOP.
    ENDFORM. "DATA_RETRIEVAL
    *& Form DISPLAY_ALV_REPORT
    text
    FORM display_alv_report.
    GD_REPID = SY-REPID.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER = ' '
    I_BUFFER_ACTIVE = ' '
      i_callback_program = sy-repid
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = ' '
      i_callback_top_of_page = 'TOP_OF_PAGE'
    I_CALLBACK_HTML_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_END_OF_LIST = ' '
    I_STRUCTURE_NAME =
    I_BACKGROUND_ID = ' '
    I_GRID_TITLE =
    I_GRID_SETTINGS =
    IS_LAYOUT =
      it_fieldcat = fieldcatalog[]
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT =
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
    IT_EVENTS =
    IT_EVENT_EXIT =
    IS_PRINT =
    IS_REPREP_ID =
    I_SCREEN_START_COLUMN = 0
    I_SCREEN_START_LINE = 0
    I_SCREEN_END_COLUMN = 0
    I_SCREEN_END_LINE = 0
    I_HTML_HEIGHT_TOP = 0
    I_HTML_HEIGHT_END = 0
    IT_ALV_GRAPHICS =
    IT_HYPERLINK =
    IT_ADD_FIELDCAT =
    IT_EXCEPT_QINFO =
    IR_SALV_FULLSCREEN_ADAPTER =
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
      TABLES
      t_outtab = i_data.
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2 .
    *IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
    ENDFORM. "DISPLAY_ALV_REPORT
    FORM FOR FILLING LISTHEADER *
    FORM fill_listheader USING it_listheader TYPE slis_t_listheader.
      DATA : wa_listheader TYPE slis_listheader.
      wa_listheader-typ = 'H'.
      wa_listheader-info = 'Noel Gifts International Limited '.
      APPEND wa_listheader TO it_listheader.
      wa_listheader-typ = 'S'.
      wa_listheader-info = 'CUSTOMER CREDIT EXCEPTION REPORT' .
      APPEND wa_listheader TO it_listheader.
      CLEAR wa_listheader.
    ENDFORM. "fill_listheader
    *& Form top_of_page
    text
    FORM top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = it_listheader.
    ENDFORM. "top_of_page
    REWARD IF HELPFUL.

  • Error in fetching the data from textfield and inserting to the database..

    I'm using Java Swing as front end and MySQL as backend using the netbeans ide..I am trying to fetch the data from the textfiled in the form and insert to the database table.i've skipped the generated code..In the following code i get the erro cannot find symbol "stmt" in the actionPerformed method..
    mport java.awt.event.*;
    import java.sql.*;
    public class BarcodeReader extends JFrame implements ActionListener {
    public BarcodeReader() {
    initComponents();
    nb.addActionListener(this);
    public void jdbcConnect(){
    Connection con=null;
    String url = "jdbc:mysql://localhost:3306/";
    String db = "mynewdatabase";
    String driver = "com.mysql.jdbc.Driver";
    String user = "usrname";
    String pass = "pwd";
    try{
    String s=newtxt.getText();
    con=DriverManager.getConnection(url + db, user, pass);
    Statement stmt=con.createStatement();
    Class.forName(driver);
    public void actionPerformed(ActionEvent e){
    try{
    jdbcConnect();
    stmt.executeUpdate("INSERT into machine(mname) values '"+jTextField1.getText()+"'");
    }}catch (Exception ex) {
    System.out.println(ex);
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new BarcodeReader().setVisible(true);
    }

    There are far too many errors to try and clear.
    For one, the exception references the actionPerformed method (according to your text), so why is that not shown here?
    For another you are performing, possible time-consuming, actions, and even worse IO actions, on the event thread, which is a huge no-no.
    You are not closeing your resources properly, if at all, which is another huge no-no.
    You are completely mixing your "view" (the gui), and your "model" (the data related classes), which is another huge no-no.
    etc, etc, etc.

  • Cannot complete document due to status of preceding document

    Hi everyone,
    We encounter the following problem;
    We have a grantor application and from there we create a grantor agreement via the copy control settings in customizing.
    Both transaction types have their own status profile (user status).
    Now, when we have created the agreement (as follow up document), we are missing some of the user statussses, for example 'CANCEL'.
    This is simply not available to select.
    Investigation turns out that this is due to the fact that the preceding document (grantor application) is not yet completed. After we manually change the status of the application to 'Completed', then in the agreement we can select the missing user status.
    How can we fix this? It is not a workable solution to first create the follow up document, then go back to the preceding document to change the status of that document and then go back again to the follow up document and start processing that one.
    I was told that it should be possible with normal customizing to make sure that the follow up document is "leading" and will not be affected by any status of the preceding document.
    Another option would be to use some function modules and badi's to make sure that the status of the preceding document is automatically set to completed during the copy control.
    But to be honest, we would prefer not to enhance any FM's and/or badi's but to use standard customizing.
    Does anybody have some ideas how to solve this.
    Thank you very much for your help.
    Regards,
    Pieter

    please check SCVMM 2012 | Force Remove vCenter Server
    http://digitaljive.wordpress.com/2012/07/06/scvmm-2012-force-remove-vcenter-server/
    Mohamed Fawzi | http://fawzi.wordpress.com

  • Fetching reversal document Created using FB60

    hi All,
    I have created an invoice using FB60 and reversed the same which is getting stored in RBKP table i have an existing code which returns the invoice reversed using created using mir0 the select query is as below.
    SELECT lifnr xblnr bldat cputm  FROM rbkp     INTO TABLE i_reversal
               FOR ALL ENTRIES IN i_an_ven
               WHERE lifnr = i_an_ven-lifnr AND
                     bukrs = i_an_ven-bukrs AND
                     cpudt >= date_in AND
                     cputm >= time_in AND
                     stblg <> ' '.
    I now want to fetch reverse document created using FB60 which is stored in table BKPF
    Can any one let me know condition what i should apply to fetch the same.
    OR the outline would be helpful
    Thanks,

    Check the field BSTAT = 'B' in BKPF.

  • System changes status of preceding document

    Hello *,
    within our quotation process we're faced to a not expected and not required behaviour.
    process:
    1. Create quotation with item lines
    2. Press button "more" --> "Send all Items"
    3. Create a follow-up quotation
    4. Choose to be copied items
    5. Save the follow-up
    ==> The system sets the status E0005 "transferred to R/3" with systemstatus RELE automatically for the preceding document. Of course this transaction is distributed to the ECC what is not required.
    How to avoid this step?
    There is no entry for "Send all items" in column transaction to control a system status within status customizing.
    We do not use a copy routine for follow-up generation and no BADIs are implemented. The event trace did not give any usable results.
    How to avoid the automatically document transfer from CRM to ECC by not requested status change during follow-up creation in quotation process?
    Kind regards
    Thomas

    Hi Thomas,
    I am also facing the same issue. I am also looking for the solution. will let you know if any success.
    Best regards,
    Dinesh.

  • Fetching order data from Live Cache

    Hi
    The requirement is to fetch order data from liveCache for a given product based on ATP category . (AY - dependent demands and AU - order reservations)
    I want to get information about the dates and order quantity.
    I have identified following two FM's.
    /SAPAPO/OM_PEG_CAT_GET_ORDERS
    /SAPAPO/OM_ORDER_GET_DATA
    Which one of the two FM is more suitable specific to my requirement ? Also what are the important parameters to be passed in the applicable FM ?
    I would also like to know the difference in these two FMs?
    Thanks in advance,
    Yogesh

    Hi,
    I tried FM PAPO/OM_PEG_CAT_GET_ORDERS
    I am giving the following inputs
    1. PEGID which I am getting from /SAPAPO/DM_MATERIAL_GET_PEGID for a given product location.
    2. ATP category in IT_CATEGORY = BM and CC
    3. V_SIMSESSION = 000
    4. IV_IONODE_PEG_SEL = 0
    But I am getting LC_COM_ERROR
    What parameters am I missing ?
    Regards,
    Yogesh

  • Logic to fetch multiple records from BKPF, SRGBTBREL and SOOD

    Hi All
    Need help in developing a login for a report.
    We are trying to display records of a/c documents which have an associated note with them. This involves 4 categories.
    1)     My Document, I attached the note.
    2)     My Document, someone else attached the note.
    3)     No note attached.
    4)     All.
    The logic desired is as below:
    1)     BKPF-BUKRS + BKPF-BELNR + BKPF-GJAHR = SRGBTBREL-INSTID_A. (SRGBTBREL can have multiple records for this combination if multiple notes attached)
    2)     a) SOOD-OBJTY = SRGBTBREL-INSTID_B+17(3).
    b) SOOD-OBJYR = SRGBTBREL-INSTID_B+20(2).
    c) SOOD-OBJNO = SRGBTBREL-INSTID_B+22(12).
    Unique combination.
    I have fetched the details from the three database tables but finding it challenging to put it across in one output internal table. It doesnu2019t cover the scenario where multiple notes are attached to the document (One can be from the same person who created the document and another ones can be from different person or both from the different people).
    Thanks in advance,
    Harsh

    Code Snippet Part 2.
    * Approved Document.
        IF rb_app = 'X'.
          CLEAR wa_sood.
    *      READ TABLE gt_sood INTO wa_sood WITH KEY objtp = lv_objtp
    *                                               objyr = lv_objyr
    *                                               objno = lv_objno.
          LOOP AT gt_sood INTO wa_sood WHERE objtp = lv_objtp
                                         and objyr = lv_objyr
                                         and objno = lv_objno.
    *      IF sy-subrc = 0.
            IF wa_bkpf-usnam <> wa_sood-cronam.
    * Company Code.
              wa_output-bukrs = wa_bkpf-bukrs.
    * A/c Document No.
              wa_output-belnr = wa_bkpf-belnr.
    * Fiscal Year.
              wa_output-gjahr = wa_bkpf-gjahr.
    * Document Type.
              wa_output-blart = wa_bkpf-blart.
    * Document Date.
              wa_output-budat = wa_bkpf-budat.
    * Day On Which Accounting Document Was Entered.
              wa_output-cpudt = wa_bkpf-cpudt.
    * User name.
              wa_output-usnam = wa_bkpf-usnam.
    * Reverse Document Number.
              wa_output-stblg = wa_bkpf-stblg.
    * Transaction Code.
              wa_output-tcode = wa_bkpf-tcode.
    * Short description of contents.
              wa_output-objdes = wa_sood-objdes.
    * Creator Name.
              wa_output-cronam = wa_sood-cronam.
    * Date created.
              wa_output-crdat = wa_sood-crdat.
    * Time created.
              wa_output-crtim = wa_sood-crtim.
    * Status.
              WRITE icon_green_light TO wa_output-light.
              APPEND wa_output TO gt_output.
    *          CLEAR: wa_output,
    *                 wa_sood.
    *        ENDIF.
          ENDIF.
                   ENDLOOP.
        ENDIF.
    * All Documents.
        IF rb_all = 'X'.
    * Company Code.
          wa_output-bukrs = wa_bkpf-bukrs.
    * A/c Document No.
          wa_output-belnr = wa_bkpf-belnr.
    * Fiscal Year.
          wa_output-gjahr = wa_bkpf-gjahr.
    * Document Type.
          wa_output-blart = wa_bkpf-blart.
    * Document Date.
          wa_output-budat = wa_bkpf-budat.
    * Day On Which Accounting Document Was Entered.
          wa_output-cpudt = wa_bkpf-cpudt.
    * User name.
          wa_output-usnam = wa_bkpf-usnam.
    * Reverse Document Number.
          wa_output-stblg = wa_bkpf-stblg.
    * Transaction Code.
          wa_output-tcode = wa_bkpf-tcode.
          CLEAR wa_sood.
    *      READ TABLE gt_sood INTO wa_sood WITH KEY objtp = lv_objtp
    *                                               objyr = lv_objyr
    *                                               objno = lv_objno.
          LOOP AT gt_sood INTO wa_sood WHERE objtp = lv_objtp
                                         and objyr = lv_objyr
                                         and objno = lv_objno.
    *      ELSE.
            IF wa_bkpf-usnam <> wa_sood-cronam.
    * Status.
              WRITE icon_green_light TO wa_output-light.
    * Short description of contents.
              wa_output-objdes = wa_sood-objdes.
    * Creator Name.
              wa_output-cronam = wa_sood-cronam.
    * Date created.
              wa_output-crdat = wa_sood-crdat.
    * Time created.
              wa_output-crtim = wa_sood-crtim.
            ELSE.
    * Status.
              WRITE icon_yellow_light TO wa_output-light.
    * Short description of contents.
              wa_output-objdes = wa_sood-objdes.
    * Creator Name.
              wa_output-cronam = wa_sood-cronam.
    * Date created.
              wa_output-crdat = wa_sood-crdat.
    * Time created.
              wa_output-crtim = wa_sood-crtim.
            ENDIF.
    *      ENDIF.
          ENDLOOP.
          IF sy-subrc <> 0.
            WRITE icon_red_light TO wa_output-light.
          ENDIF.
          APPEND wa_output TO gt_output.
    *      CLEAR: wa_output,
    *             wa_sood.
        ENDIF.
      ENDLOOP.

  • Fetch the data from the Data base based on selection criteria in ABAP

    Hi
    I am new to ABAP and working on the Screen where User Enters Company code from and to , Document no and to, I have defined as specified below
      SELECT-OPTIONS Company     FOR p_ccode.
      SELECT-OPTIONS Document    FOR p_fdocnr.
      SELECT-OPTIONS Year           FOR p_fyear.
    When I debug in the pgm I get the values as
    IBT11001100 (From and To Company Code)
    IBT23234241002323424246 (From and To doc no)
    IBT20092009 (From and To Year)
    How can write a SQL select statement to fetch the data from the Database based on the above inputs
    Thanks
    PR

    Moderator message:
    Sorry - this isn't an ABAP training forum. Please press F1 on SELECT-OPTIONS and/or SELECT.
    Thread locked.
    Rob

  • Error: Preceding document required for the invoice is not available

    Dear SRM Experts,
    We are on SRM7.0 with SAP 4.6 C as backend SAP R/3 system (Classic Deployment).
    When we try to create an invoice in SRM wrt a PO ( with item category B ... created from a limit SC with invoice only option), we get an error :
    Line 1: Preceding document required for the invoice is not available
    We are not sure ..why this error is coming and what preceding document system is checking ?
    As the PO is with item category B.. the GR is not required
    Any inputs will be highly appreciated..
    Thanks and Regards,
    Ram

    Hi!
    This error usually comes up when the PO has the flag GR_BASEDIV set. Please check your PO and verify if it is flagged.
    Best regards,
    Christian Zeuch

Maybe you are looking for

  • How to do java conjunction with XSLT Mapping...?

    Hi, I Got a doubt while doing the XSLT mapping...... I have created the Data Types Message Types and Message Interfaces Now my doubt is where i have to write the XSLT and Java code and how to create Message Mapping and Interface Mappings... Please he

  • MDM web dynpro in BPM process

    This is my first development in BPM, so please be charitable and understanding.... I have following error in my process: Error: Build stopped due to an error: com.sap.glx.paradigmInterface.bpmn.compiler.BPMNCompilerException: [BPM.rt_c_bpmn.000024] I

  • How to connect jpeg to timeline clip replacing video but keeping audio

    I put some video in the project timeline and now I would like to connect several still pictures (jpeg) at specific points in this video so that you hear the sound from the video but only see the still image. Connecting my jpeg to the clip in the time

  • App store is GONE!

    My iTunes all of a sudden will not show the app store. The bar at the top that shows the Home buttone and has Music, movies, apps etc is gone and the iTunes store is just a dumbed down version that mostly will not open any links. Did the iTunes url c

  • Shipping - Bill of lading

    A shipment consist of n deliveries. In our company we will put all our shipment from our plant to a third party distribution center and they will ship each delivery to the respective customer. In our industry, Carrier is selected according to our cus