ABAP Subscreens Tutorial: Call Subscreen in SAP - Shikshaglobe

Content Creator: Satish kumar

ABAP Subscreens Tutorial: Call Subscreen in SAP

Subscreens in SAP ABAP are a powerful feature that allows you to display multiple screens within a single screen. This functionality is particularly useful when you want to break down complex processes into smaller, manageable parts, or when you need to present related information together. In this tutorial, we will learn how to call subscreens in SAP and how to pass data between the main screen and the subscreen.

1.     Creating the Subscreen: The first step is to create a subscreen in the ABAP Dictionary. Go to the transaction code SE51 and select the "Subscreen" option. Define the subscreen attributes like the number, name, and screen type. You can design the subscreen using the Screen Painter, just like you do for regular screens.

2.     Creating the Main Screen: Next, create the main screen that will contain the subscreen. Use the Screen Painter (SE51) to design the main screen and leave space where you want the subscreen to appear. Assign a unique screen number to the main screen.

3.     Define Subscreen Area: To call the subscreen in the main screen, define a subscreen area. Go to the main screen's flow logic, and declare a subscreen area using the following syntax: INCLUDE .

4.     Pass Values to the Subscreen: Before calling the subscreen, you may need to pass some values from the main screen. Declare the variables in the main screen's PBO (Process Before Output) module. To pass values to the subscreen, assign the values to the corresponding subscreen field using the following syntax: SUBSCREEN FIELD .

5.     Call the Subscreen: In the main screen's PBO module, write the logic to call the subscreen using the following syntax: CALL SUBSCREEN . This statement will load the subscreen in the defined subscreen area during the screen processing.

6.     Process the Subscreen Data: When the subscreen is called, the control is transferred to the subscreen. Process the data on the subscreen, and if required, perform validations and calculations.

7.     Return to the Main Screen: After the processing on the subscreen is complete, use the following syntax to return to the main screen: LEAVE TO SCREEN . This statement will transfer the control back to the main screen at the specified screen number.

8.     Display the Main Screen: In the main screen's PAI (Process After Input) module, write the logic to display the main screen with the updated data after returning from the subscreen.

9.     Handle User Input: In the main screen's PAI module, handle user input and process the data as per your application requirements. If you need to call the subscreen again based on specific conditions, use the statement CALL SUBSCREEN again.

10. Debugging and Testing: To ensure that the subscreen integration works as expected, set breakpoints and debug the main screen and subscreen processing. Test different scenarios and validate the data flow between the main screen and the subscreen.

Click here for details

CALL SUBSCREEN

A subscreen is a free screen that is shown in a space of another ("principal") screen. Subscreens permit you to insert one screen inside one more at runtime. You can remember numerous sub-evaluates for primary screen. The term subscreen applies both to the screen that you implant, and the region on the principal screen in which you place it. This instructional exercise is about subscreen regions. The genuine screens made through SE51 exchange, are called subscreen screens in the event that characterized in screen credits. At the point when you utilize a subscreen, the stream rationale of the implanted screen is likewise installed in the stream rationale of the primary screen. Hence, Using subscreens on screens is like utilizing remembers for ABAP programs.

To utilize a subscreen, you should follow three straightforward advances

Characterize the subscreen area(s) on a screen

Characterize reasonable subscreen screens

Incorporate the subscreen screen in the subscreen region.

Likewise, you want to change the edge of sub-screen and fundamental screen. You want to name it in the field name field.Further, you likewise need to change the fields inside the subscreen to cause them to show up in primary screen. On the off chance that the sub-screen is characterized to be bigger than the accessible region in the principal screen, just the piece of subscreen will be noticeable that fits in the region accessible. The region is constantly estimated from the upper left corner of screen. Thus you ought to take sufficient consideration while characterizing sub-screen regions and making sub-screens.

Model

Experience the difference

For example here we have characterized two sub-screen regions on primary screen and have connected two different Sub-screen to comparing regions. At the point when principal screen is called, the PBO of fundamental screen is called. Be that as it may, before show, the PBO's of each screen joined with sub-screen regions on fundamental screen are likewise called.

ABAP Subscreens Tutorial: Call Subscreen in SAP

