Tuesday, June 2, 2015

Re-trigger the Workflow

Using the T.code SWUE you can re-trigger.

Follow the steps to trigger the workflow via Event.
1) Goto the T.code SWUE.
2) Object category = BO BOR Object Type
3) Object Type = Business Object (e.g. BUS2089,..).
4) Object Event = which event you want to trigger (e.g CREATED,..)
5) Click on Object Key button & enter the key field value(s)
6) There is a button 'Event Parametersu2019. Click on that to enter the event parameter values, if any
7) Then you have to click 'Event Receiver' button, and you can see which Workflow is linked to this event
8) Now click on 'Create Event' to trigger the event.
9) Then  Go to SWEL and see the Event.

Saturday, April 4, 2015

BADI using Filters

In BADI's filters give you a chance to call specific implementation based on filter value.Actually it is available whenever you have multiple implementations for one BADI definition.

suppose you created one two BADI implementations for ME_PO_PROCESS_CUST definitions..you check the filter option in SE18 and give on what field you want to do filetr...give that field data element or structure.then automatically all of the methods in your BADI implementation gets one import parameter which is FLT_VALUE.within the code you write for different values different code in both implementations.within the transaction if you give that one of field value that perticular BADI implementation will be triggered.

Suppose if you did implementation1 with filter VBELN...whenever you write the code within methods , you have to give some value for FLT_VAL which is automatically obtianed in your all methods...so you have to pass some value.
if you pass some value like FLT_VAL = '1000090000' in first implementation method with some logic.

If you pass another value in FLT_VAL = '1000090001' of seconmd implementation method with some other logic.

Ok..now if you enter VA03 tcode enter vbeln value...if you enter 1000090000 it trigger the first method..if you enter 1000080001 it triggers the second method based on filter value.

Saturday, November 29, 2014

SAP tables not used frequently

SWD_STEPS -  Workflow and tasks
SW* - For all workflow related tables
SWWWIHEAD - Workflow Runtime: Header Table for All Work Item Types
E071 - Objects in transport request.
TADIR - All Development Objects

Sunday, November 9, 2014

Finding the Routines from routine include name

1. Go to program MV80H200
2. Search for form XD0200_INCLUDE_NAMEN_SETZEN inside the program
3. Copy the first 5 letters from the include name ( eg if the program name is RV56C909, copy RV56C).
4. Search for RV56C inside the code.
5. Go to VOFN and inside class field, put the TRAU and execute.



Tuesday, October 14, 2014

Creating the SICF service node manually from the webdynpro application name

Program Name - WDY_CREATE_ICF_FOR_APPLICATION

Execute the program in transaction se38 and give webdynpro application name and give one name for the ICF node.
Once executed, ICF node will be created with the given name.



Friday, October 10, 2014

Program to resolve the proxy error while moving transport request

Program Name - SPROX_LOG_TRANSP_OBJ_INSERT. 

Execute the above program and give the error transport request as the input and execute.

Thursday, September 25, 2014

Friday, September 19, 2014

Comparing versions of Business Object

1. Get the Program name of BO -  (Go to SWO1. Enter the BO name; Click Display; Double click on BO name; You will get the Program name of the BO)
2. Go to SE38;  Enter the Program name of BO; Dont click on display; Directly click  "Utilities->Version->Version Managment"
 You will get the versions.

Now you can do the remote comparison with Production version.

But this will show only the differences of methods (ABAP codelines). Other differences like Keyfields, Attributes, Exceptions  you can check manually..

Sunday, August 17, 2014

Workflow version change and activating.

1. Goto PFTC->Provide Template number.

2. Change->GOTO->Workflow Builder->Choose Version->You select the Version.

3. Activate the new version.

Wednesday, August 6, 2014

Copy Varient from one system to another

1. Run Report RSTRANSP.
2. Provide the program name as input.
3. Execute the program and provide the transport request number.


Monday, July 22, 2013

Adding SO10 text to Transport request


When we create or add text in SO10 it will not be added or prompt you add it in a transport request. If you want to add SO10 object in a TR, add it manually.

Give the following details

Program ID = R3TR
Object Type = TEXT
Object Name = TEXT,Text Name,Text ID,Language


SAP Dynamic Action

This Link is very good

http://wiki.sdn.sap.com/wiki/display/Snippets/Dynamic+Action

Monday, December 24, 2012

Function module to get work items in a particular User ID


SAP_WAPI_CREATE_WORKLIST

Pass USER = "user ID"

and get table WORKLIST as output.


Sunday, September 23, 2012

BAPI for assigning object to class CL20N class type 032 (Release Strategy)

