OPEN SALESORDER

Hi all,
i am uploading sales order using BAPI_SALESORDER_CREATEFROMDAT2,
how to upload the address related data for one time shipto customers in the sales orders using this bapi.
thanks,
deepthi n

Hi,
You can not use BAPI to populate header text. You have to save the header text after you create or save sales order. The function module you will be using is <b>SAVE_TEXT</b>.
If you mean "Header Note" text by header text, see the code below to populate header text.
DATA: l_objname LIKE thead-tdname,
      l_vbeln   LIKE vbak-vbeln.
DATA: lst_header LIKE thead.    "Target Text Header
*" internal table for text to be inserted
DATA: lit_textline  LIKE tline OCCURS 10 WITH HEADER LINE.
*" move sales document number
l_vbeln = 'Pass Sales document number here'.
l_objname = l_vbeln. "(or you can directly assing VBELN value here)
*" Create text header
lst_header-tdobject = 'VBBK'.
lst_header-tdname   = l_objname.
lst_header-tdid     = '0001'.
lst_header-tdspras  = sy-langu.
lit_textline-tdformat = '*'.
lit_textline-tdline   = 'This is 1st line'.
APPEND lit_textline.
lit_textline-tdformat = '*'.
lit_textline-tdline   = 'This is 2nd line'.
APPEND lit_textline.
lit_textline-tdformat = '*'.
lit_textline-tdline   = 'This is 3rd line'.
APPEND lit_textline.
* Save text
CALL FUNCTION 'SAVE_TEXT'
  EXPORTING
    client          = sy-mandt
    header          = lst_header
    insert          = 'X'
    savemode_direct = 'X'
  TABLES
    lines           = lit_textline.
IF sy-subrc <> 0.
*  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Let me know which text you wants to populate on header. I can give you the code for that.
Let me know if you have any question.
Regards,
RS

