0% found this document useful (0 votes)
6 views7 pages

Smart Forms

The document provides a comprehensive overview of Smartforms, BDC, and various SAP functionalities, including invoice receipt printing, error handling, and performance improvement techniques. It details the processes for generating PDF outputs, managing data transactions, and implementing ALV grids for reporting. Additionally, it outlines the flows for Sales, MM, and FI modules, along with key tables used in each process.

Uploaded by

greeshmakuderu2
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views7 pages

Smart Forms

The document provides a comprehensive overview of Smartforms, BDC, and various SAP functionalities, including invoice receipt printing, error handling, and performance improvement techniques. It details the processes for generating PDF outputs, managing data transactions, and implementing ALV grids for reporting. Additionally, it outlines the flows for Sales, MM, and FI modules, along with key tables used in each process.

Uploaded by

greeshmakuderu2
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Smartforms:To print invoice receipt, like company address, customer address, line item details and

footer

Tables: VBRK, VBRP.

Company address : t001 table- bukrs

Customer address: kna1 table –adrnr(vbrk-kunrg)

Details: posnr, fkimg,matnr,marktx,netwr. (ITEM no,mat no,mat desc, quantity , net price)

Debug a sf: When we active a sf, FM generates, inside FM we can place [Link] we can place static break
point also like break <user name >

Dynamic logo: in driver program, we can write logic if country is ‘india’, we can give a logo(from se78)
else, other logo and we can pass this to smartform and in smartform, for graphic window we can bind
with variable which has details of logo

Folder: whetever we put in folder , everything will be on same page.

Smartform o/p to pdf: 1. Generate spool request and execute sp01 to identify spool request number.
Use RSTXPDF4 std program to convert spool request to pdf.

2. get OTF of SF and convert OTF to PDF(using convert_otf fm)

3 nd way: use PDF! Tcode.

Transulations: se63(only text elements can be there)

Command: to trigger a page break (like only 10 records should display on page)

Like check go to new page and give conditions

BDC: Migrated vendor master data from legacy system, instead of manually entreing values in xk01,
automated using BDC, we had 10,000+ records and used call transction
Why call transaction: they need immediate exectuion and also only one tcode is involved so ..used call
trasaction

How to handle errors: using BDCMSGCALL structure.

Why bdc, why not bapi: bapi doesnot cover all xk01 fileds , so used bDC.

How to improve performance : mode =N


Use : format_message fm to get error message,

Call transaction: Real time excetion, small data,Immediate excetion, cannot reprocess failed records
session method: batch processing, errors can be processed in sm35, large data, can correct and
reprocess filed records
DATA: lt_bdcdata TYPE TABLE OF bdcdata,

lt_msg TYPE TABLE OF bdcmsgcoll,

lv_tcode TYPE sy-tcode VALUE 'XD01'.

CALL TRANSACTION lv_tcode USING lt_bdcdata

MODE 'N' " 'A' = display screens, 'N' = background, 'E' = errors only

UPDATE 'S' " 'S' = synchronous, 'A' = asynchronous

MESSAGES INTO lt_msg.

LOOP AT lt_msg INTO DATA(ls_msg).

CALL FUNCTION ‘format_messgae'

EXPORTING

msgid = ls_msg-msgid

msgnr = ls_msg-msgnr

msgv1 = ls_msg-msgv1

msgv2 = ls_msg-msgv2

msgv3 = ls_msg-msgv3

msgv4 = ls_msg-msgv4

IMPORTING

message_text_output = DATA(lv_msg_text).

WRITE: / lv_msg_text.

ENDLOOP.

'A' Asynchronous Update Doesn't wait for DB update Performance is a priority

Waits for update to complete


'S' Synchronous Update Data consistency is critical
(safer)

• Reports: the requiremnts is to create a customer and sales report to manage sales data. On
basic list, view customer details like customer id, name, place (kunnr, land1, name1). and double
click on customer id, display sales order header details on secondary list like (sales order
number, date..) vbeln, erdat, [Link] double click of sales oder number , should display sales
order item details , item no,material, net price (vbeln, posnr,matnr,netwr), if netwr > some
value should display like button , on click of button should naviget to mm01 tcode to display
details.

Steps:

• 1. Create a Module pool screen

• 2. Place custom control component on the module pool screen

• 3. Create the object for container class 'CL_GUI_CUSTOM_CONTAINER͛ linking with

• custom control (physical control on module pool screen toolbox)

• 4. Create the object for grid class 'CL_GUI_ALV_GRID' linking with

• container object

• 5. Retrieve the data to be displayed in the ALV grid

• 6. Generate the field catalog for the fields of ALV grid

• 7. Generate the layout for the ALV grid (optional)

And before display alv grid, handle the events, i.e, to navigate to secondary list use double click event
i.e. double click event , declare event handler and class and event handler methods foe duoble click
event. It has importing parameter like e_column, e_row, based on that e_row we can read table by
using index and get data, based on that data fetch data for secondary list and display it