CL20N is an enjoy T-code because of that BDC will not work properly.

BAPI to change or create value is BAPI_OBJCL_CREATE this BAPI will not update in table, to get data updated in table we have to use BAPI commit  BAPI_TRANSACTION_COMMIT along with BAPI_OBJCL_CREATE.

Sample code.

REPORT  YTEST_CL20N.
* data
data: lw_object type OBJNUM,
      lc_table type TABELLE,
      lw_class type KLASSE_D,
      lw_cltype type KLASSENART.
*table
data: li_valuesnum  type STANDARD TABLE OF BAPI1003_ALLOC_VALUES_NUM WITH HEADER LINE,
      li_valueschar type STANDARD TABLE OF BAPI1003_ALLOC_VALUES_CHAR WITH HEADER LINE,
      li_valuescurr type STANDARD TABLE OF BAPI1003_ALLOC_VALUES_CURR WITH HEADER LINE,
      li_return     type STANDARD TABLE OF BAPIRET2.
*
concatenate 'SZ' 'A9' into lw_object.
CONDENSE lw_object.
lc_table = 'T16FS'.
lw_class = 'PR_OVERALL_RELEASE'.
lw_cltype = '032'.

* character
li_valueschar-CHARACT = 'PR_DOCUMENT_TYPE'.
li_valueschar-VALUE_CHAR = 'ZI02'.
append li_valueschar.
clear: li_valueschar.

*Currency
li_valuescurr-CHARACT = 'PRVALUE1'.
li_valuescurr-VALUE_FROM = '0'.
li_valuescurr-VALUE_TO = '4999'.
li_valuescurr-CURRENCY_FROM = 'SAR'.
li_valuescurr-CURRENCY_TO = 'SAR'.
APPEND li_valuescurr.
CLEAR: li_valuescurr.

* NUMERIC
li_valuesnum-CHARACT = 'ZEMER_PRIO'.
li_valuesnum-VALUE_FROM = '1'.
append li_valuesnum.
clear: li_valuesnum.

CALL FUNCTION 'BAPI_OBJCL_CREATE'
        EXPORTING
          objectkeynew    = lw_object
          objecttablenew  = lc_table
          classnumnew     = lw_class
          classtypenew    = lw_cltype
        TABLES
          allocvaluesnum  = li_valuesnum
          allocvalueschar = li_valueschar
          allocvaluescurr = li_valuescurr
          return          = li_return.

BREAK-POINT.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
*   WAIT          =
* IMPORTING
*   RETURN        =
          .

Please find CL20N screen




Sunday, March 18, 2012

IS Oil SD routines


1.Create a Routine in 05F5 within the customer name space.
2.Register that object with SAP to get the registration key.(you need to have OSS ID to get the object registered with SAP.Refer google to know how a object should be registered with SAP)
3.Even though the Routine is a customised one,it will reside within the SAP Development Class.
4.Once you get the Registration key,code the logic in the respective routine.
5.Activate it and test.
6.While transporting tag the RV80HGEN in the TR as XPRA so that the routine gets activated automatically once the TR is imported in the target client.
7.For more info you can refer the SAP Notes 327220 and 114978

Sunday, February 12, 2012

Copying SAP script from one client to another

Open Program RSTXSCRP.
1.Select Form Radio Button
2.In Mode Writre EXPORT
3. In Object Name Give Your Object Name(SAPSCRIPT/SMARTFORM NAME)
4. In Second Block give the file name 'C:\YSANDI.FRM'
Note That Form Name should be MAX 6 CHARCTER. and Extension Should be .FRM-->Execute
5. Then Go to other client-->Run The Program
6.GIVE MODE IMPORT
7.Then Excute and Select The File from PC.

Friday, September 9, 2011

Reading data from B2 Cluster

1. Retrieving data from B2 cluster using Function module.

Function module name is - HR_FORMS_TIM_GET_B2_RESULTS

Sample Code -

*&---------------------------------------------------------------------*
*& Report  YTEST_B2_CLUSTER
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ytest_b2_cluster.

TABLES: pernr.

infotypes: 0000, 0001.

DATA: lv_begda TYPE dats,
      lv_endda TYPE dats.

DATA: ls_tim_b2 TYPE hrf_tim_b2.

lv_begda = '20110101'.
lv_endda = '20110830'.
START-OF-SELECTION.
GET pernr.

  CALL FUNCTION 'HR_FORMS_TIM_GET_B2_RESULTS'
    EXPORTING
      pernr                 = pernr-pernr
      begda                 = lv_begda
      endda                 = lv_endda
    IMPORTING
      tim_b2                = ls_tim_b2
    EXCEPTIONS
      wrong_cluster_version = 1
      no_read_authority     = 2
      cluster_archived      = 3
      technical_error       = 4
      OTHERS                = 5.

