Variables in SMARTFORMS

Hi all,
   In our Smart forms we have fixed text of 10-12 lines , within which we have 1-2 variable data (dynamic).
   Now for this in the smartform,we were thinking to use Standard text SO10 .
  Another query is that if we define std texts in SO10 for different cases,we need to call these within the same smartform i.e. something like CASE structure in the SMARTFORM...Whats the best way to achive the above?
BR,
Disha.

Hi Disha,
    May be you can use some code like this:
      CALL FUNCTION 'READ_TEXT'
      EXPORTING
        id                      = 'ST'
        language                = sy-langu
        name                    = <Standard text name>
        object                  = 'TEXT'
      TABLES
        lines                   = it_lines
      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.
      LOOP AT it_lines INTO wa_lines.
        IF wa_lines-tdline CS '<fdate>'.
          REPLACE ALL OCCURRENCES OF '<fdate>' IN wa_lines-tdline WITH lv_create.
        ENDIF.
        IF sy-tabix = 1.
          ls_bodypart-content_ascii = wa_lines-tdline.
        ELSE.
          IF wa_lines-tdformat NE '='.
            CONCATENATE ls_bodypart-content_ascii cl_abap_char_utilities=>newline
            wa_lines-tdline INTO ls_bodypart-content_ascii.
          ELSE.
            CONCATENATE ls_bodypart-content_ascii
            wa_lines-tdline INTO ls_bodypart-content_ascii.
          ENDIF.
        ENDIF.
      ENDLOOP.
Note: <fdata> is the dynamic variable declared in standard text(SO10).
BR,
Swagatika

