Skip to Content
avatar image
Former Member

smartforms

hi

i have a problem with the smartforsm which has to pull the data from the kna1 how to pull the data from it can anyone explain me as to how to do it and your help is much appriciated.

i have 5 fields like kunnr, name1 ort01, land1, pstlz.

please help ,me out

regards,

jacob.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • avatar image
    Former Member
    Oct 08, 2008 at 12:08 PM

    Hi,

    Looks you need Basic Training on SMARTFORMS........SDN is not the right place for the same.......

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 08, 2008 at 12:16 PM

    Hi,

    You can directly fetch d data thru kna1 table in smartform itself... for that u hav to just do rt click on win then create flow logic - program lines.

    Here u can write select query..

    Otherwise fetch data form kna1 table into internal table (in report) and pass it to smartform FM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 08, 2008 at 12:25 PM
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 08, 2008 at 12:28 PM

    Hi ,

    In global definitons -->

    global data declare the variable name and associated type.

    Types declare the field string.

    initialization --> write the select query for 5 fields.

    In page--> create table --> create the cells for the fields.

    Create the text nodes for the cells in header area and drag and drop the fields in the main area in the respective text nodes.

    Regards,

    Sravanthi

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 08, 2008 at 12:59 PM

    Hi Jacob,

    There are 2 ways to retrive the data.

    1. when you create a smartform it generate a function module, in smartforms in global setings -> form interface you can declaree a varable the kna1-kunnr.

    as you use these FM in the print program just pass the single value on kunnr to these FM.

    in smartforms in programming code lines write the abap code to get the data from kna1.

    you can declare all the global data in global declarations in smartforms

    2. in second case write the code line to retrive the data in the print program and pass that table to the smartforms FM .

    before that u should define these table in the form interface in global settings.

    these are the basics of smartforms, just read about smartforms from the below link

    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCRSF/BCSRVSCRSF.pdf

    regards

    kumar m

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      you can fetch the data from KNA1 based on some primary key. lets consider that KUNNR is the primary key here. Then you can write a query in your print program as follows:

      SELECT kunnr

      name1

      ort01

      land1

      pstlz

      INTO corresponding fields of TABLE itab_kna1

      FROM kna1

      WHERE kunnr = ???.

      You can put here the parameter filed name or any other field name having the value of KUNNR. Itab_kna1 here is the internal table used to store the data from KNA1. Then to read the internal table do a loop at itab_kna1.

      Then in smartform you can you can retrieve the data and get it populated in any window/table.

  • avatar image
    Former Member
    Oct 16, 2008 at 10:14 AM

    thanks

    Add comment
    10|10000 characters needed characters exceeded