Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 28

Display Item table of every Header Table

record in a New Page using Conditional


Breaks
FollowRSS feedLike
0 Likes 4,666 Views 2 Comments

This article explains how to Display Item table in a New page for every Header Record in the
Header table .

Here is an Example.

Go to Transaction code SFP(Form Builder).

Enter the Name of the Interface as shown below and click on Create button.

A pop up will be displayed. Enter the description and Interface Type .Click on Save.
Interface will be created as shown below. Create Invoice Number as Import Parameter.

Click on Save and Activate.

Create FORM ‘ZAF_BILLING_ITEM_DETAILS‘.


Assign Interface and Click on Save.

Get all the layout attributes(Fields.Tables…) into Context level from Interface level..

To display the Item table of each header record,

Create a loop between Header data table and Item data table as shown below.
Specify the Item table as shown below.

Under Conditions, enter the prerequisites that need to be met before the table is processed at run
time

and displayed in the form.


Based on given where condition a loop will be triggered between Header data Item data at Run
time.

Create the layout as shown below.


Set the Properties of Header and Item table Sub forms to act as a Table as shown below.
Material_Table(VBRP) Sub form Properties:
Binding:

Material Number Sub form Properties:


Item table Sub form Properties:

Item Data Sub form Properties:

Click on Save , Activate and Execute.

Enter the Invoice Number and Execute.


Output will be displayed as shown below ..

To display the Second Header Record and its item table data on Next Page we need to add
conditional breaks
Click on Material Number Sub form Which act as a Header Table.

Click on Add Icon. Select MATNR


Condition will be added as shown below. Select the Top of Next page as shown below.
Save ,Activate and Execute the Form Now each Item table will be displayed in a New Page.

Material Number 1 and its item table displayed in First page.


Material Number 2 and corresponding item table to started in Second Page.
Using Where conditions to relate header and item tables in Adobe
forms
By Jayachandra Nagaram, YASH Technologies

In this demo we will create an Adobe form, which displays relating data from two tables (Header and Item) by
using ‘Where conditions’ in Form context.

Step1: Go to transaction SFP and create interface for the form.

In this demo we can use the interface YDEMO_ALTERNATIVE which is used in previous tutorial
using alternatives.

Step2: Create Form YDEMO_TABLELEVEL

Note: Maintain Interface type ABAP-Dictionary Base interface. (IN ECC6.0 Version)

You will see two parts in screen Interface and context.


Step3: Drag and drop Global table GT_SPFLI from interface to context area.

Step4: Select all fields which are not required to display and deactivate the fields. (right click)
Step5: Select DATA under table GT_SPFLI and right click.

Go to create--> Loop

This will create a table i.e., a sub loop under the main loop.

Note: when you drag a table in to context it will internally create a loop processing in the form.
Step6: A dialog box will open asking for table which you want to loop inside main loop.

Step7: Click the F4 help button, it shows the tables that exists in the interface.
Step8: Select the table GT_SFLIGHT (item details)

It will internally create a sub loop i.e, a table GT_SFLIGHT under the table SPFLI data.

Step9: Select the fields which are not required to display and deactivate.
Step10: Double click table GT_SFLIGHT and go to the where conditions tab available in lower part of the
window.

Create the where condition for the table loop.

This internally creates below code.


Loop at GT_SPFLI.
Loop at GT_SFLIGHT where CARRID eq GT_SPFLI-CARRID
and CONNID eq GT_SPFLI-CONNID.

.............................. } -----> code processing


..............................
Endloop.
Endloop.

Step11: Go to Layout: in data view a nested loop (table) will be displayed.

SFLIGHT under SPFLI. Create the boiler plate objects if needed.


Step12: Drag and drop all the fields under GT_SPFLI table into body page.

Note: Do not drag the entire table into body page. We need to follow creating table using sub forms
concept.

Go to hierarchy view; Select all fields of spfli, Wrap the fields into sub form by right clicking.

Again wrap the sub form in to another sub form. Sub form properties are maintained latter.

Step13: Drag and drop the fields from sflight into body page and create sub forms as showed in below
snap. Keep note that the subforms created for sflight fields should be place inside the spflidata subform.
Maintain names as spflitable
'-->spflidata
'-->sflighttable
---> Sflightdata

Step14: Content of body page should be flowed.

Step15: Maintain the subforms properties as showed in the below snaps.

Subform: spflitable
Subform: spflidata

Subform: sflighttable
Subform: sflightdata

Step16: Now your FORM is ready, check for syntax and activate it.

Execute the form and follow the below to get the data in hierarchy level. Header and its corresponding
item details.
Output: Page1
Page2

You might also like