Sap Script Queries

Hi Experts,
I need to print Long Text maintained for a record in sap.
I have the Text ID and Text Object but don't know about the Text Name
and I have to print this Long Text in my SAP SCRIPT to be shown on the Form and i am not doing changes in standard print program instead using the subroutine pool.
Please tell me in Detail how can i achieve this.
And one more query, i also have to print Digital signature for a document.
Please tell me in Detail how can i get the details for a Digital signature (for a particular record) and get them printed in SAP Script.
Thanks

Hi,
data: T_TEXT like tline occurs 0 with header line.
  IF NOT thead_011 IS INITIAL.
    CALL FUNCTION 'READ_TEXT'
      EXPORTING
        id                      = thead_011-tdid
        language                = thead_011-tdspras
        name                    = thead_011-tdname
        object                  = thead_011-tdobject
      TABLES
        lines                   = T_TEXT
      EXCEPTIONS
        id                      = 1
        language                = 2
        name                    = 3
        not_found               = 4
        object                  = 5
        reference_check         = 6
        wrong_access_to_archive = 7
        OTHERS                  = 8.
T_TEXT is an internal table and contains the all the text which is there in ur transaction.
now, u Loop the table T_TEXT and call WRITE_FORM fm in the loop.
LOOP AT t_text.
  call function 'WRITE_FORM'
    EXPORTING
       element = 'TEXT'.
ENDLOOP.
now u call the element 'TEXT' in ur form, and print &T_TEXT-TDLINE& in that element..
so it will print all the lines in T_TEXT table.
In Script:
eg: 
/E  TEXT
P1 &T_TEXT-TDLINE&
Hope it helps
Rgds,
Pavan

