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

Similar Messages

  • 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.

  • Invoice Smartform  Printing Multiple Line Items

    Hi Floks,
    I have a billing Document with multiple items like labor ,material,miscellaneous and more .. i want to print all line items description and data also in smartform . It's possible to print all this requirement in Normal Windows or  How is it possible to print .If any Standard form is there .
    please Helpme Out.
    Regards,
    suresh

    Hi suresh,
        We are having standard smartform for the Invoice. Use LB_BIL_INVOICE. Copy it to Zform. You can get all the details by default.
    regards,
    Chandra.
    Note: Please reward if helpful.

  • ME91F printing multiple line items in reminders

    Hi All,
    We are trying to print reminders for line items (in PO's) from ME91F. When I execute this report it displays only line items (which satifies selection criteria), but when generate message (print outputs) for selected line items It will print reminders with all the line items (including the one for which reminders have been generated earlier). What should I do to make only the selected line items are printed in the reminders (instead of old one's).
    Example
    I have PO 4500000030 with two line items 10 and 20. Reminder for line item 10 is already generated at earlier date and now I am generating reminder for item 20 from ME91F. When I run transaction ME91F it displays only line item 20, but after selecting item 20 and click on generate messages (in the spool I am seeing two line items 10 and 20). What should I do to print only line item 20.
    Any thoughts/inputs will be greatly appreciated. Thanks for your time.
    Paul

    Hi
    please check with developer to verify the print program.
    regards
    Srinivas

  • How to Print Multiple line items(only the one's that are selected in va22)

    Hello All ,
    My smartform should print the multiple selected line items that i as a user should be able to see as the output .
    In my case i dont have any program that calls the transaction va22
    directly from the transaction VA22 i give the ISSUE OUTPUT TO .
    The Driver program that calls my smartforms fetches the data from table VBAP .
    Two cases that i get because of this fetching logic .
    1. When i try to fetch the data based on only VBELN in the output i get all the items that are in the particular Quotation .
    2 . When i try to fetch data based on VBELN and POSNR in the ouptut when i select multiple items and give print the first item that i i selected is displayed .
    Now what i need is to print only those data that i select in VA22 .
    say if there are items A, B , C, D ,E  in the Quotation .
    and before printing i select A , C , D then only those items should be printed .
    I hope any one  of the Experts  can solve my problem .
    Thanks & Regards
    Faran

    Hi
    I think you will need to do some enhancemwnt for this. What you can do select the lines in table comtrol and before issuing output you need to find a suitable wnhancement place where you can export the selected lines and make the corresponding change in logic for the same?.
    Secondly uou can make a custom report also where user will select lines of po and print..but in this way you will need to many calculations
    Nabheet

  • Printing multiple line items

    i developed PO smartform.the requirement is that i should be able to display all line items on the entire page of total pages and in the last page after the end of the lineitems ,the secondary windows should be displayed  which are declared below the main window.
    for example the dimensions of
    main window : LM  0.5 cm   width 19 cm
                         UM  7 cm      height 7cm
    secondary window :LM  0.5 cm   width 10 cm
                                UM  14 cm      height 19cm and there are
    some secondary windows below the mainwindow.
    i gave the option 'after  the end of mainwindow' for all the secondary windows below mainwindow. i increased the mainwindow height to full page length so that if there are 30 lineitems,most of the line items will be displayed in the first page and remaining  items will be in the second page and below that secondary windows will come as per dimensions.but the problem is if any line items gets end after crossing the upper margin of secondary window,secondary windows are overlapping with lineitems.how can i put a condition like if the line item display exceeds the upper margin of secondary window (ex:14 cm) and ends over there,all the secondary windows should go to next page.please suggest a solution .
    Thanks
    k srinivas

    Hi,
    Its very difficult to explain the logic over here . Insted give me your ID i will send you the smartform which I have developed long back . It has the same functionality.
    Regards,
    Nageswar

  • Multiple Line item proposal in SAP based on return reason for Material Serv

    Hi,
    I have a requirement in which the customer returns the faulty material for repair, the company does the inspection of the material and sends the faulty material to the External vendors for Repairing.
    External Vendor after repairing sends the material back to the company, which is then returned back to the customer.
    I want to understand , is it possible in SAP to have a sales document created with different line items (One for the material returned from the customer, one for the Material to be send to the external vendor for repairing , and one for the material to be returned back to customer after repairing)
    Is it possible to have this proposal automatically based on return reason in SAP ?
    Kindly Advise.
    Regards,
    Harsh

    Hi Harsh,
    I think you are trying to amalgamate 3 processes which is quite ambitious by all means :). However in my past experience we have been able to track these articles but playing around using the standards. Customer return was a process through which an article was brought in a seperate storage location for repair and was sent out for repair using sub contracting process, after repair it was again sent out to the customer with the sales process. Of course there were quite a few physical processes that were needed to support this. We started to think but than refrained ourselves from using batches and serial numbers for this.
    Regards
    Kaizad

  • Prob with putting text after the Schedule line item in PO Sap script

    Hi Guys,
    I need to include a Text afetr the first schedule line item and that shouldn't print after next onwards, can anyone help me out.
    Thanks,
    Ramesh

    two things
    in this
    activate debugger and check whether the field
    &EKET-J_3ASIZE& is eq ' ' or not
    only then it will come in to else condition
    if its coming into else case check whether &T166P-TXNAM& is getting populated or not
    if it doesnt u need to go to item_text
    define a variable and move the value of &T166P-TXNAM&
    define &TEXT& = &T166P-TXNAM&
    and then
    in item_schedule
    iNCLUDE <b>&TEXT &</b> OBJECT &T166P-TDOBJECT& ID &T166P-TDID& LANGUAGE &EKKO-SPRAS& PARAGRAPH IX
    i think this will resolve the issue.
    Harish
    reward if its useful

  • Unable to print BSEG-SGTXT in Main window - SAP Script

    Hi
    I have an issue in Scripts.
    I want to print BSEG-SGTXT in my Main Window and below is my code but i am unable to print the text. while debugging, i am getting value in zsgtxt field, but i am unable to get/print in script.
    can any one help me why it's not printing? and plese suggest where it's wrong.
    In Main window:
    /:   PERFORM TEXT IN PROGRAM ZFIGS_CHECK_PRINTING     
    /:   USING &REGUP-BELNR&                              
    /:   CHANGING &ZSGTXT&                                
    /:   ENDPERFORM                                       
    CH   &ZSGTXT&           
    In Subroutine pool:
    FORM text TABLES intab STRUCTURE itcsy
                             outtab STRUCTURE itcsy.
      DATA: zbelnr(10),
            zsgtxt LIKE bseg-sgtxt.
      READ TABLE intab WITH KEY name = 'REGUP-BELNR' .
      IF sy-subrc = 0.
        MOVE intab-value TO zbelnr.
        SELECT SINGLE sgtxt INTO zsgtxt FROM bseg
              WHERE bukrs = '8140' AND
                    belnr = zbelnr.
        IF sy-subrc = 0.
          MOVE zsgtxt TO outtab-value.
          MODIFY outtab INDEX sy-tabix.
        ENDIF.
      ENDIF.
    ENDFORM.
    Thanks,
    Siva

    Hi,
    Can any one tell how to write loop statement in Main window to display BSEG-SGTXT. As i am getting text (BSEG-SGTXT) from subroutine pool and calling into Main window using Perform statement and printing duplicate text in multiple times insted of different text.
    Thanks,
    Siva

  • SAP Script Check printing Layout, Line Items to display twice in First Page

    Hi All,
    This requirement is for US check printing Layout.
    My Requirement is to display Items twice on the first page.
    Eg : Main Window has 10 Items, I need to display all the Items at the bottom in another window at the bottom.
    I can't create 2 Main windows in the first page, as the data from the Main window 1 overflows to Main window 2 in the first page.
    I copied print program RFFOUS_C into a Z-version and try to implement the logic, however unable to print the line items in the bottom window.
    Kindly give your valuable Inputs.
    Thanks
    Vinayak

    Hi
    I had the same request for a check form in Canada. I solved it by writing the line item output into variables and print these variables in a second window. It was ~10 hours of effort, not a real nice technical solution but it worked.
    If you require I can send you a PDF of the sap script form definition. You can contact me at [email protected] Answers can take 1 week or more. 
    Best regards
    JD

  • 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á

  • Create ecatt script for one sales order creation with multiple line items

    Hi ,
    I want to create a ecatt script for one sales order creation with multiple line items. Preferably SAP GUI.
    This selection of data will be from an external file/ variants which will have only one row of data in it.
    Firstly: I have to sort the external file having same PO Numbers in an order.Group them together.
    Second: I have to create sales order for those many line items having same PO Number.
    Best Regard
    Taranum

    Hi Micky
    Firstl you should upload the Line items for a particular sales Order in an Internal table
    and then pass that internal table to your BAPI during your coding corresponding to a particu;lar sales order
    In case of any issues pls revert back
    Reward points if helpful
    Regards
    Hitesh

  • Printing of return delivery of multiple line items

    Dear All,
    I have a requirment to print return delivery material document with multiple line items of a PO. I tried with collectve slip in MIGO. but still line item will come in different pages. Message details are maintained for all line items. Print preview is seen from MB90.  please suggest me to achieve this requirement.
    Regards
    MSR

    Hi MSR,
    Contact ur ABAPer and ask him to adjust the Sapscript Form / SMART Form.
    Regards
    Ramesh Ch

  • Reg: Printing multiple lines of line item in a smartform?

    Hi Experts,
    I have a query regarding printing multliple line items in a smartform. In this form i dont have control on the font size because the client is using some generic type format to print the data in EPSON LQ 590.
    Here this generic type drivers, it has his own default font.
    If i print using the normal EPSON LQ 590 drivers, alignment is perfectly fine. But in generic case its totally different.
    My query is in my item row there are 7 columns. If one of the column exceeds the space which i have assigned for that particular cell, it should go to next line automatically. How should i do this?
    Then there should be a line space between 2 rows of data.  How should i do this?
    Please help me on this.
    Another query is date is getting displayed as 19.07.2009, due to the space problem in that particular cell i need to display as 19.07.09. Please tell me how should i do this also?
    Waiting for the reply.
    Thanks and Regards,
    Abdur Rafique

    Use smartstyles for the same to mke sure it goes into next line. Also you can set space between 2 lrows to one line.
    For the date issue..use the following piece of code...
    DATA: w_date TYPE sy-datum,
                w_char TYPE char8.
    CONCATENATE w_date+6(2) w_date+4(2) w_date+2(2) INTO w_char SEPERATE BY '.'.

  • Unable to create PO with multiple line items through LSMW-BAPI method

    Hi All,
    I have a requirement of creating PO through LSMW. I can't use LSMW standard batch input program since there are some fileds not available and also it has many limitations. I'm using LSMW-BAPI method ( Business object BUS2012) which create IDOC and uses BAPI_PO_CREATE1 to ultimately post the PO in the system. I am trying to create PO from a single file which contains both Header and Item data.
    Now my problem is that everytime PO is being created with Single line item only. Everytime I am giving multiple item data in the source file LSMW is preparing multiple IDOCs for multiple line items. As per my understanding this is happenng since header and item is in the same hierarchy level of IDOC type PORDCR102 and the control record is inserted for every line item in the source file.
    It seems that through LSMW-BAPI  it is not possible to create PO with multiple line items. Can anybody provide some input regarding this? Thanks in advance.
    BR,
    Atanu Mukherjee

    Solved by myself.
    Earlier the problem was that LSMW was not being able to recognize items under same header. It was creating new IDOCs every time it gets a new item. To enable this we need to create two structure HEADERDATA and ITEMDATA.  Two additional identifier fields with identifier value 'H' and 'I' should be added in these two structures respectively. Then we need one sequential file with the identifiers field followed by the header and Item data. Example:
    H~header data
    I~item data
    I~item data 
    This would help the standard program to understand what are the items under same header and ultimately create PO with multiple line items.
    BR,
    Atanu Mukherjee

Maybe you are looking for