Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Subscreen in Screen Painter

Former Member
0 Likes
2,247

Hi Friends,

I have created a layout in screen painter using Tabstrip with wizard which is having Tabstrip control with four tabs.

Now I want to attach to table to each tab,so that I can input some data and save in the table.

I request you to kindly guide me as to how to do the same.

TIA.

Regards,

Mark K

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,016

Hi

Insert subscreens in 4 tabs and give names to those subscreens, and create these 4 screens and change the attributes of these screens to subscreen, and call them in main screen like this.

process before output.

  • MODULE STATUS_1000.

*

call subscreen: <subscreen area1> including sy-repid s_no, -> <b>Screen no variable</b>

<subscreen area2> including sy-repid s_no,

process after input.

module user_command_1000.

call subscreen : <subscreen area1>,<subscreen area2>.

In the main screen code the program somewhat like this.

&----


*& Module pool ZHTABSTRIP_CONTROL *

*& *

&----


*& *

*& *

&----


program zhtabstrip_control .

tables : lfa1,kna1,mara,vbak.

data : begin of itab occurs 0,

lifnr like lfa1-lifnr,

name1 like lfa1-name1,

kunnr like kna1-kunnr,

land1 like kna1-land1,

matnr like mara-matnr,

ersda like mara-ersda,

ernam like mara-ernam,

vbeln like vbak-vbeln,

erdat like vbak-erdat,

erzet like vbak-erzet,

end of itab.

controls : tabstrip type tabstrip.

data: s_no like sy-dynnr value 100. -> <b>screen no which u r calling for the subscreen.</b>

&----


*& Module USER_COMMAND_1000 INPUT

&----


  • text

----


module user_command_1000 input.

case sy-ucomm.

when 'VEND'.

s_no = 100.

tabstrip-activetab = 'VEND'.

when 'CUST'.

s_no = 200.

tabstrip-activetab = 'CUST'.

when 'MAT'.

s_no = 300.

tabstrip-activetab = 'MAT'.

when 'SD'.

s_no = 400.

tabstrip-activetab = 'SD'.

when 'EXIT'.

leave program.

endcase.

endmodule. " USER_COMMAND_1000 INPUT

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


module status_0100 output.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

select * from lfa1 into corresponding fields of table itab.

read table itab index 3.

lfa1-lifnr = itab-lifnr.

lfa1-name1 = itab-name1.

refresh itab.

endmodule. " STATUS_0100 OUTPUT

&----


*& Module STATUS_0200 OUTPUT

&----


  • text

----


module status_0200 output.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

refresh itab.

select * from kna1 into corresponding fields of table itab.

read table itab index 1.

kna1-kunnr = itab-kunnr.

kna1-land1 = itab-land1.

endmodule. " STATUS_0200 OUTPUT

&----


*& Module STATUS_0300 OUTPUT

&----


  • text

----


module status_0300 output.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

refresh itab.

select * from mara into corresponding fields of table itab.

read table itab index 5.

mara-matnr = itab-matnr.

mara-ersda = itab-ersda.

mara-ernam = itab-ernam.

endmodule. " STATUS_0300 OUTPUT

&----


*& Module STATUS_0400 OUTPUT

&----


  • text

----


module status_0400 output.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

refresh itab.

select * from vbak into corresponding fields of table itab.

read table itab index 7.

vbak-vbeln = itab-vbeln.

vbak-erdat = itab-erdat.

vbak-erzet = itab-erzet.

endmodule.

Hope this code will give you some idea.

Regards

Haritha.

Hi Friends,

I have created a layout in screen painter using Tabstrip with wizard which is having Tabstrip control with four tabs.

Now I want to attach to table to each tab,so that I can input some data and save in the table.

I request you to kindly guide me as to how to do the same.

TIA.

Regards,

Mark K

15 REPLIES 15
Read only

gopi_narendra
Active Contributor
0 Likes
2,016

Create subscreen for each tab and individually u need to handle each subscreen as a single screen.

Regards

- Gopi

Read only

Former Member
0 Likes
2,016

Place a sub screen on each tab and you can handle the sub screen the way you handle the normal screen. You can place a table control on each of the screens and write the PBO and PAI for the screens.

Regards,

Ravi

Note - Please mark all the helpful answers

Read only

0 Likes
2,016

Could u pls guide me as to how to create subscreen.

Regards,

Read only

0 Likes
2,016

Open the tab strip and drag and drop the SUB SCREEN element from the screen elements you have on the left handside, on the screen painter.

Now, create a screen for the program and mark that as subscreen in the attributes and call that subscreen when hit the appropriate TAB

see program DEMO_DYNPRO_SUBSCREENS for example.

Regards,

Ravi

Note - Please mark all the helpful answers

Read only

0 Likes
2,016

Hi

It's just as to create a screen, only you've to set the flag SUBSCREEN as dynpro type in the chararcteristics in screen painter.

Max

Read only

0 Likes
2,016

Check these programs for better understanding of tab strips.

demo_dynpro_tabstrip_local

demo_dynpro_tabstrip_server

Regards

- Gopi

Read only

Former Member
0 Likes
2,016

please follow this link its really useful.

<a href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/dbab6235c111d1829f0000e829fbfe/frameset.htm">http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/dbab6235c111d1829f0000e829fbfe/frameset.htm</a>

reward useful answers,

Regards,

Shrita Sharma

Read only

Former Member
0 Likes
2,017

Hi

Insert subscreens in 4 tabs and give names to those subscreens, and create these 4 screens and change the attributes of these screens to subscreen, and call them in main screen like this.

process before output.

  • MODULE STATUS_1000.

*

