Customizing Sap Script ????

I am customizing predefined form MEDRUCK and making the 3 forms ZMEDRUCK1,ZMEDRUCK2,ZMEDRUCK3 each form i am adding different fields which are not available in the predefined form.
I am using predefined print program SAPFM06P i dont want to change the predefined program, where should i write the logic for the added fields.
Thanking in advance.,
Ravi

Hi Ravi,
CALL a PERFORM - ENDFORM from sap script and define a subroutine pool to write your own logic.
Check the links
http://www.sapdevelopment.co.uk/sapscript/sapscript_executeabap.htm
The code will be something similar.
REPORT YLSD999A.
DATA  W_LENGTH TYPE I.
*   GENERAL PURPOSE SUBROUTINES FOR CALLING FROM SAPSCRIPTS
FORM DISPLAY_POUND TABLES IN_TAB STRUCTURE ITCSY
                          OUT_TAB STRUCTURE ITCSY.
  DATA: COUNT TYPE P VALUE 16.
  DATA: W_VALUE(17) TYPE C.        "defined as 7 chars to remove pence
  DATA: W_CHAR TYPE C.
  DATA: W_DUMMY TYPE C.
  DATA: W_CURR(3) TYPE C.
*    Get first  parameter in input table.
  READ TABLE IN_TAB INDEX 1.
  WRITE IN_TAB-VALUE TO W_VALUE .
* get second parameter in input table
  READ TABLE IN_TAB INDEX 2.
  MOVE IN_TAB-VALUE TO W_CURR.
  IF W_CURR = 'GBP'.
    W_CURR = '£'.
  ENDIF.
  W_LENGTH = STRLEN( W_CURR ).
*    look for first space starting at right.
  WHILE COUNT > -1.
    W_CHAR = W_VALUE+COUNT(1).
*  W_CHAR = IN_TAB-VALUE+COUNT(1).
    IF W_CHAR = ' '.
      COUNT = COUNT - W_LENGTH + 1.
      W_VALUE+COUNT(W_LENGTH) = W_CURR.
      COUNT = -1.
    ELSE.
*     W_VALUE+COUNT(1) = W_CHAR.
      COUNT = COUNT - 1.
    ENDIF.
  ENDWHILE.
* read only parameter in output table
  READ TABLE OUT_TAB INDEX 1.
  OUT_TAB-VALUE = W_VALUE.
  MODIFY OUT_TAB INDEX SY-TABIX.
ENDFORM.
Cheers
VJ
PERFORM ... IN PROGRAM .... USING.. CHANGING ..  
ENDPERFORM
      To call ABAP subroutines from within  a form we use the  
     PERFORM... IN PROGRAM ... statement , the advantage of    
     using it  is that the print program is not required to cahnge and we 
     can get the new data from the subroutine which is placed in a Z  
     report . To pass and get the values from th subroutine the  
     parameters are passed which are of  type structure ITCSY.
     e.g. /:PERFORM get_date IN PROGRAM zreport
            /:USING &SALESORDER&
            /:CHANGING &S_DATE&
            /:ENDPERFORM  
            The date &S_DATE& ....
           The  ABAP Code would be
           REPORT zreport.
           TABLES ztab.
           FORM get_date TABLES in_tab STRUCTURE ITCSY out_tab
           STRUCTURE ITCSY .
           READ TABLE in_tab INDEX 1.
           SELECT some_date FROM ztab WHERE salesorder = in_tab-value.
           IF sy-subrc EQ 0.
           READ TABLE out-tab INDEX 1.
           MOVE ztab-somedate TO out_tab-value
           MODIFY out_tab INDEX 1.
           ENDIF.
           ENDFORM.
            In the above code USING is used to pass the value to the
          subroutine while changing is used to recieve the value from th
          subroutine ,for further paramters we can use either USING or
           CHANGING .
           In the subroutine the type of paramter is always an internal table of
           type ITCSY  irrespective of the value passed.The VALUE field
           of the internal table is used to fill and recieve the values   .     
Message was edited by: Vijayendra  Rao

