Wednesday, February 10, 2016

some code

Getting Runtime
GET RUN TIME FIELD var_start.
PERFORM f_calculation.
GET RUN TIME FIELD var_end.
var_diff = var_end - var_start.
* Declare var_start.var_end as type 'i'. var_start would be 0 initially.


Getting the -ve number to the starting
var_csign TYPE /BIC/OITDATASOU .
CLEAR:var_csign.
var_csign = var_tranamt.
SEARCH var_csign FOR ‘-‘.
IF sy-subrc EQ 0 AND sy-fdpos NE 0.
SPLIT var_csign AT ‘-‘ INTO var_csign var_sign.
CONDENSE var_csign.
CONCATENATE ‘-‘ var_csign INTO var_csign.
ELSE.
CONDENSE var_csign.
ENDIF.
Notes: Change the datatype to CHAR

Hash Table
DATA :int_target TYPE HASHED TABLE OF y_target
WITH UNIQUE KEY
COMPANYCODE
CCTXTLG
ACCOUNT
ATXTLG
ERPID
ICP
ICPTXTLG
TRANSCURR
DATASOU
LCURR,
wa_target TYPE y_target. * Moving values to Hash Table to use Collect.
LOOP AT it_target INTO ls_target CLEAR:wa_target.
MOVE-CORRESPONDING ls_target TO wa_target.

Moving Field Symbol value to variable
data f1(4) value ‘ABC’.
DATA: v_val TYPE char4 VALUE ‘XYZA’.
field-symbols <f>.
assign f1 to <f>.

write<f>.
<f> = ‘ABD’.

Getting Source System
SOURCE_SYSTEM  = p_r_request->get_logsys( ).

Enabling/Disabling 3.X content
we made the value of one of the filed blank in RSADMINC table Value of field RSAWBN_HIDE_FUNC = ‘X’ in the table rsadminc table we made the value blank for that field this will enable the 3.x functionality

F4 Help code

INITIALIZATION.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_obj-low.
  PERFORM f_help_object_class CHANGING s_obj.


*&---------------------------------------------------------------------*
*&      Form  F_HELP_OBJECT_CLASS
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      <--P_P_OBJ  text
*----------------------------------------------------------------------*
FORM F_HELP_OBJECT_CLASS  CHANGING P_OBJ. " no definition of p_obj is required

TYPES : BEGIN OF ty_tab,
        object TYPE CDOBJECTCL,
        obtext TYPE CDOBTEXT,
        END OF ty_tab.

DATA : lt_tab TYPE STANDARD TABLE OF ty_tab,
       lt_ret TYPE STANDARD TABLE OF DDSHRETVAL,
       lw_ret TYPE DDSHRETVAL.


"" Here lt_tab is the data you want to see in the output of the F4 help. It is populated using a select statement.
            lt_ret is the standard table used for the FM

SELECT OBJECT OBTEXT from TCDOBT
              INTO TABLE lt_tab
             WHERE spras = 'EN'.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
  EXPORTING
*   DDIC_STRUCTURE         = ' '
    RETFIELD               = 'OBJECT'    " This is the field name defined in the internal table you want to see in the output.
    VALUE_ORG              = 'S'           " This is standard. 'C' or 'S' can be used. C didnot work.So 'S' :P
* IMPORTING
*   USER_RESET             =
  TABLES
    VALUE_TAB              = lt_tab
    RETURN_TAB             = lt_ret
 EXCEPTIONS
   PARAMETER_ERROR        = 1
   NO_VALUES_FOUND        = 2
   OTHERS                 = 3
          .

IF SY-SUBRC EQ 0.
  READ TABLE lt_ret INTO lw_ret INDEX 1. " Index 1 is the data row you have selected once the pop up for the F4 help opens. The selected value is present in 'fieldval' field
  p_obj = lw_ret-fieldval.
ENDIF.


ENDFORM.                    " F_HELP_OBJECT_CLASS


Monday, February 8, 2016

Equipment

Tables
EQUI


Tcode
IE01/02/03


Notes 
When initializing 0equipment_attr, it needs to be 'Initialize WITH data transfer' - if it is WITHOUT, the delta will not be set in RSA7. The entry can seen, but no pointer value is present.

Enabling Delta for 0Equipment

In earlier versions,  0Equipment_Attr and 0Equipment_Text are not delta enabled by default.
Below Notes help in enabling them

2007055 - Delta for BW Extractor 0EQUIPMENT_ATTR
2007893 - Delta for BW Extractor 0EQUIPMENT_TEXT


Common Issues/Points to Remember


  • Infopackage Failures / Initialization Errors
    • Refer to this LINK

APD Related Errors

APD Lines missing in BW
This is due to SAP GUI update to 7.4. Refer SAP notes 2227956 ( did not work for me )


PSA Related Errors

PSA Deletion : Invalid DataStore object name /BIC/BXXX: Reason: No valid entry in table RSTS
Take the /BIC/ table name and open in SE11. Look for the datasource name in the description of the table and activate the datasource.

Bex Errors

