Page break problem in Sales Order Report

Hi,
I have made a RTF template for Sales Order Report. The template is designed to contain max 10 lines.
Now if number of lines are less than 10(1 page) or more than 10(2 pages) then PDF output is coming fine.
But if there are exactly 10 lines then instead of printing only 1 page it prints 2 pages, 1st page with 10 lines of data and 2nd page with only header & footer.
Can anybody help?
Regards.

How do you define when they page break happens?
Try to use:
<?split-by-page-break:?>
Check the user guide for more information.
Cheers,
Klaus

Similar Messages

  • Help on Sales order report

    Hi,
    I have a code to display Sales order report. But i need to generate Sales order Line item wise Report. Can anyone help me to modify this code to suit my criteria?
    DATA: IT_VBAK LIKE VBAK OCCURS 0 WITH HEADER LINE.
    DATA: IT_VBAP LIKE VBAP OCCURS 0 WITH HEADER LINE.
    PARAMETERS: SORG LIKE VBAK-VKORG,
    CCODE LIKE VBAK-BUKRS_VF.
    SELECT * FROM VBAK INTO TABLE IT_VBAK UP TO 100 ROWS
    WHERE
    VKORG = SORG AND
    BUKRS_VF = CCODE.
    SELECT * FROM VBAP INTO TABLE IT_VBAP UP TO 100 ROWS
    FOR ALL ENTRIES IN IT_VBAK
    WHERE
    VBELN = IT_VBAK-VBELN.
    LOOP AT IT_VBAP.
    WRITE: / IT_VBAP-VBELN, IT_VBAP-ERNAM, IT_VBAP-POSNR.
    ENDLOOP.
    Thanks in advance..
    Any help will be greatly appritiated

    Hi
    Hope it will help you..
    Reward if help.
    REPORT ZVRDOC0 no standard page heading
    line-size 300
    line-count 50(5).
    TABLES : vbak, "Sales Document Header Level
    vbap, "Sales Document Header Level
    kna1. "General Data in customer Master
    *INTERNAL TABLE T_VBAP
    DATA : Begin of t_vbap occurs 0,
           vbeln like vbap-vbeln,
           matnr like vbap-matnr,
           posnr like vbap-posnr,
           arktx like vbap-arktx,
           kwmeng like vbap-kwmeng,
           cmkua like vbap-cmkua,
           end of t_vbap.
    *INTERNAL TABLE T_TAB.
    DATA : Begin of t_tab occurs 0,
            vbeln like vbak-vbeln,
            kunnr like vbak-kunnr,
            audat like vbak-audat,
            netwr like vbak-netwr,
            vkorg like vbak-vkorg,
            name1 like kna1-name1,
            land1 like kna1-land1,
            end of t_tab.
    *INTERNAL TABLE T_FINAL.
    DATA : Begin of t_final occurs 0,
            vbeln like vbap-vbeln,
            kunnr like vbak-kunnr,
            matnr like vbap-matnr,
            posnr like vbap-posnr,
            arktx like vbap-arktx,
            kwmeng like vbap-kwmeng,
            cmkua like vbap-cmkua,
            audat like vbak-audat,
            netwr like vbak-netwr,
            vkorg like vbak-vkorg,
            name1 like kna1-name1,
            land1 like kna1-land1,
            end of t_final.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE text-bO3.
    parameters : P_kunnr like vbak-kunnr.
    select-options : S_vbeln for vbak-vbeln,
                     S_audat for vbak-audat.
    SELECTION-SCREEN END OF BLOCK B1.
    start-of-selection.
    select vbeln  matnr posnr arktx kwmeng cmkua  from vbap
    into corresponding fields  of table  t_vbap  where vbeln in S_vbeln .
    IF sy-subrc EQ 0.
    select  vbakkunnr vbakvbeln vbakaudat vbaknetwr vbak~vkorg
            kna1name1 kna1land1  into  table   t_Tab   from
            vbak   join  kna1   on kna1kunnr  = vbakkunnr
            FOR ALL ENTRIES IN t_vbap
            where vbak~vbeln = t_vbap-Vbeln and
            vbak~kunnr = p_kunnr and
            vbak~audat  in  S_audat .
    ENDIF.
    *end-of-selection.
    loop at t_vbap.
    read table t_tab with key vbeln = t_vbap-vbeln.
    move :
    t_vbap-vbeln to t_final-vbeln,
    t_vbap-matnr to t_final-matnr,
    t_vbap-posnr to t_final-posnr,
    t_vbap-arktx to t_final-arktx,
    t_vbap-kwmeng to t_final-kwmeng,
    t_vbap-cmkua to t_final-cmkua,
    t_tab-kunnr to t_final-kunnr,
    t_tab-audat to t_final-audat,
    t_tab-netwr to t_final-netwr,
    t_tab-vkorg to t_final-vkorg,
    t_tab-name1 to t_final-name1,
    t_tab-land1 to t_final-land1.
    append t_final.
    clear t_Final.
    endloop.
    sort t_Final by vbeln   Kunnr    matnr posnr  .
    loop at t_final.
    at new vbeln.
    write : /1 SY-VLINE, 2 t_final-vbeln color 5 inverse.
    ULINE /1(250).
    endat.
    write : /1 SY-VLINE, 2 t_final-vbeln color 5 inverse,
    20 SY-VLINE, 21 t_final-posnr color 5 inverse,
    40 SY-VLINE, 41 t_final-matnr color 5 inverse,
    60 SY-VLINE, 61 t_final-arktx color 4 inverse,
    80 SY-VLINE, 81 t_final-kwmeng color 4 inverse,
    100 SY-VLINE, 101 t_final-cmkua color 4 inverse,
    120 SY-VLINE, 121 t_final-kunnr color 3 inverse,
    140 SY-VLINE, 141 t_final-audat color 3 inverse,
    160 SY-VLINE, 161 t_final-netwr color 2 inverse,
    180 SY-VLINE, 181 t_final-vkorg color 2 inverse,
    210 SY-VLINE, 211 t_final-name1 color 1 inverse,
    230 SY-VLINE, 231 t_final-land1 color 1 inverse,
    250 SY-VLINE.
    at end of vbeln.
    sum.
    ULINE /1(250).
    write: /60 SY-VLINE, 'Total' ,
    81 t_final-kwmeng color 4 inverse ,100 SY-VLINE,
    101 t_final-cmkua color 4 inverse,120 SY-VLINE.
    ULINE /1(250).
    endat.
    at last.
    SKIP 2.
    sum.
    ULINE /1(250).
    write: /1 SY-VLINE, 60 SY-VLINE, 'Grand Total' ,
    81 t_final-kwmeng color 4 inverse , 100 SY-VLINE ,
    101 t_final-cmkua color 4 inverse,120 SY-VLINE.
    ULINE /1(250).
    endat.
    endloop.
    TOP-OF-PAGE.
    ULINE /50(24).
    WRITE : /50 SY-VLINE , 52 'SALES ORDER DETAILS' COLOR 5,
    73 SY-VLINE.
    ULINE /50(24).
    ULINE .
    WRITE: /10 'CURRENT DATE :', 25 SY-DATUM COLOR 1 INVERSE,
    100 'CURRENT TIME :', 115 SY-UZEIT color 5 INVERSE.
    WRITE: /10 'USERNAME :', 25 SY-UNAME COLOR 1 INVERSE,
    100 'PAGE NO :', 113 SY-PAGNO COLOR 5 INVERSE.
    WRITE: /10 'LOGON CLIENT :', 25 SY-MANDT COLOR 1 INVERSE,
    100 'COLON N0 :', 114 SY-COLNO COLOR 5 INVERSE.
    WRITE: /10 'CURRENT REPROT:', 25 SY-REPID COLOR 1 INVERSE,
    100 'LANGUAGE :', 116 SY-LANGU COLOR 5 INVERSE.
    ULINE.
    ULINE /1(250).
    write : /1 SY-VLINE, 2 'SALES DOC NO' color 6 inverse,
    20 SY-VLINE, 21 'SALES DOC ITEM' color 6 inverse,
    40 SY-VLINE,41 'MATERIAL NO' color 6 inverse,
    60 SY-VLINE, 61 'SHORT SALES TEXT' color 6 inverse,
    80 SY-VLINE, 81 'CUMM ORDER SALES' color 6 inverse,
    100 SY-VLINE, 101 'CREDIT DATA' color 6 inverse,
    120 SY-VLINE, 121 'CUSTOMER NO' color 6 inverse,
    140 SY-VLINE, 141 'DOC DATE' color 6 inverse,
    160 SY-VLINE, 161 'NET VALUE SALES' color 6 inverse,
    180 SY-VLINE, 181 'SALES ORG' color 6 inverse,
    210 SY-VLINE, 211 'CUSTOMER NAME' color 6 inverse,
    230 SY-VLINE, 231 'CUSTOMER CONTY' color 6 inverse,
    250 SY-VLINE.
    ULINE /1(250).
    END-OF-PAGE.
    ULINE.
    WRITE: /45 ' THIS IS END OF PAGE FOR SALES DOCUMENT DETAILS'
    COLOR 6 .

  • Regarding Sales Order Report in SD

    Hii
    I want to create reports in SD module such as sales order report, which covers all organization levels, delivery status, invoice status, shipping details and partner function details.
    Any inputs would be appreciated
    Regards,
    Guru

    Hello Guru,
    Please use basic SD transactions VA01,VA02,VA03(Create/change/display Sales order).
    Here, places the mouse cursor on any of the fields and hit F1.
    You will be given Technical help info (Table name ,field name,screen name)
    For example in VA03  when we hit F1 on Sales order number input help field, we get the following information.
    Table name VBAK
    Field: VBELN
    Data element: VBELN_VA
    Also as mentioned in the previous threads, please go through the tables VBAK,VBAP,VBFA,VBRP for the information required.
    Please mark as answered if my suggestion helped in resolving your problem.
    Regards,
    Himanshu Limaye

  • Open sales orders report

    Hi,
         Does anyone know of any open sales orders report ? VA05 ? Table join between VBAP-VBAK ?
    Thanks

    Hello,
    Does anyone know of any open sales orders report ? VA05 ? Table join between VBAP-VBAK ?
    If your basic requirement is find out the open Sales Order then you can look out for the below standard report:
    VA05/VA05N
    If your requirement involves some values to be included then kindly urge you to go for SQVI technique involving tables like VBAK,VBAP,VBUK and other Sales table based on requirement.
    Regards,
    Sarthak

  • Open Sales Order Report

    Hello..
    my client wants to have the open sales Order report in following format :
    ======================================================================================================
    Customer Name | Item 1 code  | Item 2 code  | Item 3 code  |  Item 4 code  |  Item 5 code  |  Item 6 code  | Item 7 code  |
    =======================================================================================================
    Jack Inc.......................987.................865.....................654.................543.......................739..................543...................987
    Colt Inc.......................237.................213.....................799..................321.......................875...................187...................122
    IOUU LLC...................127.................535.....................654..................777.......................211...................345...................777
    =====================================================================================================
    .................................1351..............1613...................2107.................1641.....................1825.................1075..................1886
    =====================================================================================================
    pls help me to create sql query for the above
    rekha
    Edited by: Rekhatiwari on Dec 16, 2010 10:46 AM
    Edited by: Rekhatiwari on Dec 16, 2010 10:47 AM

    Hi,
    Try this:
    SELECT T0.CardName,
    (Select SUM(isnull(T1.quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '[%2\]') Item1,
    (Select SUM(isnull(T1.quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '[%3\]') Item2,
    (Select SUM(isnull(T1.quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '[%4\]') Item3,
    (Select SUM(isnull(T1.quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '[%5\]') Item4,
    (Select SUM(isnull(T1.quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '[%6\]') Item5,
    (Select SUM(isnull(T1.quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '[%7\]') Item6,
    (Select SUM(isnull(T1.quantity,0)) from RDR1 T1 WHERE T1.DocEntry = T0.DocEntry AND T1.ItemCode = '[%8\]') Item7
    FROM ORDR T0
    WHERE T0.docdate between [%0\] and [%1\]
    That might be the only way close to your requirement.
    Thanks,
    Gordon

  • How To Add a new column for ZPR0 price in open sales order report ??

    HI,
    my requirement is To Add a new column for ZPR0 price in open sales order report if the order/scheduling agreement is a cross-company code transaction l(company code of order/scheduling agreement <> company code of delivering plant), price = ZPR0 price as at estimated GI date

    k

  • To Add a new column for ZPR0 prce in open sales order report

    HI,
    my requirement is To Add a new column for ZPR0 prce in open sales order report if the order/scheduling agreement is a cross-company code transaction l(company code of order/scheduling agreement <> company code of delivering plant), price = ZPR0 price as at estimated GI date

    HI,
    my requirement is To Add a new column for ZPR0 prce in open sales order report if the order/scheduling agreement is a cross-company code transaction l(company code of order/scheduling agreement <> company code of delivering plant), price = ZPR0 price as at estimated GI date

  • Sales Order / Forecasted Sale Order Report

    hi
    How to create Sales Order / Forecasted Sale Order Report.

    Hi Raju,
    Are you talking of normal sales order and in the Forecasted sale order report what are the inputs you are giving.

  • Sales order report

    Hi,
    What are the tables I should use for the following reports.
    1.  I want to create sales order status report for given sales office, sales group and creation date.
    2.  Open sales order report which covers all organizational levels, delivery status, invoice status shipping details and partner function details.
    thanks in advance
    with regards,
    VC

    For 2nd Q, you can find the open sales orders in the same VBUK table.
    Delivery status field is LFSTK.
    Invoice status field is RELIK
    The partner information is available in Sales Document: Partner table VBPA.

  • Credit Block released Sales order report

    Hi Experts,
    My client is given few sales orders (around 4)no and requesting us, to prepare the credit block released sales orders report (include released person user ID).
    *.No change logs is existing for all sales order and deliveries.
    For above requirement I am using CDHDR table data but I am not getting credit block released sales order report.
    Below fields I am using in CDHDR Table.
    Change doc.Object (objectclas) : VERKBELEG
    Document No (CHANGENR): Sales order no XXXXXXX
    Transaction no (TCODE) : VKM1,VKM2,VKM3
    Date(UDATE) : 25.09.2011 to 09.11.2011
    Experts, Can you please help me out for this.
    Thanking you!!!!
    Regards,
    Vijaykumar Kola
    *.I'm already aware of this is a new development.

    Try this, simple report... Here we check the new value of credit  status field VBUK-CMGST and if it is 'D' we know that someone used VKM* transaction to release the document. Also you need to format the sales order number with leading zeros so it occupies all 10 digits and pass it to CDHDR-OBJECTID field (and not CHANGENR field). In the below code I am using select option for sales order number, so I know it will be formatted with leading zeros and so select on CDHDR will be successful.
    *& Report  ZTV_TEST
    REPORT  ztv_test.
    TABLES: vbak, cdhdr.
    SELECT-OPTIONS: s_saldoc FOR vbak-vbeln OBLIGATORY,
                    s_udate FOR cdhdr-udate.
    RANGES: r_objid FOR cdhdr-objectclas.
    DATA: ls_cdhdr TYPE cdhdr,
          ls_cdpos TYPE cdpos.
    IF NOT s_saldoc IS INITIAL.
      LOOP AT s_saldoc.
        MOVE-CORRESPONDING s_saldoc TO r_objid.
        CONDENSE: r_objid-high, r_objid-low.
        APPEND r_objid.
      ENDLOOP.
    ENDIF.
    CHECK NOT r_objid[] IS INITIAL.
    SELECT *
      INTO ls_cdhdr
      FROM cdhdr
            WHERE objectclas = 'VERKBELEG' AND
                  objectid IN r_objid AND
                  udate IN s_udate AND
                  tcode LIKE 'VKM%'.
      SELECT SINGLE *
        INTO ls_cdpos
        FROM cdpos
          WHERE objectclas = ls_cdhdr-objectclas AND
                objectid = ls_cdhdr-objectid AND
                changenr = ls_cdhdr-changenr AND
                tabname = 'VBUK' AND
                fname = 'CMGST' AND
                value_new = 'D'.
      IF sy-subrc = 0.
        WRITE:/ ls_cdhdr-objectid(10), ls_cdhdr-username,
                ls_cdhdr-udate, ls_cdhdr-utime.
      ENDIF.
    ENDSELECT.

  • Sales order report with order attachments

    Hi All
    I am writing a program for a 2 part report that gives a list of sales orders with attachment flags and a list of invoices that do not have the output processed due to the presence of attachment flag.
    Firstly i need help regarding few queries in the process of writing this program.
    1. How can i distinguish between a sales order with attachement and one without an attachment.
    2. What is the related field for attachment in sales header/sales item table(s) or any other sales related table which will contain information of the attachment in the sales order.
    3. If I have an attachment in sales order, will it have an effect in the output being processed for the invoice for that order.
    Thanks in Advance
    --Mike

    Hello Erik,
    is there a sales order report with the complete line-item pricing
    breakdown. For example, In VA05 I'm only able to get the Net
    Price and Net Value as an output. I would also like to view the
    breakdown of the conditions (e.g. disounts, tax, etc.)
    Is there another report in SAP that will show this? Or a backend
    table I can pull this information from to create a query?
    The best way to handle your requirement is to create a Custom report using the standard table for Sales Order i.e. VBAK and you can pick up the Document Condition Number. You can pass this number to table KONV and pull up all the values for the active contion type which was responsible for Sales Order price calculation. Please reach out to a ABAPer to develop this sort of a custom report.
    Just FYI, if you want to check out all the value for a specific condition type, then you can use the standard report i.e. V/LD.
    Please update your post after carrying out this exercise.
    Regards,
    Sarthak

  • Sales Order Report with Pricing Breakdown

    HI, is there a sales order report with the complete line-item pricing breakdown. For example, In VA05 I'm only able to get the Net Price and Net Value as an output. I would also like to view the breakdown of the conditions (e.g. disounts, tax, etc.)
    Is there another report in SAP that will show this? Or a backend table I can pull this information from to create a query?
    Thanks, Erik

    Hello Erik,
    is there a sales order report with the complete line-item pricing
    breakdown. For example, In VA05 I'm only able to get the Net
    Price and Net Value as an output. I would also like to view the
    breakdown of the conditions (e.g. disounts, tax, etc.)
    Is there another report in SAP that will show this? Or a backend
    table I can pull this information from to create a query?
    The best way to handle your requirement is to create a Custom report using the standard table for Sales Order i.e. VBAK and you can pick up the Document Condition Number. You can pass this number to table KONV and pull up all the values for the active contion type which was responsible for Sales Order price calculation. Please reach out to a ABAPer to develop this sort of a custom report.
    Just FYI, if you want to check out all the value for a specific condition type, then you can use the standard report i.e. V/LD.
    Please update your post after carrying out this exercise.
    Regards,
    Sarthak

  • I have a problem regarding sales order line item with confimed quanity

    Hi Experts,
    I have a problem regarding sales order line item with confimed quanity with '0'  with delivery block but confirming the sales order quantity once the order is released from credit check.
    The situation arises as per the below scenarios.
    Scenario - 1 -  When the sales order has two line item - one line item with confirmed qunaity in the schedule line and for the 2nd line item there is no available stock for the Material xxxxxx.
    Initially the sales order is created for the line item 2 with confirmed quantity = 0, and having the delivery block = 01 for the Material xxxxxx  and the order is set with credit check.  Once the order is relased from the credit check.  The quanity for the item 2 where the confirmed quantity will be = 0 ( Where it is not changing the confirmed quantity)
    Scenario -2-  Updating the order qunaity for the line item 2 as (9Pcs) it will goes to credit check and save the order.
    Maintain the stock for the line item 2 ( 5 Pcs).
    Once the order is released from the credit check.  Then  for the line item 2 the confirm quanity will be seting to 5 Pcs with Delivery blcok 01.
    This should not happen, When the credit check is released even though if it has stock based on the delivery blockl it should set the confirmed quanity to Zero.
    Can you please help me how to solve this issue.
    Looking forward for your reply.
    Thanks and Regards,

    Hi,
    I agree with your point.  In the sales order When the complete delivery check box is enabled where the confimed qty is set to zero, it is fine but when we save the orderr it goes to credit check.  Once we release the order using VKM3 where in the sales order the confimed quantity is setting to 5,  But it should set to Zero quantity.  Quatity should not be get confirmed it should be Zero Quantity. 
    Further in SPRO - customizing in the deliveries blocking reasons - It has a tick mark in the confirmation blcok.  But we dont want to remove the - Confirmation Block tick mark
    Please any one can help me if you have any solution to solve this problem.
    Thanks and Regards.

  • Condition Period Problem in Sales order -  Need help

    Hi Gurus
    I am testing Sales Order back dated
    Condition period Problem in Sales order
    example for you to understand
    Sales Order where PO date is 17.12.2007
    Del Date & Price date is 13.02.2008
    Then it is not calculating IN: A/R BED %IN A/R BED totalN A/R CESS [1621]
    But if i do it after 14 feb 2008 then it is calculating IN: A/R BED %IN A/R BED totalN A/R CESS [1621]
    When I do it with current date it is calculating IN: A/R BED %IN A/R BED totalN A/R CESS [1621] say date is 9-5-2008
    I am not able to trace out problem, kindly help me from where I do I check and why this is happening.
    Rajesh Chalke

    Hi,
    I am not sure if this solves your problem, but I am suspecting that this might be due to the 'valid on date' of the condition records created for the relevant duty condition types.
    Since it was a recent regulation and VK11 usually defaults current date as the valid date, that condition record may have been valid only from the recent date on which it was created.
    Check the date in VK12 (To find the exact selection parameters, check the pricing analysis in the sales order which will display the exact condition record which is being selected as of current date.) Check for the same parameters; change the date to relevant date in the past and recreate the sales order. Hopefully this should solve the issue.
    Cheers,
    KC

  • BAPI - Problem in Sales order creation

    Hi Friends,
    I have problem in Sales order creation using BAPI ,I am getting a messsage - Error in creating document ,I have sent the code along with this mail ,can you help it out.
    Code:
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text FOR FIELD p_auart.
    PARAMETERS: p_auart TYPE auart OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Sales organization
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text1 FOR FIELD p_vkorg.
    PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Distribution channel
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text2 FOR FIELD p_vtweg.
    PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Division.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text3 FOR FIELD p_spart.
    PARAMETERS: p_spart TYPE spart OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SKIP 1.
    Sold-to
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text4 FOR FIELD p_sold.
    PARAMETERS: p_sold  TYPE kunnr OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Ship-to
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text5 FOR FIELD p_ship.
    PARAMETERS: p_ship  TYPE kunnr OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SKIP 1.
    Material
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text6 FOR FIELD p_matnr.
    PARAMETERS: p_matnr TYPE matnr   OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Quantity.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text7 FOR FIELD p_menge.
    PARAMETERS: p_menge TYPE kwmeng  OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Plant
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text9 FOR FIELD p_plant.
    PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Data declarations.
    DATA: v_vbeln            LIKE vbak-vbeln.
    DATA: header             LIKE bapisdhead1.
    DATA: headerx            LIKE bapisdhead1x.
    DATA: item               LIKE bapisditem  OCCURS 0 WITH HEADER LINE.
    DATA: itemx              LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
    DATA: partner            LIKE bapipartnr  OCCURS 0 WITH HEADER LINE.
    DATA: return             LIKE bapiret2    OCCURS 0 WITH HEADER LINE.
    DATA: lt_schedules_inx   TYPE STANDARD TABLE OF bapischdlx
                             WITH HEADER LINE.
    DATA: lt_schedules_in    TYPE STANDARD TABLE OF bapischdl
                             WITH HEADER LINE.
    Initialization.
    INITIALIZATION.
    v_text   = 'Order type'.
    v_text1  = 'Sales Org'.
    v_text2  = 'Distribution channel'.
    v_text3  = 'Division'.
    v_text4  = 'Sold-to'.
    v_text5  = 'Ship-to'.
    v_text6  = 'Material'.
    v_text7  = 'Quantity'.
    v_text9  = 'Plant'.
    Start-of-selection.
    START-OF-SELECTION.
    Header data
    Sales document type
      header-doc_type = p_auart.
      headerx-doc_type = 'X'.
    Sales organization
      header-sales_org = p_vkorg.
      headerx-sales_org = 'X'.
    Distribution channel
      header-distr_chan  = p_vtweg.
      headerx-distr_chan = 'X'.
    Division
      header-division = p_spart.
      headerx-division = 'X'.
      headerx-updateflag = 'I'.
    Partner data
    Sold to
      partner-partn_role = 'AG'.
      partner-partn_numb = p_sold.
      APPEND partner.
    Ship to
      partner-partn_role = 'WE'.
      partner-partn_numb = p_ship.
      APPEND partner.
    ITEM DATA
      itemx-updateflag = 'I'.
    Line item number.
      item-itm_number = '000010'.
      itemx-itm_number = 'X'.
    Material
      item-material = p_matnr.
      itemx-material = 'X'.
    Plant
      item-plant    = p_plant.
      itemx-plant   = 'X'.
    Quantity
      item-target_qty = p_menge.
      itemx-target_qty = 'X'.
      APPEND item.
      APPEND itemx.
      Fill schedule lines
      lt_schedules_in-itm_number = '000010'.
      lt_schedules_in-sched_line = '0001'.
      lt_schedules_in-req_qty    = p_menge.
      APPEND lt_schedules_in.
      Fill schedule line flags
      lt_schedules_inx-itm_number  = '000010'.
      lt_schedules_inx-sched_line  = '0001'.
      lt_schedules_inx-updateflag  = 'X'.
      lt_schedules_inx-req_qty     = 'X'.
      APPEND lt_schedules_inx.
    Call the BAPI to create the sales order.
      CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
           EXPORTING
                sales_header_in     = header
                sales_header_inx    = headerx
           IMPORTING
                salesdocument_ex    = v_vbeln
           TABLES
                return              = return
                sales_items_in      = item
                sales_items_inx     = itemx
                sales_schedules_in  = lt_schedules_in
                sales_schedules_inx = lt_schedules_inx
                sales_partners      = partner.
    Check the return table.
      LOOP AT return WHERE type = 'E' OR type = 'A'.
        EXIT.
      ENDLOOP.
      IF sy-subrc = 0.
        WRITE: / 'Error in creating document'.
      ELSE.
    Commit the work.
        COMMIT WORK AND WAIT.
        WRITE: / 'Document ', v_vbeln, ' created'.
      ENDIF.
    Regards,
    Dinesh

    what messages u are gettting in RETURN ? Please check the RETURN tables data.
    [code]CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
    EXPORTING
    sales_header_in = header
    sales_header_inx = headerx
    IMPORTING
    salesdocument_ex = v_vbeln
    TABLES
    return = return
    sales_items_in = item
    sales_items_inx = itemx
    sales_schedules_in = lt_schedules_in
    sales_schedules_inx = lt_schedules_inx
    sales_partners = partner.
    Regards
    Prabhu

Maybe you are looking for

  • IMac so slow

    I work for a small nonprofit organization, and the iMac I am using from 2007 is painfully slow. When I open a program such as Google Chrome, I sometimes wait 3 minutes for it to finish loading. It freezes often. I'm trying to determine if I can salva

  • Windows 7 Home Premium 64bit in Lenovo K300 5316 1BU

    I would like to know the step by step procedure for being able to boot from my USB External Hard Drive. Thank you in advance, MateusMan

  • Shift Report with Long Text

    how do i  get a shift report out of the PLM (plant maintenance) module that includes the following: Work Order Number Person Responsible Time and date Equipment Hours Confirmed Goods Movement Long Text Description of what was done to correct the prob

  • Empty file after replace

    Hello I am facing a very strange problem saving files. Find attached a quick example showing the issue. The first time I hit "save" and choose a name for the file (numbers.txt, for example), everything works great and the file is created with my data

  • Can't change JDev Customizer format by methods of BIBenas

    Hi all, I would like to ask you for help with customizing of format of crosstab column header – which I set in JDev crosstab creating. When I use JDev Customizer to setting format of catalogue crosstab column header (page Format of Customizer tool),