Blog Archive

Thursday, July 31, 2014

ABAP class6 List of topics covered

Om


1.deleting the table content
----------------------------
a)SM30->View, delete
b) or abap query to delte the content.
c)se16n
   table name

views-> 4 types (datata base,project,maintaince,help)
------
->databasedview(from 2 tables) ex: vbak,vbap,( select all fieds,join condition)

also use view for abap quary.

-->helpview:(main table and its relation ship table:foreign key relations ship);


--->SYST table (abap system fields) and important fileds
--------------
SUBRC
TABIX
DBCNT
PAGNO
FODEC(function code)
LANGU
TZONE(Current time zone)

DYNNR(CURRENT SCREEN NUMBER)
BATCH(if it running batch mode,foreground mode)
mandt(current client)
tcode(current tcode)
uzeit(current time)
datum(current date)
uline
vline(vertical line)
msgid
msgty
------------------------------------------------------------
types of program(executable,function group,included, class and interterface,module,..)
and other options while creating any new program.


explanation of userexit: idoc example
--------------------------------------
Orders:
1)message type 2)basic type
(edi signals: PR,PO,SO,DELIVARY,INVOICE) Mainly 
850-po(out)
855->ack(in),
856->asn(in)
824->ack(out),
810->invoice(in)
824->ack(out)

partner type LI, LS difference and bank, KU(customer)
sap to SAP(generally we use LS)
LI->vendor

Partner role :VN(vendor), message type: standard one( we will cover for cutomization)
                         *message code  (ex: hyderabad, bangalore)
                         *message function( in hyderabad-> madhapur,hitec city)
Once idoc is generated, Process code has abap code(function module) where we write some user exit, to do some modification based on message code and message function.( we change the segment data based on branching). This is very helpful for technical routing. this message code and message function values will be appear in the control records of the idoc.

(for branching for message code and message function will be used,idoc control records,this data will be appear)
(based on this info, we can control data in abap code)

we21 port exlanation:(xml port creation, use function module to add timestamp and additionally)
al11 explanation:

we20: filling all options
message control:
output type for my me21n

(NACE: 
APPLICATION :EF
GOTO OUTPUT TYPE:You can see some standardard output types)(where ever edi there, just copy)
create new one.
ex:zedi( use copy all function).
processing routine----------->
types of medium(1.printoutput 2.fax 4.telex 5.externalsend 6.edi 7.send mail, ....)
use edi specific.

Mailtitle and text----------->
use edi specific


double click on output type:
----------------------------
access sequence:

output type->( condition recrods->condition table -> access sequence  )

output type linked to access sequence;

1.condition recrods  2.condition table (from access code).

finally add the output type in procedure.

mESSAGE CONTROL
EF->PURCHAGE ORDER  
V1 SALES
V2 DELIVARY
V3 BILLIN(INVOICE)

Process code(important) are standard  , we41 is for outbound, we42 for inbound process code.(for custome things)
purchage order: ME10.
EF  -> ZEDI ---> ME10.

some times, even though output type is configured, idoc is not sent.
in that cases: enter the oupput type in table(system table).
table name:    v_t161m, messages check the idoc number for the document

we02 -> check idoc .
if the idoc status is 30, run bd87(manual execution, process);

this is one idoc settings configution including output type.
------------------------------------------------------------

Next day















Sunday, July 27, 2014

ABAP class4 List of topics covered

Om

------> ;how to schedule back ground jobs

se36(to create jobs)
1. which sap abap program, variant, time?

1 job->mulitiple jobs one after the other.

user specific jobs,
job class(high,low,medium).

this jobs run(immediate? date/time? after job,after event,)
          periodic job?(hour/month/week..)      

factory calendar
job log

(topic on forground, background).
spool(result of the job).

ex: capturing errors during programm, we need to route those in another table
(job is for execution of programms, not for additional activities).


-----> performance tuning of abap code.
1.tace st05;
2.avoid loop inside loop(nested loop).
3.do not use join, instead use for all entries.
4.do not use, select * into table; use specific
5.do not use, select and end select.
6.clear and refresh use in code.
refreshing table; as similar to clear.
7. un necessary declartion of variables.
8. never use the  into corresponding fileds statements.
   also move to corresponding.
9. checking the execution time of abap program.

