SlideShare uma empresa Scribd logo
1 de 70
Dialog Programming Overview
SAP System : Dialog Processing
(Report)
SAP GUI
Report zpsm1.
Tables customers.

Reques
t

Application Server

List

Select single * from

Generate
1
10
Screen(List)
Send Request

Store request
to queue
3

customers where id = 1.
Write: / customers-name.

Dispatcher
Send
List
9

2

Request
Queue Send request
to WP
4

D

SAP Buffer

Search for
free WP
Check Program in
Program Buffer
5

D

D

…

Program
…

D

…

8

Database Server

SQL
Request

6

Load&Gen
Program

7

Execute
ABAP
stateme
nt
Dialog WP : Executable Program
Dialog WP
TaskHandler

Local Memory
Memory
Space

ABAP Processor
DYNPRO Processor

DB Interface
Result Set Memory

Database

List Buffer
Types of ABAP Report
1
3

1. Report Listing

4

2. Drill-down Report
3. Control-break Report
4. ALV Report
SAP System : Dialog Processing
(DIALOG)
SAP GUI
Program sapmzex001.

Reques
t

Application Server

Include ….

Screen

Set screen 100.

Generate Dialog
1
10
Screen
Send Request

Store request
to queue
3

…

Dispatcher
Send
List
9

2

Request
Queue Send request
to WP
4

D

SAP Buffer

Search for
free WP
Check Program in
Program Buffer
5

D

D

…

Program
…

D

…

8

Database Server

SQL
Request

6

Load&Gen
Program

7

Execute
ABAP
stateme
nt
Dialog WP : Dialog Program
Dialog WP
TaskHandler

Local Memory
ABAP Memory

ABAP Processor
DYNPRO Processor

DB Interface
Result Set Memory

Database

Screen Buffer
Dialog Program : Transaction
Dialog Program Components
Transaction Code
Transaction Code

Dialog Program
Dialog Program

Program Naming Convention : SAPM…

PBO

(Screen Layout)

ABAP Module Pool

Flow Logic

Screen : 200
(Screen Layout)

ABAP Module Pool

PAI

Screen : 100

PBO

ABAP Module Pool

PAI

ABAP Module Pool

Flow Logic
SAP Transaction
DB Commit





DB Commit

An SAP transaction consists of Dialog steps. A Dialog step
begins when the user press Enter,activates a function by
pressing a function key,double-clicks or chooses a function from
a menu.It ends when the next screen is display
In the course of a Dialog step,The PAI modules belonging to the
current screen and the PBO modules belonging to the next
screen
Data Transfer (Local Memory)
Local Memory

Screen Work Area

ABAP Work Area

ok_code

Screen Buffer
Element List

PBO

ABAP Memory Space
customers
id
…
0000000

customers-id
customers-name

PAI

ok_code

name

city
Flow Logic


Process Before Output(PBO)




After it has processed all of the modules in the
PBO processing block, the system copies the
contents of the fields in the ABAP work area to
their corresponding fields in the screen work area.

Process After Input(PAI)


Before it processes the first module in the PAI
processing block, the system copies the contents
of the fields in the screen work area to their
corresponding fields in the ABAP work area.
OK Code Field in Screen
OK Code Field or
Command Field
(ok_code in Element List)
Defining Screen (4 Steps)





Screen Attribute
Screen Layout
Flow Logic
Element List

Element
List(ok_code
field)
Flow Logic in Screen 100
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
PBO in Screen 100
MODULE status_0100 OUTPUT.
SET PF-STATUS ‘0100’.
SET TITLEBAR ‘0100’.
ENDMODULE.
PAI in Screen 100
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN ‘EXIT’.
“Leave

program

SET SCREEN 0. LEAVE SCREEN. “Leave to

screen 0

WHEN ‘SAVE’.
UPDATE customers.
MESSAGE S000(38) WITH ‘Update OK’.
SET SCREEN 50. LEAVE SCREEN.
ENDCASE.
ENDMODULE.
How to Create Dialog
Program








Transaction SE80 : Create Dialog Program
Create Screen(4 steps)
 Screen Attribute
 Screen Layout
 Flow Logic(PBO,PAI)
 Define Variable ok_code in Element List
Define Data Object in ABAP Work Area at
TOP Include(Tables, Data,...)
Check and Activate Dialog Program
Create Transaction Code
Example I
Maintain Customers Data
Screen : 100

Screen : 200
Example I


Create Dialog Program SAPMZEX< nn> for
changing Customers table
 Screen 100
 Field customers-id
 Screen 200
 Field customers-id and customers-name
Example I


Screen 100
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
Example I


