RV_ORDER_FLOW_INFORMATION

Hello,
I have a invoice of sale (SD) with two positions ( 10 and 11 )
The two positions refer to the same accounting document (FI)
Accounting is correct!
I can not find a relationship in  table "BSEG"  to select the BUZEI that corresponds to the position of the invoice (SD)
Or a BAPI or a function that return the correct buzei or correct accounting point.
If we look at each position of invoice SD is the same accounting document (FI)  and  I have reviewed the characteristics defined in VKOA and can not find a relationship.
I use this function "RV_ORDER_FLOW_INFORMATION" but I dont get to relationship with invoice position.
Only I have "accounting document".
Since the transaction VF03 when selecting any of the two positions.
Next, the system  run the function "AC_DOCUMENT_RECORD.
EXPORTING
   I_AWTYP = 'VBRK'
  I_AWREF = VBRK-VBELN
  I_AWORG = VBRK-LOGSYS
  I_BUKRS = VBRK-BUKRS
Then: You select accounting document (FI) and  the system  run the function "FI_DOCUMENT_RECORD '.
Best regards,
Gustavo

Hi  Florian
I am sorry.
I am not found any relationship at all BSEG-buzei (accounting document) that refers to each position of the invoice of sale (SD).
My question is how I can get the relationship for each position of the invoice for the same accounting document?
This functión "RV_ORDER_FLOW_INFORMATION"  can you help me?
Thank you very much.
Best regards,
Gustavo