explanation of st05( start activation and stop activation)

transports->
------------
1.released objects
SMTS for import transport request.

st01,st03(unlock tr) st09  -> st09 is sufficent for all activites;

perform with pass by value and pass by reference
-------------------------------------------------

collect statement with example,
delete adjaent duplicate with example

---> filed symbols
     assign to filedname.
     unassign .


----> creating transaction code.

----> authorization check for transaction code level only.

      authorization object create.

      authorization object is assigned to our user.
----> authorization check in program.

      use pattern, give autorization object.
      then use sy-subrc = 0
         okay
  creation of authorzation object.

   SU20 tcode.
     select z section.

---->classical and interactive reports (20 +1 digts)

generally, we use 2 level only.
example on intractive reports

use HIDE key word for intractive report.

top of page and at user command.

how to create included program.
(example: all declartions part, move into include program).

------> creating class in abap

tcode: se24 to create class

ex: ZCL_SOMENAME

simiar to function module.
1.attributes
  input and output paramters in class.

  instance attribue, 2. static attribute 3.constant attribute
  visibility public,private,protecd

2. methods and parametres(importing,exporting,...)
   add code in start method and end method.

3. signature of method.

/* use simiar code, what ever we used in function module */

raise exception.

debuging also in class and debugging.
classical debugger and new debugger also.

ussing me->  ( this means current class )

to access the current class tributes values.


----->now call this class in our report.

data : cl_salesclass type ref to classname.
                          ------

note: pattern is not used for delcartion.

create object
use pattern.
1. create object
cl_salesclass   and classname.

create object of the class.

i.e. create object cl_salesclass.


use pattern to create instance of the class

  now give data(delcartion), class name and method also


for our example : pass the filed and import result into internal table.

-------------> function module = is almost similar to class.

important sap tables that are to be remember.


pick pack pgi
so(vbak,vbap),pr(eban),po(ekko,ekpo),delivary(likp,lips)
gr(mkpf,mseg) invoice(vbrk,vbrp),fi(bkpf,bseg)
vendor(bsak,bsik), customer(bsad,bsid), gl(bsas,asis)

partner(so =vbpa,vbud) (pr= ebkn) delivary=VBFA.


More info in document
sap technical
     -------------            












ABAP class3 List of topics covered

abap class3 topics covered
---------------------------
1.uploading records(excel csv) in sap tables with example.
  a)client dependant, b) client independent. tables
  certain objects are client dependant and client independent.
  also fill enhancement category options, while saving the table.

2) fill the sample data in excel and save as csv file format.
3) Create a program in se38
4) difference between using char and string in abap, which is best?
5) declaration of internal table and work area.

6) using perform
7) use call function 'F4_FILENAME' /* for the pop up to fetch the file name */
   get the value into vairable . this is has file name informaiton

8) another perform for excel_download.

   function name  GUI_UPLOAD.
    EXPORT -> file name
              asci formant yes
              has field separator yes

    tables -> get the csv records in internal table.

9)debugging ,  f5, f6, f7,f8.

10) use split option to split all fields based on filed Separator and moving into work area.
 
       SPLIT WORKAREA AT ',' INTO all fileds name of work area.

11)appending work area to internal table.
    now insert, modify( not exists, insert or update), display.

------------->

( to fetch different fileds from different tables)
sales header info , sales into info, material info.

1. Creating function module) and function module group creation.
(se37/se80,

Function module more information
-->attributes( package, user and more, remote function or not,)
-->import
-->export
-->changing(come as input and ouptalso)
-->tables( creation of table type, line type(structure)), types of tables also there(standard, hash table etc)

  use select query to fetch data
  select VBELN VKORG VTWEG SPART FROM VBAK INTO TABLE LT_VBAK WHERE VBELN EQ I_VBENL.

  FOR ALL ENTRIES -> USE.

  LOOP STATEMENT, SORT ,AND READ TABLE ,

  IF WITH INITIAL CHECK.

  EXECUTING FUNCTION MODULE.

-----> CALLING THIS FUNCTION MODULE FROM REPORT.(USING ALV REPORT).

-----> HOW TO USE PATTERN IN ABAP EDITOR.

  ----> USING SY-SUBRC;
   classical debugger explanation.
---> using the joins(inner join) for the same query. ( also sap help search).
   

---> how to check tr of the program.
---> version management
      saving the changes in different versions
      comparing the version(even these are in different transport request).
----> creating package in abap and creating new transport number.

-----> explanation of SE09( single tcode for all transport activities).

----->abap editor, code inspector.
      ( for performance check and efficiancy of the code)

-----> quick past (and options in abap editor).


    

Saturday, July 26, 2014

ABAP class2 List of topics covered

Om


se11(Data dictionary)
1. Creating table-------->
   domain,   dataelement and difference and creating them in table,using exiting
   1)delivary class( customizing(configuration related), application(master/transation),
   2) maintance allowed
   3) fileds, key and initilization.
   4) local objects and package, transport request.
   5) Data element creation, field labe( short, medium,long and heading)
   6) using sap standard data types.
   7) search help with * and f4

