Monday, 13 October 2014

GGB0 Validation using User Exit

User exit for FI Transactions using (GGB0)
 
TCODE   : GGB0 validation
                OB28  for activating validation
                GCX2   user exit Program Config
                GS01   Set Creation
Program : RGGBR000 user exit program
Step 1 : create custom program for RGGBR000
   1 .Create custom (ZRGGBR000) program , with the copy of  standard Program  RGGBR000 .

   2. Maintained user exit name with in form (form get_exit_titles tables etab ) .
 Exits-name = (user defined name)
  3. Create form for that new user exit .
   form zpark using b_result.
         "Set Validation is true at initial stage
   b_result = b_true .
     “When your validation is unsuccessful just pass b_result in b_fales .
     * b_result = b_fales .
endform.      
Within form write your logic
Save and Activate the program .
Step2 : Assign the Custom Program in GCX2
After Assigning , user exit name will be appear in GGB0 exit TAB .
Step3 :  Create the Validation in GGB0 .
 
Maintained the User exit

Message:
Step:  Activate Validation (OB28) .

SET Creation (GS01 ) :
Press enter. Then below screen will appear .

Tuesday, 16 September 2014

BAPI - step by step creation


BAPI- Business Application Programming Interface

Step1: Creating a structure in SE11

Step2: Creating the function module in SE37
Step 3: Creating the business object in SWO1
Step 4: Viewing the created BAPI in BAPI Explorer
Step 5: Test your BAPI in SWO1


Step1: Creating a structure in SE11


Simple OOPS Concept ALV

*&---------------------------------------------------------------------*
*& Report  ZDEMO123
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

report  zdemo123.

*----------------------------------------------------------------------*
*       CLASS local DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
class local definition .
 public section .
   data: it_bkpf type standard table of bkpf .
   types : r_belnr  type range of bkpf-belnr .
   methods:get_data importing belnr type r_belnr,
           fieldcat exporting e_fcat type lvc_t_fcat,
           build_alv importing i_fcat type lvc_t_fcat  .
endclass .                    "local DEFINITION

*----------------------------------------------------------------------*
*       CLASS local IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
class local implementation .

 method:get_data.
   select * from bkpf into table it_bkpf where belnr in belnr .
 endmethod .                    "get_data
 method fieldcat .

   call function 'LVC_FIELDCATALOG_MERGE'
    exporting
*      I_BUFFER_ACTIVE              =
      i_structure_name             = 'BKPF'
*      I_CLIENT_NEVER_DISPLAY       = 'X'
*      I_BYPASSING_BUFFER           =
*      I_INTERNAL_TABNAME           = IT_BKPF
     changing
       ct_fieldcat                  = e_fcat
    exceptions
      inconsistent_interface       = 1
      program_error                = 2
      others                       = 3  .

*    lc_fcat = e_fcat .
 endmethod .                    "fieldcat


 method: build_alv .
   data lo_grid type ref to cl_gui_alv_grid.
   data: c_fcat type lvc_t_fcat .
   create object lo_grid
     exporting
       i_parent = cl_gui_custom_container=>screen0.
   c_fcat = i_fcat .
   call method lo_grid->set_table_for_first_display
     changing
       it_outtab                     = it_bkpf
       it_fieldcatalog               = c_fcat
     exceptions
       invalid_parameter_combination = 1
       program_error                 = 2
       too_many_lines                = 3
       others                        = 4.

 endmethod .                    "build_alv

endclass .                    "local IMPLEMENTATION

data: obj_local type ref to local.
data: cfcat type lvc_t_fcat .
tables: bkpf .

select-options : s_belnr for bkpf-belnr .
selection-screen begin of screen 1001 .
selection-screen end of screen 1001.

start-of-selection .


 create object obj_local .

 obj_local->get_data( exporting belnr = s_belnr[] ) .
 obj_local->fieldcat( importing e_fcat = cfcat ) .

 obj_local->build_alv( exporting i_fcat = cfcat ) .

 call selection-screen 1001 ."STARTING AT 8 8 ENDING AT 85 22.

Thursday, 29 May 2014

F4 HELP FOR YEAR / SEARCH HELP FOR YEAR

PARAMETERS: p_year TYPE gjahr .


AT SELECTION-SCREEN on VALUE-REQUEST FOR p_year .

 TYPES: BEGIN OF ty_year ,
       year TYPE gjahr,
       END OF ty_year .
 data: it_year TYPE STANDARD TABLE OF ty_year WITH HEADER LINE .
        DATA: i_return TYPE ddshretval OCCURS WITH HEADER LINE,
      TYPE VALUE 'S',
      year TYPE gjahr .

      year sy-datum+0(4) .

DO 5TIMES.
it_year-year year .
append it_year .
SUBTRACT FROM year .
ENDDO.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield    'P_YEAR'
      dynpprog    sy-repid
      dynpnr      sy-dynnr
      dynprofield 'crid'
      value_org   c
    TABLES
      value_tab   it_year
      return_tab  i_return.