Similar Messages

  • Queries of SAP Script

    Hi Freinds,
    Can You Please tell me what is the purpose  of 'DEFINE' 'CHANGING' and 'USING' in sap script text.
    Why we use perform statement in sap script  text.
    Thanks in advance.

    Hi Amar,
    'DEFINE' is used to declare variables and assigning values to it.
    Ex: DEFINE &VAR1& = 'ABC'.
          DEFINE &VAR2& = SPACE.
    USING and CHANGING is a part of PERFORM.
    PERFORM is basically used to call a FORM which could be written in a subroutine pool. A subroutine pool is needed to fetch the data or performing commands such as 'LOOP-ENDLOOP' as script is not capable of handling it.
    Thus to pass values to the FORM from PERFORM we use 'USING' and to retrive the values(the calulated one) from FORM back to PERFORM we use 'CHANGING'.
    EX. DEFINE &VAR1& = '5'
          DEFINE &VAR2& = '4'.
    PERFORM 'SUB_CALCULATE' IN PROGRAM 'Z_ADD'
    USING &VAR1&
    USING &VAR2&
    CHANGING &SUM&.
    Here 'SUB_CALCULATE' is PERFORM name
           'Z_ADD' is SUBROUTINE POOL name
    Now values '5' and '4' will be paased to subroutine and logic for their sum will be written in that and it will return the value '9' to 'SUM'.
    Syntax for 'FORM' will be:
    FORM sub_calculate  TABLES:input_sum STRUCTURE itcsy
                               output_sum STRUCTURE itcsy.
    Reward points if helpful.

  • In SAP Scripts  /,  /=,  (BLANK)?

    Hi Experts,
    In SAP Scripts we use,
    1) / means LINE FEED,
    2) /= mean EXTENDED LINE ,
    3) (BLANK) mean CONTINUOUS TEXT.
    So, can u explain pls. with an example?
    ThanQ.

    Hi Srinivas,
    Let me share my ideas with you.
    / means LINE FEED: It means suppose if u want blank line betweeen 2 lines then u mention / between those.
    e.g A3  &----
         A3  &----
    /= mean EXTENDED LINE :
      This is for extended lines means suppose u mention one variable in one line and give tabs then ifu mention another varialble then automatically that variable will adjust the next line with this command
    e.g.  S1  &scsy-datum&,,,,,,,,,,,,,,,,,,,,,,,,,,
            /=      &itab-name1&.
    It menas in the output date and name1 will be displayed in the same row.
    (BLANK) mean CONTINUOUS TEXT:
        Suppose u r writing the body of the script menas it is cintineous text. automatically it will adjust wiht the blank.
    Hope this helps you. reply for queries.
    Regards,
    Kumar.

  • Creation of New Page in SAP Script

    Hi Experts,
    Please advice when will a new page trigger in SAP Script :
    As per my requirement I need to create a new page for an existing layout and make changes to the second page alone...
    but this page should be triggered only for a specific condition. Is it possible to trigger second page when it satisfies certain conditon?
    I have searched SDN regarding the same but most of them have recommended to use NEW-PAGE...but as per my understanding NEW-PAGE is used when certain data needs to be printed on the next page ( not on the new page ).
    Thanks
    Karthik.R

    Ok friend,
    Try using the conditions in your driver program using 'CONTROL_FORM' function module. or using some other condition in it.
    You can also give conditions in text editors and you can trigger the pages.
    i think these links will help you in solving your solution just check these Link: [new page based on condition in sap script|new page based on condition in sap script; this is just an hint from this you can develop the idea.
    Link: [Breaks in Smartforms|LAST PAGE FOR SAP SCRIPT;.
    Also there are other few related links in SDN which will help you.
    I think this must solve your issue if you still face any queries please revert back to me i will help you.
    Thanks,
    Sri Hari

  • If i got incorrect characters in the output of sap script? HOW TO CORRECT I

    If i got incorrect characters in the output of sap script? HOW TO CORRECT IT?

    Hi Sunil,
    Debug the script and check where exactly those are getting populated. Definately you will get it. Check the conversion parts means character to numeric conversion.
    If your version is 4.7E then select unicode check box in the reports attributes. It will display the error message so that we can solve very easily.Hope this helps you, reply for queries, Shall post you the updates.
    Regards. 
    Kumar. .

  • 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

  • Query Regarding SAP SCRIPT

    I have a normal report output with a field "HIDE" to make it interactive. When clicked on any of the values of this field(s), the value (say VBELN) has to be passed to SAP SCRIPT and all the SELECT QUERIES needs to be written in SAP SCRIPT to get the desired output.
    How do i get this feature?

    hi
    U have to call perform in SAP script '/:'.
    In that u have to pass parameter and get(changing) parameter.
    FORM get_value  TABLES  inpar  STRUCTURE itcsy
                                    outpar STRUCTURE itcsy.
    u have to read value from inpar and append value in outpar into the form.
    Hope thiw will be useful.
    regards
    vinod

  • If Statement in SAP Scripts

    Hi All,
    I have written the below If statement in  SAP scripts but when i execute the same the controll doent check the second line entries. If firtst line doesnot satisfy it goes to the else part. Kindly suggest what is wrong in this..
    /:           IF &T156T-BWART& = '321' OR &T156T-BWART& = '322' OR
    /:           &T156T-BWART& = '349' OR &T156T-BWART& = '350' OR
    /:           &T156T-BWART& = '312' OR &T156T-BWART& = '326' OR
    /:           &T156T-BWART& = '343' OR &T156T-BWART& = '344'.
    /:           ELSE
    /:           ENDIF.

    Hi neha,
    Try to use the '/E' fo rnext line
    /E->Extended line
    Here is a code:
    /: IF &T156T-BWART& = '321' OR &T156T-BWART& = '322' OR
    /E  &T156T-BWART& = '349' OR &T156T-BWART& = '350' OR
    /E  &T156T-BWART& = '312' OR &T156T-BWART& = '326' OR
    /E &T156T-BWART& = '343' OR &T156T-BWART& = '344'.
    /: ELSE
    /: ENDIF.
    Hope this helps you.
    Regards,
    Rajani

  • How to print last page in sap script in ladscape format?

    Hi all,
    can any 1 tell me How to print last page in sap script in ladscape format?
    Thanks In advance.
    Pravin

    Hi Pravin Sherkar,
    we can do this in SAP Scripts.
    we need to create two pages, one of landscape and another of potrait.
    now after filling the data at last we need to call the page which is of format landscape using START_FORM  function module.
    You can use condition &PAGE& = &FORMPAGES&.
    Please check this link
    Printing Portrait/Landscape in sapscript
    Re: Landscape and potrait in same layout?
    http://www.sap-img.com/ts013.htm
    Best regards,
    raam

  • How to print the text in points wise in sap script

    hi friends,
    how to print the text in points wise in sap script.
    ex: if suppose paragraph consists of 15 lines. then according to one sentence or one fullstop (.) it should give point 1. like that...
    1. hai how ru.
    2. what r  u doing.
    3.where r u.
    like this i want numbering.. waiting for ur replys.
    thanks,
    kiran

    declare a counter
    data : cnt type char 4.
    print :
    cnt = cnt + 1.
    &cnt& &text&
    cnt = cnt + 1. and so on.
    or.
    if the data is in an internal table
    loop at internal_table.
    cnt = cnt + 1.
    write form.
    in script -&cnt& &text&
    endloop.
    Edited by: NIKHILKUMAR POOJARI on Nov 17, 2008 11:18 AM

  • How to print Special Characters in Sap-Scripts

    How to print Special Characters in Sap-Scripts
    Thanks,
    Ravi

    Hi
    if u want print special characters we can use hot codes i.e '  '  (single inverted commas). in between these hot codes insert u r special characters.
    write    '    !@#$%^&*( )  '.
    for the above write statement output is
    output is   !@#$%^&*( )

  • In SAP Script how to hard code my Company address in footer window

    Hi All ,
    In SAP Script how to hard code my Company address in footer window .
    Ex : in YB_F140_ACC_STAT this script i want to keep my company address, i want to hard coad , i dont want to use any field from table.
    Please give me step by step.
    Thanks
    Sridhar

    Hi,
    You can make use of standard text...
    create a standard text in SO10 with your company address
    and in the footer window of your script.. use include text and provide the name of the standard text you created in SO10.
    In the text editor... goto insert > text> standard
    You get popup give the name of the text name id and language
    regards
    padma

  • What is the diff b/w Sap Scripts and Smart Forms

    Hi,
          Whats the diff b/w SAP Scripts and Smart Forms..
             I need the internal explanation for both Smart Forms and SAP Scripts mean when we execute what happens whether Print Program r Forms starts execution 1st  and SIMILARLY FOR SMARTFORMS WHETHER FM'S  R FORMS.
    Thanks & Regards,
    Gopi.

    Hi
    Difference with SMARTFORMS vs. SapScript(SE71)
    The Following are the differences :-
    a) Multiple page formats are possible in smartforms which is not the case in SAPScripts
    b) It is possible to have a smartform without a main window .
    c) Labels cannot be created in smartforms.
    d) Routines can be written in smartforms tool.
    e) Smartforms generates a function module when activated.
    f) Unlike sapscripts (RSTXSCRP), you cannot upload/download Smartform to your local harddisk.
    It was said that it was provided in CRM 3.0 version, but not available in R/3. You can download smartforms into Local PC in a XML format. In the same way you can upload this XML format into Smartform. From the smartform editor itself you can call download option, if you are working in CRM 3.0 environment.
    In R3 also, you can download into XML format. However, it's not sure about uploading. Refer to the program 'SF_XSF_DEMO'.
    In 4.7 Enterprise, other have seen this utlity which is completey missing in 4.6c. There is functionality to downlaod a complete form or only a particular node. (Utilities -> Download form). It will create a XML file and save it in the hard disk.
    For others, if you want to download/upload the Smartforms source, you will need the help from the Basis people. What you can do is to create a Transport and then FTP down to your local harddisk. When you need the Smartform source in another system, you have FTP up the Smartforms file back to the SAP server. Finally, the Basis team, will tp it into your system.
    g) The protect and endprotect command in sapscript doesn't work with smartforms. For example on a invoice: First data of position no 80. is printed on page one, other data of position no 80 is printed on page 2. And there's nothing you can do about it. Actually, there is something you can do about it. By using a folder node and checking the 'protect' checkbox, everything in that folder will be page protected.
    check out this link:
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    Reward points if helpful.
    Regards,
    Swathi.

  • 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

  • Use of IF statement in SAP Scripts

    Can u tell me how to use IF statement in SAP Scripts.
    The problem is
    if &sy-tabix& eq '1'
    total
    else
    total1.
    endif.
    this sy-tabix is not working

    i think sy-tabix will not work here....
    do like this..
    data : vtabix type i.
    loop at itab.
    vtabix = sy-tabix.
    write_form...for the text element..
    endloop.
    in form layout
    /: if &vtabix(c)& eq 1
    /:endif
    regards
    shiba dutta

Maybe you are looking for

  • Adobe Flash 10.0.42.34 not fully compatible with OS X 10.6.2

    Every time I try to run Flash content on my computer, I am told that I need to install Rosetta (32-bit backward compatibility).   When is Adobe going to provide a 64-bit version of Flash?  I mean, Snow Leopard has been out for some time, I would thin

  • Multiple Select boxes in one form

    Does anyone know if it is possible to have multiple select boxes inside one form? I have six different select boxes that are generated by six separate queries. The action page for all six select boxes is the same so I just want one submit button so u

  • Help with Blackberry Protects

    My phone fell into water and is destroyed. i have a extra temporary blackberry tour to use. i have saved my data daily by blackberry protects. my problem i sthat my blackberry does not connect to the internet. if i have my contacts on the BB Protects

  • Is it possible to animate a symbol when dragged?

    IF so can you show me how? thanks!

  • Can Photoshop CS3 Be Configured To Open Bridge CS4 On Launch?

    I used PS CS3 for a couple of years and then bought Photoshop Elements 8 last year because I felt it was more modern, included Bridge CS4, was incredibly cheap and would also do everything I wanted. I have discovered that PS CS3 has a couple of usefu