Step by Step Tutorials in Bapi-SAP ABAP

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 116

Step By Step Tutorials in SAP ABAP.

This Bolg has tutorials on Reports,


Interfaces, Conversions, Enhancements, BAPIS, RFCs, ALE, EDI, RFID, ALs, Smart Forms, Sap
Scripts, A!o"e Forms#
Search
Thursday, February 21, 2008
BAPI Sales Order Create Code
Bapi Sales Order Create Code
$e sa% in the earlier e&ample as to ho% to create a sales or!er from
the SE'( interface# )o% %e nee! to create a program an! call the
BAPI to create sales or!ers# Later %e %ill !iscuss %a*s to call a BAPI
from a non+sap s*stem#
,iven an appropriate name to the program# Please follo% the naming
conventions as per *our compan*# ABAP programs shoul! al%a*s
start %ith a -.- or a -/-#
Enter suita"le !escription#
Create a 0tmp o"1ects or create a transport re2uest# Transport
re2uests %oul! "e covere! in the later tutorials#
Follo% the menu path EDIT+++++3Pattern
Enter the name of the BAPI as sho%n "elo%#
The inserte! BAPI is sho%n "elo%#
$e no% nee! to get the import parameters, e&port parameters an!
the ta"les#
)ote4 Ta5e care that the !ata !eclaration in the program for the a"ove
mentione! parameters matches e&actl* as given in the BAPI# To
ensure that please open the BAPI using transaction SE'( an! cop*
the e&act names of the parameters from the BAPI structure#
If this is not follo%e! *our program %ill give an -ABAP D67P-#
Chec5 the Import parameters
The follo%ing figure sho%s the import parameter BAPIS8EAD an! %e
nee! to !eclare a structure in our ABAP program as follo%s#
ata! st"BAPIS#$A li%e BAPIS#$A, & Sales Order #eader
ata
7a5e sure *ou follo% the ABAP na'in( )on*entions.
Similarl* for ta"les pic5 up the names from the function mo!ule#
ata! st"BAPIS#$A li%e BAPIS#$A, & Sales Order #eader
ata
ta"BAPIIT$+I, li%e BAPIIT$+I, o))urs 0 -ith header line, & .n
ite'
ta"BAPIPA/T,/ li%e BAPIPA/T,/ o))urs 0 -ith header line, &
Partner
d"BAPI/$T0/,1 li%e BAPI/$T0/,1, & Bapi return 's(
d"*beln li%e bapi*beln12B$.,. & Sales Order ,u'ber
The complete program is given "elo%# Please ma5e sure that *ou use
the !ata specific to *our s*stem# In the follo%ing some of the values
are har! co!e!# /ou nee! to use varia"les an! pic5 up the values#
Please note in the follo%ing program, sol! to part* 9SP: has "een
entere! as -A,- an! ship to part* 9S8: as -R,-#
SP++++++++A,
S8++++++++R,
;r!er t*pe -;R- as -TA-
Please use TA instead o3 O/
Also if *ou set the 4 CO,2$/T"PA/25"A0A/T 6 787 parameter to
-<- *ou can use sol! to part* as SP an! ship to part* as S8#
REP;RT .E<=BAPISALES;RDCRT #
>+++++++++++++++++++++++++Data Declaration+++++++++++++++++++++++++++++>
Data4 st=BAPISD8EAD li5e BAPISD8EAD, ? Sales ;r!er 8ea!er
Data
ta=BAPIITE7I) li5e BAPIITE7I) occurs @ %ith hea!er line, ? Ln item
ta=BAPIPART)R li5e BAPIPART)R occurs @ %ith hea!er line, ?
Partner
!=BAPIRET6R)A li5e BAPIRET6R)A, ? Bapi return msg
!=v"eln li5e "apiv"eln+BEL)# ? Sales ;r!er )um"er
> 7ove the !ata to create sales or!er in the repective parameters++++++
>
move4 -TA- to st=BAPISD8EAD+D;C=T/PE, ? Sales !ocument t*pe
-ABCD'- to st=BAPISD8EAD+P6RC8=);=C,
-@@@A@- to ta=BAPIITE7I)+IT7=)67BER,
-/+'BA- to ta=BAPIITE7I)+7ATERIAL,
-AA@@- to ta=BAPIITE7I)+PLA)T,
-A- to ta=BAPIITE7I)+REE=ET/,
-A,- to ta=BAPIPART)R+PART)=R;LE, ? Sol! to Part*
-@@@@@@((((- to ta=BAPIPART)R+PART)=)67B#
> Appen! the internal ta"les+++++++++++++++++++++++++++++++++++++++++++>
appen! ta=BAPIPART)R#
clear ta=BAPIPART)R#
appen! ta=BAPIITE7I)#
clear ta=BAPIITE7I)#
> 7ove ship to part*+++++++++++++++++++++++++++++++++++++++++++++++++++>
move4 -R,- to ta=BAPIPART)R+PART)=R;LE, ? Ship to part*
-@@@@@@((((- to ta=BAPIPART)R+PART)=)67B#
> Appen! the internal ta"les+++++++++++++++++++++++++++++++++++++++++++>
appen! ta=BAPIPART)R#
clear ta=BAPIPART)R#
> Call the Bapi to create the sales or!er
CALL F6)CTI;) -BAPI=SALES;RDER=CREATEFR;7DATA-
E<P;RTI),
;RDER=8EADER=I) F st=BAPISD8EAD
> $IT8;6T=C;77IT F - -
4 CO,2$/T"PA/25"A0A/T 6 7 7
I7P;RTI),
SALESD;C67E)T F !=v"eln
> S;LD=T;=PART/ F
> S8IP=T;=PART/ F
> BILLI),=PART/ F
RET6R) F !=BAPIRET6R)A
TABLES
;RDER=ITE7S=I) F ta=BAPIITE7I)
;RDER=PART)ERS F ta=BAPIPART)R
> ;RDER=ITE7S=;6T F
> ;RDER=CF,S=REF F
> ;RDER=CF,S=I)ST F
> ;RDER=CF,S=PART=;F F
> ;RDER=CF,S=AL6E F
> ;RDER=CCARD F
> ;RDER=CF,S=BL;B F
> ;RDER=SC8ED6LE=E< F
#
if !=v"eln G3 space#
%rite4 -Sales or!er )o# -, !=v"eln#
en!if#
Poste! "* ABAP FRIE)D at H4A@ A7
La"els4 Bapi Sales ;r!er create, BAPI=SALES;RDER=CREATEFR;7DATA, Sample
program to create sales or!er using BAPI, SAP ABAP BAPI, SAP BAPI, 6sing BAPI,
6sing BAPIs
0 )o''ents!
Post a Comment
.in%s to this post
Create a Lin5
)e%er Post ;l!er Post 8ome
ABAP TIPS
P/$2IO0S ,$8T /A,O+
Al%a*s specif* *our con!itions in the $here+clause instea! of chec5ing them *ourself %ith chec5
statements# The !ata"ase s*stem can then use an in!e& 9if possi"le: an! the net%or5 loa! is
consi!era"l* less#
Since your web browser does not support JavaScript, here is a non-JavaScript version of
the image slideshow:
Al-ays spe)i3y your )onditions in the 5here1)lause instead o3 )he)%in( the' yoursel3 -ith
)he)% state'ents. The database syste' )an then use an inde9 :i3 possible; and the
net-or% load is )onsiderably less#
For all 3re<uently used Sele)t state'ents, try to use an inde9. =ou al-ays use an inde9 i3
you spe)i3y :a (eneri) part o3; the inde9 3ields )on)atenated -ith lo(i)al Ands in the Sele)t
state'ent7s 5here )lause. ,ote that )o'ple9 5here )lauses are poison 3or the state'ent
opti'i>er in any database syste'.
I3 there e9ists at least one ro- o3 a database table or *ie- -ith a )ertain )ondition, use the
Sele)t Sin(le state'ent instead o3 a Sele)t1$ndsele)t1loop. Sele)t Sin(le re<uires one
)o''uni)ation -ith the database syste', -hereas Sele)t1$ndsele)t needs t-o.
It is al-ays 3aster to use the Into Table *ersion o3 a Sele)t state'ent than to use Append
state'ents.
To read data 3ro' se*eral lo(i)ally )onne)ted tables use a ?oin instead o3 nested Sele)t
state'ents. ,et-or% load is )onsiderably less.
I3 you -ant to 3ind the 'a9i'u', 'ini'u', su' and a*era(e *alue or the )ount o3 a
database )olu'n, use a sele)t list -ith a((re(ate 3un)tions instead o3 )o'putin( the
a((re(ates yoursel3. ,et-or% load is )onsiderably less.
I3 you pro)ess your data only on)e, use a Sele)t1$ndsele)t1loop instead o3 )olle)tin( data
in an internal table -ith Sele)t Into Table. Internal table handlin( ta%es up 'u)h 'ore
spa)e.
0se a sele)t list or a *ie- instead o3 Sele)t 4 , i3 you are only interested in spe)i3i) )olu'ns
o3 the table. ,et-or% load is )onsiderably less.
For all 3re<uently used, read1only tables, try to use SAP bu33erin(. ,et-or% load is
)onsiderably less.
5hene*er possible, use array operations instead o3 sin(le1ro- operations to 'odi3y your
database tables. Fre<uent )o''uni)ation bet-een the appli)ation pro(ra' and database
syste' produ)es )onsiderable o*erhead.
5hene*er possible, use )olu'n updates instead o3 sin(le1ro- updates to update your
database tables. ,et-or% load is )onsiderably less.
Instead o3 usin( nested Sele)t loops or FO/ A.. $,T/I$S it is o3ten possible to use
sub<ueries. ,et-or% load is )onsiderably less.
0se the spe)ial operators CO, CA, CS, instead o3 pro(ra''in( the operations yoursel3. I3
ABAP@A state'ents are e9e)uted per )hara)ter on lon( strin(s, CP0 )onsu'ption )an rise
substantially.
So'e 3un)tion 'odules 3or strin( 'anipulation ha*e be)o'e obsolete and should be
repla)ed by ABAP@A state'ents or 3un)tions! ST/I,B"CO,CAT$,AT$... 1C
CO,CAT$,AT$, ST/I,B"SP.IT... 1C SP.IT, ST/I,B".$,BT# 1C strlen:;, ST/I,B"C$,T$/
1C 5/IT$...TO...C$,T$/$, ST/I,B"+O2$"/IB#T 1C 5/IT$...TO.../IB#T1D0STIFI$
0se the CO,CAT$,AT$ state'ent instead o3 pro(ra''in( a strin( )on)atenation o3 your
o-n.
I3 you -ant to delete the leadin( spa)es in a strin(, use the ABAP@A state'ent S#IFT....$FT
$.$TI,B .$AI,B... .Other )onstru)tions :-ith C, and S#IFT...B= S=1FPOS P.AC$S,
-ith CO,$,S$ i3 possible, -ith C, and ASSIB, C.AES=1FPOS:.$,; ...; are not as 3ast.
In any )ase, a*oid usin( S#IFT inside a 5#I.$1loopF
0se the SP.IT state'ent instead o3 pro(ra''in( a strin( split yoursel3.
0se the strlen: ; 3un)tion to restri)t the O loop to the rele*ant part o3 the 3ield, e.(. -hen
deter'inatin( a )he)%1su'.
0se &C.$A/ 3 5IT# *al& -hene*er you -ant to initiali>e a 3ield -ith a *alue di33erent 3ro'
the 3ield7s type1spe)i3i) initial *alue.
Try to %eep the table ordered and use binary sear)h or used a table o3 type SO/T$
TAB.$. I3 TAB has n entries, linear sear)h runs in O: n ; ti'e, -hereas binary sear)h ta%es
only O: lo(2: n ; ;.
A dyna'i) %ey a))ess is slo-er than a stati) one, sin)e the %ey spe)i3i)ation 'ust be
e*aluated at runti'e. #o-e*er, 3or lar(e tables the )osts are do'inated by nu'ber o3
)o'parison needed to lo)ate the entry.
I3 you need to a))ess an internal table -ith di33erent %eys repeatedly, %eep your o-n
se)ondary indi)es.5ith a se)ondary inde9, you )an repla)e a linear sear)h -ith a binary
sear)h plus an inde9 a))ess.
.OOP ... 5#$/$ is 3aster than .OOP@C#$CG be)ause .OOP ... 5#$/$ e*aluates the
spe)i3ied )ondition internally. As -ith any lo(i)al e9pressions, the per3or'an)e is better i3
the operands o3 a )o'parison share a )o''on type. The per3or'an)e )an be 3urther
enhan)ed i3 .OOP ... 5#$/$ is )o'bined -ith F/O+ i1 and@or TO i2, i3 possible.
Al%a*s use Prett* Printer an! E&ten!e! Program Chec5 "efore releasing the co!e# Do not leave
unuse! co!e in the program# Comment the co!e thoroughl*# Align the comments an! the Co!e#
Follo% the SAP Stan!ar!s an! SAP Best Practices gui!elines# ItIs a goo! practice to ta5e a !ump
of the co!e on *our local !rive#
Ole Auto'ation Part1
Ole Auto'ation Part 2
Pro)essin( Blo)%s in ABAP
Si'ple ABAP /eport
A.2 Brid 1 Chan(in( Colors
A.2 /eport $9a'ple
Creatin( 2ariants For ABAP
/eports
/e)ordin( BC usin(
Transa)tion
Sales o)u'ent Flo- in
ABAP
0ser $9its in SAP S
SAP ABAP ,a'in(
Standards
SAP S Tables
SAP ABAP ata i)tionary
Tables
++ I'portant Transa)tion
Codes in SAP
Passin( ( ata Fro' One
ABAP Pro(ra' to Another
ABAP Co'pute Add Colle)t
and Append
SAP ABAP eter'inin(
Attributes o3 ata
SAP ABAP $ditor I)ons
BAPI 3or isplayin( +aterial
ata
BAPI to (et )usto'er ban%
details
$I Outbound Pro)ess
SAP $I Pro)ess O*er*ie-
Fun)tion +odule 3or 2endor
Ban% details
SAP IOC
Creatin( a 2alid Pass-ord in
SAP
SAP BAIs Introdu)tion
SAP ABAP +AC/OS
POP 0P 3un)tion +odule to
Con3ir' and Sa*e ata
Sap S)ripts and S'artFor's
Bar Codes
Standard /eports and Sap
S)ripts
I'portant Standard /eports
in SAP
Abap Tri)%s and Tips
Bapi Sales Order
BAPI Pur)hase Order
Creatin( Fun)tion +odules in
SAP
Creatin( Tables in SAP
Findin( 0ser $9its in SAP
Fun)tion +odule Create Te9t
and /ead Te9t
I'portant Transa)tion Codes
in SAP
ABAP Fun)tion +odule 3or
Sub'ittin( a Pro(ra'
ABAP Ba'e Ti) Ta) Toe
ABAP Internal Table To $9)el
Sheet
ABAP Fun)tion +odule to
)reate ire)tory
i33erent Types o3 +enus in
SAP
Fun)tion +odules in SAP to
)he)% .o(ed in 0sers
ABAP Fun)tion +odule 3or
Addin( ays to ates
Call a Transa)tion Fro' a
/e'ote Syste'
SAP ++ si'ple Pro)ure'ent
Cy)le
BAPI +aterial $IT
Findin( e)i'al Pla)es in
Curren)y
Bettin( ne(ati*e si(n be3ore
a nu'ber in ABAP
Pro(ra' $ditor .o)% 0nlo)%
/estri)tin( Sele)t Options
.ist o3 BAPIs in the syste'
SAP Fun)tion +odule
ABAP De"ugger Brea5 Points
ABAP De"ugger $atchPoints
Drill Do%n Reports Concept
Creating a 8;T SP;T
Interactive Programs an! 8i!e
Techni2ue
String Concatenate
,et $ee5 of the /ear
SAP ABAP to A!! Da*s to a
Date
A!! 7onths to a Date
,et 7onth in the /ear
Displa* Cloc5
ABAP Code For Pro(ress
BA/
ABAP Fun)tion +odule For
Calu)lator
ABAP Fun)tion +odule For
Calender
isplayin( +essa(es in
ABAP
Fun)tion +odule Pop 0p To
Con3ir'
Con*ersion /outines in SAP
SAP ABAP Authori>ation
SAP ABAP +odule Pool
Tutorial
SAP ABAP /FC
Findin( Path to SAP
Transa)tion in +enu
SAP Pur)hasin( o)u'ents
SAP and ABAP Short)uts
.o(i)al atabases
Ad*anta(es o3 .o(i)al
atabases
Copy to Clipboard
BAPI Create +aterial
Findin( and /unnin(
Pro(ra's in ABAP
Pro(ra' Synta9 Che)% and
$9tended Synta9 Che)%
Sele)t Options upper lo-er
)ase
Pop 0p a Calender
+odule to /ead a File
+odule to /e*erse A Strin(
/un an $9e)utable Pro(ra'
-ith Para'eters
Pro(ra' 3or POP up S)reen
Printin( Sele)tion
Para'eters 3or a /eport
0ploadin( and o-n.oadin(
a /eport
SAP ABAP 2ersion
+ana(e'ent
SAP ABAP Short Cuts
.ist o3 I'portant Syste'
2ariables
ABAP 7ACR;S
ABAP Callin( a File Sele)tor
So'e I'portant Fun)tion
+odules
ABAP Strin( Operations
ABAP Fun)tion +odule to
Che)% 2alidity o3 ate
Trans3er Internal Table
Contents to a File
SAP ABAP Pro(ra' Types
BAPI to /ead Custo'er ata
Che)%in( 2alidity o3 ate
o-nload to Appli)ation
Ser*er
ABAP ebu((er Brea%point
and 5at)hpoint
BAPI to (et Co'pany Code
etails
Creatin( +aterial 0sin( BAPI
part 2
Beneratin( a 2alid Pass-ord
.o(i)al atabases Stru)ture
+a%in( Fields OBli(atory in
Sele)tion S)reen
ABAP 2ie-s
Bettin( a Co'pany Code 3or
a Plant
I'portin( )ontents o3
Sele)t Options
BAPI 3or a*ailability )he)%
Strin( to ,u'eri)al
SAP Boods +o*e'ent
Pro)ess
Bettin( a .ist o3 Plants 3or a
+aterial
SAP /H Clients Con)ept
ABAP Adobe For's
Authori>ation Ob?e)t Tables
SAP Industry Spe)i3i)
Solutions
S)ra'ble a Strin(
.S+5
POP up table )ontents on the
s)reen
SAP /H Boo%'ar%in(
5ebsites
Sto)% /e<uire'ents .ist
Fun)tion +odule
/etail Transa)tion Codes
BAPI Sales Order Si'ulate
Bet P.A,T and es)ription
3or a +aterial
+/P .ist Fun)tion +odule
Produ)tion Plannin( and
Controllin(
Appli)ations in SAP /H
Tool Based /eports
I'portant Transa)tion Codes
in SAP
SAP Sto)% per Bin
Clipboard in SAP
Bettin( a Plant 3or a +aterial
Plant +aterial and Stora(e
.o)ation
SAP Produ)tion Plannin(
Standard /eports
,et5ea*er Co'ponents
Supported atabases and
Operatin( Syste's
Its TRUE that SAP is expanding its solutions to
allow for integration to other NON-SAP systems And
!A"A is #eing used to a$$omplish this This does not in
any way mean that A%AP will #e repla$ed #y !A"A
&illions of lines of A%AP $odes has #een written
whi$h exists in the forms of Reports Interfa$es and
Enhan$ements This $odes runs the #iggest $ompanies
of the world SAP is $ontinuously in the
effort of impro'ing A%AP

Su"scri"e to FREE Post
Enter Email
Su"scri"e
Delivere! "* Fee!Burner
Blo( Ar)hi*e
J H@@K 9H@B:
o J August 9H:
J Aug AC 9A:
SAP ABAP Important Le*%or!sThe follo%ing list
!isp###
M Aug A' 9A:
SAP ABAP Function 7o!ule to $rap Long Te&tThe
foll###
o M Nul* 9AO:
M Nul HD 9':
SAP Retail Transaction Co!es4 Su"se2uent
Settlemen###
SAP Retail Transaction Co!es4 Fresh Items
Procurem###
Important Transaction Co!es in SAP Retail4 )on+rep###
M Nul HK 9':
SAP Retail Transactions Procurement of
Replenisha"###
SAP Retail Transactions Assortment 7anagement
SAP Retail Transaction Co!es Pricing
M Nul HC 9A:
SAP IS+Retail Transaction Co!es 7erchan!ise
M Nul AO 9A:
)et%eaver Components A6T;ID Infrastructure RFID
M Nul AB 9A:
SAP Supporte! Data"ases ;perating S*stems
M Nul A@ 9A:
SAP an! A!o"e Forms
M Nul @D 9A:
SAP AuthoriPation ;"1ects Ta"les
M Nul @K 9A:
SAP 6serQan! AuthoriPation S*stemQRelate! Ta"les
M Nul @( 9A:
SAP In!ustr* Specific Solutions SAP Business Solut###
M Nul @H 9A:
SAP Stoc5 Per Bin
M Nul @A 9H:
SAP Plant Storage Location Data
SAP Plant Details Compan* co!e an! Controlling
Are###
o M Nune 9B@:
M Nun '@ 9':
SAP PLant for a 7aterial
SAP Compan* Co!e for a Plant
SAP Plant 7aterial an! Storage Location
M Nun H( 9A:
SAP P;P 6P TABLE C;)TE)TS ;) T8E SCREE)
M Nun HO 9H:
SAP ,et Plant Description for a 7aterial
SAP Plants for a given 7aterial
M Nun HB 9A:
SAP ABAP Fin!ing an! Running Programs
M Nun HC 9H:
SAP Function 7o!ule String )umerical
SAP Function 7o!ule String Scram"le
M Nun H' 9':
SAP ABAP )egative Sign Before a )um"er
SAP Function 7o!ule Import Clip"oar!
SAP ABAP Cop* to ClipBoar! Function 7o!ule
M Nun HH 9A:
SAP Tool Base! Reports
M Nun H@ 9H:
SAP ,oo!s 7ovement
SAP Pro!uction Planning an! Controlling Stan!ar!
R###
M Nun AD 9H:
SAP 7RP List Function 7o!ule
SAP Stoc5sRRe2uirements List Function 7o!ule
M Nun AK 9H:
SAP Availa"ilit* Chec5 BAPIRFunction 7o!ule
Creating a ali! Pass%or! in SAP
M Nun A( 9H:
SAP RR' Boo5mar5ing $e"sites
SAP RR' Clients Concept
M Nun AO 9A:
Stan!ar! Reports in SAP Pro!uction Planning
M Nun AB 9A:
SAP ABAP ,enerate Pass%or! Function 7o!ule
M Nun AC 9A:
SAP BAPI Sales ;r!er Simulate
M Nun AH 9A:
SAP BAPI List of BAPIS in the S*stem
M Nun AA 9A:
SAP LS7$ Legac* S*stem 7igration $or5"ench
M Nun A@ 9H:
SAP RR' Applications
Stan!ar! Reports in SAP Pro!uction Planning
M Nun @K 9A:
SAP ABAP 7acros
M Nun @O 9A:
BAPI to get compan* co!e !etails
M Nun @B 9B:
SAP ABAP Program EDIT;R L;CLR6)L;CL
6sing Logical Data"ases in SAP ABAP
M Nun @C 9B:
M Nun @' 9B:
M Nun @H 9B:
o M 7a* 9B@:
M 7a* 'A 9':
M 7a* '@ 9A:
M 7a* HD 9':
M 7a* HK 9H:
M 7a* H( 9H:
M 7a* HO 9':
M 7a* H' 9A:
M 7a* HA 9H:
M 7a* H@ 9H:
M 7a* AO 9H:
M 7a* AC 9H:
M 7a* A' 9':
M 7a* AH 9H:
M 7a* AA 9H:
M 7a* A@ 9':
M 7a* @K 9':
M 7a* @( 9':
M 7a* @O 9':
M 7a* @B 9H:
M 7a* @C 9A:
M 7a* @' 9A:
M 7a* @H 9A:
M 7a* @A 9':
o M April 9HA:
M Apr '@ 9H:
M Apr HD 9A:
M Apr HK 9H:
M Apr H( 9A:
M Apr HB 9A:
M Apr HC 9A:
M Apr H' 9H:
M Apr HH 9A:
M Apr HA 9A:
M Apr A( 9A:
M Apr AC 9H:
M Apr A@ 9A:
M Apr @D 9H:
M Apr @C 9A:
M Apr @' 9A:
M Apr @A 9A:
o M 7arch 9'H:
M 7ar 'A 9A:
M 7ar HK 9A:
M 7ar H( 9A:
M 7ar HO 9A:
M 7ar HB 9H:
M 7ar HC 9A:
M 7ar H' 9A:
M 7ar HH 9':
M 7ar HA 9A:
M 7ar AD 9H:
M 7ar A( 9':
M 7ar AC 9A:
M 7ar A' 9H:
M 7ar AH 9A:
M 7ar @( 9H:
M 7ar @O 9C:
M 7ar @B 9C:
M 7ar @C 9A:
o M Fe"ruar* 9HK:
M Fe" HD 9A:
M Fe" HK 9H:
M Fe" H( 9H:
M Fe" HO 9H:
M Fe" HB 9A:
M Fe" HH 9A:
M Fe" HA 9A:
M Fe" H@ 9A:
M Fe" AD 9A:
M Fe" AK 9H:
M Fe" AO 9A:
M Fe" AB 9':
M Fe" AC 9A:
M Fe" A' 9A:
M Fe" A@ 9A:
M Fe" @( 9A:
M Fe" @O 9A:
M Fe" @B 9A:
M Fe" @' 9A:
M Fe" @H 9':
o M Nanuar* 9O:
M Nan 'A 9A:
M Nan HC 9A:
M Nan H' 9A:
M Nan HH 9A:
M Nan AH 9A:
M Nan @B 9A:

BAPI /FC Fun)tion +odules A Si'ple ABAP /eport +O0.$ POO. ABAP ,a'in( Standards BC SAP SC/IPTS BA/
CO$ STA,A/ /$PO/TS 0S$/ $8ITS .ist o3 I'portant 2ariables ABAP Tri)%s and Tips I'portant Transa)tion Codes
in ABAP Creatin( Tables in SAP Sales o)u'ent Flo- SAP S /elated Tables Findin( 0ser $9its in SAP Pro)essin(
Blo)%s in ABAP Fun)tion +odules Create Te9t And Sa*e Te9t O.$ Auto'ation O.$ For $8C$. Si'ple ABAP A.2 /eport
Creatin( 2ariants For ABAP Pro(ra's SAP ABAP Authori>ations Con*ersion /outines in SAP


Pri*a)y Poli)y
This site is o%ne! an! operate! "* , Ra1esh# All pro!uct names are tra!emar5s of their respective companies# This site is in no
%a* affiliate! %ith SAP A,# 6se information on this site at *our o%n ris5# I The arti)les are )opyri(hted to B /a?esh and )an
only be reprodu)ed (i*en the author7s per'ission. =ou )an )onta)t 'e on abap.sap.3riendJ('ail.)o'. /our privac* on
the Internet is of the utmost importance to us#$e %ant to ma5e *our online e&perience satisf*ing an! safe# Because %e gather
certain t*pes of information a"out our users, %e feel *ou shoul! full* un!erstan! our polic* an! the terms an! con!itions
surroun!ing the capture an! use of that information# This privac* statement !iscloses %hat information %e gather an! ho% %e use
it#
Information %e gathers through aggregate! trac5ing information !erive! mainl* "* tall*ing page vie%s throughout our sites# This
information allo%s us to "etter tailor our content to rea!ersI nee!s an! to help our a!vertisers an! sponsors "etter un!erstan! the
!emographics of our au!ience# 6n!er no circumstances %e !ivulge an* information a"out an in!ivi!ual user to a thir! part*#
Coo5ie Trac5ing4 $e ma* place a te&t file calle! a Scoo5ieT in the "ro%ser files of *our computer# The coo5ie itself !oes not
contain Personal Information although it %ill ena"le us to relate *our use of this site to information that *ou have specificall* an!
5no%ingl* provi!e!# But the onl* personal information a coo5ie can contain is information *ou suppl* *ourself# A coo5ie canIt rea!
!ata off *our har! !is5 or rea! coo5ie files create! "* other sites# $e ma* use coo5ies to trac5 user traffic patterns 9as !escri"e!
a"ove:#
5e allo- third1party ad*ertisin( )o'panies :li%e Boo(le Adsense; to ser*e ads -hen you *isit our 5eb site. I3 you -ould
li%e 'ore in3or'ation about this pra)ti)e and to %no- your )hoi)es about not ha*in( this in3or'ation used by these
)o'panies, 2isit This.http4RR%%%#google#comRprivac*=a!s#html
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Step By Step Tutorials in SAP ABAP. This Bolg has tutorials on Reports,
Interfaces, Conversions, Enhancements, BAPIS, RFCs, ALE, EDI, RFID, ALs, Smart Forms, Sap
Scripts, A!o"e Forms#
Search
Sho%ing posts for 2uer* sales order )reation# Sho% all posts
Sho%ing posts for 2uer* sales order )reation# Sho% all posts
+onday, Duly 28, 2008
SAP /etail Transa)tion Codes Pri)in(
Find belo- a list o3 transa)tion Codes 3or SAP /etail Pri)in(
Transa)tion es)ription
+OA Create Customer Discount Con!ition
BDHH Delete Change Pointers
$)@ ,enerate Pricing $or5list
$)A Release $or5list
7EIC Create Automatic Document %or5list
A@A Create Sales ;r!er
$A' Displa* LP Calculation Sur
$LLA Create 7ar5et+"as5et Price Calculation
$7BA Create Price Entr*
LPB Create Price Calculation
$P7A Direct Re2uest For P;S ;ut"oun!
$A( Displa* LP Calculation Sur
$E' Displa* Ret# 7ar5up SP Ca
7ELE Con!itions B* en!or
+OC Displa* Customer Discount
LA' Displa* Con!ition Recor!s
RLD E&ecute Pricing Report
See Also!
SAP Industry Spe)i3i) Solutions SAP Business Solutions By Industry
SAP IS1/etail Transa)tion Codes +er)handise
I'portant Transa)tion Codes 3or ABAP
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""
Poste! "* ABAP FRIE)D at A@4HO P7 @ comments Lin5s to this post
Saturday, Dune 1A, 2008
SAP BAPI Sales Order Si'ulate
SAP BAPI Sales Order Si'ulate
In SAP "efore creating a sales or!er there is a %a* to simulate it using a BAPI# This can "e !one
using the follo%ing BAPI#
SAP ABAP BAPI to Simulate a Sales ;r!er#
BAPI"SA.$SO/$/"SI+0.AT$
This is ver* useful in case *ou %ant to chec5 the Availa"ilit* an!
Pricing# The parameters o"taine! are given "elo%#
BAPIIT$+$8 Co''uni)ation Fields! Issue S
o)u'ent Ite'! 555
BAPIS#$0 Struture o3 2B$P :Sales o)u'ent!
S)hedule .ine ata;
BAPICO, Co''uni)ation Fields 3or +aintainin(
Conditions in the Order
BAPII,CO+P Co''uni)ation Fields! In)o'pletion
Fin! the co!e "elo%#
)ote4 This is ver* similar to Sales ;r!er Create BAPI
-BAPI=SALES;RDER=CREATEFR;7DATA- "ut in this case the
actual Sales ;r!er is not create! instea! a simulation is carrie! out#
/$PO/T K$8"SA.O/SI+0.AT$.
41111111111111111111111111ata e)laration111111111111111111111111111114
ata! st"BAPIS#$A li%e BAPIS#$A, & Sales Order #eader
ata
ta"BAPIIT$+I, li%e BAPIIT$+I, o))urs 0 -ith header line, &
.n ite'
ta"BAPIPA/T,/ li%e BAPIPA/T,/ o))urs 0 -ith header line,
& Partner
int"BAPIIT$+$8 li%e BAPIIT$+$8 o))urs 0 -ith header line,
int"BAPIS#$0 li%e BAPIS#$0 o))urs 0 -ith header
line,
int"BAPICO, li%e BAPICO, o))urs 0 -ith header line,
int"BAPII,CO+P li%e BAPII,CO+P o))urs 0 -ith header
line,
d"BAPI/$T0/,1 li%e BAPI/$T0/,. & Bapi return 's(
4 +o*e the data to )reate sales order in the repe)ti*e
para'eters1111114
'o*e! 7TA7 to st"BAPIS#$A1OC"T=P$, & Sales do)u'ent
type
71LAMH7 to st"BAPIS#$A1P0/C#",O"C,
7000107 to ta"BAPIIT$+I,1IT+",0+B$/,
7=1HL17 to ta"BAPIIT$+I,1+AT$/IA.,
711007 to ta"BAPIIT$+I,1P.A,T,
717 to ta"BAPIIT$+I,1/$N"NT=,
7AB7 to ta"BAPIPA/T,/1PA/T,"/O.$, & Sold to Party
7000000OOOO7 to ta"BAPIPA/T,/1PA/T,",0+B.
4 Append the internal tables11111111111111111111111111111111111111111114
append ta"BAPIPA/T,/.
)lear ta"BAPIPA/T,/.
append ta"BAPIIT$+I,.
)lear ta"BAPIIT$+I,.
4 +o*e ship to party1111111111111111111111111111111111111111111111111114
'o*e! 7/B7 to ta"BAPIPA/T,/1PA/T,"/O.$, & Ship to
party
7000000OOOO7 to ta"BAPIPA/T,/1PA/T,",0+B.
4 Append the internal tables11111111111111111111111111111111111111111114
append ta"BAPIPA/T,/.
)lear ta"BAPIPA/T,/.
4 Call BAPI to SI+0.AT$ the Order
CA.. F0,CTIO, 7BAPI"SA.$SO/$/"SI+0.AT$7
$8PO/TI,B
O/$/"#$A$/"I, 6 st"BAPIS#$A
4 CO,2$/T"PA/25"A0A/T 6 7 7
I+PO/TI,B
4 SA.$SOC0+$,T 6
4 SO."TO"PA/T= 6
4 S#IP"TO"PA/T= 6
4 BI..I,B"PA/T= 6
/$T0/, 6 d"BAPI/$T0/,1
TAB.$S
O/$/"IT$+S"I, 6 ta"BAPIIT$+I,
O/$/"PA/T,$/S 6 ta"BAPIPA/T,/
4 O/$/"SC#$0.$"I, 6
O/$/"IT$+S"O0T 6 int"BAPIIT$+$8
4 O/$/"CFBS"/$F 6
4 O/$/"CFBS"I,ST 6
4 O/$/"CFBS"PA/T"OF 6
4 O/$/"CFBS"2A.0$ 6
4 O/$/"CFBS"B.OB 6
4 O/$/"CCA/ 6
4 O/$/"CCA/"$8 6
O/$/"SC#$0.$"$8 6 int"BAPIS#$0
O/$/"CO,ITIO,"$8 6 int"BAPICO,
O/$/"I,CO+P.$T$ 6 int"BAPII,CO+P
4 +$SSAB$TAB.$ 6
4 $8T$,SIO,I, 6
4 PA/T,$/A/$SS$S 6
.
IF S=1S0B/C 6 0.
$,IF.
Poste! "* ABAP FRIE)D at AA4BH P7 @ comments Lin5s to this post
La"els4 BAPI, BAPI=SALES;RDER=SI76LATE, Function 7o!ule, Sales or!er
Simulation
+onday, April 1A, 2008
SAP ABAP Callin( $9e)utable Pro(ra's
SAP ABAP Callin( $9e)utable Pro(ra's
If *ou %ish to call an e&ecuta"le ABAP progra from another ABAP programRreport *ou can !o so
"* using the S6B7IT statement# For e&ample *our %ish to call program GCALLEDPR;,AR73
from the current program GC6RRE)TPR;,RA73 then the control can either "e passe! to the
calle! program or once the calle! program has finishe! its 1o" the control ca" "e RET6R)ED to
the calling program# Please fin! the S*nta& "elo%#
S0B+IT pro(P:*ariable; QA, /$T0/,R QoptionsR.
The calle! program name can "e !irectl* mentione! in the co!e or
*ou can !*namicall* pass the calle! program using a varia"le# As
mentione! a"ove once the calle! program finishes its 1o", the
program can "e either returne! to the calling program using the
RET6R) option# In case RET6R) is omitte! then all !ata an! list
levels of the calling program 9the entire internal session: are !elete!#
After the calle! e&ecuta"le program has finishe!, control returns to
the level from %hich *ou starte! the calling program# $hereas if the
RET6R) option is use! then the control is returne! to the statement
after S6B7IT an! the calling program continues its operation#
In case the calle! program has a selection screen then the S6B7IT
statement can "e use! %ith the various options as sho%n "elo%#
S0B+IT Q2IA S$.$CTIO,1SC/$$,R
Q0SI,B S$.$CTIO,1S$T *arR
The follo%ing co!e %ill ma5e things clearer#
The follo%ing is the )alled pro(ra'
REP;RT .E<ERCISE=A 7ESSA,E+ID .E<ERCISEA#
#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>
>
> This Report Displa*s Sales ;r!er 8ea!er
Data >
>
>
>
>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> Ta"les Declaration++++++++++++++++++++++++++++++++++++++++++++++++++++
Ta"les4 BAL, ? Sales Document4 8ea!er Data
BPA, ? Sales Document4 Partner
BLD# ? Sales Document4 Business Data
> Data Declaration++++++++++++++++++++++++++++++++++++++++++++++++++++++
!ata4 !=sol!to9A@:, ? Sol! to part*
!=shipto9A@:, ? Shipt to Part*
!="u*er9A@:, ? Bu*er
!="illto9A@:# ? Bill to Part*
> Select ;ptions++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Select+options4 S=BEL) for v"a5+v"eln# ? Sales ;r!er )um"er
> Start of Selection++++++++++++++++++++++++++++++++++++++++++++++++++++
Start+;f+Selection#
Select v"eln
net%r
%aer5 into 9v"a5+v"eln, v"a5+net%r, v"a5+%aer5: from v"a5
%here
v"eln in s=BEL)#
en!select#
> Select Bu*er+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
select single 5unnr
into !="u*er from v"pa %here parv% F -B6- or parv% F -RE- an!
v"eln F S=BEL)+L;$#
> Select Bill to Part*+++++++++++++++++++++++++++++++++++++++++++++++++
select single 5unnr
into !="illto from v"pa %here parv% F -BP- or parv% F -$E- an!
v"eln F S=BEL)+lo%#
> Select Sol! to Part*++++++++++++++++++++++++++++++++++++++++++++++++++
select single 5unnr
into !=sol!to from v"pa %here parv% F -SP- or parv% F -A,-
an!
v"eln F S=BEL)+lo% #
> Select Shipt to Part*+++++++++++++++++++++++++++++++++++++++++++++++++
select single 5unnr
into !=shipto from v"pa %here parv% F -S8- an!
v"eln F S=BEL)+lo% #
> ;utput the !ata+++++++++++++++++++++++++++++++++++++++++++++++++++++++
%rite4R v"a5+v"eln, !="u*er, v"a5+net%r, !="illto, !=sol!to, !=shipto,
v"a5+%aer5#
The follo%ing the the )allin( pro(ra'.
REP;RT .E<ERCISE=S6B7IT #
Data4 !=valueA9A@:#
!=valueA F -TestA-#
S6B7IT .E<ERCISE=A via selection+screen an! RET6R)#
%rite4 !=valueA#
$8$/CIS$
Please tr* the follo%ing options#
A: From the calling program-s S6B7IT statement remove the and
/$T0/, ;ption an! see the result# If an! RET6R) is remove! the
the value of !=valueA is not %ritten on the screen# $here as if an!
RET6R) is not omitte! then the control is given "ac5 to the calle!
program at the ne&t statement after S6B7IT an! the value of
!=valueA ie TestA is %ritten on the screen#
H: Create a variant for the program 9see creating variants for ABAP
Programs:# An! use the statement given "elo%# An! see the result#
)ote that S;RD is the variant name an! *ou nee! to replace it %ith
the name given "* *ou#
S0B+IT K$8$/CIS$"1 usin( sele)tion1set 7SO/7.
Poste! "* ABAP FRIE)D at C4AB A7 @ comments Lin5s to this post
+onday, +ar)h 2A, 2008
SAP #old ata Set ata O-n ata and Syste' Status
SAP #old ata Set ata O-n ata and Syste' Status
SAP S=ST$+ I,FO/+ATIO,
If *ou are on a particular screen an! %ish to chec5 the )urrent transa)tion in
SAP then *ou can follo% the menu path given "elo%#
S*stem+++++3Status#
Please refer the !iagram sho%n "elo%#
;nce *ou clic5 on Status *ou %ill see the screen sho%n "elo%#
In the a"ove screen *ou can see the complete SAP syste'
in3or'ation#
SAP O5, ATA
In the SAP S*stem if *ou %ant to set !efaults or %ant to give *our
o%n preferences then *ou can follo% the menu path given "elo%#
S/STE7 ++++++++ 6SER PR;FILE ++++++++ ;$) DATA#
Please refer the screen sho%n "elo%#
For e&ample *ou can change the %a* s*stem !ate is !ispla*e!#
9mm#!!#****: or 9!!#mm#****:
#old ata and Set ata
Suppose *ou %ant to create multiple Sale ;r!ers or Purchase ;r!ers
%ith similar !ata# Then *ou nee! not t*pe in all the fiel!s again an!
again# This can "e !one "* using the 8ol! Data an! Set Data
functionalit*#
To chec5 this functionalit* pleas run transaction A@A ++++ SAP Sales
Order Create. T*pe in the re2uire! fiel!s li5e
Ship1to Party
Sold1to Party
Pur)hase Order ,u'ber
+aterial ,o
Nuantity
an! then clic5 on #O. ata :+enu Path CCCCCCCCC Syste'
1111111111 0ser Pro3ile 1111111 #old ata;
Please refer the figure "elo%#
The fiel!s that contain !ata %ill "e hel! even after saving the sales
;r!er an! %ill remain %hen the ne&t A@A screen appears# )o% *ou
can ma5e changes in the !ata an! Save the ;r!er#
Similarl* *ou can use Set ata. B* using Set Data the values remain
on the screen "ut are not availa"le for e!iting# Set Data can "e use!
if *ou are sure that *ou %oul! "e creating multiple o"1ects in same
%ith e&actl* the same !ata values#
Poste! "* ABAP FRIE)D at D4AD A7 @ comments Lin5s to this post
La"els4 ;%n Data, SAP8ol! Data, Set Data, S*stem Status
5ednesday, +ar)h 1M, 2008
SAP ABAP Tutorial 3or )reatin( an /FC :/e'ote enabled Fun)tion
+odule;
SAP ABAP Tutorial 3or )reatin( an /FC :/e'ote enabled Fun)tion
+odule;
Tas54 To create an RFC for creating a Sales or!er in SAP#
In the earlier posts %e have alrea!* seen ho% to use a BAPI to
create a SALES or!er in SAP ABAP# To!a* %e %ill create an RFC to
post a sales or!er#
,ote! =ou )an use the 3ollo-in( BAPIs and Fun)tion 'odules to
)reate a Sales Order in SAP.
BAPI"SA.$SO/$/"C/$AT$F/O+AT1 Sales ;r!er4 Create
Sales ;r!er
BAPI"SA.$SO/$/"C/$AT$F/O+AT1 Sales ;r!er4 Create
Sales ;r!er
S"SA.$SOC0+$,T"C/$AT$
Other BAPIs related to Sales Order are as 3ollo-s.
BAPISO/$/"B$T$TAI.$.IST Sales Order! .ist o3 All
Order ata
BAPI"O/$/"C#A,B$"STAT0S"B$T Chan(e status 3or order
BAPI"SA.$SO/$/"C#A,B$ Sales Order! Chan(e Sales Order
BAPI"SA.$SO/$/"B$T.IST Sales order! .ist o3 all orders 3or
)usto'er
BAPI"SA.$SO/$/"B$TSTAT0S Sales order! isplay status
BAPI"SA.$SO/$/"SI+0.AT$ Sales Order! Si'ulate Sales
Ord
Transa)tions used in this Tutorial.
S$HO Fun)tion Builder
S$H8 ABAP $ditor
S$80 Ob?e)t ,a*i(ator
S#B BC /e)order
First %e %ill !o a BDC recor!ing using transaction S8DB# To see
!etails on ho% to !o a BDC recor!ing please clic5 here.
In this case *ou nee! to use the transaction A@A to !o the recor!ing#
$e %ill !o the recor!ing for the follo%ing fiel!s#
Order Type
Sold1to Party
Ship1to Party
Pur)h Ord ,o
+aterial
Nuantity
In the function mo!ule that %e create these %ill "e the Import
Parameters#
)ote4 *ou nee! to !o the BDC recor!ing for all the man!ator* fiel!s
for creating a Sales ;r!er#
;nce the BDC recor!ing is complete for Transa)tion 2A01 as sho%n
in the previous post 9/e3er this:
$e nee! to create a program for this recor!ing 9/e3er this:#
;nce the a"ove t%o tas5s are complete %e nee! to !o some clean
up as %e have to transfer this program to a function mo!ule# Please
refer to the follo%ing program#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
report .SALES;RDER
no stan!ar! page hea!ing line+siPe HBB#
DATA4 BDCDATA LILE BDCDATA ;CC6RS @ $IT8 8EADER
LI)E,
CT67;DE LILE CT6=PARA7S+DIS7;DE AL6E -A-,
C6PDATE LILE CT6=PARA7S+6PD7;DE AL6E -L-,
7ESSTAB LILE BDC7S,C;LL ;CC6RS @ $IT8 8EADER
LI)E,
L=S6BRC LILE S/+S6BRC,
L=7STRI),9CK@:,
);DATA AL6E -R-#
>inclu!e "!crec&#
start+of+selection#
perform "!c=!*npro using -SAP7CBA- -@A@A-#
perform "!c=fiel! using -BDC=C6RS;R-
-BAL+SPART-#
perform "!c=fiel! using -BDC=;LC;DE-
-R@@-#
perform "!c=fiel! using -BAL+A6ART-
-;R-#
perform "!c=fiel! using -BAL+L;R,-
--#
perform "!c=fiel! using -BAL+T$E,-
--#
perform "!c=fiel! using -BAL+SPART-
--#
perform "!c=!*npro using -SAP7CBA- -C@@A-#
perform "!c=fiel! using -BDC=;LC;DE-
-R@@-#
perform "!c=fiel! using -BLD+BSTLD-
-ABCD'-#
perform "!c=fiel! using -L6A,+L6))R-
-((((-#
perform "!c=fiel! using -L6$E+L6))R-
-((((-#
perform "!c=fiel! using -RCBA+LETDAT-
-@CR@ARH@@K-#
perform "!c=fiel! using -RCBA+LPR,B.-
-D-#
perform "!c=fiel! using -BLD+PRSDT-
-@'RADRH@@K-#
perform "!c=fiel! using -BDC=C6RS;R-
-RCBA+L$7E),9@A:-#
perform "!c=fiel! using -RCBA+7AB)R9@A:-
-*+'BA-#
perform "!c=fiel! using -RCBA+L$7E),9@A:-
- A-#
perform "!c=!*npro using -SAP7CBA- -C@@A-#
perform "!c=fiel! using -BDC=;LC;DE-
-FSIC8-#
perform "!c=fiel! using -BLD+BSTLD-
-ABCD'-#
perform "!c=fiel! using -L6A,+L6))R-
-((((-#
perform "!c=fiel! using -L6$E+L6))R-
-((((-#
perform "!c=fiel! using -RCBA+LETDAT-
-@CR@ARH@@K-#
perform "!c=fiel! using -RCBA+LPR,B.-
-D-#
perform "!c=fiel! using -BLD+PRSDT-
-@'RADRH@@K-#
perform "!c=fiel! using -BLD+.TER7-
-.B@A-#
perform "!c=fiel! using -BLD+I)C;A-
-CIF-#
perform "!c=fiel! using -BLD+I)C;H-
-DUssel!orf-#
perform "!c=fiel! using -BDC=C6RS;R-
-RCBA+7AB)R9@H:-#
perform "!c=!*npro using -SAPLSP;H- -@A@A-#
perform "!c=fiel! using -BDC=;LC;DE-
-F;PTA-#
perform "!c=transaction using -A@A-#
Form "!c=transaction using tco!e#
CALL TRA)SACTI;) TC;DE 6SI), BDCDATA
7;DE CT67;DE
6PDATE C6PDATE
7ESSA,ES I)T; 7ESSTAB#
L=S6BRC F S/+S6BRC#
$RITE4 R -CALL=TRA)SACTI;)-,
TC;DE,
-returnco!e4-9I@B:,
L=S6BRC,
-REC;RD4-,
S/+I)DE<#
L;;P AT 7ESSTAB#
E)DL;;P#
en!form#
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Start ne% screen
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
F;R7 BDC=D/)PR; 6SI), PR;,RA7 D/)PR;#
CLEAR BDCDATA#
BDCDATA+PR;,RA7 F PR;,RA7#
BDCDATA+D/)PR; F D/)PR;#
BDCDATA+D/)BE,I) F -<-#
APPE)D BDCDATA#
E)DF;R7#
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Insert fiel!
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
F;R7 BDC=FIELD 6SI), F)A7 FAL#
IF FAL G3 );DATA#
CLEAR BDCDATA#
BDCDATA+F)A7 F F)A7#
BDCDATA+FAL F FAL#
APPE)D BDCDATA#
E)DIF#
E)DF;R7#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Please ma5e a note that the a"ove program has "een mo!ifie! from
the program that %as generate! using transaction S8DB# The inclu!e
BDCREC< has "een commente! out an! the co!e has "een inserte!
in the main program# $e %ill !o further mo!ifications to this program
%hile inserting this co!e in the /e'ote $nabled Fun)tion +odule
/FC.
$e %ill no% create a Function 7o!ule an! ma5e it Remotel*
Ena"le!# 8o% to create a function mo!ule see here#
Before creating a function mo!ule *ou nee! to create a function
group see here.
;nce the structure of the function mo!ule is create! %e nee! to
create the Import Parameters# The import parameters %e var* from
s*stem to s*stem an! %ill !epen! on the fiel!s that *ou nee! to
transfer to SAP RR'# I!eall* there %ill "e Import Parameters, Ta"les
an! E&port Parameters#
Please see the figure "elo%#
I+PO/TA,T! ,ote that the Pass 2alue 3iled has been sele)ted.
This 3iled has to be sele)ted 3or all /FCs.
;nce the Import Parameters are set *ou can create the e&port
parameters#
8ere %e %ill "e e&porting the Sales ;r!er )um"er#
I+PO/TA,T! ,ote that the Pass 2alue 3iled has been sele)ted.
This 3iled has to be sele)ted 3or all /FCs.
)o% %e nee! to create an Inclu!e program as sho%n "elo%#
Put the follo%ing co!e in a separate inclu!e program# This inclu!e
program %ill "e inserte! in one of the inclu!es of the function mo!ule#
)amel* .KSA.$STOP. Please note that this name fill !iffer in *our
s*stem# But the last three letters of the inclu!e %ill "e TOP.
Also ma5e a note of the follo%ing#
The inclu!e en!ing %ith 088 9in our case L.SALES088: shoul! not
"e mo!ifie!# SAP generates the follo%ing co!e in this inclu!e#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> T8IS FILE IS ,E)ERATED B/ T8E F6)CTI;)
LIBRAR/# >
> )EER C8A),E IT 7A)6ALL/,
PLEASEV >
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Put the follo%ing co!e in a separate inclu!e program# This inclu!e
program %ill "e inserte! in one of the inclu!es of the function mo!ule#
)amel* .KSA.$STOP. Please note that this name fill !iffer in *our
s*stem# But the last three letters of the inclu!e %ill "e TOP.
I)CL6DE L.SALES6@A#
>>>I)CL6DE .SALESCREATEI #
DATA4 BDCDATA LILE BDCDATA ;CC6RS @ $IT8 8EADER
LI)E,
CT67;DE LILE CT6=PARA7S+DIS7;DE AL6E -A-,
C6PDATE LILE CT6=PARA7S+6PD7;DE AL6E -L-,
7ESSTAB LILE BDC7S,C;LL ;CC6RS @ $IT8 8EADER
LI)E,
L=S6BRC LILE S/+S6BRC,
L=7STRI),9CK@:,
);DATA AL6E -R-#
Form "!c=transaction using tco!e#
CALL TRA)SACTI;) TC;DE 6SI), BDCDATA
7;DE CT67;DE
6PDATE C6PDATE
7ESSA,ES I)T; 7ESSTAB#
L=S6BRC F S/+S6BRC#
$RITE4 R -CALL=TRA)SACTI;)-,
TC;DE,
-returnco!e4-9I@B:,
L=S6BRC,
-REC;RD4-,
S/+I)DE<#
en!form#
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Start ne% screen
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
F;R7 BDC=D/)PR; 6SI), PR;,RA7 D/)PR;#
CLEAR BDCDATA#
BDCDATA+PR;,RA7 F PR;,RA7#
BDCDATA+D/)PR; F D/)PR;#
BDCDATA+D/)BE,I) F -<-#
APPE)D BDCDATA#
E)DF;R7#
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Insert fiel!
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
F;R7 BDC=FIELD 6SI), F)A7 FAL#
IF FAL G3 );DATA#
CLEAR BDCDATA#
BDCDATA+F)A7 F F)A7#
BDCDATA+FAL F FAL#
APPE)D BDCDATA#
E)DIF#
E)DF;R7#
)o% the main co!e has to "e inserte! in the "o!* of the function
mo!ule# The co!e sho%n "elo% nee!s to "e inserte! in the "o!* of
the function mo!ule#
Please note that in the co!e given "elo% the har! co!e! values are
replace! "* I7P;RT Parameters of the function mo!ule#
F6)CTI;) .=SALES=CREATE#
>?++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>?>?Local interface4
>? I7P;RTI),
>? AL6E9;RDT/P: LILE BAL+A6ART
>? AL6E9S;LDT;: LILE L)AA+L6))R
>? AL6E9S8IPTT;: LILE L)AA+L6))R
>? AL6E9P6RC8;RD);: LILE BLD+BSTLD
>? AL6E97AT);: LILE 7ARA+7AT)R
>? AL6E9ET/: LILE RCBA+L$7E),
>? E<P;RTI),
>? AL6E9SALES;RD);: LILE BAL+BEL)
>?++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
perform "!c=!*npro using -SAP7CBA- -@A@A-#
perform "!c=fiel! using -BDC=C6RS;R-
-BAL+SPART-#
perform "!c=fiel! using -BDC=;LC;DE-
-R@@-#
perform "!c=fiel! using -BAL+A6ART-
O/T=P.
perform "!c=fiel! using -BAL+L;R,-
--#
perform "!c=fiel! using -BAL+T$E,-
--#
perform "!c=fiel! using -BAL+SPART-
--#
perform "!c=!*npro using -SAP7CBA- -C@@A-#
perform "!c=fiel! using -BDC=;LC;DE-
-R@@-#
perform "!c=fiel! using -BLD+BSTLD-
P6RC8;RD);#
perform "!c=fiel! using -L6A,+L6))R-
SO.TO.
perform "!c=fiel! using -L6$E+L6))R-
S#IPTTO.
perform "!c=fiel! using -RCBA+LETDAT-
-@CR@ARH@@K-#
perform "!c=fiel! using -RCBA+LPR,B.-
-D-#
perform "!c=fiel! using -BLD+PRSDT-
-@'RADRH@@K-#
perform "!c=fiel! using -BDC=C6RS;R-
-RCBA+L$7E),9@A:-#
perform "!c=fiel! using -RCBA+7AB)R9@A:-
+AT,O.
perform "!c=fiel! using -RCBA+L$7E),9@A:-
NT=.
perform "!c=!*npro using -SAP7CBA- -C@@A-#
perform "!c=fiel! using -BDC=;LC;DE-
-FSIC8-#
perform "!c=transaction using -A@A-#
,ET PARA7ETER ID -A6)- FIELD SALES;RD);#
E)DF6)CTI;)#
,ote that the re'otely enabled and Start I''ediately radio
buttons are sele)ted as sho-n belo-.
Please a!! the follo%ing line once the Call Transaction is complete!#
B$T PA/A+$T$/ I 7A0,7 FI$. SA.$SO/,O.
The a"ove comman! %ill get the ne%l* create! Sales ;r!er in the
file! SALES;RD);# Alternativel* *ou can follo% the proce!ure given
"elo% using the 6SERE<IT#
,ET PARA7ETER ID -A6)- FIELD SALES;RD);# Is a simpler %a*
of getting the latest sales or!er num"er#
For more !etails on ,ET PARA7ETER ID an! SET PARA7ETER ID
please see the follo%ing#
SAP SPA@BPA Para'eters
I'portant. The Sales Order nu'ber should be obtained in the
$8PO/T para'eters o3 the 3un)tion 'odule. This is not handled
in the )ode (i*en belo-. But I -ill 'ention the user1e9it 3ro'
-here the Sales Order nu'ber needs to be e9ported to this
3un)tion 'odule. 5e -ill dis)uss I+PO/TI,B and $8PO/TI,B
3ro' SAP +e'ory in the ne9t Post.
6ser E&it Program )ame4 7CBAF..
F;R7
6SERE<IT=SAE=D;C67E)T#