Similar Messages

  • CRM 2013 Opening salesorder record results in blank page

    I am using CRM 2013 on-premise and I'm having an issue viewing Order records. I can see the list of Active Orders, but when I click an Order record to open it, I get a blank page.
    I have tried the following to fix this:
    Cleared my cookies and cache
    Navigated to another Org under the same URL
    IIS reset on the web site
    Full server reboot
    I have found several posts saying this is a known bug in CRM 2013 and the "fixes" were the items listed above. Has anyone else run into this issue and not been able to resolve using the aforementioned work-arounds?
    I also get an additional error when I try to navigate away from the blank page:
    Microsoft Dynamics CRM Error Report Contents
    <CrmScriptErrorReport>
      <ReportVersion>1.0</ReportVersion>
      <ScriptErrorDetails>
       <Message>Unable to get value of the property 'ClientVariables': object is null or undefined</Message>
       <Line>2</Line>
       <URL>/_common/JsProvider.ashx?ids=1959345455-451858892-1713948411-1401263868-1250882489-367493978-19173614-574022791-696891199-2007586035-1552783829&ver=1250620516</URL>
       <PageURL>/main.aspx?etc=1088&extraqs=%3f_gridType%3d1088%26etc%3d1088%26id%3d%257b8029E1FC-4FB8-E411-9406-00155D106900%257d%26rskey%3d706276367&pagemode=iframe&pagetype=entityrecord&rskey=706276367</PageURL>
       <Function>anonymous(){returnthis.get_$L_0().ClientVariables}</Function>
       <CallStack>
        <Function>anonymous(){returnthis.get_$L_0().ClientVariables}</Function>
       </CallStack>
      </ScriptErrorDetails>
      <ClientInformation>
       <BrowserUserAgent>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; BRI/2; MS-RTC LM 8; InfoPath.3)</BrowserUserAgent>
       <BrowserLanguage>en-us</BrowserLanguage>
       <SystemLanguage>en-us</SystemLanguage>
       <UserLanguage>en-us</UserLanguage>
       <ScreenResolution>1920x1200</ScreenResolution>
       <ClientName>Web</ClientName>
       <ClientTime>2015-03-30T12:47:28</ClientTime>
      </ClientInformation>
      <ServerInformation>
        <OrgLanguage>1033</OrgLanguage>
        <OrgCulture>1033</OrgCulture>
        <UserLanguage>1033</UserLanguage>
        <UserCulture>1033</UserCulture>
        <OrgID>{0E1EFE15-0471-E411-93FE-00155D106900}</OrgID>
        <UserID>{15167AD7-C474-E411-93FE-00155D106900}</UserID>
        <CRMVersion>6.1.0.581</CRMVersion>
      </ServerInformation>
    </CrmScriptErrorReport>

    wilson5301 wrote:
     When he tries to open up a PDF, Internet explorer will open a new blank window.
    Open a PDF from where:
    saved locally on the computer?
    from an online link?
    If from an online link, I have seen the same before.  This usually occurs if the server where the document is located is very slow.  Retrying (F5) usually resolves the problem.
    P.S. the latest secure version of Reader 7x is 7.1.4!

  • Open ProductionOrder Window & Close SalesOrder Window

    Hi All,
    After successful Addition of Sales Order, i need to open a Production Order Window and close the Sales Order Window. How do I do it with SDK? And in which event I write the code? Pls write me the code to solve this issue.
    Thanks in Advance.
    Kind Regards,
    Murtaza

    Hi,
    U can do it on the item press after action by conditions
    if(pVal.ItemUID=="1" && pVal.actionsuccess==true)
    1.For Closing the sales order window ,u have
    oForm.Close() //Where oForm is the instance of the sales order form.
    2.For Open the Production Order Window,u have
      oSboApplication.ActivateMenuItem("4369").

  • Reg:open sales orders

    Can any body give me the logic to list the oper sales orders.
    Thanks,
    srik

    Hi,
    *& Report  ZOPEN_SALESORDER
    report zopen_salesorder message-id arc no standard page heading.
    tables :kna1,vbak.
    select-options : so_vkorg for vbak-vkorg ,
    so_vtweg for vbak-vtweg ,
    so_spart for vbak-spart,
    so_kunnr for kna1-kunnr.
    data : keybalance like bapi3007_3 occurs 0 with header line.
    data : begin of sales_open occurs 0 ,
    vbeln like vbak-vbeln,
    auart like vbak-auart,
    kunnr like kna1-kunnr,
    bstnk like vbak-bstnk,
    lfstk like vbuk-lfstk,
    fkstk like vbuk-fkstk,
    gbstk like vbuk-gbstk,
    end of sales_open.
    data : begin of itm_sales occurs 0,
    vbeln like vbap-vbeln,
    posnr like vbap-posnr,
    matnr like vbap-matnr,
    lfsta like vbup-lfsta,
    lfgsa like vbup-lfgsa,
    fksta like vbup-fksta,
    fksaa like vbup-fksaa,
    gbsta like vbup-gbsta,
    end of itm_sales.
    data : l_kunnr like kna1-kunnr,
    l_vkorg like vbak-vkorg,
    l_vtweg like vbak-vtweg,
    l_spart like vbak-spart.
    data: v_statusl(20) type c,
    v_statusb(20) type c,
    v_statusf(20) type c,
    v_statusg(20) type c,
    v_status(20) type c,
    v_field(1) type c.
    **Selection Screen Validations.
    at selection-screen.
    perform validations.
    *& Form Validations
    text
    --> p1 text
    <-- p2 text
    form validations.
    **Customer
    if not so_kunnr[] is initial.
    select single kunnr into l_kunnr
    from kna1
    where kunnr in so_kunnr.
    if sy-subrc ne 0.
    message e002 with text-005.
    endif.
    endif.
    **Sales Organization
    if not so_vkorg[] is initial.
    select single vkorg into l_vkorg
    from tvko
    where vkorg in so_vkorg.
    if sy-subrc ne 0.
    message e003 with text-006.
    endif.
    endif.
    **Distribution Channel
    if not so_vtweg[] is initial.
    select single vtweg into l_vtweg
    from tvkov
    where vkorg in so_vkorg
    and vtweg in so_vtweg.
    if sy-subrc ne 0.
    message e004 with text-007.
    endif.
    endif.
    **Division
    if not so_spart[] is initial.
    select single spart into l_spart
    from tvta
    where vkorg in so_vkorg
    and vtweg in so_vtweg
    and spart in so_spart.
    if sy-subrc ne 0.
    message e005 with text-008.
    endif.
    endif.
    endform. " Validations
    top-of-page.
    perform sales_top_of_page.
    start-of-selection.
    perform sales_sel.
    *& Form sales_sel
    text
    --> p1 text
    <-- p2 text
    form sales_sel.
    data: date type sy-datum.
    date = sy-datum - 3000.
    select vbeln auart kunnr bstnk
    lfstk fkstk gbstk
    into table sales_open
    from vbakuk
    where vkorg in so_vkorg
    and vtweg in so_vtweg
    and spart in so_spart
    and kunnr in so_kunnr
    "and gbstk ne 'C'.
      and gbstk in ('A','B')
      and erdat >= date.
    loop at sales_open.
    call function 'BAPI_AR_ACC_GETKEYDATEBALANCE'
          exporting
            companycode = '1919'
            customer    = sales_open-kunnr
            keydate     = sy-datum
          tables
            keybalance  = keybalance.
        read table keybalance index sy-tabix.
    write:/4 sy-vline,
    5 sales_open-vbeln  color 2 intensified on,
    16 sy-vline,
    17 sales_open-auart color 2 intensified on,
    27 sy-vline,
    28 sales_open-kunnr color 2 intensified on,
    40 sy-vline,
    41 sales_open-bstnk color 2 intensified on,
    55 sy-vline,
    56 sales_open-lfstk,
    76 sy-vline,
    77 sales_open-fkstk,
    96 sy-vline,
    97 sales_open-gbstk ,
    117 sy-vline,
    118 keybalance-lc_bal,
    142 sy-vline.
    "hide sales_open-vbeln .
    endloop.
    write :/4 sy-uline(160).
    endform. " sales_sel
    *& Form sales_top_of_page
    text
    --> p1 text
    <-- p2 text
    form sales_top_of_page.
    write:/4 sy-uline(160),
    50 'OPEN SALES ORDERS' color 7 intensified on .
    write: /4 sy-vline,
    5 'SalesOrder' color 1 ,
    16 sy-vline,
    17 'OrderType' color 1,
    27 sy-vline,
    28 'Customer' color 1,
    40 sy-vline,
    41 'PoNumber' color 1,
    55 sy-vline,
    56 'Delivery Status' color 1,
    76 sy-vline,
    77 'Billing Status' color 1,
    96 sy-vline,
    97 'Processing Status' color 1,
    117 sy-vline,
    130 'Balance' color 1,
    142 sy-vline.
    write:/4 sy-uline(160).
    endform. " sales_top_of_page
    "at line-selection.
    "select a~vbeln
    "a~posnr
    "a~matnr
    "* a~kwmeng
    "b~lfsta
    "b~lfgsa
    "b~fksta
    "b~fksaa
    "b~gbsta
    "into table itm_sales
    "from vbap as a join vbup as b
    "on avbeln eq bvbeln
    "and aposnr eq bposnr
    "and b~gbsta ne 'C'
    "where a~vbeln eq sales_open-vbeln.
    "if not sales_open is initial.
    "loop at itm_sales.
    "write:/5 itm_sales-vbeln,
    "itm_sales-posnr,
    "itm_sales-matnr,
    "itm_sales-lfsta,
    "itm_sales-lfgsa,
    "itm_sales-fksta,
    "itm_sales-fksaa,
    "itm_sales-gbsta.
    "endloop.
    "endif.
    thanks
    Ravi

  • Open Orders Report.

    Hello,
    Can anyone give me the code for the open orders report??Using the tables VBAP,VBAK and VBUK.
    Thanking you in anticipation.
    Regards,
    Sirisha.

    hi sirisha ,
    check this code for open sales order(basic list) + open items (secondary list).
    check the status as A--not yet processed..  
                        B--partially processed
                        C--completely processed
    hope this helps u out in getting the functionality.
    u can take the header data from vbakuk ( vbak + vbuk )
    and items from vbap as shown ..
    fetching the data from vbakuk minimizes joins on vbak and vbuk.
    execute the below code.
    REPORT ZEX2  MESSAGE-ID arc NO STANDARD PAGE HEADING.
    Tables :kna1,vbak.
    SELECT-OPTIONS : so_vkorg FOR  vbak-vkorg OBLIGATORY,
                     so_vtweg FOR  vbak-vtweg OBLIGATORY,
                     so_spart FOR  vbak-spart,
                     so_kunnr FOR  kna1-kunnr.
    DATA : BEGIN OF sales_open OCCURS 0 ,
           vbeln LIKE vbak-vbeln,
           auart LIKE vbak-auart,
           kunnr LIKE kna1-kunnr,
           bstnk LIKE vbak-bstnk,
           lfstk LIKE vbuk-lfstk,
           fkstk LIKE vbuk-fkstk,
           gbstk LIKE vbuk-gbstk,
           END OF sales_open.
    DATA : BEGIN OF itm_sales OCCURS 0,
           vbeln LIKE vbap-vbeln,
           posnr LIKE vbap-posnr,
           matnr LIKE vbap-matnr,
           lfsta LIKE vbup-lfsta,
           lfgsa LIKE vbup-lfgsa,
           fksta LIKE vbup-fksta,
           fksaa LIKE vbup-fksaa,
           gbsta LIKE vbup-gbsta,
           END OF itm_sales.
    DATA : l_kunnr LIKE kna1-kunnr,
           l_vkorg LIKE vbak-vkorg,
           l_vtweg LIKE vbak-vtweg,
           l_spart LIKE vbak-spart.
    DATA: v_statusl(20) TYPE c,
          v_statusb(20) TYPE c,
          v_statusf(20) TYPE c,
          v_statusg(20) TYPE c,
          v_status(20) TYPE c,
          v_field(1) TYPE c.
    **Selection Screen Validations.
    AT SELECTION-SCREEN.
      PERFORM validations.
    *&      Form  Validations
          text
    -->  p1        text
    <--  p2        text
    FORM validations.
    **Customer
      IF NOT so_kunnr[] IS INITIAL.
        SELECT SINGLE kunnr INTO l_kunnr
               FROM kna1
               WHERE kunnr IN so_kunnr.
        IF sy-subrc NE 0.
          MESSAGE e002 WITH text-005.
        ENDIF.
      ENDIF.
    **Sales Organization
      IF NOT so_vkorg[] IS INITIAL.
        SELECT SINGLE vkorg INTO l_vkorg
               FROM tvko
               WHERE vkorg IN so_vkorg.
        IF sy-subrc NE 0.
          MESSAGE e003 WITH text-006.
        ENDIF.
      ENDIF.
    **Distribution Channel
      IF NOT so_vtweg[] IS INITIAL.
        SELECT SINGLE vtweg INTO l_vtweg
                FROM tvkov
                WHERE   vkorg IN so_vkorg
                 AND    vtweg IN so_vtweg.
        IF sy-subrc NE 0.
          MESSAGE e004 WITH text-007.
        ENDIF.
      ENDIF.
    **Division
      IF NOT so_spart[] IS INITIAL.
        SELECT SINGLE spart INTO l_spart
                FROM tvta
                WHERE   vkorg IN so_vkorg
                AND     vtweg IN so_vtweg
                AND     spart IN so_spart.
        IF sy-subrc NE 0.
          MESSAGE e005 WITH text-008.
        ENDIF.
      ENDIF.
    ENDFORM.                    " Validations
    Top-of-page.
    PERFORM sales_top_of_page.
    Start-of-selection.
    PERFORM sales_sel.
    *&      Form  sales_sel
          text
    -->  p1        text
    <--  p2        text
    FORM sales_sel.
    SELECT vbeln auart kunnr bstnk
         lfstk fkstk gbstk
         INTO TABLE sales_open
         FROM vbakuk
         WHERE vkorg IN so_vkorg
         AND   vtweg IN so_vtweg
         AND   spart IN so_spart
         AND   kunnr IN so_kunnr
         AND gbstk NE 'C'.
      LOOP AT sales_open.
        WRITE:/4 sy-vline,
               5 sales_open-vbeln HOTSPOT ON COLOR 2 INTENSIFIED OFF,
               16 sy-vline,
               17 sales_open-auart COLOR 2 INTENSIFIED OFF,
               27 sy-vline,
               28 sales_open-kunnr COLOR 2 INTENSIFIED OFF,
               40 sy-vline,
               41 sales_open-bstnk COLOR 2 INTENSIFIED OFF,
               55 sy-vline,
               56 sales_open-lfstk,
               76 sy-vline,
               77 sales_open-fkstk,
               96 sy-vline,
               97 sales_open-gbstk ,
               117 sy-vline.
        HIDE sales_open-vbeln .
      ENDLOOP.
    ENDFORM.                    " sales_sel
    *&      Form  sales_top_of_page
          text
    -->  p1        text
    <--  p2        text
    FORM sales_top_of_page.
      WRITE:/4 sy-uline(114),
         50 'OPEN SALES ORDERS' COLOR 7 INTENSIFIED ON .
      WRITE: /4 sy-vline,
              5 'SalesOrder' COLOR 1 ,
              16 sy-vline,
             17  'OrderType' COLOR 1,
             27  sy-vline,
             28  'Customer' COLOR 1,
             40  sy-vline,
             41  'PoNumber' COLOR 1,
             55  sy-vline,
             56  'Delivery Status' COLOR 1,
             76  sy-vline,
             77  'Billing Status' COLOR 1,
             96  sy-vline,
             97  'Processing Status' COLOR 1,
             117  sy-vline .
      WRITE:/4 sy-uline(114).
    ENDFORM.                    " sales_top_of_page
    AT LINE-SELECTION.
      SELECT       a~vbeln
                   a~posnr
                   a~matnr
                a~kwmeng
                   b~lfsta
                   b~lfgsa
                   b~fksta
                   b~fksaa
                   b~gbsta
                   INTO TABLE itm_sales
                   FROM vbap AS a JOIN vbup AS b
                   ON avbeln EQ bvbeln
                   AND aposnr EQ bposnr
                   AND b~gbsta NE 'C'
                   WHERE a~vbeln EQ sales_open-vbeln.
      IF NOT sales_open IS INITIAL.
        LOOP AT itm_sales.
          WRITE:/5  itm_sales-vbeln,
                    itm_sales-posnr,
                    itm_sales-matnr,
                    itm_sales-lfsta,
                    itm_sales-lfgsa,
                    itm_sales-fksta,
                    itm_sales-fksaa,
                    itm_sales-gbsta.
        ENDLOOP.
      ENDIF.
    Regards,
    Vijay
    check the entries with t-code va05 for the same criteria.
    Message was edited by: Vijay

  • Function Module for open Purchase Order & Sales Order?

    Hi, commonly I read the data from tables and calculate the open quantity for sales order and purchase order, but I want to know, are there any standard function modules for getting the list of open "purchase order" and "sales order" respectively?
    Thanks and Regards.

    hi Ren,
    u can check all these bapi's related to salesorder
    BAPI_SALESORDER_CHANGE Sales order: Change Sales Order
    BAPI_SALESORDER_CONFIRMDELVRY Sales Order: Confirmation of Delivery; Document Flow Update
    BAPI_SALESORDER_CREATEFROMDAT1 Sales order: Create Sales Order
    BAPI_SALESORDER_CREATEFROMDAT2 Sales order: Create Sales Order
    BAPI_SALESORDER_CREATEFROMDATA Create Sales Order, No More Maintenance
    BAPI_SALESORDER_GETLIST Sales order: List of all Orders for Customer
    BAPI_SALESORDER_GETSTATUS Sales Order: Display Status
    BAPI_SALESORDER_SIMULATE Sales Order: Simulate Sales Order
    May be this FM can help you
    MB_ADD_PURCHASE_ORDER_QUANTITY (Reading and adding open purchase order quantities)
    Regards,
    Naveen

  • Details of open invoices for the current year/ material price analysis

    Hi,
    I'm very new to SAP SD,MM modules. Can any one help me in the following of my requirements?
    1. How to get the details of open invoices for the current year? Which table should I look into?
    2. I have to create a report to display material price analysis. How should I do that?
    3. How to develope a report to list out all the Open Sales Order with earliest ship date and requested ship date
    4.How to create an interactive report for displaying plant status to know the status of a particular material
    5. How to develope a report on Sales Order displaying Sales order Number, Sales order date, Material, PO Date and Customer requested date
    Thanks in advance!!
    Uma.
    Message was edited by:
            Uma Ravi

    Hi Ravi,
    for 3, 4, 5 --> u can go through the code ...
    REPORT ZEX2  MESSAGE-ID arc NO STANDARD PAGE HEADING.
    Tables :kna1,vbak.
    SELECT-OPTIONS : so_vkorg FOR  vbak-vkorg OBLIGATORY,
                     so_vtweg FOR  vbak-vtweg OBLIGATORY,
                     so_spart FOR  vbak-spart,
                     so_kunnr FOR  kna1-kunnr.
    DATA : BEGIN OF sales_open OCCURS 0 ,
           vbeln LIKE vbak-vbeln,
           auart LIKE vbak-auart,
           kunnr LIKE kna1-kunnr,
           bstnk LIKE vbak-bstnk,
           lfstk LIKE vbuk-lfstk,
           fkstk LIKE vbuk-fkstk,
           gbstk LIKE vbuk-gbstk,
           END OF sales_open.
    DATA : BEGIN OF itm_sales OCCURS 0,
           vbeln LIKE vbap-vbeln,
           posnr LIKE vbap-posnr,
           matnr LIKE vbap-matnr,
           kwmeng like vbap-kwmeng,
           lfsta LIKE vbup-lfsta,
           lfgsa LIKE vbup-lfgsa,
           fksta LIKE vbup-fksta,
           fksaa LIKE vbup-fksaa,
           gbsta LIKE vbup-gbsta,
           END OF itm_sales.
    DATA : l_kunnr LIKE kna1-kunnr,
           l_vkorg LIKE vbak-vkorg,
           l_vtweg LIKE vbak-vtweg,
           l_spart LIKE vbak-spart.
    DATA: v_statusl(20) TYPE c,
          v_statusb(20) TYPE c,
          v_statusf(20) TYPE c,
          v_statusg(20) TYPE c,
          v_status(20) TYPE c,
          v_field(1) TYPE c.
    data : v_openqty like vbap-kwmeng.
    **Selection Screen Validations.
    AT SELECTION-SCREEN.
      PERFORM validations.
    *&      Form  Validations
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM validations.
    **Customer
      IF NOT so_kunnr[] IS INITIAL.
        SELECT SINGLE kunnr INTO l_kunnr
               FROM kna1
               WHERE kunnr IN so_kunnr.
        IF sy-subrc NE 0.
          MESSAGE e002 WITH text-005.
        ENDIF.
      ENDIF.
    **Sales Organization
      IF NOT so_vkorg[] IS INITIAL.
        SELECT SINGLE vkorg INTO l_vkorg
               FROM tvko
               WHERE vkorg IN so_vkorg.
        IF sy-subrc NE 0.
          MESSAGE e003 WITH text-006.
        ENDIF.
      ENDIF.
    **Distribution Channel
      IF NOT so_vtweg[] IS INITIAL.
        SELECT SINGLE vtweg INTO l_vtweg
                FROM tvkov
                WHERE   vkorg IN so_vkorg
                 AND    vtweg IN so_vtweg.
        IF sy-subrc NE 0.
          MESSAGE e004 WITH text-007.
        ENDIF.
      ENDIF.
    **Division
      IF NOT so_spart[] IS INITIAL.
        SELECT SINGLE spart INTO l_spart
                FROM tvta
                WHERE   vkorg IN so_vkorg
                AND     vtweg IN so_vtweg
                AND     spart IN so_spart.
        IF sy-subrc NE 0.
          MESSAGE e005 WITH text-008.
        ENDIF.
      ENDIF.
    ENDFORM.                    " Validations
    Top-of-page.
    PERFORM sales_top_of_page.
    Start-of-selection.
    PERFORM sales_sel.
    *&      Form  sales_sel
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM sales_sel.
    SELECT vbeln auart kunnr bstnk
         lfstk fkstk gbstk
         INTO TABLE sales_open
         FROM vbakuk
         WHERE vkorg IN so_vkorg
         AND   vtweg IN so_vtweg
         AND   spart IN so_spart
         AND   kunnr IN so_kunnr
         AND gbstk NE 'C'.
      LOOP AT sales_open.
        WRITE:/4 sy-vline,
               5 sales_open-vbeln HOTSPOT ON COLOR 2 INTENSIFIED OFF,
               16 sy-vline,
               17 sales_open-auart COLOR 2 INTENSIFIED OFF,
               27 sy-vline,
               28 sales_open-kunnr COLOR 2 INTENSIFIED OFF,
               40 sy-vline,
               41 sales_open-bstnk COLOR 2 INTENSIFIED OFF,
               55 sy-vline,
               56 sales_open-lfstk,
               76 sy-vline,
               77 sales_open-fkstk,
               96 sy-vline,
               97 sales_open-gbstk ,
               117 sy-vline.
        HIDE sales_open-vbeln .
      ENDLOOP.
    ENDFORM.                    " sales_sel
    *&      Form  sales_top_of_page
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM sales_top_of_page.
      WRITE:/4 sy-uline(114),
         50 'OPEN SALES ORDERS' COLOR 7 INTENSIFIED ON .
      WRITE: /4 sy-vline,
              5 'SalesOrder' COLOR 1 ,
              16 sy-vline,
             17  'OrderType' COLOR 1,
             27  sy-vline,
             28  'Customer' COLOR 1,
             40  sy-vline,
             41  'PoNumber' COLOR 1,
             55  sy-vline,
             56  'Delivery Status' COLOR 1,
             76  sy-vline,
             77  'Billing Status' COLOR 1,
             96  sy-vline,
             97  'Processing Status' COLOR 1,
             117  sy-vline .
      WRITE:/4 sy-uline(114).
    ENDFORM.                    " sales_top_of_page
    AT LINE-SELECTION.
      SELECT       a~vbeln
                   a~posnr
                   a~matnr
                   a~kwmeng
                   b~lfsta
                   b~lfgsa
                   b~fksta
                   b~fksaa
                   b~gbsta
                   INTO TABLE itm_sales
                   FROM vbap AS a JOIN vbup AS b
                   ON a~vbeln EQ b~vbeln
                   AND a~posnr EQ b~posnr
                   AND b~gbsta NE 'C'
                   WHERE a~vbeln EQ sales_open-vbeln.
      IF NOT sales_open IS INITIAL.
        LOOP AT itm_sales.
          at end of vbeln .
          sum.
          v_openqty = itm_sales-kwmeng.
          endat.
          WRITE:/5  itm_sales-vbeln,
                    itm_sales-posnr,
                    itm_sales-matnr,
                    itm_sales-kwmeng,
                    itm_sales-lfsta,
                    itm_sales-lfgsa,
                    itm_sales-fksta,
                    itm_sales-fksaa,
                    itm_sales-gbsta.
        ENDLOOP.
      ENDIF.
    skip 2.
      write:/  'open Quantity for the order is ', v_openqty .
    for 1.
    open invoices..
    SELECT vbeln
             fkart
             kunag
             gbstk
             INTO TABLE it_billing_h
             FROM vbrkuk
             WHERE vkorg IN so_vkorg
             AND vtweg IN so_vtweg
    *        AND spart IN so_spart
             AND kunag IN so_kunnr
            and   year in p_year                  ---->"parameter for year..
             AND gbstk NE 'C'.                   "----> open invoices
    for 2..
    2. refer TABLES mara, EINA ..
    regards,
    VIjay

  • Formatted search - open quantity

    Hi.
    Can someone please provide a formatted search that calculates the open quantity within an sales order? I know there already is a function for this, but my problem is that I have to use quotes before making the sales order. Then my open quantity will be based on what's left inside the sales quotation.
    Does someone know how to calculate the open quantity when considering only the values inside the sales order?
    Thanks and regards,
    Runar.

    Hi.
    Thank you for swift reply. I think this query fetches the open quantity based on the original quote? Correct me if I'm wrong?
    I need to fetch the open quantity only based on what is on the salesorder. So open quantity should be whats orignially on the salesorder minus what has been delivered.
    Any ideas?
    Thanks.

  • Updating oOrders open quantity

    Hi Experts,
    I am creating a Delivery Receipt based on a specific Sales Order thru DIAPI. My problem is my Sales Order open quantity per line is not updating when its reference DR quantity is less than on the Sales Order document. Is there a property I am missing?
    Please help.
    Regards,
    Roger

    Hi Gordon,
    Here is my sub procedure that creates a Delivery from a Sales Order with its Draft - Delivery document.
    - The Delivery  document's lines will depend on the Draft-Delivery lines versus the Sales Order document's lines.
    Please help me on how will my Sales Order remaining open quantity will be updated depending on its matched item on the Draft-Delivery document's lines.
    public SAPbobsCOM.Documents PostDeliveryReceipts(SAPbobsCOM.Company company, SAPbobsCOM.Documents draft, SAPbobsCOM.Documents salesOrder, BusinessObjects.Shipment shipment, ref int result)
                SAPbobsCOM.Documents delivery = (SAPbobsCOM.Documents)company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDeliveryNotes);
                delivery.HandWritten = SAPbobsCOM.BoYesNoEnum.tYES;
                delivery.DocNum = draft.DocNum;
                delivery.CardCode = salesOrder.CardCode;
                delivery.DocDate = shipment.ShipmentDate;
                delivery.UserFields.Fields.Item("U_smc_shipNo").Value = shipment.ShipmentNumber;
                int tmp_baseline = 0;
                for (int i = 0; i <= salesOrder.Lines.Count - 1; i++)
                    salesOrder.Lines.SetCurrentLine(i);
                    draft.Lines.SetCurrentLine(i);
                    if (salesOrder.Lines.TreeType != SAPbobsCOM.BoItemTreeTypes.iIngredient)
                        delivery.Lines.ItemCode = draft.Lines.ItemCode;
                        delivery.Lines.Quantity = draft.Lines.Quantity;
                        delivery.Lines.BaseEntry = salesOrder.DocEntry;
                        delivery.Lines.BaseLine = tmp_baseline;
                        delivery.Lines.BaseType = Convert.ToInt32(SAPbobsCOM.BoObjectTypes.oOrders);
                        delivery.Lines.Add();
                        tmp_baseline++;
                result = delivery.Add();
                return delivery;
    Edited by: Roger Arce on Jan 19, 2011 8:53 AM

  • Open standing sales order

    Hello Guys,
    iam migrating open standing sales order using LSMW standard object bapi_salesorder_createfromdata2.i just want to confirm from you experts whether iam using correct standard object and also i would like to know the difference between salesorder,standing sales order and open standing sales order.please help me guys.your help is greatly appreciated.
    Regards
    Janapathi

    I think that standing sales order might be related to like a blanket order or scheduling aggreement.  So to your customer, they would have a requirement to have 100 widgets shipped to them every other week, and they would have a "scheduling aggreement" or blanket PO in there system, which in turn would correspond to a "Standing sales order" in your system, so that you would ship them 100 widgets every other week and the deliveries and shipments would be against this one sales order over and over again.  I think it may be releated to this kind of process. 
    Regards,
    Rich Heilman

  • Condition value getting changed when open the Sales order in VA02

    Hi Experts,
    i have creating Sales order manually in VA01, and for first line item of sale order, i have assigned value in custom field of additional tab B, to populate Condition value for condition type ZK01 and checked in VA02, VA03 same Condition value is there for condition type ZK01.
    And created delivery document and billing document for newly created Salesorder.
    When i have open the Sales order in VA02, then i am getting changed Condition value for conidition type ZK01 in bothe header and first line item and in VA03 there is no change in value.
    Kindly let me know the user exit or any related programs to this issue.Thanks in Advance.

    Hi Rajani,
    this sound like VOFM -> conditions. Do you know which conditions are active during the determination?
    Cheers,
    Stefan.

  • Query to get Salesorder Delivery Address in Purchase Order (ODLN Address2)

    This case looks a bit like a dropshipment situation:
    Our customer orders some products (salesorder = ORDR / RDR1).
    At the order-moment the salesdepartment cannot decide yet which businesspartner is going to deliver.
    At the purchase- and delivery-moment we create a purchase-order for the goods (OPOR / POR1).
    At that moment we want to lookup the customer's delivery address (name, street, zipcode,city and country) and put it as ONE field in the OPOR-Address2-field.
    We think it is at best when we can select this address2 field from the open orders ORDR.
    Who can help us to create the proper Query ? Thanks in advance !
    Jos Dielemans - www.dielemans.biz
    Edited by: J. Dielemans on May 25, 2009 3:26 PM
    I have already found this Query:
    SELECT DISTINCT T0.DocNum,T0.DocDate, T0.CardName, T0.Address2 FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry WHERE T1.LineStatus ='o' or T1.Quantity > T1.OpenQty and T0.DocStatus ='o' ORDER BY T0.DocNum
    Now I want to select the ORDR-Address2-Field and copy it together with the customer's name to the OPOR-Address2 Field.
    I realize that we can at best use this Query as a Formatted Search on the OPOR-Address2-Field
    Jos Dielemans
    Edited by: J. Dielemans on May 25, 2009 3:26 PM

    We do not link Purchase Order to Sales Order.
    We want to copy the shipaddress from the Customer to the Purchase Order so that the Supplier can ship the goods directly to the right address.
    I thought it would be appropriate to select the right Customer from the Open Orders and then copy his CardName and Shipment Address to the Purchase Order.
    Can you help me with that Query ?
    Otherwise we should select the customer's Cardname and Shipment Address from the Business Partner's Masterdata.
    Jos Dielemans

  • Linked Button To SalesOrder, Error No Matching Record ODBC 2028

    Hello,
    I've added a LinkedButton to a Matrix Cell.
    This is ok.
    But the LinkedButton only works correct with the DocEntry
    Number of SalesOrder ,not with desired DocumentNumber.
    For Example, SalesOrder Document
    DocEntry = 310
    DocumentNumber = 400073
    Entering 310 to matrix cell and clicking the
    LinkedButton, the SalesOrder with DocumentNumber
    400073 will be loaded.
    Entering 400073 to matrix cell and clicking the
    LinkedButton, error ODBC 2028 occurs.
    Has someone an idea, how to link that
    button properly to the DocumentNumber??
    The source
    'adding column
    Set sbo_cOlumn = sbo_Matrix.Columns.Add
                        (UID:="1",Type:=it_LINKED_BUTTON)
    'adding UserDataSource
    oForm.DataSources.UserDataSources.Add UID:="1",
                          DataType:=dt_LONG_NUMBER
    'bind column to UserDataSource
    sbo_cOlumn.DataBind.SetBound
                      Bound:=True, TableName:="", Alias:="1"
    ' create linked Button
    Set sbo_LinkedButton = sbo_cOlumn.ExtendedObject
    sbo_LinkedButton.LinkedObject = lf_Order
    Regards
    Thomas

    Hi,
    I have the same problem with linking to Sales Order.
    Sugesstion to use DocEntry instead of DocNum is correct only partially and it looks user-unfriendly even if you hide DocEntry value and have DocNum in the next column.
    If you open "Inventory/Pick and Pack/Pick List" and select any pick, you can see a standard link to SO's DocNum, not to a DocEntry
    Can please anybody explain how it is done?
    Thank you
    Natalya

  • SalesOrder HandWritten property

    Good Day
    Experts: 
    I am having a bit of trouble today with the SalesOrder object.  I am creating the SalesOrders no problems passing the DocNum value from my record by setting the HandWritten property to Yes.  However, when I do this the SalesOrder gets created with a status of Open - Printed.  I just want the status to be Open like when I manually add a SalesOrder using the Manual series and typing in a number. 
    How can I achieve this? 
    Appreciate the help,
    Ed

    Hi Ed,
    What other properties are you setting? What version are you running?
    If I create a new sales order in SBO 2007A (patch 38) and set my own DocNum value then the status of my order is Open and not Open-Printed.
    Here's my test code:
    try
        SAPbobsCOM.Documents sboOrder = (SAPbobsCOM.Documents)_sboCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders);
        sboOrder.CardCode = "NZC01006";
        sboOrder.HandWritten = SAPbobsCOM.BoYesNoEnum.tYES;
        sboOrder.DocDate = System.DateTime.Now;
        sboOrder.DocDueDate = System.DateTime.Now;
        sboOrder.DocNum = 1111;
        sboOrder.Lines.SetCurrentLine(0);
        sboOrder.Lines.ItemCode = "0110";
        sboOrder.Lines.Quantity = 1;
        sboOrder.Lines.UnitPrice = 50;
        int iRetVal = sboOrder.Add();
        if(iRetVal != 0)
            _sboApp.SetStatusBarMessage(_sboCompany.GetLastErrorDescription(), SAPbouiCOM.BoMessageTime.bmt_Medium, true);
    catch (Exception ex)
        _sboApp.SetStatusBarMessage(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Long, true);
    Kind Regards,
    Owen

  • Open and cancelled Quote Report

    Hi,
    Can anyone give me the information  for getting open and cancelled Quote Report?

    I hope you are using reason for rejection for cancelling quotations. If that is the case, you can use transaction VA25 to view the list of quotations. Here you can filter on two columns status and reason for rejection to view the report as per your requirement.
    Regards,
    GSL.

