Friday, January 13, 2017

Error in module RSQL of the database interface Example

I have declared one local structure as follows,

TYPES : BEGIN OF struct_mara,

               matnr    TYPE   mara-matnr,
               vpsta     TYPE  mara-vpsta,
               matkl     TYPE  mara-matkl,
               bismt     TYPE  mara-bismt,
               meins    TYPE  mara-meins,

END OF struct_mara.

I have declared an internal table and a work area for the corresponding structure as follows,

DATA : itab_mara TYPE STANDARD TABLE OF struct_mara,
            wa_mara LIKE LINE OF itab_mara.

now i have fetched data from MARA table into the internal table itab_mara

SELECT matnr vpsta matkl meins FROM mara INTO TABLE itab_mara
                                                UP TO 10 ROWS.

When we run the above select query, it will end up with a run-time error  Error in module RSQL of the database interface .

Reason for Runtime Error :
-----------------------------
In the STRUCTURE declaration bismt field is there in 4th position but where as in the select query meins field is there in 4th position. Because of this field mismatch we are getting this runtime error.

Solution 1:
-----------
SELECT matnr vpsta matkl meins FROM mara INTO CORRESPONDIG FIELDS OF TABLE itab_mara
                                                UP TO 10 ROWS.

   As per performance issue we are not suppose to use CORRESPONDIG FILEDS keyword.

Solution 2:
------------
TYPES : BEGIN OF struct_mara,

               matnr    TYPE   mara-matnr,
               vpsta     TYPE  mara-vpsta,
               matkl     TYPE  mara-matkl,
               meins    TYPE  mara-meins,
               bismt     TYPE  mara-bismt,
             

END OF struct_mara.

As per the SELECT query fields sequence ,declare the fields inside the structure.
If you need additional fields in the internal table which are not there in select query but you need those for future purpose, in that case declare those fields after SELECT query fields sequence like bismt field which is shown above.


Saturday, January 7, 2017

how to use the BADI checks on tcode SU01 in SAP


What is BADI?

badi : Business add-ins are enhancements to the standard version of the SAP system. They can be inserted into the SAP System to accommodate user requirements too specific to be included in the standard delivery. Since specific industries often require special functions, SAP allows you to predefine these points in your software.

You can differentiate between single-use and multiple use Business Add-Ins. The distinction is based on the procedure or event character of an enhancement. In the first case, the program waits for the enhancement to return something, usually a return code. A typical example could be a benefit calculation in HR. Depending on the implementation, alternative calculations can be executed. With multiple use add-ins, an event that may be of interest to other components is processed in program flow. Any number of components could use this event as a “hook” to hang their own additional actions on to.

In addition to importing parameters, you can also use changing parameters for multiple-use Business Add-Ins. There is no sequence control for multiple-use implementations of BadIs. Therefore, using changing parameters can cause problems. There is no guarantee that implementations will not overwrite the results of previous implementations. Sequence control is technically impossible, since at the time of the definition the interface does not know which implementations there will be and which parameters will be changed by implementations. It is not possible to have a decision as to which implementation should be executed before which other (future) implementation.


Example related to SAP BADI

To validate the roles during change or create of user master data in SU01, BADI à
BADI_IDENTITY_CHECK can be implemented. Importing Parameter IO_BADI_MSG_BUFFER can be usedto add the error message and this error message will be displayed during save. We can display pop to the
user asking to enter the comments in case of any conflicts in the user roles.


Enhancement spot   SUID_IDENTITY

GoTo SE19.
Enter enhancement spot
click on create impl.






Sunday, January 1, 2017

Error in module RSQL of the database interface

DATA var_sum type n LENGTH 3.



SELECT sum( col ) from ztable INTO  var_sum
  WHERE (filter condition).


Here in above query i try to store the sum of col into a variable of type numc.Due to this i got the error (Error in module RSQL of the database interface).


Solution in this case :
DATA var_sum TYPE i.


FOR more details with example Click HERE

how to hide an ui element in web dynpro

Declare one Attribute in Context node(under CONTEXT tab of view or CONTEXT tab of COMPONENT CONTROLLER) which is of type WDUI_VISIBILITY.
Now bind the above declared attribute with the VALUE property of your UI element(Which element you want to hide).

Now By using CODE wizard ... select the SET radio button and then choose the attribute which is created in Context node...it will generate some predefined code which is shown below.

For Ex:
node->set_attribute(
------
value = lv_attribute
).



Visibility Criteria:


If you want to hide the UI element use
lv_attribute = 01.  (value for hiding)


If you want to show the UI element use
lv_attribute = 02. (value to show UI element) .

You can use this procedure based on button clicks; Like, On click of BUTTON you can display some text elements or I/O fields etc....

Happy New Year - 2017

Bill Gates
----------
1.Don't Compare yourself with anyone in this World. If YOU do so , you are insulting yourself.

2.If you BORN poor it's not your mistake , If you DIE poor it's your mistake.

3.When you have MONEY in hand only you forget who  are you , BUT when you don't have any money in your hand , the whole world forget who you are. IT'S LIFE!...


Abdul Kalam
-----------------

1.Success is when your 'SIGNATURE' changes to 'AUTOGRAPH'.

2.Man need his difficulties because they are necessary to enjoy SUCCESS.

3.DREAM is not that which you see while SLEEPING, it is something that does not let you SLEEP.