You can incorporate a subscreen screen involving the CALL SUBSCREEN proclamation in the stream rationale of the fundamental screen To incorporate a subscreen screen in the subscreen region of the primary screen and call its PBO stream rationale, utilize the accompanying assertion in the PBO occasion of the principal screen: This assertion doles out the subscreen screen with number to the subscreen region called . You can likewise determine the program where the subscreen screen is characterized (discretionary). On the off chance that you don't determine the program unequivocally, the framework searches for the subscreen screen in a similar ABAP program as the fundamental program. On the off chance that it doesn't find a relating subscreen screen, a runtime mistake happens. The PBO stream rationale of the subscreen screen is additionally included at a similar point. This can call PBO modules of the ABAP program in which the subscreen screen is characterized. Toward the finish of the subscreen PBO, the worldwide fields from the program are passed to any indistinguishably named screen fields in the subscreen screen. The PBO stream rationale of the subscreen screen could itself at any point incorporate further subscreens. The name of the subscreen region should be placed straightforwardly without transformed commas. You can determine the names and either as literals or factors. Assuming that you use factors, you should proclaim and fill indistinguishably named factors in the ABAP program. The screen number should be 4 characters in length. In the event that you don't dole out a subscreen screen to an area, it stays unfilled.

Take the next step

To call the PAI stream rationale of the subscreen screen, utilize the accompanying assertion in the PAI stream rationale of the principal screen:

This assertion incorporates the PAI stream rationale of the subscreen screen remembered for the subscreen region in the PBO occasion. This can call PAI modules of the ABAP program in which the subscreen screen is characterized. Information is shipped between indistinguishably named fields in the subscreen screen and the ABAP program either when the PAI occasion is set off, or at the relating FIELD proclamations in the PAI stream rationale of the subscreen screen.

Focuses to Remember

Names of components of sub-screens inside a screen ought to be novel

You shouldn't have OK_CODE or FCODE connected with sub-screen. The OK_CODE of primary screen itself is OK_CODE of sub-screen

Sub-screens can't have any exchange modules containing SET TITLEBAR, SET PF-STATUS, SET SCREEN, LEAVE SCREEN or LEAVE TO SCREEN. This will cause runtime mistake.

You really want to call it in the stream rationale (both PBO and PAI) of the primary screen.

CALL SUBSCREEN isn't permitted in CHAIN..ENDCHAIN and LOOP ENDLOOP articulations

Can not have an AT EXIT-COMMAND module

The fields that you use are the worldwide fields. They should be announced in the top incorporate

In the event that utilizing subscreens from another discourse program the information move won't occur except if you add explicit code.

Conclusion: Using subscreens in SAP ABAP can significantly enhance the user experience and improve the organization of complex processes. By following this tutorial, you have learned how to create and call subscreens in SAP, as well as how to pass data between the main screen and the subscreen. With this knowledge, you can now design more efficient and user-friendly SAP applications that leverage the power of subscreens.


Take the next step

Take More 

SAP ABAP Interview Questions & Answers
SAP ABAP BDC (Batch Data Communication) Tutorial
What is ABAP? Full Form, Meaning, HistoryWhat is Non-Functional Requirement? Types and Examples

Tags:

abap subscreens tutorialabap subscreens tutorial answersabap subscreens tutorial and tutorialabap subscreens tutorial and guideabap subscreens tutorial and questionsabap subscreens tutorial and trainingabap sunscreens tutorial androidabap sunscreens tutorial after ediblesabap subscreen tutorial areaabap subscreen tutorial abapabap subscreen tutorial ausblendenabap subscreens tutorial bookabap subscreens tutorial beginnersabap subscreens tutorial book pdfabap subscreens tutorial bookletabap sunscreens tutorial beginnerabap sunscreens tutorial black girlabap subscreens tutorial bdc sunscreenabap subscreens tutorial codeabap subscreens tutorial classabap subscreens tutorial c#abap sunscreens tutorial centerabap subscreen tutorial commandabap subscreen tutorial controlabap subscreen tutorial callabap subscreen tutorial createabap subscreen tutorial containerabap subscreens tutorial dataabap subscreens tutorial downloadabap subscreens tutorial dateabap subscreens tutorial datasetabap sunscreens tutorial de maquillajeabap sunscreens tutorial de maquillaje de ojosabap subscreen tutorial dynamic sizeabap subscreen tutorial dynproabap subscreen tutorial dynamicabap subscreen tutorial dynpro nameabap subscreens tutorial exampleabap subscreens tutorial errorabap subscreens tutorial excelabap subscreens tutorial easyabap subscreens tutorial examabap sunscreens tutorial easy slowabap subscreen tutorial exitabap subscreens tutorial for beginnersabap subscreens tutorial for dummiesabap sunscreens tutorial for beginners pdfabap sunscreens tutorial freeabap subscreen tutorial from another programabap subscreens tutorial guideabap subscreens tutorial githubabap subscreens tutorial guru99abap subscreens tutorial guiabap sunscreens tutorial guitarabap subscreens tutorial get sunscreen numberabap subscreens tutorial helpabap subscreens tutorial htmlabap subscreens tutorial howabap sunscreens tutorial how to useabap sunscreens tutorial how to wearabap subscreen tutorial hideabap subscreens tutorial in sapabap subscreens tutorial in javaabap subscreens tutorial in oracleabap sunscreens tutorial illustratorabap sunscreens tutorial islandabap sunscreens tutorial iphoneabap subscreen tutorial in screenabap subscreen tutorial in containerabap subscreen tutorial in selection screenabap subscreen tutorial includingabap subscreens tutorial javaabap subscreens tutorial javascriptabap subscreens tutorial javatpointabap subscreens tutorial keyabap subscreens tutorial keywordabap subscreens tutorial levelabap subscreens tutorial loginabap subscreens tutorial linkabap subscreens tutorial learnabap subscreens tutorial lababap sunscreens tutorial linuxabap sunscreens tutorial long hairabap subscreen tutorial leaveabap subscreens tutorial modelabap subscreens tutorial manualabap subscreens tutorial moduleabap subscreens tutorial modeabap sunscreens tutorial macabap sunscreens tutorial minecraftabap sunscreens tutorial musicabap subscreen tutorial module poolabap subscreen tutorial modifyabap subscreens tutorial not workingabap subscreens tutorial nameabap subscreens tutorial numberabap subscreens tutorial not foundabap subscreens tutorial no codeabap sunscreens tutorial naturalabap sunscreens tutorial natural hairabap sunscreens tutorial natural lookabap subscreen tutorial no dynpro nameabap subscreen tutorial no dynpro numberabap subscreens tutorial onlineabap subscreens tutorial oracleabap subscreens tutorial objectabap sunscreens tutorial on youtubeabap subscreen tutorial ok codeabap subscreens tutorial pdfabap subscreens tutorial pageabap subscreens tutorial page numberabap sunscreens tutorial pointabap sunscreens tutorial pythonabap subscreen tutorial pboabap subscreen tutorial paiabap subscreen tutorial push buttonabap subscreens tutorial questionsabap subscreens tutorial quizletabap subscreens tutorial questions and answersabap sunscreens tutorial quiz answersabap sunscreens tutorial quizabap sunscreens tutorial quiz answers quizletabap subscreens tutorial redditabap subscreens tutorial resultsabap subscreens tutorial resumeabap subscreens tutorial reportabap subscreens tutorial runabap sunscreens tutorial request formabap sunscreens tutorial rabap subscreen tutorial reloadabap subscreen tutorial resizingabap subscreens tutorial tutorialsabap subscreens tutorial tutorialspointabap subscreen tutorial sizeabap subscreen tutorial screenabap subscreen tutorial selection screenabap subscreen tutorial setabap subscreen tutorial subscreenabap subscreen tutorial splitterabap subscreens tutorial tableabap subscreens tutorial tutorialforbeginnerabap sunscreens tutorial tumblrabap subscreens tutorial tabstrip sunscreenabap subscreens tutorial urlabap subscreens tutorial usingabap subscreens tutorial userabap sunscreens tutorial unityabap subscreen tutorial user commandabap subscreens tutorial videoabap subscreens tutorial w3schoolsabap subscreens tutorial with examplesabap sunscreens tutorial windowsabap sunscreens tutorial walkthroughabap subscreen tutorial writeabap subscreens tutorial xmlabap subscreens tutorial xpathabap subscreens tutorial youtubeabap subscreens tutorial youtube videoabap subscreens tutorial zoneabap subscreens tutorial zscalerabap subscreens tutorial z/osabap subscreens tutorial zshabap sunscreens tutorial 1 storyabap subscreens tutorial 2024-25

Featured Universities

Mahatma Gandhi University

Location: Soreng ,Sikkim , India
Approved: UGC
Course Offered: UG and PG

MATS University

Location: Raipur, Chhattisgarh, India
Approved: UGC
Course Offered: UG and PG

Kalinga University

Location: Raipur, Chhattisgarh,India
Approved: UGC
Course Offered: UG and PG

Vinayaka Missions Sikkim University

Location: Gangtok, Sikkim, India
Approved: UGC
Course Offered: UG and PG

Sabarmati University

Location: Ahmedabad, Gujarat, India
Approved: UGC
Course Offered: UG and PG

Arni University

Location: Tanda, Himachal Pradesh, India.
Approved: UGC
Course Offered: UG and PG

Capital University

Location: Jhumri Telaiya Jharkhand,India
Approved: UGC
Course Offered: UG and PG

Glocal University

Location: Saharanpur, UP, India.
Approved: UGC
Course Offered: UG and PG

Himalayan Garhwal University

Location: PG, Uttarakhand, India
Approved: UGC
Course Offered: UG and PG

Sikkim Professional University

Location: Sikkim, India
Approved: UGC
Course Offered: UG and PG

North East Frontier Technical University

Location: Aalo, AP ,India
Approved: UGC
Course Offered: UG and PG