Maybe you are looking for

  • Ask Apple for better iPhoto (Aperture) Library sharing!

    *Some Background...* My wife and I each have our own Mac and iPhone and we share a digital camera. Between the three camera devices we snap a lot of photos and we want easy access (over the network!) to each other's photos so we can both maintain a s

  • How to check indesign version installed by Apple Script

    Hi Friends, I want to make an apple script which will check for the version of Indesign installed in the "Applications" folder. I tried using "exists" function of Finder. But seems something is missing/incorrect. tell application "Finder"           e

  • SLOW Mac Book Pro  help appreciated.

    Hello friends. I was searching the forums for help to understand why my Mac Book Pro is suddenly so slow... I found and ran etreCheck... so I'll copy and paste it here... the one item in read was that time machine is not configured.... anyway, here y

  • Strange graphical glitch on 55TL515

    I'm getting a strange graphical glitch occasionally on my 55TL515.  When the glitch appears, it will reoccur every 20 seconds or so.  I've discovered one way to make this disappear temporarily, but I'd like a permanent fix.  Let me describe my living

  • PROVIDE SYNTAX?

    Hi, If i take one infotype data we are taking like this... PROVIDE * FROM P0002 BETWEEN PN-BEGDA AND PN-ENDDA. WRITE: P0002-PERNR, P0002-NACHN, P0002-VORNA. ENDPROVIDE. But i want multiple infotypes data like 0000,0006,0008....?Give me the syntax of