> E&ample4
> CALL F6)CTI;) -..=E<A7PLE-
> I) 6PDATE TASL
> E<P;RTI),
> ..TAB F ..TAB#
L;;P AT <BEP $8ERE 6PDL. )E
6PDL.=DELETE
A)D );T A6F)R IS I)ITIAL#
SET PARA7ETER ID -A)R- FIELD <BEP+
A6F)R#
E)DL;;P#



E)DF;R7#
The Sales or!er num"er %ill "e generate! at the a"ove point an! can
"e e&porte! to SAP 7emor* %hich can then "e importe! "ac5 into
the function mo!ule#
Poste! "* ABAP FRIE)D at D4BD A7 H comments Lin5s to this post
La"els4 Creating RFCs in SAP ABAP, Remote Function Call, SAPRFC
+onday, +ar)h 1O, 2008
SAP ABAP Tutorial! +odule Pool Pro(ra''in(. Part H
SAP ABAP Tutorial! +odule Pool Pro(ra''in(. Part H
$e %ill no% procee! further an! see the co!e that nee!s to "e put in place to actuall* create the
sales or!er#
Co!e for the PB; 7o!ule
>W+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
>W 7o!ule pool .SALES;RDSCREE) >
>W >
>W+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
>W >
>W >
>W+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
I)CL6DE .SALES;RDERT;P # ?
> I)CL6DE .SALES;RDER;@A # >
> I)CL6DE .SALES;RDERI@A # >
> I)CL6DE .SALES;RDERF@A # >
>W+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
>W 7o!ule STAT6S=D@@@ ;6TP6T
>W+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
> te&t
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
7;D6LE STAT6S=D@@@ ;6TP6T#
SET PF+STAT6S -.SALES-#
SET TITLEBAR -.SL-#
E)D7;D6LE# ? STAT6S=D@@@ ;6TP6T
>W+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
>W 7o!ule 6SER=C;77A)D=D@@@ I)P6T
>W+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
> te&t
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
7;D6LE 6SER=C;77A)D=D@@@ I)P6T#
CASE ;L=C;DE#
$hen -BACL-#
leave to screen @#
$hen -;RDE-#
Perform Create=Salesor!#
leave to screen @#
en!case#
E)D7;D6LE# ? 6SER=C;77A)D=D@@@ I)P6T
>W+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
>W Form Create=Salesor!
>W+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
> te&t
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
> ++3 pA te&t
> G++ pH te&t
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
F;R7 Create=Salesor!#
>+++++++++++++++++++++++++Data Declaration+++++++++++++++++++++++++++++>
Data4 st=BAPISD8EAD li5e BAPISD8EAD, ? Sales ;r!er 8ea!er Data
ta=BAPIITE7I) li5e BAPIITE7I) occurs @ %ith hea!er line, ? Ln item
ta=BAPIPART)R li5e BAPIPART)R occurs @ %ith hea!er line, ? Partner
!=BAPIRET6R)A li5e BAPIRET6R)A, ? Bapi return msg
!=v"eln li5e "apiv"eln+BEL)# ? Sales ;r!er )um"er
> 7ove the !ata to create sales or!er in the repective parameters++++++>
move4 t&tor!t*pe to st=BAPISD8EAD+D;C=T/PE, ? Sales !ocument t*pe
t&tpurchor! to st=BAPISD8EAD+P6RC8=);=C,
> -@@@A@- to ta=BAPIITE7I)+IT7=)67BER,
t&tmatno to ta=BAPIITE7I)+7ATERIAL,
> -AA@@- to ta=BAPIITE7I)+PLA)T,
t&t2t* to ta=BAPIITE7I)+REE=ET/,
-A,- to ta=BAPIPART)R+PART)=R;LE, ? Sol! to Part*
t&tsol!to to ta=BAPIPART)R+PART)=)67B#
> Appen! the internal ta"les+++++++++++++++++++++++++++++++++++++++++++>
appen! ta=BAPIPART)R#
clear ta=BAPIPART)R#
appen! ta=BAPIITE7I)#
clear ta=BAPIITE7I)#
> 7ove ship to part*+++++++++++++++++++++++++++++++++++++++++++++++++++>
move4 -R,- to ta=BAPIPART)R+PART)=R;LE, ? Ship to part*
t&tshipto to ta=BAPIPART)R+PART)=)67B#
> Appen! the internal ta"les+++++++++++++++++++++++++++++++++++++++++++>
appen! ta=BAPIPART)R#
clear ta=BAPIPART)R#
> Call the Bapi to create the sales or!er
CALL F6)CTI;) -BAPI=SALES;RDER=CREATEFR;7DATA-
E<P;RTI),
;RDER=8EADER=I) F st=BAPISD8EAD
> $IT8;6T=C;77IT F - -
> C;)ERT=PAR$=A6ART F -<-
I7P;RTI),
SALESD;C67E)T F !=v"eln
> S;LD=T;=PART/ F
> S8IP=T;=PART/ F
> BILLI),=PART/ F
RET6R) F !=BAPIRET6R)A
TABLES
;RDER=ITE7S=I) F ta=BAPIITE7I)
;RDER=PART)ERS F ta=BAPIPART)R
> ;RDER=ITE7S=;6T F
> ;RDER=CF,S=REF F
> ;RDER=CF,S=I)ST F
> ;RDER=CF,S=PART=;F F
> ;RDER=CF,S=AL6E F
> ;RDER=CCARD F
> ;RDER=CF,S=BL;B F
> ;RDER=SC8ED6LE=E< F
#
if !=v"eln G3 space#
> 7essage I@@A#
> 7essage I@@H %ith D=v"eln#
7essage ID -.E<ERCISEH- T/PE -S- )um"er -@@@-#
> %rite4 -Sales or!er )o# -, !=v"eln#
en!if#
E)DF;R7# ? Create=Salesor!
>W+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
>W Inclu!e .SALES;RDERT;P >
>W >
>W+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
PR;,RA7 .SALES;RDSCREE) #
Data4 o5=co!e9C:,
t&tor!t*pe9H:,
t&tsol!to9A@:,
t&tshipto9A@:,
t&tpurchor!9A@:,
t&tmatno9AK:,
t&t2t*9A':#
Poste! "* ABAP FRIE)D at D4HK A7 @ comments Lin5s to this post
SAP ABAP Tutorial! +odule Pool Pro(ra''in(. Part 2
SAP ABAP Tutorial! +odule Pool Pro(ra''in(. Part 2
;nce the program -.SALES;RDSCREE)- is create! Save! an! Activate!, run Transa)tion
S$L1#
$nter s)reen nu'ber 7M0007
Screen num"ers can "e up to C characters long, all of %hich must "e !igits# Screen num"ers from
D@@@ are reserve! for customer+specific screens#
In the Screen Painter enter a short Description an! Activate the screen#
;nce this is !one *ou %ill "e presente! %ith a screen that %ill have three ta"s, namel*
Attributes@$le'ent .ist@Flo- .o(i)
Clic5 on $le'ent .ist an! t*pe O%"Code an! Activate#
)o% clic5 on Flo- .o(i).
/ou shoul! see the follo%ing co!e in the Flo% Logic#
P/OC$SS B$FO/$ O0TP0T.
+O0.$ STAT0S"M000.
P/OC$SS AFT$/ I,P0T.
+O0.$ 0S$/"CO++A,"M000.
Create +O0.$ STAT0S"M000 by double )li)%in( on it. The 3ollo-in( )ode -ill be
auto'ati)ally )reated.
I,C.0$ KSA.$SO/$/TOP . &
4 I,C.0$ KSA.$SO/$/O01 . 4
4 I,C.0$ KSA.$SO/$/I01 . 4
4 I,C.0$ KSA.$SO/$/F01 . 4
4S1111111111111111111111111111111111111111111111111111111111111111111114
4S +odule STAT0S"M000 O0TP0T
4S1111111111111111111111111111111111111111111111111111111111111111111114
4 te9t
411111111111111111111111111111111111111111111111111111111111111111111114
+O0.$ STAT0S"M000 O0TP0T.
4 S$T PF1STAT0S 7999999997.
4 S$T TIT.$BA/ 79997.
$,+O0.$. & STAT0S"M000 O0TP0T
6ncomment the follo%ing co!e#
S$T PF1STAT0S 7KSA.$S7. ++++++++++++++++++ 7enu Bar for the custom Sales ;r!er Screen#
S$T TIT.$BA/ 7KS.7. ++++++++++++++++++++ Title#
,ive appropriate names to PF+STAT6S an! TITLE BAR# ;nce the co!e is uncommente! an! the
appropriate names are given# Dou"le clic5 on the name .SALES# ;nce *ou see the prompt clic5
on create o"1ect#
/ou %ill see the follo%ing three options in the resulting screen#