The same way we use all the events

Double click->e_column, e_row

Button click->es_col_id, es_row_no,

Hotspot click-> e_column_id, e_row_id

User command-> e_ucomm

To navigate to tcode

Set parameter id ‘MAT’ field p_matnr

Call tranaction ‘mm01’ and skip first screen

RFC- We can connect to external system, all parameters must be ass by value.
SRFC: It requires both systems must be available, if target is not available the source system waits and
goes to sleep mode.

ARFC: both systems need not available.

TRFC: If target system is not available then creates transaction id in RFC tables.

Syn : SRFC : call function ‘zabc’ destination ‘Zdest’ exporting and improting.

Syn ARFC: call function ‘aabc’ destination ‘zdest’ starting new task performing Getname on end of task
expor and impo

Update FM: To commit all the changes /Rollback them all.i.e., we bundle the db changes together using
update FM. The update FM will not execute immediately but it is scheduled for execution in update WP.
Once it reach commit work statement , update FM executes. After commit work, it triggers logic of
Update FM.
How to debug Update fm: in debuuger screen-> Settings-> change debugger settings-> check the update
debugging
Never use commit work in update FM: Because after calling FM, commit work stm executes, then only
FM gets execute. So it not necessary to place commit work inside update FM.

LUW: Means Logical unit of work, it ensures data consistency by making a set of operations that must
be completed together — either all succeed or all fail.
Database LUW: A set of database operations that are either committed or rolled back together using a
database commit.
SAP LUW: A set user actions in an SAP transaction that are grouped together and treated as a single
unit. These steps are bundled together until a commit work ais issued.
As part of update Fm , we can achieve this sap luw

SAP memory: Global memory , which belongs to all sessions, we use set parameter and get parameter.

Export it_tab to memory <mem id>

Import to lt_tab from memory <mem id>


ABAP memory: local memory, specific to session , we use export and import statements

Set parameter id ‘ABC’ field lv_name


get parameter id ‘abc’ field lv_name

Parallel processing: when a huge no of records needs to be processed it takes lot of time to produce
output, with parallel processing we can divide task into multiple sessions and reduce the time and
improves performance.
It is a async call to FM.
Call function ‘bapi_sales_order_status’
starting a new task ‘T1’
Destination ‘None’

performing call1 on end of tak

exporting salesdoc = p_sdoc1.


Parallel cursor: To improve performance in case of nested loops.
sort both tables by the key and maintain an index on the inner table. Then, loop through the header
table, and inside that, loop through the item table starting from the last matched index. This avoids
re-checking previous records and significantly improves performance.
LOOP AT it_header INTO wa_header.

LOOP AT it_item INTO wa_item FROM lv_index.

IF wa_item-vbeln > wa_header-vbeln.

EXIT.

ENDIF.

IF wa_item-vbeln = wa_header-vbeln.

" Process logic

ENDIF.

lv_index = sy-tabix.

ENDLOOP.

ENDLOOP.

performance tools: ST05(performance trace), SE30/SAT,EPC(Extended program check)

File handling: AL11

Open dataset, close dataset, delete dataset, read dataset , transfer- for application server

CL_GUI_FRONTEND_SERVICES-for frontend

SD FLOW: Inquiry → Quotation → Sales Order → Delivery → Goods Issue → Billing → Payment.

MM flow: (Purchase Requisition) → (Purchase Order) → (Goods Receipt) → IR (Invoice Receipt) →


Payment.“\

FI flow: Account payable, account receivable, general ledger.

[Link] Pre-sales document VBAK, VBAP


2. Quotation Customer offer VBAK, VBAP

VBAK (header), VBAP (items), VBE


3. Sales Order Customer confirms order
(schedule lines)

4. Delivery (Outbound) Goods prepared for delivery LIKP (header), LIPS (items)

5. Goods Issue Stock reduced, accounting doc MKPF (header), MSEG (items)

6. Billing Invoice generation VBRK (header), VBRP (items)

BSID (open items), BSAD (cleared


7. Payment (FI) Customer payment received
items), BKPF, BSEG

MM

MM Step Description Key Tables

1. Purchase Requisition Internal request for materials EBAN – PR items

2. Purchase Order Formal order to vendor EKKO – PO header, EKP

MKPF – Material Doc H


3. Goods Receipt Material received in warehouse
Material Doc Items

4. Invoice Receipt Vendor invoice posted RBKP – Invoice Header

5. Payment Vendor paid (FI integration) BKPF – Accounting Doc


Items, BSIK/BSAS – Ve
Items

FI table:

• Accounting document header:BKPF

• Accounting document line items:BSEG

• Open items for customers:BSID

• Cleared items for customers:BSAD

• Open items for vendors:BSIK

• Cleared items for vendors:BSAK

You might also like