call subscreen: <subscreen area1> including sy-repid s_no, -> <b>Screen no variable</b>

<subscreen area2> including sy-repid s_no,

process after input.

module user_command_1000.

call subscreen : <subscreen area1>,<subscreen area2>.

In the main screen code the program somewhat like this.

&----


*& Module pool ZHTABSTRIP_CONTROL *

*& *

&----


*& *

*& *

&----


program zhtabstrip_control .

tables : lfa1,kna1,mara,vbak.

data : begin of itab occurs 0,

lifnr like lfa1-lifnr,

name1 like lfa1-name1,

kunnr like kna1-kunnr,

land1 like kna1-land1,

matnr like mara-matnr,

ersda like mara-ersda,

ernam like mara-ernam,

vbeln like vbak-vbeln,

erdat like vbak-erdat,

erzet like vbak-erzet,

end of itab.

controls : tabstrip type tabstrip.

data: s_no like sy-dynnr value 100. -> <b>screen no which u r calling for the subscreen.</b>

&----


*& Module USER_COMMAND_1000 INPUT

&----


  • text

----


module user_command_1000 input.

case sy-ucomm.

when 'VEND'.

s_no = 100.

tabstrip-activetab = 'VEND'.

when 'CUST'.

s_no = 200.

tabstrip-activetab = 'CUST'.

when 'MAT'.

s_no = 300.

tabstrip-activetab = 'MAT'.

when 'SD'.

s_no = 400.

tabstrip-activetab = 'SD'.

when 'EXIT'.

leave program.

endcase.

endmodule. " USER_COMMAND_1000 INPUT

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


module status_0100 output.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

select * from lfa1 into corresponding fields of table itab.

read table itab index 3.

lfa1-lifnr = itab-lifnr.

lfa1-name1 = itab-name1.

refresh itab.

endmodule. " STATUS_0100 OUTPUT

&----


*& Module STATUS_0200 OUTPUT

&----


  • text

----


module status_0200 output.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

refresh itab.

select * from kna1 into corresponding fields of table itab.

read table itab index 1.

kna1-kunnr = itab-kunnr.

kna1-land1 = itab-land1.

endmodule. " STATUS_0200 OUTPUT

&----


*& Module STATUS_0300 OUTPUT

&----


  • text

----


module status_0300 output.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

refresh itab.

select * from mara into corresponding fields of table itab.

read table itab index 5.

mara-matnr = itab-matnr.

mara-ersda = itab-ersda.

mara-ernam = itab-ernam.

endmodule. " STATUS_0300 OUTPUT

&----


*& Module STATUS_0400 OUTPUT

&----


  • text

----


module status_0400 output.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

refresh itab.

select * from vbak into corresponding fields of table itab.

read table itab index 7.

vbak-vbeln = itab-vbeln.

vbak-erdat = itab-erdat.

vbak-erzet = itab-erzet.

endmodule.

Hope this code will give you some idea.

Regards

Haritha.

Read only

0 Likes
2,016

Hi Haritha,

I have created the 4 different subscreens.

I would like to know as to when I click the Tab1, how to get the subscreen1.

Kindly guide me.

Regards,

Read only

0 Likes
2,016

HI,

When you click a TAB that tabs FCODE will be there in the ACTIVETAB filed of the tabstrip structure.

Then use the statement CALL SUBSCREEN <sub_area> including <program_name> <screen_number>. in PBO and

CALL SUBSCREEN <sub_area> in PAI.

Regards,

Sesh

Read only

0 Likes
2,016

Hi Mark,

Let me start from Scratch,

1. in PBO of screen painter,

CALL SUBSCREEN <subscreen area name> including <Module-pool programname> <Screen no.>.

2. In PAI (SE38).

CASE OK_CODE.

When 'TAB1'.

TAB-ACTIVETAB = 'TAB1'.

ENDCASE.

TAB1 Is the Function code which you would have given during design of tabstrip.

TAB is the Tabstrip name, infact it should be defined in SE38 as

CONTROLS TAB TYPE TABSTRIP. In declaration.

Hope this solves your issue.

Cheers...

Santosh.

PS: Mark All Usefull Answers.

Read only

Former Member
0 Likes
2,016

Hi

There is an icon in the screen painter after box icon, drag that and paste it in each tab.

Regards

Haritha.

Read only

Former Member
0 Likes
2,016

Hi

See the code which is highlighted.

controls : tabstrip type tabstrip.

data: s_no like sy-dynnr value 100. -> screen no which u r calling for the subscreen.

&----


*& Module USER_COMMAND_1000 INPUT

&----


  • text

----


module user_command_1000 input.

case sy-ucomm.

when 'VEND'.

<b>s_no = 100. -> You are calling the subscreen 100

tabstrip-activetab = 'VEND'. -> You r activating the vendor tab </b>

when 'CUST'.

<b>s_no = 200. -> You are calling the subscreen 200

tabstrip-activetab = 'CUST'. -> You r activating the vendor tab </b>

when 'MAT'.

<b>s_no = 300.

tabstrip-activetab = 'MAT'.</b>

when 'SD'.

<b>s_no = 400.

tabstrip-activetab = 'SD'.</b>

when 'EXIT'.

leave program.

endcase.

endmodule. " USER_COMMAND_1000 INPUT

Regards

Haritha

Message was edited by:

Haritha Ramayanam

Read only

0 Likes
2,016

Hi Haritha,

What is 'VEND', 'CUST' and 'MAT'. These indicate which names and from where will I get these details.

Pls.

Regards,

Read only

0 Likes
2,016

hi,

Those are the Names of Tabs in Tabstrip.

Cheers...

Santosh