Similar Messages

  • RED light in Output determination in VA02 for Custom SAP Script

    Hi,
    Am trying to get Order Acknowledgement output from VA02 as a preview. We have custom Script, custom print prog. So, I went to VA02>Extras>Output>Header>Output.....but, here am seeing the associated OUTPUT TYPE ZB00 as RED light!!
    So, pls. let me know that,
    1 - Why am gettign RED light? Wht culd b the reasons?
    2 - How to fix it to get it GREEN?

    Hi,
    Did you try debugging the print program? Also check the output determination analysis.
    Follow below path. Once you are in outputs edit screen...
    Select your output, menu=>Goto=>Determination analysis(or ctrl+f1).
    Here you can see what went right and wrong for all the outputs allowed for that order. You can see there might be some routines which has not been satidfied. Check this analysis for your output and see what is wrong.
    Condition records might also be missing. Check with your functional for this.
    Thanks,
    Vinod.

  • Missing fields in the output while using SAP SCRIPT

    Hi,
    I am working on an issue where we are using F110 to print some checks, and for this we have created a custom sap script and we are using a std driver program RFFOUS_C, we have also maintianed a custom subroutine pool ZRFFOUS which will retrieve the missing data for the sap script which was not there in the std. program. Now we have applied a SP to our system and since then we are having a problem...when we are printing the chechks its missing some fields.
    Surpisingly, it is happening for all scripts like Dunning, invoice......
    These scripts are working good in production which is not applied patches.
    I have tried in all ways, did debug, data is there in tables and scripts are exactly same as in production.
    Could you please share any ideas regarding this? What would be the effect of patches?
    Thanks
    Sha

    Hi ,
    I think u r printing the Check through the Tr Code F110.
    In that program u r using the Standard Driver Program RFFOUS_C and u create a New Sap script.
    and also u also mantained the custom subroutine pool ZRFFOUS .  when ru giving printing u are  not able to print some  field.
    In this case  when u using the Standard driver Program RFFOUS_C in that program there is a Include Progran  * RFFORI01---- check  , 
    in this program it is calling the Standard Form (F110PRENUM_CHCK) i--e t042e-zforn .as shown in the below and it is calling the function module 'OPEN_FORM'._
    Please copy  the form  asZF110_PRENUM_CHCK and  and do the changes in that form . and we need to maintained the Form as Company code level  -- and it will shown this Table T042E (Company Code-Specific Specifications for Payment Methods)
    Please go to Transaction Code FBZP  and U can maitained the  New Sap Script Form Company Code Level.
    one thing while u calling your new subroutine pool ZRFFOUS  Please call  this subroutine in  your Sap Script form then only u can see all values in your Check.  and Actvate the Sap script .
    Like U can call your new  subroutine ZRFFOUS  in your New Sap script Program.
    /E   CHECK
    /:   PERFORM XXXXXXX IN PROGRAM XXXXXX''                  
    /:   PERFORM CHECK_NAME IN PROGRAM  ZRFFOUS
    /:   USING &XXXXXXX&                      
    /:   CHANGING &XXXXXX&                   
    /:   ENDPERFORM                              
    In the subroutine pool ZRFFOUS   u have to call  as
    FORM CHECK_NAME TABLES t_data_in  STRUCTURE itcsy
                                                   t_data_out STRUCTURE itcsy.
    xxxxx
    xxxxx
    xxxxx
    ENDFORM.
    In this case  when u using the Standard driver Program RFFOUS_C in that program there is a Include Progran  * RFFORI01---- check  , 
    in this program it is calling the Standard Form (F110_PRENUM_CHCK) i--e t042e-zforn .
        open check form
          CALL FUNCTION 'OPEN_FORM'
               EXPORTING
                    form     =  t042e-zforn
                    device   = 'PRINTER'
                    language = t001-spras
                    options  = itcpo
                    dialog   = space
               EXCEPTIONS
                    form     = 1.
          IF sy-subrc EQ 1.                "abend:
            IF sy-batch EQ space.          "form is not active
              MESSAGE a069 WITH t042e-zforn.
            ELSE.
              MESSAGE s069 WITH t042e-zforn.
              MESSAGE s094.
              STOP.
            ENDIF.
          ENDIF.
    I thing it will help u to solve this issue.
    Thanks.
    Gagan

  • Image in sap script

    HI experts ,
    I am doing modification to customized sap script which is done by previous abaper.
    There is a image had been attached in a window like this :
    BITMAP &Z_SIGN1& OBJECT GRAPHICS ID BMAP TYPE BCOL DPI 150
    But when i searched in se78 i dont find Z_SIGN1.
    Do you experts why there is a image Z_SIGN1 in se78.
    But there is a similiar image but with different name DIR01.
    How to find the Z_SIGN1 in sap.
    Please guide me.
    Thank you very much.
    regards,
    s.saravannan

    HI friend,
    Just i m calling the image into the script ..
    The moment i call the image can i change the name of the image.
    is it possible.
    regards,
    mrsara27....

  • Trying to re-size the windows in Z SAP Script!!

    Hello,
    Am looking  to do some modifications to the custom SAP Script Layout-set, mainly re-sizing the windows, including the MAIN window.
    So, SE71>Change mode>Graphical Form Paiter checked, then, opened the Windows layout in graphical manner.........but, am unable to edit/move/re-size/modify the sizes of the windows with the help of mouse (pointer) movements!!
    And also am unable to edit the left side dimensions numericals of these windows, bcoz, those (dimensions numericals) fields are GREYED OUT!!
    I also tried by selecting the radio button of PAGE WINDOWS ........here also the dimensions numericals fields are GREYED OUT!!
    So, pls. let me know the options for editing/re-sizing the windows of SAP Script. I prefer to re-size them by changing the dimension numerical digits, instead of graphically changing with mouse pointer.
    Thank you

    logged-off and logged-in.......its worked
    Thank you

  • Debugging Sap Script

    HI all,
    I am working on a SAP Script...this custom SAP SCRIPT is being used for transaction F110...every time we are running this transaction we are missing some data in the checks that are printing and this problem is coming after we applied the Service PAck, now my question is how can I debug ths Sap Script because when activated the debugger in SAP Script and ran transaction F110 and when finally printed the checks it never went or stopped at the SAP Script...the checks are printing fine in the other box where we haven't applied the SP. So basically I want to compare in both the boxes.
    Thanks,
    Rajeev

    Hi ,   
    Programs  executes in printout in F110 .  u can see those programs in  Printout/DataMedium Tab in F110 .  identify the program u r using  for print out and execute it after activating the debugger in sap script .
    Regards
    Neetesh

  • Problem while printing SAP Script

    Hi All,
    I have one scenario, in which I have to copy the Standard SAP Script  form (HR_ALL_FIX) client '000' and import in the development server as custom SAP script(ZHR_ALL_FIX)  and making change in main window the text. Instead of  "Yours Faithfully" text I have changed it to 'Warm Regards'.
    When I try to view the print preview of the script from PP40 tcode,  the output is overlapped.
    Instead of 'warm regards' to be displayed at the end of the page, its being printed in between somewhere.
    No other changes I have made.
    Any inputs and help will be really helpful.
    Thanks in advance

    I am still facing the problem . tried everything. Have only changed the language while copying from DE to EN.
    Also, just creating a Z form without ANY change at all( even the printer used to check print preview is the same)... and attaching it to OOVM transaction and then checking the print preview - TEXT comes randomly (in different order)
    Any help will be really appreciated and rewarded..
    Awaiting help.
    Edited by: HeenaChampaneri on Apr 15, 2010 8:39 AM

  • SAP SCRIPT Header text and Item text not printing in customized PO

    Hello Experts,
                          I have copied the standard MEDRUCK to ZMEDRUCK and customized the form according to the requirement.
    I want to print the header text and Item text in my form.
    For Header text I have used :
    /: INCLUDE &EKKO-EBELN& OBJECT EKKO ID F01
    Problem 1: The text what I enter in header text is flowing only when I hit on print preview without saving the form. Once I save the SAP SCRIPT  and click on print preview the field is appearing blank. I also tried to print the form, but the field is appearing blank even on the print out.
    Problem 2: For item text the field is concatenation of  EBELN & EBELP. Can anyone suggest me how to concatenate and fetch the text in item text.

    Hi,
        Im getting an error in my subroutine pool for i_xtline which is to fetch ITEM TEXT., It says its not a in any internal table nor defined as data. How can I proceed further. I have pasted my code below. Please check and revert ASAP
    PROGRAM  ZMEDRUCK_SUBP1.
    TABLES: EKPO, EKKO.
    FORM fetch_table_data TABLES in_tab STRUCTURE itcsy
                                 out_tab STRUCTURE itcsy.
    data xname like THEAD-TDNAME.
    data i_xtline like xtline.
    clear i_xtline.
    refresh i_xtline.
    CONCATENATE EKPO-ebeln EKPO-ebelp INTO v_item_text.
    MOVE v_item_text to ITEMTXT.
    CALL FUNCTION 'READ_TEXT'
      EXPORTING
      CLIENT                        = SY-MANDT
        id                            = F01
        language                      = EN
        name                          = ITEMTXT
        object                        = EKPO
      ARCHIVE_HANDLE                = 0
      LOCAL_CAT                     = ' '
    IMPORTING
      HEADER                        =
      tables
        lines                         = i_xtline
    EXCEPTIONS
       ID                            = 1
       LANGUAGE                      = 2
       NAME                          = 3
       NOT_FOUND                     = 4
       OBJECT                        = 5
       REFERENCE_CHECK               = 6
      WRONG_ACCESS_TO_ARCHIVE       = 7
      OTHERS                        = 8
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.

  • How To trigger last page in sap script of customer account statement

    Hello all,
    I am working on customer account statement.
    It has it's own standard script(F140_CUS_STAT_02). But my client's requirement was completly diffrent,so i copied that to z script and made some changes like delete some window and some another window.
    Now on first page , i have following windows,
    1) Header
    2) address
    3) main
    4) Account
    5) Footer.
    Next Page having following windows,
    1) Header
    2) Main
    3) account
    4) footer
    Now i want to print account window on lsat page, so i put the condition nextpage = 0.
    and it is working fine , but as account window is physically present after Main window , so that much blak sapge is getting creted after main window on every page.
    To remove that blank space i am thinking of creting one more page and everytime i want display account window on that page.
    I have creted the last page also. but in my output it not detecting that last page.
    For First page - next page is next.
    For Next page - next page is next.
    for Last page- next page is last.
    Also i have added following code at last in  main window.
    /: NEXT-PAGE LAST.
    But i think i am placing this code at incorrect position in main window.
    I am not able to find out the correct podition to put the above code,but main window of that script conataing so namy text element, and that text element are getting handled from driver program based on some conditions.
    I have added my code in main window but not changed the original code.
    Plz let me know where to write /: NEXT-PAGE LAST. in main window.
    Or provide me some another solution to trigger thet last page in sap script.
    Regards,
    Anuja Dhondge

    Hi ,
    actually in account window i have used tha box command to print account statement.
    Previously i was printing this account statement in main window itself but without using bottom and end bottom command.
    So , as i made some changes or add some code in main window then lines of this account statement  were getting dismental.
    So my question is using bottom and end-bottom command this will happen or not????

  • Customer Statement using SAP Script and Standard print program RFKORD10

    Using sap script and standard print program RFKORD10 I need to create a customer statement where the main window will be as follows
    Invoice #     InvoiceDate  CustomerPO  Debit Amt  Credit Amt  Total
        6        7           8               9               10               11
        6        7           8               9               10               11
                                     Totals               12             13              14
    Where company code BKORM-KUKRS
                Invoice              BSID-BELNR
                Invoice date      BSID-BLDAT
                Customer PO    VBKD-BSTKD
    For each document number selected there will be one to many records in VBRP.  For each invoice item in VBRP:
    u2022     Select BSTKD from VBKD where
    o     VBELN = VBRP-VGBEL and
    o     POSNR = VBRP-VGPOS
    u2022     If no hits then select BSTKD from VBKD where
    o     VBELN = VBRP-VGBEL
    If there is more than one PO per invoice then list them in the Customer PO field without repeating the other fields.PO shouldnu2019t come more than once per invoice.
                 Debit Amt         if BSEG-SHKZG = S then WRBTR ELSE 0
                 Credit Amt        if BSEG-SHKZG = H then WRBTR ELSE 0
                 Total                  Debit Amt u2013 Credit Amt
                  Totals                Subtotals
    It will be of great help if some one can help me with the script and the alterations required in standard print program RFKORD10
    Points will b rewarded for sure.
    Thanks.

    Hi Suganya,
    The custom form is getting displayed properly. But the requirement is to have it as an editable PDF. So the functional team is working on configuring the settings of PDF forms with customers email address.
    But for right now, i customized the standard form F140_ACC_STAT_01 and standard print program RFKORD10_PDF and did the configuration. It is getting displayed (I tested only with the transaction FBL5N - customer open line items..)
    Please let me know any further details on this.
    Poornima

  • Invoice SAP SCRIPT is not printing Customer master text.

    I was given a SD-invoice#  XXXXXXXXX, which has problem with in it's SAP SCRIPT --> is the text is taken from  "customer master data head office text" is not printed on the SCRIPT out put.
    1). What I don't understand by going to /nvf03 --> by giving invoice number , then how can I view the script output ?
    The text is supposed to print in footer ...however the coding inthe FOOTER window is
    /:   INCLUDE 'Z_FOOTER_SO_4700_INV' OBJECT TEXT ID ADRS LANGUAGE 'IT'
    So, do I need to add coing for text of customer master data ?
    Any idea about text and field name ?
    THANKS IN ADVANCE.

    Hello,
    To see the output go to /VF03, enter the billing document number but don't press enter. Go to Billing Document in the menu bar, Issue Output to, select a line and do a print preview (if there's nothing there, the doc hasn't been printed before).
    To print the text, ask somebody to navigate to where it is in SAP. Double click on it, choose Got -> Header. This will give you all the information you need for the INCLUDE.
    The INCLUDE statement you have is for a standard text (trans: SO), not the "customer master data head office text".
    Michael
    Edited by: Michael Evershed on Sep 26, 2008 10:41 PM
    Edited by: Michael Evershed on Sep 26, 2008 10:41 PM

  • Replacing customer statement form (T CodeF.27)SAP script with Smartform.

    I have a requirement to automate sending customer statement form which is triggered through T-code: F.27. For this we are trying to replace the SAP script which is triggered from program RFKORD11 with Smartform. We have tried copy the program RFKORD11 to a custom one which assigned to the correspondance type in t-code OB78 and do the modifications, but we could not do so as we are not authorized to copy the program. Can anyone help us in acheiving this functionality. BR, Karthik G.

    Re your question A:
    F140_CUS_STAT_01 and F140_CUS_STAT_02 are SAP standard forms for customer statement.  You can use either one but usually you will create your own (by copying) to add company logo and name, etc.
    If you use program RFKORD11 for customer statement, you specify the form to be used in the "Correspondence" field.

  • To replace SAP script with smartform in customer statement using t-code F.27

    Hi, I have a requirement to replace SAP script while generating a customer statement form using F.27 with Smartform. The standard program which triggers the SAP script is RFKORD11. Can anyone tell me how can we achieve this. Thanks in advance. BR, Karthik.

    Hi
    do you find a solution for your issue? Or did anyone else know how to send raw data instead of the pdf or fixed file from transaction F.61?
    Thanks for any ideas or help
    Axel

  • SAP SCRIPT code problem

    521
    - Heading for trans. w/out sp.G/L indicators (item sorting method 2)-
    Transactions without special G/L indicators
    522
    - Heading for trans. with sp.G/L indicators (item sorting method 2)-
    &T074T-LTEXT&
    523
    - Heading for open item list of line items -
    &ULINE(71)&
    <K>Invoice No,,Reference.,,Inv.Date,,                   Due date,,,,
                 Balance</>
    &ULINE(71)&
    PERFORM GET_DATE IN PROGRAM ZREPORT
    USING &BSID-BELNR&
    CHANGING &S_DATE&
    ENDPERFORM.
                                                                                    530
    - Line items    Customer open items -
    &BSID-BELNR&,,&RF140-BELEGNUM&,,&BSID-BLDAT&,,&S_DATE&,,
    FORM get_date tables
            int_cond structure itcsy
            outt_cond structure itcsy.
    BREAK SNAGI.
    tables : bseg.
    data : w_belnr type ITCSY-value.
    DATA due_date TYPE rfpos-faedt.
    READ TABLE OUTT_COND WITH KEY name = 'S_DATE'.
      IF sy-subrc = 0.
        outt_cond-value = S_itab11.
        MODIFY outt_cond INDEX sy-tabix.
       ENDIF.
    SELECT SINGLE
    shkzg zfbdt zbd1t zbd2t zbd3t rebzg
    FROM bseg
    INTO CORRESPONDING FIELDS OF bseg
    WHERE
    *bukrs = bukrs AND
    belnr = int_cond-value.
    *AND vbeln = belnr.
    CALL FUNCTION 'NET_DUE_DATE_GET'
    EXPORTING
    i_zfbdt = bseg-zfbdt
    i_zbd1t = bseg-zbd1t
    i_zbd2t = bseg-zbd2t
    i_zbd3t = bseg-zbd3t
    i_shkzg = bseg-shkzg
    i_rebzg = bseg-rebzg
    I_KOART = 'D'
    IMPORTING
    e_faedt = due_date.
    outt_cond-value = due_date.
    MODIFY outt_cond INDEX sy-tabix.
    ENDFORM.
    Now the problem is that,it is int_cond-value is always picking up the first invoice number.
    and the net due date is always same for all invoices..?
    should I loop in the sap script or in the form..?

    Solved my self.
    just placing the perform and endform in 530

  • Dunning Notice print/email using both Smartform and SAP-Script

    Hello Gurus,
    I have developed the Customized SAP Sript (Copy of 150_DUNN_01) for Dunning NOtice to be send to Domestic Customer and
    Cutomized Smartform (copy of F150_DUNN_SF) for Foreign Customer.
    Now Issue is that when I assign the Customized script to SPRO setting and standrd setting for BTE '00001720' with function
    module 'FI_PRINT_DUNNING_NOTICE', if I want to assign smartform to SPRO setting then I need to replace same FM with
    'FI_PRINT_DUNNING_NOTICE_SMARTF'.
    how it is possible to work with both SAP-Script and Smartforms for dunning Procedure.
    Please gurus let me help for this solution...
    Thanks in Advance,
    Mahesh Sachani

    Hello Gurus,
    Please reply with any solution available with any...
    Thanks,
    Mahesh