When running analyzer, " Field symbol has not been assigned " 
The query does not throw any error but when analyzer is run, you get the field symbol error. There might be various reasons for this error , but in my case, the query I was working with had more than 50 fields as drill down and the query was not able to display it. Once the number of columns are reduced the error got away.
When running in RSRT, instead of using 'ABAP BICS' in the drop down for query display use LIST and run it. It will give you the message "  AMaximum number (50) of drilldown characteristics is exceeded" This is in my case.

Master Data Related Errors

Attributes of characteristic ZMASTER are locked by terminated change run 983212345
Lock NOT set for: Loading master data attributes
In Tcode : CHANGERUNMONI, you can see the status of the change run . 
Get the ID from there and run FM 'RSDDS_AGGR_MOD_CLOSE' to close/cancel the run.


Process Chain Related

Process Chain Triggering not triggering from event
When triggering process chain with event, the PC should be triggered manually first. this will schedule the chain for the run. Without that, even though the event is triggered, the process chain will run.

 Transport Errors

Start of the after-import method RS_TRFN_AFTER_IMPORT for object type(s) TRFN ( )
No mapping in RSLOGSYSMAP for source system <source system name>
Whenever there is a new source system mapping being added to the system, eg: a new source connection in UD Connect, entry needs to be maintained in table RSLOGSYSMAP. Once the entry is maintained, re-import the transport and it will go fine.

Error when creating transfer structure /BIC/CCQD0MATERIAL_ATTR in source system QECC100
Error when activating DataSource 0MATERIAL_ATTR QECC100
Error when creating transfer structure /BIC/CCQD0MATERIAL_ATTR in source system QECC100
Error when resetting DataSource 0MATERIAL_ATTR QECC100 to the active version
Install SAP Note 2524663 which actually needs implementation of Note 2214733. 
This note would create a new program ''RS_SCRSYSTEM_R3_CHECK' in the source system.
Run the program which in check mode 'NO_DB_UP = 'X'' and it will show you the inconsistent datasources.
Run the program with  'NO_DB_UP = ' ' and this would correct the datasources.
Re-import the transport and it should be fine.
This error might also occur when activating the datasource in BW system.

Transport fails in ChaRM with error "requests do not match the component version of the target system"
This is due to component mismatch in the system. (System - Staus - Product Version )
Refer SAP Note 1848094.
In the Options tab, click 'Ignore Invalid Component Version' option and import the transport.

DSO Related Errors

Values like Amounts, Quantities disappear after activation
If the fields are being populated in routines, then they must be make INITIAL in the transformation. Else. the values will not be updated in the DSO.


ECC Errors related to BW

V3 Jobs failure : Internal session terminated with a runtime error MESSAGE_TYPE_X
This can be because the LIS structure was changed, where there are entries present in LBWQ. The only way is to delete LBWQ entries and re-run the V3 job. Deleting LBWQ entries result in missing delta entries.
So whenever this is done, a FULL load needs to be done.


Struct. from appl. 03 due to open V3 proc. not changed -> Long text 
When adding new fields to the extractor, you might get the error.
This is because there are some unprocessed V3 entries or failed jobs which locked the structure. Check with ECC team for this or check SM13.
This mostly occurs in development ( as prod systems donot have failed jobs hanging around long). Once the locks are deleted, you can change the strucuture and the transport also goes fine between systems.

ABAP Programming Errors

The column name "MATNR" is ambiguous ABAP/4 Open SQL statement.
This occurs when using joins in a select statement.
This means that when using joins in select statement, same field is present in more than one table being used. If you are using a prefix for each table involved , you do not see this error. Else, use prefix '~' to mention which take the field needs to be read. 

SM30 Jobs running Long

Jobs are running very long.
There are many reasons for that . Some of the areas to check are listed below.
Check if there are any locks on table BALDAT.

Saturday, February 6, 2016

Material


There are materials with different types of Special Stocks.

Special Stock with Customer
Any material which is at customer end will fall under this. The quantities are saved in table MSKU.
SOBKZ = 'W'


Special Stock with Vendor
Materials/ inventory consigned to a vendor. They are saved in MSLB and MSSL.
SOBKZ = 'O'

Related Tcodes 
MB59

Related Notes
Stock Tables and Types : LINK

Datasource
0MATERIAL_ATTR/TEXT             Material Number
0MAT_PLANT_ATTR/TEXT          Material Number with Plant
0MAT_SALES_ATTR/TEXT          Material number with sales
0MAT_ST_LOC_ATTR                   Material Number Compounded to Plant and Storage Location

T-Codes :
MM01/2/3

Tables : 
MARA,MARC,MARD

0MAT_PLANT_ATTR/TEXT
  • This is Plant Data for Material.
  • Base table for this datasource is MARC
  • In MM03, there is tab which says 'Plant Stock'. Most of the fields from this datasource are present there.
  • Delta  : Create date/Change data in MARA table ( I guess ).

0MAT_ST_LOC_ATTR/TEXT
  • This is Storage Location Data for Material.
  • Base table for this datasource is MARD
  • In MM03, there is tab which says 'St.Loc Stock'. Most of the fields from this datasource are present there.
  • Delta  : Create date/Change data in MARA table ( I guess ).
0MAT_SALES_ATTR
  • This is Sales Data for Material. It is company code ( Sales Organization ) level.
  • Base table for this datasource is MVKE.
  • MM03 - Sales Org Tab