END-OF-SELECTION.

2.  Retrieving data from B2 cluster using Import statement.

*--->>> INCLUDE rpc2b200 ( RPCnxxy0)
*--->>> n = 1, 2, 3 or 4 (for PCL1, PCL2, PCL3, PCL4)
*--->>> xx = cluster ID
*--->>> y = country grouping (0 for international otherwise country indicator T500L)

INCLUDE rpc2b200. ( so here we are using PCL2, B2 cluster and country key international )
TABLES: pernr, pcl2.
INFOTYPES00000001.
DATA: lv_begda TYPE dats,
      lv_endda TYPE dats.
DATA: lit_saldo TYPE STANDARD TABLE OF pc2b5.
START-OF-SELECTION.

GET pernr.
  b2-key-pernr = pernr-pernr.
  b2-key-pabrj = '2011'.
  b2-key-pabrp = '05'.
  b2-key-cltyp = '1'.
  IF pernr-pernr EQ '00010673'.
    IMPORT SALDO FROM DATABASE pcl2(b2) ID b2-key.
    IF sy-subrc EQ 0.
      LOOP AT saldo. " saldo is a table in cluster b2
       APPEND saldo TO lit_saldo.
      ENDLOOP.
    ENDIF.
   ENDIF.
END-OF-SELECTION.


3.  Retrieving data from B2 cluster using Macro statement.

TABLES: pernr, pcl2, pcl1.*  Buffer definition
INCLUDE rpppxd00.
DATA: BEGIN OF COMMON PART.
INCLUDE rpppxd10.
DATA: END OF COMMON PART.

INCLUDE rpc2b200.  " Same as explained for Import statement

INCLUDE rpppxm00.  " all macro definitions
DATA: lit_saldo TYPE STANDARD TABLE OF pc2b5.

START-OF-SELECTION.

GET pernr.
  b2-key-pernr = pernr-pernr.
  b2-key-pabrj = '2011'.
  b2-key-pabrp = '05'.
  b2-key-cltyp = '1'.
  IF pernr-pernr EQ '00010673'.
** reset macro
    rp-init-buffer.
** import macro
    rp-imp-c2-b2.
    IF sy-subrc EQ 0.
      LOOP AT saldo.  " saldo is a table in cluster b2
       APPEND saldo TO lit_saldo.
      ENDLOOP.
    ENDIF.
  ENDIF.

END-OF-SELECTION.







Tuesday, July 19, 2011

Adding Multiple line text in ALV

*&---------------------------------------------------------------------*
*& Report YTEST_ALV1
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT ytest_alv1.
tables: ekpo.
***************************************************************
* type pools
***************************************************************
TYPE-POOLS : slis.
***************************************************************
* type declaration
***************************************************************
TYPES: BEGIN OF t_polist,
ebeln TYPE ebeln,
END OF t_polist.

TYPES: BEGIN OF t_display,
ebeln TYPE ebeln,
remark TYPE tdline,
END OF t_display.

***************************************************************
* Internal Table declaration
***************************************************************
DATA: git_polist TYPE STANDARD TABLE OF t_polist,
git_display TYPE STANDARD TABLE OF t_display.

***************************************************************
* Work area declaration
***************************************************************
DATA: gwa_polist TYPE t_polist,
gwa_display TYPE t_display.