Maybe you are looking for

  • How can I repair 10.6.8 when the disk my computer came with is 10.5.4?

    Ran Verify Disk and received the following message: "This disk needs to be repaired. Start up your computer with another disk (such as your Mac OS X installation disc), and then use Disk Utility to repair this disk." I attempted to do this but while

  • How to calculate Page Size that allows for Trim Marks?

    I have made a Word document in 4.75" x 7' Page Size and the print company is demanding they have Trim Marks so they can cut the document to the precise size. I went to Save As in the Word doc and converted the Word doc to PDF, no problem. Then I foun

  • Major phone problem!!! Please help!

    My iphone was working PERFECTLY today. Tonight, I opened iTunes to sync some new music and had 2 updates available - one was for iTunes, one for iPhone. I docked my phone, installed and ran both updates, and they took FOREVER to run. I was so frustra

  • How to create a new folder within the video folder in media

    Hi, I'm trying to figure out how to create a new folder within the video folder in media. I can easily create new folders within the pictures folder but not in videos.....Why??? Thanks in advance for your help. Message Edited by dany_s on 06-25-2009

  • Adding linkbutton

    Hi, Im tring to add a link button using actionscript but I am unable to add a click function to the link. Here is what I have so far. var addLink:LinkButton = new LinkButton(); addLink.label = "Link"+cnt; addLink.addEventListener("click",clickBack(cn