Screen 100
MODULE status_0100 OUTPUT.
SET PF-STATUS ‘0100’.
SET TITLEBAR ‘0100’.
ENDMODULE.
Example I


Screen 100
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN ‘BACK’.
LEAVE PROGRAM. “leave to screen 0
WHEN space. “if not assign Enter Key
SELECT SINGLE * FROM customers
WHERE id = customers-id.
LEAVE TO SCREEN 200.
ENDCASE.
ENDMODULE.
Example I


Screen 200
PROCESS BEFORE OUTPUT.
MODULE STATUS_0200.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0200.
Example I


Screen 200
MODULE status_0200 OUTPUT.
SET PF-STATUS ‘0200’.
SET TITLEBAR ‘0200’.
ENDMODULE.
Example I


Screen 200

MODULE user_command_0200 INPUT.
CASE ok_code.
WHEN ‘BACK’.
LEAVE TO SCREEN 100. “set screen 100
WHEN ‘SAVE’.
UPDATE customers.
MESSAGE S000(38) WITH ‘Update OK!’.
LEAVE TO SCREEN 100.
ENDCASE.
ENDMODULE.
Example I


TOP Include

TABLES customers.
DATA ok_code TYPE sy-ucomm.


Create Transaction Code

Transaction Code : ZEX<nn>
Exercise
Create Dialog Program : SAPMZCUST<nn >
Transaction Code : ZCUST<nn >
Exercise : Customers Maintenance
Screen : 100

Screen : 200
Setting the Cursor Position Dynamically
PROCESS BEFORE OUTPUT.
MODULE STATUS_0200.
MODULE set_cursor.

MODULE set_cursor OUTPUT.
SET CURSOR FIELD ‘CUSTOMERS-CITY’
OFFSET 3.
ENDMODULE.

Cursor Position
Avoiding the Unexpected
Processing Step of ok_code Field
1. Auxiliary OK_CODE Variable


TOP Include

TABLES customers.
DATA ok_code TYPE sy-ucomm.
DATA save_ok TYPE sy-ucomm.
Example I - Change


Screen 100 : PAI
MODULE user_command_0100 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN ‘BACK’.
LEAVE PROGRAM.
WHEN space.
SELECT SINGLE * FROM customers WHERE id = customers-id.
LEAVE TO SCREEN 200.
ENDCASE.
ENDMODULE.
Example I - Change


Screen 200 : PAI
MODULE user_command_0200 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN ‘BACK’.
LEAVE TO SCREEN 100.
WHEN space.
LEAVE TO SCREEN 200.
WHEN ‘SAVE’.
UPDATE customers.
MESSAGE s000(38) WITH ‘Update OK!’.
LEAVE TO SCREEN 100.
ENDCASE.
ENDMODULE.
2. Specify the Enter Function at GUI Status
Check Enter Function


Screen 100 : PAI
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN ‘BACK’.
LEAVE PROGRAM.
WHEN ‘ENTE’.
SELECT SINGLE * FROM customers
WHERE id = customers-id.
LEAVE TO SCREEN 200.
ENDCASE.
ENDMODULE.
3. Clear OK_CODE at PBO


Screen 100 : Flow Logic
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
MODULE clear_ok_code.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
Clear OK_CODE at PBO


Screen 100 : PBO
MODULE status_0100 OUTPUT.
SET PF-STATUS ‘0100’.
SET TITLEBAR ‘0100’.
ENDMODULE.
MODULE clear_ok_code OUTPUT.
CLEAR ok_code.
ENDMODULE.
Checking User Input
Example II
Maintain Customers Data
 Check Input Data Manually
Example II


Screen 100 : PAI
MODULE user_command_0100 INPUT.
...
WHEN SPACE.
SELECT SINGLE * FROM customers WHERE id = customers-id.
IF sy-subrc <> 0.
MESSAGE S000(38) WITH ‘Customers data not found’.
LEAVE TO SCREEN 100.
ELSE.
LEAVE TO SCREEN 200.
ENDIF.
ENDCASE.
ENDMODULE.
Example III
Maintain Customers Data
 Check Input Data Using Field
Command
Example III – Field Statement


Screen 100 : Flow Logic (PAI)
PROCESS AFTER INPUT.
FIELD customers-id MODULE user_command_0100.
Example III


Screen 100 : PAI
MODULE user_command_0100 INPUT.
...
WHEN SPACE.
SELECT SINGLE * FROM customers WHERE id = customers-id.
IF sy-subrc <> 0.
MESSAGE E000(38) WITH ‘Customers data not found’.
ELSE.
LEAVE TO SCREEN 200.
ENDIF.
ENDCASE.
ENDMODULE.
Field Input Checking