2. cntrl y,c,v and using options in sap screen ( mouse short cuts)
3. difference between structure and table
    1.table as similar to structure and but additionaly store data and having key fileds.
additional data has to specify while saving the table
4. master data and transaction data.(app0)
5. size catagory and buffering concepts.

1.see the talbe

utilities->table contents->add a record ( only 1 record we can add it)at each time..


sm30------>Table maintance generation------>view creation.
1. create functoin group.
2. SE80 object navigator explanation.
3. authoriztion group, with out also okay.
   explanation of authorzation objects
   (restric the actions to perticular users, su01,basis people assign)
4. now maintain multiple records at a time for the same table.
(screen automatically generated)
5. Also we can do some validations on this screen.
   ( events-> included our own custom code here), explained with a example.
6. se91, to throw error messages.
   ex: 000  add some description for this errors messages

7. use the pattern in abap editor to generate small auto code by providing above information.

8. 6 types of errors, I:information, E: error message s:success w: warning,

9. using IF condition in ABAP and loop condition

10.picking last 4 chars from 20digit char in abap
   ex; total+16(4)
11. cntl+f3 is activation.
12. debugging.(f5,f6,f7,f8) explanation.

More information about function group:
(only table maintainance screens needs function groups).

Creating Report---------------------------------------------->

Types of programs in sm38
--------------------------
1. executable program
2. include program
3. module pool(screen programming)
4. function group
5. subrountin pool.

report events---> structure of program

abap is even based program.
1.declaration( tables, data, types, constants, internal tables, work area, variables)
2.select screen( input screens for the user)
3.initilization
4.At selection screen( ex: date validations...)
5.start of selection

parameters keyword to use to get data from user.
(frame and with title, block, obligatory,radio buttong)

text elemetns: ex: text symbols->selection text, list heading).

user select one of the radio button, and check which radio butto is chedk and do corresponding operation


--->F1 for pretty priter.

using perform ( subrountie in side the program), and use pattern to generate code pattern.
work area and internal table declaration.
debugging and see the internal table work area detaisl in debuugin.
sy-subrc usage.

using F1 (Select any keyword on sap editor) and go for sap help. for more info on syntax.

1. insert into table
2. update table
3. delete
4. display operation on table.

loop,write, for internal table and work area.
displaying the data in good format.

1. creating variant for report.

se93---------------> custom transactin code for the above program.

ALV--->Reports

using the standard function module.
1.types pools:
   type-pools:slis; /* only for alv reports

multiple declartions combined together is called type pools.(type groups)
-->type group;
two important strucute
work area:  slis_filedcat_alv, internal table. slis_t_fieldcat_alv.

clear work area; and enter values from this work area, append this work area to internal table
(reapet the same for multipel fileds)
pass this internal table to FM(Function module).
using the function module.














ABAP Class5 List of topics covered

Om

Class 5: Topics covered in this session ( total 3 hours class)
--------
/* Doubts clarification

0.MACRO ( is old method of sub-routine, as of now no body is using).

1. where list is used application.
      programs, classes,webdrynpro,bsp, internet services, transactions,dialogmodules
      package,Enhancement implementation, ehhancement spots.

2.BDC batch data communication( Tcode: SHDB screen recording and SM35 
  (
    1. entering data/modify data in sap standard screen and post/save.
    2. repeat the same process for mulitiple records for the same process(above)
       as per the each record in the file.
   )

Example: SMOB, CMOD

     1.record the transaction on screen for one step.
     2. this record,will generate on abap program
     3. use this program to customize as per our requirement.(put loop condition)
     4. we can scedhule this background job or foreground.


3. access key and developer key difference

4. seeing the abap code of any standard screen.

5. PBO, PAI module program. for gui related.(SAPMZ...) coved with Example.

6. reading file(sap server) in our abap program.
 open data set and read data set.with example.
 specifing the file path to get the file from sap server path.

7. How to check the sap version of the SAP system,checking, if sap installed windows/unix?

8. AL11 tcode, to see the file directory structure with example.

9. /h debugging option, when do we use this?

10. using the sort and binary search(if data is large) before read table in abap, why?

*/
USER EXITS and ENHANCEMENTS

