-1

I'm kind of a newbie in Smart Forms. I'm trying to get some data from KNA1 table like the name and the address to show on delivery note.

How do I get this?

I know I have to put the tables in some option of "global option" but I just don't know which one. Please, can someone help me? Thanks.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Eva Dias
  • 1,709
  • 9
  • 36
  • 67
  • 2
    I've just reread your last few SAP-related questions. It would be really great if you'd add a little more background info on what you have already tried to solve the problem for yourself. I can't help myself, but I somehow get the impression you're not using the most simple means (e. g. google for "site:help.sap.com smart forms") to answer the questions for yourself. – vwegert Oct 04 '12 at 18:48

2 Answers2

2

You'll need to know how to develop ABAP coding for this. Assuming that you know this, you should try to extend the input structures of the form and add the necessary selection logic to the supplying program. If this is not possible, you can add code to the form, but that's not recommended for various reasons.

EDIT: If you do know how to code ABAP, it's even harder to understand your question. I assume you have taken a look at the excellent online doumentation. If you inspect the header entries of a form, you'll note stuff like global definitions and initialization coding. If you take a closer look at the elements you can insert in a form, you'll discover program lines. So this is one way to embed ABAP code in a form that will select data from the database. You'd print it out like any other field.

However, this is a bad idea. It will generally slow your form processing down and is a nightmare to maintain if used too widely. Instead, you should take a look at the parameters of the form and the program that is calling the form. If possible, edit the appropriate structure or use an append structure to add the additional fields. Then, use a BAdI, user exit or an implicit enhancement to fill the fields in the calling program. The advantage of this is that the data will be passed to all forms and you won't have to copy the logic throughout multiple forms. (Also, it will be easier to port this to Interactive Forms if you'll ever have to).

vwegert
  • 18,371
  • 3
  • 37
  • 55
  • I do know how to code ABAP, but I'm not sure if I'm understanding what your saying. I'm sorry, can you explain better? Thank you. – Eva Dias Oct 04 '12 at 14:28
1

Every smartform has a form interface which is the primary way of passing information to it (under "Global Settings" in the form tree). When this information is missing and you can not change the interface as well as the ABAP code which calls it for some reason (because it's called at too many different places or because it's called from SAP standard code) there are still ways to integrate ABAP coding into a smartform to get any additional data:

  1. You can click the "Global Definitions" to define global variables and global form routines
  2. You can add a "Flow Logic -> Program Lines" node to a window node. Here you can write some ABAP code to read the data you need and write it into a global variable.
  3. You can then use this variable in the text elements of the window.
Philipp
  • 67,764
  • 9
  • 118
  • 153