Friday, April 20, 2018

Application with Internal Table

Having screen painter with layout fields are vender, name, city operations.
  • Select "SE80" -> Edit object
  • Select program -> provide module pool. Program creating "Zvender-Demo-PG".
  • Select create -> Uncheck "Include" -> Enter.
  • Maintain Attributes to program -> Save Attributes.
  • Select SE80 -> Edit object -> Select program.
    "Zvender -> Demo -> PG".
  • Select screen -> enter screen number to design application screen "100".
  • Select create to switch over to screen painter.
  • Description to screen 100 "Application with Internal table" -> Save.
  • Select "Layout" from screen painter.
  • Select "Go to" -> Secondary Window -> Dictionary/Program fields to select fields from table
  • Enter table "LFA1" --> Enter.
  • Select Fields LIFNR ,NAME1 & ORT01.
  • Drop it in Layout.
  • Maintain operatoions Display & Exit -->Save.
  • Select "Flow logic' from screen painter.
  • Select "PAI" from Flow Logic -> Select it's module.
  • Double click on that module -> Enter.
  • Select main program ->Enter.
  • Tables work area
    Tables : LFAI.
  • Internal Table as per fields in Layout. Types : Begin of Fs,
    LIFNR Type LIFNR,
    Namel Type namel-Gp,
    ORTAL type ORTAL-GP,
    End of FS.
    Data : WA type FS,
    ITab type standard Table of FS.
  • Select module - end module of input.
  • Logic for operations.
    case sy-ucomm.
    when 'Display'.
    Select LIFNR
    Name1
    ORT01
    From LFA1
    Into Table ITAB
    Where LIFNR = LFA1-LIFNR
    when 'Exit'
    Leave program.
    End case.
  • Select "PRO" from Flow magic ->Delete comment to it's module.
  • Double click on that module ->Enter.
  • Select "Main Progrm"->Enter.
  • Select module - End module of "PBO".
  • Logic to transfer data from body to screen field via work area
    If not ITAB[ ] is initial.
    Loop at ITAB[ ] into WA.
    Move corresponding WA to LFA1.
    End Loop.
    End If.
  • Move - corresponding is syntax. Here LFA1 is not table name it's screen field.
  • Save & Activate -> F3-> Activate.
  • Select SE80 ->Edit object ->Select mode.
  • Provide Transaction code creating.
    "Zvendar_Demo_PG_TR" ->Create.
  • Short text "Demo".
  • Select "Dialog Transaction" ->Enter.
  • Provide module pool program "Zvendar_Demo_PG".
  • Screen number "0100" ->Save.
  • Sunday, April 15, 2018

    Applications without Internal Table

    • Select T.Code "SE80"
    • Select "Edit Object"
    • Select "Program"
    • Provide module pool program name creating "zvendor_demo"
    • Select "create"
    • Uncheck "Top Include" Click on Enter
    • Provide Attributes to program
      Type "Module Pool"
      Status "SAP Standard Production Program"
      Application "Material Management"
    • Save Details
    • Select "SE80 --> Edit object
    • Select Program --> Provide module pool created.
    • Select screen --> Provide screen number to design application
      0100 -> take any number
    • Select "create" to switch over to screen painter
    • Maintain description to screen 100
      "Applcation without Internal table" Click on Save
    • From screen painter select "Layout"
    • Select "Goto" -> secondary window -> Dictionary/Program Fields
      To select Fields from Table
    • Provide table "LFA1" Press Enter
    • Select Fields "LIFNR", "Name1" and "ORT01" press enter and drop fields on layout
    • From "Tool Box" Select "Push button" drop it in Layout
    • Double click on push button to maintain properties
    • Repeate same procedure fro Update, Delete, Display & Exit press save
    • From Screen Painter -> Select "Flow Logic"
    • From Flowlogic select "PA1" to maintain logic for operactions
    • Select "PAI" module -> Delete comment (*) press save
    • Double click on PAI module. "Module user_command_0100" press Enter
    • Select Main program press Enter
    • Table work Area
      Tabels : LFA1 "Vendor Master Table"
    • Select Module - End Module of PAI logic for operactions
      case sy-ucomm
      when "Insert" -> (FCT code)
      Insert LFA1
    • Message to konw record inserted or not
      IF SY-SUBRC = 0
      Message I000(0) with "Inserted".
      Else.
      Message E001(0) with "Not Inserted".
      EndIf.
      "0" is a default message class, "with" is syntax
      when 'update'
      update LFA1
    • Message to know record updated or not
      IF SY-SUBRC <> 0
      Message A000(0) with "Not Updated".
      Else
      Message S001(0) with "updated"
      EndIf
      when "Delete"
      Delete LFA1
      If SY-SUBRC <> 0
      Message X000(0) with "Not Deleted"
      Else
      Message I001(0) with "Deleted"
      Endif
    • In Dialog programming parameters and select-options not allowed.
      when "Display"
      select * from LFA1 where LIFNR = LFA1-LIFNR
      End select.
      When "Exit"
      Leave Program
      End Case
    • Leave program is a keyword which can move control out of application
    • Save & Actiavte -> F3 -> Activate
    • Select "SE80" -> Select "Edit Object"
    • Select "More" -> Select Transaction.
    • Enter Transaction code creating "Zvendor_Demo_TR" -> Create
    • Short text "Transaction Code for Dialog program"
    • Select "Dialog Transaction" press Enter
    • Provide module pool program name "Zvendor_Demo"
    • Provide screen number "0100" press save.

    Transaction Codes to work with ABAP Transations

    SE38 --> To Create Module Pool

    SE51 --> Screen Painter

    --> Screen Painter have layout. Layout is to design Applications in Screen Painter.

    Flow logic have PBO and PAI

    Flow Logic : It maintains communication between Application & Logic

    SE93 --> To create Transaction code for Application.

    In Real Time these T.Codes are not accessable. So, use SE80 to design Applications.

    Saturday, April 14, 2018

    FCT Codes concept in ABAP Transations

    FCT Codes Stands for "Function Control Codes".

    Note : Based on FCT Codes system variable "sy-ucomm" can control Dialog Programming.

    ucomm --> user command

    Events in ABAP Transations

    ABAP Transactions have 4 Events, Those are

    • 1. PBO --> Process Before Output
    • 2. PAI --> Process After Input
    • 3. POV --> Process on value Request
    • 4. POH --> Process on Help Request

    PBO : PBO Triggers before Screen displays.

    PAI : PAI Triggers After Screen display.

    POV : POV Triggers with "F4" Function key (It is for Search help).

    POH : POH Triggers with F1 Function key (It is to maintain Documentation).

    Flow Logic by default have PBO and PAI based on these 2 events it maintains communication.

    Dyn pro's concept from ABAP Language

    It Means ABAP Transactions Concept.

    Using ABAP Transactions pre-defined applications can be customised as per client requirement, and using ABAP transactions even new applications can be created in SAP.

    NOTE: In ABAP transactions programming type is dialog programming. This is to be extraction and manipulation. Programming type for dialog programming is "Module pool".

    New application creation in ABAP Transations:

    • Logic can be maintained Programming type module pool.
    • Flow logic maintain Communication between Application and Logic.

    Thursday, March 15, 2018

    Tables Creation in SAP-ABAP

    Bottom to Top Hierarchy to create a table:
    • Select SE11
    • Select Domain and Provide Domain name as per naming convensions
    ZDOM_DNO
    • Select Create
    • Short Description to Domain
    Domain for Field DNo
    • Provide Data Type and Size to DNO Field

    Application with Internal Table

    Having screen painter with layout fields are vender, name, city operations. Select "SE80" -> Edit object Select program ->...