Sunday, 28 July 2013

Finding Funtion Group

We can find all FunctionGroup as below.

Goto Se11
Enter Table  TADIR
In table selection screen enter  OBJECT = FUGR, then you will get all the function groups.
If you want function groups created by a person , enter author name  in addition to OBJECT = FUGR

Standard Program to Delete Scheduled Jobs is RSBTCDEL

Standard Program to Delete Scheduled Jobs is RSBTCDEL.

Run this program in SE38, here you can delete all the jobs

Saturday, 22 June 2013

Using Perform of one program in Another program

Example :

  PERFORM f_add_ser_cond IN PROGRAM znm_sc_r_qn_erro_disp IF FOUND
                            TABLES    i_cond2
                                      t_serialno
                                      lt_sernr
                            USING     matnr
                                      vwerk
                                      aufart
                                      repos
                             CHANGING lv_flag.

Tuesday, 18 June 2013

User Exit Table MODSAP

1. MODSAP is the table which has Exit name .
2. When you have a include of an exit, use the where used list and find the EXIT name.
3. Pass the Exit name to the MODSAP , then you can find the Enhancement name.

Wednesday, 12 June 2013

Disable Fields in Selection Screen of Report Program based on Authority Check.

1.  First check for Required condition ( Checking authorization in  current example) in INITIALIZATION . Based on condition use LOOP AT SCREEN to disable or make the field invisible.

Example       
  INITIALIZATION.
gv_readonly_flag = 'X' .
 LOOP AT SCREEN.

      IF screen-name EQ 'P_R1'.
        break mavb.
        screen-invisible = '1'.
        screen-active = '0' .
        MODIFY SCREEN.
      ENDIF.

    ENDLOOP.



2. Keep a flag when you run the above code and copy the same code in  AT SELECTION-SCREEN OUTPUT.  as initially the field will be invisible in the selection screen but when the user press ENTER, the field will become visible as INITIALIZATION will be executed only once in the life of program, so when the user press enter the field will become visible. So we have to write the same code in  AT SELECTION-SCREEN OUTPUT.
Example

  AT SELECTION-SCREEN OUTPUT.
  IF gv_readonly_flag = 'X' .
    LOOP AT SCREEN.

      IF screen-name EQ 'P_R1'.
        break mavb.
        screen-invisible = '1'.
        screen-active = '0' .
        MODIFY SCREEN.
      ENDIF.

    ENDLOOP.

  ENDIF.



Example with a scenario for Authorisation check :

  SELECTION-SCREEN  BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.

PARAMETERS : p_r1  RADIOBUTTON GROUP g1 ,
             p_r2  RADIOBUTTON GROUP g1 .

SELECTION-SCREEN END OF BLOCK b2.



  INITIALIZATION.

  CALL FUNCTION 'AUTHORITY_CHECK'
    EXPORTING
      user                = sy-uname
      object              = 'ZQMCERTMGR'
      field1              = 'ZQMCRTACVT'
      value1              = '01'
    EXCEPTIONS
      user_dont_exist     = 1
      user_is_authorized  = 2
      user_not_authorized = 3
      user_is_locked      = 4
      OTHERS              = 5.

  IF sy-subrc NE 2.

    CALL FUNCTION 'AUTHORITY_CHECK'
      EXPORTING
        user                = sy-uname
        object              = 'ZQMCERTMGR'
        field1              = 'ZQMCRTACVT'
        value1              = '03'
      EXCEPTIONS
        user_dont_exist     = 1
        user_is_authorized  = 2
        user_not_authorized = 3
        user_is_locked      = 4
        OTHERS              = 5.
    IF sy-subrc EQ 2 .
      gv_readonly_flag = 'X' .
    ELSEIF sy-subrc NE 0 .
      MESSAGE 'User is not Authorised'(019) TYPE 'E' .
      LEAVE TO LIST-PROCESSING.
      EXIT.
    ENDIF.
  ENDIF.

  IF gv_readonly_flag = 'X' .

    LOOP AT SCREEN.

      IF screen-name EQ 'P_R1'.
        break mavb.
        screen-invisible = '1'.
        screen-active = '0' .
        MODIFY SCREEN.
      ENDIF.

    ENDLOOP.

  ENDIF.

AT SELECTION-SCREEN OUTPUT.
  IF gv_readonly_flag = 'X' .
    LOOP AT SCREEN.

      IF screen-name EQ 'P_R1'.
        break mavb.
        screen-invisible = '1'.
        screen-active = '0' .
        MODIFY SCREEN.
      ENDIF.

    ENDLOOP.

  ENDIF.



Explanation : P_R1 and P_R2 are radion buttons. P_R1 is for write access and P_R2 is for read only report. So when we check for authorisation using the Authority_check function module, if user has authorisation for write access, authority FM with field value '01' will pass, if the user doesn't have write access , then we check for read access.If user has read access then we make the radio button P_R1 invisible as per above code.

Friday, 31 May 2013

OOPS ABAP Training Videos

oops website :-




below one is online tutorial of thomas jung:-


RM tiwary interesting blogs:-



Above links have been received from Pallav

Change Document CDHDR and CDPOS tables .

We can check the log in CDHDR and CDPOS tables or in transaction RSSCD100.



Below is to create a log in tables CDHDR and CDPOS for any table.

http://wiki.sdn.sap.com/wiki/display/ABAP/Change+Document

copy the below data from above link here.



CHANGE DOCUMENT:
This document briefly describes how to create a 'Change Document' for a business object.
Let us start with an example for clear understanding and to know the importance of the 'Change Document'.
  • Consider MM01 transaction, here MATNR is a primary key as well as 'Change Document Object'.
  • Now we try to create a Material in the MM01.
  • Now once we finish creating a material, we can find that a new material has been inserted not only from the MARA table or any other material related table but also from the tables 'CDHDR' or 'CDPOS'.The material we have created in 'CDHDR' table will be something like this.