If you want to check input values in the module
pool and start dialog in the event of a negative
result,you use the FIELD statement with the
addition MODULE.
If the module results in an error(E) or warning(W)
message,the screen is redisplayed without
processing the PBO modules.The message text
is displayed and only the field being checked by
this module becomes ready for input again
Field Statement With More Than 1 Field


Screen 100 : Flow Logic (PAI)
PROCESS AFTER INPUT.
CHAIN.
FIELD: customers-id,customers-custtype
MODULE user_command_0100.
ENDCHAIN.

PROCESS AFTER INPUT.
CHAIN.
FIELD customers-id MODULE user_command_0100.
FIELD customers-custtype MODULE user_command_0100.
ENDCHAIN.
Field Statement & Data Transport
PROCESS AFTER INPUT.
•Transfer f3,f4
MODULE a.
•Call module a
FILED f1 MODULE b. •Transfer f1
•Call module b
FILED f2 MODULE c.
•Transfer f2
•Call module c
MODULE d.

Screen 100
f1
f3

f2
f4

•Call module d
Required Field
Required Field
Required Field
At exit-command
Function Type : Exit
Command
At exit-command




When user chooses a function with type
E,the screen flow logic jumps directly to the
following statement
MODULE <module> AT EXIT-COMMAND
No other screen fields are transported to the
program except OK Code field
At exit-command


Screen 100 : Flow Logic
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
PROCESS AFTER INPUT.
MODULE exit AT EXIT-COMMAND.
MODULE USER_COMMAND_0100.
At exit-command


Screen 100 : PAI
MODULE exit INPUT.
CASE ok_code.
WHEN ‘EXIT’.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE.

LEAVE PROGRAM.
Function Module
(POPUP_TO_CONFIRM_LOSS_OF_DAT
A)
Example IV
Maintain Customer Data
 Popup confirmation data using function
‘POPUP_TO_CONFIRM_LOSS_OF_DATA’
Example IV


TOP Include
...
DATA ans.
Example IV


Screen 100 : PAI
MODULE exit INPUT.

CALL FUNCTION ‘POPUP_TO_CONFIRM_LOSS_OF_DATA ’
EXPORTING
textline1 = ‘Are you sure?’
titel
= ‘Please Confirm!!!’
IMPORTING
answer = ans.
IF ans = ‘J’. “J = Ja in German= Yes in English
LEAVE PROGRAM.
ELSE.
ENDIF.

ENDMODULE.
SAP Transaction : Enqueue Lock
Object
SAP Transaction & DB Transaction






Each Dialog step can contain update
requests(INSERT,DELETE,UPDATE)
After each Dialog step,the R/3 system
automatically passes a database commit to the
database system.The database system then
distributes the update requests from the individual
dialog steps across several database transactions
A rollback in one Dialog step has no effect on
database updates performed in previous Dialog
steps
SAP Transaction(LUW)
DB Commit

DB LUW

SAP LUW

DB Commit
SAP Database Maintenance Steps






Check data locking by calling function
‘ENQUEUE_<lock object>’
Read data from Database Ex. Select single …
Data Processing Ex. Update ...
Release lock by calling function
‘DEQUEUE_<lock object>’
SAP Lock Object


Transaction SE11 : Lock object



ENQUEUE_<lock object>
DEQUEUE_<lock object>
SAP Lock Object : Function Module
Example IV


ENQUEUE /DEQUEUELock Object(SE11)
CALL FUNCTION ‘ENQUEUE_EZCUST<nn> ’
CALL FUNCTION ‘DEQUEUE_EZCUST<nn> ’

User 1

User 2
Example IV (I)



Screen 100 : PAI

MODULE user_command_0100 INPUT.
...
WHEN SPACE.
CALL FUNCTION ‘ENQUEUE_EZCUST00’
EXPORTING
…
id = customers-id
EXCEPTIONS
...
IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ELSE.
SELECT SINGLE * FROM customers WHERE id = customers-id.
...
Example IV (II)


Screen 100 : PAI
MODULE user_command_0100 INPUT.
...
WHEN SPACE.
CALL FUNCTION ‘ENQUEUE_EZCUST00’
EXPORTING
message id sy-msgid type
id = customers-id
sy-msgty number
...
sy-msgno with
IF sy-subrc <> 0.
sy-msgv1 sy-msgv2
CONCATENATE ‘Data was locked by :’ sy-msgv1 INTO mess.
sy-msgv3 syMESSAGE E000(38) WITH mess. msgv4.
ELSE.
SELECT SINGLE * FROM customers WHERE id = customers-id.
...
Example IV