Similar Messages

  • Calling Function Module RV_ORDER_FLOW_INFORMATION in a Loop!

    Hi Guys,
    I need to fetch SD document Flow data into Bw for which I have created an Extractor using function modules. I am using a Standard FM  "RV_ORDER_FLOW_INFORMATION" which is called in the LOOP as below.
    LOOP AT VIT_VBRK INTO VFL_VBRK.
        CLEAR VBCO6.
        VBCO6-MANDT = SY-MANDT.
        VBCO6-VBELN = VFL_VBRK-VBELN.
        REFRESH TVBFA_TAB[].
        CLEAR TVBFA_TAB.
    CALL FUNCTION 'RV_ORDER_FLOW_INFORMATION'
      EXPORTING
       AUFBEREITUNG        = '2'
       BELEGTYP            = VFL_VBRK-VBTYP
        COMWA               = VBCO6
       NACHFOLGER          = 'X'
       N_STUFEN            = '50'
       VORGAENGER          = 'X'
       V_STUFEN            = '50'
    IMPORTING
       BELEGTYP_BACK       = BELEG_TYP
      TABLES
        VBFA_TAB            = TVBFA_TAB
    EXCEPTIONS
       NO_VBFA             = 1
       NO_VBUK_FOUND       = 2
       OTHERS              = 3
    IF SY-SUBRC <> 0.
    ENDIF.
    *OTHER CODE LOGIC*
    ENDLOOP.
    Now the problem is if I run this only once, i.e VIT_VBRK having only 1 document, the result I get is correct. However, if this same code is run in a LOOP with many different values in VIT_VBRK, the first Loop gives correct values and all subsequent values (value of TVBFA_TAB- RFMNG to be precise) are incorrect.
    I am guessing this is b'coz of some internal tables and work areas specific to the function module are not refreshed and the values of earlier iterations are adding up in the subsequent runs. can any one tell me if theres any specific 'REFRESH' statement or FM to be called before calling this FM.
    Thanks in Advance,
    Parth Shah.

    Hi Matt,
    I debugged the Function module like u said in 2 different Session, what I found was that there is a yet another function module called with in the FM RV_ORDER_FLOW_INFORMATION, i.e "GET_HANDLE_SD_DOCUMENTFLOW_SP" heres what the code in this FM looks like.
    FUNCTION GET_HANDLE_SD_DOCUMENTFLOW_SP.
    *"Lokale Schnittstelle:
    *"  EXPORTING
    *"     REFERENCE(HANDLE) TYPE REF TO  IF_EX_BADI_SD_DOCUMENTFLOW
    *"     VALUE(ACTIVE) TYPE  XFELD
    IF L_HANDLE_SD_DOCUMENTFLOW IS INITIAL.
        CALL METHOD CL_EXITHANDLER=>GET_INSTANCE
          IMPORTING
            ACT_IMP_EXISTING = BADI_SD_DOCUMENTFLOW_ACTIVE
          CHANGING
            INSTANCE         = L_HANDLE_SD_DOCUMENTFLOW
            EXCEPTIONS
            OTHERS           = 1.
        IF NOT SY-SUBRC = 0.
          CLEAR BADI_SD_DOCUMENTFLOW_ACTIVE.
        ENDIF.
      ENDIF.
      HANDLE = L_HANDLE_SD_DOCUMENTFLOW.
      ACTIVE = BADI_SD_DOCUMENTFLOW_ACTIVE.
    ENDFUNCTION.
    the only difference I found in the two sessions was that L_HANDLE_SD_DOCUMENTFLOW  is initial in the first run and then in all subsequent run its value remains the same, while in fact it should reset. Sadly there is no REFRESH procedure / Subroutine for it.
    Any idea how i can refresh it, or may be by-pass this check (IF L_HANDLE_SD_DOCUMENTFLOW IS INITIAL) ?
    Edited by: shahparth on Feb 17, 2011 8:39 AM

  • Need RV_ORDER_FLOW_INFORMATION Rfc Documentation.

    Hi All,
    i cant understand the output of the RFC  "RV_ORDER_FLOW_INFORMATION " can anybody explain
    thank you,
    dhanu.

    Hi  Florian
    I am sorry.
    I am not found any relationship at all BSEG-buzei (accounting document) that refers to each position of the invoice of sale (SD).
    My question is how I can get the relationship for each position of the invoice for the same accounting document?
    This functión "RV_ORDER_FLOW_INFORMATION"  can you help me?
    Thank you very much.
    Best regards,
    Gustavo

  • Need help to modify a report written using Field-Groups Concept. - Part1

    Hello ABAP Experts,
    I need your help to modify the following report with following requirement as I have least knowledge
    about the field-group concept. Thats is the reason, I am pasting the whole code. As it is part of our
    production requirement. I really appreciate your help, If its sent modifying the code required.
    Modification required in the report.
    To allow the sales representatives to see billed shipments and open orders for the current month.
    1) Selection Screen Changes:
    u2022     Add selection by Sales group and Customer group
    u2022     Add sort by:     3. Ship-to / Material
    u2022     Add another selection box
    [ ] Open Orders and Shipments with the current month
    2)      For the new selection box, subtotal sales quantity and delivery quantity.
         If delivered, make the sales quantity zero in the subtotal
    Current report displays, in Selection Screen
    Sales org:
    Person Name:
    Material:
    Plant:
    Sales Office:
    Ship to Name:
    Ship to Number:
    Sorts Report by : 1. Person Name 2. Material
    Check Boxes : 1. Open Orders 2. Delayed Orders.
    report  zorder  LINE-SIZE 170
                      LINE-COUNT 58
                      MESSAGE-ID zv
                      NO STANDARD PAGE HEADING.
    TABLES:
    cdhdr,                                 "Change Doc Header
    cdpos,                                 "Change Doc Item
    kna1,                                  "Customer master
    likp,                                  "Delivery Header
    lips,                                  "Delivery Item
    *lips,                                 "Delivery Item
    zvbpa_lfa1,                            "Vendor Master
    makt,                                  "Material Desc
    t001w,                                 "Plant
    tvkbt,                                 "Sales Office
    tvko,                                  "Sales Organizations
    vbak,                                  "Sales Header
    vbap,                                  "Sales Item
    zvvbak,                                "Sales Hdr - Time calc
    vbup,                                  "Item status
    vbep,                                  "Sales Schedule Line
    vbfa,                                  "Flow documents
    vbpa,                                  "Partners
    vbrk,                                  "Billing Header
    vbrp.                                  "Billing Item
    SELECT-OPTIONS:
      s_vkorg FOR vbak-vkorg OBLIGATORY,
      s_ernam FOR vbak-ernam,
      s_matnr FOR vbap-matnr,
      s_werks FOR vbap-werks,
      s_vkbur FOR vbak-vkbur,
      s_name1 FOR kna1-name1,
      s_kunnr FOR kna1-kunnr.
    SELECTION-SCREEN ULINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(49) text-c20.
    PARAMETERS: p_sort TYPE n DEFAULT '1'.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 19(40) text-022.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 19(40) text-023.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 19(40) text-024.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN COMMENT 19(40) text-070.
    SELECTION-SCREEN ULINE.
    SELECTION-SCREEN BEGIN OF BLOCK b20 WITH FRAME.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS:p_open AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 5(48) text-072.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS:p_delay AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 5(48) text-073.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK b20.
    DATA:
    vbeln(11),                             "Document number
    cancel_dt TYPE d,                      "Cancellation Date
    BEGIN OF tabkey,                       "Tabkey
    mandant LIKE sy-mandt,
    vbeln LIKE vbap-vbeln,
    posnr LIKE vbap-posnr,
    END OF tabkey,
    name1_sp1 LIKE lfa1-name1,             "Sales Carrier Name
    name1_sp2 LIKE lfa1-name1,             "Delivery Carrier Name
    datum-1 TYPE d,                        "Current Dt Less 1
    datum-14 TYPE d,                       "Current Dt Less 14
    datum-90 TYPE d,                       "Current Dt Less 90
    rpt_hdr1(170),                         "Report Header 1
    rpt_hdr2(170),                         "Report Header 2
    rpt_hdr3(170),                         "Report Header 3
    cb_hdr1(170),                          "Control Break Header 1
    line_pos1 TYPE i,                      "Line Print Position HDR1
    line_pos2 TYPE i,                      "Line Print Position HDR2
    line_pos3 TYPE i,                      "Line Print Position DET2
    status,                                "Order Status
    open,                                  "Open Order
    delayed VALUE 'D',                     "Delayed Order
    v_comp(30).                            "Company Text Field
    DATA: v_flagh2.  " Flag for header 2 & 3
    DATA: ls_comwa LIKE vbco6. "Structure for flow information
    DATA: t_vbfa_tab TYPE STANDARD TABLE OF vbfa WITH HEADER LINE."Itab
    for flow information
    data: g_trans_id type vttk-tdlnr. "get transport id from flow
      information
      data  v_sales_org_cpimex type vkorg value  '3300'.
      FIELD-GROUPS:
      header,
      order.
      INSERT
      status                                 "Status
      vbak-vkbur                             "Sales Office
      vbak-ernam                             "Created By
      kna1-kunnr                             "Customer
      kna1-name1                             "Customer Name
      vbap-matnr                             "Material
      vbap-werks                             "Plant
      vbep-lddat                             "Load Dt
      vbap-vbeln                             "Sales Document
      INTO header.
      INSERT
      kna1-ort01                             "City
      kna1-regio                             "Region
      likp-traid                             "Transport ID
      lips-vbeln                             "Delivery Document
      lips-ntgew                             "Net Wt
      lips-gewei                             "Unit of Weight
      vbap-kwmeng                            "Order Qty
      vbap-vrkme                             "Sales Unit
      vbak-bstnk                             "Customer PO
      vbak-erdat                             "Sales Create Dt
      vbak-ihrez                             "PO Release
      vbak-vdatu                            "Req Delivery Dt
      vbak-vzeit                            "Req Delivery Time
      vbfa-vbeln                             "Goods issue doc
      vbrk-vbeln                             "Billing Document
      name1_sp1                              "Sales Carrier
      name1_sp2                              "Delivery Carrier
      INTO order.
    INITIALIZATION.
    AT SELECTION-SCREEN.
      IF NOT p_sort BETWEEN 1 AND 2.
        MESSAGE e022 WITH p_sort.
      ENDIF.
    * Report 1 or more of cancelled, delayed or open
      IF p_open IS INITIAL AND
         p_delay IS INITIAL.
        MESSAGE e023.
      ENDIF.
    START-OF-SELECTION.
    * Load Company Name
      WRITE 'XYZ INC'(000) TO v_comp.
    * Calculate Date Range
      datum-1 = sy-datum - 1.
      datum-14 = sy-datum - 14.
      datum-90 = sy-datum - 90.
    * Compose Parameter Header
      PERFORM parm_hdr.
    ** Compose Report Header
      v_flagh2 = 1.
      PERFORM data_selection.
    END-OF-SELECTION.
    * Determine Sort
      CASE p_sort.
        WHEN 1.
          SORT BY status vbak-ernam kna1-name1 kna1-kunnr
                  vbep-lddat vbap-vbeln.
        WHEN 2.
          SORT BY status vbap-matnr vbap-werks vbep-lddat
                  vbap-vbeln.
      ENDCASE.
      LOOP.
        AT NEW status.
          CASE status.
            WHEN delayed.
              WRITE 'Delayed Orders'(061) TO rpt_hdr1.
            WHEN OTHERS.
              WRITE 'Open Orders'(062) TO rpt_hdr1.
          ENDCASE.
          NEW-PAGE.
        ENDAT.
        AT NEW vbak-ernam.
          IF p_sort = 1.
            CLEAR cb_hdr1.
            WRITE 'CAA:'(064) TO cb_hdr1.
            WRITE vbak-ernam TO cb_hdr1+5.
            NEW-PAGE.
          ENDIF.
        ENDAT.
        AT NEW vbap-matnr.
          IF p_sort = 2.
            CLEAR makt.
            SELECT SINGLE * FROM makt
                WHERE spras = sy-langu AND
                      matnr = vbap-matnr.
            CLEAR cb_hdr1.
            WRITE 'Material:'(042) TO cb_hdr1.
            WRITE vbap-matnr TO cb_hdr1+10.
            WRITE makt-maktx TO cb_hdr1+21.
            NEW-PAGE.
          ENDIF.
        ENDAT.
        AT NEW vbap-werks.
          AT order.
            RESERVE 3 LINES.
            SKIP 1.
            NEW-LINE.
    * Indicate new open item
            WRITE vbap-vbeln TO vbeln.
    * Find Transport ID
    * Fill the structure LS_COMWA
            ls_comwa-mandt = sy-mandt.
            ls_comwa-vbeln = vbap-vbeln.
            CALL FUNCTION 'RV_ORDER_FLOW_INFORMATION'
              EXPORTING
                comwa    = ls_comwa
              TABLES
                vbfa_tab = t_vbfa_tab.
            IF sy-subrc EQ 0.
              READ TABLE t_vbfa_tab WITH KEY vbtyp_n = '8'.
              IF sy-subrc EQ 0.
                SELECT SINGLE tdlnr INTO g_trans_id
                  FROM vttk WHERE tknum = t_vbfa_tab-vbeln.
                CONDENSE g_trans_id.
              ENDIF.
            ENDIF.
            IF vbak-erdat >= datum-1.
              vbeln+10 = 'N'.
            ENDIF.
            CASE p_sort.
              WHEN 1.
                WRITE 1 vbak-vkbur.
                WRITE 8 kna1-name1.
                WRITE 44 vbeln.
                WRITE 56 vbap-matnr.
                WRITE:
                    75 vbap-kwmeng LEFT-JUSTIFIED,
                     vbap-vrkme,
                    100 vbak-bstnk,
                     vbak-ihrez,
                    134 vbak-vdatu,
                        vbak-vzeit,
                    154 vbep-lddat.
                WRITE 166 vbap-werks.
                NEW-LINE.
                WRITE:
                  5  kna1-ort01,
                  41 kna1-regio.
                IF name1_sp2 IS INITIAL.
                  WRITE:
                    45 name1_sp1,
                ELSE.
                  WRITE 45 name1_sp2.
                  IF name1_sp1 = name1_sp2.
                    WRITE ' '.
                  ELSE.
                    WRITE '*'.
                  ENDIF.
                ENDIF.
                IF  vbak-vkorg =  v_sales_org_cpimex .
                  WRITE  81 g_trans_id.
                ELSE.
                  WRITE  81 likp-traid.
                ENDIF.
                WRITE:
                  102 lips-vbeln,
                  115 lips-ntgew NO-ZERO LEFT-JUSTIFIED,
                      lips-gewei,
                  140 vbfa-vbeln,
                  152 vbrk-vbeln.
              WHEN 2.
                WRITE 1 vbak-ernam.
                WRITE 14 vbak-vkbur.
                WRITE 21 kna1-name1.
                WRITE 57 vbeln.
                WRITE:
                    69 vbap-kwmeng LEFT-JUSTIFIED,
                        vbap-vrkme,
                    92 vbak-bstnk,
                        vbak-ihrez,
                    126 vbak-vdatu,
                      vbak-vzeit,
                    146 vbep-lddat.
                WRITE 162 vbap-werks.
                NEW-LINE.
                WRITE:
                  5  kna1-ort01,
                  41 kna1-regio.
                IF name1_sp2 IS INITIAL.
                  WRITE:
                    45 name1_sp1,
                ELSE.
                  WRITE 45 name1_sp2.
                  IF name1_sp1 = name1_sp2.
                    WRITE ' '.
                  ELSE.
                    WRITE '*'.
                  ENDIF.
                ENDIF.
                IF  vbak-vkorg =  v_sales_org_cpimex .
                  WRITE  81 g_trans_id.
                ELSE.
                  WRITE  81 likp-traid.
                ENDIF.
                WRITE:
                   102 lips-vbeln,
                   115 lips-ntgew NO-ZERO LEFT-JUSTIFIED,
                       lips-gewei,
                   140 vbfa-vbeln,
                   152 vbrk-vbeln.
            ENDCASE.
          ENDAT.
        ENDLOOP.
    *       FORM PARM_HDR                                                 *
    FORM parm_hdr.
      WRITE 'Program selections'(101) TO rpt_hdr1.
      WRITE 'Sign'(102) TO rpt_hdr1+29.
      WRITE 'Option'(103) TO rpt_hdr1+34.
      WRITE 'From'(104) TO rpt_hdr1+41.
      WRITE 'To'(105) TO rpt_hdr1+77.
    ENDFORM.                    "PARM_HDR
    *       FORM RPT_HDR                                                  *
    FORM rpt_hdr.
      CASE p_sort.
        WHEN 1.               "When sort by CAA
          WRITE 1'SOff'(066).
          WRITE 8'Customer'(009).
          WRITE 44'Sales Doc'(010).
          WRITE 56'Material'(031).
          WRITE 75'Sales Qty'(011).
          WRITE 100'Customer PO'(012).
          WRITE 134'Req.Del.Dt & Tm'(014).
          WRITE 154'Load Dt'(015).
          WRITE 166'Plnt'(016).
          NEW-LINE.
          WRITE 5'City'(017).
          WRITE 41'Reg'(069).
          WRITE 45'Carrier'(018).
          WRITE 81'Transport ID'(019).
          WRITE 102'Dlvry Doc'(021).
          WRITE 115'Dlvry Qty'(025).
          WRITE 140'PGI Doc'(026).
          WRITE 152'Billng Doc'(027).
        WHEN 2.               "When sort by Material
          WRITE 1'Created By'(008).
          WRITE 14'SOff'(066).
          WRITE 21'Customer'(009).
          WRITE 57'Sales Doc'(010).
          WRITE 69'Sales Qty'(011).
          WRITE 92'Customer PO'(012).
          WRITE 126'Req.Del.Dt & Tm'(014).
          WRITE 146'Load Dt'(015).
          WRITE 162'Plnt'(016).
          NEW-LINE.
          WRITE 5'City'(017).
          WRITE 41'Reg'(069).
          WRITE 45'Carrier'(018).
          WRITE 81'Transport ID'(019).
          WRITE 102'Dlvry Doc'(021).
          WRITE 115'Dlvry Qty'(025).
          WRITE 140'PGI Doc'(026).
          WRITE 152'Billng Doc'(027).
      ENDCASE.
    ENDFORM.                    "RPT_HDR
    INCLUDE zrpthdri.
    WRITE:
    / rpt_hdr1.
    ULINE.
    IF v_flagh2 <> 0.
      PERFORM rpt_hdr.  "Write secondary header
      ULINE.
    * Control Break Header
      WRITE / cb_hdr1.
    ENDIF.
    Continued in Part-2
    Thanks  a ton in advance.
    Mythili Sharma
    Edited by: Mythili sharma on Mar 30, 2009 3:32 AM
    Edited by: Rob Burbank on Mar 30, 2009 10:46 AM

    Hello ABAP Experts,
    I need your help to modify the following report with following requirement as I have least knowledge about the field-group concept. Thats is the reason, I am pasting the whole code. As it is part of our production requirement. I really appreciate your help, If its sent modifying the code required.
    Modification required in the report.
    To allow the sales representatives to see billed shipments and open orders for the current month.
    1) Selection Screen Changes:
    u2022     Add selection by Sales group and Customer group
    u2022     Add sort by:     5. Ship-to / Material
    u2022     Add another selection box
    [ ] Open Orders and Shipments with the current month
    2)      For the new selection box, subtotal sales quantity and delivery quantity.
         If delivered, make the sales quantity zero in the subtotal
    Current report displays, in Selection Screen
    Sales org:
    Person Name:
    Material:
    Plant:
    Sales Office:
    Ship to Name:
    Ship to Number:
    Sorts Report by :
    1. Person Name
    2. Material
    3. Plant
    4. Sales Office
    Check Boxes :
    1. Open Orders
    2. Delayed Orders
    3.Cancelled Orders
    PLEASE DOWNLOAD THE COMPLETE REPORT FROM THE FOLLOWING LINK
    << Link removed >>
    It would be a great help, If the program is modified according to the requirement and snd it back through send space and send link, even if u send the necessary changes to be done in the report is also appreciable.
    Thanks a ton in adanvce
    Mythili
    I wanted to close this thread as I could not put my question in a proper format. So please reply in the new thread which is posted.
    Edited by: Mythili sharma on Mar 30, 2009 2:16 PM
    Edited by: Rob Burbank on Mar 30, 2009 4:24 PM

  • 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

  • A FM for the Sales Document Flow ...?

    Hi Friends;
    I know that the Sales and Distribution Flow is kept in table VBFA .? But is there a ready function module that gives me the shipment note number  and invoice number taking reversals into consideration and giving the actual and final flow of sales order item ?
    for example : input     SALES Document : SD001 item 10
                        output   shipment Notice    : 8000001 item 10
                        output   invoice number      : 9000001 item 10
    Kind regards.
    Erkan VAROL.

    Hi,
    look for example to BAPI_SALESORDER_GETLIST
    CALL FUNCTION 'RV_ORDER_FLOW_INFORMATION'
    Please check table VBFA. It contains all the information about document flow in SD.
    Check the example program below, it is not a function call, it is a dialog call.
    (Or)
    report zrich_0001.
    data: xvbco6 type vbco6.
    data: xvbak type vbak.
    parameters: p_vbeln type vbak-vbeln.
    clear xvbco6. clear xvbak.
    select single * from vbak into xvbak
    where vbeln = p_vbeln.
    move-corresponding xvbak to xvbco6.
    call dialog 'RV_DOCUMENT_FLOW'
    exporting
    vbco6 from xvbco6
    ivkorg from xvbak-vkorg
    ivtweg from xvbak-vtweg.
    Regards

  • Read record from parent table

    Hello,
    I have a table which is linked (using FK) with a number of other tables which are linked with other tables, etc. (like a tree). Using ADO.NET EF provider within ODAC 11.2.0.3 Release 5 I am trying to get a record from the root table. I coded a test using MSTest and when I do "myContext.MyTable.Where(...).FirstOrDefault();" VS2010 stops the debugging process after a while - no exception is caught in code but I get an error in Test results window: "The test adapter 'UnitTestAdapter' threw an exception while running test '<my test>'. Exception has been thrown by the target of an invocation.
    Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
    In the Debug window/view I get this:
    A first chance exception of type 'System.AccessViolationException' occurred in Oracle.DataAccess.dll
    A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
    A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in Microsoft.VisualStudio.QualityTools.Tips.UnitTest.Adapter.dll
    Step into: Stepping over method without symbols 'Microsoft.VisualStudio.TestTools.Agent.AgentExecution.CallAdapterRunMethod'
    W, 7380, 13, 2012/11/09, 23:33:29.803, QTAgent32.exe, AgentExecution: Exception while calling TestAdapter.Run: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    at Oracle.DataAccess.Client.OpsDac.Read(IntPtr opsConCtx, IntPtr opsErrCtx, IntPtr opsSqlCtx, IntPtr& opsDacCtx, OpoSqlValCtx* pOpoSqlValCtx, OpoMetValCtx* pOpoMetValCtx, OpoDacValCtx* pOpoDacValCtx)
    at Oracle.DataAccess.Client.OracleDataReader.Read()
    at System.Data.Common.Internal.Materialization.Shaper`1.StoreRead()
    at System.Data.Common.Internal.Materialization.Shaper`1.SimpleEnumerator.MoveNext()
    at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
    at System.Data.Objects.ELinq.ObjectQueryProvider.<GetElementFunction>b__1[TResult](IEnumerable`1 sequence)
    at System.Data.Objects.ELinq.ObjectQueryProvider.ExecuteSingle[TResult](IEnumerable`1 query, Expression queryRoot)
    at System.Data.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute[S](Expression expression)
    at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable`1 source)
    at <my code stack>
    --- End of inner exception stack trace ---
    at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
    at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestExecuter.DefaultTestMethodInvoke(Object[] args)
    at Microsoft.VisualStudio.TestTools.TestTypes.Unit.DefaultTestMethodDecorator.Invoke(Object[] args)
    at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestExecuter.RunTestMethod()
    at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestExecuter.ExecuteTest()
    at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestExecuter.Execute(UnitTestResult result)
    at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestRunner.ExecuteSingleTest(UnitTestExecuter executer, UnitTestElement test, ITestContext testContext, UnitTestAdapterContext userContext, Boolean isLoadTest)
    at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestRunner.Run(UnitTestElement test, ITestContext testContext, Boolean isLoadTest, Boolean useMultipleCpus)
    at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestRunner.Run(UnitTestElement test, ITestContext testContext, Boolean isLoadTest, Boolean useMultipleCpus)
    at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestAdapter.Run(ITestElement testElement, ITestContext testContext, Boolean isLoadTest)
    at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestAdapter.Run(ITestElement testElement, ITestContext testContext)
    at Microsoft.VisualStudio.TestTools.Agent.AgentExecution.CallAdapterRunMethod(Object obj)
    The thread 'Agent: adapter run thread for test '<my test>' with id '0779674e-2258-44d4-adfe-65302abbe50f'' (0x13e0) has exited with code 0 (0x0).
    W, 7380, 30, 2012/11/09, 23:33:29.869, QTAgent32.exe, Performance warning: m_test should be null when TestResult is serialized. Please find the offending code and correct it.
    E, 7380, 30, 2012/11/09, 23:33:29.879, QTAgent32.exe, AgentExecution: Received adapter message during test shutdown: run id {94200779-4759-4b4a-819c-61c55d39acbc}, test '<my test>' with id 0779674e-2258-44d4-adfe-65302abbe50f: MessageKind: Result, Outcome: Error
    The thread 'ExecutionUtilities.InvokeWithTimeout helper thread 'Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestAdapter.AbortTestRun'' (0x1f98) has exited with code 0 (0x0).
    The thread 'Agent: state execution thread for test '<my test>' with id '0779674e-2258-44d4-adfe-65302abbe50f'' (0x2688) has exited with code 0 (0x0).
    The thread 'Agent: test queue thread' (0x1c58) has exited with code 0 (0x0).
    A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll
    A first chance exception of type 'System.Threading.ThreadAbortException' occurred in Oracle.DataAccess.dll
    A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll
    The thread '<No Name>' (0x24c0) has exited with code 0 (0x0).
    A first chance exception of type 'System.Threading.ThreadAbortException' occurred in System.Data.Entity.dll
    A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll
    A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll
    The thread '<No Name>' (0x2410) has exited with code 0 (0x0).
    The thread '<No Name>' (0x2520) has exited with code 0 (0x0).
    E, 7380, 6, 2012/11/09, 23:35:17.912, QTAgent32.exe, AgentObject: Cleanup: Timeout reached in cleaning up the agent.
    E, 7380, 6, 2012/11/09, 23:35:22.918, QTAgent32.exe, AgentObject: Cleanup: Timeout reached in cleaning up the agent.
    The program '[7380] QTAgent32.exe: Managed (v4.0.30319)' has exited with code 0 (0x0).
    Any idea is appreciated!
    Thanks
    Edited by: 917334 on Nov 10, 2012 12:17 AM
    The equivalent where statement works well in classic ADO.NET.

    Hello
    Use the below function module
    RV_ORDER_FLOW_INFORMATION pass the type as C and pass the number.You will get all the flow.
    SELECT VBELN KNUMV BUKRS KUNRG REGIO NETWR FKSTO FKDAT FKART  INTO CORRESPONDING FIELDS OF TABLE T_VBRK  FROM VBRK WHERE BUKRS IN P_BUKRS AND FKDAT IN P_FKDAT AND VKORG IN P_VKORG AND REGIO = '07'
        ORDER BY VBELN KNUMV.
    SORT T_VBRK BY vbeln.
      LOOP AT T_VBRK.
        IF  T_VBRK-FKART = 'F2' OR T_VBRK-FKART = 'YF2' OR T_VBRK-FKART = 'ZF2' OR
            T_VBRK-FKART = 'ZG2' OR T_VBRK-FKART = 'ZL2' OR T_VBRK-FKART = 'YG2' OR T_VBRK-FKART = 'YL2' .
          IF T_VBRK-FKSTO IS INITIAL.
    i_vbco6-vbeln = t_vbrk-vbeln.
    CALL FUNCTION 'RV_ORDER_FLOW_INFORMATION'
      EXPORTING
      AUFBEREITUNG        = '2'
      BELEGTYP            = ' '
        COMWA               = i_vbco6
      NACHFOLGER          = 'X'
      N_STUFEN            = '50'
      VORGAENGER          = 'X'
      V_STUFEN            = '50'
    IMPORTING
      BELEGTYP_BACK       =
      TABLES
        VBFA_TAB            = t_vbfa
    EXCEPTIONS
       NO_VBFA             = 1
       NO_VBUK_FOUND       = 2
       OTHERS              = 3
    endif.
    ENDIF.
    endloop.
    loop at t_vbfa.
      if t_vbfa-vbtyp_V = 'C' OR t_vbfa-vbtyp_V = 'K' OR t_vbfa-vbtyp_V = 'L' OR t_vbfa-vbtyp_V = 'E' .
    *clear t_vbfa.
    SELECT VBELN BSTNK BSTDK FROM VBAK INTO CORRESPONDING FIELDS OF TABLE T_VBAK FOR ALL ENTRIES IN T_VBFA WHERE VBELN = T_VBFA-VBELV .
    endif.
      ENDLOOP.
    In case of any more help is required do let me know
    Regards,
    Nabheet Madan

  • Help in sql trace for vf03

    Hi,
      i was tracing the sql statments present in vf03 transaction for the invoice no.'s with accounting document over all status as not clear.
    i want to know the flow of the sql statements right from the user giving the invoice no. as input to the document flow window to know from where and how it is picking the accounting doucment over all processing status
    waiting for ur replies
    regards,
    maqsood

    Hi
    You should look at the code of std fm RV_ORDER_FLOW_INFORMATION, here you can see all selects the system does.
    Anyway the tables are VBFA (document flow), VBUK and VBUP. But you can't find that information here, because it's only in accounting not in sales.
    So perhaps the abap code you're looking for it's this:
    if vbrk-vbeln <> vbfa_tab-vbeln.
        perform vbrk_ermitteln using vbfa_tab-vbeln.
        check sy-subrc = 0.
        check xvbrk-rfbsk = 'C' or  xvbrk-rfbsk = 'J'.
        read table xdoc_num with key vbeln = vbfa_tab-vbeln
                            binary search.
        tabix_xdoc = sy-tabix.
        if sy-subrc = 0.
          check xdoc_num-not_found is initial.
        else.
          refresh xbkpf.
          call function 'FI_DOCUMENT_READ'
               exporting
                    i_awtyp     = 'VBRK'
                    i_awref     = vbfa_tab-vbeln
                    i_awsys     = vbrk-logsys
                    i_bukrs     = vbrk-bukrs
                    i_gjahr     = vbrk-gjahr
               tables
                    t_bkpf      = xbkpf
                    t_bseg      = xbseg
               exceptions
                    wrong_input = 1
                    not_found   = 2.
          describe table xbkpf lines sy-tabix.
          if sy-tabix ne 0.
    Delete documents from other fiscal year
            if sy-tabix > 1.
              CALL FUNCTION 'FI_PERIOD_DETERMINE'
                EXPORTING
                  i_budat        = vbrk-fkdat
                  i_bukrs        = vbrk-bukrs
                IMPORTING
                  e_gjahr        = da_gjahr
                  e_poper        = da_poper
                EXCEPTIONS
                  fiscal_year    = 1
                  period         = 2
                  period_version = 3
                  posting_period = 4
                  special_period = 5
                  version        = 6
                  posting_date   = 7
                  OTHERS         = 8.
              IF sy-subrc = 0.
                CONCATENATE da_gjahr da_poper INTO vbrk-gjahr.
              loop at xbkpf where gjahr ne vbrk-gjahr.
                delete xbkpf index sy-tabix.
              endloop.
              ENDIF.
            endif.
            loop at xbkpf.
              clear l_xdoc_num-status.
              move 'BKPF'      to l_xdoc_num-awtyp.
              move xbkpf-bukrs to l_xdoc_num-bukrs.
              move xbkpf-belnr to l_xdoc_num-docnr.
              move xbkpf-cpudt to l_xdoc_num-cpudt.
              move xbkpf-gjahr to l_xdoc_num-gjahr.
              l_xdoc_num-vbeln = vbfa_tab-vbeln.
              l_xdoc_num-logsys = vbrk-logsys.
              clear l_xdoc_num-not_found.
              loop at xbseg where bukrs eq xbkpf-bukrs
                            and   belnr eq xbkpf-belnr
                            and   gjahr eq xbkpf-gjahr
                            and   ( koart eq 'D' or koart eq 'K' ).
              endloop.
              if sy-subrc ne 0.
                l_xdoc_num-status = 'C'.
              else.
                loop at xbseg where not augbl is initial
                              and   ( koart eq 'D' or koart eq 'K' ).
                endloop.
                if not sy-subrc is initial.
      SET STATUS TO 'No items are cleared'
                  l_xdoc_num-status = 'A'.
                else.
                  loop at xbseg where augbl is initial
                                and   umskz ne 'A'
                                and   vorgn ne 'AZUM'
                                and   ( koart eq 'D' or koart eq 'K' ).
                  endloop.
                  if not sy-subrc is initial.
      Set status to 'All items are cleared'
                    l_xdoc_num-status = 'C'.
                  endif.
                endif.
    Otherwise: If there are customer/vendor positions where AUGBL is
    filled and some other ones where AUGBL is blank then set status
    to 'Partially cleared'
                if l_xdoc_num-status is initial.
                  l_xdoc_num-status = 'B'.
                endif.
              endif.
              append l_xdoc_num.
            endloop.
            insert lines of l_xdoc_num into xdoc_num index tabix_xdoc.
    This is extracted from include LV05CF01
    Max

  • Populating two dynamic internal tables and displaying the O/p as ALV

    I want to develop a abap prototype program report for the SD document flow analysis...
    There is a Fm : RV_ORDER_FLOW_INFORMATION in which if we pass the Sales order number it returns the flows as VBFA_TAB.
    I need to populate two dynamic ITAB1 and ITAB2
    the structure of ITAB1 should be like ColNm1....ColNmn
    The values for ColNm1 will be Sales Order ColNm2 as Delivery or smthng else depending on  field vbtyp_n.
    ITAB 2 should have the corresponding values accly to ITAB1.
    Then we need to display in ALV o/p.
    The tables should be populated dynamically.
    Can anybody throw some light on it and plz do write back with sample code to do the logic of it.

    Search in SDN with Dynamic internal tables.
    you get lot of code samples and Discussions related to Dynamic internal tables.
    you can also check with this class CL_ALV_TABLE_CREATE

  • Relationship table of Sales Order (VA03) and Delivery Order (VL03N)

    Hi everyone!
    What table can I see the relationship of Sales Order document (VA03) and Delivery Order document (VL03N) as shown in VA03 > Environment > Document Flow?
    I mean, what tables saves the partnerships of each document (query sales order no. and get equivalent delivery order no. or nos.)
    Thank you very much!

    Hi
    U can use the fm RV_ORDER_FLOW_INFORMATION in order to get out those links or you can read the item table LIPS:
    LIPS-VGBEL  = sales order number
    LIPS-VGPOS  = salese order item
    Max

  • FM to find Sales Order based on Purchase Order Number

    Hi All,
    I have a Purchase Order number and based on this I want to find out the corresponding Sales Order Number.
    Can anyone help me find any FM for this (I have tried RV_ORDER_FLOW_INFORMATION but its not of much help).
    Regards,
    Shoeb

    Check my reply here.
    Re: Purchase order number from Sales order

  • How to use Function module generated to update CDHDR CDPOS

    Hi,
    I have a Z-table, and I want to tracks the value changes in some fields,
    the data elements for those specific fields are marked for "Change document".
    I created a Change document object using the transaction SCDO and I got the function module.
    now can any one tell me how to use these function modules like ( what values need to be passed to function module. what value do we need to pass for   OBJECTID,..value for tables ...etc )
    I have a custom program to update/delete entries in the custom table so should I use the function module in my custom program to result an entry in CDHDR & CDPOS.
    how to display the old value and new values  for the fields specified to changes.
    Regards,
    Nagu.

    check in SE37
    RV_ORDER_FLOW_INFORMATION
    SD_SALES_DOCUMENT_READ
    SD_SALES_DOCUMENT_READ_POS
    SD_DOCUMENT_PARTNER_READ
    SD_DETERMINE_CONTRACT_TYPE
    SD_SALES_DOCUMENT_COPY
    SD_SALES_DOCUMENT_SAVE
    SD_SALES_DOCUMENT_ENQUEUE
    SD_PARTNER_READ
    RV_DELIVERY_PRINT_VIEW
    SD_PACKING_PRINT_VIEW
    SD_DELIVERY_VIEW
    RV_BILLING_PRINT_VIEW
    RV_PRICE_PRINT_HEAD
    RV_PRICE_PRINT_ITEM
    Rewards if useful...........
    Minal

  • How to create a Return Order from a Quality Notification?

    Hi everyone at SDN.
    Really need some help on this issue we are having. We want to create a Return Order from a Quality Notification, ie. the document flow should be:
    :: Serv. notif 000200000482
       :: Return Order 0060299453
    In the SAPGUI we are able to do this by going into transaction QN02, enter the notification number and in the menu: "Notification" --> "Functions" --> "Sales Order" --> "Create Selection of Order Type". Now we select the Return Order type and the result is as wanted.
    However, we want to do all this in ABAP instead. The BAPI I have tried with is BAPI_CUSTOMERRETURN_CREATE.
    And the following code is used:
        ls_order_h_in-refobjtype = 'BUS2078'. "Quality Notification
        ls_order_h_in-refdoctype = 'Z5'. "Quality Notification type
        ls_order_h_in-refobjkey = '000200000482'. "Ref. Quality Notification
        ls_order_h_in-doc_type = 'ZREN'. "Return Order type
        ls_order_h_in-sales_org = 'S001'.
        ls_order_h_in-distr_chan = '01'.
        ls_order_h_in-division = '01'.
    Then I add a material as well as the mandatory partner functions. When I execute the Return Order is created but when I check the document flow for the Return Order there is no link to the Quality Notification.
    Any suggestions on how to do this? I have tried using FM RV_DOCUMENT_FLOW_UPDATE_U for updating the document flow but it doesn't seem to like it when I enter a Notification in there. And when I run FM RV_ORDER_FLOW_INFORMATION for the above (working) Return Order there is no Quality Notification available. So this leads me to believe that I have to update something else then VBFA (Sales Document Flow)...
    I would really appreciate all the help I can get on this.
    Best Regards
    Niklas

    anyone?

  • Sales order details

    Hi ,
    can you help me to find the (BAPI or Function module)
    which will give the existing sales order detail...
    similar to BAPI_PO_GETDETAIL,
    is there any bapi or F.M. for that....
    thanks in advance..
    Manish

    BAPI_CUSTOMERORDER_GETLIST
    BAPI_SALESORDER_GETLIST.
    SD_PARTNER_READ     
    PRICING     
    RV_ORDER_FLOW_INFORMATION     
    SD_PRINT_TERMS_OF_PAYMENT     
    BAPI_SALESORDER_SIMULATE     
    RV_ORDER_FLOW_INFORMATION  Reads sales document flow of sales document after delivery and billing 
    Don't forget also check direct reference documents for the both starting document # and preceding/following document types that you are searching for (For example, if you search delivery for the given SO, check also LIPS-VGBEL and LIPS-VGPOS, if it's possible with regard to performance
    SD_SALES_DOCUMENT_READ   Reads sales document header and business data: tables VBAK, VBKD and VBPA (Sold-to (AG), Payer (RG) and Ship-to (WE) parties) 
    SD_SALES_DOCUMENT_READ_POS   Reads sales document header and item material: tables VBAK, VBAP-MATNR 
    SD_DOCUMENT_PARTNER_READ   partner information including address. Calls SD_PARTNER_READ 
    SD_DETERMINE_CONTRACT_TYPE   In: at least VBAK-VBELN
    Exceptions: NO CONTRACT | SERVICE_CONTRACT | QUANTITY_CONTRACT 
    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

  • How to get Follow on documents

    Hi All,
    I need to find follow on documents for sales orders, e.g, I need to find all accounting documents created for a sales order. I know we have document numbers for Invoices and Credit Memos in VBFA but how do we link them to accounting tables like BKPF and BSEG. Does anyone know how to link them or if there is any Function Module availavle for this. I have tried FM  RV_ORDER_FLOW_INFORMATION and BAPI_ACC_DOCUMENTS_RECORD but they only seem to give whatever is in VBFA and not the accounting documents posted in FI.
    Any ideas/suggestions will be greatly appreciated.

    Try to plug in the SD document number into <b>BKPF-XBLNR</b>. This works for me.
    <i><b>Points are always welcome!!</b></i>

Maybe you are looking for

  • Adobe Flash Player 11.3.300.265 cannot open new tab in Firefox 14

    Cannot open new tab after updating adobe flash player to 11.3.300.265 in Firefox 14.01 Reinstall Adobe Flash Player to earlier version 11.2.202.235 and everything work fine with Firefox 14.01

  • Mess up when adding photos to a web gallery

    Hi everyone, Once I have created a web gallery and the sync with mobileme has be done, everything is ok. But as soon as I add more photo to this web gallery, the sync with mobile me isstill ok, but the display on aperture is completly mess up. It dis

  • Select options values pass to function module

    Hi all,         I want to pass the values entered in the select options to the function module. How should my function module interface be declared for passing the select options I tried declaring like t_range type data in the tables tab.  But this t

  • .XML page not opening in IE after running in JDeveloper 10.1.3

    Hi, I built a page SamplePG.xml under webui in JDeveloper. When i tried to run the page, the internet explorer opened and it keeps on refreshing, the page is not completely opening. any suggestions. Thanks.

  • Urgent Help in Java Networking

    Dear Sir, I've written an encryption algorithm.My problem is i 've to encrypt a file using the algorithm above at one computer.The receiver in another computer should get this file and decrypt it at another computer.I have written both encryption and