+enu bar Status 3or Sales Order S)reen
Appli)ation toolbar Status 3or Sales Order S)reen
Fun)tion %eys Status 3or Sales Order S)reen
Clic5 on the Function Le*s Drop Do%n Bo&# /ou %ill see the Stan!ar! Tool Bar %ith Icons that
*ou normall* see in the SAP Screen#
Enter the follo%ing values in the empt* fiel!s#
Standard Toolbar
$nte SA2$ BACG $8IT CA,C$. P/I,T FI, FI,,$8T FI/STPAB$
P/$2P ,$8T .AST
Activate the PF1STAT0S.
/ou %ill "e prompte! to enter the Function Te&t an! Info Te&t for the "utton Enter#
Please enter the follo%ing values#
Function Te&t -Ente-
Info Te&t -Enter-
E&ecute Transa)tion S$80 an! Activate the complete program "* right clic5ing on it#
$e %ill no% create a transaction co!e for our program# To create a transaction co!e right clic5 on
the main program an! from the pop+up menu select Create+++++Transaction#
In the !ialog "o& enter the follo%ing values#
Transa)tion Code 7KSA.$SO/7
Short es)ription 7Create Sales Order7
An! Clic5 on Save#
/ou %ill no% "e as5e! to enter Program name an! Screen )um"er# Enter the follo%ing values#
Pro(ra' KSA.$SO/SC/$$,
S)reen M000
Save an! Activate the Program
)o% %e nee! to enter co!e to create the Sales or!er# $e also nee! to create the Screen
Elements#
In transaction SEK@ in the left pane clic5 on Screens an! then !ou"le clic5 on D@@@#
)o% from the menu clic5 on LA/;6T "utton#
$e nee! to create La"els an! Te&t Bo&es for the follo%ing fiel!s#
Filed :.abel isplay; .abel ,a'e Te9tBo9 ,a'e e3 .en(th
;r!er T*pe l"lor!t*p t&tor!t*p H
Sales ;rg l"lsalesorg t&tsalesorg C
Distri"ution Channel l"l!istchnl t&t!istchnl H
Division l"l!iv t&t!iv H
Sol!+to Part* l"lsol!to t&tsol!to A@
Ship+to Part* l"lshipto t&tshipto A@
Purchase ;r! l"lpurchor! t&tpurchor! A@
7aterial l"lmat t&tmat AK
Euantit* l"l2t* t&t2t* A'
$e also nee! to create a comman! "utton as follo%s
.abel ,a'e
Create ;r!er l"lcreateor!
$e %ill no% loo5 at the propert* "o& %hich is !ispla*e! after !ou"le clic5ing on each screen
element#
;r!er T*pe 9La"el:
)ame l"lor!t*p
Te&t ;r!er=T*pe

