select options as parameters to smartforms, control break events functionality in smartforms

12
Select-options as parameters to smartforms and displaying the data in the form of control break reports in smartforms: Procedure : 1. Create a dictionary structure representing select-option structure name : zselect fields : sign char1 option option low vbeln_va high vbeln_va Note: If required, create table type based on above line type (structure-zselect) table type -->ztselect 2. Create smartform (z9amsform4) Form interface : import : i_vbeln type ztselect (or) tables : t_vbeln like zselect Global definitions :-

Upload: mahendra-reddy

Post on 07-Jul-2016

481 views

Category:

Documents


16 download

DESCRIPTION

Select Options as Parameters to Smartforms, Control Break Events Functionality in Smartforms in SAP ABAP

TRANSCRIPT

Page 1: Select Options as Parameters to Smartforms, Control Break Events Functionality in Smartforms

Select-options as parameters to smartforms and displaying the data in the form of control break reports in smartforms:

Procedure :

1. Create a dictionary structure representing select-option

structure name : zselect

fields :

sign char1

option option

low vbeln_va

high vbeln_va

Note: If required, create table type based on above line type (structure-zselect)

table type -->ztselect

2. Create smartform (z9amsform4)

Form interface :

import :

i_vbeln type ztselect (or)

tables :

t_vbeln like zselect

Global definitions :-

Types :

types : begin of ty_vbap,

vbeln type vbap-vbeln,

posnr type vbap-posnr,

Page 2: Select Options as Parameters to Smartforms, Control Break Events Functionality in Smartforms

matnr type vbap-matnr,

netwr type vbap-netwr,

end of ty_vbap.

types : gt_vbap type table of ty_vbap.

global data :

lt_vbap type gt_vbap

ls_vbap type ty_vbap

lv_total type i

gv_total type i

Page 3: Select Options as Parameters to Smartforms, Control Break Events Functionality in Smartforms

Initialization tab :

Page 4: Select Options as Parameters to Smartforms, Control Break Events Functionality in Smartforms

Loop object

Page 5: Select Options as Parameters to Smartforms, Control Break Events Functionality in Smartforms

Text object under event on sort begin:

Page 6: Select Options as Parameters to Smartforms, Control Break Events Functionality in Smartforms

Code object (program lines) under loop :

Page 7: Select Options as Parameters to Smartforms, Control Break Events Functionality in Smartforms

Text object under loop:

Page 8: Select Options as Parameters to Smartforms, Control Break Events Functionality in Smartforms

Text object under event on sort end:

Page 9: Select Options as Parameters to Smartforms, Control Break Events Functionality in Smartforms

Code object under event on sort end :

Page 10: Select Options as Parameters to Smartforms, Control Break Events Functionality in Smartforms

Text object after loop

Driver Program :

REPORT  Z9AMSFORM4_CALL.

data lv_vbeln type vbak-vbeln.select-options so_vbeln for lv_vbeln default '4980' to '4985'.

start-of-selection.* get the smartform function module name

data lv_fname type rs38l_fnam.CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'  EXPORTING    formname                 = 'Z9AMSFORM4' IMPORTING   FM_NAME                   = lv_fname.

Page 11: Select Options as Parameters to Smartforms, Control Break Events Functionality in Smartforms

* invoke the smartform f.mcall function lv_fnameexporting  i_vbeln = so_vbeln[].

initialization :

input parameters output parameters

t_vbeln lt_vbap

select vbeln posnr matnr netwr from vbap

into table lt_vbap where vbeln in t_vbeln.