a)Modification:(old concept),need access key, to change sap standard screens, sap is not going to support, if any migrations are happened.

b)Enhacements:

   using tcodes: CMOD, SMOD
   ii)customer exits(screen,function,filed,menu exits)
    step by step

   a) first identify the package of the screen.
   b) see the list of customer exits(sap has given some stand functions, included)
      where we need to add our code.
   c) implement the logic for include for your exist.

   for testing purpose, put break point, and check, how the navigation is happening

/* doubts clarification

10. abap programming: Ranges   as similar to parameters.
    
   Ranges: var1 FOR ekko-zterm.

   * assigned some values for this
    use this in condition.

example: select * from ekko into table it_ekko where zterm in r_number.

11. Never confuse with addvanced topics of internal table( hash...), use the same procedure as said earliar
    we can achieve all requirements using that. Only performance case(we use advanced internal table procedure

 */     
     


Sunday, July 13, 2014

ABAP is must in SAP Environment for smart work.

Om

Why ABAP?


  1. After working in different projects in SAP environment. I have understood, with out knowing abap knowledge, it is difficult to manage in SAP environment. 
  2. -------------------------------------------------------------------------------------
  3. The person who knows, ABAP and other modules in SAP (ABAP + Other module) definitely can manage all work great way.
  4. --------------------------------------------------------------------------------------
  5. I have asked one of the functional consultant(SAP MM), Why do not you learn ABAP language. 
  6. He said: I feel fear after seeing that big code.
  7. -------------------------------------------------------------------------------------
  8. Yes, The person(certain) whoever looks first time abap code, definitely feels bad. and trying to avoid to learn ABAP side.
  9. -------------------------------------------------------------------------------------
  10. Why SAP. ( because of its advantages: it is developed for big firms or big organization which has business across the world.), so they can easy do their business, with help of SAP software.
  11. -------------------------------------------------------------------------------------
  12. Most business have to perform these operations.
  13. ex: material management in organization, buying , selling , finance management, Human resources, quick monitoring and integration with non SAP and SAP environments, quick fixes, support new add-ons, support should be easy and so on....
  14. -------------------------------------------------------------------------------------
  15. SAP has many products and applications.
  16. Designed good tables(already defined for most business specific), 
  17. ex: you can create Purchase order in ME21N, update, display also. these will be saved in SAP standard tables. 
  18. Functional consultants directly work on these screens( they know fully functionality of business), ex: purchase order needs sales organization, cost center, items info , header info, unit of measurement and so on.. 
  19. -------------------------------------------------------------------------------------
  20. In SAP ,we see many functional consultants(SAP MM, FI-CO, SD, PP, .....)
  21. -------------------------------------------------------------------------------------
  22. all these modules run on homogeneous environment ABAP stack.  By using ABAP we can write our own custom code to create our required screens and objects. SAP internal code is also in ABAP.  
  23. -------------------------------------------------------------------------------------
  24. Many application in SAP designed in standard way to support many business.( it will be continuous the same model for next couple of years.) it is very difficult to break / give better environment in short period.
  25. -------------------------------------------------------------------------------------
  26. So ABAP play good role for next couple years definitely.

How to learn ABAP 

first is, avoid fear by seeing abap code.  It is like a language, once you learn it is easy for you.
------------------------------------------------------------------------------------
Use editor like notepad plus, to simply the code,( use cut,copy method by referring standard tables, fields)  use the editor(notepad++) to navigate code easily and simple coding techniques in edit plus.
----------------------------------------------------------------------------------------
Most of the of the time use the data elements by referencing SAP standard elements.
-------------------------------------------------------------------------------------------
ABAP = data manipulation operation on SAP stand tables/custom tables.(Business specific)
                        select statements, control statements, (report programming)
                Standard Interface:  IDoc, BAPI, RFC,Function module. 
                Interaction methods: with standard application screens with ABAP and enhancements. i
                Debugging ABAP code(very very important).
