Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding : Lock Object ,Sapscript & BDC

Former Member
0 Kudos

hai this is Umesh,

My Query :

1.Can any one tell me how the lock objects

exclusive not cumulative works ?

2.I am Unable to display amount in words in

sapscript?

3.Source code for Error Handling in Call transaction?

5 REPLIES 5

sbhutani1
Contributor
0 Kudos

Hi sn,

follow these links

for lock objects

www.sap-img.com/abap/ type-and-uses-of-lock-objects-in-sap.htm

for Call transaction

www.sap-img.com/abap/question-about-bdc-program.htm

former_member181962
Active Contributor
0 Kudos

2) Use the function module : SPELL_AMOUNT to write the amount in words.

3) Immediately after call transaction,

check for sy-subrc <> 0.

and call the fm 'FORMAT_MESSAGE'.

data: i_return type standard table of bdcmsgcoll.

call transaction.....messages into i_return.

if sy-subrc <> 0.

loop at i_return.

CALL FUNCTION 'FORMAT_MESSAGE'

EXPORTING

ID = i_return-id

LANG = sy-langu

NO = i_return-number

V1 = i_return-MESSAGE_V1

V2 = i_return-MESSAGE_V2

V3 = i_return-MESSAGE_V3

V4 = i_return-MESSAGE_V4

IMPORTING

MSG = l_message

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2

.

check sy-subrc = 0.

write: / l_message.

endloop.

endif.

REgards,

Ravi

Former Member
0 Kudos

HI

GOOD

1- CAN YOU GIVE SOME CLEAR IDEA ABOUT YOUR FIRST REQUIREMENT.

2-CAN YOU GIVE THE DETAILS LIKE HOW YOU R DISPLAYING THE AMOUNT VALUE.

3-

DATA : bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.

DATA : messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.

DATA : ws_mode type c.

ws_mode = 'N'.

call transaction 'F-32' using bdcdata mode ws_mode

messages into messtab.

*perform close_group.

&----


*& Form bdc_dynpro

&----


  • text

----


  • -->P_0015 text

  • -->P_0016 text

----


FORM bdc_dynpro USING program

dynpro.

CLEAR bdcdata.

bdcdata-program = program.

bdcdata-dynpro = dynpro.

bdcdata-dynbegin = 'X'.

APPEND bdcdata.

ENDFORM. " bdc_dynpro

&----


*& Form bdc_field

&----


  • text

----


  • -->P_0075 text

  • -->P_0076 text

----


FORM bdc_field USING fnam

fval.

DATA : nodata VALUE '\'.

IF fval <> nodata.

CLEAR bdcdata.

bdcdata-fnam = fnam.

bdcdata-fval = fval.

APPEND bdcdata.

ENDIF.

ENDFORM.

THANKS

MRUTYUN

Former Member
0 Kudos

hii

1)Lock Objects

In a system where many users can access the same data, it becomes necessary to control the access to the data. In R/3 system this access control is built-in on database tables. Developers can also lock objects over table records.

To lock an object you need to call standard functions, which are automatically generated while defining the lock object in ABAP/4 dictionary. This locking system is independent of the locking mechanism used by the R/3 system. This mechanism also defines LUW i.e. Logical Unit of Work. Whenever an object is locked, either by in built locking mechanism or by function modules, it creates corresponding entry in global system table i.e. table is locked. The system automatically releases the lock at the end of transaction. The LUW starts when a lock entry is created in the system table and ends when the lock is released.

Creating Lock Objects

Lock object is an aggregated dictionary object and can be defined by using the following steps:

o From initial data dictionary screen, enter the name for the object, Click Lock object radiobutton and then click on Create. The system displays a dialog box for Maintain Lock Objects screen

o Enter short text as usual and the name for primary table.

-Save

-Select Tables option

From this screen you can:

Select secondary tables, if any, linked by foreign key relationship.

Fields for the lock objects. This option allows you to select fields for objects (R/3 system allows locking up to record level). Lock object argument are not selected by user but are imposed by the system and includes all the primary keys for the table.

3) for error log

use function module 'FORMAT_MESSAGE' .

Thanks&Regards

Naresh

Former Member
0 Kudos

Hi umesh,

this is the documentation for lock modes from SAP.

Access by more than one user can be synchronized in the following ways:

1) Exclusive lock: The locked data can only be displayed or edited by a single user. A request for another exclusive lock or for a shared lock is rejected.

2) Shared lock: More than one user can access the locked data at the same time in display mode. A request for another shared lock is accepted, even if it comes from another user. An exclusive lock is rejected.

3) Exclusive but not cumulative: Exclusive locks can be requested several times from the same transaction and are processed successively. In contrast, exclusive but not cumulative locks can be called only once from the same transaction. All other lock requests are rejected.

Also, last but not the least, locking the object is <b>logical</b> (locking with any enqueue ) .so, you have to use the lock object while trying to access from second program .

Hope this will give you some insight into locking concept.

Regards,

Vicky

PS: Award points if helpful