;r!er T*pe 9Te&t Bo&:
)ame t&tor!t*p
Te&t
Def# Length H
Similarl* fill the Propert* "o& for other file!s
I'portant
Property Bo9 3or Co''and Button in this )ase the Fun)tion Code is i'portant
Create ;r!er
)ame cm!or!
Te&t Create ;r!er
F)t Code O/$
SAP ABAP Tutorial! +odule Pool Pro(ra''in(. Part H

Poste! "* ABAP FRIE)D at H4BD A7 @ comments Lin5s to this post
SAP ABAP +odule Pool Pro(ra''in( Tutorial Part 1
SAP ABAP Tutorial! +odule Pool Pro(ra''in(. Part 1
/elated Transa)tion Codes 4
S$L1! S)reen Painter Initial S)reen
S$A1! +enu Painter Initial S)reen
S$H8! ABAP $ditor Initial S)reen
S$80! Ob?e)t ,a*i(ator
In this tutorial %e %ill e&plore mo!ule pool programming# $e %ill
create a sales or!er#
$e %ill com"ine the Initial screen an! the ;vervie% Screen of
Transa)tion 2A01 Create Standard Order into one screen#
$e %ill use the follo%ing BAPI to create the Sales ;r!er
BAPI"SA.$SO/$/"C/$AT$F/O+AT1
The follo%ing fiel!s %ill "e up!ate!#
Order Type O/
Sales Or( 1000
sitribution Channel 10
i*ision 00
Sold1to Party OOOO
Ship1to Party OOOO
Pur)h Ord ,o 1LAMH
+aterial y1HL1
Order Nuantity 10
$e %ill no% procee! an! create the main program#
Run Transa)tion S$80 an! create a program
-.SALES;RDSCREE)-# First 1ust create this program save an!
activate#
To !o so in the !rop!o%n "o& select Program an! t*pe the name
-.SALES;RDSCREE)- in the file! "elo% an! hit enter#
/ou %ill see a prompt that sa*s -Program !oes not e&ist- !o *ou %ant
to create a ne% o"1ectX
Sa* *es#
Create a program %ith T;PI)CL6DE, give an appropriate name to
the TOPI,C.0$ an! save the program#
See SAP ABAP Tutorial! +odule Pool Pro(ra''in(. Part 2
Poste! "* ABAP FRIE)D at H4AH A7 @ comments Lin5s to this post
La"els4 7o!ulePool Programming, SAP BAPI, SAP SCREE) TRA)SACTI;)S
Tuesday, February 2T, 2008
Fun)tion +odule POP 0P TO CO,FI/+
Fun)tion +odule 7POP0P"TO"CO,FI/+7.
Another function mo!ule that is use! fre2uentl* is
-P;P6P=T;=C;)FIR7- it is use! as follo%s#
REP;RT .E<=P;P6PT;C;)FIR7 #
>+++++++++++++++++++++++++Data Declaration+++++++++++++++++++++++++++++>
Data4 !=response9A:# ? Response from popup
CALL F6)CTI;) -P;P6P=T;=C;)FIR7-
E<P;RTI),
TITLEBAR F -Create Sales ;r!er -
> DIA,);SE=;BNECT F - -
TE<T=E6ESTI;) F -Create sales or!erX-
TE<T=B6TT;)=A F -/ES-9@@A:
> IC;)=B6TT;)=A F - -
TE<T=B6TT;)=H F -);-9@@H:
> IC;)=B6TT;)=H F - -
> DEFA6LT=B6TT;) F -A-
DISPLA/=CA)CEL=B6TT;) F -<-
> 6SERDEFI)ED=FA=8ELP F - -
> START=C;L67) F HB
> START=R;$ F O
> P;P6P=T/PE F
I7P;RTI),
A)S$ER F !=response
> TABLES
> PARA7ETER F
E<CEPTI;)S
TE<T=);T=F;6)D F A
;T8ERS F H
#
IF S/+S6BRC G3 @#
> 7ESSA,E ID S/+7S,ID T/PE S/+7S,T/ )67BER S/+7S,);
> $IT8 S/+7S,A S/+7S,H S/+7S,' S/+7S,C#
E)DIF#
Poste! "* ABAP FRIE)D at (4BK A7 @ comments Lin5s to this post
La"els4 ABAP F6)CTI;) 7;D6LE P;P6P, ABAP user confirmation,
P;P6P=T;=C;)FIR7, SAP ABAP Function 7o!ules, SAP ABAP P;6P>, SAP ABAP
6SER I)P6T
+onday, February 2L, 2008
isplayin( +essa(es in ABAP
isplayin( +essa(es in ABAP
Do%nLoa! PDF
In ABAP *ou nee! to !ispla* a message on various occasions, for
e&ample if the user has input erroneous !ata then a message nee!s
to "e !ispla*e!, instructing the user to rectif* the error, or after a
certain tas5 is accomplishe!, *ou ma* nee! to !ispla* a message#
A message class is use! to !ispla* messages from the program an!
the transaction use! for this purpose is S$M1# The messages are
store! in the ta"le T100# E&amples of calling a message are sho%n
"elo%#
/ou ma* nee! to create a message class for !ispla*ing *our
message# /ou nee! to chec5 if a message class has alrea!* "een
create! "* other ABAP colleagues# )ote that messages classes
%oul! alrea!* e&ist in *our s*stem, "ut *ou ma* have to create a ne%
class for *our programs#
To create a ne% message class t*pe the name follo%ing the naming
stan!ar!s an! t*pe the name as sho%n in the figure "elo%#
Alternativel* *ou can goto transaction SEDA to create a ne% message
class#
In this e&ample %e %ill t*pe the name as sho%n "elo% an! !ou"le
clic5 on the name -.E<ERCISEA-#
The follo%ing prompt %ill appear# Clic5 on /es#
Clic5 on /es again#
T*pe an appropriate short te&t#
Create a 0tmp o"1ect
T*pe a message that *ou %oul! li5e to !ispla*# Please note the
num"er associate! %ith the message# In this case the message is
-@@@-#
$e have create! ' messages#
$e no% nee! to !ispla* these messages in our program# $e %ill
ma5e changes in the Create Sales or!er program as sho%n "elo%#
Some e&amples of calling a message#
A# 7ESSA,E &nnn#
H# 7ESSA,E ID i! T/PE mt*pe )67BER n#
'# 7ESSA,E &nnn9mi!:#
There are si& 5in!s of message t*pe4
A 9A"en!:
Termination
E 9Error:
Error
I 9Info:
Information
S 9Status:
Status message
$ 9$arning:
$arning
< 9E&it:
Termination %ith short !ump
See the s*nta& sho%n "elo% for !ispla*ing a message in *our
programs#
+$SSAB$ I id T=P$ 'type ,0+B$/ n.
I
message class in our case .E<ERCISEA or .E<ERCISEH
T=P$
message t*pe 9A,E,I,S,$,<:
,0+B$/
message num"er
$9a'ple
+$SSAB$ I 7K$8$/CIS$7 T=P$ 7S7 ,0+B$/ 70007.
;nce the program is run the messages %ill "e !ispla*e! as follo%s#
Choose the one that suits *our re2uirement#
The follo%ing message is !ispla*e! 1ust to sho% as to ho% to
e&plicitl* call another message class#
Poste! "* ABAP FRIE)D at O4HH A7 @ comments Lin5s to this post
La"els4 ABAP 7essages, Calling messages in ABAP, Displa*ing messages in ABAP,
SAP ABAP messages, Ta"le TA@@, Transaction Co!e SEDA, Tutorial on ABAP messages
Thursday, February 21, 2008
BAPI Sales Order Create Code
Bapi Sales Order Create Code
$e sa% in the earlier e&ample as to ho% to create a sales or!er from
the SE'( interface# )o% %e nee! to create a program an! call the
BAPI to create sales or!ers# Later %e %ill !iscuss %a*s to call a BAPI
from a non+sap s*stem#
,iven an appropriate name to the program# Please follo% the naming
conventions as per *our compan*# ABAP programs shoul! al%a*s
start %ith a -.- or a -/-#
Enter suita"le !escription#
Create a 0tmp o"1ects or create a transport re2uest# Transport
re2uests %oul! "e covere! in the later tutorials#
Follo% the menu path EDIT+++++3Pattern
Enter the name of the BAPI as sho%n "elo%#
The inserte! BAPI is sho%n "elo%#
$e no% nee! to get the import parameters, e&port parameters an!
the ta"les#
)ote4 Ta5e care that the !ata !eclaration in the program for the a"ove
mentione! parameters matches e&actl* as given in the BAPI# To
ensure that please open the BAPI using transaction SE'( an! cop*
the e&act names of the parameters from the BAPI structure#
If this is not follo%e! *our program %ill give an -ABAP D67P-#
Chec5 the Import parameters
The follo%ing figure sho%s the import parameter BAPIS8EAD an! %e
nee! to !eclare a structure in our ABAP program as follo%s#
ata! st"BAPIS#$A li%e BAPIS#$A, & Sales Order #eader
ata
7a5e sure *ou follo% the ABAP na'in( )on*entions.
Similarl* for ta"les pic5 up the names from the function mo!ule#
ata! st"BAPIS#$A li%e BAPIS#$A, & Sales Order #eader
ata
ta"BAPIIT$+I, li%e BAPIIT$+I, o))urs 0 -ith header line, & .n
ite'
ta"BAPIPA/T,/ li%e BAPIPA/T,/ o))urs 0 -ith header line, &
Partner
d"BAPI/$T0/,1 li%e BAPI/$T0/,1, & Bapi return 's(
d"*beln li%e bapi*beln12B$.,. & Sales Order ,u'ber
The complete program is given "elo%# Please ma5e sure that *ou use
the !ata specific to *our s*stem# In the follo%ing some of the values
are har! co!e!# /ou nee! to use varia"les an! pic5 up the values#
Please note in the follo%ing program, sol! to part* 9SP: has "een
entere! as -A,- an! ship to part* 9S8: as -R,-#
SP++++++++A,
S8++++++++R,
;r!er t*pe -;R- as -TA-
Please use TA instead o3 O/
Also if *ou set the 4 CO,2$/T"PA/25"A0A/T 6 787 parameter to
-<- *ou can use sol! to part* as SP an! ship to part* as S8#
REP;RT .E<=BAPISALES;RDCRT #
>+++++++++++++++++++++++++Data Declaration+++++++++++++++++++++++++++++>
Data4 st=BAPISD8EAD li5e BAPISD8EAD, ? Sales ;r!er 8ea!er
Data
ta=BAPIITE7I) li5e BAPIITE7I) occurs @ %ith hea!er line, ? Ln item
ta=BAPIPART)R li5e BAPIPART)R occurs @ %ith hea!er line, ?
Partner
!=BAPIRET6R)A li5e BAPIRET6R)A, ? Bapi return msg
!=v"eln li5e "apiv"eln+BEL)# ? Sales ;r!er )um"er
> 7ove the !ata to create sales or!er in the repective parameters++++++
>
move4 -TA- to st=BAPISD8EAD+D;C=T/PE, ? Sales !ocument t*pe
-ABCD'- to st=BAPISD8EAD+P6RC8=);=C,
-@@@A@- to ta=BAPIITE7I)+IT7=)67BER,
-/+'BA- to ta=BAPIITE7I)+7ATERIAL,
-AA@@- to ta=BAPIITE7I)+PLA)T,
-A- to ta=BAPIITE7I)+REE=ET/,
-A,- to ta=BAPIPART)R+PART)=R;LE, ? Sol! to Part*
-@@@@@@((((- to ta=BAPIPART)R+PART)=)67B#
> Appen! the internal ta"les+++++++++++++++++++++++++++++++++++++++++++>
appen! ta=BAPIPART)R#
clear ta=BAPIPART)R#
appen! ta=BAPIITE7I)#
clear ta=BAPIITE7I)#
> 7ove ship to part*+++++++++++++++++++++++++++++++++++++++++++++++++++>
move4 -R,- to ta=BAPIPART)R+PART)=R;LE, ? Ship to part*
-@@@@@@((((- to ta=BAPIPART)R+PART)=)67B#
> Appen! the internal ta"les+++++++++++++++++++++++++++++++++++++++++++>
appen! ta=BAPIPART)R#
clear ta=BAPIPART)R#
> Call the Bapi to create the sales or!er
CALL F6)CTI;) -BAPI=SALES;RDER=CREATEFR;7DATA-
E<P;RTI),
;RDER=8EADER=I) F st=BAPISD8EAD
> $IT8;6T=C;77IT F - -
4 CO,2$/T"PA/25"A0A/T 6 7 7
I7P;RTI),
SALESD;C67E)T F !=v"eln
> S;LD=T;=PART/ F
> S8IP=T;=PART/ F
> BILLI),=PART/ F
RET6R) F !=BAPIRET6R)A
TABLES
;RDER=ITE7S=I) F ta=BAPIITE7I)
;RDER=PART)ERS F ta=BAPIPART)R
> ;RDER=ITE7S=;6T F
> ;RDER=CF,S=REF F
> ;RDER=CF,S=I)ST F
> ;RDER=CF,S=PART=;F F
> ;RDER=CF,S=AL6E F
> ;RDER=CCARD F
> ;RDER=CF,S=BL;B F
> ;RDER=SC8ED6LE=E< F
#
if !=v"eln G3 space#
%rite4 -Sales or!er )o# -, !=v"eln#
en!if#
Poste! "* ABAP FRIE)D at H4A@ A7 @ comments Lin5s to this post
La"els4 Bapi Sales ;r!er create, BAPI=SALES;RDER=CREATEFR;7DATA, Sample
program to create sales or!er using BAPI, SAP ABAP BAPI, SAP BAPI, 6sing BAPI,
6sing BAPIs
5ednesday, February 20, 2008
BAPI Sales Order Create
BAPI to Create Sales Order. Do%nLoa! PDF
5e -ill see the 3un)tionality o3
BAPI"SA.$SO/$/"C/$AT$F/O+AT1.
As sho%n "elo%, run transaction SE'(#
an! enter the name of the BAPI
BAPI=SALES;RDER=CREATEFR;7DATA#
Press FK or clic5 on e&ecute# First %e nee! to enter the hea!er !ata#
Clic5 on the single entr* Icon as sho%n "elo%#
Enter !oc t*pe an! purchase or!er num"er# This %ill !epen! on *our
re2uirement an! the !ata %ill var* from s*stem to s*stem#
;r!er t*pe ++++++++++ -;R-
;nce the hea!er !ata is entere! %e nee! to enter the line item !ata#
Please note that in this e&ample %e %oul! "e entering minimum !ata
re2uire! 1ust to create a sample sales or!er# In real life scenario *ou
nee! to enter all the fiel!s as per the companies re2uirement#
Enter the follo%ing fiel!s#
Item )um"er ++++ @@@@A@
7aterial++++++++++*+'BA
Plant+++++++++++++AA@@
Re2uire! 2uantit* A
Purchase ;r!er num"er AB'D'
Please not that all the a"ove !ata is s*stem specific an! *ou nee! to
enter the values availa"le in *our s*stem# /ou can refer to an e&isting
sales or!er %ith the help of transaction A@'#
)ee! to enter the Partner Data# )amel* Sol! to Part* an! Ship to
Part*#
Enter Sol! to Part* in!icator -SP-
Ship to Part* as -S8-
Enter the sol! to an! ship to part* num"er as ((((
,o "ac5 an! Save the !ata# This %ill help *ou to create another sales
or!er 1ust "* retrieving the values again "* clic5ing on Test Data
"utton# ;r in case *ou ma5e a mista5e then *ou can 1ust change the
erroneous !ata#
;nce *ou save the !ata# Press FK or clic5 on e&ecute# As *ou can
see "elo%# Sales ;r!er ((@K is create!# Again this num"er %ill "e
!ifferent in *our s*stem#
)o% *ou nee! to chec5 the ne%l* create! Sales ;r!er# T*pe R)A@H
or R)A@' as the transaction co!e#
Enter the sales or!er num"er#
Press enter# The ne% sales or!er is !ispla*e!#
Poste! "* ABAP FRIE)D at C4'D A7 @ comments Lin5s to this post
La"els4 ABAP BAPI, BAPI, Bapi Sales ;r!er create, Bapi to create sales or!er,
BAPI=SALES;RDER=CREATEFR;7DATA, SAP BAPI, SAP Interfacing
Tuesday, February 1M, 2008
Fun)tion +odules Create Te9t and /ead Te9t
Fun)tion +odules Create Te9t and /ead Te9t
7an* a times it is re2uire! to Rea! te&t from SAP ;"1ects li5e Sales
;r!er or Purchase ;r!er from an ABAP program# Similarl* it ma*
also "e re2uire! to %rite te&t in Sales ;r!er or other SAP o"1ects
through ABAP Co!e#
The follo%ing Function 7o!ules can "e use! to !o the nee!ful#
A: Create=Te&t
H: Rea!+Te&t
To rea! te&t from sales or!er 8ea!er Te&t %e first nee! to create
some te&t# ;pen an e&isting Sales or!er using transaction A@H as
sho%n in the figure "elo%#
In the hea!er te&t t*pe some te&t for e&ample -This is 8ea!er Te&t-
an! !ou"le clic5 in the te&t area#
;nce this is !one the te&t gets save! an! the follo%ing screen
appears# 8ere *ou can t*pe some more te&t#
,o "ac5 to the previous screen
See the change in the Icon as sho%n in the figure "elo%# It no% has
some lines#
)o% %e nee! to run e&ecute the function mo!ule to rea! the te&t that
%e have 1ust t*pe!# But "efore that %e nee! to fin! the follo%ing
A: Te&t ;"1ect to rea!
H: Te&t ID to rea!#
8ence clic5 on the Icon sho%n "elo%#
Then the follo%ing screen appears# From here %e can pic5 up the
Te&t ;"1ect 9BBL: an! Te&t ID 9@@@A:# For hea!er te&t#
This can also "e achieve! using transaction SE(B# As sho%n "elo%#
Select Te&t ;"1ects an! IDs as sho%n "elo% an! clic5 on !ispla*#
$e no% nee! to search for Sales# Clic5 on the search tool as sho%n
"elo%#
T*pe Sales as sho%n "elo%#
Select Sales 8ea!er# From the figure %e can see the o"1ect as
BBL# Then clic5 on Te&t IDs#
Select @@@A for hea!er note#
$e no% have the follo%ing information %ith us#
A: Te&t ;"1ect +++++++ -BBL-
H: Te&t ID +++++++++++-@@@A-
': Sales or!er num"er ++++-@@@@@@BC('-
C: Language -E)-
The a"ove info shoul! "e o"taine! as sho%n in the a"ove screen
shots# )o% run transaction SE'( an! e&ecute the function mo!ule
-READ=TE<T-
Enter the a"ove mention !ata# Please note that this !ata %ill var*
from s*stem to s*stem#
)ame is the Sales ;r!er )um"er#
Run the function mo!ule# As sho%n "elo% the ta"le has one recor!#
Clic5 on that entr*#
The te&t is !ispla*e! as sho%n "elo%#
The test !ata that has "een entere! can "e save! an! "* clic5ing on
the save "utton#
,ive appropriate name#
;nce save! it can "e retrieve! from the Test Data Director*#
Similarl* Te&t can also "e %ritten in Sales ;r!erRPurchase ;r!er or
an* other SAP o"1ect using the function mo!ule -CREATE DATA-#
$e %ill insert te&t in the -C;7PLETI;) );TE-# The follo%ing figure
sho%s the ;"1ect name an! ;"1ect ID#
Enter the !ata in the function mo!ule parameters as sho%n "elo%#
An! run the function mo!ule#
;pen the sale or!er# ,oto+++8ea!er Te&t# See the te&t in
C;7PLETI;) );TE#
Similarl* te&t can "e rea! or %ritten in the Item te&t# The a"ove
mentione! steps can "e follo%e! to get the ;"1ect an! ID#
)ote4 For Item te&t the -)A7E- parameter in the function mo!ule
nee!s to "e fille! %ith
Sales ;r!er num"er Y item num"er#
Poste! "* ABAP FRIE)D at K4@D A7 @ comments Lin5s to this post
La"els4 ABAP CREATE=TE<T, ABAP Function 7o!ules, ABAP READ=TE<T,
F6)CTI;) 7o!ule CREATE=TE<T, Function 7o!ule READ=TE<T, SAP
CREATE=TE<T, SAP Function 7o!ules, SAP Rea!=Te&t
Thursday, Danuary 2A, 2008
isplayin( ata 0sin( S$11@S$12@S$1T@S$1T,
Logon to SAP
Enter Transaction Co!e SEAA#
)ote that transaction SEAA can "e use! to Displa*RChangeRCreate
!ata"ase ta"les# ;ther transactions for ABAP !ictionar* are as
follo%s
SEAH Displa*
Data"ase Ta"les
ie%
Data T*pes
Domain
Search 8elp
Loc5 ;"1ects
SEAA Displa*RChangeRCreate
Data"ase Ta"les
ie%
Data T*pes
Domain
Search 8elp
Loc5 ;"1ects
SEAO an! SEAO) Data Bro%ser
Enter the Ta"le name in this case BAL
Clic5 on Displa*#
Clic5 on C;ntents as sho%n "elo% or use shortcut
CTRLYS8IFTYFA@
Enter the !esire! !ata# In this case the sales or!er num"er#
The !ata is !ispla*e! as sho%n "elo%#
Poste! "* ABAP FRIE)D at '4@B A7 A comments Lin5s to this post
La"els4 ABAP Data Bro%ser, ABAP Dictionar*, ABAP Ta"les, ABAPL;ERS, Data
Bro%ser, Displa*ing !ata in SAP, Let us a"ap, SAP Data Bro%ser, SEAA, SEAH, SEAO,
SEAO)
)e%er Posts ;l!er Posts 8ome
ABAP TIPS
P/$2IO0S ,$8T /A,O+
Al%a*s specif* *our con!itions in the $here+clause instea! of chec5ing them *ourself %ith chec5
statements# The !ata"ase s*stem can then use an in!e& 9if possi"le: an! the net%or5 loa! is
consi!era"l* less#
Since your web browser does not support JavaScript, here is a non-JavaScript version of
the image slideshow:
Al-ays spe)i3y your )onditions in the 5here1)lause instead o3 )he)%in( the' yoursel3 -ith
)he)% state'ents. The database syste' )an then use an inde9 :i3 possible; and the
net-or% load is )onsiderably less#
For all 3re<uently used Sele)t state'ents, try to use an inde9. =ou al-ays use an inde9 i3
you spe)i3y :a (eneri) part o3; the inde9 3ields )on)atenated -ith lo(i)al Ands in the Sele)t
state'ent7s 5here )lause. ,ote that )o'ple9 5here )lauses are poison 3or the state'ent
opti'i>er in any database syste'.
I3 there e9ists at least one ro- o3 a database table or *ie- -ith a )ertain )ondition, use the
Sele)t Sin(le state'ent instead o3 a Sele)t1$ndsele)t1loop. Sele)t Sin(le re<uires one
)o''uni)ation -ith the database syste', -hereas Sele)t1$ndsele)t needs t-o.
It is al-ays 3aster to use the Into Table *ersion o3 a Sele)t state'ent than to use Append
state'ents.
To read data 3ro' se*eral lo(i)ally )onne)ted tables use a ?oin instead o3 nested Sele)t
state'ents. ,et-or% load is )onsiderably less.
I3 you -ant to 3ind the 'a9i'u', 'ini'u', su' and a*era(e *alue or the )ount o3 a
database )olu'n, use a sele)t list -ith a((re(ate 3un)tions instead o3 )o'putin( the
a((re(ates yoursel3. ,et-or% load is )onsiderably less.
I3 you pro)ess your data only on)e, use a Sele)t1$ndsele)t1loop instead o3 )olle)tin( data
in an internal table -ith Sele)t Into Table. Internal table handlin( ta%es up 'u)h 'ore
spa)e.
0se a sele)t list or a *ie- instead o3 Sele)t 4 , i3 you are only interested in spe)i3i) )olu'ns
o3 the table. ,et-or% load is )onsiderably less.
For all 3re<uently used, read1only tables, try to use SAP bu33erin(. ,et-or% load is
)onsiderably less.
5hene*er possible, use array operations instead o3 sin(le1ro- operations to 'odi3y your
database tables. Fre<uent )o''uni)ation bet-een the appli)ation pro(ra' and database
syste' produ)es )onsiderable o*erhead.
5hene*er possible, use )olu'n updates instead o3 sin(le1ro- updates to update your
database tables. ,et-or% load is )onsiderably less.
Instead o3 usin( nested Sele)t loops or FO/ A.. $,T/I$S it is o3ten possible to use
sub<ueries. ,et-or% load is )onsiderably less.
0se the spe)ial operators CO, CA, CS, instead o3 pro(ra''in( the operations yoursel3. I3
ABAP@A state'ents are e9e)uted per )hara)ter on lon( strin(s, CP0 )onsu'ption )an rise
substantially.
So'e 3un)tion 'odules 3or strin( 'anipulation ha*e be)o'e obsolete and should be
repla)ed by ABAP@A state'ents or 3un)tions! ST/I,B"CO,CAT$,AT$... 1C
CO,CAT$,AT$, ST/I,B"SP.IT... 1C SP.IT, ST/I,B".$,BT# 1C strlen:;, ST/I,B"C$,T$/
1C 5/IT$...TO...C$,T$/$, ST/I,B"+O2$"/IB#T 1C 5/IT$...TO.../IB#T1D0STIFI$
0se the CO,CAT$,AT$ state'ent instead o3 pro(ra''in( a strin( )on)atenation o3 your
o-n.
I3 you -ant to delete the leadin( spa)es in a strin(, use the ABAP@A state'ent S#IFT....$FT
$.$TI,B .$AI,B... .Other )onstru)tions :-ith C, and S#IFT...B= S=1FPOS P.AC$S,
-ith CO,$,S$ i3 possible, -ith C, and ASSIB, C.AES=1FPOS:.$,; ...; are not as 3ast.
In any )ase, a*oid usin( S#IFT inside a 5#I.$1loopF
0se the SP.IT state'ent instead o3 pro(ra''in( a strin( split yoursel3.
0se the strlen: ; 3un)tion to restri)t the O loop to the rele*ant part o3 the 3ield, e.(. -hen
deter'inatin( a )he)%1su'.
0se &C.$A/ 3 5IT# *al& -hene*er you -ant to initiali>e a 3ield -ith a *alue di33erent 3ro'
the 3ield7s type1spe)i3i) initial *alue.
Try to %eep the table ordered and use binary sear)h or used a table o3 type SO/T$
TAB.$. I3 TAB has n entries, linear sear)h runs in O: n ; ti'e, -hereas binary sear)h ta%es
only O: lo(2: n ; ;.
A dyna'i) %ey a))ess is slo-er than a stati) one, sin)e the %ey spe)i3i)ation 'ust be
e*aluated at runti'e. #o-e*er, 3or lar(e tables the )osts are do'inated by nu'ber o3
)o'parison needed to lo)ate the entry.
I3 you need to a))ess an internal table -ith di33erent %eys repeatedly, %eep your o-n
se)ondary indi)es.5ith a se)ondary inde9, you )an repla)e a linear sear)h -ith a binary
sear)h plus an inde9 a))ess.
.OOP ... 5#$/$ is 3aster than .OOP@C#$CG be)ause .OOP ... 5#$/$ e*aluates the
spe)i3ied )ondition internally. As -ith any lo(i)al e9pressions, the per3or'an)e is better i3
the operands o3 a )o'parison share a )o''on type. The per3or'an)e )an be 3urther
enhan)ed i3 .OOP ... 5#$/$ is )o'bined -ith F/O+ i1 and@or TO i2, i3 possible.
Al%a*s use Prett* Printer an! E&ten!e! Program Chec5 "efore releasing the co!e# Do not leave
unuse! co!e in the program# Comment the co!e thoroughl*# Align the comments an! the Co!e#
Follo% the SAP Stan!ar!s an! SAP Best Practices gui!elines# ItIs a goo! practice to ta5e a !ump
of the co!e on *our local !rive#
Ole Auto'ation Part1
Ole Auto'ation Part 2
Pro)essin( Blo)%s in ABAP
Si'ple ABAP /eport
A.2 Brid 1 Chan(in( Colors
A.2 /eport $9a'ple
Creatin( 2ariants For ABAP
/eports
/e)ordin( BC usin(
Transa)tion
Sales o)u'ent Flo- in
ABAP
0ser $9its in SAP S
SAP ABAP ,a'in(
Standards
SAP S Tables
SAP ABAP ata i)tionary
Tables
++ I'portant Transa)tion
Codes in SAP
Passin( ( ata Fro' One
ABAP Pro(ra' to Another
ABAP Co'pute Add Colle)t
and Append
SAP ABAP eter'inin(
Sap S)ripts and S'artFor's
Bar Codes
Standard /eports and Sap
S)ripts
I'portant Standard /eports
in SAP
Abap Tri)%s and Tips
Bapi Sales Order
BAPI Pur)hase Order
Creatin( Fun)tion +odules in
SAP
Creatin( Tables in SAP
Findin( 0ser $9its in SAP
Fun)tion +odule Create Te9t
and /ead Te9t
I'portant Transa)tion Codes
in SAP
ABAP Fun)tion +odule 3or
Sub'ittin( a Pro(ra'
ABAP Ba'e Ti) Ta) Toe
ABAP Internal Table To $9)el
Sheet
ABAP Fun)tion +odule to
)reate ire)tory
i33erent Types o3 +enus in
SAP
ABAP De"ugger Brea5 Points
ABAP De"ugger $atchPoints
Drill Do%n Reports Concept
Creating a 8;T SP;T
Interactive Programs an! 8i!e
Techni2ue
String Concatenate
,et $ee5 of the /ear
SAP ABAP to A!! Da*s to a
Date
A!! 7onths to a Date
,et 7onth in the /ear
Displa* Cloc5
ABAP Code For Pro(ress
BA/
ABAP Fun)tion +odule For
Calu)lator
ABAP Fun)tion +odule For
Calender
isplayin( +essa(es in
ABAP
Fun)tion +odule Pop 0p To
Con3ir'
Con*ersion /outines in SAP
SAP ABAP Authori>ation
SAP ABAP +odule Pool
Pop 0p a Calender
+odule to /ead a File
+odule to /e*erse A Strin(
/un an $9e)utable Pro(ra'
-ith Para'eters
Pro(ra' 3or POP up S)reen
Printin( Sele)tion
Para'eters 3or a /eport
0ploadin( and o-n.oadin(
a /eport
SAP ABAP 2ersion
+ana(e'ent
SAP ABAP Short Cuts
.ist o3 I'portant Syste'
2ariables
ABAP 7ACR;S
ABAP Callin( a File Sele)tor
So'e I'portant Fun)tion
+odules
ABAP Strin( Operations
ABAP Fun)tion +odule to
Che)% 2alidity o3 ate
Trans3er Internal Table
Contents to a File
SAP ABAP Pro(ra' Types
BAPI to /ead Custo'er ata
Attributes o3 ata
SAP ABAP $ditor I)ons
BAPI 3or isplayin( +aterial
ata
BAPI to (et )usto'er ban%
details
$I Outbound Pro)ess
SAP $I Pro)ess O*er*ie-
Fun)tion +odule 3or 2endor
Ban% details
SAP IOC
Creatin( a 2alid Pass-ord in
SAP
SAP BAIs Introdu)tion
SAP ABAP +AC/OS
POP 0P 3un)tion +odule to
Con3ir' and Sa*e ata
Sele)t Options
BAPI 3or a*ailability )he)%
Strin( to ,u'eri)al
SAP Boods +o*e'ent
Pro)ess
Bettin( a .ist o3 Plants 3or a
+aterial
SAP /H Clients Con)ept
ABAP Adobe For's
Authori>ation Ob?e)t Tables
SAP Industry Spe)i3i)
Solutions
Fun)tion +odules in SAP to
)he)% .o(ed in 0sers
ABAP Fun)tion +odule 3or
Addin( ays to ates
Call a Transa)tion Fro' a
/e'ote Syste'
SAP ++ si'ple Pro)ure'ent
Cy)le
BAPI +aterial $IT
Findin( e)i'al Pla)es in
Curren)y
Bettin( ne(ati*e si(n be3ore
a nu'ber in ABAP
Pro(ra' $ditor .o)% 0nlo)%
/estri)tin( Sele)t Options
.ist o3 BAPIs in the syste'
SAP Fun)tion +odule
S)ra'ble a Strin(
.S+5
POP up table )ontents on the
s)reen
SAP /H Boo%'ar%in(
5ebsites
Sto)% /e<uire'ents .ist
Fun)tion +odule
/etail Transa)tion Codes
Tutorial
SAP ABAP /FC
Findin( Path to SAP
Transa)tion in +enu
SAP Pur)hasin( o)u'ents
SAP and ABAP Short)uts
.o(i)al atabases
Ad*anta(es o3 .o(i)al
atabases
Copy to Clipboard
BAPI Create +aterial
Findin( and /unnin(
Pro(ra's in ABAP
Pro(ra' Synta9 Che)% and
$9tended Synta9 Che)%
Sele)t Options upper lo-er
)ase
BAPI Sales Order Si'ulate
Bet P.A,T and es)ription
3or a +aterial
+/P .ist Fun)tion +odule
Produ)tion Plannin( and
Controllin(
Appli)ations in SAP /H
Tool Based /eports
I'portant Transa)tion Codes
in SAP
SAP Sto)% per Bin
Che)%in( 2alidity o3 ate
o-nload to Appli)ation
Ser*er
ABAP ebu((er Brea%point
and 5at)hpoint
BAPI to (et Co'pany Code
etails
Creatin( +aterial 0sin( BAPI
part 2
Beneratin( a 2alid Pass-ord
.o(i)al atabases Stru)ture
+a%in( Fields OBli(atory in
Sele)tion S)reen
ABAP 2ie-s
Bettin( a Co'pany Code 3or
a Plant
I'portin( )ontents o3
Clipboard in SAP
Bettin( a Plant 3or a +aterial
Plant +aterial and Stora(e
.o)ation
SAP Produ)tion Plannin(
Standard /eports
,et5ea*er Co'ponents
Supported atabases and
Operatin( Syste's
Its TRUE that SAP is expanding its solutions to
allow for integration to other NON-SAP systems And
!A"A is #eing used to a$$omplish this This does not in
any way mean that A%AP will #e repla$ed #y !A"A
&illions of lines of A%AP $odes has #een written
whi$h exists in the forms of Reports Interfa$es and
Enhan$ements This $odes runs the #iggest $ompanies
of the world SAP is $ontinuously in the
effort of impro'ing A%AP

Su"scri"e to FREE Post
Enter Email
Su"scri"e
Delivere! "* Fee!Burner
Blo( Ar)hi*e
J H@@K 9H@B:
o J August 9H:
J Aug AC 9A:
SAP ABAP Important Le*%or!sThe follo%ing list
!isp###
M Aug A' 9A:
SAP ABAP Function 7o!ule to $rap Long Te&tThe
foll###
o M Nul* 9AO:
M Nul HD 9':
SAP Retail Transaction Co!es4 Su"se2uent
Settlemen###
SAP Retail Transaction Co!es4 Fresh Items
Procurem###
Important Transaction Co!es in SAP Retail4 )on+rep###
M Nul HK 9':
SAP Retail Transactions Procurement of
Replenisha"###
SAP Retail Transactions Assortment 7anagement
SAP Retail Transaction Co!es Pricing
M Nul HC 9A:
SAP IS+Retail Transaction Co!es 7erchan!ise
M Nul AO 9A:
)et%eaver Components A6T;ID Infrastructure RFID
M Nul AB 9A:
SAP Supporte! Data"ases ;perating S*stems
M Nul A@ 9A:
SAP an! A!o"e Forms
M Nul @D 9A:
SAP AuthoriPation ;"1ects Ta"les
M Nul @K 9A:
SAP 6serQan! AuthoriPation S*stemQRelate! Ta"les
M Nul @( 9A:
SAP In!ustr* Specific Solutions SAP Business Solut###
M Nul @H 9A:
SAP Stoc5 Per Bin
M Nul @A 9H:
SAP Plant Storage Location Data
SAP Plant Details Compan* co!e an! Controlling
Are###
o M Nune 9B@:
M Nun '@ 9':
SAP PLant for a 7aterial
SAP Compan* Co!e for a Plant
SAP Plant 7aterial an! Storage Location
M Nun H( 9A:
SAP P;P 6P TABLE C;)TE)TS ;) T8E SCREE)
M Nun HO 9H:
SAP ,et Plant Description for a 7aterial
SAP Plants for a given 7aterial
M Nun HB 9A:
SAP ABAP Fin!ing an! Running Programs
M Nun HC 9H:
SAP Function 7o!ule String )umerical
SAP Function 7o!ule String Scram"le
M Nun H' 9':
SAP ABAP )egative Sign Before a )um"er
SAP Function 7o!ule Import Clip"oar!
SAP ABAP Cop* to ClipBoar! Function 7o!ule
M Nun HH 9A:
SAP Tool Base! Reports
M Nun H@ 9H:
SAP ,oo!s 7ovement
SAP Pro!uction Planning an! Controlling Stan!ar!
R###
M Nun AD 9H:
SAP 7RP List Function 7o!ule
SAP Stoc5sRRe2uirements List Function 7o!ule
M Nun AK 9H:
SAP Availa"ilit* Chec5 BAPIRFunction 7o!ule
Creating a ali! Pass%or! in SAP
M Nun A( 9H:
SAP RR' Boo5mar5ing $e"sites
SAP RR' Clients Concept
M Nun AO 9A:
Stan!ar! Reports in SAP Pro!uction Planning
M Nun AB 9A:
SAP ABAP ,enerate Pass%or! Function 7o!ule
M Nun AC 9A:
SAP BAPI Sales ;r!er Simulate
M Nun AH 9A:
SAP BAPI List of BAPIS in the S*stem
M Nun AA 9A:
SAP LS7$ Legac* S*stem 7igration $or5"ench
M Nun A@ 9H:
SAP RR' Applications
Stan!ar! Reports in SAP Pro!uction Planning
M Nun @K 9A:
SAP ABAP 7acros
M Nun @O 9A:
BAPI to get compan* co!e !etails
M Nun @B 9B:
SAP ABAP Program EDIT;R L;CLR6)L;CL
6sing Logical Data"ases in SAP ABAP
M Nun @C 9B:
M Nun @' 9B:
M Nun @H 9B:
o M 7a* 9B@:
M 7a* 'A 9':
M 7a* '@ 9A:
M 7a* HD 9':
M 7a* HK 9H:
M 7a* H( 9H:
M 7a* HO 9':
M 7a* H' 9A:
M 7a* HA 9H:
M 7a* H@ 9H:
M 7a* AO 9H:
M 7a* AC 9H:
M 7a* A' 9':
M 7a* AH 9H:
M 7a* AA 9H:
M 7a* A@ 9':
M 7a* @K 9':
M 7a* @( 9':
M 7a* @O 9':
M 7a* @B 9H:
M 7a* @C 9A:
M 7a* @' 9A:
M 7a* @H 9A:
M 7a* @A 9':
o M April 9HA:
M Apr '@ 9H:
M Apr HD 9A:
M Apr HK 9H:
M Apr H( 9A:
M Apr HB 9A:
M Apr HC 9A:
M Apr H' 9H:
M Apr HH 9A:
M Apr HA 9A:
M Apr A( 9A:
M Apr AC 9H:
M Apr A@ 9A:
M Apr @D 9H:
M Apr @C 9A:
M Apr @' 9A:
M Apr @A 9A:
o M 7arch 9'H:
M 7ar 'A 9A:
M 7ar HK 9A:
M 7ar H( 9A:
M 7ar HO 9A:
M 7ar HB 9H:
M 7ar HC 9A:
M 7ar H' 9A:
M 7ar HH 9':
M 7ar HA 9A:
M 7ar AD 9H:
M 7ar A( 9':
M 7ar AC 9A:
M 7ar A' 9H:
M 7ar AH 9A:
M 7ar @( 9H:
M 7ar @O 9C:
M 7ar @B 9C:
M 7ar @C 9A:
o M Fe"ruar* 9HK:
M Fe" HD 9A:
M Fe" HK 9H:
M Fe" H( 9H:
M Fe" HO 9H:
M Fe" HB 9A:
M Fe" HH 9A:
M Fe" HA 9A:
M Fe" H@ 9A:
M Fe" AD 9A:
M Fe" AK 9H:
M Fe" AO 9A:
M Fe" AB 9':
M Fe" AC 9A:
M Fe" A' 9A:
M Fe" A@ 9A:
M Fe" @( 9A:
M Fe" @O 9A:
M Fe" @B 9A:
M Fe" @' 9A:
M Fe" @H 9':
o M Nanuar* 9O:
M Nan 'A 9A:
M Nan HC 9A:
M Nan H' 9A:
M Nan HH 9A:
M Nan AH 9A:
M Nan @B 9A:

BAPI /FC Fun)tion +odules A Si'ple ABAP /eport +O0.$ POO. ABAP ,a'in( Standards BC SAP SC/IPTS BA/
CO$ STA,A/ /$PO/TS 0S$/ $8ITS .ist o3 I'portant 2ariables ABAP Tri)%s and Tips I'portant Transa)tion Codes
in ABAP Creatin( Tables in SAP Sales o)u'ent Flo- SAP S /elated Tables Findin( 0ser $9its in SAP Pro)essin(
Blo)%s in ABAP Fun)tion +odules Create Te9t And Sa*e Te9t O.$ Auto'ation O.$ For $8C$. Si'ple ABAP A.2 /eport
Creatin( 2ariants For ABAP Pro(ra's SAP ABAP Authori>ations Con*ersion /outines in SAP


Pri*a)y Poli)y
This site is o%ne! an! operate! "* , Ra1esh# All pro!uct names are tra!emar5s of their respective companies# This site is in no
%a* affiliate! %ith SAP A,# 6se information on this site at *our o%n ris5# I The arti)les are )opyri(hted to B /a?esh and )an
only be reprodu)ed (i*en the author7s per'ission. =ou )an )onta)t 'e on abap.sap.3riendJ('ail.)o'. /our privac* on
the Internet is of the utmost importance to us#$e %ant to ma5e *our online e&perience satisf*ing an! safe# Because %e gather
certain t*pes of information a"out our users, %e feel *ou shoul! full* un!erstan! our polic* an! the terms an! con!itions
surroun!ing the capture an! use of that information# This privac* statement !iscloses %hat information %e gather an! ho% %e use
it#
Information %e gathers through aggregate! trac5ing information !erive! mainl* "* tall*ing page vie%s throughout our sites# This
information allo%s us to "etter tailor our content to rea!ersI nee!s an! to help our a!vertisers an! sponsors "etter un!erstan! the
!emographics of our au!ience# 6n!er no circumstances %e !ivulge an* information a"out an in!ivi!ual user to a thir! part*#
Coo5ie Trac5ing4 $e ma* place a te&t file calle! a Scoo5ieT in the "ro%ser files of *our computer# The coo5ie itself !oes not
contain Personal Information although it %ill ena"le us to relate *our use of this site to information that *ou have specificall* an!
5no%ingl* provi!e!# But the onl* personal information a coo5ie can contain is information *ou suppl* *ourself# A coo5ie canIt rea!
!ata off *our har! !is5 or rea! coo5ie files create! "* other sites# $e ma* use coo5ies to trac5 user traffic patterns 9as !escri"e!
a"ove:#
5e allo- third1party ad*ertisin( )o'panies :li%e Boo(le Adsense; to ser*e ads -hen you *isit our 5eb site. I3 you -ould
li%e 'ore in3or'ation about this pra)ti)e and to %no- your )hoi)es about not ha*in( this in3or'ation used by these
)o'panies, 2isit This.http4RR%%%#google#comRprivac*=a!s#html

You might also like