Similar Messages

  • Problem with windows and variable in smartform

    hi guru,
    i create smartform for printing tax document and found problem.
    1) 
    i create layout in form like this.
           {Main Window}
                     <<<< Data to print
           <<<< secondary Window
             <<<< secondary Window
    with many data in table, so this form will take 10 page up to print. i found and showed in every page.
    in my solution *i want to display and on last page after {Main Window} Only*. how to resolve this.
    2)  follow to 1st question, can i place position of each window in dynamic?  +like 's position is under {Main Window} 2 cm.+ instead of specific position left margin , upper margin *or should i create other page and place and .*
    3)  i create 2 variables  (sum1 type p , sum2  type p ) for keep sum of  tax in table that show in each page and write it at end of each page. i want to clear data in these 2 variables when system create new page and start to keep sum of value again. i create program line node under {Main Window} after but don't know which code or syntax to write.how to code this?
    regards,
    Kittisak.

    1) On the 'Conditions' tab of your WIndow3 & WIndow4 just click the check box
    'Only After End of Main Window'. It will always be printed at the last after your main window is finished.
    2) And if you don't want your window3 & window4 in a fixed place than instead of new windows do the same thing inside your main window creating a new template or anything as per your requirement and place it after your main table.
    3) For clearing the fields, do it like this, in the program lines write the code below:
    IF G_PAGE NE SFSY-PAGE.  " declare g_page with initial value '0'
        CLEAR field1.   
        CLEAR field2.
        G_PAGE = SFSY-PAGE.   
      ENDIF.
    With luck,
    Pritam.

  • How to dynamically replace variables in SMARTFORM texts based on item data?

    Hi experts,
    I'm currently designing a confirmation of order using Adobe PDF forms. The general layout with tables, pictures and texts was not big deal.
    But one tiny bit doesn't work and I'm becoming more and more desperate about it.
    We need various free texts for our pdf form. I created the texts using smartform texts. Some of these texts need to be slightly dynamic, so I added some dynamic fields in it.
    For example:
         "The material is currently out of stock.You can expect shipping around week &num_week&."
    To replace the dynamic field &num_week& in my interface, I read that I have to name the dynamic field exactly like the corresponding field in my interface. In my case this would be now:
         "The material is currently out of stock.You can expect shipping around week &SLS_PRT_COM-ITEM_DETAIL-ZZ_EXTRAFIELDS-ZZWEEKNUM&."
    To see the text on my form, I added a text object with type 'text module' and the proper textname. Of course I'm able to insert text on my form, save and activate it without problems. But if I want to print the form, nothing happens as the print program exits with an error code.
    After some hours I found out that this problem only occurs if I'm trying to replace the dynamic field with a field from the item table. Using a field from head details or globals like sy-mandt works like a charm.
    So my question is: Is it possible to use item data to replace dynamic fields of a smartform text?
    Greetings and thanks in advance!
    André

    Hi
    Have a look at the links below:
    LiveCycle ES2 * Adobe LiveCycle Designer ES2
    Using floating field in Adobe Forms to display text paragraph with dynamic variables in between
    After adding the floating field it will apeare in the hierarchy pallet above or bellow the text field.
    Good luck
    Shai.

  • Adding commas in quan variable of smartforms

    hi experts,
    In my smartforms,i have a variable temp_menge which is having value 1000000 but i want to get it displayed as 1,000,000.How to write the same.?????
    Thanks,
    Gaurav
    Edited by: Gaurav Kumar on Feb 26, 2008 2:30 PM

    Hi,
    There might be 2 possibilities. One is data type. Symbols of the DEC, CURR, INT, and QUAN data types are normally formatted with the a ‘thousands’ separator character. The T option allows you to omit this separator character.
    Syntax:
    &symbol(T)&
    The EKPO-MENGE field contains the value 1234.56. The Dictionary definition specifies 3 decimal places and an output length of 17.
    &EKPO-MENGE& -> 1,234.560
    &EKPO-MENGE(T)& -> 1234.560
    So one thing is change your data type to TYPE P or remove the (T) from your code. This should work.
    Reward points if helps.
    Regards,
    JLN

  • String variables in smartforms

    Hi
      I have one problem when displaying the text in smartform
    i declared my variable as string type
    in the smartform  i get the item text from purchagse order ( it is about  300 characters)  into this variable.
    even though the lengh of the variable is showing 300,
      but for visible it is displaying only 260 characters,
    what is the reason  for this the variable is in main area only.

    Hi
    Smartforms can display only 255 characters by default.
    If you want more then, you have to give the variable like this:
    /: var1+0(255)
    /:var1+255(255)..... so on..
    Regards,
    Vishwa.

  • Declare Variable in Smartforms from BT and EPF tables

    Hi All,
    I am developing a smartform to display the payslip of employees.
    In my smartform I need to use fields from the BT table and EPF Table.
    I need to declare variables for the same fields in smartform.
    How can this be achieved.
    Any pointers or suggestions would be helpful.
    Thanks,
    Saher

    Hi
    Please search with the search term smartforms and u will get many threads which will answer your question.
    In  general, in form interface of smartform we declare the tables whose values are passed from the print program.
    IN global definitions, we declare the variables we use in the smartform.
    Regards,
    Vishwa.

  • Current window variable in SmartForms

    Hi,
    what is syste variable to find the name of the current window in Smartforms,
    regards,
    venkat
    Edited by: Alvaro Tejada Galindo on Feb 27, 2008 12:02 PM

    Hi Venkat,
    I think the system variable you are looking for is SFSY-WINDOWNAME!
    Have a nice day!

  • Data type of variable in smartform

    Hi folks
    iam displaying the currency fields as acolum  in the main widow , now i want to display the sum of these items   i have coded like this:
    data: cu-sum type f default '0'..
    loop at itab into w_iatab.
    cu_sum = cu_cusum + w_itab-curr
    endloop.
    now its claculating the sum but its not showing in layoutest
    could u tell me the data type of cu_sum should be  P or C OR F. because here 'curr' is the currency field.
    tahnks in adavace
    priyavasuki srinivas

    Hi Priyavasuki Srinivas,
    In your SMART FORM
    Goto Global Settings ---> Global attributes ---> Global Definitions
    Here you can find a TAB Currency/Quant.Fields
    There In the Field name decalre your Output Field name and Choose the Data type as CURR.
    Your problem should be solved with this.
    Thanks,
    Sreekanth

  • Print variable with ZPL II in smartforms

    Hi all,
    How can I print a variable in smartforms with ZPL II code?
    I use commant in smartforms with ^FV but it could not be written to the label.
    ZPL II Command String is :  XX is a variable that is stored a value in Programs Line before ZPL II Command.
    S_LZPL_SETUP     'XAFO50,50GB0,203,5FSFWBFO115, 75A0,25,20FVXXFSXZ'
    Best regards,
    Munur

    Hi Jack,
    1.
    data : ZZPL2 type string.
    clear : zsaat,ztarih.
    concatenate ZZCZEIT(2) ':' ZZCZEIT+2(2) ':' ZZCZEIT+4(2)
           into ZSAAT.
    condense ZSAAT no-gaps.
    concatenate ZZCDATE+6(2) '.' ZZCDATE+4(2) '.' ZZCDATE(4)
           into ZTARIH.
    condense ZTARIH no-gaps.
    concatenate '^BY4,2.0^FO20,50^B7N,4,1,1,0,N^FD'
                  ZZKDMAT
                '^FS'
                '^FO490,15^GB0,250,5^FS'  
                '^FWB^FO500,60^A0,25,20^FD'
                ZSAAT                    
                '^FS'                      
                '^FWB^FO525,50^A0,25,20^FD'
                ZTARIH
                '^FS'                    
                '^FWN^A0,25,20^FD'
                '^FS'                      
           into ZZPL2.
    2. In the command :
    S_LZPL_SETUP           ZZPL2
    That's all.
    Best regards,
    Munur

  • * is coming while priniting smartform of multiple pages for a customer

    Hi Experts,
    I m priniting the smartform for the Customer statement and i m using SFSY-PAGE and SFSY-FORMPAGES for the page number and for total number for pages. There am facing the problem of * in SFSY-FORMPAGES..
    If the total no of pages is single digit like 8 or 7 it is printing page 1 of 8 etc, but if it is double digit in the sense like 11, it is printing Page 1 of * Page 2 of * and Page 10 of 11.... I have used the Z and C in the variables in Smartform...
    Please help me to solve this

    Hi,
    Refer Question Why SFSY-FORMPAGES is output as a star "" instead of the total number of pages?* from the below link
    http://wiki.sdn.sap.com/wiki/display/ABAP/SmartFormsFAQ#SmartFormsFAQ-WhySFSYFORMPAGESisoutputasastar%22%22insteadofthetotalnumberofpages%3F
    Thanks,
    Pawan

  • Printing Standard TEXT  with multiple paragraphs in smartform

    Hello all,
    I have a requirement that, there is a very long standard text stored in a notification of an order in SAP ISU system. The text contains multiple paragraphs with indentations. I want to print this text directly into the smartform WITH SAME INDENTATION AND PARAGRAPH FORMATTING.
    First i am reading the entire text using FM READ_TEXT.
    My first  problem is even if i read the text into a variable of type STRING , it just prints 255 characters of it.
    And secondly if i try to printout it using LOOP AT node in smartforms, it prints the entire content but without any formatting .
    Please let me know whether it is possible to print standard text in smartforms or not
    Thanks
    Nilesh Puranik

    Hey ,
    Well thanks for that but my replies got posted 2-3 times unknowingly, could'nt help it.
    Coming to the problem, i  guess you did not get my point when i say dynamic texts for each service order.
    In my Report i am using LOOP AT ITAB ..where in itab i  am storing a service order no i.e. ITAB-ORDER_NO
    Now for every order there is standard text maintained in SO10 starting with order name
    so my code goes like this.
    LOOP AT ITAB.
    CALL FUNCTION 'READ_TEXT'
      EXPORTING
        ID                            = 'LTXT'
        LANGUAGE            = 'E'
        NAME                      = ITAB-order_no
        OBJECT                   = 'QMSM'
      TABLES
        LINES                         = LINES .
    CALL <SMART FORM Fm>
    ENDLOOP.
    Hence whatever Standard text maintained for that service order i  want to display it as it is in the smartform with same paragraphs formatting and indentation.
    IF i use a variable in smartform and pass the entire text  after using READ_TEXT , it does not format the text  and it just prints only 255 characters even if i define it of type STRING .
    Hence i am stuck in this scenario.
    Appreciate ur help though.
    Thanks
    Nilesh

  • Dynamicaly print logo on smartform(if a person email id change logo ischang

    hi expert,
    actually i want all the variable of smartform in one table.
    so i crated ztable,
    my logo is in database i want to  fetch the logo from z table .
    (v_logo logo name in table how can i fetch logo from database with refrence of email id of person)
    so plz suggest me step by step method.
    i am working on hr module.
    condition is if pernr (person)email id chang logo is also change both fields are in one table .

    Hi
    This is very simple, create all the logo's with the actual name of the person or perner.
    Use a select query on your table and pass the value of the seleceted record as the name of the graphic in the smartform node.
    Something like this:
    MAPPING TABLE"
    PERNER    IMAGE_NAME
    0001           0001
    0002           0002
    in se78, you logo name should be '0001' , '0002' and so on....
    in smartform, based on ur pernr, select a record from mapping table and pass the value of the image name to a variable in the graphics display node.
    this should solve your prob.
    Cheers
    Ravish

  • Icon printing in smartforms

    Dear All,
                 I need to print an icon in smartform through program , i will be passing the icon value in one variable in program and pass that variable in smartforms, for example wicon = '<769>' and pass the wicon in smartforms but it's not printing .. is there any other way to print an icon in smartforms through program..

    Hello Simpu ,
    try this--
    Go your Text field where u want to print the icon -- Click on the Editor button (left side )--- Click on Insert button --
    Go in Character -
    then click on Sap Symbols / Or Sap Icon  Choice your icon dobule click on that save ur smartforms and run in the Printout u can see your icon.
    If any Problm ask me.
    Vanu.

  • Smartforms for beginner

    hello everyone,
    i am new to SAP particularly SMARTFORMS. i am planning to create a simple letter which later i want to call in my abap program.
    example:
    TO:<b> variable_name</b>
          <b>variable_address</b>
    (main body)
    Dear <b>variable_name</b>,
    blah blah blah... blah blah blah..
    thank you,
    mrm.
    now, any suggestions/help/tip in declaring the variables in smartforms? i absolutely have no idea how. :(.
    thanks for future responses.
    Mark

    Hi Mark,
       Go thru the link othere have given it would be make u learn lot abt smartforms.... For ur requirement  U need to have 2 things as every smartforms have..... a  Print program .... then ur smartforms for it.
    Goto SE38 & create a print program.... as follows
    DATA: v_fm_name TYPE rs38l_fnam,
               v_name  type text20,
               variable_address type text20.
    v_name     = ' Mark Ronald Magat'.
    v_address  = 'Address'.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        formname           = < Ur smartform name within single quotes'
      IMPORTING
        fm_name            = v_fm_name
      EXCEPTIONS
        no_form            = 1
        no_function_module = 2
        OTHERS             = 3.
    CALL FUNCTION '/1BCDWB/SF00000183'
      EXPORTING
         v_variablename                     = v_name
         v_address                            = v_address
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
    EXCEPTIONS
       FORMATTING_ERROR           = 1
       INTERNAL_ERROR             = 2
       SEND_ERROR                 = 3
       USER_CANCELED              = 4
       OTHERS                     = 5
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Now Go to smartforms....
    In form Interface give :
      v_variablename   type  text20
      v_address           type  text20
    Create a a text element in a window . now go to the text element and give
    TO: & v_variablename &
            &v_addrerss&
    Dear  & v_variablename & ,
      blah blah blah... blah blah blah..
    Thank You
    mrm.
    Save check activate.... u are done.....
    When u are clicking execute u find a function module being created take that name and paste it in SE38 program @ second call function... in the above code it is /1BCDWB/SF00000183'... but will change for each smartform.
    Reward if u find it useful.
    Arun T

  • Request for URL Link in SmartForm

    Hi Experts,
    I am working on ECC5.0. I am developing PO smrtform and got a requirement to have HTML links in Smartform Layout.
    Example Scenario: I have html link as follows for item number 1 details in PDF format. Whe I copy and paste the following link I am able to see PDF document.
    http://sapuxdev.abcd.com:8085/sap/ebp/docserver/100/po%20attachment%20oss%20note.pdf?attkget&KpId=49934B44F040744CE1000000AC1D061F&KpClass=BBP_L_DOC
    Kind Note: This number "49934B44F040744CE1000000AC1D061F" is dynamic (this is changed based on Item number in a PO)
    I want to store the above link in a variable called Item1_Details and want to display in smartform with the varible name. Whenever I click on variable in smartform the pdf file needs to be opened in new web browser.
    Kindly let me know is there any solution for my problem.
    Thanks a lot in advance for your help.
    Thanks,
    Sudarsan

    Hi
    If you need to create a static link only then specify in Jsp page
    If the link is dynamic and also depends on some numbers It is always recommended to put the Link Or Url in the jsp dyn page or some java classess instead of jsp page.
    below is the code you can use for that.
    IPortalComponentRequest request =
                   (IPortalComponentRequest) rendererContext.getRequest();
              IPortalComponentURI solnDetailsUriObj =
                   request.createPortalComponentURI();
              solnDetailsUriObj.setContextName("specify the link or url")
              String solnDetailsUri = solnDetailsUriObj.toString();
              Link solutionLink = new Link("solutionLink");
    Now you can use the link assigned dynamically to any thing.
    Try this link also.
    [http://help.sap.com/saphelp_nw04s/helpdata/en/45/1bc575ba064574e10000000a114a6b/content.htm]
    Hope this will help
    Regards
    Hareesh

Maybe you are looking for

  • Db02 & indexes

    Hi, I would like to know where do i find information regarding my system's indexes? I'm runing and upgraded system of ecc6 (before was 4.6c) with sql server 2000. on the earlier system - 4.6c i had to goto transaction db02 ->db analysis-> missing ind

  • Sync doesn't bring over all my bookmarks, only some.

    Firefox 31 with a new MacBook Air, but the sync to my iMac isn't complete. I've signed out and back on, and tried Sync Now a few times. When I go to Show All Bookmarks on the MBA, they're still missing. Curiously, the bookmark folder on the MBA look

  • Error in grouping of kanbans

    Hi , created Jit call profile.Assigned summarised by plant & partner function. But kanbans are not grouped into the Jit call.It will create the separate jit call for the same delivery date. Can you please guide me any program missing in grouping.ofil

  • Niel, folks, hi. You mentioned the last time you perfectly helped/assisted me bout MacDrive Apps for file retrieval, what's the specification? Thanks

    I've had my WD external hard drive formatted to MAC OS Extended(Journaled). No issue bout it, all good. I have my old files saved on a desktop hard drive other brand. What specific MacDrive Apps do I need to download on the desktop for me to retrieve

  • Access NamedCache in Cluster

    Hi, there,      Is there an example showing how to access a DistributedCache object in a clustered environment? It seems like CacheFactory.getDistributedCache() method will do it. However, what is the usage of cacheFactory.getCluster() method then? A