当前位置:网站首页>SAP ABAP sub screen tutorial: call sub screen -010 in SAP

SAP ABAP sub screen tutorial: call sub screen -010 in SAP

2022-06-22 16:22:00 Boating in rainy days

SAP ABAP Sub screen tutorial : stay SAP Call the sub screen in -010

Before reading this tutorial , Please make sure you know what a dialog program is …

Sub screen

  • The sub screen is displayed in another (“ Lord ”) A separate screen in the screen area .
  • Sub screens allow you to embed one screen into another at runtime . You can include multiple sub screens on the main screen .
  • The term “ Sub screen ” Both for embedded screens , It is also applicable to the area where the sub screen is placed on the main screen . This tutorial is about sub screen areas . If defined in the screen properties , Through SE51 The actual screen created by a transaction is called a sub screen .
  • When using a sub screen , The flow logic embedded in the screen will also be embedded in the flow logic of the main screen . therefore , Using a sub screen on a screen is like using a ABAP The program uses the same .

To use a sub screen , You must follow three simple steps

  1. Define the sub screen area on the screen
  2. Define appropriate sub screens
  3. Include sub screens in the sub screen area .

in addition , You need to adjust the frame of the sub screen and the main screen . You need to name it in the field name field .

Besides , You also need to adjust the fields in the sub screen , To make it appear on the main screen .
If the sub screen is defined to be larger than the available area in the main screen , Only the part of the sub screen suitable for the available area is visible .
This area is always measured from the upper left corner of the screen . therefore , When defining a sub screen area and creating a sub screen , You should be extra careful .

example

for example , ad locum , We have defined two sub screen areas on the main screen , And attach two different sub screens to the corresponding area . Whenever the main screen is called , Will call the main screen PBO. But before the display , Of each screen PBO Connected to the sub screen area on the main screen , Also known as PBO.
 Insert picture description here

You can use... In the flow logic of the home screen CALL Sub screen statements include sub screens .

To include a sub screen in the sub screen area of the main screen and call its PBO Stream logic , On the main screen PBO The following statements are used in the event :

PROCESS BEFORE OUTPUT.

CALL SUBSCREEN <area> INCLUDING [<prog>] <dynp>.

This sentence will be numbered dynp The sub screen of is assigned to a sub screen named area Sub screen area of . You can also specify the program in which the sub screens are defined ( Optional ).
If the program is not explicitly specified , The system will be in the same... As the main program ABAP Find the sub screen in the program .
If the corresponding sub screen is not found , A runtime error will occur . Subscreen PBO Flow logic is also included at the same point .
This can call the... That defines the sub screen ABAP programmatic PBO modular .
On the sub screen PBO At the end of , The global field in the program will be passed to any screen field with the same name in the sub screen .
Subscreen PBO The flow logic itself can include other sub screens .

You must directly enter the name of the sub screen area < Area >, Do not use an inverted comma .
You can put the name prog and dynp Specify as text or variable .
If using variables , Must be in ABAP A variable with the same name is declared and filled in the program . Screen number dynp The length must be 4 Characters .
If a sub screen is not assigned to an area , The area will remain empty .

To call the... Of the sub screen PAI Stream logic , On the main screen PAI The following statements are used in the flow logic :

PROCESS AFTER INPUT.

CALL SUBSCREEN <area>.

This statement includes PBO Event sub screen area < Area > Of the sub screens included in PAI Stream logic .
This can call the... That defines the sub screen ABAP programmatic PAI modular .
It's triggering PAI When an event is , Or on the sub screen PAI Corresponding in flow logic FIELD Statement place , Fields with the same name and... In the sub screen ABAP Transfer data between programs .

Key points to remember

  • The names of sub screen elements within the screen should be unique
  • You should not attach... To a sub screen OK_CODE or FCODE. The main screen itself OK_CODE Is a sub screen OK_CODE
  • The sub screen must not contain any setting title bar 、 Set up PF state 、 Set up the screen 、 Off screen or off screen dialog module . This will result in runtime errors .
  • You need the flow logic on the home screen (PBO and PAI) Call it in .
  • Calling a sub screen... Is not allowed in the chain .ENDCHAIN and LOOP ENDLOOP sentence
  • Can not have AT EXIT Command module
  • The fields you use are global fields . They must be declared at the top , Include
  • If you use sub screens in other dialog programs , Unless you add a specific code , Otherwise, data transmission will not be carried out .

Reference resources :https://www.guru99.com/abap-subscreens.html

原网站

版权声明
本文为[Boating in rainy days]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206221500489109.html