--------------------------------------------------------------------------------------------------
in JAVA( we use this programming for many things, in different applications,
                ex: web design, logic implementation, networking, security.....)
--------------------------------------------------------------------------------------------------
  But in ABAP, what i have observed, how to run the business data( data manipulation only for business, i.e. not best as like java GUI/ security/web integration,) to implement these, sap has other products, abap-webdynpro, java webdynpro, SAP netweaver and SAP security,basis.
--------------------------------------------------------------------------------------------------
So, In ABAP, most of the time, we focus on business specific data only and small extents in other side. also.
--------------------------------------------------------------------------------------------------
                       Once you are familiar with basic statements like
                                        Select statements, data types, domain, data element
                                        control statements: loop,read table, 
                                          work area, internal table
----------------------------------------------------------------------------------------------------
My suggestion is, learn abap from good trainer( because, most of the time, you can get full information from him, and it is integrated with different application, we can get full information, how the abap program is called from different applications). Trainer will explain you, How the business runs at different application, important standard tables, interfaces of it, how abap is integrated with those.)
One of the best trainer I have identified in bangalore Santhosh: who is working in one of the mnc, near electronic city, he is giving training on SAP ABAP and Workflow, I have taken abap training(programming ,all user exits,enhancemtns, rfc/bapi, idoc programming). he is giving online and offline classes also his gmail id :  sap.s.santhosh
-----------------------------------------------------------------------------------------------------
If any functional/technical consultant knows abap, first preference is for him only rather than individual person. and he will gain goods roles in organization if has desire in management.

-----------------------------------------------------------------------------------------------------
You will get good salaries by know small things in ABAP along with business applications. (need to know many things in JAVA to servive )



Draw backs: 
1) This ABAP programming is helpful, only if you work for an organization(big). or only for training.
  ( In JAVA, we can use this for company, or else , we can start your individual webdesign or relevant also, and small firms also, you will get more opportunities in many locations where ever you want).
2) Need good configuration of hardware to install the SAP environments and maintenance is difficult.(generally  SAP basis will take care about sap software).
   ( In most of the cases: by paying 500rs , you will get one month access to practice).
3) Need good trainer to learn, otherwise, we do not know, how abap is called in SAP applications with real time examples and also how business runs.

              





Sunday, July 6, 2014

Understanding abap code for ABAP client proxy.

Om



1.Creating datatypes/work-area/structures as similar to proxy objects/structures.


1.Creating datatypes/work-area/structures as similar to proxy objects/structures  

DATA:
  PRXY TYPE REF TO ZTCO_MI_EMPDET_OB,
  FS_EMPLOYEE TYPE ZTDT_EMPDET_OB_EMPLOYEE,
  T_EMPLOYEE TYPE ZTDT_EMPDET_OB_EMPLOYEE_TAB,
  FS_EMPLOYEE_MT TYPE ZTMT_EMPDET_OB


2.Creating custom datatypes to create internal tables with reference to standard tables.
/*example*/
DATA:
  BEGIN OF I_PA0000 OCCURS 0,
   PERNR LIKE PA0000-PERNR,
   MASSN LIKE PA0000-MASSN,
  END OF I_PA0000,

3. Creating proxy object( w.r.t. datatype)
TRY.
 CREATE OBJECT PRXY.
ENDTRY.


4. Select-options  for user manual entry
/* to fetch user entry from the sap gui */
SELECT-OPTIONS:
 S_PERNR FOR PA0001-PERNR.

5. Using select query
/* this is select statement to fetch multiple values */

SELECT PERNR   " (this is comment in abap) also use ctrl+< or ctrl+> for omment,uncomment
MASSN
FROM PA0000
INTO TABLE I_PA0000
AND BEGDA LE SY-DATUM
WHERE PERNR IN S_PERNR
AND ENDDA GE SY-DATUM
AND STAT2 EQ '3'.

Note: stat2 means employeement status and ENDDA= end date, BEGDA=start/begin date

