Question concerning sap script

Hi all experts! I have a question concerning sap script
First some background information:
I’ve created a sap script  that is called from a function module and from an executable program,  when I run the executable program the sap script work fine, but when I run the function module, all the variables in the sap script don’t have value
In the function module the variables are defined in the top include
I don’t know why these variables don’t take his value from the function module
Any ideas?
Thanks in advance.
Message was edited by: Gerardo hernandez

I think that sapscript expects its variables to be in the program which calls the fm <b>by default</b>. When you test via SE37 the framework itself is the calling program and it's unlikely that it will have a variable named kunnr-name1.
To over-ride this default, inside your fm pass the 'options' parameter(type itcpo) to 'open_form' and set the 'tdprogram' value to sy-repid in the function module.
I have tested this in my own environemnt and initially got the same error as you. When I set the tdprogram variable it started working!

Similar Messages

  • Question on SAP Scripts?

    I have the standered text having date and address and information about delivery details.I want to fetch the date separately and put it in the date window and in the same way address and delivery details put it in other windows. is it possible? Plz help me out.
    points will reward for every helpful ans.

    Hi there.
    IF I understood you right, you have stored in one text, three differente kind of information, and you want to split it and print in three different windows. That's it?
    If so, you can do this using PERFORM statement in script. So you can define 3 fields, and in the first window call this perform and populate them. This form will use FM READ_TEXT to separate it for you. Like:
    In script:
    /: DEFINE &DATE& ...
    /: DEFINE &ADDRESS& ...
    /: DEFINE &DETAILS& ...
    /: PERFORM texts IN PROGRAM ZTEXTS
    /: USING &DOC_NUMBER&
    /: CHANGING &DATE&
    /: CHANGING &ADDRESS&
    /: CHANGING &DETAILS&
    /: ENDPERFORM
    Then, create report ZTEXTS, like this:
    REPORT ztexts.
    FORM texts TABLES in_par STRUCTURE itcsy
                     out_par STRUCTURE itcsy.
      DATA: it_text TYPE STANDARD TABLE OF tline.
      DATA: vbeln TYPE vbeln.
      DATA: date TYPE dats.
      READ TABLE in_par WITH KEY name = 'DOC_NUMBER'.
      CHECK sy-subrc = 0.
      vbeln  = in_par-value.
      CALL FUNCTION 'READ_TEXT'
      EXPORTING
        id                      = 'ID'
        language                = 'EN'
        name                    = vbeln
        object                  = 'OBJECT'
      TABLES
        lines                   = it_text
      EXCEPTIONS
        id                      = 1
        language                = 2
        name                    = 3
        not_found               = 4
        object                  = 5
        reference_check         = 6
        wrong_access_to_archive = 7
        OTHERS                  = 8.
    *** here you split the text into your 3 vars ...
      READ TABLE out_par WITH KEY name = 'DATE'.
      CHECK sy-subrc = 0.
      out_par-value = date.
      MODIFY out_par INDEX sy-tabix.
    ENDFORM.
    If you have doubts in perform statement, check this link:
    http://help.sap.com/saphelp_nw70/helpdata/EN/d1/80318f454211d189710000e8322d00/frameset.htm
    Regards.
    Valter Oliveira.

  • Question on SAP-SCRIPT

    i have designed a new script which contains only one page. i am printing payment order information based on the date when the order is created.the payment order and the corresponding data will be printed on a separate page that means the no of pages depends on the no of payment orders. but here the problem is i am getting one additional page which contains all the windows except the main window. can any one suggest a solution.

    Hi,
    I think the problem is you are getting additional page not based on the data which you are fetching.
    Since the other windows are independent of the data you are seeing that.
    May be you can change the interface of the "write_form" and can check, like making the function as "delete".
    Regards,
    Suman

  • A question about SAP script

    Consider a main window, can its width & length be changed/different with first page?

    Most of the time main window in first page will have diffrent position and second page onwards it will have diffrent position .
    one example :
    sales order details - want to print layout form
    requirement will be customer address should be in first page and body will be in first page and next page also.
    first page - we will print customer address and body
    next page onwards we will not print customer address and main window will have more space ,so here we need assign diffrent position.

  • Sap script output type

    Hi experts,
    I have two questions to ask.
      1.I have a question in sap script. Can we create new output types for PO? 
    2. What does it mean when we get error while printing-i.e the following kind of error. If nakp is the output type then the error is NAKP TEXT NOT MAINTAINED.

    Hi everyone,
         I want to print some text in a PO in Japaneese and Korean. Now it is available in print preview but when try to print it it comes garbed.
      Moreover there are two output types NAJP and NAKR. In the list of allowed output types i get output like
    NAJP text not maintained
    NAKR text not maintained.
    Could you tell me why I am getting such an output...

  • Quick SAP Script question New Page Print

    Quick SAP Script question
    I have added a new page to an existing SAP Script BUT only want it to print if a condition is true.
    I need to do this from within the form as the print program is SAP Std.
    Any idea how I can prevent the new page from printing?
    i.e. I need the form NOT to call the new page if the condition is false. Is there a way of forcing an exit or stop from with in the form?

    Hi,
    To trigger a new page, there is script ediotr command NEW-PAGE.
    so find where is that command is triggered and use the below code for trigger it on any specific condition....
    if &condition& = 'True'
    /*  NEW-PAGE
    elseif
    /: NEW-PAGE   
    endif
    so it means if condition is satisfied your new page will not work.. else it will...
    Hope you got it...
    Try this..
    Best luck..
    Regs,
    Lokesh.

  • Sap script main window related question

    hi
    i have a requirement to add a new column to sap script main window picking information from some table
    this new column is C2 and it takes reference from C1
    i ahve below queries
    1) is is better to add a new column to main window and increase and decrease alsl columns width of all columns
    or create a new window below the main window in which this new field will apear
    ie C1 and C2 to appear in this new window
    c1 is already coming in main window it needs to reaper with the new C2 in new window
    my concern is that since main window is only one and it it being called again and again to polultate the data
    how this new window will work will it be able to display the corect data
    whcih is better approach
    2) ASLO the requriement is that the new field should appear only when Reprint is done for the transfer order
    can anyone tell how to catch the reprint option or code from teh program what is defined for reprint option in program and how to catch it and put condtion?
    regards
    Arora

    If you would like to have vertical lines as well inside the frame....
    /:   BOX FRAME 10 TW                                                
    /:   BOX XPOS '1.2'  CM WIDTH 0 TW HEIGHT '12.7' CM FRAME 10 TW     
    /:   BOX XPOS '11.00' CM WIDTH 0 TW HEIGHT '12.7' CM FRAME 10 TW    
    /:   BOX XPOS '15.5' CM WIDTH 0 TW HEIGHT '12.7' CM FRAME 10 TW     
    /:   BOX XPOS '18.4' CM WIDTH 0 TW HEIGHT '12.7' CM FRAME 10 TW     
    Regards,
    Rich Heilman

  • Can send me recent real time sap script interivew question?

    Hi any one plz send me the real time sap script interivew questions... or mail me on [email protected]

    Hi,
    Please check the links,
    http://www.sap-img.com/sapscripts/faq-for-sap-scripts.htm
    FAQ on Scripts
    If this data isn't enough, then you can search for SAP script interview questions in SDN, you get more results.
    Regards,
    Hema.
    Reward points if it is useful.

  • SAP script question

    Hi all,
    I have changed footer page window in the form. But apparantly, the address page window is also changed. I dont know how, though I have not touched the address page window. As a result the whole output report layout is changed. Is there anyway I can get the origianl page windows and have the original form.
    Thanks for the great help.
    Sobhan.

    If you wish to keep a copy of your layout sets in your own hardisk.  You can run this SAP program.  You can keep it as a backup copy and upload it back whenever you need it again.
    RSTXSCRP - SAP Scripts Export/Import
    regards
    vinod

  • Question on form printing in SAP scripts

    Hi,
    I would like to know whether it is possible to print color logos in forms using sap scripts or not ?
    If possible, please provide the steps for uploading a color logo into the form using a sap script.
    Is the color of the logo displayed only in the printout or can it seen in the print preview as well after uploading the logo?
    If anybody has good material on sap scripts, pls mail the same to my email id - [email protected] .
    Thanks & Regards,
    Vijay

    Hi,
    First you have to import the logo into SAP through TCode SE78 (if it is a BMP file) and using program RSTXLDMC (if it is of TIFF file).
    Go to SE78 -> Double click Graphics -> double click BMAP -> then go to Menu Graphic then select Import. Then give the name and description. Then choose whether it should be in colour or black and white. This completes the process of importing the logo into SAPscript.
    Then you can use the name of this object in SCRIPTS .IN Sap script, YOu can include text object(if you have uploaded the image using rstxldmc) or include graphic if you have used se78 in text elements section of the Page windows.
    SAPScripts
    http://esnips.com/doc/1ff9f8e8-0a4c-42a7-8819-6e3ff9e7ab44/sapscripts.pdf
    http://esnips.com/doc/1e487f0c-8009-4ae1-9f9c-c07bd953dbfa/script-command.pdf
    http://esnips.com/doc/64d4eccb-e09b-48e1-9be9-e2818d73f074/faqss.pdf
    http://esnips.com/doc/cb7e39b4-3161-437f-bfc6-21e6a50e1b39/sscript.pdf
    http://esnips.com/doc/fced4d36-ba52-4df9-ab35-b3d194830bbf/symbols-in-scripts.pdf
    http://esnips.com/doc/b57e8989-ccf0-40d0-8992-8183be831030/sapscript-how-to-calculate-totals-and-subtotals.htm
    SAP SCRIPT FIELDS
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/d1/8033ea454211d189710000e8322d00/content.htm
    scripts easy material
    http://www.allsaplinks.com/sap_script_made_easy.html
    http://www.sappoint.com/abap/ssintro.pdf
    http://www.sappoint.com/abap/sscript.pdf
    http://www.sappoint.com/abap/sscript.pdf
    http://www.sappoint.com/abap/lsetssap.pdf
    http://www.sappoint.com/abap/sscrtpex1.pdf
    http://www.sap-img.com/sapscripts.htm
    http://www.thespot4sap.com/Articles/SAPscript_Introduction.asp
    http://www.sapbrain.com/TUTORIALS/TECHNICAL/SAPSCRIPTS_tutorial.html
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCRPROG/BCSRVSCRPROG.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCRRDI/BCSRVSCRRDI.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCREDIT/BCSRVSCREDIT.pdf
    http://www.sappoint.com/abap/sscrtpex1.pdf
    http://www.sap-img.com/sapscripts.htm
    http://www.esnips.com/doc/1ff9f8e8-0a4c-42a7-8819-6e3ff9e7ab44/sapscripts.pdf
    Other Links
    http://www.virtuosollc.com/PDF/Get_Reporter.pdf
    http://help.sap.com/saphelp_47x200/helpdata/en/da/6ada3889432f48e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/66/bc7d2543c211d182b30000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/5b/d22cee43c611d182b30000e829fbfe/frameset.htm
    http://www.virtuosollc.com/PDF/Get_Reporter.pdf
    http://help.sap.com/saphelp_47x200/helpdata/en/da/6ada3889432f48e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/66/bc7d2543c211d182b30000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/5b/d22cee43c611d182b30000e829fbfe/frameset.htm
    http://www.thespot4sap.com/Articles/Code_CostCentreReport.asp
    http://www.allsaplinks.com/dialog_programming.html
    http://help.sap.com/saphelp_webas630/helpdata/en/9f/db9cdc35c111d1829f0000e829fbfe/frameset.htm
    http://www.allsaplinks.com/files/using_table_in_screen.pdf
    http://www.geocities.com/ZSAPcHAT
    Regards,
    Priyanka.

  • Sap script question - char format

    Hi,
    What is the use of Selection checkbox available in character format of sap script?
    What willl happen if we check or uncheck that?
    Appreciate your suggestions.
    Regards,
    Guru

    its not like that gurus......
    c if u tick that check box in the top there is a field called mark
    it will ON ......the marker is used
    Character string attribute: marker
    This character string attribute allows search keys to be specified in
    the information within the angled brackets of the character string. In
    the output format created by SAPscript, the search key is entered
    explicitly when such a character string occurs.
    Example: The character string "MK" is used for marking (the marking
    attribute is set). The search keys are then entered in the text editor
    as follows:
    This is a <MK:KEY1234>Search key</>
    The word "Search key" is therefore marked with "KEY1234".
    Marking keys may not be more than 50 characters long. The characters " "
    (blank), "=", and ";" are not allowed in the key.
    if it is usefull....Plz Rewards
    Regards
    Anbu

  • Question on Printing SAP Script

    Hi Group,
    I have an urgency in printing a SAPScript. I would like to know how to change the printer settings to hold the page of a particular size for printing.
    Please let me know the procedure to achieve this and also the transaction(s) relating to this configuration.
    My requirement:
    I want to create some settings to a SAP Script page and I want to use the same configuration (of the page) while running the driver program.
    My Issue is:
    I have a page(SAP Script) in which I want to print exactly 3 cheques for the page.
    But, currently, I am able to get only one cheque getting printed and remaining 2/3 of the page is getting wasted. So I want to do the configuration accordingly to achieve my task.
    Please let me know your valuable inputs.
    Thanks & Regards,
    Vishnu.

    We don't include the audit trail content in the specification print out.   I recommend using a BI Publisher contextual report that you can launch from the specification.  You can learn more about custom reporting in the extensibility pack reporting guide.

  • In SAP Scripts MAIN procesed first?

    Hi Experts,
    I hv a small doubts in SAP Scripts, they r,
    1- In SAP Scripts the MAIN window is procesed very first all over the SAP Script?
    2- To debug the script, after activating the debugger in Script, Shall I go & debug the Print prog step by step or just run the Transaction, e.g.
    say ME23?
    ThanQ.

    Hi Srinivas,
       The order in which the windows are triggered is determined by the print program.
    The print program will call the WRITE_FORM function modules which will trigger the windiw that is passed to it.
    You can see the example print program:
    RSTXEXP1
    The fm WRITE_FORM is called multiple times, and different windows get triggered as and when the control comes to the Function module.
    And regarding your second question, in general you cannot run the print programs as stand alone(most cases) as the would not have and executable code outside the form-endform .So, to test the script, you must run the transaction after your activate the script debugging.
    Regards,
    Ravi

  • Need to convert a SAP Script to Smart Form

    Hello,
    I need to convert a SAP script to a Smart form.
    I am aware of converting it but have a question abt print program?
    Can the print program which is currently attached to the SAP script supprot the Smart form?
    Could some one let me know if i can use the same program or need to do some modifications in it?
    Pointa rewareded if useful.
    Thanks,
    Krishna

    hi
    t-code smartforms
    utilities->migrate sapscript
    check the link below it provides steps to convert sap scripts to smartforms
    http://www.ficoexpertonline.com/downloads/Iyer_SmartForms.pdf
    Check these threads.
    Smartforms -> sapscript
    Re: Convert SapScript to Smartforms ?
    regards.
    Kiran Sure

  • Hi SAP FI/CO GURUS ...... PLEASE GIVE ME INTERVIEW QUESTIONS ON SAP FI/CO

    Hi FI/CO gurus
    I require your great help to get my brother into SAP House. He had done his FI/CO training and he is trying as fresher into SAP. So i request you to please give me interview questions on SAP FI/CO in topic wise. The reason i am asking here in this forum is, a lot of gurus who are having great experience are there in this group. if i get help from these gurus, that will be great help to my brother into get into SAP FI/CO.
    So i request you to please send me interview questions on SAP FI and CO in topic wise. Awaiting for your reply.
    Regards
    Raj

    Hi,
    Please find below few questions on FI. I think those are very useful for intervew
    SAF FI Technical Interview Questions 1
    1. Tell me about FI Organizational structure?
    Ans:     Client
                   |
          Operating Concern
                   |
    Controlling area1       Controlling Area 2
             |
    Co. Code 1 Co. Code 2
        |
    Bus area 1  Bus area2  Bus Area3  Bus Area 4
    2. How many Normal and Special periods will be there in fiscal year, why do u use special periods?
    Ans: 12 Normal posting period and 4 special periods are in the fiscal year which can be used for posting tax and audit adjustments to a closed fiscal year.
    3.Where do you open and close periods?
    Ans: PPV is used to open and close the periods based on a/c types considering GL Accounts. Tr. Code. OB52.
    4.What do you enter in Company code Global settings?
    Ans: 4 digit Alphanumeric key.
    Name of the company
    City
    Country
    Currency
    Language
    Address
    5.What is document type, and what does it control? Examples.
    Ans: Document type is nothing vouchers containing line items. Several business transac! tions can be identified within a particular document type.
    It controls the document number ranges.
    It controls the Header part of document
    IT controls the line item level of the document
    Helps filing of physical document 
    6. What is posting key and what does it control?
    Ans: These are special classification keys. Two character numerical key it controls the entry of line items.
    Posting key determines Account type, Debit/credit posting, Field status of transaction.
    7. What is field status group, what does it control? 
    Ans: FSG is mandatory field in ! GL Creation. You use this field to define which fields are displayed when you post business transactions to a G/L account. 
    A field may have one of the following statuses.
    - Suppressed
    - Display
    - Optional
    - Required
    8. What is chart of account and how many charts of accounts can be assigned to a company?
    Ans: Chart of account is a list of all G/L accounts used by one or several company codes.
    For each G/L account, the chart of accounts contains the account number, account name, and the information that controls how an account functions and how a G/L account is created in a Company code.
    You have to assign a chart of accounts to each company code. This chart of accounts is the Operating chart of accounts and is used for the daily postings in this company code.
    You have the following options when using multiple company codes.
    You can use the same chart of accounts for all company codes
    If the company codes all have the same requirements for the chart of accounts set up, assign all of the individual company codes to the same chart of accounts. This could be the case if all company codes are in the same country.
    In addition to the operating chart of accounts, you can use two additional charts of accounts If the individual company codes need different charts of accounts, you can assign up to two charts of accounts in addition to the operating chart of accounts. This could be the case if company codes lie in multiple countries.
    The use of different charts of accounts has no effect on the balance sheet and profit and loss statement. When creating the balance sheet or the profit and loss statement, you can choose whether to balance the co! mpany codes which use different charts of accounts together or separately.
    9. What does definition of a chart of account contains?
    Ans: chart of account key
    Name
    Maintenance language
    Length of the GL Account Number
    Controlling Integration
    Group chart of accounts (Consolidation)
    Block Indicator
    10. Can one COA be assigned to several companies?
    Ans: yes. One COA can be assigned to several companies.
    11) What is account group and what does it control? 
    Ans: Account group determines which fields you can configure on the G/L master record. It is necessary to have at least two one for B/S and another one for P&L a/c.
    It controls the Number ranges of GL A/C.
    The status of fields of the master record of GL belongs to company code area.
    12) What is reconciliation account; can you directly enter documents in that a/c?
    Ans: When you p! ost items to a subsidiary ledger, the system automatically posts the same data to the general ledger. Each subsidiary ledger has one or more reconciliation accounts in the general ledger. 
    We can’t use reconciliation account for direct postings.
    13) How do you control field status of GL master records and from where do you control! 
    Ans: Field status variant is maintained all FSGs.
    14) What are the segments of GL master record?
    Ans:
    - COA Segment
    A/C group
    Nature of account
    Short text
    GL a/c long text
    Trading partner
    Group Account Number
    -  Company code segment
    Account currency
    Tax
    Reconciliation a/c for a/c type
    OIM,LID,FSG.
    15) What does Field status group assigned to a GL master record controls?
    Ans: It controls the account assignments that are made to the account. Specifically the field status group controls whether postings to cost centers, internal orders, profitability segments and so on are required, not allowed (suppressed), or optional.
    16) What is Country and operational chart of account? Why do you use group chart of account?
    Ans: Operational chart of account – Day to day activities It is mandatory.
    Country COA – It’s used for legal specific requirement of each country. It’s additional and optional.
    Group COA used for consolidation of Company codes. This is for group consolidation purpose.
    17) What are all the segments in a Customer/Vendor master record?
    Ans: Segments in Customer           Segments in Vendor
    -      General Data segment            General data segment
    -      Company code segment         Company code segment
    -      Sales area segment                 Purchasing organization Segment
    18) What is open line item management? What do you mean by clearing open line items?
    Ans: Open item management is further reconciliation function. OIM allows you to display the open and cleared items and amounts in an account. OIM should be used if an offsetting entry is made for every line item posted in the account. The a/c is reconciled and cleared against another account. Ex. Salary clearing account and GR/IR Clearing account.
    19) What is residual payment and part payment?
    Ans: Residual payment it clears original invoice with incoming amount and create new line item for remaining outstanding amount.
    Partial payment it leaves the original invoice amount and creates new
    line item for incoming amount.
    20) What is internal and external number ranges?
    Ans: Internal Number Ranges: Doc. No will be provided by the system automatically in serial order allotting the next available progressive number. The number must be in numerical.
    External Number ranges: Doc. No will be given manually by the end user. System will not lock no automatically in this case. User can pick the number randomly. Number may be an alpha numeric.

Maybe you are looking for

  • Animated GIF's as Wallpaper

    I have tried to use several animated gif images as wallpaper on my Nokia 5610, but none of them will animate, only the first frame shows (no cycling of frames). Are animated gif's not supported by the nokia 5610? Is there an option I need to turn on?

  • Error while releasing the Invoice to accounts

    Hi friends, while I am releasing the Invoice to accounts I am getting the following error. " The maximum number of items for an FI document ('999') has been             exceeded. " I know why this error is coming. can anyone tell me the solution for

  • How do I reinstall Adobe Photoshop CS4 - I receive error 6 stating that licensing for this product has stopped working.

    I previously installed Adobe Photoshop CS4 on my Macbook Pro. My hard drive crashed, and I had to get a new hard drive replaced. Now upon trying to reinstall CS4 from a backup copy CD (with licensing, serial number available), I receive an error 6 st

  • Manual Backup Details

    Hello, I got some problems with Windows and Bootcamp, and now I want to manual backup my Macintosh HD hard drive. My question: What exactly files should I copy/paste for these fonctions: 1.Safari bookmarks 2.Stickies That's it, I hope I am not forget

  • Change database name - Crystal10 and Visual Studio 2005

    <p>Hi there,</p> <p> I have about 150 crystal reports in my development environment. I need to move them into the testing environment. Every environment has its own database and every database is names '[client name]_[environment]' so I get things li