SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software
Development resources, articles, tutorials, code samples, tools and downloads for SAP HANA and ABAP, HANA Database, SQLScript, SAP UI5, Screen Personas, Web Dynpro, Workflow

How to Use Form Routines in SAP Smartforms Documents


Creating Form Routines in SAP Smartform documents help ABAP developers who are working with SAP Smartforms documents keep their ABAP codes clean and create reusable form routines that can be called within Smartforms.

In this SAP Smartforms tutorial, I'll demonstrate how to create a sample Form Routine and how to call it from Initialization code block.





On the Global Data, add the following line to define gs_vbrk global variable.

GS_VBRK TYPE VBRK
Code

Go to Form Routines tab, add the following form routine code block.

FORM get_vbrk_data
  USING cs_bil_number TYPE VBELN
    CHANGING cs_vbrk TYPE vbrk.

SELECT SINGLE * FROM vbrk INTO cs_vbrk
  WHERE vbeln = cs_bil_number.

ENDFORM.

Code

On the Initialization tab, add the following code which will call and populate gs_vbrk variable structure.
Of course, gs_vbrk should be defined among Input Parameters and Output Parameters of Initialization code block.
And is_bil_invoice-hd_gen should be defined in the Input Parameters of Initialization code section.

* Populate internal VBRK structure variable
PERFORM get_vbrk_data
  USING is_bil_invoice-hd_gen-bil_number
    CHANGING gs_vbrk.
Code


SAP HANA and ABAP

Install SAP Free
CRM Companies List
Web Based CRM Software


Copyright © 2004 - 2021 Eralper YILMAZ. All rights reserved.