Screen 200 : PAI
MODULE user_command_0200 INPUT.
...
WHEN ‘BACK’.
CALL FUNCTION ‘DEQUEUE_EZCUST00’
EXPORTING
…
id = customers-id.
LEAVE TO SCREEN 100.
…
Example IV


Screen 200 : PAI
MODULE user_command_0200 INPUT.
...
WHEN ‘SAVE’.
UPDATE customers.
MESSAGE S000(38) WITH ‘Update OK!’.
CALL FUNCTION ‘DEQUEUE_EZCUST00’
EXPORTING
…
id = customers-id.
LEAVE TO SCREEN 100.
...
...
Monitoring Enqueue Lock : SM12

Mais conteúdo relacionado

Destaque

Task two ePortfolio
Task two ePortfolioTask two ePortfolio
Task two ePortfolio
KelsiAtMIT
 
Prezentace pro 25.výročí
Prezentace pro 25.výročíPrezentace pro 25.výročí
Prezentace pro 25.výročí
La-Bamba
 
Sap gui 720 training
Sap gui 720 trainingSap gui 720 training
Sap gui 720 training
Hari Singh
 
Sap gui administration_guide
Sap gui administration_guideSap gui administration_guide
Sap gui administration_guide
Vivek Srivastava
 

Destaque (16)

Task two ePortfolio
Task two ePortfolioTask two ePortfolio
Task two ePortfolio
 
Bai thu
Bai thuBai thu
Bai thu
 
Halloween
HalloweenHalloween
Halloween
 
Prezentace pro 25.výročí
Prezentace pro 25.výročíPrezentace pro 25.výročí
Prezentace pro 25.výročí
 
My Crowdfunding Experience
My Crowdfunding ExperienceMy Crowdfunding Experience
My Crowdfunding Experience
 
Sap fico
Sap ficoSap fico
Sap fico
 
Sap-fi Material
Sap-fi  MaterialSap-fi  Material
Sap-fi Material
 
Sap gui
Sap guiSap gui
Sap gui
 
SAP Material Managament Class 1 Sample
SAP Material Managament  Class 1 SampleSAP Material Managament  Class 1 Sample
SAP Material Managament Class 1 Sample
 
SAP GUI and Navigation - Quick Guide
SAP GUI and Navigation - Quick Guide SAP GUI and Navigation - Quick Guide
SAP GUI and Navigation - Quick Guide
 
Sap gui 720 training
Sap gui 720 trainingSap gui 720 training
Sap gui 720 training
 
SAP S4HANA : Learn From Our Implementation Journey
SAP S4HANA : Learn From Our Implementation JourneySAP S4HANA : Learn From Our Implementation Journey
SAP S4HANA : Learn From Our Implementation Journey
 
Sap gui administration_guide
Sap gui administration_guideSap gui administration_guide
Sap gui administration_guide
 
Innovations in Logistics with S4HANA Enterprise Management 1511
 Innovations in Logistics with S4HANA Enterprise Management 1511 Innovations in Logistics with S4HANA Enterprise Management 1511
Innovations in Logistics with S4HANA Enterprise Management 1511
 
SAP S/4 HANA - SAP sFIN (Simple Finance) - Financial Reporting and Advanced A...
SAP S/4 HANA - SAP sFIN (Simple Finance) - Financial Reporting and Advanced A...SAP S/4 HANA - SAP sFIN (Simple Finance) - Financial Reporting and Advanced A...
SAP S/4 HANA - SAP sFIN (Simple Finance) - Financial Reporting and Advanced A...
 
SAP ECC Ehp7 + bw 7.4
SAP  ECC Ehp7 + bw 7.4SAP  ECC Ehp7 + bw 7.4
SAP ECC Ehp7 + bw 7.4
 

Semelhante a 08.abap dialog programming overview

Module-Pool-Tutorial.pdf
Module-Pool-Tutorial.pdfModule-Pool-Tutorial.pdf
Module-Pool-Tutorial.pdf
Suman817957
 
Complete reference to_abap_basics
Complete reference to_abap_basicsComplete reference to_abap_basics
Complete reference to_abap_basics
Abhishek Dixit
 
LIMS_DOCUMENTATION
LIMS_DOCUMENTATIONLIMS_DOCUMENTATION
LIMS_DOCUMENTATION
RAHUL KUMAR
 
PT1420 Modules in Flowchart and Visual Basic .docx
PT1420 Modules in Flowchart and Visual Basic             .docxPT1420 Modules in Flowchart and Visual Basic             .docx
PT1420 Modules in Flowchart and Visual Basic .docx
amrit47
 
