SAP ABAP Dialog Programmimg

Embed Size (px)

Citation preview

  • 8/15/2019 SAP ABAP Dialog Programmimg

    1/70

    Dialog Programming

    Overview

  • 8/15/2019 SAP ABAP Dialog Programmimg

    2/70

    SAP System : Dialog Processing(Report)

    Database Server

    Application Server

    Dispatcher

    RequestQueue

    D D D D…

    SAP Bufer

    Program

    1

    3

    4

    5

    6

    !

    1"

    Report zpsm1.

     Tales c!stomers.

    Select single " #rom

      c!stomers where i$ %1.

    &rite: ' c!stomersname.

    ExecuteABAPstatement

    Check Program inProgram Bufer 

    #

    Load&GenProgram

    SQLRequest

    Send List

    GenerateScreen(List

    Send Request

    Request

    List

    $ Search !or

    !ree "P 

    Store request to

    queue 

    Send request to

    "P 

    SAP G#$

  • 8/15/2019 SAP ABAP Dialog Programmimg

    3/70

    Dialog WP : Executable ProgramDialog WP : Executable ProgramDialog WP

     

    TaskHandler 

    DYNPRO Processor 

    ABAP Processor 

    Database

    Local Memory

    %emor S'ace

    DB nter!ace

    List Bufer 

    Resut Set %emor

  • 8/15/2019 SAP ABAP Dialog Programmimg

    4/70

     Types o# AAP Report

    1% Report &isting

    $% Drill'(o)n Report

    3% *ontrol'brea+ Report4% A&, Report

    1

    *

    +

  • 8/15/2019 SAP ABAP Dialog Programmimg

    5/70

    SAP System : Dialog Processing(D,A-O)

    Database Server

    Application Server

    Dispatcher

    RequestQueue

    D D D D…

    SAP Bufer

    Program

    1

    3

    4

    5

    6

    !

    1"

    Program sapmze/001.

    ,ncl!$e ….

    Set screen 100.

    ExecuteABAPstatement

    Check Program inProgram Bufer 

    #

    Load&GenProgram

    SQLRequest

    Send List

    Generate )iaogScreen

    Send Request

    Request

    Screen

    $ Search !or

    !ree "P 

    Store request to

    queue 

    Send request to

    "P 

    SAP G#$

  • 8/15/2019 SAP ABAP Dialog Programmimg

    6/70

    Dialog WP : Dialog ProgramDialog WP : Dialog ProgramDialog WP

     

    TaskHandler 

    DYNPRO Processor 

    ABAP Processor 

    Database

    Local Memory

    ABAP Memory 

    DB nter!ace

    Screen Bufer 

    Resut Set %emor

  • 8/15/2019 SAP ABAP Dialog Programmimg

    7/70

    Dialog Program :

     Transaction

  • 8/15/2019 SAP ABAP Dialog Programmimg

    8/70

    Dialog Program omponent-ransaction *o(e

    -ransaction *o(e

    Screen . 100100/Screen &a0out

    Screen . 200200/Screen &a0out

    2lo) &ogic

    2lo) &ogic

    PB

    PA

    ABAP o(ule Pool

    ABAP o(ule Pool

    PB

    PA

    ABAP o(ule Pool

    ABAP o(ule Pool

    Dialog ProgramDialog Program Program aming *onvention . SAP…

  • 8/15/2019 SAP ABAP Dialog Programmimg

    9/70

    SAP Transaction

    An SAP transaction consists o# Dialog steps. A Dialogstep egins when the !ser press 2nter3activates a#!nction y pressing a #!nction 4ey3$o!leclic4s orchooses a #!nction #rom a men!.,t en$s when the ne/tscreen is $isplay

    ,n the co!rse o# a Dialog step3The PA, mo$!leselonging to the c!rrent screen an$ the PO mo$!les

    elonging to the ne/t screen

    DB *ommit DB *ommit

  • 8/15/2019 SAP ABAP Dialog Programmimg

    10/70

    Data Trans#er (-ocal 5emory

     Screen Bufer ABAP emor0 Space

    Screen 7or+ Area ABAP 7or+ Area

    PBOPBO

    PAIPAI

    customers'i(

    customers'name

    customers

    i( name cit0… """""""

    o+8co(e

    o+8co(e

    -ocal 5emory

    9lement &ist

  • 8/15/2019 SAP ABAP Dialog Programmimg

    11/70

    6low -ogic Process e#ore O!tp!t(PO)

    A:ter it has processe$ all o# the mo$!les in thePB processing loc43 the system copies the

    contents o# the 7el$s in the AAP wor4 area totheir correspon$ing 7el$s in the screen wor4area.

    Process A#ter ,np!t(PA,) Be:ore it processes the 7rst mo$!le in the PA 

    processing loc43 the system copies the contentso# the 7el$s in the screen wor4 area to theircorrespon$ing 7el$s in the AAP wor4 area.

  • 8/15/2019 SAP ABAP Dialog Programmimg

    12/70

    O8 o$e 6iel$ in Screen

    O8 o$e 6iel$ or

    omman$ 6iel$(o49co$e in 2lement

    -ist)

  • 8/15/2019 SAP ABAP Dialog Programmimg

    13/70

    De7ning Screen (+ Steps) Screen Attri!te Screen -ayo!t 6low -ogic 2lement -ist

    EementList(ok*code +ed

  • 8/15/2019 SAP ABAP Dialog Programmimg

    14/70

    6low -ogic in Screen 100PRO2SS 26OR2 OTPT.

    5OD-2 STATS90100.

    PRO2SS A6T2R ,;PT.

      5OD-2 S2R9O55A;D90100.

  • 8/15/2019 SAP ABAP Dialog Programmimg

    15/70

    PO in Screen 1005OD-2 stat!s90100 OTPT.

    S2T P6STATS ‘0100’.  S2T T,T-2AR ‘0100’.

    2;D5OD-2.

     

  • 8/15/2019 SAP ABAP Dialog Programmimg

    16/70

    PA, in Screen 1005OD-2 !ser9comman$90100 ,;PT.

    AS2 o49co$e.

      &

  • 8/15/2019 SAP ABAP Dialog Programmimg

    17/70

    ariale o49co$e in 2lement

    -ist De7ne Data Oect in AAP &or4 Area

    at TOP ,ncl!$e(Tales3 Data3...)

  • 8/15/2019 SAP ABAP Dialog Programmimg

    18/70

    2/ample ,

    5aintain !stomers Data

    Screen : 100 Screen : B00

  • 8/15/2019 SAP ABAP Dialog Programmimg

    19/70

    2/ample , reate Dialog Program SAP5C2=;nn> 

    #or changing !stomers tale Screen 100

    6iel$ c!stomersi$ Screen B00

    6iel$ c!stomersi$ an$ c!stomersname

  • 8/15/2019 SAP ABAP Dialog Programmimg

    20/70

    2/ample , Screen 100

    PRO2SS 26OR2 OTPT.

      5OD-2 STATS90100.

      PRO2SS A6T2R ,;PT.  5OD-2 S2R9O55A;D90100.

  • 8/15/2019 SAP ABAP Dialog Programmimg

    21/70

    2/ample , Screen 100

    5OD-2 stat!s90100 OTPT.

      S2T P6STATS ‘0100’.

      S2T T,T-2AR ‘0100’.

      2;D5OD-2.

  • 8/15/2019 SAP ABAP Dialog Programmimg

    22/70

    2/ample , Screen 100

    5OD-2 !ser9comman$90100 ,;PT.

      AS2 o49co$e.

      &2 PRORA5. “leave to screen 0

      &

  • 8/15/2019 SAP ABAP Dialog Programmimg

    23/70

    2/ample , Screen 200

    PRO2SS 26OR2 OTPT.

      5OD-2 STATS90B00.

      PRO2SS A6T2R ,;PT.

      5OD-2 S2R9O55A;D90B00.

  • 8/15/2019 SAP ABAP Dialog Programmimg

    24/70

    2/ample , Screen 200

    5OD-2 stat!s90B00 OTPT.

      S2T P6STATS ‘0B00’.

      S2T T,T-2AR ‘0B00’.

      2;D5OD-2.

  • 8/15/2019 SAP ABAP Dialog Programmimg

    25/70

    2/ample , Screen 200

      5OD-2 !ser9comman$90B00 ,;PT.

      AS2 o49co$e.

      &2 TO SR22; 100. “set screen 100

      &2’.

      PDAT2 c!stomers.  52SSA2 S000(*?) &,T< ‘p$ate O8’.

      -2A>2 TO SR22; 100.

      2;DAS2.

      2;D5OD-2.

  • 8/15/2019 SAP ABAP Dialog Programmimg

    26/70

    2/ample , TOP Include

     TA-2S c!stomers.

    DATA o49co$e TEP2 sy!comm. Create Transaction Code

     Transaction o$e : ZEX

  • 8/15/2019 SAP ABAP Dialog Programmimg

    27/70

    2/ercise

    reate Dialog Program :

    SAP5CSTFnnG Transaction o$e : CSTFnnG

  • 8/15/2019 SAP ABAP Dialog Programmimg

    28/70

    2/ercise : !stomers

    5aintenanceScreen : 100 Screen : B00

  • 8/15/2019 SAP ABAP Dialog Programmimg

    29/70

    Setting the !rsor Position

    Dynamically

    Cursor Position

    PRO2SS 26OR2 OTPT. 5OD-2 STATS90B00.

     5OD-2 set9c!rsor.

     5OD-2 set9c!rsor OTPT.

      S2T RSOR 6,2-D ‘STO52RS,TE’  O66S2T *.2;D5OD-2.

  • 8/15/2019 SAP ABAP Dialog Programmimg

    30/70

    Avoi$ing the ne/pecte$Processing Step o# o49co$e

    6iel$

  • 8/15/2019 SAP ABAP Dialog Programmimg

    31/70

    1. A!/iliary O89OD2

    >ariale TOP Include

     TA-2S c!stomers.

    DATA o49co$e TEP2 sy!comm.

    DATA save9o4 TEP2 sy!comm.

  • 8/15/2019 SAP ABAP Dialog Programmimg

    32/70

    2/ample , hange Screen 100 : PAI

    5OD-2 !ser9comman$90100 ,;PT.

      save9o4 % o49co$e.

      -2AR o49co$e.

      AS2 save9o4.

      &2 PRORA5.  &

  • 8/15/2019 SAP ABAP Dialog Programmimg

    33/70

    2/ample , hange Screen 200 : PAI

    5OD-2 !ser9comman$90B00 ,;PT.

      save9o4 % o49co$e.

      -2AR o49co$e.  AS2 save9o4.

      &2 TO SR22; 100.

      &2 TO SR22; B00.  &2’.

      PDAT2 c!stomers.

      52SSA2 s000(*?) &,T< ‘p$ate O8’.

      -2A>2 TO SR22; 100.

      2;DAS2.

    2;D5OD-2.

  • 8/15/2019 SAP ABAP Dialog Programmimg

    34/70

    B. Speci#y the 9nter 6!nction at ,

    Stat!s

  • 8/15/2019 SAP ABAP Dialog Programmimg

    35/70

    hec4 2nter 6!nction Screen 100 : PAI

    5OD-2 !ser9comman$90100 ,;PT.

      AS2 o49co$e.

      &2 PRORA5.

      &

  • 8/15/2019 SAP ABAP Dialog Programmimg

    36/70

    *. lear O89OD2 at PO Screen 100 : Flo !o"ic

    PRO2SS 26OR2 OTPT.

      5OD-2 STATS90100.

      5OD-2 clear9o49co$e.

      PRO2SS A6T2R ,;PT.

      5OD-2 S2R9O55A;D90100.

  • 8/15/2019 SAP ABAP Dialog Programmimg

    37/70

    lear O89OD2 at PO Screen 100 : PBO

    5OD-2 stat!s90100 OTPT.

      S2T P6STATS ‘0100’.

      S2T T,T-2AR ‘0100’.

      2;D5OD-2.

      5OD-2 clear9o49co$e OTPT.  *&9AR o+8co(e%  2;D5OD-2.

  • 8/15/2019 SAP ABAP Dialog Programmimg

    38/70

    hec4ing ser ,np!t

  • 8/15/2019 SAP ABAP Dialog Programmimg

    39/70

    2/ample ,,

    5aintain !stomers Data Check Input Data Manually Check Input Data Manually 

  • 8/15/2019 SAP ABAP Dialog Programmimg

    40/70

    2/ample ,, Screen 100 : PAI

    5OD-2 !ser9comman$90100 ,;PT.

      ...  &

  • 8/15/2019 SAP ABAP Dialog Programmimg

    41/70

    2/ample ,,,

    5aintain !stomers Data Check Input Data UsingCheck Input Data Using Field Field  

    CommandCommand

  • 8/15/2019 SAP ABAP Dialog Programmimg

    42/70

    2/ample ,,, – 

     6iel$ Statemen Screen 100 : Flo !o"ic #PAI$

      PRO2SS A6T2R ,;PT.

      6,2-D c!stomersi$ 5OD-2!ser9comman$90100.

  • 8/15/2019 SAP ABAP Dialog Programmimg

    43/70

    2/ample ,,, Screen 100 : PAI

    5OD-2 !ser9comman$90100 ,;PT.

      ...

      &

  • 8/15/2019 SAP ABAP Dialog Programmimg

    44/70

    6iel$ ,np!t hec4ing ,# yo! want to chec4 inp!t val!es in the

    mo$!le pool an$ start $ialog in the evento# a negative res!lt3yo! !se the 6,2-Dstatement with the a$$ition 5OD-2.

    ,# the mo$!le res!lts in an error(2) orwarning(&) message3the screen is

    re$isplaye$ witho!t processing the POmo$!les.The message te/t is $isplaye$ an$only the 7el$ eing chec4e$ y this mo$!leecomes rea$y #or inp!t again

  • 8/15/2019 SAP ABAP Dialog Programmimg

    45/70

    6iel$ Statement &ith 5ore Than 16iel$

    Screen 100 : Flo !o"ic #PAI$PRO2SS A6T2R ,;PT.

     

  • 8/15/2019 SAP ABAP Dialog Programmimg

    46/70

    6iel$ Statement H Data TransportPRO2SS A6T2R ,;PT.

      5OD-2 a.

      6,-2D #1 5OD-2 .

      6,-2D #B 5OD-2 c.

      5OD-2 $.

    :1 :$

    :3 :4

    Screen 100

    I Trans#er #*3#+

    Iall mo$!le aI Trans#er #1Iall mo$!le I Trans#er #B

    Iall mo$!le cIall mo$!le $

  • 8/15/2019 SAP ABAP Dialog Programmimg

    47/70

    ReJ!ire$ 6iel$

  • 8/15/2019 SAP ABAP Dialog Programmimg

    48/70

  • 8/15/2019 SAP ABAP Dialog Programmimg

    49/70

  • 8/15/2019 SAP ABAP Dialog Programmimg

    50/70

    At e/itcomman$

  • 8/15/2019 SAP ABAP Dialog Programmimg

    51/70

    6!nction Type : 2/it

    omman$

  • 8/15/2019 SAP ABAP Dialog Programmimg

    52/70

     &hen !ser chooses a #!nction with type23the screen Kow logic !mps $irectly

    to the #ollowing statement  MODULE AT EXITCOMMA!DMODULE AT EXITCOMMA!D

     ;o other screen 7el$s are transporte$ tothe program e/cept O" Code 7el$

    At e/itcomman$

  • 8/15/2019 SAP ABAP Dialog Programmimg

    53/70

    At e/itcomman$ Screen 100 : Flo !o"ic

    PRO2SS 26OR2 OTPT.

      5OD-2 STATS90100.

      PRO2SS A6T2R ,;PT.

      5OD-2 e/it AT 2=,TO55A;D.

      5OD-2 S2R9O55A;D90100.

  • 8/15/2019 SAP ABAP Dialog Programmimg

    54/70

    At e/itcomman$ Screen 100 : PAI

    5OD-2 e/it ,;PT.

      AS2 o49co$e.

      &2 PRORA5.2;DAS2.

      2;D5OD-2.

    -2A>2 PRORA5.

  • 8/15/2019 SAP ABAP Dialog Programmimg

    55/70

    6!nction 5o$!le(POPP9TO9O;6,R59-OSS9O69DAT

    A)

  • 8/15/2019 SAP ABAP Dialog Programmimg

    56/70

    2/ample ,>

    5aintain !stomer Data #opup con$%mation data using#opup con$%mation data using

    &unction&unction‘ ‘ PP

  • 8/15/2019 SAP ABAP Dialog Programmimg

    57/70

    2/ample ,> TOP Include

    ...

      DATA ans.

  • 8/15/2019 SAP ABAP Dialog Programmimg

    58/70

    2/ample ,> Screen 100 : PAI

    5OD-2 e/it ,;PT.

      A-- 6;T,O; ‘PP

  • 8/15/2019 SAP ABAP Dialog Programmimg

    59/70

    SAP Transaction : 2nJ!e!e -oc4Oect

  • 8/15/2019 SAP ABAP Dialog Programmimg

    60/70

    SAP Transaction H D Transactio

    2ach Dialog step can contain !p$atereJ!ests(,;S2RT3D2-2T23PDAT2)

    A#ter each Dialog step3the R'* system

    a!tomatically passes a $ataase commit to the$ataase system.The $ataase system then$istri!tes the !p$ate reJ!ests #rom thein$ivi$!al $ialog steps across several $ataase

    transactions A rollac4 in one Dialog step has no eNect on

    $ataase !p$ates per#orme$ in previo!s Dialogsteps

  • 8/15/2019 SAP ABAP Dialog Programmimg

    61/70

    SAP Transaction(-&)DB *ommit DB *ommit

    SAP &

  • 8/15/2019 SAP ABAP Dialog Programmimg

    62/70

    SAP Dataase 5aintenance Step

    hec4 $ata loc4ing y calling #!nction‘2;229Flock o'(ect lock o'(ect G’

    Rea$ $ata #rom Dataase E)* +electsingle …

    Data Processing E)* Update ***

    Release loc4 y calling #!nction‘D2229Flock o'(ect lock o'(ect G’

  • 8/15/2019 SAP ABAP Dialog Programmimg

    63/70

    SAP -oc4 Oect

     Transaction S211 : -oc4 oect 2;229Flock o'(ect lock o'(ect G

    D2229Flock o'(ect lock o'(ect G

  • 8/15/2019 SAP ABAP Dialog Programmimg

    64/70

    SAP -oc4 Oect : 6!nction5o$!le

  • 8/15/2019 SAP ABAP Dialog Programmimg

    65/70

    2/ample ,> E+,-E-E ./E,-E-E!oc Oect#SE11$

    A-- 6;T,O; ‘2;2292CST’ 

    A-- 6;T,O;‘D22292CST

    ’ 

    ser 1 ser B

  • 8/15/2019 SAP ABAP Dialog Programmimg

    66/70

    2/ample ,> (,) Screen 100 : PAI5OD-2 !ser9comman$90100 ,;PT.

      ...

      &1 SE5S>B SE5S>* SE5S>+.

      2-S2.

      S2-2T S,;-2 " 6RO5 c!stomers &

  • 8/15/2019 SAP ABAP Dialog Programmimg

    67/70

    2/ample ,> (,,)

    Screen 100 : PAI5OD-2 !ser9comman$90100 ,;PT.

      ...

      &

  • 8/15/2019 SAP ABAP Dialog Programmimg

    68/70

    2/ample ,>

    Screen 200 : PAI5OD-2 !ser9comman$90B00 ,;PT.

      ...

      &2 TO SR22; 100.

     

  • 8/15/2019 SAP ABAP Dialog Programmimg

    69/70

    2/ample ,>

    Screen 200 : PAI5OD-2 !ser9comman$90B00 ,;PT.

      ...

      &2’.

      PDAT2 c!stomers.

      52SSA2 S000(*?) &,T< ‘p$ate O8’.

      A-- 6;T,O; ‘D22292CST00’

      2=PORT,;

      …  i$ % c!stomersi$.

      -2A>2 TO SR22; 100.

      ...

      ...

  • 8/15/2019 SAP ABAP Dialog Programmimg

    70/70

    5onitoring 2nJ!e!e -oc4 :S51B