Smarta formulär i SAP ABAP

Innehållsförteckning:

Anonim

SAP Smart Forms används för att skapa och underhålla formulär för massutskrift i SAP-system. Som utmatningsmedium stöder SAP Smart Forms en skrivare, ett fax, e-post eller Internet (med hjälp av den genererade XML-utdata).
SAP introducerade SmartForms 1998 för att övervinna begränsningarna i SAP-skript. SmartForms är lättare att utveckla, underhålla och transportera än SAP Script.

I denna handledning lär du dig:

  • Jämförelse av smarta formulär och SapScripts
  • Advanatges av smarta formulär
  • Arkitektur av SAP Smart Form
  • Smartforms-guide
  • Windows i smarta former
  • Programmeringsflöde för smarta formulär

Jämförelse av smarta formulär och SapScripts

  • Flera sidformat är möjliga i SmartForms vilket inte är fallet i SAPScripts
  • Det är möjligt att ha en SmartForm utan huvudfönster.
  • Rutiner kan skrivas i SmartForms-verktyget.
  • SmartForms genererar en funktionsmodul när den är aktiverad.
  • Etiketter kan inte skapas i SmartForms.

Advanatges av smarta formulär

  • De hjälper till att anpassa formulär utan programmeringskunskap på grund av ett helt grafiskt användargränssnitt
  • När du aktiverar den smarta formen genererar systemet automatiskt funktionsmodulen och vid körning.
  • För att göra några ändringar måste vi använda Drag & Drop, Cut & Paste. Dessa åtgärder inkluderar inte skrivning av kodrader eller användning av skriptspråk.
  • Vi kan infoga statiska och dynamiska tabeller. Dessa inkluderar radmatningar i de enskilda tabellcellerna, utlöser händelser för tabellrubriker och delsummor och sorterar data före utdata.
  • De smarta formerna tillåter användaren att inkludera grafik, som kan visas som en del av formuläret eller som bakgrundsgrafik. Under utskriften kan användaren undertrycka bakgrundsbilden vid behov.
  • Webpublicering är möjlig med den genererade XML-utdata

Arkitektur av SAP Smart Form

Smartforms-guide

Låter gå igenom det i SAP-system-

  1. Ange transaktion SMARTFORMS i rutan för transaktionskod.
  2. I nästa skärm anger du ett formulärnamn och klickar på skapa

Nästa skärm är indelad i tre avsnitt-

Navigationsfönstret består av noder och subnoder. De innehåller alla element (text, fönster etc) som tillhör SAP-formulär

  • Underhållsfönstret visar attributen för elementen
  • Fönstret för formulärskrivare visar sidans layout

När vi skapar smarta formulär skapar / genererar SAP en funktionsmodul. I motsats till SAPscripts låter SAP FORMS dig ändra språk.
I navigeringsfönstret hittar du
globala datadeklarationer : De data som definieras här kan användas i hela smartform för kodningsändamål.
Formgränssnitt : Här definieras all data som kommer att skickas till smartform från Print-programmet.

Högerklicka på sidorna gör det möjligt att skapa en ny sida, fönster, grafik eller adress.

Utskrift sker på basis av fältet "nästa sida".
Men bearbetning kommer att ske enligt sekvensen i navigeringsfönstret!


For background picture and graphics you can pick up either black and white or color bitmap images and are stored in the form of standard texts. You may take a detour from the smartform screen and open Form Graphics screen. Transaction code: Se78

Setting in the Graphics in Smart Form Window-

Windows in Smart Forms


There are two types of Windows

  1. Main
  2. Secondary

Important Points to Note

  • You cannot have more than 1 main window in a page. You can have multiple secondary windows
  • Whatever you print in secondary window… it has to be static. (If u have 20 lines in a PO and there is page constraint the lines get carried forward to next page in the main window. i.e. In a predecessor and successor type of content, they will be printed in sequence in main window. This is not allowed in Secondary windows.


Inside the main window we can add text as introduction to customize the form output.

The Output options on each window determine the Line size, Width, Colors and background to be put.

Smartforms gives the option of giving the address number which is maintained in the central address management. The address will be directly taken from ADRC table and will be populated in the form.

The two different editors are available in Smartforms viz. Normal Editor

and the Graphics Editor.

This setting can be changed using the Configure editor in Utilities.

In Table painter, you can draw the format as per client requirement (e.g. Heading, Sub Heading, Item, Sub Total, Grand Total etc.)
You can use the table layout to determine:

  • The number of lines and cells
  • The height of each line
  • The width of each cell
  • The alignment of the table in the window


The Table shows the different line types which will be used in the table. The Line types define the size of each cell and the number of cells in each line.

Smart Forms Programming Flow

When an SAP Smart Form template is created, a user creates the form layout, defines the required fields, conditions, and special programming instructions in the Smart Form template using the Smart Form Builder.
After the form design is complete, the form needs to be activated before it can be tested or accessed by the print programs.Activating the form initiates the generation of a function module that handles all of the form's processing.
This function module interacts with the application program/print program to create the output in the user-defined output media for the specified device.
In case of smart forms, we use 2 function modules for the processing of the smart form. To the first function module , we pass the name of the smart form as the import parameter. This then returns the name of the dynamically generated function module which will actually call the smartform.
The smartform name can be passed on to the function Module - 'SSF_FUNCTION_MODULE_NAME'

This will return the Function module name of the smartform which is referenced.

The Print program will be calling the FM 'SSF_FUNCTION_MODULE_NAME' to get the Function module name at Runtime. Therafter it will call the Function module thus obtained to execute the smartform.

Templates

Mall kan användas när du vet den exakta storleken på utdata eller om utdata är i ett fast format.
Exempelvis skatteformulär / kontroller / flygformulär / järnvägsbiljett: alla dessa använder mallar.
Det stora mellan tabell och mall är att höjden förändras dynamiskt i en tabell. Vi kallar en rad en "linje" i mallen.


SMART Styles

En smart stil innehåller:

  • Rubrikdata som innehåller standardvärdena för en Smart Style
  • Styckeformat inklusive indrag och avstånd, teckensnittsattribut, flikar, konturer och numrering
  • Teckenformat inklusive effekter (superscript, subscript), streckkod och teckensnittsattribut
  • Färger och understrykningar för ett stycke- eller teckenformat

Du kan använda transaktionen "smartforms" / "smartstyle" för att skapa en smart stil.

Det är allt för denna handledning