Chp6 assembly language programming for pic copy
Chp6 assembly language programming for pic   copyChp6 assembly language programming for pic   copy
Chp6 assembly language programming for pic copy
mkazree
 
Scm lsmw steps_onweb
Scm lsmw steps_onwebScm lsmw steps_onweb
Scm lsmw steps_onweb
Harsha Reddy
 

Semelhante a 08.abap dialog programming overview (20)

ABAP Dialog Programming Overview.ppt
ABAP Dialog Programming Overview.pptABAP Dialog Programming Overview.ppt
ABAP Dialog Programming Overview.ppt
 
Module-Pool-Tutorial.pdf
Module-Pool-Tutorial.pdfModule-Pool-Tutorial.pdf
Module-Pool-Tutorial.pdf
 
Complete reference to_abap_basics
Complete reference to_abap_basicsComplete reference to_abap_basics
Complete reference to_abap_basics
 
Verified CKAD Exam Questions and Answers
Verified CKAD Exam Questions and AnswersVerified CKAD Exam Questions and Answers
Verified CKAD Exam Questions and Answers
 
Alv theory
Alv theoryAlv theory
Alv theory
 
Modularization & Catch Statement
Modularization & Catch StatementModularization & Catch Statement
Modularization & Catch Statement
 
Abap reports
Abap reportsAbap reports
Abap reports
 
AutoCount Accounting User Manual
AutoCount Accounting User ManualAutoCount Accounting User Manual
AutoCount Accounting User Manual
 
merged
mergedmerged
merged
 
15EE51 - Microcontrollers Laboratory
15EE51 - Microcontrollers Laboratory15EE51 - Microcontrollers Laboratory
15EE51 - Microcontrollers Laboratory
 
LIMS_DOCUMENTATION
LIMS_DOCUMENTATIONLIMS_DOCUMENTATION
LIMS_DOCUMENTATION
 
PT1420 Modules in Flowchart and Visual Basic .docx
PT1420 Modules in Flowchart and Visual Basic             .docxPT1420 Modules in Flowchart and Visual Basic             .docx
PT1420 Modules in Flowchart and Visual Basic .docx
 
CATS Approval.pdf
CATS Approval.pdfCATS Approval.pdf
CATS Approval.pdf
 
Meg bernal insight2014 4219
Meg bernal insight2014 4219Meg bernal insight2014 4219
Meg bernal insight2014 4219
 
Db2
Db2Db2
Db2
 
ABAP Message, Debugging, File Transfer and Type Group
ABAP Message, Debugging, File Transfer and Type GroupABAP Message, Debugging, File Transfer and Type Group
ABAP Message, Debugging, File Transfer and Type Group
 
Chp6 assembly language programming for pic copy
Chp6 assembly language programming for pic   copyChp6 assembly language programming for pic   copy
Chp6 assembly language programming for pic copy
 
Scm lsmw steps_onweb
Scm lsmw steps_onwebScm lsmw steps_onweb
Scm lsmw steps_onweb
 
Info plc net_sinamics hmi lab (1)
Info plc net_sinamics hmi lab (1)Info plc net_sinamics hmi lab (1)
Info plc net_sinamics hmi lab (1)
 
Info plc net_dcs800_controlbuilder_basic_exercises
Info plc net_dcs800_controlbuilder_basic_exercisesInfo plc net_dcs800_controlbuilder_basic_exercises
Info plc net_dcs800_controlbuilder_basic_exercises
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 