************************************************************
* Text Declaration
************************************************************
DATA: lv_name TYPE tdobname,
lv_id TYPE tdid,
lv_lang TYPE spras,
lv_object TYPE tdobject.
DATA: lit_lines TYPE STANDARD TABLE OF tline,
lwa_lines TYPE tline.
************************************************************
* ALV Data Declaration
************************************************************
DATA : g_repid LIKE sy-repid,
gs_layout TYPE slis_layout_alv,
gs_print TYPE slis_print_alv,
gt_list_top_of_page TYPE slis_t_listheader,
gt_events TYPE slis_t_event,
gt_sort TYPE slis_t_sortinfo_alv,
gt_fieldcat TYPE slis_t_fieldcat_alv,
fieldcat_ln LIKE LINE OF gt_fieldcat,
fieldcat_in TYPE slis_fieldcat_alv,
lwa_sort TYPE LINE OF slis_t_sortinfo_alv,
col_pos TYPE i.
DATA : gs_variant LIKE disvariant,
g_save.
DATA: it_evt TYPE slis_t_event,
wa_evt TYPE slis_alv_event.
************************************************************
**Macro for Field Catelogue
************************************************************
DEFINE build_cat.
clear: fieldcat_ln.
fieldcat_ln-fieldname = &1.
fieldcat_ln-tabname = 'GIT_DISPLAY'.
fieldcat_ln-seltext_l = &2.
fieldcat_ln-col_pos = &3.
fieldcat_ln-outputlen = &4.
append fieldcat_ln to gt_fieldcat.
END-OF-DEFINITION.
************************************************************
* Selection screen
************************************************************
select-OPTIONS: p_ebeln for ekpo-ebeln.
************************************************************
* Start of program
************************************************************
START-OF-SELECTION.
*--->>> selecting the PO document no
SELECT ebeln FROM ekpo
INTO TABLE git_polist where ebeln in p_ebeln.
*--->>>
SORT git_polist BY ebeln.
*--->>>
DELETE ADJACENT DUPLICATES FROM git_polist COMPARING ALL FIELDS.
*--->>> reading the first line of text, if multiple lines are present, we will add it later
LOOP AT git_polist INTO gwa_polist .
gwa_display-ebeln = gwa_polist-ebeln.
lv_id = 'F02'.
lv_lang = 'E'.
lv_object = 'EKKO'.
CLEAR: lv_name.
lv_name = gwa_polist-ebeln.
CLEAR: lit_lines[].
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = lv_id
language = lv_lang
name = lv_name
object = lv_object
TABLES
lines = lit_lines
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc <> 0.
ELSE.
READ TABLE lit_lines INTO lwa_lines INDEX 1.
ENDIF.
gwa_display-remark = lwa_lines-tdline.
CLEAR: lwa_lines.
APPEND gwa_display TO git_display.
CLEAR: gwa_display.
ENDLOOP.
*--->>> field cat
build_cat 'EBELN' 'PO Document No' '1' '20'.
build_cat 'REMARK' 'Remark' '2' '125'.
*--->>> alv
g_repid = sy-repid.
gs_variant-report = g_repid.
g_save = 'A'.

*--->>> this event for displaying mutiple lines

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
IMPORTING
et_events = it_evt.
*
READ TABLE it_evt INTO wa_evt
WITH KEY name = slis_ev_after_line_output .
wa_evt-form = slis_ev_after_line_output .
MODIFY it_evt FROM wa_evt INDEX sy-tabix .
*
READ TABLE it_evt INTO wa_evt
WITH KEY name = slis_ev_top_of_page .
wa_evt-form = slis_ev_top_of_page .
MODIFY it_evt FROM wa_evt INDEX sy-tabix .
*--->>> end of event setting

*--->>> call the list display
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = g_repid
i_structure_name = 'GIT_FINAL'
it_fieldcat = gt_fieldcat[]
is_variant = gs_variant
it_events = it_evt
TABLES
t_outtab = git_display
EXCEPTIONS
program_error = 1
OTHERS = 2.

*&---------------------------------------------------------------------*
*& Form after_line_output
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->RS_LINEINFO text
*----------------------------------------------------------------------*
FORM after_line_output USING rs_lineinfo TYPE slis_lineinfo .
DATA: v_tabix TYPE syst-tabix .
*--->>>
CLEAR : gwa_display .
*--->>>
READ TABLE git_display INTO gwa_display INDEX rs_lineinfo-tabindex .
CHECK sy-subrc = 0 .
*--->>>
lv_id = 'F02'.
lv_lang = 'E'.
lv_object = 'EKKO'.
CLEAR: lv_name.
lv_name = gwa_polist-ebeln.
CLEAR: lit_lines[].
*--->>>
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = lv_id
language = lv_lang
name = lv_name
object = lv_object
TABLES
lines = lit_lines
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc <> 0.
ENDIF.
*--->>>
DESCRIBE TABLE lit_lines LINES v_tabix .
CHECK v_tabix > 1 .
*--->>>
LOOP AT lit_lines INTO lwa_lines FROM 2 .
WRITE: / sy-vline ,
22 sy-vline ,
23 lwa_lines-tdline ,
148 sy-vline .
ENDLOOP.
ENDFORM . "after_line_output

Monday, June 6, 2011

Print Control in Block List ALV

If we take a printout of Block list ALV, each block will come in separate pages, to avoid that, we can control the print functionality in ALV block list.

*--->>> Data declaration
data: w_print TYPE slis_print_alv. " for print control

*--->>> print control information
w_print-no_print_selinfos = 'X'.
w_print-no_new_page = 'X'.
w_print-no_coverpage = 'X'.
w_print-no_change_print_params = 'X'.
w_print-no_print_listinfos = 'X'.
*--->>> for display and print
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
EXPORTING
is_print = w_print. " print control info
*--->>>