6. Using sort command for internaltable( just before we have assigned data with select statement)
SORT: I_PA0000 BY PERNR,
        I_PA0001 BY PERNR,
        I_PA0002 BY PERNR,
        I_PA0007 BY PERNR,
        I_PA0008 BY PERNR.
7. applying loop for internaltable 


7.1. Clear the workarea/structure content.
     CLEAR FS_EMPLOYEE.
7.2. Assigning value to the internal table
FS_EMPLOYEE-PERSONNEL_NUMBER = I_PA0000-PERNR.
FS_EMPLOYEE-ACTION_TYPE = I_PA0000-MASSN.
7.3. reading the internal table in loop: (before it should be sorted, outside the loop), & if condition.
    (sy-subrc  is system varaible, which will be zero, at least one record is fetched)
  READ TABLE I_PA0001 WITH KEY PERNR = I_PA0000-PERNR BINARY SEARCH.
    IF SY-SUBRC EQ 0.
      FS_EMPLOYEE-EMP_GROUP = I_PA0001-PERSG.
      FS_EMPLOYEE-EMP_SUBGROUP = I_PA0001-PERSK.
      FS_EMPLOYEE-PERSONNEL_SUBAREA = I_PA0001-BTRTL.
      FS_EMPLOYEE-PAYROLL_AREA = I_PA0001-ABKRS.
      FS_EMPLOYEE-COST_CENTER = I_PA0001-KOSTL.
      FS_EMPLOYEE-ORGANIZATIONAL_UNIT = I_PA0001-ORGEH.
      FS_EMPLOYEE-POSITION = I_PA0001-PLANS.
    ENDIF.     
7.4. assigning structure variable to table variable
APPEND FS_EMPLOYEE TO T_EMPLOYEE.



TRY.
      FS_EMPLOYEE_MT-MT_EMPDET_OB-EMPLOYEE = T_EMPLOYEE.
      CALL METHOD PRXY->EXECUTE_ASYNCHRONOUS
        EXPORTING
          OUTPUT = FS_EMPLOYEE_MT.
      COMMIT WORK
     .
    CATCH CX_AI_SYSTEM_FAULT .
      DATA FAULT TYPE REF TO CX_AI_SYSTEM_FAULT .
      CREATE OBJECT FAULT.
      WRITE :/ FAULT->ERRORTEXT.
  ENDTRY.                     8. Calling call method of proxy with in try block







make easy coding ABAP JAVA C C Plus with nodepad plus tips


Om

Un commenting at the endof  of the lines of abap code.


few, Search terms.


search term inside the ( )  storing in memory, we use this in replacing with search  with \  or  $ as shown below

before:->


after :->



another example, apply this and see the output in your notepad plus


We can also see then end of the line , where exactly it starts,( by default ,it is hidden), using regular expression we can find those , use our required logic.

another example search the pattern inside quotations " ".  here \d  is similar to [0-9]




Marking the required lines as per our serach. later , we can delete those lines or additiona opertaions


bookmarking

operations on bookmarking lines

Hiding and Unhiding lines



Note: sometime, if you see some missed lines after unhidding also, simply again hide those lines and unhide, then you are able to see those missed lines also.


another example for selecting lines with starts with numbers.

Selecting lines which starts with char A

Selecting required lines with end line option also



selecting lines which ends with 13 number.


 selecting lines and replacing with some condition, meaning of plus symbol

finding those lines which ends with specific char or number


Understanding regular expression keywords to search efficiently.


another important topics in notepad plss, vertical copy



Regular expression keywords in notepad:
http://blog.creativeitp.com/posts-and-articles/editors/understanding-regex-with-notepad/

Make your own language syntax:        http://scn.sap.com/people/manish.kumar19/blog/2013/12/27/abap-syntax-highlighting-in-notepad
( enableing the abap keywords) see part1 and part2.


Are you facing problem with installing the notepad++ plugins for

1. compare and 2. xml tools

in some computers, we see the two different program  1)Program files 2) Program files(x86)
by default, your notpad++ wizard helps you to install the software in 2)program files(x86),

place the plugs in in the programfiles->notepad++> this folder
                                                                            and in plugin folder also
                                                                 then, you can see the xml tools functionality and compare functionality of notepad++

;-)



Om-tat-sat