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

Post on 07-Jul-2016

484 Views

Category:

Documents

16 Downloads

Preview:

Click to see full reader

DESCRIPTION

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

TRANSCRIPT

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,

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

Initialization tab :

Loop object

Text object under event on sort begin:

Code object (program lines) under loop :

Text object under loop:

Text object under event on sort end:

Code object under event on sort end :

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.

* 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.

top related