08.abap dialog programming overview

  • 2. SAP System : Dialog Processing (Report) SAP GUI Report zpsm1. Tables customers. Reques t Application Server List Select single * from Generate 1 10 Screen(List) Send Request Store request to queue 3 customers where id = 1. Write: / customers-name. Dispatcher Send List 9 2 Request Queue Send request to WP 4 D SAP Buffer Search for free WP Check Program in Program Buffer 5 D D … Program … D … 8 Database Server SQL Request 6 Load&Gen Program 7 Execute ABAP stateme nt
  • 3. Dialog WP : Executable Program Dialog WP TaskHandler Local Memory Memory Space ABAP Processor DYNPRO Processor DB Interface Result Set Memory Database List Buffer
  • 4. Types of ABAP Report 1 3 1. Report Listing 4 2. Drill-down Report 3. Control-break Report 4. ALV Report
  • 5. SAP System : Dialog Processing (DIALOG) SAP GUI Program sapmzex001. Reques t Application Server Include …. Screen Set screen 100. Generate Dialog 1 10 Screen Send Request Store request to queue 3 … Dispatcher Send List 9 2 Request Queue Send request to WP 4 D SAP Buffer Search for free WP Check Program in Program Buffer 5 D D … Program … D … 8 Database Server SQL Request 6 Load&Gen Program 7 Execute ABAP stateme nt
  • 6. Dialog WP : Dialog Program Dialog WP TaskHandler Local Memory ABAP Memory ABAP Processor DYNPRO Processor DB Interface Result Set Memory Database Screen Buffer
  • 7. Dialog Program : Transaction
  • 8. Dialog Program Components Transaction Code Transaction Code Dialog Program Dialog Program Program Naming Convention : SAPM… PBO (Screen Layout) ABAP Module Pool Flow Logic Screen : 200 (Screen Layout) ABAP Module Pool PAI Screen : 100 PBO ABAP Module Pool PAI ABAP Module Pool Flow Logic
  • 9. SAP Transaction DB Commit   DB Commit An SAP transaction consists of Dialog steps. A Dialog step begins when the user press Enter,activates a function by pressing a function key,double-clicks or chooses a function from a menu.It ends when the next screen is display In the course of a Dialog step,The PAI modules belonging to the current screen and the PBO modules belonging to the next screen
  • 10. Data Transfer (Local Memory) Local Memory Screen Work Area ABAP Work Area ok_code Screen Buffer Element List PBO ABAP Memory Space customers id … 0000000 customers-id customers-name PAI ok_code name city
  • 11. Flow Logic  Process Before Output(PBO)   After it has processed all of the modules in the PBO processing block, the system copies the contents of the fields in the ABAP work area to their corresponding fields in the screen work area. Process After Input(PAI)  Before it processes the first module in the PAI processing block, the system copies the contents of the fields in the screen work area to their corresponding fields in the ABAP work area.
  • 12. OK Code Field in Screen OK Code Field or Command Field (ok_code in Element List)
  • 13. Defining Screen (4 Steps)     Screen Attribute Screen Layout Flow Logic Element List Element List(ok_code field)
  • 14. Flow Logic in Screen 100 PROCESS BEFORE OUTPUT. MODULE STATUS_0100. PROCESS AFTER INPUT. MODULE USER_COMMAND_0100.
  • 15. PBO in Screen 100 MODULE status_0100 OUTPUT. SET PF-STATUS ‘0100’. SET TITLEBAR ‘0100’. ENDMODULE.
  • 16. PAI in Screen 100 MODULE user_command_0100 INPUT. CASE ok_code. WHEN ‘EXIT’. “Leave program SET SCREEN 0. LEAVE SCREEN. “Leave to screen 0 WHEN ‘SAVE’. UPDATE customers. MESSAGE S000(38) WITH ‘Update OK’. SET SCREEN 50. LEAVE SCREEN. ENDCASE. ENDMODULE.
  • 17. How to Create Dialog Program      Transaction SE80 : Create Dialog Program Create Screen(4 steps)  Screen Attribute  Screen Layout  Flow Logic(PBO,PAI)  Define Variable ok_code in Element List Define Data Object in ABAP Work Area at TOP Include(Tables, Data,...) Check and Activate Dialog Program Create Transaction Code
  • 18. Example I Maintain Customers Data Screen : 100 Screen : 200
  • 19. Example I  Create Dialog Program SAPMZEX< nn> for changing Customers table  Screen 100  Field customers-id  Screen 200  Field customers-id and customers-name
  • 20. Example I  Screen 100 PROCESS BEFORE OUTPUT. MODULE STATUS_0100. PROCESS AFTER INPUT. MODULE USER_COMMAND_0100.
  • 21. Example I  Screen 100 MODULE status_0100 OUTPUT. SET PF-STATUS ‘0100’. SET TITLEBAR ‘0100’. ENDMODULE.
  • 22. Example I  Screen 100 MODULE user_command_0100 INPUT. CASE ok_code. WHEN ‘BACK’. LEAVE PROGRAM. “leave to screen 0 WHEN space. “if not assign Enter Key SELECT SINGLE * FROM customers WHERE id = customers-id. LEAVE TO SCREEN 200. ENDCASE. ENDMODULE.
  • 23. Example I  Screen 200 PROCESS BEFORE OUTPUT. MODULE STATUS_0200. PROCESS AFTER INPUT. MODULE USER_COMMAND_0200.
  • 24. Example I  Screen 200 MODULE status_0200 OUTPUT. SET PF-STATUS ‘0200’. SET TITLEBAR ‘0200’. ENDMODULE.
  • 25. Example I  Screen 200 MODULE user_command_0200 INPUT. CASE ok_code. WHEN ‘BACK’. LEAVE TO SCREEN 100. “set screen 100 WHEN ‘SAVE’. UPDATE customers. MESSAGE S000(38) WITH ‘Update OK!’. LEAVE TO SCREEN 100. ENDCASE. ENDMODULE.
  • 26. Example I  TOP Include TABLES customers. DATA ok_code TYPE sy-ucomm.  Create Transaction Code Transaction Code : ZEX<nn>
  • 27. Exercise Create Dialog Program : SAPMZCUST<nn > Transaction Code : ZCUST<nn >
  • 28. Exercise : Customers Maintenance Screen : 100 Screen : 200
  • 29. Setting the Cursor Position Dynamically PROCESS BEFORE OUTPUT. MODULE STATUS_0200. MODULE set_cursor. MODULE set_cursor OUTPUT. SET CURSOR FIELD ‘CUSTOMERS-CITY’ OFFSET 3. ENDMODULE. Cursor Position
  • 30. Avoiding the Unexpected Processing Step of ok_code Field
  • 31. 1. Auxiliary OK_CODE Variable  TOP Include TABLES customers. DATA ok_code TYPE sy-ucomm. DATA save_ok TYPE sy-ucomm.
  • 32. Example I - Change  Screen 100 : PAI MODULE user_command_0100 INPUT. save_ok = ok_code. CLEAR ok_code. CASE save_ok. WHEN ‘BACK’. LEAVE PROGRAM. WHEN space. SELECT SINGLE * FROM customers WHERE id = customers-id. LEAVE TO SCREEN 200. ENDCASE. ENDMODULE.
  • 33. Example I - Change  Screen 200 : PAI MODULE user_command_0200 INPUT. save_ok = ok_code. CLEAR ok_code. CASE save_ok. WHEN ‘BACK’. LEAVE TO SCREEN 100. WHEN space. LEAVE TO SCREEN 200. WHEN ‘SAVE’. UPDATE customers. MESSAGE s000(38) WITH ‘Update OK!’. LEAVE TO SCREEN 100. ENDCASE. ENDMODULE.
  • 34. 2. Specify the Enter Function at GUI Status
  • 35. Check Enter Function  Screen 100 : PAI MODULE user_command_0100 INPUT. CASE ok_code. WHEN ‘BACK’. LEAVE PROGRAM. WHEN ‘ENTE’. SELECT SINGLE * FROM customers WHERE id = customers-id. LEAVE TO SCREEN 200. ENDCASE. ENDMODULE.
  • 36. 3. Clear OK_CODE at PBO  Screen 100 : Flow Logic PROCESS BEFORE OUTPUT. MODULE STATUS_0100. MODULE clear_ok_code. PROCESS AFTER INPUT. MODULE USER_COMMAND_0100.
  • 37. Clear OK_CODE at PBO  Screen 100 : PBO MODULE status_0100 OUTPUT. SET PF-STATUS ‘0100’. SET TITLEBAR ‘0100’. ENDMODULE. MODULE clear_ok_code OUTPUT. CLEAR ok_code. ENDMODULE.
  • 39. Example II Maintain Customers Data  Check Input Data Manually
  • 40. Example II  Screen 100 : PAI MODULE user_command_0100 INPUT. ... WHEN SPACE. SELECT SINGLE * FROM customers WHERE id = customers-id. IF sy-subrc <> 0. MESSAGE S000(38) WITH ‘Customers data not found’. LEAVE TO SCREEN 100. ELSE. LEAVE TO SCREEN 200. ENDIF. ENDCASE. ENDMODULE.
  • 41. Example III Maintain Customers Data  Check Input Data Using Field Command
  • 42. Example III – Field Statement  Screen 100 : Flow Logic (PAI) PROCESS AFTER INPUT. FIELD customers-id MODULE user_command_0100.
  • 43. Example III  Screen 100 : PAI MODULE user_command_0100 INPUT. ... WHEN SPACE. SELECT SINGLE * FROM customers WHERE id = customers-id. IF sy-subrc <> 0. MESSAGE E000(38) WITH ‘Customers data not found’. ELSE. LEAVE TO SCREEN 200. ENDIF. ENDCASE. ENDMODULE.
  • 44. Field Input Checking   If you want to check input values in the module pool and start dialog in the event of a negative result,you use the FIELD statement with the addition MODULE. If the module results in an error(E) or warning(W) message,the screen is redisplayed without processing the PBO modules.The message text is displayed and only the field being checked by this module becomes ready for input again
  • 45. Field Statement With More Than 1 Field  Screen 100 : Flow Logic (PAI) PROCESS AFTER INPUT. CHAIN. FIELD: customers-id,customers-custtype MODULE user_command_0100. ENDCHAIN. PROCESS AFTER INPUT. CHAIN. FIELD customers-id MODULE user_command_0100. FIELD customers-custtype MODULE user_command_0100. ENDCHAIN.
  • 46. Field Statement & Data Transport PROCESS AFTER INPUT. •Transfer f3,f4 MODULE a. •Call module a FILED f1 MODULE b. •Transfer f1 •Call module b FILED f2 MODULE c. •Transfer f2 •Call module c MODULE d. Screen 100 f1 f3 f2 f4 •Call module d
  • 51. Function Type : Exit Command
  • 52. At exit-command   When user chooses a function with type E,the screen flow logic jumps directly to the following statement MODULE <module> AT EXIT-COMMAND No other screen fields are transported to the program except OK Code field
  • 53. At exit-command  Screen 100 : Flow Logic PROCESS BEFORE OUTPUT. MODULE STATUS_0100. PROCESS AFTER INPUT. MODULE exit AT EXIT-COMMAND. MODULE USER_COMMAND_0100.
  • 54. At exit-command  Screen 100 : PAI MODULE exit INPUT. CASE ok_code. WHEN ‘EXIT’. LEAVE PROGRAM. ENDCASE. ENDMODULE. LEAVE PROGRAM.
  • 56. Example IV Maintain Customer Data  Popup confirmation data using function ‘POPUP_TO_CONFIRM_LOSS_OF_DATA’
  • 58. Example IV  Screen 100 : PAI MODULE exit INPUT. CALL FUNCTION ‘POPUP_TO_CONFIRM_LOSS_OF_DATA ’ EXPORTING textline1 = ‘Are you sure?’ titel = ‘Please Confirm!!!’ IMPORTING answer = ans. IF ans = ‘J’. “J = Ja in German= Yes in English LEAVE PROGRAM. ELSE. ENDIF. ENDMODULE.
  • 59. SAP Transaction : Enqueue Lock Object
  • 60. SAP Transaction & DB Transaction    Each Dialog step can contain update requests(INSERT,DELETE,UPDATE) After each Dialog step,the R/3 system automatically passes a database commit to the database system.The database system then distributes the update requests from the individual dialog steps across several database transactions A rollback in one Dialog step has no effect on database updates performed in previous Dialog steps
  • 61. SAP Transaction(LUW) DB Commit DB LUW SAP LUW DB Commit
  • 62. SAP Database Maintenance Steps     Check data locking by calling function ‘ENQUEUE_<lock object>’ Read data from Database Ex. Select single … Data Processing Ex. Update ... Release lock by calling function ‘DEQUEUE_<lock object>’
  • 63. SAP Lock Object  Transaction SE11 : Lock object   ENQUEUE_<lock object> DEQUEUE_<lock object>
  • 64. SAP Lock Object : Function Module
  • 65. Example IV  ENQUEUE /DEQUEUELock Object(SE11) CALL FUNCTION ‘ENQUEUE_EZCUST<nn> ’ CALL FUNCTION ‘DEQUEUE_EZCUST<nn> ’ User 1 User 2
  • 66. Example IV (I)  Screen 100 : PAI MODULE user_command_0100 INPUT. ... WHEN SPACE. CALL FUNCTION ‘ENQUEUE_EZCUST00’ EXPORTING … id = customers-id EXCEPTIONS ... IF sy-subrc <> 0. MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ELSE. SELECT SINGLE * FROM customers WHERE id = customers-id. ...
  • 67. Example IV (II)  Screen 100 : PAI MODULE user_command_0100 INPUT. ... WHEN SPACE. CALL FUNCTION ‘ENQUEUE_EZCUST00’ EXPORTING message id sy-msgid type id = customers-id sy-msgty number ... sy-msgno with IF sy-subrc <> 0. sy-msgv1 sy-msgv2 CONCATENATE ‘Data was locked by :’ sy-msgv1 INTO mess. sy-msgv3 syMESSAGE E000(38) WITH mess. msgv4. ELSE. SELECT SINGLE * FROM customers WHERE id = customers-id. ...
  • 68. Example IV  Screen 200 : PAI MODULE user_command_0200 INPUT. ... WHEN ‘BACK’. CALL FUNCTION ‘DEQUEUE_EZCUST00’ EXPORTING … id = customers-id. LEAVE TO SCREEN 100. …
  • 69. Example IV  Screen 200 : PAI MODULE user_command_0200 INPUT. ... WHEN ‘SAVE’. UPDATE customers. MESSAGE S000(38) WITH ‘Update OK!’. CALL FUNCTION ‘DEQUEUE_EZCUST00’ EXPORTING … id = customers-id. LEAVE TO SCREEN 100. ... ...