Maintianing multiple line items in main window  in scripts

Hi folks,
  i want to print multiple line items in main window of script for eg 50 line items then my main window should continue in second page also. how to maintain this.
can u provide me sample code for this..
Thx in advance,
Neelima.N

You have an internal table with 50 lines, is it correct?
Let's say, there's a MATNR field in your internal table.
First do, what I wrote in my previous comment.
The create an element in yout main window, like this:
/E LINE_ITEMS
/  &GS_MAIN-MATNR&
In your printer program you have to code the following:
LOOP AT gt_main INTO gs_main.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
WINDOW = 'MAIN'
ELEMENT = 'LINE_ITEMS'.
ENDLOOP.
This code will loop all 50 of your table entries.
In the MAIN window will fit 30 entries.
When the LOOP is reaching the 30th entry, SAP will automatically create a new page (because of the NEXT PAGE statement you set in the page settings in the SAPScript) and will continue the printing.
Regards
Tamá

Similar Messages

  • Displaying line items in main window

    Hi
    I want to create a sapscript from scratch. How do one display multiple line items in a one window.
    Do i loop the internal table in the print program and write to scapscript?

    Hi,
    Make a Main window in sapscript.
    Make a text element say ITEM.
    and then give the name of ur variable to be printed as &<variable>&
    Now in Program side make a new prog...
    get the lineitems in itab
    open_form....
    loop across the itab
    write_form
    endloop
    close_form
    Pls ping me if unclear... i think it helps...
    Regards,
    Abhishek

  • Problem in dynamically handling the number of line Items in Main Window

    Hi Gurus,
    I want to know is there any way by which we can handle the Line items that is being Printed in the Main Window.i.e can we split a Line item to the next/subsequent page if it is not fitting in the First/subsequent page.
    Please throw some light .
    Regards,
    Asish Dash

    Hi Haritha,
    No,  suppose there are 10 line items.suppose the 10th value is not fitting in the first page and some part gets printed in the first page and the rest is splitted to the second page.What I want is the whole 10th line item value should come in the second page i.e if the line item value doesnot fit in the First page then the whole value should get printed in the second page.
    Regards .
    Asish Dash

  • Unable to print multiple line items in Z-SAP SCRIPT

    Hi ALL,
    We have a scenario where in we are calling the Driver program (RFKORD50) for Document Extract(F.64), Where in we have attached the Z-Script to the program(RFKORD50),
    Unable to print multiple items.
    1) Checked with all the elements in STD program for printing multiple items in main window but unable to get all the items we are able to fetch only 1 item .
    (&BSEG-BUZEI&,,     &BSEG-SGTXT&,,,,&BSEG-DMBTR&)
    2) I have also tried with external subroutine but it also didnot work.it is fetching the latest value.
    Ex: if we have 3 items say 1,2,3 first 2 items are not getting fetched it is taking 3rd item and printing it straight away(Problem is it is not going to script for fetching the first item).
    see the perform which i have used
    /: PERFORM ITEMS IN PROGRAM ZTFI_ZNV20296
    /:USING &BSEG-BUKRS&
    /:USING &BKPF-BELNR&
    /:USING &BSEG-GJAHR&
    /:CHANGING &V_BUZEI&
    /:CHANGING &V_SGTXT&
    /:CHANGING &V_DMBTR&
    /: ENDPERFORM
    IL  &V_BUZEI&,,     &V_SGTXT&,,,,&V_DMBTR&
    Please suggest me whetther we can call write_form from external subroutine. or is there any loop commands in SAP SCRIPT Form.
    Regards,
    Jana

    Hi!
    The LOOP is always within the printer program. In this case also.
    Just check out the RFKORI35 include, the LOOP begins in the 215th line (in 4.6C).
    SORT HBSEG BY BUKRS SORTP1 SORTP2 SORTP3 SORTP4 SORTP5
                          BELNR GJAHR BUZEI.
            LOOP AT HBSEG.
    *         WHERE BUKRS = SAVE_BUKRS.
              SAVE_BUKRS  = HBSEG-BUKRS.
              IF  ( HBSEG-KUNNR = SAVE_KUNNR
              AND   NOT SAVE_KUNNR IS INITIAL )
              OR  ( HBSEG-LIFNR = SAVE_LIFNR
              AND   NOT SAVE_LIFNR IS INITIAL ).
                CLEAR RF140-ELEMENT.
                RF140-ELEMENT = '521'.
                CALL FUNCTION 'WRITE_FORM'
                         EXPORTING  WINDOW    = 'MAIN'
                                    ELEMENT   = '521'
                         EXCEPTIONS WINDOW    = 1
                                    ELEMENT   = 2.
    You might try out to write your code within the 521 elemnt in the sapscript.
    Regards
    Tamás
    Edited by: Tamás Nyisztor on Jun 12, 2008 3:34 PM

  • 1 line item in invoice for Multiple line items of SO

    Hi SD Gurus,
    My client requirement is multiple line items of the sales order should reflect as a single line item in the invoice ..?
    For ex: I am using Service material type Dien & material created under different material groups.
    My Sales order looks somthing like below with material no & amount:
    10  Testing charges    10$     material group xx1
    20  Baking charges     20$     material group xx2
    30  Scan/Taping          20$    matierial group xx1
    Now in the invoice its should reflect only with 1 line item with the whole amount 50$.
    Kinldy let me know how  this requriement can be fullfilled.
    Thanks,
    Rahul

    Dear Rahul
    I think you can apply Rate Routing for this.
    A rate routing is a routing for repetitive manufacturing. It enables you to easily reproduce the lean production process.
    In the rate routing, the production rate per operation is defined (production time according to a base quantity). Set-up time is not usually defined, since no changes to setup are planned.
    However, you can also use standard routings. A standard routing represents the various steps of production (such as setup, processing, teardown and so on), operation by operation, if necessary with suboperations.
    A rate routing does, however, offer all the same functions as a standard routing.
    <b>Structure</b>
    If you use the same standard value key for all the work centers on the line, the system copies the descriptions of the standard values to the routing as the column headings of the operation overview.
    If you use different standard value keys for the work centers, the system copies the descriptions into the routing that is entered in the control data for the routing in Customizing.
    To create a Rate Routing, follow the steps as under:-
    1)  Starting from the main Line Design menu, choose Rate routing --> Create.
           The system displays the initial screen for rate routings.
    2)  Enter the plant, the material and in the field Group, the group to which you want to assign the rate routing.
    3)  Choose Enter.
         The system displays the screen Header details.
    4)  Enter the following data:
             => the routing description
             => the plant
             => the usage of the rate routing, i.e.production
             => the status, i.e. released
             => the unit of measure of the materials to be produced
    5)  Save your rate routing.
    <b>Result</b>
    You have created the rate routing. Continue creating the main production line and if necessary, feeder lines.
    You can also take the help of your PP guy for this.
    Thanks
    G. Lakshmipathi

  • Problem in printing multiple line items

    Hi,
       i designed a SAPSCRIPT FORM.When i execute the t-code MB01 by giving PO which has multiple line items ,  output type is invisible.
    But when i iexecute the t-code MB01 by giving PO which has single item , output type is visible and form is printing.
    Do i need to copy the print program and make changes in there or if i change elements in the form will that helps in printing multiple line items.
    thanks.

    HI,
    wat i understand is u r trying to loop at a variable window .but tht is not suggestable.
    write a loop in program lines. read the values in to different variables and the try printing them as text elements that will solve the problem.
    or else in other way use a template and that can also solve the problem.

  • Setting the value of a single attribute for multiple line items

    Hi all,
    I am working on a Web Dynpro application, I have created this applicaion for an accounting document so it has header data and multiple line item data. As per the requirement I have to put the following logic:
    1. When a user enters a value in the field KBLNR on the line item, all the other fields like cost centerm fund, functional area should populate from a database table based on the value of the KBLNR. to get this I have put the following code:
    TYPES: BEGIN OF t_kblp,
              fipos     TYPE kblp-fipos,
              kostl     TYPE kostl,
                      END OF t_kblp.
      DATA lv_kblnr TYPE wd_this->element_t_bseg-kblnr.
      DATA: lt_kblp TYPE STANDARD TABLE OF t_kblp,
            wa_kblp LIKE LINE OF lt_kblp,
            lt_bseg              TYPE STANDARD TABLE OF bseg,
            wa_bseg              TYPE bseg.
      DATA lo_nd_t_bseg TYPE REF TO if_wd_context_node.
      DATA lo_el_t_bseg TYPE REF TO if_wd_context_element.
      DATA: ls_t_bseg TYPE wd_this->element_t_bseg,
            lo_api_controller    TYPE REF TO if_wd_controller,
            lo_message_manager   TYPE REF TO if_wd_message_manager,
            lo_nd_tbseg          TYPE REF TO if_wd_context_node,
             lo_el_tbseg          TYPE REF TO if_wd_context_element,
             lt_el_tbseg          TYPE wdr_context_element_set,
             lv_bseg              TYPE bseg.
      lo_nd_t_bseg = wd_context->path_get_node( path = `ZDATA.CHANGING.T_BSEG` ).
      lo_api_controller ?= wd_this->wd_get_api( ).
      CALL METHOD lo_api_controller->get_message_manager
        RECEIVING
          message_manager = lo_message_manager.
      lo_nd_tbseg = wd_context->path_get_node( path = `ZDATA.CHANGING.T_BSEG` ).
      lt_el_tbseg = lo_nd_tbseg->get_elements( ).
      LOOP AT lt_el_tbseg INTO lo_el_tbseg.
        lo_el_tbseg->get_static_attributes(
                               IMPORTING static_attributes = lv_bseg ).
      IF lv_bseg-kblnr NE ' '.
          SELECT belnr
                 fipos
                 kostl
                 PSPNR
                 geber
                 saknr
                 fkber
                 grant_nbr
                 gsber
                 FROM kblp
                 inTO corresponding fields of wa_kblp
                 WHERE belnr = lv_bseg-kblnr and
                      saknr = lv_bseg-saknr.
            ENDSELECT.
    lo_nd_t_bseg = wd_context->path_get_node( path = `ZPRELIMINARY_POSTING.CHANGING.T_BSEG` ).
    * get element via lead selection
            lo_el_t_bseg = lo_nd_t_bseg->get_element( ).
    lo_el_tbseg->set_static_attributes(
                               EXPORTING static_attributes = wa_kblp ).
       CLEAR: lv_bseg, wa_kblp.
      ENDLOOP.
    everything is working fine but now the problem is couple of fields that I have in wa_kblp are with different names in bseg table and hence they are not updating... I tried putting the following logic within the loop :
    lo_el_t_bseg->set_attribute(
        name =  `PROJK`
    value = wa_kblp-pspnr ).
    but it's only setting the value of the first line item and not working for the multiple line items, can you please tell me how can do this?
    Thanks,
    Rajat Garg
    Edited by: rajatg on Jun 24, 2011 5:09 PM

    Hi Chris,
    I tried your code and it worked fine but after I put this code I am getting another issue. within the loop I had a code to make the fields non modifiable on the screen and was working fine but now what's happening is it's making the all the lines uneditable except the one with data on it (which is completely opposite), this is what I have coded:
    LOOP AT lt_el_tbseg INTO lo_el_tbseg.
        lo_el_tbseg->get_static_attributes(
                               IMPORTING static_attributes = lv_bseg ).
    IF lv_bseg-kblnr NE ' '.
      SELECT belnr
                 fipos
                 kostl
                 PSPNR
                 geber
                 saknr
                 fkber
                 grant_nbr
                 gsber
                 FROM kblp
                 inTO corresponding fields of wa_kblp
                 WHERE belnr = lv_bseg-kblnr and
                      saknr = lv_bseg-saknr.
            ENDSELECT.
    move: wa_kblp-belnr to wa_bseg-kblnr,
    wa_kblp-fipos to wa_bseg-fipos,
    wa_kblp-kostl to wa_bseg-kostl,
    wa_kblp-pspnr to wa_bseg-projk,
    wa_kblp-geber to wa_bseg-geber,
    wa_kblp-saknr to wa_bseg-saknr,
    wa_kblp-fkber to wa_bseg-fkber,
    wa_kblp-grant_nbr to wa_bseg-grant_nbr,
    wa_kblp-gsber to wa_bseg-gsber,
    lv_bseg-dmbtr to wa_bseg-dmbtr.
    append wa_bseg to lt_bseg.
    lo_nd_edit_property = wd_context->path_get_node( path = `ZPRELIMINARY_POSTING.CHANGING.T_BSEG.EDIT_PROPERTY` ).
          get element via lead selection
          lo_el_edit_property = lo_nd_edit_property->get_element( ).
          lo_el_edit_property->set_attribute(
            name =  `EDIT_FIELD`
            value = 'ABAP_TRUE' ).
          lo_el_edit_property->set_attribute(
            name =  `EDIT_WBS`
            value = 'ABAP_TRUE' ).
    endif.
    endloop.
    o_nd_t_bseg = wd_context->path_get_node( path = `ZPRELIMINARY_POSTING.CHANGING.T_BSEG` ).
    get element via lead selection
            lo_el_t_bseg = lo_nd_t_bseg->get_element( ).
      CALL METHOD lo_nd_t_bseg->bind_table
        EXPORTING
          new_items            = lt_bseg.
    Can you please see what I am doing it wrong here....

  • Production order from sales order with multiple line item(for one material)

    Dear Gurus,
    I am working in MTO scenarios. If there is several line item in a sales order for one material, multiple production order( same as no. of sales order line item) is getting created against each of the line item.My requirement is,since the material code is same in each line item and sales order is one, one production order should be generated for all line item. please tell me how to do it.
    (Here for one material, multiple line item is required for some specific reason)
    Regards
    Rajib Pathak

    Hi,
    This is not possible.
    In Std SAP will create one production order for one sales order. The stock is also allocated to thet particular sales order only. Because each and every sales order may vary in any one of the parameters. Considering this, SAP has designed like this.
    Regards,
    V. Suresh

  • Single/ Consolidated  GR/IR entry for a PO having multiple line items

    Hi,
    In a PO there are couple of line items for materials of similar type and class. While making the Goods Receipt, the Accounting Document is making two no of line items for GR/IR accounts as credit and two no of inventory accounts as debit. Same is happening to GR/IR account while making Invoice Receipt document also.
    Informatively, both the materials above have been assigned to one GR/IR account in the OBYC table.
    My question is, is it possible to consolidate the value of both these materials and post one line item for GR/IR account. This is required as in our case in a PO, normally, we do have multiple line items and hence it is resulting multiple no of GR/IR and inventory accounts in a single accounting document. As we are getting details of the line item from PO history, we do not require it in the accounting document.
    Requested to kindly help.
    Regards
    B.Mohanty

    Hi
    This is not possible (you will compleet los the link between the Invoice and GR)
    The reason is that when you receive an invoice that this is based on a G/R line and the way arround when you receive first the invoice(s).
    The system need this for the automatecly clearing from the  G/R - I/R account, that is based on PO an PO line item number.

  • MM: PO Not Picking up PR Having Multiple Line Items

    Hi All,
    When Creating PO with Reference to PR Having multiple line items, not picking up the line items and also the vendor and also the where in we  have to select  input tax code.
    CASE1: Created PR 760001340 with single line item and also could able to create PO.
    Case2: Created PR 760001341 with multiple line items, When creating PO with reference to PR the line items and Vendor are not picking Up.
    Plz. Advise a solution.
    Thanks in Advance.....
    Regards
    Sudheer

    HI SHWN,
    Thanks for prompt response.
    ERROR Message: When referencing a requisition, please also enter a requisition item no.
    Regards
    Sudheer

  • How to Restrict Single Delivery Date for PO with Multiple Line Items

    Dear Experts,
    How to Restrict Single Delivery Date for PO with Multiple Line Items.
    System needs to through Error Message if User Inputs Different Delivery Dates for PO with Multiple Line Items in ME21N Tcode.
    Can we achive this by Some Enhancement in SAP or Not ???
    If so how to do it.
    Any Inputs is highly appreciated.
    Thanks and Regards,
    Selvakumar. M

    Hi Selvakumar,
    we can resrict the PO to have a single delivery date in all the line items by means of giving a error message or overwiting the delivery date keyed/determined in the line item.
    You can use the BADI -> ME_PROCESS_PO_CUST. In which you need to implement the method PROCESS_SCHEDULE.
    (for technical aid - This method will be called for each and every PO line item, From the imporing parameter im_schedule we can get all the details of current PO line, even we can change the data in the current PO line. )
    Regards,
    Madhu.

  • Creating a PO Using BAPI For Multiple PLants Or Multiple Line Items

    Hi All
        Can you please suggest me how to create a Purchase Order Using BAPI_PO_Create1 for Multiple Plants Or for Multiple Line items. The Requirement is like the PO is for single material for single vendor but for mulple stores i.e plants
    NOte:  Suggest me the  Creation of PO for MUltiple Line items or for multiple plants Using BAPI . Hope you people will give me the needful.
    Regards
    Shivakumar Bandari

    Hi,
    Here is the sample code to do that...
    *---> po header data
      wa_poheader-vendor    =  your vendor..
      wa_poheader-doc_type  =  Your doc type..check with Functional contact....
      wa_poheader-purch_org =  Purchasing Org..
      wa_poheader-pur_group =  Purchasing Group
    *---> po header data (change toolbar)
      wa_poheaderx-vendor    =  'X'.
      wa_poheaderx-doc_type  =  'X'.
      wa_poheaderx-purch_org =  'X'.
      wa_poheaderx-pur_group =  'X'.
    *---> poitem data
    data: item like ekpo-ebelp.
    item = '0010'.
    loop at t_parts.
      it_poitem-po_item  =  '00010'.
      IT_POITEM-PLANT    =  Plant..
      IT_POITEM-STGE_LOC =  Sloc...
    *---> poitemx (item data change toolbar)
      it_poitemx-po_item  =  '0010'.
      it_poitemx-po_itemx  =  'X'.
      IT_POITEMX-PLANT    =  'X'.
      IT_POITEMX-STGE_LOC =  'X'.
    *---> add record's to internal table
      APPEND:  it_poitem,
             it_poitemx.
    endloop.
    *call bapi_po_create1
      CLEAR v_ebeln.
      CALL FUNCTION 'BAPI_PO_CREATE1'
        EXPORTING
          poheader         = wa_poheader
          poheaderx        = wa_poheaderx
        IMPORTING
          exppurchaseorder = v_ebeln
        TABLES
          return           = it_return
          poitem           = it_poitem
          poitemx          = it_poitemx.
    *---> check the return table for error message
      READ TABLE it_return WITH KEY type = 'E'.
      IF sy-subrc NE 0.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait = 'X'.
      endif.
    Thanks,
    Murali

  • Copying the item text in case of multiple line items

    Hi All,
                    I have a scenario where the sales order gets created in our SAP through a 850 idoc. The incoming idoc has only one item segment which carries the total order quantity ( for example say 1000). Since my company has contractual agreements with the end customer for doing multiple shipments , our sales department splits the total quantity into multiple line items in the sales order. Say splitting the 1000 quantities into 5 line items of 200 each.
    The problem here is that when the sales order got created , all  the related item text were copied only to the first line item ( of 1000 qty) and which is standard SAP. Since the order quantity was manually split, the related item text are not carried to the subsequent line items. The issue comes when an outbound (810) idoc is sent to customer . As I told earlier since only the first line item has the item text , the 810 idoc which was created for  the first line item only has the item text . The rest of the 810 which were subsequently created for multiple shipments/invoices on different dates didn't have the item text in the 810's. This is becoming a major problem as the 810 files are failing at our trading partners end because of missing text.
    Now my question is, Is there a way that I can make the item text copy automatically when multiple line items are created manually by business. Like is there a way where I can modify MV45AFZZ  to copy the item text in their respective segemnts ( z003,z004 etc) to "N" number of line items.
    Also please suggest if there is a better way of doing it. Suggstions are most welcome !!!.
    Regards
    Amrith

    Hi,
    First of all try to avoid doing select into corresponding fields. THis would improve the performance of the program.
    Try to do a single fetch from the BSIS table . fetch the hkont, belnr, dmbtr fields in to a master internal table. Manipulate and play with the data as required.  Don't hit the data base table more than once (unless it is required) . This would improve the performance of your code.
    Try to code this way.
    types: begin of ty_bsis,
                 hkont type hkont,
                 belnr type  belnr_d,
                 dmbtr type dmbtr,
              end of ty_bsis.
    data: it_bsis type standard table of ty_bsis,
             wa_bsis type ty_bsis,
    select hkont belnr dmbtr
              from bsis
              into table it_bsis
              WHERE HKONT IN S_RACCT
            AND PRCTR IN P_PRCTR
              AND MONAT IN S_POPER
             AND BUKRS EQ P_BUKRS
             AND GJAHR EQ P_GJAHR
              AND PRCTR IN S_PRCTR.
    Using the data availabe in the it_bsis, you can manipulate as required.
    Hope this would be helpful
    Regards
    Ramesh Sundaram

  • Partial goods receipt for PO with multiple line items

    Hello All,
    While doing MIGO, for a PO with multiple line items, if one line item is having error, will we be able to go ahead with goods receipt? Or entire material document is blocked for doing MIGO?
    We will be doing a development - in case if there is problem in goods receipt (checking of any parameter, and if it is missing - we will be posting error message)...is it possible to ahead with next line item and still post the material document?
    If partial goods receipt if possible for PO with multiple line items, how do we do it?
    Regards,
    RJS

    Hi
    While doing MIGO, for a PO with multiple line items, if one line item is having error, will we be able to go ahead with goods receipt? Or entire material document is blocked for doing MIGO?
    No. You cannot post the MIGO, if even one of the PO line item is having problem or giving error.
    We will be doing a development - in case if there is problem in goods receipt (checking of any parameter, and if it is missing - we will be posting error message)...is it possible to ahead with next line item and still post the material document?
    If you skip a line irem and do GR with next line item, how will you match quantity & value with the vendor Invoice at LIV ?
    If partial goods receipt if possible for PO with multiple line items, how do we do it?
    Partial goods receipt is possible for PO line items. That means, if PO has 100 qty for line item 1 then you can do GR for 50 now and 50 later depending on the vendors delivery.
    Hope this is what you mean by "Partial Goods Receipt".
    Edited by: Arun R on May 10, 2010 2:03 PM

  • How to implement bapi for transaction code f-02 for multiple line items

    Hi All,
    I am having one requirement to of implementing bapi for tcode f-02.
    I have identified the name of the badi e.i.  BAPI_ACC_GL_POSTING_POST.
    but i dont have any idea how implement it.
    i have multiple line items for one header.
    Please help me in this.
    Regards,
    Shoaib.

    HI
    In recording once u save, the recording comings out the transaction.
    If u want the pop-up to display before save. Then in recording also
    after entering all data and before Save press enter or do check.Try
    this way after that save the transaction.
    Regards,
    Raghu.

Maybe you are looking for

  • How do I remove my credit card information from my ipad and iphone

    How do I remove my credit card information from my ipad and ipone account?

  • How do I set up my old G3 PBs and a Sawtooth?

    My Wallstreet 233 had sat on my shelf for the last 5 years after I had thought that the Power Manager had burned due to a faulty adapter output. I recently got an old 266 which had an original apple mains adapter, and lo and behold the old PB came al

  • Java 1.4 & WLS 6.1 SP2 (Solaris 8 / SPARC)

    I know its unsupported and I know we should not really do it. But... My customer would like a preview of the performance improvements that are available in 1.4 since their application is heavily dependent on the Reflection API, for which Sun are clai

  • Set current layer question

    I've noticed in an action I have, it has a step that says "Set current layer". What exactly is that and how do you use it?  I want to add it to an action I'm creating.

  • Details on JRockit adaptive optimization

    Hello, I'm currently doing some research regarding the adaptive optimization system in Java VMs. I've looked through the various white papers available on JRockit, but couldn't find any detailed technical information about the approach JRockit takes